ent

package
v1.65.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 35 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.
	TypeArchive       = "Archive"
	TypeCommitRow     = "CommitRow"
	TypeDamagedPath   = "DamagedPath"
	TypeDeletedRef    = "DeletedRef"
	TypeFile          = "File"
	TypeObject        = "Object"
	TypePin           = "Pin"
	TypeReindex       = "Reindex"
	TypeSession       = "Session"
	TypeSet           = "Set"
	TypeSetRef        = "SetRef"
	TypeSettings      = "Settings"
	TypeTree          = "Tree"
	TypeWalkedArchive = "WalkedArchive"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: 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(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Archive

type Archive struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// SessionID holds the value of the "session_id" field.
	SessionID *string `json:"session_id,omitempty"`
	// State holds the value of the "state" field.
	State int `json:"state,omitempty"`
	// OpenedAt holds the value of the "opened_at" field.
	OpenedAt *time.Time `json:"opened_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ArchiveQuery when eager-loading is set.
	Edges ArchiveEdges `json:"edges"`
	// contains filtered or unexported fields
}

Archive is the model entity for the Archive schema.

func (*Archive) ExecContext

func (c *Archive) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Archive) QueryContext

func (c *Archive) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Archive) QueryObjects

func (_m *Archive) QueryObjects() *ObjectQuery

QueryObjects queries the "objects" edge of the Archive entity.

func (*Archive) QuerySession

func (_m *Archive) QuerySession() *SessionQuery

QuerySession queries the "session" edge of the Archive entity.

func (*Archive) String

func (_m *Archive) String() string

String implements the fmt.Stringer.

func (*Archive) Unwrap

func (_m *Archive) Unwrap() *Archive

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

func (_m *Archive) Update() *ArchiveUpdateOne

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

func (*Archive) Value

func (_m *Archive) Value(name string) (ent.Value, error)

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

type ArchiveClient

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

ArchiveClient is a client for the Archive schema.

func NewArchiveClient

func NewArchiveClient(c config) *ArchiveClient

NewArchiveClient returns a client for the Archive from the given config.

func (*ArchiveClient) Create

func (c *ArchiveClient) Create() *ArchiveCreate

Create returns a builder for creating a Archive entity.

func (*ArchiveClient) CreateBulk

func (c *ArchiveClient) CreateBulk(builders ...*ArchiveCreate) *ArchiveCreateBulk

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

func (*ArchiveClient) Delete

func (c *ArchiveClient) Delete() *ArchiveDelete

Delete returns a delete builder for Archive.

func (*ArchiveClient) DeleteOne

func (c *ArchiveClient) DeleteOne(_m *Archive) *ArchiveDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ArchiveClient) DeleteOneID

func (c *ArchiveClient) DeleteOneID(id string) *ArchiveDeleteOne

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

func (*ArchiveClient) ExecContext

func (c *ArchiveClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveClient) Get

func (c *ArchiveClient) Get(ctx context.Context, id string) (*Archive, error)

Get returns a Archive entity by its id.

func (*ArchiveClient) GetX

func (c *ArchiveClient) GetX(ctx context.Context, id string) *Archive

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

func (*ArchiveClient) Hooks

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

Hooks returns the client hooks.

func (*ArchiveClient) Intercept

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

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

func (*ArchiveClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ArchiveClient) MapCreateBulk

func (c *ArchiveClient) MapCreateBulk(slice any, setFunc func(*ArchiveCreate, int)) *ArchiveCreateBulk

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 (*ArchiveClient) Query

func (c *ArchiveClient) Query() *ArchiveQuery

Query returns a query builder for Archive.

func (*ArchiveClient) QueryContext

func (c *ArchiveClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveClient) QueryObjects

func (c *ArchiveClient) QueryObjects(_m *Archive) *ObjectQuery

QueryObjects queries the objects edge of a Archive.

func (*ArchiveClient) QuerySession

func (c *ArchiveClient) QuerySession(_m *Archive) *SessionQuery

QuerySession queries the session edge of a Archive.

func (*ArchiveClient) Update

func (c *ArchiveClient) Update() *ArchiveUpdate

Update returns an update builder for Archive.

func (*ArchiveClient) UpdateOne

func (c *ArchiveClient) UpdateOne(_m *Archive) *ArchiveUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ArchiveClient) UpdateOneID

func (c *ArchiveClient) UpdateOneID(id string) *ArchiveUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ArchiveClient) Use

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

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

type ArchiveCreate

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

ArchiveCreate is the builder for creating a Archive entity.

func (*ArchiveCreate) AddObjectIDs

func (_c *ArchiveCreate) AddObjectIDs(ids ...int) *ArchiveCreate

AddObjectIDs adds the "objects" edge to the Object entity by IDs.

func (*ArchiveCreate) AddObjects

func (_c *ArchiveCreate) AddObjects(v ...*Object) *ArchiveCreate

AddObjects adds the "objects" edges to the Object entity.

func (*ArchiveCreate) Exec

func (_c *ArchiveCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ArchiveCreate) ExecContext

func (c *ArchiveCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveCreate) ExecX

func (_c *ArchiveCreate) ExecX(ctx context.Context)

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

func (*ArchiveCreate) Mutation

func (_c *ArchiveCreate) Mutation() *ArchiveMutation

Mutation returns the ArchiveMutation object of the builder.

func (*ArchiveCreate) OnConflict

func (_c *ArchiveCreate) OnConflict(opts ...sql.ConflictOption) *ArchiveUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Archive.Create().
	SetSessionID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ArchiveUpsert) {
		SetSessionID(v+v).
	}).
	Exec(ctx)

func (*ArchiveCreate) OnConflictColumns

func (_c *ArchiveCreate) OnConflictColumns(columns ...string) *ArchiveUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Archive.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ArchiveCreate) QueryContext

func (c *ArchiveCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveCreate) Save

func (_c *ArchiveCreate) Save(ctx context.Context) (*Archive, error)

Save creates the Archive in the database.

func (*ArchiveCreate) SaveX

func (_c *ArchiveCreate) SaveX(ctx context.Context) *Archive

SaveX calls Save and panics if Save returns an error.

func (*ArchiveCreate) SetCreatedAt

func (_c *ArchiveCreate) SetCreatedAt(v time.Time) *ArchiveCreate

SetCreatedAt sets the "created_at" field.

func (*ArchiveCreate) SetID

func (_c *ArchiveCreate) SetID(v string) *ArchiveCreate

SetID sets the "id" field.

func (*ArchiveCreate) SetNillableCreatedAt

func (_c *ArchiveCreate) SetNillableCreatedAt(v *time.Time) *ArchiveCreate

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

func (*ArchiveCreate) SetNillableOpenedAt

func (_c *ArchiveCreate) SetNillableOpenedAt(v *time.Time) *ArchiveCreate

SetNillableOpenedAt sets the "opened_at" field if the given value is not nil.

func (*ArchiveCreate) SetNillableSessionID

func (_c *ArchiveCreate) SetNillableSessionID(v *string) *ArchiveCreate

SetNillableSessionID sets the "session_id" field if the given value is not nil.

func (*ArchiveCreate) SetNillableState

func (_c *ArchiveCreate) SetNillableState(v *int) *ArchiveCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*ArchiveCreate) SetOpenedAt

func (_c *ArchiveCreate) SetOpenedAt(v time.Time) *ArchiveCreate

SetOpenedAt sets the "opened_at" field.

func (*ArchiveCreate) SetSession

func (_c *ArchiveCreate) SetSession(v *Session) *ArchiveCreate

SetSession sets the "session" edge to the Session entity.

func (*ArchiveCreate) SetSessionID

func (_c *ArchiveCreate) SetSessionID(v string) *ArchiveCreate

SetSessionID sets the "session_id" field.

func (*ArchiveCreate) SetState

func (_c *ArchiveCreate) SetState(v int) *ArchiveCreate

SetState sets the "state" field.

type ArchiveCreateBulk

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

ArchiveCreateBulk is the builder for creating many Archive entities in bulk.

func (*ArchiveCreateBulk) Exec

func (_c *ArchiveCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ArchiveCreateBulk) ExecContext

func (c *ArchiveCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveCreateBulk) ExecX

func (_c *ArchiveCreateBulk) ExecX(ctx context.Context)

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

func (*ArchiveCreateBulk) OnConflict

func (_c *ArchiveCreateBulk) OnConflict(opts ...sql.ConflictOption) *ArchiveUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Archive.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ArchiveUpsert) {
		SetSessionID(v+v).
	}).
	Exec(ctx)

func (*ArchiveCreateBulk) OnConflictColumns

func (_c *ArchiveCreateBulk) OnConflictColumns(columns ...string) *ArchiveUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Archive.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ArchiveCreateBulk) QueryContext

func (c *ArchiveCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveCreateBulk) Save

func (_c *ArchiveCreateBulk) Save(ctx context.Context) ([]*Archive, error)

Save creates the Archive entities in the database.

func (*ArchiveCreateBulk) SaveX

func (_c *ArchiveCreateBulk) SaveX(ctx context.Context) []*Archive

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

type ArchiveDelete

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

ArchiveDelete is the builder for deleting a Archive entity.

func (*ArchiveDelete) Exec

func (_d *ArchiveDelete) Exec(ctx context.Context) (int, error)

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

func (*ArchiveDelete) ExecContext

func (c *ArchiveDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveDelete) ExecX

func (_d *ArchiveDelete) ExecX(ctx context.Context) int

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

func (*ArchiveDelete) QueryContext

func (c *ArchiveDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveDelete) Where

func (_d *ArchiveDelete) Where(ps ...predicate.Archive) *ArchiveDelete

Where appends a list predicates to the ArchiveDelete builder.

type ArchiveDeleteOne

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

ArchiveDeleteOne is the builder for deleting a single Archive entity.

func (*ArchiveDeleteOne) Exec

func (_d *ArchiveDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ArchiveDeleteOne) ExecX

func (_d *ArchiveDeleteOne) ExecX(ctx context.Context)

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

func (*ArchiveDeleteOne) Where

Where appends a list predicates to the ArchiveDelete builder.

type ArchiveEdges

type ArchiveEdges struct {
	// Session holds the value of the session edge.
	Session *Session `json:"session,omitempty"`
	// Objects holds the value of the objects edge.
	Objects []*Object `json:"objects,omitempty"`
	// contains filtered or unexported fields
}

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

func (ArchiveEdges) ObjectsOrErr

func (e ArchiveEdges) ObjectsOrErr() ([]*Object, error)

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

func (ArchiveEdges) SessionOrErr

func (e ArchiveEdges) SessionOrErr() (*Session, error)

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

type ArchiveGroupBy

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

ArchiveGroupBy is the group-by builder for Archive entities.

func (*ArchiveGroupBy) Aggregate

func (_g *ArchiveGroupBy) Aggregate(fns ...AggregateFunc) *ArchiveGroupBy

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

func (*ArchiveGroupBy) Bool

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

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

func (*ArchiveGroupBy) BoolX

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

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

func (*ArchiveGroupBy) Bools

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

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

func (*ArchiveGroupBy) BoolsX

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

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

func (*ArchiveGroupBy) Float64

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

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

func (*ArchiveGroupBy) Float64X

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

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

func (*ArchiveGroupBy) Float64s

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

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

func (*ArchiveGroupBy) Float64sX

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

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

func (*ArchiveGroupBy) Int

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

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

func (*ArchiveGroupBy) IntX

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

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

func (*ArchiveGroupBy) Ints

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

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

func (*ArchiveGroupBy) IntsX

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

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

func (*ArchiveGroupBy) Scan

func (_g *ArchiveGroupBy) Scan(ctx context.Context, v any) error

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

func (*ArchiveGroupBy) ScanX

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

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

func (*ArchiveGroupBy) String

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

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

func (*ArchiveGroupBy) StringX

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

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

func (*ArchiveGroupBy) Strings

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

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

func (*ArchiveGroupBy) StringsX

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

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

type ArchiveMutation

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

ArchiveMutation represents an operation that mutates the Archive nodes in the graph.

func (*ArchiveMutation) AddField

func (m *ArchiveMutation) 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 (*ArchiveMutation) AddObjectIDs

func (m *ArchiveMutation) AddObjectIDs(ids ...int)

AddObjectIDs adds the "objects" edge to the Object entity by ids.

func (*ArchiveMutation) AddState

func (m *ArchiveMutation) AddState(i int)

AddState adds i to the "state" field.

func (*ArchiveMutation) AddedEdges

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

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

func (*ArchiveMutation) AddedField

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

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

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

func (*ArchiveMutation) AddedIDs

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

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

func (*ArchiveMutation) AddedState

func (m *ArchiveMutation) AddedState() (r int, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*ArchiveMutation) ClearCreatedAt

func (m *ArchiveMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*ArchiveMutation) ClearEdge

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

func (m *ArchiveMutation) 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 (*ArchiveMutation) ClearObjects

func (m *ArchiveMutation) ClearObjects()

ClearObjects clears the "objects" edge to the Object entity.

func (*ArchiveMutation) ClearOpenedAt

func (m *ArchiveMutation) ClearOpenedAt()

ClearOpenedAt clears the value of the "opened_at" field.

func (*ArchiveMutation) ClearSession

func (m *ArchiveMutation) ClearSession()

ClearSession clears the "session" edge to the Session entity.

func (*ArchiveMutation) ClearSessionID

func (m *ArchiveMutation) ClearSessionID()

ClearSessionID clears the value of the "session_id" field.

func (*ArchiveMutation) ClearedEdges

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

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

func (*ArchiveMutation) ClearedFields

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

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

func (ArchiveMutation) Client

func (m ArchiveMutation) 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 (*ArchiveMutation) CreatedAt

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

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

func (*ArchiveMutation) CreatedAtCleared

func (m *ArchiveMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*ArchiveMutation) EdgeCleared

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

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

func (*ArchiveMutation) ExecContext

func (c *ArchiveMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveMutation) Field

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

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

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

func (*ArchiveMutation) Fields

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

func (m *ArchiveMutation) ID() (id string, exists bool)

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

func (*ArchiveMutation) IDs

func (m *ArchiveMutation) IDs(ctx context.Context) ([]string, error)

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

func (*ArchiveMutation) ObjectsCleared

func (m *ArchiveMutation) ObjectsCleared() bool

ObjectsCleared reports if the "objects" edge to the Object entity was cleared.

func (*ArchiveMutation) ObjectsIDs

func (m *ArchiveMutation) ObjectsIDs() (ids []int)

ObjectsIDs returns the "objects" edge IDs in the mutation.

func (*ArchiveMutation) OldCreatedAt

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

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

func (m *ArchiveMutation) 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 (*ArchiveMutation) OldOpenedAt

func (m *ArchiveMutation) OldOpenedAt(ctx context.Context) (v *time.Time, err error)

OldOpenedAt returns the old "opened_at" field's value of the Archive entity. If the Archive 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 (*ArchiveMutation) OldSessionID

func (m *ArchiveMutation) OldSessionID(ctx context.Context) (v *string, err error)

OldSessionID returns the old "session_id" field's value of the Archive entity. If the Archive 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 (*ArchiveMutation) OldState

func (m *ArchiveMutation) OldState(ctx context.Context) (v int, err error)

OldState returns the old "state" field's value of the Archive entity. If the Archive 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 (*ArchiveMutation) Op

func (m *ArchiveMutation) Op() Op

Op returns the operation name.

func (*ArchiveMutation) OpenedAt

func (m *ArchiveMutation) OpenedAt() (r time.Time, exists bool)

OpenedAt returns the value of the "opened_at" field in the mutation.

func (*ArchiveMutation) OpenedAtCleared

func (m *ArchiveMutation) OpenedAtCleared() bool

OpenedAtCleared returns if the "opened_at" field was cleared in this mutation.

func (*ArchiveMutation) QueryContext

func (c *ArchiveMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveMutation) RemoveObjectIDs

func (m *ArchiveMutation) RemoveObjectIDs(ids ...int)

RemoveObjectIDs removes the "objects" edge to the Object entity by IDs.

func (*ArchiveMutation) RemovedEdges

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

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

func (*ArchiveMutation) RemovedIDs

func (m *ArchiveMutation) 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 (*ArchiveMutation) RemovedObjectsIDs

func (m *ArchiveMutation) RemovedObjectsIDs() (ids []int)

RemovedObjects returns the removed IDs of the "objects" edge to the Object entity.

func (*ArchiveMutation) ResetCreatedAt

func (m *ArchiveMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ArchiveMutation) ResetEdge

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

func (m *ArchiveMutation) 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 (*ArchiveMutation) ResetObjects

func (m *ArchiveMutation) ResetObjects()

ResetObjects resets all changes to the "objects" edge.

func (*ArchiveMutation) ResetOpenedAt

func (m *ArchiveMutation) ResetOpenedAt()

ResetOpenedAt resets all changes to the "opened_at" field.

func (*ArchiveMutation) ResetSession

func (m *ArchiveMutation) ResetSession()

ResetSession resets all changes to the "session" edge.

func (*ArchiveMutation) ResetSessionID

func (m *ArchiveMutation) ResetSessionID()

ResetSessionID resets all changes to the "session_id" field.

func (*ArchiveMutation) ResetState

func (m *ArchiveMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*ArchiveMutation) SessionCleared

func (m *ArchiveMutation) SessionCleared() bool

SessionCleared reports if the "session" edge to the Session entity was cleared.

func (*ArchiveMutation) SessionID

func (m *ArchiveMutation) SessionID() (r string, exists bool)

SessionID returns the value of the "session_id" field in the mutation.

func (*ArchiveMutation) SessionIDCleared

func (m *ArchiveMutation) SessionIDCleared() bool

SessionIDCleared returns if the "session_id" field was cleared in this mutation.

func (*ArchiveMutation) SessionIDs

func (m *ArchiveMutation) SessionIDs() (ids []string)

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

func (*ArchiveMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ArchiveMutation) SetField

func (m *ArchiveMutation) 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 (*ArchiveMutation) SetID

func (m *ArchiveMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Archive entities.

func (*ArchiveMutation) SetOp

func (m *ArchiveMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ArchiveMutation) SetOpenedAt

func (m *ArchiveMutation) SetOpenedAt(t time.Time)

SetOpenedAt sets the "opened_at" field.

func (*ArchiveMutation) SetSessionID

func (m *ArchiveMutation) SetSessionID(s string)

SetSessionID sets the "session_id" field.

func (*ArchiveMutation) SetState

func (m *ArchiveMutation) SetState(i int)

SetState sets the "state" field.

func (*ArchiveMutation) State

func (m *ArchiveMutation) State() (r int, exists bool)

State returns the value of the "state" field in the mutation.

func (ArchiveMutation) Tx

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

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

func (*ArchiveMutation) Type

func (m *ArchiveMutation) Type() string

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

func (*ArchiveMutation) Where

func (m *ArchiveMutation) Where(ps ...predicate.Archive)

Where appends a list predicates to the ArchiveMutation builder.

func (*ArchiveMutation) WhereP

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

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

type ArchiveQuery

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

ArchiveQuery is the builder for querying Archive entities.

func (*ArchiveQuery) Aggregate

func (_q *ArchiveQuery) Aggregate(fns ...AggregateFunc) *ArchiveSelect

Aggregate returns a ArchiveSelect configured with the given aggregations.

func (*ArchiveQuery) All

func (_q *ArchiveQuery) All(ctx context.Context) ([]*Archive, error)

All executes the query and returns a list of Archives.

func (*ArchiveQuery) AllX

func (_q *ArchiveQuery) AllX(ctx context.Context) []*Archive

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

func (*ArchiveQuery) Clone

func (_q *ArchiveQuery) Clone() *ArchiveQuery

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

func (*ArchiveQuery) Count

func (_q *ArchiveQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ArchiveQuery) CountX

func (_q *ArchiveQuery) CountX(ctx context.Context) int

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

func (*ArchiveQuery) ExecContext

func (c *ArchiveQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveQuery) Exist

func (_q *ArchiveQuery) Exist(ctx context.Context) (bool, error)

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

func (*ArchiveQuery) ExistX

func (_q *ArchiveQuery) ExistX(ctx context.Context) bool

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

func (*ArchiveQuery) First

func (_q *ArchiveQuery) First(ctx context.Context) (*Archive, error)

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

func (*ArchiveQuery) FirstID

func (_q *ArchiveQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*ArchiveQuery) FirstIDX

func (_q *ArchiveQuery) FirstIDX(ctx context.Context) string

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

func (*ArchiveQuery) FirstX

func (_q *ArchiveQuery) FirstX(ctx context.Context) *Archive

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

func (*ArchiveQuery) ForShare

func (_q *ArchiveQuery) ForShare(opts ...sql.LockOption) *ArchiveQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ArchiveQuery) ForUpdate

func (_q *ArchiveQuery) ForUpdate(opts ...sql.LockOption) *ArchiveQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ArchiveQuery) GroupBy

func (_q *ArchiveQuery) GroupBy(field string, fields ...string) *ArchiveGroupBy

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

client.Archive.Query().
	GroupBy(archive.FieldSessionID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ArchiveQuery) IDs

func (_q *ArchiveQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*ArchiveQuery) IDsX

func (_q *ArchiveQuery) IDsX(ctx context.Context) []string

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

func (*ArchiveQuery) Limit

func (_q *ArchiveQuery) Limit(limit int) *ArchiveQuery

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

func (*ArchiveQuery) Offset

func (_q *ArchiveQuery) Offset(offset int) *ArchiveQuery

Offset to start from.

func (*ArchiveQuery) Only

func (_q *ArchiveQuery) Only(ctx context.Context) (*Archive, error)

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

func (*ArchiveQuery) OnlyID

func (_q *ArchiveQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*ArchiveQuery) OnlyIDX

func (_q *ArchiveQuery) OnlyIDX(ctx context.Context) string

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

func (*ArchiveQuery) OnlyX

func (_q *ArchiveQuery) OnlyX(ctx context.Context) *Archive

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

func (*ArchiveQuery) Order

func (_q *ArchiveQuery) Order(o ...archive.OrderOption) *ArchiveQuery

Order specifies how the records should be ordered.

func (*ArchiveQuery) QueryContext

func (c *ArchiveQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveQuery) QueryObjects

func (_q *ArchiveQuery) QueryObjects() *ObjectQuery

QueryObjects chains the current query on the "objects" edge.

func (*ArchiveQuery) QuerySession

func (_q *ArchiveQuery) QuerySession() *SessionQuery

QuerySession chains the current query on the "session" edge.

func (*ArchiveQuery) Select

func (_q *ArchiveQuery) Select(fields ...string) *ArchiveSelect

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

client.Archive.Query().
	Select(archive.FieldSessionID).
	Scan(ctx, &v)

func (*ArchiveQuery) Unique

func (_q *ArchiveQuery) Unique(unique bool) *ArchiveQuery

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

func (_q *ArchiveQuery) Where(ps ...predicate.Archive) *ArchiveQuery

Where adds a new predicate for the ArchiveQuery builder.

func (*ArchiveQuery) WithObjects

func (_q *ArchiveQuery) WithObjects(opts ...func(*ObjectQuery)) *ArchiveQuery

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

func (*ArchiveQuery) WithSession

func (_q *ArchiveQuery) WithSession(opts ...func(*SessionQuery)) *ArchiveQuery

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

type ArchiveSelect

type ArchiveSelect struct {
	*ArchiveQuery
	// contains filtered or unexported fields
}

ArchiveSelect is the builder for selecting fields of Archive entities.

func (*ArchiveSelect) Aggregate

func (_s *ArchiveSelect) Aggregate(fns ...AggregateFunc) *ArchiveSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ArchiveSelect) Bool

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

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

func (*ArchiveSelect) BoolX

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

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

func (*ArchiveSelect) Bools

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

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

func (*ArchiveSelect) BoolsX

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

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

func (ArchiveSelect) ExecContext

func (c ArchiveSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveSelect) Float64

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

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

func (*ArchiveSelect) Float64X

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

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

func (*ArchiveSelect) Float64s

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

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

func (*ArchiveSelect) Float64sX

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

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

func (*ArchiveSelect) Int

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

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

func (*ArchiveSelect) IntX

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

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

func (*ArchiveSelect) Ints

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

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

func (*ArchiveSelect) IntsX

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

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

func (ArchiveSelect) QueryContext

func (c ArchiveSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveSelect) Scan

func (_s *ArchiveSelect) Scan(ctx context.Context, v any) error

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

func (*ArchiveSelect) ScanX

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

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

func (*ArchiveSelect) String

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

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

func (*ArchiveSelect) StringX

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

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

func (*ArchiveSelect) Strings

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

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

func (*ArchiveSelect) StringsX

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

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

type ArchiveUpdate

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

ArchiveUpdate is the builder for updating Archive entities.

func (*ArchiveUpdate) AddObjectIDs

func (_u *ArchiveUpdate) AddObjectIDs(ids ...int) *ArchiveUpdate

AddObjectIDs adds the "objects" edge to the Object entity by IDs.

func (*ArchiveUpdate) AddObjects

func (_u *ArchiveUpdate) AddObjects(v ...*Object) *ArchiveUpdate

AddObjects adds the "objects" edges to the Object entity.

func (*ArchiveUpdate) AddState

func (_u *ArchiveUpdate) AddState(v int) *ArchiveUpdate

AddState adds value to the "state" field.

func (*ArchiveUpdate) ClearCreatedAt

func (_u *ArchiveUpdate) ClearCreatedAt() *ArchiveUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*ArchiveUpdate) ClearObjects

func (_u *ArchiveUpdate) ClearObjects() *ArchiveUpdate

ClearObjects clears all "objects" edges to the Object entity.

func (*ArchiveUpdate) ClearOpenedAt

func (_u *ArchiveUpdate) ClearOpenedAt() *ArchiveUpdate

ClearOpenedAt clears the value of the "opened_at" field.

func (*ArchiveUpdate) ClearSession

func (_u *ArchiveUpdate) ClearSession() *ArchiveUpdate

ClearSession clears the "session" edge to the Session entity.

func (*ArchiveUpdate) ClearSessionID

func (_u *ArchiveUpdate) ClearSessionID() *ArchiveUpdate

ClearSessionID clears the value of the "session_id" field.

func (*ArchiveUpdate) Exec

func (_u *ArchiveUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ArchiveUpdate) ExecContext

func (c *ArchiveUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveUpdate) ExecX

func (_u *ArchiveUpdate) ExecX(ctx context.Context)

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

func (*ArchiveUpdate) Mutation

func (_u *ArchiveUpdate) Mutation() *ArchiveMutation

Mutation returns the ArchiveMutation object of the builder.

func (*ArchiveUpdate) QueryContext

func (c *ArchiveUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveUpdate) RemoveObjectIDs

func (_u *ArchiveUpdate) RemoveObjectIDs(ids ...int) *ArchiveUpdate

RemoveObjectIDs removes the "objects" edge to Object entities by IDs.

func (*ArchiveUpdate) RemoveObjects

func (_u *ArchiveUpdate) RemoveObjects(v ...*Object) *ArchiveUpdate

RemoveObjects removes "objects" edges to Object entities.

func (*ArchiveUpdate) Save

func (_u *ArchiveUpdate) Save(ctx context.Context) (int, error)

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

func (*ArchiveUpdate) SaveX

func (_u *ArchiveUpdate) SaveX(ctx context.Context) int

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

func (*ArchiveUpdate) SetCreatedAt

func (_u *ArchiveUpdate) SetCreatedAt(v time.Time) *ArchiveUpdate

SetCreatedAt sets the "created_at" field.

func (*ArchiveUpdate) SetNillableCreatedAt

func (_u *ArchiveUpdate) SetNillableCreatedAt(v *time.Time) *ArchiveUpdate

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

func (*ArchiveUpdate) SetNillableOpenedAt

func (_u *ArchiveUpdate) SetNillableOpenedAt(v *time.Time) *ArchiveUpdate

SetNillableOpenedAt sets the "opened_at" field if the given value is not nil.

func (*ArchiveUpdate) SetNillableSessionID

func (_u *ArchiveUpdate) SetNillableSessionID(v *string) *ArchiveUpdate

SetNillableSessionID sets the "session_id" field if the given value is not nil.

func (*ArchiveUpdate) SetNillableState

func (_u *ArchiveUpdate) SetNillableState(v *int) *ArchiveUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*ArchiveUpdate) SetOpenedAt

func (_u *ArchiveUpdate) SetOpenedAt(v time.Time) *ArchiveUpdate

SetOpenedAt sets the "opened_at" field.

func (*ArchiveUpdate) SetSession

func (_u *ArchiveUpdate) SetSession(v *Session) *ArchiveUpdate

SetSession sets the "session" edge to the Session entity.

func (*ArchiveUpdate) SetSessionID

func (_u *ArchiveUpdate) SetSessionID(v string) *ArchiveUpdate

SetSessionID sets the "session_id" field.

func (*ArchiveUpdate) SetState

func (_u *ArchiveUpdate) SetState(v int) *ArchiveUpdate

SetState sets the "state" field.

func (*ArchiveUpdate) Where

func (_u *ArchiveUpdate) Where(ps ...predicate.Archive) *ArchiveUpdate

Where appends a list predicates to the ArchiveUpdate builder.

type ArchiveUpdateOne

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

ArchiveUpdateOne is the builder for updating a single Archive entity.

func (*ArchiveUpdateOne) AddObjectIDs

func (_u *ArchiveUpdateOne) AddObjectIDs(ids ...int) *ArchiveUpdateOne

AddObjectIDs adds the "objects" edge to the Object entity by IDs.

func (*ArchiveUpdateOne) AddObjects

func (_u *ArchiveUpdateOne) AddObjects(v ...*Object) *ArchiveUpdateOne

AddObjects adds the "objects" edges to the Object entity.

func (*ArchiveUpdateOne) AddState

func (_u *ArchiveUpdateOne) AddState(v int) *ArchiveUpdateOne

AddState adds value to the "state" field.

func (*ArchiveUpdateOne) ClearCreatedAt

func (_u *ArchiveUpdateOne) ClearCreatedAt() *ArchiveUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*ArchiveUpdateOne) ClearObjects

func (_u *ArchiveUpdateOne) ClearObjects() *ArchiveUpdateOne

ClearObjects clears all "objects" edges to the Object entity.

func (*ArchiveUpdateOne) ClearOpenedAt

func (_u *ArchiveUpdateOne) ClearOpenedAt() *ArchiveUpdateOne

ClearOpenedAt clears the value of the "opened_at" field.

func (*ArchiveUpdateOne) ClearSession

func (_u *ArchiveUpdateOne) ClearSession() *ArchiveUpdateOne

ClearSession clears the "session" edge to the Session entity.

func (*ArchiveUpdateOne) ClearSessionID

func (_u *ArchiveUpdateOne) ClearSessionID() *ArchiveUpdateOne

ClearSessionID clears the value of the "session_id" field.

func (*ArchiveUpdateOne) Exec

func (_u *ArchiveUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ArchiveUpdateOne) ExecContext

func (c *ArchiveUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ArchiveUpdateOne) ExecX

func (_u *ArchiveUpdateOne) ExecX(ctx context.Context)

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

func (*ArchiveUpdateOne) Mutation

func (_u *ArchiveUpdateOne) Mutation() *ArchiveMutation

Mutation returns the ArchiveMutation object of the builder.

func (*ArchiveUpdateOne) QueryContext

func (c *ArchiveUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ArchiveUpdateOne) RemoveObjectIDs

func (_u *ArchiveUpdateOne) RemoveObjectIDs(ids ...int) *ArchiveUpdateOne

RemoveObjectIDs removes the "objects" edge to Object entities by IDs.

func (*ArchiveUpdateOne) RemoveObjects

func (_u *ArchiveUpdateOne) RemoveObjects(v ...*Object) *ArchiveUpdateOne

RemoveObjects removes "objects" edges to Object entities.

func (*ArchiveUpdateOne) Save

func (_u *ArchiveUpdateOne) Save(ctx context.Context) (*Archive, error)

Save executes the query and returns the updated Archive entity.

func (*ArchiveUpdateOne) SaveX

func (_u *ArchiveUpdateOne) SaveX(ctx context.Context) *Archive

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

func (*ArchiveUpdateOne) Select

func (_u *ArchiveUpdateOne) Select(field string, fields ...string) *ArchiveUpdateOne

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

func (*ArchiveUpdateOne) SetCreatedAt

func (_u *ArchiveUpdateOne) SetCreatedAt(v time.Time) *ArchiveUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ArchiveUpdateOne) SetNillableCreatedAt

func (_u *ArchiveUpdateOne) SetNillableCreatedAt(v *time.Time) *ArchiveUpdateOne

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

func (*ArchiveUpdateOne) SetNillableOpenedAt

func (_u *ArchiveUpdateOne) SetNillableOpenedAt(v *time.Time) *ArchiveUpdateOne

SetNillableOpenedAt sets the "opened_at" field if the given value is not nil.

func (*ArchiveUpdateOne) SetNillableSessionID

func (_u *ArchiveUpdateOne) SetNillableSessionID(v *string) *ArchiveUpdateOne

SetNillableSessionID sets the "session_id" field if the given value is not nil.

func (*ArchiveUpdateOne) SetNillableState

func (_u *ArchiveUpdateOne) SetNillableState(v *int) *ArchiveUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*ArchiveUpdateOne) SetOpenedAt

func (_u *ArchiveUpdateOne) SetOpenedAt(v time.Time) *ArchiveUpdateOne

SetOpenedAt sets the "opened_at" field.

func (*ArchiveUpdateOne) SetSession

func (_u *ArchiveUpdateOne) SetSession(v *Session) *ArchiveUpdateOne

SetSession sets the "session" edge to the Session entity.

func (*ArchiveUpdateOne) SetSessionID

func (_u *ArchiveUpdateOne) SetSessionID(v string) *ArchiveUpdateOne

SetSessionID sets the "session_id" field.

func (*ArchiveUpdateOne) SetState

func (_u *ArchiveUpdateOne) SetState(v int) *ArchiveUpdateOne

SetState sets the "state" field.

func (*ArchiveUpdateOne) Where

Where appends a list predicates to the ArchiveUpdate builder.

type ArchiveUpsert

type ArchiveUpsert struct {
	*sql.UpdateSet
}

ArchiveUpsert is the "OnConflict" setter.

func (*ArchiveUpsert) AddState

func (u *ArchiveUpsert) AddState(v int) *ArchiveUpsert

AddState adds v to the "state" field.

func (*ArchiveUpsert) ClearCreatedAt

func (u *ArchiveUpsert) ClearCreatedAt() *ArchiveUpsert

ClearCreatedAt clears the value of the "created_at" field.

func (*ArchiveUpsert) ClearOpenedAt

func (u *ArchiveUpsert) ClearOpenedAt() *ArchiveUpsert

ClearOpenedAt clears the value of the "opened_at" field.

func (*ArchiveUpsert) ClearSessionID

func (u *ArchiveUpsert) ClearSessionID() *ArchiveUpsert

ClearSessionID clears the value of the "session_id" field.

func (*ArchiveUpsert) SetCreatedAt

func (u *ArchiveUpsert) SetCreatedAt(v time.Time) *ArchiveUpsert

SetCreatedAt sets the "created_at" field.

func (*ArchiveUpsert) SetOpenedAt

func (u *ArchiveUpsert) SetOpenedAt(v time.Time) *ArchiveUpsert

SetOpenedAt sets the "opened_at" field.

func (*ArchiveUpsert) SetSessionID

func (u *ArchiveUpsert) SetSessionID(v string) *ArchiveUpsert

SetSessionID sets the "session_id" field.

func (*ArchiveUpsert) SetState

func (u *ArchiveUpsert) SetState(v int) *ArchiveUpsert

SetState sets the "state" field.

func (*ArchiveUpsert) UpdateCreatedAt

func (u *ArchiveUpsert) UpdateCreatedAt() *ArchiveUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ArchiveUpsert) UpdateOpenedAt

func (u *ArchiveUpsert) UpdateOpenedAt() *ArchiveUpsert

UpdateOpenedAt sets the "opened_at" field to the value that was provided on create.

func (*ArchiveUpsert) UpdateSessionID

func (u *ArchiveUpsert) UpdateSessionID() *ArchiveUpsert

UpdateSessionID sets the "session_id" field to the value that was provided on create.

func (*ArchiveUpsert) UpdateState

func (u *ArchiveUpsert) UpdateState() *ArchiveUpsert

UpdateState sets the "state" field to the value that was provided on create.

type ArchiveUpsertBulk

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

ArchiveUpsertBulk is the builder for "upsert"-ing a bulk of Archive nodes.

func (*ArchiveUpsertBulk) AddState

func (u *ArchiveUpsertBulk) AddState(v int) *ArchiveUpsertBulk

AddState adds v to the "state" field.

func (*ArchiveUpsertBulk) ClearCreatedAt

func (u *ArchiveUpsertBulk) ClearCreatedAt() *ArchiveUpsertBulk

ClearCreatedAt clears the value of the "created_at" field.

func (*ArchiveUpsertBulk) ClearOpenedAt

func (u *ArchiveUpsertBulk) ClearOpenedAt() *ArchiveUpsertBulk

ClearOpenedAt clears the value of the "opened_at" field.

func (*ArchiveUpsertBulk) ClearSessionID

func (u *ArchiveUpsertBulk) ClearSessionID() *ArchiveUpsertBulk

ClearSessionID clears the value of the "session_id" field.

func (*ArchiveUpsertBulk) DoNothing

func (u *ArchiveUpsertBulk) DoNothing() *ArchiveUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ArchiveUpsertBulk) Exec

func (u *ArchiveUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ArchiveUpsertBulk) ExecX

func (u *ArchiveUpsertBulk) ExecX(ctx context.Context)

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

func (*ArchiveUpsertBulk) Ignore

func (u *ArchiveUpsertBulk) Ignore() *ArchiveUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Archive.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ArchiveUpsertBulk) SetCreatedAt

func (u *ArchiveUpsertBulk) SetCreatedAt(v time.Time) *ArchiveUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*ArchiveUpsertBulk) SetOpenedAt

func (u *ArchiveUpsertBulk) SetOpenedAt(v time.Time) *ArchiveUpsertBulk

SetOpenedAt sets the "opened_at" field.

func (*ArchiveUpsertBulk) SetSessionID

func (u *ArchiveUpsertBulk) SetSessionID(v string) *ArchiveUpsertBulk

SetSessionID sets the "session_id" field.

func (*ArchiveUpsertBulk) SetState

func (u *ArchiveUpsertBulk) SetState(v int) *ArchiveUpsertBulk

SetState sets the "state" field.

func (*ArchiveUpsertBulk) Update

func (u *ArchiveUpsertBulk) Update(set func(*ArchiveUpsert)) *ArchiveUpsertBulk

Update allows overriding fields `UPDATE` values. See the ArchiveCreateBulk.OnConflict documentation for more info.

func (*ArchiveUpsertBulk) UpdateCreatedAt

func (u *ArchiveUpsertBulk) UpdateCreatedAt() *ArchiveUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ArchiveUpsertBulk) UpdateNewValues

func (u *ArchiveUpsertBulk) UpdateNewValues() *ArchiveUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Archive.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(archive.FieldID)
		}),
	).
	Exec(ctx)

func (*ArchiveUpsertBulk) UpdateOpenedAt

func (u *ArchiveUpsertBulk) UpdateOpenedAt() *ArchiveUpsertBulk

UpdateOpenedAt sets the "opened_at" field to the value that was provided on create.

func (*ArchiveUpsertBulk) UpdateSessionID

func (u *ArchiveUpsertBulk) UpdateSessionID() *ArchiveUpsertBulk

UpdateSessionID sets the "session_id" field to the value that was provided on create.

func (*ArchiveUpsertBulk) UpdateState

func (u *ArchiveUpsertBulk) UpdateState() *ArchiveUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

type ArchiveUpsertOne

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

ArchiveUpsertOne is the builder for "upsert"-ing

one Archive node.

func (*ArchiveUpsertOne) AddState

func (u *ArchiveUpsertOne) AddState(v int) *ArchiveUpsertOne

AddState adds v to the "state" field.

func (*ArchiveUpsertOne) ClearCreatedAt

func (u *ArchiveUpsertOne) ClearCreatedAt() *ArchiveUpsertOne

ClearCreatedAt clears the value of the "created_at" field.

func (*ArchiveUpsertOne) ClearOpenedAt

func (u *ArchiveUpsertOne) ClearOpenedAt() *ArchiveUpsertOne

ClearOpenedAt clears the value of the "opened_at" field.

func (*ArchiveUpsertOne) ClearSessionID

func (u *ArchiveUpsertOne) ClearSessionID() *ArchiveUpsertOne

ClearSessionID clears the value of the "session_id" field.

func (*ArchiveUpsertOne) DoNothing

func (u *ArchiveUpsertOne) DoNothing() *ArchiveUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ArchiveUpsertOne) Exec

func (u *ArchiveUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ArchiveUpsertOne) ExecX

func (u *ArchiveUpsertOne) ExecX(ctx context.Context)

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

func (*ArchiveUpsertOne) ID

func (u *ArchiveUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ArchiveUpsertOne) IDX

func (u *ArchiveUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*ArchiveUpsertOne) Ignore

func (u *ArchiveUpsertOne) Ignore() *ArchiveUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Archive.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ArchiveUpsertOne) SetCreatedAt

func (u *ArchiveUpsertOne) SetCreatedAt(v time.Time) *ArchiveUpsertOne

SetCreatedAt sets the "created_at" field.

func (*ArchiveUpsertOne) SetOpenedAt

func (u *ArchiveUpsertOne) SetOpenedAt(v time.Time) *ArchiveUpsertOne

SetOpenedAt sets the "opened_at" field.

func (*ArchiveUpsertOne) SetSessionID

func (u *ArchiveUpsertOne) SetSessionID(v string) *ArchiveUpsertOne

SetSessionID sets the "session_id" field.

func (*ArchiveUpsertOne) SetState

func (u *ArchiveUpsertOne) SetState(v int) *ArchiveUpsertOne

SetState sets the "state" field.

func (*ArchiveUpsertOne) Update

func (u *ArchiveUpsertOne) Update(set func(*ArchiveUpsert)) *ArchiveUpsertOne

Update allows overriding fields `UPDATE` values. See the ArchiveCreate.OnConflict documentation for more info.

func (*ArchiveUpsertOne) UpdateCreatedAt

func (u *ArchiveUpsertOne) UpdateCreatedAt() *ArchiveUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ArchiveUpsertOne) UpdateNewValues

func (u *ArchiveUpsertOne) UpdateNewValues() *ArchiveUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Archive.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(archive.FieldID)
		}),
	).
	Exec(ctx)

func (*ArchiveUpsertOne) UpdateOpenedAt

func (u *ArchiveUpsertOne) UpdateOpenedAt() *ArchiveUpsertOne

UpdateOpenedAt sets the "opened_at" field to the value that was provided on create.

func (*ArchiveUpsertOne) UpdateSessionID

func (u *ArchiveUpsertOne) UpdateSessionID() *ArchiveUpsertOne

UpdateSessionID sets the "session_id" field to the value that was provided on create.

func (*ArchiveUpsertOne) UpdateState

func (u *ArchiveUpsertOne) UpdateState() *ArchiveUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

type Archives

type Archives []*Archive

Archives is a parsable slice of Archive.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Archive is the client for interacting with the Archive builders.
	Archive *ArchiveClient
	// CommitRow is the client for interacting with the CommitRow builders.
	CommitRow *CommitRowClient
	// DamagedPath is the client for interacting with the DamagedPath builders.
	DamagedPath *DamagedPathClient
	// DeletedRef is the client for interacting with the DeletedRef builders.
	DeletedRef *DeletedRefClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Object is the client for interacting with the Object builders.
	Object *ObjectClient
	// Pin is the client for interacting with the Pin builders.
	Pin *PinClient
	// Reindex is the client for interacting with the Reindex builders.
	Reindex *ReindexClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// Set is the client for interacting with the Set builders.
	Set *SetClient
	// SetRef is the client for interacting with the SetRef builders.
	SetRef *SetRefClient
	// Settings is the client for interacting with the Settings builders.
	Settings *SettingsClient
	// Tree is the client for interacting with the Tree builders.
	Tree *TreeClient
	// WalkedArchive is the client for interacting with the WalkedArchive builders.
	WalkedArchive *WalkedArchiveClient
	// 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().
	Archive.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Client) 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) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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 CommitRow

type CommitRow struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// ReceivedAt holds the value of the "received_at" field.
	ReceivedAt time.Time `json:"received_at,omitempty"`
	// Tree holds the value of the "tree" field.
	Tree []byte `json:"tree,omitempty"`
	// Parent holds the value of the "parent" field.
	Parent []byte `json:"parent,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID string `json:"agent_id,omitempty"`
	// ScanStartNs holds the value of the "scan_start_ns" field.
	ScanStartNs int64 `json:"scan_start_ns,omitempty"`
	// PolicyVersion holds the value of the "policy_version" field.
	PolicyVersion uint32 `json:"policy_version,omitempty"`
	// KeyID holds the value of the "key_id" field.
	KeyID *string `json:"key_id,omitempty"`
	// Consistent holds the value of the "consistent" field.
	Consistent bool `json:"consistent,omitempty"`
	// SetID holds the value of the "set_id" field.
	SetID int64 `json:"set_id,omitempty"`
	// Presence holds the value of the "presence" field.
	Presence []byte `json:"presence,omitempty"`
	// Partial holds the value of the "partial" field.
	Partial bool `json:"partial,omitempty"`
	// Incomplete holds the value of the "incomplete" field.
	Incomplete bool `json:"incomplete,omitempty"`
	// RetainedBy holds the value of the "retained_by" field.
	RetainedBy string `json:"retained_by,omitempty"`
	// RetireAt holds the value of the "retire_at" field.
	RetireAt *time.Time `json:"retire_at,omitempty"`
	// RetirePolicy holds the value of the "retire_policy" field.
	RetirePolicy *string `json:"retire_policy,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// TombstonedAt holds the value of the "tombstoned_at" field.
	TombstonedAt *time.Time `json:"tombstoned_at,omitempty"`
	// LogicalSize holds the value of the "logical_size" field.
	LogicalSize *int64 `json:"logical_size,omitempty"`
	// FileCount holds the value of the "file_count" field.
	FileCount *int64 `json:"file_count,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `json:"metadata,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CommitRowQuery when eager-loading is set.
	Edges CommitRowEdges `json:"edges"`
	// contains filtered or unexported fields
}

CommitRow is the model entity for the CommitRow schema.

func (*CommitRow) ExecContext

func (c *CommitRow) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRow) QueryContext

func (c *CommitRow) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRow) QuerySet

func (_m *CommitRow) QuerySet() *SetQuery

QuerySet queries the "set" edge of the CommitRow entity.

func (*CommitRow) String

func (_m *CommitRow) String() string

String implements the fmt.Stringer.

func (*CommitRow) Unwrap

func (_m *CommitRow) Unwrap() *CommitRow

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

func (_m *CommitRow) Update() *CommitRowUpdateOne

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

func (*CommitRow) Value

func (_m *CommitRow) Value(name string) (ent.Value, error)

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

type CommitRowClient

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

CommitRowClient is a client for the CommitRow schema.

func NewCommitRowClient

func NewCommitRowClient(c config) *CommitRowClient

NewCommitRowClient returns a client for the CommitRow from the given config.

func (*CommitRowClient) Create

func (c *CommitRowClient) Create() *CommitRowCreate

Create returns a builder for creating a CommitRow entity.

func (*CommitRowClient) CreateBulk

func (c *CommitRowClient) CreateBulk(builders ...*CommitRowCreate) *CommitRowCreateBulk

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

func (*CommitRowClient) Delete

func (c *CommitRowClient) Delete() *CommitRowDelete

Delete returns a delete builder for CommitRow.

func (*CommitRowClient) DeleteOne

func (c *CommitRowClient) DeleteOne(_m *CommitRow) *CommitRowDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommitRowClient) DeleteOneID

func (c *CommitRowClient) DeleteOneID(id int) *CommitRowDeleteOne

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

func (*CommitRowClient) ExecContext

func (c *CommitRowClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowClient) Get

func (c *CommitRowClient) Get(ctx context.Context, id int) (*CommitRow, error)

Get returns a CommitRow entity by its id.

func (*CommitRowClient) GetX

func (c *CommitRowClient) GetX(ctx context.Context, id int) *CommitRow

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

func (*CommitRowClient) Hooks

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

Hooks returns the client hooks.

func (*CommitRowClient) Intercept

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

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

func (*CommitRowClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CommitRowClient) MapCreateBulk

func (c *CommitRowClient) MapCreateBulk(slice any, setFunc func(*CommitRowCreate, int)) *CommitRowCreateBulk

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 (*CommitRowClient) Query

func (c *CommitRowClient) Query() *CommitRowQuery

Query returns a query builder for CommitRow.

func (*CommitRowClient) QueryContext

func (c *CommitRowClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowClient) QuerySet

func (c *CommitRowClient) QuerySet(_m *CommitRow) *SetQuery

QuerySet queries the set edge of a CommitRow.

func (*CommitRowClient) Update

func (c *CommitRowClient) Update() *CommitRowUpdate

Update returns an update builder for CommitRow.

func (*CommitRowClient) UpdateOne

func (c *CommitRowClient) UpdateOne(_m *CommitRow) *CommitRowUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommitRowClient) UpdateOneID

func (c *CommitRowClient) UpdateOneID(id int) *CommitRowUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommitRowClient) Use

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

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

type CommitRowCreate

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

CommitRowCreate is the builder for creating a CommitRow entity.

func (*CommitRowCreate) Exec

func (_c *CommitRowCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommitRowCreate) ExecContext

func (c *CommitRowCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowCreate) ExecX

func (_c *CommitRowCreate) ExecX(ctx context.Context)

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

func (*CommitRowCreate) Mutation

func (_c *CommitRowCreate) Mutation() *CommitRowMutation

Mutation returns the CommitRowMutation object of the builder.

func (*CommitRowCreate) OnConflict

func (_c *CommitRowCreate) OnConflict(opts ...sql.ConflictOption) *CommitRowUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.CommitRow.Create().
	SetRef(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CommitRowUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*CommitRowCreate) OnConflictColumns

func (_c *CommitRowCreate) OnConflictColumns(columns ...string) *CommitRowUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.CommitRow.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CommitRowCreate) QueryContext

func (c *CommitRowCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowCreate) Save

func (_c *CommitRowCreate) Save(ctx context.Context) (*CommitRow, error)

Save creates the CommitRow in the database.

func (*CommitRowCreate) SaveX

func (_c *CommitRowCreate) SaveX(ctx context.Context) *CommitRow

SaveX calls Save and panics if Save returns an error.

func (*CommitRowCreate) SetAgentID

func (_c *CommitRowCreate) SetAgentID(v string) *CommitRowCreate

SetAgentID sets the "agent_id" field.

func (*CommitRowCreate) SetConsistent

func (_c *CommitRowCreate) SetConsistent(v bool) *CommitRowCreate

SetConsistent sets the "consistent" field.

func (*CommitRowCreate) SetDeletedAt

func (_c *CommitRowCreate) SetDeletedAt(v time.Time) *CommitRowCreate

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowCreate) SetExpiresAt

func (_c *CommitRowCreate) SetExpiresAt(v time.Time) *CommitRowCreate

SetExpiresAt sets the "expires_at" field.

func (*CommitRowCreate) SetFileCount

func (_c *CommitRowCreate) SetFileCount(v int64) *CommitRowCreate

SetFileCount sets the "file_count" field.

func (*CommitRowCreate) SetIncomplete

func (_c *CommitRowCreate) SetIncomplete(v bool) *CommitRowCreate

SetIncomplete sets the "incomplete" field.

func (*CommitRowCreate) SetKeyID

func (_c *CommitRowCreate) SetKeyID(v string) *CommitRowCreate

SetKeyID sets the "key_id" field.

func (*CommitRowCreate) SetLogicalSize

func (_c *CommitRowCreate) SetLogicalSize(v int64) *CommitRowCreate

SetLogicalSize sets the "logical_size" field.

func (*CommitRowCreate) SetMetadata

func (_c *CommitRowCreate) SetMetadata(v map[string]string) *CommitRowCreate

SetMetadata sets the "metadata" field.

func (*CommitRowCreate) SetNillableAgentID

func (_c *CommitRowCreate) SetNillableAgentID(v *string) *CommitRowCreate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*CommitRowCreate) SetNillableConsistent

func (_c *CommitRowCreate) SetNillableConsistent(v *bool) *CommitRowCreate

SetNillableConsistent sets the "consistent" field if the given value is not nil.

func (*CommitRowCreate) SetNillableDeletedAt

func (_c *CommitRowCreate) SetNillableDeletedAt(v *time.Time) *CommitRowCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CommitRowCreate) SetNillableExpiresAt

func (_c *CommitRowCreate) SetNillableExpiresAt(v *time.Time) *CommitRowCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CommitRowCreate) SetNillableFileCount

func (_c *CommitRowCreate) SetNillableFileCount(v *int64) *CommitRowCreate

SetNillableFileCount sets the "file_count" field if the given value is not nil.

func (*CommitRowCreate) SetNillableIncomplete

func (_c *CommitRowCreate) SetNillableIncomplete(v *bool) *CommitRowCreate

SetNillableIncomplete sets the "incomplete" field if the given value is not nil.

func (*CommitRowCreate) SetNillableKeyID

func (_c *CommitRowCreate) SetNillableKeyID(v *string) *CommitRowCreate

SetNillableKeyID sets the "key_id" field if the given value is not nil.

func (*CommitRowCreate) SetNillableLogicalSize

func (_c *CommitRowCreate) SetNillableLogicalSize(v *int64) *CommitRowCreate

SetNillableLogicalSize sets the "logical_size" field if the given value is not nil.

func (*CommitRowCreate) SetNillablePartial

func (_c *CommitRowCreate) SetNillablePartial(v *bool) *CommitRowCreate

SetNillablePartial sets the "partial" field if the given value is not nil.

func (*CommitRowCreate) SetNillablePolicyVersion

func (_c *CommitRowCreate) SetNillablePolicyVersion(v *uint32) *CommitRowCreate

SetNillablePolicyVersion sets the "policy_version" field if the given value is not nil.

func (*CommitRowCreate) SetNillableRetainedBy

func (_c *CommitRowCreate) SetNillableRetainedBy(v *string) *CommitRowCreate

SetNillableRetainedBy sets the "retained_by" field if the given value is not nil.

func (*CommitRowCreate) SetNillableRetireAt

func (_c *CommitRowCreate) SetNillableRetireAt(v *time.Time) *CommitRowCreate

SetNillableRetireAt sets the "retire_at" field if the given value is not nil.

func (*CommitRowCreate) SetNillableRetirePolicy

func (_c *CommitRowCreate) SetNillableRetirePolicy(v *string) *CommitRowCreate

SetNillableRetirePolicy sets the "retire_policy" field if the given value is not nil.

func (*CommitRowCreate) SetNillableScanStartNs

func (_c *CommitRowCreate) SetNillableScanStartNs(v *int64) *CommitRowCreate

SetNillableScanStartNs sets the "scan_start_ns" field if the given value is not nil.

func (*CommitRowCreate) SetNillableTombstonedAt

func (_c *CommitRowCreate) SetNillableTombstonedAt(v *time.Time) *CommitRowCreate

SetNillableTombstonedAt sets the "tombstoned_at" field if the given value is not nil.

func (*CommitRowCreate) SetParent

func (_c *CommitRowCreate) SetParent(v []byte) *CommitRowCreate

SetParent sets the "parent" field.

func (*CommitRowCreate) SetPartial

func (_c *CommitRowCreate) SetPartial(v bool) *CommitRowCreate

SetPartial sets the "partial" field.

func (*CommitRowCreate) SetPolicyVersion

func (_c *CommitRowCreate) SetPolicyVersion(v uint32) *CommitRowCreate

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowCreate) SetPresence

func (_c *CommitRowCreate) SetPresence(v []byte) *CommitRowCreate

SetPresence sets the "presence" field.

func (*CommitRowCreate) SetReceivedAt

func (_c *CommitRowCreate) SetReceivedAt(v time.Time) *CommitRowCreate

SetReceivedAt sets the "received_at" field.

func (*CommitRowCreate) SetRef

func (_c *CommitRowCreate) SetRef(v []byte) *CommitRowCreate

SetRef sets the "ref" field.

func (*CommitRowCreate) SetRetainedBy

func (_c *CommitRowCreate) SetRetainedBy(v string) *CommitRowCreate

SetRetainedBy sets the "retained_by" field.

func (*CommitRowCreate) SetRetireAt

func (_c *CommitRowCreate) SetRetireAt(v time.Time) *CommitRowCreate

SetRetireAt sets the "retire_at" field.

func (*CommitRowCreate) SetRetirePolicy

func (_c *CommitRowCreate) SetRetirePolicy(v string) *CommitRowCreate

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowCreate) SetScanStartNs

func (_c *CommitRowCreate) SetScanStartNs(v int64) *CommitRowCreate

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowCreate) SetSet

func (_c *CommitRowCreate) SetSet(v *Set) *CommitRowCreate

SetSet sets the "set" edge to the Set entity.

func (*CommitRowCreate) SetSetID

func (_c *CommitRowCreate) SetSetID(v int64) *CommitRowCreate

SetSetID sets the "set_id" field.

func (*CommitRowCreate) SetTimestamp

func (_c *CommitRowCreate) SetTimestamp(v time.Time) *CommitRowCreate

SetTimestamp sets the "timestamp" field.

func (*CommitRowCreate) SetTombstonedAt

func (_c *CommitRowCreate) SetTombstonedAt(v time.Time) *CommitRowCreate

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowCreate) SetTree

func (_c *CommitRowCreate) SetTree(v []byte) *CommitRowCreate

SetTree sets the "tree" field.

type CommitRowCreateBulk

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

CommitRowCreateBulk is the builder for creating many CommitRow entities in bulk.

func (*CommitRowCreateBulk) Exec

func (_c *CommitRowCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CommitRowCreateBulk) ExecContext

func (c *CommitRowCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowCreateBulk) ExecX

func (_c *CommitRowCreateBulk) ExecX(ctx context.Context)

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

func (*CommitRowCreateBulk) OnConflict

func (_c *CommitRowCreateBulk) OnConflict(opts ...sql.ConflictOption) *CommitRowUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.CommitRow.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CommitRowUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*CommitRowCreateBulk) OnConflictColumns

func (_c *CommitRowCreateBulk) OnConflictColumns(columns ...string) *CommitRowUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.CommitRow.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CommitRowCreateBulk) QueryContext

func (c *CommitRowCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowCreateBulk) Save

func (_c *CommitRowCreateBulk) Save(ctx context.Context) ([]*CommitRow, error)

Save creates the CommitRow entities in the database.

func (*CommitRowCreateBulk) SaveX

func (_c *CommitRowCreateBulk) SaveX(ctx context.Context) []*CommitRow

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

type CommitRowDelete

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

CommitRowDelete is the builder for deleting a CommitRow entity.

func (*CommitRowDelete) Exec

func (_d *CommitRowDelete) Exec(ctx context.Context) (int, error)

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

func (*CommitRowDelete) ExecContext

func (c *CommitRowDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowDelete) ExecX

func (_d *CommitRowDelete) ExecX(ctx context.Context) int

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

func (*CommitRowDelete) QueryContext

func (c *CommitRowDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowDelete) Where

Where appends a list predicates to the CommitRowDelete builder.

type CommitRowDeleteOne

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

CommitRowDeleteOne is the builder for deleting a single CommitRow entity.

func (*CommitRowDeleteOne) Exec

func (_d *CommitRowDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CommitRowDeleteOne) ExecX

func (_d *CommitRowDeleteOne) ExecX(ctx context.Context)

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

func (*CommitRowDeleteOne) Where

Where appends a list predicates to the CommitRowDelete builder.

type CommitRowEdges

type CommitRowEdges struct {
	// Set holds the value of the set edge.
	Set *Set `json:"set,omitempty"`
	// contains filtered or unexported fields
}

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

func (CommitRowEdges) SetOrErr

func (e CommitRowEdges) SetOrErr() (*Set, error)

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

type CommitRowGroupBy

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

CommitRowGroupBy is the group-by builder for CommitRow entities.

func (*CommitRowGroupBy) Aggregate

func (_g *CommitRowGroupBy) Aggregate(fns ...AggregateFunc) *CommitRowGroupBy

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

func (*CommitRowGroupBy) Bool

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

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

func (*CommitRowGroupBy) BoolX

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

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

func (*CommitRowGroupBy) Bools

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

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

func (*CommitRowGroupBy) BoolsX

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

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

func (*CommitRowGroupBy) Float64

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

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

func (*CommitRowGroupBy) Float64X

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

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

func (*CommitRowGroupBy) Float64s

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

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

func (*CommitRowGroupBy) Float64sX

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

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

func (*CommitRowGroupBy) Int

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

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

func (*CommitRowGroupBy) IntX

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

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

func (*CommitRowGroupBy) Ints

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

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

func (*CommitRowGroupBy) IntsX

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

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

func (*CommitRowGroupBy) Scan

func (_g *CommitRowGroupBy) Scan(ctx context.Context, v any) error

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

func (*CommitRowGroupBy) ScanX

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

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

func (*CommitRowGroupBy) String

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

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

func (*CommitRowGroupBy) StringX

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

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

func (*CommitRowGroupBy) Strings

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

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

func (*CommitRowGroupBy) StringsX

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

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

type CommitRowMutation

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

CommitRowMutation represents an operation that mutates the CommitRow nodes in the graph.

func (*CommitRowMutation) AddField

func (m *CommitRowMutation) 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 (*CommitRowMutation) AddFileCount

func (m *CommitRowMutation) AddFileCount(i int64)

AddFileCount adds i to the "file_count" field.

func (*CommitRowMutation) AddLogicalSize

func (m *CommitRowMutation) AddLogicalSize(i int64)

AddLogicalSize adds i to the "logical_size" field.

func (*CommitRowMutation) AddPolicyVersion

func (m *CommitRowMutation) AddPolicyVersion(u int32)

AddPolicyVersion adds u to the "policy_version" field.

func (*CommitRowMutation) AddScanStartNs

func (m *CommitRowMutation) AddScanStartNs(i int64)

AddScanStartNs adds i to the "scan_start_ns" field.

func (*CommitRowMutation) AddedEdges

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

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

func (*CommitRowMutation) AddedField

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

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

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

func (*CommitRowMutation) AddedFileCount

func (m *CommitRowMutation) AddedFileCount() (r int64, exists bool)

AddedFileCount returns the value that was added to the "file_count" field in this mutation.

func (*CommitRowMutation) AddedIDs

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

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

func (*CommitRowMutation) AddedLogicalSize

func (m *CommitRowMutation) AddedLogicalSize() (r int64, exists bool)

AddedLogicalSize returns the value that was added to the "logical_size" field in this mutation.

func (*CommitRowMutation) AddedPolicyVersion

func (m *CommitRowMutation) AddedPolicyVersion() (r int32, exists bool)

AddedPolicyVersion returns the value that was added to the "policy_version" field in this mutation.

func (*CommitRowMutation) AddedScanStartNs

func (m *CommitRowMutation) AddedScanStartNs() (r int64, exists bool)

AddedScanStartNs returns the value that was added to the "scan_start_ns" field in this mutation.

func (*CommitRowMutation) AgentID

func (m *CommitRowMutation) AgentID() (r string, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*CommitRowMutation) ClearDeletedAt

func (m *CommitRowMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommitRowMutation) ClearEdge

func (m *CommitRowMutation) 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 (*CommitRowMutation) ClearExpiresAt

func (m *CommitRowMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*CommitRowMutation) ClearField

func (m *CommitRowMutation) 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 (*CommitRowMutation) ClearFileCount

func (m *CommitRowMutation) ClearFileCount()

ClearFileCount clears the value of the "file_count" field.

func (*CommitRowMutation) ClearKeyID

func (m *CommitRowMutation) ClearKeyID()

ClearKeyID clears the value of the "key_id" field.

func (*CommitRowMutation) ClearLogicalSize

func (m *CommitRowMutation) ClearLogicalSize()

ClearLogicalSize clears the value of the "logical_size" field.

func (*CommitRowMutation) ClearMetadata

func (m *CommitRowMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*CommitRowMutation) ClearParent

func (m *CommitRowMutation) ClearParent()

ClearParent clears the value of the "parent" field.

func (*CommitRowMutation) ClearPresence

func (m *CommitRowMutation) ClearPresence()

ClearPresence clears the value of the "presence" field.

func (*CommitRowMutation) ClearRetireAt

func (m *CommitRowMutation) ClearRetireAt()

ClearRetireAt clears the value of the "retire_at" field.

func (*CommitRowMutation) ClearRetirePolicy

func (m *CommitRowMutation) ClearRetirePolicy()

ClearRetirePolicy clears the value of the "retire_policy" field.

func (*CommitRowMutation) ClearSet

func (m *CommitRowMutation) ClearSet()

ClearSet clears the "set" edge to the Set entity.

func (*CommitRowMutation) ClearTombstonedAt

func (m *CommitRowMutation) ClearTombstonedAt()

ClearTombstonedAt clears the value of the "tombstoned_at" field.

func (*CommitRowMutation) ClearedEdges

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

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

func (*CommitRowMutation) ClearedFields

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

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

func (CommitRowMutation) Client

func (m CommitRowMutation) 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 (*CommitRowMutation) Consistent

func (m *CommitRowMutation) Consistent() (r bool, exists bool)

Consistent returns the value of the "consistent" field in the mutation.

func (*CommitRowMutation) DeletedAt

func (m *CommitRowMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*CommitRowMutation) DeletedAtCleared

func (m *CommitRowMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*CommitRowMutation) EdgeCleared

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

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

func (*CommitRowMutation) ExecContext

func (c *CommitRowMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowMutation) ExpiresAt

func (m *CommitRowMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*CommitRowMutation) ExpiresAtCleared

func (m *CommitRowMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*CommitRowMutation) Field

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

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

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

func (*CommitRowMutation) Fields

func (m *CommitRowMutation) 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 (*CommitRowMutation) FileCount

func (m *CommitRowMutation) FileCount() (r int64, exists bool)

FileCount returns the value of the "file_count" field in the mutation.

func (*CommitRowMutation) FileCountCleared

func (m *CommitRowMutation) FileCountCleared() bool

FileCountCleared returns if the "file_count" field was cleared in this mutation.

func (*CommitRowMutation) ID

func (m *CommitRowMutation) 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 (*CommitRowMutation) IDs

func (m *CommitRowMutation) 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 (*CommitRowMutation) Incomplete

func (m *CommitRowMutation) Incomplete() (r bool, exists bool)

Incomplete returns the value of the "incomplete" field in the mutation.

func (*CommitRowMutation) KeyID

func (m *CommitRowMutation) KeyID() (r string, exists bool)

KeyID returns the value of the "key_id" field in the mutation.

func (*CommitRowMutation) KeyIDCleared

func (m *CommitRowMutation) KeyIDCleared() bool

KeyIDCleared returns if the "key_id" field was cleared in this mutation.

func (*CommitRowMutation) LogicalSize

func (m *CommitRowMutation) LogicalSize() (r int64, exists bool)

LogicalSize returns the value of the "logical_size" field in the mutation.

func (*CommitRowMutation) LogicalSizeCleared

func (m *CommitRowMutation) LogicalSizeCleared() bool

LogicalSizeCleared returns if the "logical_size" field was cleared in this mutation.

func (*CommitRowMutation) Metadata

func (m *CommitRowMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*CommitRowMutation) MetadataCleared

func (m *CommitRowMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*CommitRowMutation) OldAgentID

func (m *CommitRowMutation) OldAgentID(ctx context.Context) (v string, err error)

OldAgentID returns the old "agent_id" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldConsistent

func (m *CommitRowMutation) OldConsistent(ctx context.Context) (v bool, err error)

OldConsistent returns the old "consistent" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldDeletedAt

func (m *CommitRowMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldExpiresAt

func (m *CommitRowMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldField

func (m *CommitRowMutation) 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 (*CommitRowMutation) OldFileCount

func (m *CommitRowMutation) OldFileCount(ctx context.Context) (v *int64, err error)

OldFileCount returns the old "file_count" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldIncomplete

func (m *CommitRowMutation) OldIncomplete(ctx context.Context) (v bool, err error)

OldIncomplete returns the old "incomplete" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldKeyID

func (m *CommitRowMutation) OldKeyID(ctx context.Context) (v *string, err error)

OldKeyID returns the old "key_id" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldLogicalSize

func (m *CommitRowMutation) OldLogicalSize(ctx context.Context) (v *int64, err error)

OldLogicalSize returns the old "logical_size" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldMetadata

func (m *CommitRowMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldParent

func (m *CommitRowMutation) OldParent(ctx context.Context) (v []byte, err error)

OldParent returns the old "parent" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldPartial

func (m *CommitRowMutation) OldPartial(ctx context.Context) (v bool, err error)

OldPartial returns the old "partial" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldPolicyVersion

func (m *CommitRowMutation) OldPolicyVersion(ctx context.Context) (v uint32, err error)

OldPolicyVersion returns the old "policy_version" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldPresence

func (m *CommitRowMutation) OldPresence(ctx context.Context) (v []byte, err error)

OldPresence returns the old "presence" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldReceivedAt

func (m *CommitRowMutation) OldReceivedAt(ctx context.Context) (v time.Time, err error)

OldReceivedAt returns the old "received_at" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldRef

func (m *CommitRowMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldRetainedBy

func (m *CommitRowMutation) OldRetainedBy(ctx context.Context) (v string, err error)

OldRetainedBy returns the old "retained_by" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldRetireAt

func (m *CommitRowMutation) OldRetireAt(ctx context.Context) (v *time.Time, err error)

OldRetireAt returns the old "retire_at" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldRetirePolicy

func (m *CommitRowMutation) OldRetirePolicy(ctx context.Context) (v *string, err error)

OldRetirePolicy returns the old "retire_policy" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldScanStartNs

func (m *CommitRowMutation) OldScanStartNs(ctx context.Context) (v int64, err error)

OldScanStartNs returns the old "scan_start_ns" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldSetID

func (m *CommitRowMutation) OldSetID(ctx context.Context) (v int64, err error)

OldSetID returns the old "set_id" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldTimestamp

func (m *CommitRowMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldTombstonedAt

func (m *CommitRowMutation) OldTombstonedAt(ctx context.Context) (v *time.Time, err error)

OldTombstonedAt returns the old "tombstoned_at" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) OldTree

func (m *CommitRowMutation) OldTree(ctx context.Context) (v []byte, err error)

OldTree returns the old "tree" field's value of the CommitRow entity. If the CommitRow 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 (*CommitRowMutation) Op

func (m *CommitRowMutation) Op() Op

Op returns the operation name.

func (*CommitRowMutation) Parent

func (m *CommitRowMutation) Parent() (r []byte, exists bool)

Parent returns the value of the "parent" field in the mutation.

func (*CommitRowMutation) ParentCleared

func (m *CommitRowMutation) ParentCleared() bool

ParentCleared returns if the "parent" field was cleared in this mutation.

func (*CommitRowMutation) Partial

func (m *CommitRowMutation) Partial() (r bool, exists bool)

Partial returns the value of the "partial" field in the mutation.

func (*CommitRowMutation) PolicyVersion

func (m *CommitRowMutation) PolicyVersion() (r uint32, exists bool)

PolicyVersion returns the value of the "policy_version" field in the mutation.

func (*CommitRowMutation) Presence

func (m *CommitRowMutation) Presence() (r []byte, exists bool)

Presence returns the value of the "presence" field in the mutation.

func (*CommitRowMutation) PresenceCleared

func (m *CommitRowMutation) PresenceCleared() bool

PresenceCleared returns if the "presence" field was cleared in this mutation.

func (*CommitRowMutation) QueryContext

func (c *CommitRowMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowMutation) ReceivedAt

func (m *CommitRowMutation) ReceivedAt() (r time.Time, exists bool)

ReceivedAt returns the value of the "received_at" field in the mutation.

func (*CommitRowMutation) Ref

func (m *CommitRowMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*CommitRowMutation) RemovedEdges

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

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

func (*CommitRowMutation) RemovedIDs

func (m *CommitRowMutation) 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 (*CommitRowMutation) ResetAgentID

func (m *CommitRowMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*CommitRowMutation) ResetConsistent

func (m *CommitRowMutation) ResetConsistent()

ResetConsistent resets all changes to the "consistent" field.

func (*CommitRowMutation) ResetDeletedAt

func (m *CommitRowMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CommitRowMutation) ResetEdge

func (m *CommitRowMutation) 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 (*CommitRowMutation) ResetExpiresAt

func (m *CommitRowMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*CommitRowMutation) ResetField

func (m *CommitRowMutation) 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 (*CommitRowMutation) ResetFileCount

func (m *CommitRowMutation) ResetFileCount()

ResetFileCount resets all changes to the "file_count" field.

func (*CommitRowMutation) ResetIncomplete

func (m *CommitRowMutation) ResetIncomplete()

ResetIncomplete resets all changes to the "incomplete" field.

func (*CommitRowMutation) ResetKeyID

func (m *CommitRowMutation) ResetKeyID()

ResetKeyID resets all changes to the "key_id" field.

func (*CommitRowMutation) ResetLogicalSize

func (m *CommitRowMutation) ResetLogicalSize()

ResetLogicalSize resets all changes to the "logical_size" field.

func (*CommitRowMutation) ResetMetadata

func (m *CommitRowMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*CommitRowMutation) ResetParent

func (m *CommitRowMutation) ResetParent()

ResetParent resets all changes to the "parent" field.

func (*CommitRowMutation) ResetPartial

func (m *CommitRowMutation) ResetPartial()

ResetPartial resets all changes to the "partial" field.

func (*CommitRowMutation) ResetPolicyVersion

func (m *CommitRowMutation) ResetPolicyVersion()

ResetPolicyVersion resets all changes to the "policy_version" field.

func (*CommitRowMutation) ResetPresence

func (m *CommitRowMutation) ResetPresence()

ResetPresence resets all changes to the "presence" field.

func (*CommitRowMutation) ResetReceivedAt

func (m *CommitRowMutation) ResetReceivedAt()

ResetReceivedAt resets all changes to the "received_at" field.

func (*CommitRowMutation) ResetRef

func (m *CommitRowMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*CommitRowMutation) ResetRetainedBy

func (m *CommitRowMutation) ResetRetainedBy()

ResetRetainedBy resets all changes to the "retained_by" field.

func (*CommitRowMutation) ResetRetireAt

func (m *CommitRowMutation) ResetRetireAt()

ResetRetireAt resets all changes to the "retire_at" field.

func (*CommitRowMutation) ResetRetirePolicy

func (m *CommitRowMutation) ResetRetirePolicy()

ResetRetirePolicy resets all changes to the "retire_policy" field.

func (*CommitRowMutation) ResetScanStartNs

func (m *CommitRowMutation) ResetScanStartNs()

ResetScanStartNs resets all changes to the "scan_start_ns" field.

func (*CommitRowMutation) ResetSet

func (m *CommitRowMutation) ResetSet()

ResetSet resets all changes to the "set" edge.

func (*CommitRowMutation) ResetSetID

func (m *CommitRowMutation) ResetSetID()

ResetSetID resets all changes to the "set_id" field.

func (*CommitRowMutation) ResetTimestamp

func (m *CommitRowMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*CommitRowMutation) ResetTombstonedAt

func (m *CommitRowMutation) ResetTombstonedAt()

ResetTombstonedAt resets all changes to the "tombstoned_at" field.

func (*CommitRowMutation) ResetTree

func (m *CommitRowMutation) ResetTree()

ResetTree resets all changes to the "tree" field.

func (*CommitRowMutation) RetainedBy

func (m *CommitRowMutation) RetainedBy() (r string, exists bool)

RetainedBy returns the value of the "retained_by" field in the mutation.

func (*CommitRowMutation) RetireAt

func (m *CommitRowMutation) RetireAt() (r time.Time, exists bool)

RetireAt returns the value of the "retire_at" field in the mutation.

func (*CommitRowMutation) RetireAtCleared

func (m *CommitRowMutation) RetireAtCleared() bool

RetireAtCleared returns if the "retire_at" field was cleared in this mutation.

func (*CommitRowMutation) RetirePolicy

func (m *CommitRowMutation) RetirePolicy() (r string, exists bool)

RetirePolicy returns the value of the "retire_policy" field in the mutation.

func (*CommitRowMutation) RetirePolicyCleared

func (m *CommitRowMutation) RetirePolicyCleared() bool

RetirePolicyCleared returns if the "retire_policy" field was cleared in this mutation.

func (*CommitRowMutation) ScanStartNs

func (m *CommitRowMutation) ScanStartNs() (r int64, exists bool)

ScanStartNs returns the value of the "scan_start_ns" field in the mutation.

func (*CommitRowMutation) SetAgentID

func (m *CommitRowMutation) SetAgentID(s string)

SetAgentID sets the "agent_id" field.

func (*CommitRowMutation) SetCleared

func (m *CommitRowMutation) SetCleared() bool

SetCleared reports if the "set" edge to the Set entity was cleared.

func (*CommitRowMutation) SetConsistent

func (m *CommitRowMutation) SetConsistent(b bool)

SetConsistent sets the "consistent" field.

func (*CommitRowMutation) SetDeletedAt

func (m *CommitRowMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowMutation) SetExpiresAt

func (m *CommitRowMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*CommitRowMutation) SetField

func (m *CommitRowMutation) 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 (*CommitRowMutation) SetFileCount

func (m *CommitRowMutation) SetFileCount(i int64)

SetFileCount sets the "file_count" field.

func (*CommitRowMutation) SetID

func (m *CommitRowMutation) SetID() (r int64, exists bool)

SetID returns the value of the "set_id" field in the mutation.

func (*CommitRowMutation) SetIDs

func (m *CommitRowMutation) SetIDs() (ids []int64)

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

func (*CommitRowMutation) SetIncomplete

func (m *CommitRowMutation) SetIncomplete(b bool)

SetIncomplete sets the "incomplete" field.

func (*CommitRowMutation) SetKeyID

func (m *CommitRowMutation) SetKeyID(s string)

SetKeyID sets the "key_id" field.

func (*CommitRowMutation) SetLogicalSize

func (m *CommitRowMutation) SetLogicalSize(i int64)

SetLogicalSize sets the "logical_size" field.

func (*CommitRowMutation) SetMetadata

func (m *CommitRowMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*CommitRowMutation) SetOp

func (m *CommitRowMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CommitRowMutation) SetParent

func (m *CommitRowMutation) SetParent(b []byte)

SetParent sets the "parent" field.

func (*CommitRowMutation) SetPartial

func (m *CommitRowMutation) SetPartial(b bool)

SetPartial sets the "partial" field.

func (*CommitRowMutation) SetPolicyVersion

func (m *CommitRowMutation) SetPolicyVersion(u uint32)

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowMutation) SetPresence

func (m *CommitRowMutation) SetPresence(b []byte)

SetPresence sets the "presence" field.

func (*CommitRowMutation) SetReceivedAt

func (m *CommitRowMutation) SetReceivedAt(t time.Time)

SetReceivedAt sets the "received_at" field.

func (*CommitRowMutation) SetRef

func (m *CommitRowMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*CommitRowMutation) SetRetainedBy

func (m *CommitRowMutation) SetRetainedBy(s string)

SetRetainedBy sets the "retained_by" field.

func (*CommitRowMutation) SetRetireAt

func (m *CommitRowMutation) SetRetireAt(t time.Time)

SetRetireAt sets the "retire_at" field.

func (*CommitRowMutation) SetRetirePolicy

func (m *CommitRowMutation) SetRetirePolicy(s string)

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowMutation) SetScanStartNs

func (m *CommitRowMutation) SetScanStartNs(i int64)

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowMutation) SetSetID

func (m *CommitRowMutation) SetSetID(i int64)

SetSetID sets the "set_id" field.

func (*CommitRowMutation) SetTimestamp

func (m *CommitRowMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*CommitRowMutation) SetTombstonedAt

func (m *CommitRowMutation) SetTombstonedAt(t time.Time)

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowMutation) SetTree

func (m *CommitRowMutation) SetTree(b []byte)

SetTree sets the "tree" field.

func (*CommitRowMutation) Timestamp

func (m *CommitRowMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*CommitRowMutation) TombstonedAt

func (m *CommitRowMutation) TombstonedAt() (r time.Time, exists bool)

TombstonedAt returns the value of the "tombstoned_at" field in the mutation.

func (*CommitRowMutation) TombstonedAtCleared

func (m *CommitRowMutation) TombstonedAtCleared() bool

TombstonedAtCleared returns if the "tombstoned_at" field was cleared in this mutation.

func (*CommitRowMutation) Tree

func (m *CommitRowMutation) Tree() (r []byte, exists bool)

Tree returns the value of the "tree" field in the mutation.

func (CommitRowMutation) Tx

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

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

func (*CommitRowMutation) Type

func (m *CommitRowMutation) Type() string

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

func (*CommitRowMutation) Where

func (m *CommitRowMutation) Where(ps ...predicate.CommitRow)

Where appends a list predicates to the CommitRowMutation builder.

func (*CommitRowMutation) WhereP

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

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

type CommitRowQuery

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

CommitRowQuery is the builder for querying CommitRow entities.

func (*CommitRowQuery) Aggregate

func (_q *CommitRowQuery) Aggregate(fns ...AggregateFunc) *CommitRowSelect

Aggregate returns a CommitRowSelect configured with the given aggregations.

func (*CommitRowQuery) All

func (_q *CommitRowQuery) All(ctx context.Context) ([]*CommitRow, error)

All executes the query and returns a list of CommitRows.

func (*CommitRowQuery) AllX

func (_q *CommitRowQuery) AllX(ctx context.Context) []*CommitRow

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

func (*CommitRowQuery) Clone

func (_q *CommitRowQuery) Clone() *CommitRowQuery

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

func (*CommitRowQuery) Count

func (_q *CommitRowQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CommitRowQuery) CountX

func (_q *CommitRowQuery) CountX(ctx context.Context) int

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

func (*CommitRowQuery) ExecContext

func (c *CommitRowQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowQuery) Exist

func (_q *CommitRowQuery) Exist(ctx context.Context) (bool, error)

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

func (*CommitRowQuery) ExistX

func (_q *CommitRowQuery) ExistX(ctx context.Context) bool

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

func (*CommitRowQuery) First

func (_q *CommitRowQuery) First(ctx context.Context) (*CommitRow, error)

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

func (*CommitRowQuery) FirstID

func (_q *CommitRowQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CommitRowQuery) FirstIDX

func (_q *CommitRowQuery) FirstIDX(ctx context.Context) int

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

func (*CommitRowQuery) FirstX

func (_q *CommitRowQuery) FirstX(ctx context.Context) *CommitRow

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

func (*CommitRowQuery) ForShare

func (_q *CommitRowQuery) ForShare(opts ...sql.LockOption) *CommitRowQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*CommitRowQuery) ForUpdate

func (_q *CommitRowQuery) ForUpdate(opts ...sql.LockOption) *CommitRowQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*CommitRowQuery) GroupBy

func (_q *CommitRowQuery) GroupBy(field string, fields ...string) *CommitRowGroupBy

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 {
	Ref []byte `json:"ref,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CommitRow.Query().
	GroupBy(commitrow.FieldRef).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CommitRowQuery) IDs

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

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

func (*CommitRowQuery) IDsX

func (_q *CommitRowQuery) IDsX(ctx context.Context) []int

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

func (*CommitRowQuery) Limit

func (_q *CommitRowQuery) Limit(limit int) *CommitRowQuery

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

func (*CommitRowQuery) Offset

func (_q *CommitRowQuery) Offset(offset int) *CommitRowQuery

Offset to start from.

func (*CommitRowQuery) Only

func (_q *CommitRowQuery) Only(ctx context.Context) (*CommitRow, error)

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

func (*CommitRowQuery) OnlyID

func (_q *CommitRowQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CommitRowQuery) OnlyIDX

func (_q *CommitRowQuery) OnlyIDX(ctx context.Context) int

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

func (*CommitRowQuery) OnlyX

func (_q *CommitRowQuery) OnlyX(ctx context.Context) *CommitRow

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

func (*CommitRowQuery) Order

Order specifies how the records should be ordered.

func (*CommitRowQuery) QueryContext

func (c *CommitRowQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowQuery) QuerySet

func (_q *CommitRowQuery) QuerySet() *SetQuery

QuerySet chains the current query on the "set" edge.

func (*CommitRowQuery) Select

func (_q *CommitRowQuery) Select(fields ...string) *CommitRowSelect

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 {
	Ref []byte `json:"ref,omitempty"`
}

client.CommitRow.Query().
	Select(commitrow.FieldRef).
	Scan(ctx, &v)

func (*CommitRowQuery) Unique

func (_q *CommitRowQuery) Unique(unique bool) *CommitRowQuery

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

Where adds a new predicate for the CommitRowQuery builder.

func (*CommitRowQuery) WithSet

func (_q *CommitRowQuery) WithSet(opts ...func(*SetQuery)) *CommitRowQuery

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

type CommitRowSelect

type CommitRowSelect struct {
	*CommitRowQuery
	// contains filtered or unexported fields
}

CommitRowSelect is the builder for selecting fields of CommitRow entities.

func (*CommitRowSelect) Aggregate

func (_s *CommitRowSelect) Aggregate(fns ...AggregateFunc) *CommitRowSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CommitRowSelect) Bool

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

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

func (*CommitRowSelect) BoolX

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

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

func (*CommitRowSelect) Bools

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

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

func (*CommitRowSelect) BoolsX

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

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

func (CommitRowSelect) ExecContext

func (c CommitRowSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowSelect) Float64

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

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

func (*CommitRowSelect) Float64X

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

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

func (*CommitRowSelect) Float64s

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

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

func (*CommitRowSelect) Float64sX

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

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

func (*CommitRowSelect) Int

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

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

func (*CommitRowSelect) IntX

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

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

func (*CommitRowSelect) Ints

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

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

func (*CommitRowSelect) IntsX

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

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

func (CommitRowSelect) QueryContext

func (c CommitRowSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowSelect) Scan

func (_s *CommitRowSelect) Scan(ctx context.Context, v any) error

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

func (*CommitRowSelect) ScanX

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

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

func (*CommitRowSelect) String

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

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

func (*CommitRowSelect) StringX

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

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

func (*CommitRowSelect) Strings

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

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

func (*CommitRowSelect) StringsX

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

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

type CommitRowUpdate

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

CommitRowUpdate is the builder for updating CommitRow entities.

func (*CommitRowUpdate) AddFileCount

func (_u *CommitRowUpdate) AddFileCount(v int64) *CommitRowUpdate

AddFileCount adds value to the "file_count" field.

func (*CommitRowUpdate) AddLogicalSize

func (_u *CommitRowUpdate) AddLogicalSize(v int64) *CommitRowUpdate

AddLogicalSize adds value to the "logical_size" field.

func (*CommitRowUpdate) AddPolicyVersion

func (_u *CommitRowUpdate) AddPolicyVersion(v int32) *CommitRowUpdate

AddPolicyVersion adds value to the "policy_version" field.

func (*CommitRowUpdate) AddScanStartNs

func (_u *CommitRowUpdate) AddScanStartNs(v int64) *CommitRowUpdate

AddScanStartNs adds value to the "scan_start_ns" field.

func (*CommitRowUpdate) ClearDeletedAt

func (_u *CommitRowUpdate) ClearDeletedAt() *CommitRowUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommitRowUpdate) ClearExpiresAt

func (_u *CommitRowUpdate) ClearExpiresAt() *CommitRowUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*CommitRowUpdate) ClearFileCount

func (_u *CommitRowUpdate) ClearFileCount() *CommitRowUpdate

ClearFileCount clears the value of the "file_count" field.

func (*CommitRowUpdate) ClearKeyID

func (_u *CommitRowUpdate) ClearKeyID() *CommitRowUpdate

ClearKeyID clears the value of the "key_id" field.

func (*CommitRowUpdate) ClearLogicalSize

func (_u *CommitRowUpdate) ClearLogicalSize() *CommitRowUpdate

ClearLogicalSize clears the value of the "logical_size" field.

func (*CommitRowUpdate) ClearMetadata

func (_u *CommitRowUpdate) ClearMetadata() *CommitRowUpdate

ClearMetadata clears the value of the "metadata" field.

func (*CommitRowUpdate) ClearParent

func (_u *CommitRowUpdate) ClearParent() *CommitRowUpdate

ClearParent clears the value of the "parent" field.

func (*CommitRowUpdate) ClearPresence

func (_u *CommitRowUpdate) ClearPresence() *CommitRowUpdate

ClearPresence clears the value of the "presence" field.

func (*CommitRowUpdate) ClearRetireAt

func (_u *CommitRowUpdate) ClearRetireAt() *CommitRowUpdate

ClearRetireAt clears the value of the "retire_at" field.

func (*CommitRowUpdate) ClearRetirePolicy

func (_u *CommitRowUpdate) ClearRetirePolicy() *CommitRowUpdate

ClearRetirePolicy clears the value of the "retire_policy" field.

func (*CommitRowUpdate) ClearSet

func (_u *CommitRowUpdate) ClearSet() *CommitRowUpdate

ClearSet clears the "set" edge to the Set entity.

func (*CommitRowUpdate) ClearTombstonedAt

func (_u *CommitRowUpdate) ClearTombstonedAt() *CommitRowUpdate

ClearTombstonedAt clears the value of the "tombstoned_at" field.

func (*CommitRowUpdate) Exec

func (_u *CommitRowUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommitRowUpdate) ExecContext

func (c *CommitRowUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowUpdate) ExecX

func (_u *CommitRowUpdate) ExecX(ctx context.Context)

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

func (*CommitRowUpdate) Mutation

func (_u *CommitRowUpdate) Mutation() *CommitRowMutation

Mutation returns the CommitRowMutation object of the builder.

func (*CommitRowUpdate) QueryContext

func (c *CommitRowUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowUpdate) Save

func (_u *CommitRowUpdate) Save(ctx context.Context) (int, error)

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

func (*CommitRowUpdate) SaveX

func (_u *CommitRowUpdate) SaveX(ctx context.Context) int

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

func (*CommitRowUpdate) SetAgentID

func (_u *CommitRowUpdate) SetAgentID(v string) *CommitRowUpdate

SetAgentID sets the "agent_id" field.

func (*CommitRowUpdate) SetConsistent

func (_u *CommitRowUpdate) SetConsistent(v bool) *CommitRowUpdate

SetConsistent sets the "consistent" field.

func (*CommitRowUpdate) SetDeletedAt

func (_u *CommitRowUpdate) SetDeletedAt(v time.Time) *CommitRowUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowUpdate) SetExpiresAt

func (_u *CommitRowUpdate) SetExpiresAt(v time.Time) *CommitRowUpdate

SetExpiresAt sets the "expires_at" field.

func (*CommitRowUpdate) SetFileCount

func (_u *CommitRowUpdate) SetFileCount(v int64) *CommitRowUpdate

SetFileCount sets the "file_count" field.

func (*CommitRowUpdate) SetIncomplete

func (_u *CommitRowUpdate) SetIncomplete(v bool) *CommitRowUpdate

SetIncomplete sets the "incomplete" field.

func (*CommitRowUpdate) SetKeyID

func (_u *CommitRowUpdate) SetKeyID(v string) *CommitRowUpdate

SetKeyID sets the "key_id" field.

func (*CommitRowUpdate) SetLogicalSize

func (_u *CommitRowUpdate) SetLogicalSize(v int64) *CommitRowUpdate

SetLogicalSize sets the "logical_size" field.

func (*CommitRowUpdate) SetMetadata

func (_u *CommitRowUpdate) SetMetadata(v map[string]string) *CommitRowUpdate

SetMetadata sets the "metadata" field.

func (*CommitRowUpdate) SetNillableAgentID

func (_u *CommitRowUpdate) SetNillableAgentID(v *string) *CommitRowUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableConsistent

func (_u *CommitRowUpdate) SetNillableConsistent(v *bool) *CommitRowUpdate

SetNillableConsistent sets the "consistent" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableDeletedAt

func (_u *CommitRowUpdate) SetNillableDeletedAt(v *time.Time) *CommitRowUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableExpiresAt

func (_u *CommitRowUpdate) SetNillableExpiresAt(v *time.Time) *CommitRowUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableFileCount

func (_u *CommitRowUpdate) SetNillableFileCount(v *int64) *CommitRowUpdate

SetNillableFileCount sets the "file_count" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableIncomplete

func (_u *CommitRowUpdate) SetNillableIncomplete(v *bool) *CommitRowUpdate

SetNillableIncomplete sets the "incomplete" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableKeyID

func (_u *CommitRowUpdate) SetNillableKeyID(v *string) *CommitRowUpdate

SetNillableKeyID sets the "key_id" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableLogicalSize

func (_u *CommitRowUpdate) SetNillableLogicalSize(v *int64) *CommitRowUpdate

SetNillableLogicalSize sets the "logical_size" field if the given value is not nil.

func (*CommitRowUpdate) SetNillablePartial

func (_u *CommitRowUpdate) SetNillablePartial(v *bool) *CommitRowUpdate

SetNillablePartial sets the "partial" field if the given value is not nil.

func (*CommitRowUpdate) SetNillablePolicyVersion

func (_u *CommitRowUpdate) SetNillablePolicyVersion(v *uint32) *CommitRowUpdate

SetNillablePolicyVersion sets the "policy_version" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableReceivedAt

func (_u *CommitRowUpdate) SetNillableReceivedAt(v *time.Time) *CommitRowUpdate

SetNillableReceivedAt sets the "received_at" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableRetainedBy

func (_u *CommitRowUpdate) SetNillableRetainedBy(v *string) *CommitRowUpdate

SetNillableRetainedBy sets the "retained_by" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableRetireAt

func (_u *CommitRowUpdate) SetNillableRetireAt(v *time.Time) *CommitRowUpdate

SetNillableRetireAt sets the "retire_at" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableRetirePolicy

func (_u *CommitRowUpdate) SetNillableRetirePolicy(v *string) *CommitRowUpdate

SetNillableRetirePolicy sets the "retire_policy" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableScanStartNs

func (_u *CommitRowUpdate) SetNillableScanStartNs(v *int64) *CommitRowUpdate

SetNillableScanStartNs sets the "scan_start_ns" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableSetID

func (_u *CommitRowUpdate) SetNillableSetID(v *int64) *CommitRowUpdate

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableTimestamp

func (_u *CommitRowUpdate) SetNillableTimestamp(v *time.Time) *CommitRowUpdate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*CommitRowUpdate) SetNillableTombstonedAt

func (_u *CommitRowUpdate) SetNillableTombstonedAt(v *time.Time) *CommitRowUpdate

SetNillableTombstonedAt sets the "tombstoned_at" field if the given value is not nil.

func (*CommitRowUpdate) SetParent

func (_u *CommitRowUpdate) SetParent(v []byte) *CommitRowUpdate

SetParent sets the "parent" field.

func (*CommitRowUpdate) SetPartial

func (_u *CommitRowUpdate) SetPartial(v bool) *CommitRowUpdate

SetPartial sets the "partial" field.

func (*CommitRowUpdate) SetPolicyVersion

func (_u *CommitRowUpdate) SetPolicyVersion(v uint32) *CommitRowUpdate

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowUpdate) SetPresence

func (_u *CommitRowUpdate) SetPresence(v []byte) *CommitRowUpdate

SetPresence sets the "presence" field.

func (*CommitRowUpdate) SetReceivedAt

func (_u *CommitRowUpdate) SetReceivedAt(v time.Time) *CommitRowUpdate

SetReceivedAt sets the "received_at" field.

func (*CommitRowUpdate) SetRetainedBy

func (_u *CommitRowUpdate) SetRetainedBy(v string) *CommitRowUpdate

SetRetainedBy sets the "retained_by" field.

func (*CommitRowUpdate) SetRetireAt

func (_u *CommitRowUpdate) SetRetireAt(v time.Time) *CommitRowUpdate

SetRetireAt sets the "retire_at" field.

func (*CommitRowUpdate) SetRetirePolicy

func (_u *CommitRowUpdate) SetRetirePolicy(v string) *CommitRowUpdate

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowUpdate) SetScanStartNs

func (_u *CommitRowUpdate) SetScanStartNs(v int64) *CommitRowUpdate

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowUpdate) SetSet

func (_u *CommitRowUpdate) SetSet(v *Set) *CommitRowUpdate

SetSet sets the "set" edge to the Set entity.

func (*CommitRowUpdate) SetSetID

func (_u *CommitRowUpdate) SetSetID(v int64) *CommitRowUpdate

SetSetID sets the "set_id" field.

func (*CommitRowUpdate) SetTimestamp

func (_u *CommitRowUpdate) SetTimestamp(v time.Time) *CommitRowUpdate

SetTimestamp sets the "timestamp" field.

func (*CommitRowUpdate) SetTombstonedAt

func (_u *CommitRowUpdate) SetTombstonedAt(v time.Time) *CommitRowUpdate

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowUpdate) SetTree

func (_u *CommitRowUpdate) SetTree(v []byte) *CommitRowUpdate

SetTree sets the "tree" field.

func (*CommitRowUpdate) Where

Where appends a list predicates to the CommitRowUpdate builder.

type CommitRowUpdateOne

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

CommitRowUpdateOne is the builder for updating a single CommitRow entity.

func (*CommitRowUpdateOne) AddFileCount

func (_u *CommitRowUpdateOne) AddFileCount(v int64) *CommitRowUpdateOne

AddFileCount adds value to the "file_count" field.

func (*CommitRowUpdateOne) AddLogicalSize

func (_u *CommitRowUpdateOne) AddLogicalSize(v int64) *CommitRowUpdateOne

AddLogicalSize adds value to the "logical_size" field.

func (*CommitRowUpdateOne) AddPolicyVersion

func (_u *CommitRowUpdateOne) AddPolicyVersion(v int32) *CommitRowUpdateOne

AddPolicyVersion adds value to the "policy_version" field.

func (*CommitRowUpdateOne) AddScanStartNs

func (_u *CommitRowUpdateOne) AddScanStartNs(v int64) *CommitRowUpdateOne

AddScanStartNs adds value to the "scan_start_ns" field.

func (*CommitRowUpdateOne) ClearDeletedAt

func (_u *CommitRowUpdateOne) ClearDeletedAt() *CommitRowUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommitRowUpdateOne) ClearExpiresAt

func (_u *CommitRowUpdateOne) ClearExpiresAt() *CommitRowUpdateOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*CommitRowUpdateOne) ClearFileCount

func (_u *CommitRowUpdateOne) ClearFileCount() *CommitRowUpdateOne

ClearFileCount clears the value of the "file_count" field.

func (*CommitRowUpdateOne) ClearKeyID

func (_u *CommitRowUpdateOne) ClearKeyID() *CommitRowUpdateOne

ClearKeyID clears the value of the "key_id" field.

func (*CommitRowUpdateOne) ClearLogicalSize

func (_u *CommitRowUpdateOne) ClearLogicalSize() *CommitRowUpdateOne

ClearLogicalSize clears the value of the "logical_size" field.

func (*CommitRowUpdateOne) ClearMetadata

func (_u *CommitRowUpdateOne) ClearMetadata() *CommitRowUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*CommitRowUpdateOne) ClearParent

func (_u *CommitRowUpdateOne) ClearParent() *CommitRowUpdateOne

ClearParent clears the value of the "parent" field.

func (*CommitRowUpdateOne) ClearPresence

func (_u *CommitRowUpdateOne) ClearPresence() *CommitRowUpdateOne

ClearPresence clears the value of the "presence" field.

func (*CommitRowUpdateOne) ClearRetireAt

func (_u *CommitRowUpdateOne) ClearRetireAt() *CommitRowUpdateOne

ClearRetireAt clears the value of the "retire_at" field.

func (*CommitRowUpdateOne) ClearRetirePolicy

func (_u *CommitRowUpdateOne) ClearRetirePolicy() *CommitRowUpdateOne

ClearRetirePolicy clears the value of the "retire_policy" field.

func (*CommitRowUpdateOne) ClearSet

func (_u *CommitRowUpdateOne) ClearSet() *CommitRowUpdateOne

ClearSet clears the "set" edge to the Set entity.

func (*CommitRowUpdateOne) ClearTombstonedAt

func (_u *CommitRowUpdateOne) ClearTombstonedAt() *CommitRowUpdateOne

ClearTombstonedAt clears the value of the "tombstoned_at" field.

func (*CommitRowUpdateOne) Exec

func (_u *CommitRowUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommitRowUpdateOne) ExecContext

func (c *CommitRowUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CommitRowUpdateOne) ExecX

func (_u *CommitRowUpdateOne) ExecX(ctx context.Context)

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

func (*CommitRowUpdateOne) Mutation

func (_u *CommitRowUpdateOne) Mutation() *CommitRowMutation

Mutation returns the CommitRowMutation object of the builder.

func (*CommitRowUpdateOne) QueryContext

func (c *CommitRowUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CommitRowUpdateOne) Save

func (_u *CommitRowUpdateOne) Save(ctx context.Context) (*CommitRow, error)

Save executes the query and returns the updated CommitRow entity.

func (*CommitRowUpdateOne) SaveX

func (_u *CommitRowUpdateOne) SaveX(ctx context.Context) *CommitRow

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

func (*CommitRowUpdateOne) Select

func (_u *CommitRowUpdateOne) Select(field string, fields ...string) *CommitRowUpdateOne

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

func (*CommitRowUpdateOne) SetAgentID

func (_u *CommitRowUpdateOne) SetAgentID(v string) *CommitRowUpdateOne

SetAgentID sets the "agent_id" field.

func (*CommitRowUpdateOne) SetConsistent

func (_u *CommitRowUpdateOne) SetConsistent(v bool) *CommitRowUpdateOne

SetConsistent sets the "consistent" field.

func (*CommitRowUpdateOne) SetDeletedAt

func (_u *CommitRowUpdateOne) SetDeletedAt(v time.Time) *CommitRowUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowUpdateOne) SetExpiresAt

func (_u *CommitRowUpdateOne) SetExpiresAt(v time.Time) *CommitRowUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*CommitRowUpdateOne) SetFileCount

func (_u *CommitRowUpdateOne) SetFileCount(v int64) *CommitRowUpdateOne

SetFileCount sets the "file_count" field.

func (*CommitRowUpdateOne) SetIncomplete

func (_u *CommitRowUpdateOne) SetIncomplete(v bool) *CommitRowUpdateOne

SetIncomplete sets the "incomplete" field.

func (*CommitRowUpdateOne) SetKeyID

func (_u *CommitRowUpdateOne) SetKeyID(v string) *CommitRowUpdateOne

SetKeyID sets the "key_id" field.

func (*CommitRowUpdateOne) SetLogicalSize

func (_u *CommitRowUpdateOne) SetLogicalSize(v int64) *CommitRowUpdateOne

SetLogicalSize sets the "logical_size" field.

func (*CommitRowUpdateOne) SetMetadata

func (_u *CommitRowUpdateOne) SetMetadata(v map[string]string) *CommitRowUpdateOne

SetMetadata sets the "metadata" field.

func (*CommitRowUpdateOne) SetNillableAgentID

func (_u *CommitRowUpdateOne) SetNillableAgentID(v *string) *CommitRowUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableConsistent

func (_u *CommitRowUpdateOne) SetNillableConsistent(v *bool) *CommitRowUpdateOne

SetNillableConsistent sets the "consistent" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableDeletedAt

func (_u *CommitRowUpdateOne) SetNillableDeletedAt(v *time.Time) *CommitRowUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableExpiresAt

func (_u *CommitRowUpdateOne) SetNillableExpiresAt(v *time.Time) *CommitRowUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableFileCount

func (_u *CommitRowUpdateOne) SetNillableFileCount(v *int64) *CommitRowUpdateOne

SetNillableFileCount sets the "file_count" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableIncomplete

func (_u *CommitRowUpdateOne) SetNillableIncomplete(v *bool) *CommitRowUpdateOne

SetNillableIncomplete sets the "incomplete" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableKeyID

func (_u *CommitRowUpdateOne) SetNillableKeyID(v *string) *CommitRowUpdateOne

SetNillableKeyID sets the "key_id" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableLogicalSize

func (_u *CommitRowUpdateOne) SetNillableLogicalSize(v *int64) *CommitRowUpdateOne

SetNillableLogicalSize sets the "logical_size" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillablePartial

func (_u *CommitRowUpdateOne) SetNillablePartial(v *bool) *CommitRowUpdateOne

SetNillablePartial sets the "partial" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillablePolicyVersion

func (_u *CommitRowUpdateOne) SetNillablePolicyVersion(v *uint32) *CommitRowUpdateOne

SetNillablePolicyVersion sets the "policy_version" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableReceivedAt

func (_u *CommitRowUpdateOne) SetNillableReceivedAt(v *time.Time) *CommitRowUpdateOne

SetNillableReceivedAt sets the "received_at" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableRetainedBy

func (_u *CommitRowUpdateOne) SetNillableRetainedBy(v *string) *CommitRowUpdateOne

SetNillableRetainedBy sets the "retained_by" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableRetireAt

func (_u *CommitRowUpdateOne) SetNillableRetireAt(v *time.Time) *CommitRowUpdateOne

SetNillableRetireAt sets the "retire_at" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableRetirePolicy

func (_u *CommitRowUpdateOne) SetNillableRetirePolicy(v *string) *CommitRowUpdateOne

SetNillableRetirePolicy sets the "retire_policy" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableScanStartNs

func (_u *CommitRowUpdateOne) SetNillableScanStartNs(v *int64) *CommitRowUpdateOne

SetNillableScanStartNs sets the "scan_start_ns" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableSetID

func (_u *CommitRowUpdateOne) SetNillableSetID(v *int64) *CommitRowUpdateOne

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableTimestamp

func (_u *CommitRowUpdateOne) SetNillableTimestamp(v *time.Time) *CommitRowUpdateOne

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*CommitRowUpdateOne) SetNillableTombstonedAt

func (_u *CommitRowUpdateOne) SetNillableTombstonedAt(v *time.Time) *CommitRowUpdateOne

SetNillableTombstonedAt sets the "tombstoned_at" field if the given value is not nil.

func (*CommitRowUpdateOne) SetParent

func (_u *CommitRowUpdateOne) SetParent(v []byte) *CommitRowUpdateOne

SetParent sets the "parent" field.

func (*CommitRowUpdateOne) SetPartial

func (_u *CommitRowUpdateOne) SetPartial(v bool) *CommitRowUpdateOne

SetPartial sets the "partial" field.

func (*CommitRowUpdateOne) SetPolicyVersion

func (_u *CommitRowUpdateOne) SetPolicyVersion(v uint32) *CommitRowUpdateOne

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowUpdateOne) SetPresence

func (_u *CommitRowUpdateOne) SetPresence(v []byte) *CommitRowUpdateOne

SetPresence sets the "presence" field.

func (*CommitRowUpdateOne) SetReceivedAt

func (_u *CommitRowUpdateOne) SetReceivedAt(v time.Time) *CommitRowUpdateOne

SetReceivedAt sets the "received_at" field.

func (*CommitRowUpdateOne) SetRetainedBy

func (_u *CommitRowUpdateOne) SetRetainedBy(v string) *CommitRowUpdateOne

SetRetainedBy sets the "retained_by" field.

func (*CommitRowUpdateOne) SetRetireAt

func (_u *CommitRowUpdateOne) SetRetireAt(v time.Time) *CommitRowUpdateOne

SetRetireAt sets the "retire_at" field.

func (*CommitRowUpdateOne) SetRetirePolicy

func (_u *CommitRowUpdateOne) SetRetirePolicy(v string) *CommitRowUpdateOne

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowUpdateOne) SetScanStartNs

func (_u *CommitRowUpdateOne) SetScanStartNs(v int64) *CommitRowUpdateOne

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowUpdateOne) SetSet

func (_u *CommitRowUpdateOne) SetSet(v *Set) *CommitRowUpdateOne

SetSet sets the "set" edge to the Set entity.

func (*CommitRowUpdateOne) SetSetID

func (_u *CommitRowUpdateOne) SetSetID(v int64) *CommitRowUpdateOne

SetSetID sets the "set_id" field.

func (*CommitRowUpdateOne) SetTimestamp

func (_u *CommitRowUpdateOne) SetTimestamp(v time.Time) *CommitRowUpdateOne

SetTimestamp sets the "timestamp" field.

func (*CommitRowUpdateOne) SetTombstonedAt

func (_u *CommitRowUpdateOne) SetTombstonedAt(v time.Time) *CommitRowUpdateOne

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowUpdateOne) SetTree

func (_u *CommitRowUpdateOne) SetTree(v []byte) *CommitRowUpdateOne

SetTree sets the "tree" field.

func (*CommitRowUpdateOne) Where

Where appends a list predicates to the CommitRowUpdate builder.

type CommitRowUpsert

type CommitRowUpsert struct {
	*sql.UpdateSet
}

CommitRowUpsert is the "OnConflict" setter.

func (*CommitRowUpsert) AddFileCount

func (u *CommitRowUpsert) AddFileCount(v int64) *CommitRowUpsert

AddFileCount adds v to the "file_count" field.

func (*CommitRowUpsert) AddLogicalSize

func (u *CommitRowUpsert) AddLogicalSize(v int64) *CommitRowUpsert

AddLogicalSize adds v to the "logical_size" field.

func (*CommitRowUpsert) AddPolicyVersion

func (u *CommitRowUpsert) AddPolicyVersion(v uint32) *CommitRowUpsert

AddPolicyVersion adds v to the "policy_version" field.

func (*CommitRowUpsert) AddScanStartNs

func (u *CommitRowUpsert) AddScanStartNs(v int64) *CommitRowUpsert

AddScanStartNs adds v to the "scan_start_ns" field.

func (*CommitRowUpsert) ClearDeletedAt

func (u *CommitRowUpsert) ClearDeletedAt() *CommitRowUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommitRowUpsert) ClearExpiresAt

func (u *CommitRowUpsert) ClearExpiresAt() *CommitRowUpsert

ClearExpiresAt clears the value of the "expires_at" field.

func (*CommitRowUpsert) ClearFileCount

func (u *CommitRowUpsert) ClearFileCount() *CommitRowUpsert

ClearFileCount clears the value of the "file_count" field.

func (*CommitRowUpsert) ClearKeyID

func (u *CommitRowUpsert) ClearKeyID() *CommitRowUpsert

ClearKeyID clears the value of the "key_id" field.

func (*CommitRowUpsert) ClearLogicalSize

func (u *CommitRowUpsert) ClearLogicalSize() *CommitRowUpsert

ClearLogicalSize clears the value of the "logical_size" field.

func (*CommitRowUpsert) ClearMetadata

func (u *CommitRowUpsert) ClearMetadata() *CommitRowUpsert

ClearMetadata clears the value of the "metadata" field.

func (*CommitRowUpsert) ClearParent

func (u *CommitRowUpsert) ClearParent() *CommitRowUpsert

ClearParent clears the value of the "parent" field.

func (*CommitRowUpsert) ClearPresence

func (u *CommitRowUpsert) ClearPresence() *CommitRowUpsert

ClearPresence clears the value of the "presence" field.

func (*CommitRowUpsert) ClearRetireAt

func (u *CommitRowUpsert) ClearRetireAt() *CommitRowUpsert

ClearRetireAt clears the value of the "retire_at" field.

func (*CommitRowUpsert) ClearRetirePolicy

func (u *CommitRowUpsert) ClearRetirePolicy() *CommitRowUpsert

ClearRetirePolicy clears the value of the "retire_policy" field.

func (*CommitRowUpsert) ClearTombstonedAt

func (u *CommitRowUpsert) ClearTombstonedAt() *CommitRowUpsert

ClearTombstonedAt clears the value of the "tombstoned_at" field.

func (*CommitRowUpsert) SetAgentID

func (u *CommitRowUpsert) SetAgentID(v string) *CommitRowUpsert

SetAgentID sets the "agent_id" field.

func (*CommitRowUpsert) SetConsistent

func (u *CommitRowUpsert) SetConsistent(v bool) *CommitRowUpsert

SetConsistent sets the "consistent" field.

func (*CommitRowUpsert) SetDeletedAt

func (u *CommitRowUpsert) SetDeletedAt(v time.Time) *CommitRowUpsert

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowUpsert) SetExpiresAt

func (u *CommitRowUpsert) SetExpiresAt(v time.Time) *CommitRowUpsert

SetExpiresAt sets the "expires_at" field.

func (*CommitRowUpsert) SetFileCount

func (u *CommitRowUpsert) SetFileCount(v int64) *CommitRowUpsert

SetFileCount sets the "file_count" field.

func (*CommitRowUpsert) SetIncomplete

func (u *CommitRowUpsert) SetIncomplete(v bool) *CommitRowUpsert

SetIncomplete sets the "incomplete" field.

func (*CommitRowUpsert) SetKeyID

func (u *CommitRowUpsert) SetKeyID(v string) *CommitRowUpsert

SetKeyID sets the "key_id" field.

func (*CommitRowUpsert) SetLogicalSize

func (u *CommitRowUpsert) SetLogicalSize(v int64) *CommitRowUpsert

SetLogicalSize sets the "logical_size" field.

func (*CommitRowUpsert) SetMetadata

func (u *CommitRowUpsert) SetMetadata(v map[string]string) *CommitRowUpsert

SetMetadata sets the "metadata" field.

func (*CommitRowUpsert) SetParent

func (u *CommitRowUpsert) SetParent(v []byte) *CommitRowUpsert

SetParent sets the "parent" field.

func (*CommitRowUpsert) SetPartial

func (u *CommitRowUpsert) SetPartial(v bool) *CommitRowUpsert

SetPartial sets the "partial" field.

func (*CommitRowUpsert) SetPolicyVersion

func (u *CommitRowUpsert) SetPolicyVersion(v uint32) *CommitRowUpsert

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowUpsert) SetPresence

func (u *CommitRowUpsert) SetPresence(v []byte) *CommitRowUpsert

SetPresence sets the "presence" field.

func (*CommitRowUpsert) SetReceivedAt

func (u *CommitRowUpsert) SetReceivedAt(v time.Time) *CommitRowUpsert

SetReceivedAt sets the "received_at" field.

func (*CommitRowUpsert) SetRetainedBy

func (u *CommitRowUpsert) SetRetainedBy(v string) *CommitRowUpsert

SetRetainedBy sets the "retained_by" field.

func (*CommitRowUpsert) SetRetireAt

func (u *CommitRowUpsert) SetRetireAt(v time.Time) *CommitRowUpsert

SetRetireAt sets the "retire_at" field.

func (*CommitRowUpsert) SetRetirePolicy

func (u *CommitRowUpsert) SetRetirePolicy(v string) *CommitRowUpsert

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowUpsert) SetScanStartNs

func (u *CommitRowUpsert) SetScanStartNs(v int64) *CommitRowUpsert

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowUpsert) SetSetID

func (u *CommitRowUpsert) SetSetID(v int64) *CommitRowUpsert

SetSetID sets the "set_id" field.

func (*CommitRowUpsert) SetTimestamp

func (u *CommitRowUpsert) SetTimestamp(v time.Time) *CommitRowUpsert

SetTimestamp sets the "timestamp" field.

func (*CommitRowUpsert) SetTombstonedAt

func (u *CommitRowUpsert) SetTombstonedAt(v time.Time) *CommitRowUpsert

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowUpsert) SetTree

func (u *CommitRowUpsert) SetTree(v []byte) *CommitRowUpsert

SetTree sets the "tree" field.

func (*CommitRowUpsert) UpdateAgentID

func (u *CommitRowUpsert) UpdateAgentID() *CommitRowUpsert

UpdateAgentID sets the "agent_id" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateConsistent

func (u *CommitRowUpsert) UpdateConsistent() *CommitRowUpsert

UpdateConsistent sets the "consistent" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateDeletedAt

func (u *CommitRowUpsert) UpdateDeletedAt() *CommitRowUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateExpiresAt

func (u *CommitRowUpsert) UpdateExpiresAt() *CommitRowUpsert

UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateFileCount

func (u *CommitRowUpsert) UpdateFileCount() *CommitRowUpsert

UpdateFileCount sets the "file_count" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateIncomplete

func (u *CommitRowUpsert) UpdateIncomplete() *CommitRowUpsert

UpdateIncomplete sets the "incomplete" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateKeyID

func (u *CommitRowUpsert) UpdateKeyID() *CommitRowUpsert

UpdateKeyID sets the "key_id" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateLogicalSize

func (u *CommitRowUpsert) UpdateLogicalSize() *CommitRowUpsert

UpdateLogicalSize sets the "logical_size" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateMetadata

func (u *CommitRowUpsert) UpdateMetadata() *CommitRowUpsert

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateParent

func (u *CommitRowUpsert) UpdateParent() *CommitRowUpsert

UpdateParent sets the "parent" field to the value that was provided on create.

func (*CommitRowUpsert) UpdatePartial

func (u *CommitRowUpsert) UpdatePartial() *CommitRowUpsert

UpdatePartial sets the "partial" field to the value that was provided on create.

func (*CommitRowUpsert) UpdatePolicyVersion

func (u *CommitRowUpsert) UpdatePolicyVersion() *CommitRowUpsert

UpdatePolicyVersion sets the "policy_version" field to the value that was provided on create.

func (*CommitRowUpsert) UpdatePresence

func (u *CommitRowUpsert) UpdatePresence() *CommitRowUpsert

UpdatePresence sets the "presence" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateReceivedAt

func (u *CommitRowUpsert) UpdateReceivedAt() *CommitRowUpsert

UpdateReceivedAt sets the "received_at" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateRetainedBy

func (u *CommitRowUpsert) UpdateRetainedBy() *CommitRowUpsert

UpdateRetainedBy sets the "retained_by" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateRetireAt

func (u *CommitRowUpsert) UpdateRetireAt() *CommitRowUpsert

UpdateRetireAt sets the "retire_at" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateRetirePolicy

func (u *CommitRowUpsert) UpdateRetirePolicy() *CommitRowUpsert

UpdateRetirePolicy sets the "retire_policy" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateScanStartNs

func (u *CommitRowUpsert) UpdateScanStartNs() *CommitRowUpsert

UpdateScanStartNs sets the "scan_start_ns" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateSetID

func (u *CommitRowUpsert) UpdateSetID() *CommitRowUpsert

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateTimestamp

func (u *CommitRowUpsert) UpdateTimestamp() *CommitRowUpsert

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateTombstonedAt

func (u *CommitRowUpsert) UpdateTombstonedAt() *CommitRowUpsert

UpdateTombstonedAt sets the "tombstoned_at" field to the value that was provided on create.

func (*CommitRowUpsert) UpdateTree

func (u *CommitRowUpsert) UpdateTree() *CommitRowUpsert

UpdateTree sets the "tree" field to the value that was provided on create.

type CommitRowUpsertBulk

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

CommitRowUpsertBulk is the builder for "upsert"-ing a bulk of CommitRow nodes.

func (*CommitRowUpsertBulk) AddFileCount

func (u *CommitRowUpsertBulk) AddFileCount(v int64) *CommitRowUpsertBulk

AddFileCount adds v to the "file_count" field.

func (*CommitRowUpsertBulk) AddLogicalSize

func (u *CommitRowUpsertBulk) AddLogicalSize(v int64) *CommitRowUpsertBulk

AddLogicalSize adds v to the "logical_size" field.

func (*CommitRowUpsertBulk) AddPolicyVersion

func (u *CommitRowUpsertBulk) AddPolicyVersion(v uint32) *CommitRowUpsertBulk

AddPolicyVersion adds v to the "policy_version" field.

func (*CommitRowUpsertBulk) AddScanStartNs

func (u *CommitRowUpsertBulk) AddScanStartNs(v int64) *CommitRowUpsertBulk

AddScanStartNs adds v to the "scan_start_ns" field.

func (*CommitRowUpsertBulk) ClearDeletedAt

func (u *CommitRowUpsertBulk) ClearDeletedAt() *CommitRowUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommitRowUpsertBulk) ClearExpiresAt

func (u *CommitRowUpsertBulk) ClearExpiresAt() *CommitRowUpsertBulk

ClearExpiresAt clears the value of the "expires_at" field.

func (*CommitRowUpsertBulk) ClearFileCount

func (u *CommitRowUpsertBulk) ClearFileCount() *CommitRowUpsertBulk

ClearFileCount clears the value of the "file_count" field.

func (*CommitRowUpsertBulk) ClearKeyID

func (u *CommitRowUpsertBulk) ClearKeyID() *CommitRowUpsertBulk

ClearKeyID clears the value of the "key_id" field.

func (*CommitRowUpsertBulk) ClearLogicalSize

func (u *CommitRowUpsertBulk) ClearLogicalSize() *CommitRowUpsertBulk

ClearLogicalSize clears the value of the "logical_size" field.

func (*CommitRowUpsertBulk) ClearMetadata

func (u *CommitRowUpsertBulk) ClearMetadata() *CommitRowUpsertBulk

ClearMetadata clears the value of the "metadata" field.

func (*CommitRowUpsertBulk) ClearParent

func (u *CommitRowUpsertBulk) ClearParent() *CommitRowUpsertBulk

ClearParent clears the value of the "parent" field.

func (*CommitRowUpsertBulk) ClearPresence

func (u *CommitRowUpsertBulk) ClearPresence() *CommitRowUpsertBulk

ClearPresence clears the value of the "presence" field.

func (*CommitRowUpsertBulk) ClearRetireAt

func (u *CommitRowUpsertBulk) ClearRetireAt() *CommitRowUpsertBulk

ClearRetireAt clears the value of the "retire_at" field.

func (*CommitRowUpsertBulk) ClearRetirePolicy

func (u *CommitRowUpsertBulk) ClearRetirePolicy() *CommitRowUpsertBulk

ClearRetirePolicy clears the value of the "retire_policy" field.

func (*CommitRowUpsertBulk) ClearTombstonedAt

func (u *CommitRowUpsertBulk) ClearTombstonedAt() *CommitRowUpsertBulk

ClearTombstonedAt clears the value of the "tombstoned_at" field.

func (*CommitRowUpsertBulk) DoNothing

func (u *CommitRowUpsertBulk) DoNothing() *CommitRowUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CommitRowUpsertBulk) Exec

Exec executes the query.

func (*CommitRowUpsertBulk) ExecX

func (u *CommitRowUpsertBulk) ExecX(ctx context.Context)

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

func (*CommitRowUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.CommitRow.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*CommitRowUpsertBulk) SetAgentID

SetAgentID sets the "agent_id" field.

func (*CommitRowUpsertBulk) SetConsistent

func (u *CommitRowUpsertBulk) SetConsistent(v bool) *CommitRowUpsertBulk

SetConsistent sets the "consistent" field.

func (*CommitRowUpsertBulk) SetDeletedAt

func (u *CommitRowUpsertBulk) SetDeletedAt(v time.Time) *CommitRowUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowUpsertBulk) SetExpiresAt

func (u *CommitRowUpsertBulk) SetExpiresAt(v time.Time) *CommitRowUpsertBulk

SetExpiresAt sets the "expires_at" field.

func (*CommitRowUpsertBulk) SetFileCount

func (u *CommitRowUpsertBulk) SetFileCount(v int64) *CommitRowUpsertBulk

SetFileCount sets the "file_count" field.

func (*CommitRowUpsertBulk) SetIncomplete

func (u *CommitRowUpsertBulk) SetIncomplete(v bool) *CommitRowUpsertBulk

SetIncomplete sets the "incomplete" field.

func (*CommitRowUpsertBulk) SetKeyID

SetKeyID sets the "key_id" field.

func (*CommitRowUpsertBulk) SetLogicalSize

func (u *CommitRowUpsertBulk) SetLogicalSize(v int64) *CommitRowUpsertBulk

SetLogicalSize sets the "logical_size" field.

func (*CommitRowUpsertBulk) SetMetadata

func (u *CommitRowUpsertBulk) SetMetadata(v map[string]string) *CommitRowUpsertBulk

SetMetadata sets the "metadata" field.

func (*CommitRowUpsertBulk) SetParent

func (u *CommitRowUpsertBulk) SetParent(v []byte) *CommitRowUpsertBulk

SetParent sets the "parent" field.

func (*CommitRowUpsertBulk) SetPartial

func (u *CommitRowUpsertBulk) SetPartial(v bool) *CommitRowUpsertBulk

SetPartial sets the "partial" field.

func (*CommitRowUpsertBulk) SetPolicyVersion

func (u *CommitRowUpsertBulk) SetPolicyVersion(v uint32) *CommitRowUpsertBulk

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowUpsertBulk) SetPresence

func (u *CommitRowUpsertBulk) SetPresence(v []byte) *CommitRowUpsertBulk

SetPresence sets the "presence" field.

func (*CommitRowUpsertBulk) SetReceivedAt

func (u *CommitRowUpsertBulk) SetReceivedAt(v time.Time) *CommitRowUpsertBulk

SetReceivedAt sets the "received_at" field.

func (*CommitRowUpsertBulk) SetRetainedBy

func (u *CommitRowUpsertBulk) SetRetainedBy(v string) *CommitRowUpsertBulk

SetRetainedBy sets the "retained_by" field.

func (*CommitRowUpsertBulk) SetRetireAt

func (u *CommitRowUpsertBulk) SetRetireAt(v time.Time) *CommitRowUpsertBulk

SetRetireAt sets the "retire_at" field.

func (*CommitRowUpsertBulk) SetRetirePolicy

func (u *CommitRowUpsertBulk) SetRetirePolicy(v string) *CommitRowUpsertBulk

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowUpsertBulk) SetScanStartNs

func (u *CommitRowUpsertBulk) SetScanStartNs(v int64) *CommitRowUpsertBulk

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowUpsertBulk) SetSetID

SetSetID sets the "set_id" field.

func (*CommitRowUpsertBulk) SetTimestamp

func (u *CommitRowUpsertBulk) SetTimestamp(v time.Time) *CommitRowUpsertBulk

SetTimestamp sets the "timestamp" field.

func (*CommitRowUpsertBulk) SetTombstonedAt

func (u *CommitRowUpsertBulk) SetTombstonedAt(v time.Time) *CommitRowUpsertBulk

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowUpsertBulk) SetTree

func (u *CommitRowUpsertBulk) SetTree(v []byte) *CommitRowUpsertBulk

SetTree sets the "tree" field.

func (*CommitRowUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the CommitRowCreateBulk.OnConflict documentation for more info.

func (*CommitRowUpsertBulk) UpdateAgentID

func (u *CommitRowUpsertBulk) UpdateAgentID() *CommitRowUpsertBulk

UpdateAgentID sets the "agent_id" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateConsistent

func (u *CommitRowUpsertBulk) UpdateConsistent() *CommitRowUpsertBulk

UpdateConsistent sets the "consistent" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateDeletedAt

func (u *CommitRowUpsertBulk) UpdateDeletedAt() *CommitRowUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateExpiresAt

func (u *CommitRowUpsertBulk) UpdateExpiresAt() *CommitRowUpsertBulk

UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateFileCount

func (u *CommitRowUpsertBulk) UpdateFileCount() *CommitRowUpsertBulk

UpdateFileCount sets the "file_count" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateIncomplete

func (u *CommitRowUpsertBulk) UpdateIncomplete() *CommitRowUpsertBulk

UpdateIncomplete sets the "incomplete" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateKeyID

func (u *CommitRowUpsertBulk) UpdateKeyID() *CommitRowUpsertBulk

UpdateKeyID sets the "key_id" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateLogicalSize

func (u *CommitRowUpsertBulk) UpdateLogicalSize() *CommitRowUpsertBulk

UpdateLogicalSize sets the "logical_size" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateMetadata

func (u *CommitRowUpsertBulk) UpdateMetadata() *CommitRowUpsertBulk

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateNewValues

func (u *CommitRowUpsertBulk) UpdateNewValues() *CommitRowUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.CommitRow.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*CommitRowUpsertBulk) UpdateParent

func (u *CommitRowUpsertBulk) UpdateParent() *CommitRowUpsertBulk

UpdateParent sets the "parent" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdatePartial

func (u *CommitRowUpsertBulk) UpdatePartial() *CommitRowUpsertBulk

UpdatePartial sets the "partial" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdatePolicyVersion

func (u *CommitRowUpsertBulk) UpdatePolicyVersion() *CommitRowUpsertBulk

UpdatePolicyVersion sets the "policy_version" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdatePresence

func (u *CommitRowUpsertBulk) UpdatePresence() *CommitRowUpsertBulk

UpdatePresence sets the "presence" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateReceivedAt

func (u *CommitRowUpsertBulk) UpdateReceivedAt() *CommitRowUpsertBulk

UpdateReceivedAt sets the "received_at" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateRetainedBy

func (u *CommitRowUpsertBulk) UpdateRetainedBy() *CommitRowUpsertBulk

UpdateRetainedBy sets the "retained_by" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateRetireAt

func (u *CommitRowUpsertBulk) UpdateRetireAt() *CommitRowUpsertBulk

UpdateRetireAt sets the "retire_at" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateRetirePolicy

func (u *CommitRowUpsertBulk) UpdateRetirePolicy() *CommitRowUpsertBulk

UpdateRetirePolicy sets the "retire_policy" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateScanStartNs

func (u *CommitRowUpsertBulk) UpdateScanStartNs() *CommitRowUpsertBulk

UpdateScanStartNs sets the "scan_start_ns" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateSetID

func (u *CommitRowUpsertBulk) UpdateSetID() *CommitRowUpsertBulk

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateTimestamp

func (u *CommitRowUpsertBulk) UpdateTimestamp() *CommitRowUpsertBulk

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateTombstonedAt

func (u *CommitRowUpsertBulk) UpdateTombstonedAt() *CommitRowUpsertBulk

UpdateTombstonedAt sets the "tombstoned_at" field to the value that was provided on create.

func (*CommitRowUpsertBulk) UpdateTree

func (u *CommitRowUpsertBulk) UpdateTree() *CommitRowUpsertBulk

UpdateTree sets the "tree" field to the value that was provided on create.

type CommitRowUpsertOne

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

CommitRowUpsertOne is the builder for "upsert"-ing

one CommitRow node.

func (*CommitRowUpsertOne) AddFileCount

func (u *CommitRowUpsertOne) AddFileCount(v int64) *CommitRowUpsertOne

AddFileCount adds v to the "file_count" field.

func (*CommitRowUpsertOne) AddLogicalSize

func (u *CommitRowUpsertOne) AddLogicalSize(v int64) *CommitRowUpsertOne

AddLogicalSize adds v to the "logical_size" field.

func (*CommitRowUpsertOne) AddPolicyVersion

func (u *CommitRowUpsertOne) AddPolicyVersion(v uint32) *CommitRowUpsertOne

AddPolicyVersion adds v to the "policy_version" field.

func (*CommitRowUpsertOne) AddScanStartNs

func (u *CommitRowUpsertOne) AddScanStartNs(v int64) *CommitRowUpsertOne

AddScanStartNs adds v to the "scan_start_ns" field.

func (*CommitRowUpsertOne) ClearDeletedAt

func (u *CommitRowUpsertOne) ClearDeletedAt() *CommitRowUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CommitRowUpsertOne) ClearExpiresAt

func (u *CommitRowUpsertOne) ClearExpiresAt() *CommitRowUpsertOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*CommitRowUpsertOne) ClearFileCount

func (u *CommitRowUpsertOne) ClearFileCount() *CommitRowUpsertOne

ClearFileCount clears the value of the "file_count" field.

func (*CommitRowUpsertOne) ClearKeyID

func (u *CommitRowUpsertOne) ClearKeyID() *CommitRowUpsertOne

ClearKeyID clears the value of the "key_id" field.

func (*CommitRowUpsertOne) ClearLogicalSize

func (u *CommitRowUpsertOne) ClearLogicalSize() *CommitRowUpsertOne

ClearLogicalSize clears the value of the "logical_size" field.

func (*CommitRowUpsertOne) ClearMetadata

func (u *CommitRowUpsertOne) ClearMetadata() *CommitRowUpsertOne

ClearMetadata clears the value of the "metadata" field.

func (*CommitRowUpsertOne) ClearParent

func (u *CommitRowUpsertOne) ClearParent() *CommitRowUpsertOne

ClearParent clears the value of the "parent" field.

func (*CommitRowUpsertOne) ClearPresence

func (u *CommitRowUpsertOne) ClearPresence() *CommitRowUpsertOne

ClearPresence clears the value of the "presence" field.

func (*CommitRowUpsertOne) ClearRetireAt

func (u *CommitRowUpsertOne) ClearRetireAt() *CommitRowUpsertOne

ClearRetireAt clears the value of the "retire_at" field.

func (*CommitRowUpsertOne) ClearRetirePolicy

func (u *CommitRowUpsertOne) ClearRetirePolicy() *CommitRowUpsertOne

ClearRetirePolicy clears the value of the "retire_policy" field.

func (*CommitRowUpsertOne) ClearTombstonedAt

func (u *CommitRowUpsertOne) ClearTombstonedAt() *CommitRowUpsertOne

ClearTombstonedAt clears the value of the "tombstoned_at" field.

func (*CommitRowUpsertOne) DoNothing

func (u *CommitRowUpsertOne) DoNothing() *CommitRowUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CommitRowUpsertOne) Exec

func (u *CommitRowUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*CommitRowUpsertOne) ExecX

func (u *CommitRowUpsertOne) ExecX(ctx context.Context)

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

func (*CommitRowUpsertOne) ID

func (u *CommitRowUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*CommitRowUpsertOne) IDX

func (u *CommitRowUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*CommitRowUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.CommitRow.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*CommitRowUpsertOne) SetAgentID

func (u *CommitRowUpsertOne) SetAgentID(v string) *CommitRowUpsertOne

SetAgentID sets the "agent_id" field.

func (*CommitRowUpsertOne) SetConsistent

func (u *CommitRowUpsertOne) SetConsistent(v bool) *CommitRowUpsertOne

SetConsistent sets the "consistent" field.

func (*CommitRowUpsertOne) SetDeletedAt

func (u *CommitRowUpsertOne) SetDeletedAt(v time.Time) *CommitRowUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*CommitRowUpsertOne) SetExpiresAt

func (u *CommitRowUpsertOne) SetExpiresAt(v time.Time) *CommitRowUpsertOne

SetExpiresAt sets the "expires_at" field.

func (*CommitRowUpsertOne) SetFileCount

func (u *CommitRowUpsertOne) SetFileCount(v int64) *CommitRowUpsertOne

SetFileCount sets the "file_count" field.

func (*CommitRowUpsertOne) SetIncomplete

func (u *CommitRowUpsertOne) SetIncomplete(v bool) *CommitRowUpsertOne

SetIncomplete sets the "incomplete" field.

func (*CommitRowUpsertOne) SetKeyID

SetKeyID sets the "key_id" field.

func (*CommitRowUpsertOne) SetLogicalSize

func (u *CommitRowUpsertOne) SetLogicalSize(v int64) *CommitRowUpsertOne

SetLogicalSize sets the "logical_size" field.

func (*CommitRowUpsertOne) SetMetadata

func (u *CommitRowUpsertOne) SetMetadata(v map[string]string) *CommitRowUpsertOne

SetMetadata sets the "metadata" field.

func (*CommitRowUpsertOne) SetParent

func (u *CommitRowUpsertOne) SetParent(v []byte) *CommitRowUpsertOne

SetParent sets the "parent" field.

func (*CommitRowUpsertOne) SetPartial

func (u *CommitRowUpsertOne) SetPartial(v bool) *CommitRowUpsertOne

SetPartial sets the "partial" field.

func (*CommitRowUpsertOne) SetPolicyVersion

func (u *CommitRowUpsertOne) SetPolicyVersion(v uint32) *CommitRowUpsertOne

SetPolicyVersion sets the "policy_version" field.

func (*CommitRowUpsertOne) SetPresence

func (u *CommitRowUpsertOne) SetPresence(v []byte) *CommitRowUpsertOne

SetPresence sets the "presence" field.

func (*CommitRowUpsertOne) SetReceivedAt

func (u *CommitRowUpsertOne) SetReceivedAt(v time.Time) *CommitRowUpsertOne

SetReceivedAt sets the "received_at" field.

func (*CommitRowUpsertOne) SetRetainedBy

func (u *CommitRowUpsertOne) SetRetainedBy(v string) *CommitRowUpsertOne

SetRetainedBy sets the "retained_by" field.

func (*CommitRowUpsertOne) SetRetireAt

func (u *CommitRowUpsertOne) SetRetireAt(v time.Time) *CommitRowUpsertOne

SetRetireAt sets the "retire_at" field.

func (*CommitRowUpsertOne) SetRetirePolicy

func (u *CommitRowUpsertOne) SetRetirePolicy(v string) *CommitRowUpsertOne

SetRetirePolicy sets the "retire_policy" field.

func (*CommitRowUpsertOne) SetScanStartNs

func (u *CommitRowUpsertOne) SetScanStartNs(v int64) *CommitRowUpsertOne

SetScanStartNs sets the "scan_start_ns" field.

func (*CommitRowUpsertOne) SetSetID

SetSetID sets the "set_id" field.

func (*CommitRowUpsertOne) SetTimestamp

func (u *CommitRowUpsertOne) SetTimestamp(v time.Time) *CommitRowUpsertOne

SetTimestamp sets the "timestamp" field.

func (*CommitRowUpsertOne) SetTombstonedAt

func (u *CommitRowUpsertOne) SetTombstonedAt(v time.Time) *CommitRowUpsertOne

SetTombstonedAt sets the "tombstoned_at" field.

func (*CommitRowUpsertOne) SetTree

func (u *CommitRowUpsertOne) SetTree(v []byte) *CommitRowUpsertOne

SetTree sets the "tree" field.

func (*CommitRowUpsertOne) Update

func (u *CommitRowUpsertOne) Update(set func(*CommitRowUpsert)) *CommitRowUpsertOne

Update allows overriding fields `UPDATE` values. See the CommitRowCreate.OnConflict documentation for more info.

func (*CommitRowUpsertOne) UpdateAgentID

func (u *CommitRowUpsertOne) UpdateAgentID() *CommitRowUpsertOne

UpdateAgentID sets the "agent_id" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateConsistent

func (u *CommitRowUpsertOne) UpdateConsistent() *CommitRowUpsertOne

UpdateConsistent sets the "consistent" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateDeletedAt

func (u *CommitRowUpsertOne) UpdateDeletedAt() *CommitRowUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateExpiresAt

func (u *CommitRowUpsertOne) UpdateExpiresAt() *CommitRowUpsertOne

UpdateExpiresAt sets the "expires_at" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateFileCount

func (u *CommitRowUpsertOne) UpdateFileCount() *CommitRowUpsertOne

UpdateFileCount sets the "file_count" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateIncomplete

func (u *CommitRowUpsertOne) UpdateIncomplete() *CommitRowUpsertOne

UpdateIncomplete sets the "incomplete" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateKeyID

func (u *CommitRowUpsertOne) UpdateKeyID() *CommitRowUpsertOne

UpdateKeyID sets the "key_id" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateLogicalSize

func (u *CommitRowUpsertOne) UpdateLogicalSize() *CommitRowUpsertOne

UpdateLogicalSize sets the "logical_size" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateMetadata

func (u *CommitRowUpsertOne) UpdateMetadata() *CommitRowUpsertOne

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateNewValues

func (u *CommitRowUpsertOne) UpdateNewValues() *CommitRowUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.CommitRow.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*CommitRowUpsertOne) UpdateParent

func (u *CommitRowUpsertOne) UpdateParent() *CommitRowUpsertOne

UpdateParent sets the "parent" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdatePartial

func (u *CommitRowUpsertOne) UpdatePartial() *CommitRowUpsertOne

UpdatePartial sets the "partial" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdatePolicyVersion

func (u *CommitRowUpsertOne) UpdatePolicyVersion() *CommitRowUpsertOne

UpdatePolicyVersion sets the "policy_version" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdatePresence

func (u *CommitRowUpsertOne) UpdatePresence() *CommitRowUpsertOne

UpdatePresence sets the "presence" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateReceivedAt

func (u *CommitRowUpsertOne) UpdateReceivedAt() *CommitRowUpsertOne

UpdateReceivedAt sets the "received_at" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateRetainedBy

func (u *CommitRowUpsertOne) UpdateRetainedBy() *CommitRowUpsertOne

UpdateRetainedBy sets the "retained_by" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateRetireAt

func (u *CommitRowUpsertOne) UpdateRetireAt() *CommitRowUpsertOne

UpdateRetireAt sets the "retire_at" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateRetirePolicy

func (u *CommitRowUpsertOne) UpdateRetirePolicy() *CommitRowUpsertOne

UpdateRetirePolicy sets the "retire_policy" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateScanStartNs

func (u *CommitRowUpsertOne) UpdateScanStartNs() *CommitRowUpsertOne

UpdateScanStartNs sets the "scan_start_ns" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateSetID

func (u *CommitRowUpsertOne) UpdateSetID() *CommitRowUpsertOne

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateTimestamp

func (u *CommitRowUpsertOne) UpdateTimestamp() *CommitRowUpsertOne

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateTombstonedAt

func (u *CommitRowUpsertOne) UpdateTombstonedAt() *CommitRowUpsertOne

UpdateTombstonedAt sets the "tombstoned_at" field to the value that was provided on create.

func (*CommitRowUpsertOne) UpdateTree

func (u *CommitRowUpsertOne) UpdateTree() *CommitRowUpsertOne

UpdateTree sets the "tree" field to the value that was provided on create.

type CommitRows

type CommitRows []*CommitRow

CommitRows is a parsable slice of CommitRow.

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 DamagedPath

type DamagedPath struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SetID holds the value of the "set_id" field.
	SetID int64 `json:"set_id,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// FoundAt holds the value of the "found_at" field.
	FoundAt time.Time `json:"found_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DamagedPathQuery when eager-loading is set.
	Edges DamagedPathEdges `json:"edges"`
	// contains filtered or unexported fields
}

DamagedPath is the model entity for the DamagedPath schema.

func (*DamagedPath) ExecContext

func (c *DamagedPath) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPath) QueryContext

func (c *DamagedPath) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPath) QuerySet

func (_m *DamagedPath) QuerySet() *SetQuery

QuerySet queries the "set" edge of the DamagedPath entity.

func (*DamagedPath) String

func (_m *DamagedPath) String() string

String implements the fmt.Stringer.

func (*DamagedPath) Unwrap

func (_m *DamagedPath) Unwrap() *DamagedPath

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

func (_m *DamagedPath) Update() *DamagedPathUpdateOne

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

func (*DamagedPath) Value

func (_m *DamagedPath) Value(name string) (ent.Value, error)

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

type DamagedPathClient

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

DamagedPathClient is a client for the DamagedPath schema.

func NewDamagedPathClient

func NewDamagedPathClient(c config) *DamagedPathClient

NewDamagedPathClient returns a client for the DamagedPath from the given config.

func (*DamagedPathClient) Create

func (c *DamagedPathClient) Create() *DamagedPathCreate

Create returns a builder for creating a DamagedPath entity.

func (*DamagedPathClient) CreateBulk

func (c *DamagedPathClient) CreateBulk(builders ...*DamagedPathCreate) *DamagedPathCreateBulk

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

func (*DamagedPathClient) Delete

func (c *DamagedPathClient) Delete() *DamagedPathDelete

Delete returns a delete builder for DamagedPath.

func (*DamagedPathClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DamagedPathClient) DeleteOneID

func (c *DamagedPathClient) DeleteOneID(id int) *DamagedPathDeleteOne

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

func (*DamagedPathClient) ExecContext

func (c *DamagedPathClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathClient) Get

func (c *DamagedPathClient) Get(ctx context.Context, id int) (*DamagedPath, error)

Get returns a DamagedPath entity by its id.

func (*DamagedPathClient) GetX

func (c *DamagedPathClient) GetX(ctx context.Context, id int) *DamagedPath

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

func (*DamagedPathClient) Hooks

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

Hooks returns the client hooks.

func (*DamagedPathClient) Intercept

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

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

func (*DamagedPathClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DamagedPathClient) MapCreateBulk

func (c *DamagedPathClient) MapCreateBulk(slice any, setFunc func(*DamagedPathCreate, int)) *DamagedPathCreateBulk

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 (*DamagedPathClient) Query

func (c *DamagedPathClient) Query() *DamagedPathQuery

Query returns a query builder for DamagedPath.

func (*DamagedPathClient) QueryContext

func (c *DamagedPathClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathClient) QuerySet

func (c *DamagedPathClient) QuerySet(_m *DamagedPath) *SetQuery

QuerySet queries the set edge of a DamagedPath.

func (*DamagedPathClient) Update

func (c *DamagedPathClient) Update() *DamagedPathUpdate

Update returns an update builder for DamagedPath.

func (*DamagedPathClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DamagedPathClient) UpdateOneID

func (c *DamagedPathClient) UpdateOneID(id int) *DamagedPathUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DamagedPathClient) Use

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

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

type DamagedPathCreate

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

DamagedPathCreate is the builder for creating a DamagedPath entity.

func (*DamagedPathCreate) Exec

func (_c *DamagedPathCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DamagedPathCreate) ExecContext

func (c *DamagedPathCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathCreate) ExecX

func (_c *DamagedPathCreate) ExecX(ctx context.Context)

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

func (*DamagedPathCreate) Mutation

func (_c *DamagedPathCreate) Mutation() *DamagedPathMutation

Mutation returns the DamagedPathMutation object of the builder.

func (*DamagedPathCreate) OnConflict

func (_c *DamagedPathCreate) OnConflict(opts ...sql.ConflictOption) *DamagedPathUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DamagedPath.Create().
	SetSetID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DamagedPathUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*DamagedPathCreate) OnConflictColumns

func (_c *DamagedPathCreate) OnConflictColumns(columns ...string) *DamagedPathUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DamagedPath.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DamagedPathCreate) QueryContext

func (c *DamagedPathCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathCreate) Save

Save creates the DamagedPath in the database.

func (*DamagedPathCreate) SaveX

func (_c *DamagedPathCreate) SaveX(ctx context.Context) *DamagedPath

SaveX calls Save and panics if Save returns an error.

func (*DamagedPathCreate) SetFoundAt

func (_c *DamagedPathCreate) SetFoundAt(v time.Time) *DamagedPathCreate

SetFoundAt sets the "found_at" field.

func (*DamagedPathCreate) SetPath

func (_c *DamagedPathCreate) SetPath(v string) *DamagedPathCreate

SetPath sets the "path" field.

func (*DamagedPathCreate) SetSet

func (_c *DamagedPathCreate) SetSet(v *Set) *DamagedPathCreate

SetSet sets the "set" edge to the Set entity.

func (*DamagedPathCreate) SetSetID

func (_c *DamagedPathCreate) SetSetID(v int64) *DamagedPathCreate

SetSetID sets the "set_id" field.

type DamagedPathCreateBulk

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

DamagedPathCreateBulk is the builder for creating many DamagedPath entities in bulk.

func (*DamagedPathCreateBulk) Exec

Exec executes the query.

func (*DamagedPathCreateBulk) ExecContext

func (c *DamagedPathCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathCreateBulk) ExecX

func (_c *DamagedPathCreateBulk) ExecX(ctx context.Context)

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

func (*DamagedPathCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DamagedPath.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DamagedPathUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*DamagedPathCreateBulk) OnConflictColumns

func (_c *DamagedPathCreateBulk) OnConflictColumns(columns ...string) *DamagedPathUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DamagedPath.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DamagedPathCreateBulk) QueryContext

func (c *DamagedPathCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathCreateBulk) Save

Save creates the DamagedPath entities in the database.

func (*DamagedPathCreateBulk) SaveX

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

type DamagedPathDelete

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

DamagedPathDelete is the builder for deleting a DamagedPath entity.

func (*DamagedPathDelete) Exec

func (_d *DamagedPathDelete) Exec(ctx context.Context) (int, error)

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

func (*DamagedPathDelete) ExecContext

func (c *DamagedPathDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathDelete) ExecX

func (_d *DamagedPathDelete) ExecX(ctx context.Context) int

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

func (*DamagedPathDelete) QueryContext

func (c *DamagedPathDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathDelete) Where

Where appends a list predicates to the DamagedPathDelete builder.

type DamagedPathDeleteOne

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

DamagedPathDeleteOne is the builder for deleting a single DamagedPath entity.

func (*DamagedPathDeleteOne) Exec

func (_d *DamagedPathDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DamagedPathDeleteOne) ExecX

func (_d *DamagedPathDeleteOne) ExecX(ctx context.Context)

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

func (*DamagedPathDeleteOne) Where

Where appends a list predicates to the DamagedPathDelete builder.

type DamagedPathEdges

type DamagedPathEdges struct {
	// Set holds the value of the set edge.
	Set *Set `json:"set,omitempty"`
	// contains filtered or unexported fields
}

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

func (DamagedPathEdges) SetOrErr

func (e DamagedPathEdges) SetOrErr() (*Set, error)

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

type DamagedPathGroupBy

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

DamagedPathGroupBy is the group-by builder for DamagedPath entities.

func (*DamagedPathGroupBy) Aggregate

func (_g *DamagedPathGroupBy) Aggregate(fns ...AggregateFunc) *DamagedPathGroupBy

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

func (*DamagedPathGroupBy) Bool

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

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

func (*DamagedPathGroupBy) BoolX

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

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

func (*DamagedPathGroupBy) Bools

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

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

func (*DamagedPathGroupBy) BoolsX

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

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

func (*DamagedPathGroupBy) Float64

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

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

func (*DamagedPathGroupBy) Float64X

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

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

func (*DamagedPathGroupBy) Float64s

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

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

func (*DamagedPathGroupBy) Float64sX

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

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

func (*DamagedPathGroupBy) Int

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

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

func (*DamagedPathGroupBy) IntX

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

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

func (*DamagedPathGroupBy) Ints

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

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

func (*DamagedPathGroupBy) IntsX

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

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

func (*DamagedPathGroupBy) Scan

func (_g *DamagedPathGroupBy) Scan(ctx context.Context, v any) error

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

func (*DamagedPathGroupBy) ScanX

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

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

func (*DamagedPathGroupBy) String

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

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

func (*DamagedPathGroupBy) StringX

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

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

func (*DamagedPathGroupBy) Strings

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

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

func (*DamagedPathGroupBy) StringsX

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

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

type DamagedPathMutation

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

DamagedPathMutation represents an operation that mutates the DamagedPath nodes in the graph.

func (*DamagedPathMutation) AddField

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) AddedEdges

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

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

func (*DamagedPathMutation) AddedField

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

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

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

func (*DamagedPathMutation) AddedIDs

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

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

func (*DamagedPathMutation) ClearEdge

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

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) ClearSet

func (m *DamagedPathMutation) ClearSet()

ClearSet clears the "set" edge to the Set entity.

func (*DamagedPathMutation) ClearedEdges

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

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

func (*DamagedPathMutation) ClearedFields

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

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

func (DamagedPathMutation) Client

func (m DamagedPathMutation) 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 (*DamagedPathMutation) EdgeCleared

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

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

func (*DamagedPathMutation) ExecContext

func (c *DamagedPathMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathMutation) Field

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

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

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

func (*DamagedPathMutation) Fields

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) FoundAt

func (m *DamagedPathMutation) FoundAt() (r time.Time, exists bool)

FoundAt returns the value of the "found_at" field in the mutation.

func (*DamagedPathMutation) ID

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) IDs

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) OldField

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) OldFoundAt

func (m *DamagedPathMutation) OldFoundAt(ctx context.Context) (v time.Time, err error)

OldFoundAt returns the old "found_at" field's value of the DamagedPath entity. If the DamagedPath 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 (*DamagedPathMutation) OldPath

func (m *DamagedPathMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the DamagedPath entity. If the DamagedPath 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 (*DamagedPathMutation) OldSetID

func (m *DamagedPathMutation) OldSetID(ctx context.Context) (v int64, err error)

OldSetID returns the old "set_id" field's value of the DamagedPath entity. If the DamagedPath 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 (*DamagedPathMutation) Op

func (m *DamagedPathMutation) Op() Op

Op returns the operation name.

func (*DamagedPathMutation) Path

func (m *DamagedPathMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*DamagedPathMutation) QueryContext

func (c *DamagedPathMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathMutation) RemovedEdges

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

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

func (*DamagedPathMutation) RemovedIDs

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) ResetEdge

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

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) ResetFoundAt

func (m *DamagedPathMutation) ResetFoundAt()

ResetFoundAt resets all changes to the "found_at" field.

func (*DamagedPathMutation) ResetPath

func (m *DamagedPathMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*DamagedPathMutation) ResetSet

func (m *DamagedPathMutation) ResetSet()

ResetSet resets all changes to the "set" edge.

func (*DamagedPathMutation) ResetSetID

func (m *DamagedPathMutation) ResetSetID()

ResetSetID resets all changes to the "set_id" field.

func (*DamagedPathMutation) SetCleared

func (m *DamagedPathMutation) SetCleared() bool

SetCleared reports if the "set" edge to the Set entity was cleared.

func (*DamagedPathMutation) SetField

func (m *DamagedPathMutation) 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 (*DamagedPathMutation) SetFoundAt

func (m *DamagedPathMutation) SetFoundAt(t time.Time)

SetFoundAt sets the "found_at" field.

func (*DamagedPathMutation) SetID

func (m *DamagedPathMutation) SetID() (r int64, exists bool)

SetID returns the value of the "set_id" field in the mutation.

func (*DamagedPathMutation) SetIDs

func (m *DamagedPathMutation) SetIDs() (ids []int64)

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

func (*DamagedPathMutation) SetOp

func (m *DamagedPathMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DamagedPathMutation) SetPath

func (m *DamagedPathMutation) SetPath(s string)

SetPath sets the "path" field.

func (*DamagedPathMutation) SetSetID

func (m *DamagedPathMutation) SetSetID(i int64)

SetSetID sets the "set_id" field.

func (DamagedPathMutation) Tx

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

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

func (*DamagedPathMutation) Type

func (m *DamagedPathMutation) Type() string

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

func (*DamagedPathMutation) Where

func (m *DamagedPathMutation) Where(ps ...predicate.DamagedPath)

Where appends a list predicates to the DamagedPathMutation builder.

func (*DamagedPathMutation) WhereP

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

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

type DamagedPathQuery

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

DamagedPathQuery is the builder for querying DamagedPath entities.

func (*DamagedPathQuery) Aggregate

func (_q *DamagedPathQuery) Aggregate(fns ...AggregateFunc) *DamagedPathSelect

Aggregate returns a DamagedPathSelect configured with the given aggregations.

func (*DamagedPathQuery) All

func (_q *DamagedPathQuery) All(ctx context.Context) ([]*DamagedPath, error)

All executes the query and returns a list of DamagedPaths.

func (*DamagedPathQuery) AllX

func (_q *DamagedPathQuery) AllX(ctx context.Context) []*DamagedPath

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

func (*DamagedPathQuery) Clone

func (_q *DamagedPathQuery) Clone() *DamagedPathQuery

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

func (*DamagedPathQuery) Count

func (_q *DamagedPathQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DamagedPathQuery) CountX

func (_q *DamagedPathQuery) CountX(ctx context.Context) int

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

func (*DamagedPathQuery) ExecContext

func (c *DamagedPathQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathQuery) Exist

func (_q *DamagedPathQuery) Exist(ctx context.Context) (bool, error)

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

func (*DamagedPathQuery) ExistX

func (_q *DamagedPathQuery) ExistX(ctx context.Context) bool

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

func (*DamagedPathQuery) First

func (_q *DamagedPathQuery) First(ctx context.Context) (*DamagedPath, error)

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

func (*DamagedPathQuery) FirstID

func (_q *DamagedPathQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DamagedPathQuery) FirstIDX

func (_q *DamagedPathQuery) FirstIDX(ctx context.Context) int

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

func (*DamagedPathQuery) FirstX

func (_q *DamagedPathQuery) FirstX(ctx context.Context) *DamagedPath

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

func (*DamagedPathQuery) ForShare

func (_q *DamagedPathQuery) ForShare(opts ...sql.LockOption) *DamagedPathQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*DamagedPathQuery) ForUpdate

func (_q *DamagedPathQuery) ForUpdate(opts ...sql.LockOption) *DamagedPathQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*DamagedPathQuery) GroupBy

func (_q *DamagedPathQuery) GroupBy(field string, fields ...string) *DamagedPathGroupBy

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 {
	SetID int64 `json:"set_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DamagedPath.Query().
	GroupBy(damagedpath.FieldSetID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DamagedPathQuery) IDs

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

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

func (*DamagedPathQuery) IDsX

func (_q *DamagedPathQuery) IDsX(ctx context.Context) []int

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

func (*DamagedPathQuery) Limit

func (_q *DamagedPathQuery) Limit(limit int) *DamagedPathQuery

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

func (*DamagedPathQuery) Offset

func (_q *DamagedPathQuery) Offset(offset int) *DamagedPathQuery

Offset to start from.

func (*DamagedPathQuery) Only

func (_q *DamagedPathQuery) Only(ctx context.Context) (*DamagedPath, error)

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

func (*DamagedPathQuery) OnlyID

func (_q *DamagedPathQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DamagedPathQuery) OnlyIDX

func (_q *DamagedPathQuery) OnlyIDX(ctx context.Context) int

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

func (*DamagedPathQuery) OnlyX

func (_q *DamagedPathQuery) OnlyX(ctx context.Context) *DamagedPath

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

func (*DamagedPathQuery) Order

Order specifies how the records should be ordered.

func (*DamagedPathQuery) QueryContext

func (c *DamagedPathQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathQuery) QuerySet

func (_q *DamagedPathQuery) QuerySet() *SetQuery

QuerySet chains the current query on the "set" edge.

func (*DamagedPathQuery) Select

func (_q *DamagedPathQuery) Select(fields ...string) *DamagedPathSelect

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 {
	SetID int64 `json:"set_id,omitempty"`
}

client.DamagedPath.Query().
	Select(damagedpath.FieldSetID).
	Scan(ctx, &v)

func (*DamagedPathQuery) Unique

func (_q *DamagedPathQuery) Unique(unique bool) *DamagedPathQuery

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

Where adds a new predicate for the DamagedPathQuery builder.

func (*DamagedPathQuery) WithSet

func (_q *DamagedPathQuery) WithSet(opts ...func(*SetQuery)) *DamagedPathQuery

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

type DamagedPathSelect

type DamagedPathSelect struct {
	*DamagedPathQuery
	// contains filtered or unexported fields
}

DamagedPathSelect is the builder for selecting fields of DamagedPath entities.

func (*DamagedPathSelect) Aggregate

func (_s *DamagedPathSelect) Aggregate(fns ...AggregateFunc) *DamagedPathSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DamagedPathSelect) Bool

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

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

func (*DamagedPathSelect) BoolX

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

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

func (*DamagedPathSelect) Bools

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

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

func (*DamagedPathSelect) BoolsX

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

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

func (DamagedPathSelect) ExecContext

func (c DamagedPathSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathSelect) Float64

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

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

func (*DamagedPathSelect) Float64X

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

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

func (*DamagedPathSelect) Float64s

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

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

func (*DamagedPathSelect) Float64sX

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

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

func (*DamagedPathSelect) Int

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

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

func (*DamagedPathSelect) IntX

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

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

func (*DamagedPathSelect) Ints

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

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

func (*DamagedPathSelect) IntsX

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

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

func (DamagedPathSelect) QueryContext

func (c DamagedPathSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathSelect) Scan

func (_s *DamagedPathSelect) Scan(ctx context.Context, v any) error

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

func (*DamagedPathSelect) ScanX

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

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

func (*DamagedPathSelect) String

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

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

func (*DamagedPathSelect) StringX

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

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

func (*DamagedPathSelect) Strings

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

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

func (*DamagedPathSelect) StringsX

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

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

type DamagedPathUpdate

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

DamagedPathUpdate is the builder for updating DamagedPath entities.

func (*DamagedPathUpdate) ClearSet

func (_u *DamagedPathUpdate) ClearSet() *DamagedPathUpdate

ClearSet clears the "set" edge to the Set entity.

func (*DamagedPathUpdate) Exec

func (_u *DamagedPathUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DamagedPathUpdate) ExecContext

func (c *DamagedPathUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathUpdate) ExecX

func (_u *DamagedPathUpdate) ExecX(ctx context.Context)

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

func (*DamagedPathUpdate) Mutation

func (_u *DamagedPathUpdate) Mutation() *DamagedPathMutation

Mutation returns the DamagedPathMutation object of the builder.

func (*DamagedPathUpdate) QueryContext

func (c *DamagedPathUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathUpdate) Save

func (_u *DamagedPathUpdate) Save(ctx context.Context) (int, error)

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

func (*DamagedPathUpdate) SaveX

func (_u *DamagedPathUpdate) SaveX(ctx context.Context) int

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

func (*DamagedPathUpdate) SetFoundAt

func (_u *DamagedPathUpdate) SetFoundAt(v time.Time) *DamagedPathUpdate

SetFoundAt sets the "found_at" field.

func (*DamagedPathUpdate) SetNillableFoundAt

func (_u *DamagedPathUpdate) SetNillableFoundAt(v *time.Time) *DamagedPathUpdate

SetNillableFoundAt sets the "found_at" field if the given value is not nil.

func (*DamagedPathUpdate) SetNillablePath

func (_u *DamagedPathUpdate) SetNillablePath(v *string) *DamagedPathUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*DamagedPathUpdate) SetNillableSetID

func (_u *DamagedPathUpdate) SetNillableSetID(v *int64) *DamagedPathUpdate

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*DamagedPathUpdate) SetPath

func (_u *DamagedPathUpdate) SetPath(v string) *DamagedPathUpdate

SetPath sets the "path" field.

func (*DamagedPathUpdate) SetSet

func (_u *DamagedPathUpdate) SetSet(v *Set) *DamagedPathUpdate

SetSet sets the "set" edge to the Set entity.

func (*DamagedPathUpdate) SetSetID

func (_u *DamagedPathUpdate) SetSetID(v int64) *DamagedPathUpdate

SetSetID sets the "set_id" field.

func (*DamagedPathUpdate) Where

Where appends a list predicates to the DamagedPathUpdate builder.

type DamagedPathUpdateOne

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

DamagedPathUpdateOne is the builder for updating a single DamagedPath entity.

func (*DamagedPathUpdateOne) ClearSet

ClearSet clears the "set" edge to the Set entity.

func (*DamagedPathUpdateOne) Exec

func (_u *DamagedPathUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DamagedPathUpdateOne) ExecContext

func (c *DamagedPathUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DamagedPathUpdateOne) ExecX

func (_u *DamagedPathUpdateOne) ExecX(ctx context.Context)

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

func (*DamagedPathUpdateOne) Mutation

func (_u *DamagedPathUpdateOne) Mutation() *DamagedPathMutation

Mutation returns the DamagedPathMutation object of the builder.

func (*DamagedPathUpdateOne) QueryContext

func (c *DamagedPathUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DamagedPathUpdateOne) Save

Save executes the query and returns the updated DamagedPath entity.

func (*DamagedPathUpdateOne) SaveX

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

func (*DamagedPathUpdateOne) Select

func (_u *DamagedPathUpdateOne) Select(field string, fields ...string) *DamagedPathUpdateOne

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

func (*DamagedPathUpdateOne) SetFoundAt

SetFoundAt sets the "found_at" field.

func (*DamagedPathUpdateOne) SetNillableFoundAt

func (_u *DamagedPathUpdateOne) SetNillableFoundAt(v *time.Time) *DamagedPathUpdateOne

SetNillableFoundAt sets the "found_at" field if the given value is not nil.

func (*DamagedPathUpdateOne) SetNillablePath

func (_u *DamagedPathUpdateOne) SetNillablePath(v *string) *DamagedPathUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*DamagedPathUpdateOne) SetNillableSetID

func (_u *DamagedPathUpdateOne) SetNillableSetID(v *int64) *DamagedPathUpdateOne

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*DamagedPathUpdateOne) SetPath

SetPath sets the "path" field.

func (*DamagedPathUpdateOne) SetSet

SetSet sets the "set" edge to the Set entity.

func (*DamagedPathUpdateOne) SetSetID

SetSetID sets the "set_id" field.

func (*DamagedPathUpdateOne) Where

Where appends a list predicates to the DamagedPathUpdate builder.

type DamagedPathUpsert

type DamagedPathUpsert struct {
	*sql.UpdateSet
}

DamagedPathUpsert is the "OnConflict" setter.

func (*DamagedPathUpsert) SetFoundAt

func (u *DamagedPathUpsert) SetFoundAt(v time.Time) *DamagedPathUpsert

SetFoundAt sets the "found_at" field.

func (*DamagedPathUpsert) SetPath

SetPath sets the "path" field.

func (*DamagedPathUpsert) SetSetID

func (u *DamagedPathUpsert) SetSetID(v int64) *DamagedPathUpsert

SetSetID sets the "set_id" field.

func (*DamagedPathUpsert) UpdateFoundAt

func (u *DamagedPathUpsert) UpdateFoundAt() *DamagedPathUpsert

UpdateFoundAt sets the "found_at" field to the value that was provided on create.

func (*DamagedPathUpsert) UpdatePath

func (u *DamagedPathUpsert) UpdatePath() *DamagedPathUpsert

UpdatePath sets the "path" field to the value that was provided on create.

func (*DamagedPathUpsert) UpdateSetID

func (u *DamagedPathUpsert) UpdateSetID() *DamagedPathUpsert

UpdateSetID sets the "set_id" field to the value that was provided on create.

type DamagedPathUpsertBulk

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

DamagedPathUpsertBulk is the builder for "upsert"-ing a bulk of DamagedPath nodes.

func (*DamagedPathUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DamagedPathUpsertBulk) Exec

Exec executes the query.

func (*DamagedPathUpsertBulk) ExecX

func (u *DamagedPathUpsertBulk) ExecX(ctx context.Context)

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

func (*DamagedPathUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DamagedPath.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*DamagedPathUpsertBulk) SetFoundAt

SetFoundAt sets the "found_at" field.

func (*DamagedPathUpsertBulk) SetPath

SetPath sets the "path" field.

func (*DamagedPathUpsertBulk) SetSetID

SetSetID sets the "set_id" field.

func (*DamagedPathUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the DamagedPathCreateBulk.OnConflict documentation for more info.

func (*DamagedPathUpsertBulk) UpdateFoundAt

func (u *DamagedPathUpsertBulk) UpdateFoundAt() *DamagedPathUpsertBulk

UpdateFoundAt sets the "found_at" field to the value that was provided on create.

func (*DamagedPathUpsertBulk) UpdateNewValues

func (u *DamagedPathUpsertBulk) UpdateNewValues() *DamagedPathUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.DamagedPath.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*DamagedPathUpsertBulk) UpdatePath

UpdatePath sets the "path" field to the value that was provided on create.

func (*DamagedPathUpsertBulk) UpdateSetID

func (u *DamagedPathUpsertBulk) UpdateSetID() *DamagedPathUpsertBulk

UpdateSetID sets the "set_id" field to the value that was provided on create.

type DamagedPathUpsertOne

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

DamagedPathUpsertOne is the builder for "upsert"-ing

one DamagedPath node.

func (*DamagedPathUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DamagedPathUpsertOne) Exec

Exec executes the query.

func (*DamagedPathUpsertOne) ExecX

func (u *DamagedPathUpsertOne) ExecX(ctx context.Context)

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

func (*DamagedPathUpsertOne) ID

func (u *DamagedPathUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*DamagedPathUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*DamagedPathUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DamagedPath.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*DamagedPathUpsertOne) SetFoundAt

SetFoundAt sets the "found_at" field.

func (*DamagedPathUpsertOne) SetPath

SetPath sets the "path" field.

func (*DamagedPathUpsertOne) SetSetID

SetSetID sets the "set_id" field.

func (*DamagedPathUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the DamagedPathCreate.OnConflict documentation for more info.

func (*DamagedPathUpsertOne) UpdateFoundAt

func (u *DamagedPathUpsertOne) UpdateFoundAt() *DamagedPathUpsertOne

UpdateFoundAt sets the "found_at" field to the value that was provided on create.

func (*DamagedPathUpsertOne) UpdateNewValues

func (u *DamagedPathUpsertOne) UpdateNewValues() *DamagedPathUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.DamagedPath.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*DamagedPathUpsertOne) UpdatePath

func (u *DamagedPathUpsertOne) UpdatePath() *DamagedPathUpsertOne

UpdatePath sets the "path" field to the value that was provided on create.

func (*DamagedPathUpsertOne) UpdateSetID

func (u *DamagedPathUpsertOne) UpdateSetID() *DamagedPathUpsertOne

UpdateSetID sets the "set_id" field to the value that was provided on create.

type DamagedPaths

type DamagedPaths []*DamagedPath

DamagedPaths is a parsable slice of DamagedPath.

type DeletedRef

type DeletedRef struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// TombstonedAt holds the value of the "tombstoned_at" field.
	TombstonedAt time.Time `json:"tombstoned_at,omitempty"`
	// contains filtered or unexported fields
}

DeletedRef is the model entity for the DeletedRef schema.

func (*DeletedRef) ExecContext

func (c *DeletedRef) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRef) QueryContext

func (c *DeletedRef) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRef) String

func (_m *DeletedRef) String() string

String implements the fmt.Stringer.

func (*DeletedRef) Unwrap

func (_m *DeletedRef) Unwrap() *DeletedRef

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

func (_m *DeletedRef) Update() *DeletedRefUpdateOne

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

func (*DeletedRef) Value

func (_m *DeletedRef) Value(name string) (ent.Value, error)

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

type DeletedRefClient

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

DeletedRefClient is a client for the DeletedRef schema.

func NewDeletedRefClient

func NewDeletedRefClient(c config) *DeletedRefClient

NewDeletedRefClient returns a client for the DeletedRef from the given config.

func (*DeletedRefClient) Create

func (c *DeletedRefClient) Create() *DeletedRefCreate

Create returns a builder for creating a DeletedRef entity.

func (*DeletedRefClient) CreateBulk

func (c *DeletedRefClient) CreateBulk(builders ...*DeletedRefCreate) *DeletedRefCreateBulk

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

func (*DeletedRefClient) Delete

func (c *DeletedRefClient) Delete() *DeletedRefDelete

Delete returns a delete builder for DeletedRef.

func (*DeletedRefClient) DeleteOne

func (c *DeletedRefClient) DeleteOne(_m *DeletedRef) *DeletedRefDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DeletedRefClient) DeleteOneID

func (c *DeletedRefClient) DeleteOneID(id int) *DeletedRefDeleteOne

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

func (*DeletedRefClient) ExecContext

func (c *DeletedRefClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefClient) Get

func (c *DeletedRefClient) Get(ctx context.Context, id int) (*DeletedRef, error)

Get returns a DeletedRef entity by its id.

func (*DeletedRefClient) GetX

func (c *DeletedRefClient) GetX(ctx context.Context, id int) *DeletedRef

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

func (*DeletedRefClient) Hooks

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

Hooks returns the client hooks.

func (*DeletedRefClient) Intercept

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

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

func (*DeletedRefClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DeletedRefClient) MapCreateBulk

func (c *DeletedRefClient) MapCreateBulk(slice any, setFunc func(*DeletedRefCreate, int)) *DeletedRefCreateBulk

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 (*DeletedRefClient) Query

func (c *DeletedRefClient) Query() *DeletedRefQuery

Query returns a query builder for DeletedRef.

func (*DeletedRefClient) QueryContext

func (c *DeletedRefClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefClient) Update

func (c *DeletedRefClient) Update() *DeletedRefUpdate

Update returns an update builder for DeletedRef.

func (*DeletedRefClient) UpdateOne

func (c *DeletedRefClient) UpdateOne(_m *DeletedRef) *DeletedRefUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeletedRefClient) UpdateOneID

func (c *DeletedRefClient) UpdateOneID(id int) *DeletedRefUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeletedRefClient) Use

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

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

type DeletedRefCreate

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

DeletedRefCreate is the builder for creating a DeletedRef entity.

func (*DeletedRefCreate) Exec

func (_c *DeletedRefCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeletedRefCreate) ExecContext

func (c *DeletedRefCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefCreate) ExecX

func (_c *DeletedRefCreate) ExecX(ctx context.Context)

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

func (*DeletedRefCreate) Mutation

func (_c *DeletedRefCreate) Mutation() *DeletedRefMutation

Mutation returns the DeletedRefMutation object of the builder.

func (*DeletedRefCreate) OnConflict

func (_c *DeletedRefCreate) OnConflict(opts ...sql.ConflictOption) *DeletedRefUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DeletedRef.Create().
	SetRef(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DeletedRefUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*DeletedRefCreate) OnConflictColumns

func (_c *DeletedRefCreate) OnConflictColumns(columns ...string) *DeletedRefUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DeletedRef.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DeletedRefCreate) QueryContext

func (c *DeletedRefCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefCreate) Save

func (_c *DeletedRefCreate) Save(ctx context.Context) (*DeletedRef, error)

Save creates the DeletedRef in the database.

func (*DeletedRefCreate) SaveX

func (_c *DeletedRefCreate) SaveX(ctx context.Context) *DeletedRef

SaveX calls Save and panics if Save returns an error.

func (*DeletedRefCreate) SetRef

func (_c *DeletedRefCreate) SetRef(v []byte) *DeletedRefCreate

SetRef sets the "ref" field.

func (*DeletedRefCreate) SetTombstonedAt

func (_c *DeletedRefCreate) SetTombstonedAt(v time.Time) *DeletedRefCreate

SetTombstonedAt sets the "tombstoned_at" field.

type DeletedRefCreateBulk

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

DeletedRefCreateBulk is the builder for creating many DeletedRef entities in bulk.

func (*DeletedRefCreateBulk) Exec

func (_c *DeletedRefCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DeletedRefCreateBulk) ExecContext

func (c *DeletedRefCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefCreateBulk) ExecX

func (_c *DeletedRefCreateBulk) ExecX(ctx context.Context)

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

func (*DeletedRefCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.DeletedRef.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DeletedRefUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*DeletedRefCreateBulk) OnConflictColumns

func (_c *DeletedRefCreateBulk) OnConflictColumns(columns ...string) *DeletedRefUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.DeletedRef.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DeletedRefCreateBulk) QueryContext

func (c *DeletedRefCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefCreateBulk) Save

func (_c *DeletedRefCreateBulk) Save(ctx context.Context) ([]*DeletedRef, error)

Save creates the DeletedRef entities in the database.

func (*DeletedRefCreateBulk) SaveX

func (_c *DeletedRefCreateBulk) SaveX(ctx context.Context) []*DeletedRef

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

type DeletedRefDelete

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

DeletedRefDelete is the builder for deleting a DeletedRef entity.

func (*DeletedRefDelete) Exec

func (_d *DeletedRefDelete) Exec(ctx context.Context) (int, error)

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

func (*DeletedRefDelete) ExecContext

func (c *DeletedRefDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefDelete) ExecX

func (_d *DeletedRefDelete) ExecX(ctx context.Context) int

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

func (*DeletedRefDelete) QueryContext

func (c *DeletedRefDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefDelete) Where

Where appends a list predicates to the DeletedRefDelete builder.

type DeletedRefDeleteOne

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

DeletedRefDeleteOne is the builder for deleting a single DeletedRef entity.

func (*DeletedRefDeleteOne) Exec

func (_d *DeletedRefDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeletedRefDeleteOne) ExecX

func (_d *DeletedRefDeleteOne) ExecX(ctx context.Context)

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

func (*DeletedRefDeleteOne) Where

Where appends a list predicates to the DeletedRefDelete builder.

type DeletedRefGroupBy

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

DeletedRefGroupBy is the group-by builder for DeletedRef entities.

func (*DeletedRefGroupBy) Aggregate

func (_g *DeletedRefGroupBy) Aggregate(fns ...AggregateFunc) *DeletedRefGroupBy

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

func (*DeletedRefGroupBy) Bool

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

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

func (*DeletedRefGroupBy) BoolX

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

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

func (*DeletedRefGroupBy) Bools

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

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

func (*DeletedRefGroupBy) BoolsX

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

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

func (*DeletedRefGroupBy) Float64

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

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

func (*DeletedRefGroupBy) Float64X

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

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

func (*DeletedRefGroupBy) Float64s

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

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

func (*DeletedRefGroupBy) Float64sX

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

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

func (*DeletedRefGroupBy) Int

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

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

func (*DeletedRefGroupBy) IntX

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

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

func (*DeletedRefGroupBy) Ints

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

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

func (*DeletedRefGroupBy) IntsX

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

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

func (*DeletedRefGroupBy) Scan

func (_g *DeletedRefGroupBy) Scan(ctx context.Context, v any) error

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

func (*DeletedRefGroupBy) ScanX

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

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

func (*DeletedRefGroupBy) String

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

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

func (*DeletedRefGroupBy) StringX

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

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

func (*DeletedRefGroupBy) Strings

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

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

func (*DeletedRefGroupBy) StringsX

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

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

type DeletedRefMutation

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

DeletedRefMutation represents an operation that mutates the DeletedRef nodes in the graph.

func (*DeletedRefMutation) AddField

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) AddedEdges

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

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

func (*DeletedRefMutation) AddedField

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

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

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

func (*DeletedRefMutation) AddedIDs

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

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

func (*DeletedRefMutation) ClearEdge

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

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) ClearedEdges

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

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

func (*DeletedRefMutation) ClearedFields

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

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

func (DeletedRefMutation) Client

func (m DeletedRefMutation) 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 (*DeletedRefMutation) EdgeCleared

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

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

func (*DeletedRefMutation) ExecContext

func (c *DeletedRefMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefMutation) Field

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

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

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

func (*DeletedRefMutation) Fields

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

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) IDs

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) OldField

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) OldRef

func (m *DeletedRefMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the DeletedRef entity. If the DeletedRef 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 (*DeletedRefMutation) OldTombstonedAt

func (m *DeletedRefMutation) OldTombstonedAt(ctx context.Context) (v time.Time, err error)

OldTombstonedAt returns the old "tombstoned_at" field's value of the DeletedRef entity. If the DeletedRef 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 (*DeletedRefMutation) Op

func (m *DeletedRefMutation) Op() Op

Op returns the operation name.

func (*DeletedRefMutation) QueryContext

func (c *DeletedRefMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefMutation) Ref

func (m *DeletedRefMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*DeletedRefMutation) RemovedEdges

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

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

func (*DeletedRefMutation) RemovedIDs

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) ResetEdge

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

func (m *DeletedRefMutation) 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 (*DeletedRefMutation) ResetRef

func (m *DeletedRefMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*DeletedRefMutation) ResetTombstonedAt

func (m *DeletedRefMutation) ResetTombstonedAt()

ResetTombstonedAt resets all changes to the "tombstoned_at" field.

func (*DeletedRefMutation) SetField

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

func (m *DeletedRefMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DeletedRefMutation) SetRef

func (m *DeletedRefMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*DeletedRefMutation) SetTombstonedAt

func (m *DeletedRefMutation) SetTombstonedAt(t time.Time)

SetTombstonedAt sets the "tombstoned_at" field.

func (*DeletedRefMutation) TombstonedAt

func (m *DeletedRefMutation) TombstonedAt() (r time.Time, exists bool)

TombstonedAt returns the value of the "tombstoned_at" field in the mutation.

func (DeletedRefMutation) Tx

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

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

func (*DeletedRefMutation) Type

func (m *DeletedRefMutation) Type() string

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

func (*DeletedRefMutation) Where

func (m *DeletedRefMutation) Where(ps ...predicate.DeletedRef)

Where appends a list predicates to the DeletedRefMutation builder.

func (*DeletedRefMutation) WhereP

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

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

type DeletedRefQuery

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

DeletedRefQuery is the builder for querying DeletedRef entities.

func (*DeletedRefQuery) Aggregate

func (_q *DeletedRefQuery) Aggregate(fns ...AggregateFunc) *DeletedRefSelect

Aggregate returns a DeletedRefSelect configured with the given aggregations.

func (*DeletedRefQuery) All

func (_q *DeletedRefQuery) All(ctx context.Context) ([]*DeletedRef, error)

All executes the query and returns a list of DeletedRefs.

func (*DeletedRefQuery) AllX

func (_q *DeletedRefQuery) AllX(ctx context.Context) []*DeletedRef

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

func (*DeletedRefQuery) Clone

func (_q *DeletedRefQuery) Clone() *DeletedRefQuery

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

func (*DeletedRefQuery) Count

func (_q *DeletedRefQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeletedRefQuery) CountX

func (_q *DeletedRefQuery) CountX(ctx context.Context) int

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

func (*DeletedRefQuery) ExecContext

func (c *DeletedRefQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefQuery) Exist

func (_q *DeletedRefQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeletedRefQuery) ExistX

func (_q *DeletedRefQuery) ExistX(ctx context.Context) bool

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

func (*DeletedRefQuery) First

func (_q *DeletedRefQuery) First(ctx context.Context) (*DeletedRef, error)

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

func (*DeletedRefQuery) FirstID

func (_q *DeletedRefQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DeletedRefQuery) FirstIDX

func (_q *DeletedRefQuery) FirstIDX(ctx context.Context) int

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

func (*DeletedRefQuery) FirstX

func (_q *DeletedRefQuery) FirstX(ctx context.Context) *DeletedRef

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

func (*DeletedRefQuery) ForShare

func (_q *DeletedRefQuery) ForShare(opts ...sql.LockOption) *DeletedRefQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*DeletedRefQuery) ForUpdate

func (_q *DeletedRefQuery) ForUpdate(opts ...sql.LockOption) *DeletedRefQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*DeletedRefQuery) GroupBy

func (_q *DeletedRefQuery) GroupBy(field string, fields ...string) *DeletedRefGroupBy

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 {
	Ref []byte `json:"ref,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DeletedRef.Query().
	GroupBy(deletedref.FieldRef).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeletedRefQuery) IDs

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

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

func (*DeletedRefQuery) IDsX

func (_q *DeletedRefQuery) IDsX(ctx context.Context) []int

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

func (*DeletedRefQuery) Limit

func (_q *DeletedRefQuery) Limit(limit int) *DeletedRefQuery

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

func (*DeletedRefQuery) Offset

func (_q *DeletedRefQuery) Offset(offset int) *DeletedRefQuery

Offset to start from.

func (*DeletedRefQuery) Only

func (_q *DeletedRefQuery) Only(ctx context.Context) (*DeletedRef, error)

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

func (*DeletedRefQuery) OnlyID

func (_q *DeletedRefQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DeletedRefQuery) OnlyIDX

func (_q *DeletedRefQuery) OnlyIDX(ctx context.Context) int

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

func (*DeletedRefQuery) OnlyX

func (_q *DeletedRefQuery) OnlyX(ctx context.Context) *DeletedRef

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

func (*DeletedRefQuery) Order

Order specifies how the records should be ordered.

func (*DeletedRefQuery) QueryContext

func (c *DeletedRefQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefQuery) Select

func (_q *DeletedRefQuery) Select(fields ...string) *DeletedRefSelect

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 {
	Ref []byte `json:"ref,omitempty"`
}

client.DeletedRef.Query().
	Select(deletedref.FieldRef).
	Scan(ctx, &v)

func (*DeletedRefQuery) Unique

func (_q *DeletedRefQuery) Unique(unique bool) *DeletedRefQuery

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

Where adds a new predicate for the DeletedRefQuery builder.

type DeletedRefSelect

type DeletedRefSelect struct {
	*DeletedRefQuery
	// contains filtered or unexported fields
}

DeletedRefSelect is the builder for selecting fields of DeletedRef entities.

func (*DeletedRefSelect) Aggregate

func (_s *DeletedRefSelect) Aggregate(fns ...AggregateFunc) *DeletedRefSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DeletedRefSelect) Bool

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

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

func (*DeletedRefSelect) BoolX

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

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

func (*DeletedRefSelect) Bools

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

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

func (*DeletedRefSelect) BoolsX

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

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

func (DeletedRefSelect) ExecContext

func (c DeletedRefSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefSelect) Float64

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

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

func (*DeletedRefSelect) Float64X

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

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

func (*DeletedRefSelect) Float64s

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

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

func (*DeletedRefSelect) Float64sX

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

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

func (*DeletedRefSelect) Int

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

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

func (*DeletedRefSelect) IntX

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

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

func (*DeletedRefSelect) Ints

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

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

func (*DeletedRefSelect) IntsX

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

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

func (DeletedRefSelect) QueryContext

func (c DeletedRefSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefSelect) Scan

func (_s *DeletedRefSelect) Scan(ctx context.Context, v any) error

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

func (*DeletedRefSelect) ScanX

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

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

func (*DeletedRefSelect) String

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

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

func (*DeletedRefSelect) StringX

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

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

func (*DeletedRefSelect) Strings

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

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

func (*DeletedRefSelect) StringsX

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

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

type DeletedRefUpdate

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

DeletedRefUpdate is the builder for updating DeletedRef entities.

func (*DeletedRefUpdate) Exec

func (_u *DeletedRefUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeletedRefUpdate) ExecContext

func (c *DeletedRefUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefUpdate) ExecX

func (_u *DeletedRefUpdate) ExecX(ctx context.Context)

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

func (*DeletedRefUpdate) Mutation

func (_u *DeletedRefUpdate) Mutation() *DeletedRefMutation

Mutation returns the DeletedRefMutation object of the builder.

func (*DeletedRefUpdate) QueryContext

func (c *DeletedRefUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefUpdate) Save

func (_u *DeletedRefUpdate) Save(ctx context.Context) (int, error)

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

func (*DeletedRefUpdate) SaveX

func (_u *DeletedRefUpdate) SaveX(ctx context.Context) int

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

func (*DeletedRefUpdate) SetNillableTombstonedAt

func (_u *DeletedRefUpdate) SetNillableTombstonedAt(v *time.Time) *DeletedRefUpdate

SetNillableTombstonedAt sets the "tombstoned_at" field if the given value is not nil.

func (*DeletedRefUpdate) SetTombstonedAt

func (_u *DeletedRefUpdate) SetTombstonedAt(v time.Time) *DeletedRefUpdate

SetTombstonedAt sets the "tombstoned_at" field.

func (*DeletedRefUpdate) Where

Where appends a list predicates to the DeletedRefUpdate builder.

type DeletedRefUpdateOne

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

DeletedRefUpdateOne is the builder for updating a single DeletedRef entity.

func (*DeletedRefUpdateOne) Exec

func (_u *DeletedRefUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeletedRefUpdateOne) ExecContext

func (c *DeletedRefUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DeletedRefUpdateOne) ExecX

func (_u *DeletedRefUpdateOne) ExecX(ctx context.Context)

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

func (*DeletedRefUpdateOne) Mutation

func (_u *DeletedRefUpdateOne) Mutation() *DeletedRefMutation

Mutation returns the DeletedRefMutation object of the builder.

func (*DeletedRefUpdateOne) QueryContext

func (c *DeletedRefUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DeletedRefUpdateOne) Save

Save executes the query and returns the updated DeletedRef entity.

func (*DeletedRefUpdateOne) SaveX

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

func (*DeletedRefUpdateOne) Select

func (_u *DeletedRefUpdateOne) Select(field string, fields ...string) *DeletedRefUpdateOne

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

func (*DeletedRefUpdateOne) SetNillableTombstonedAt

func (_u *DeletedRefUpdateOne) SetNillableTombstonedAt(v *time.Time) *DeletedRefUpdateOne

SetNillableTombstonedAt sets the "tombstoned_at" field if the given value is not nil.

func (*DeletedRefUpdateOne) SetTombstonedAt

func (_u *DeletedRefUpdateOne) SetTombstonedAt(v time.Time) *DeletedRefUpdateOne

SetTombstonedAt sets the "tombstoned_at" field.

func (*DeletedRefUpdateOne) Where

Where appends a list predicates to the DeletedRefUpdate builder.

type DeletedRefUpsert

type DeletedRefUpsert struct {
	*sql.UpdateSet
}

DeletedRefUpsert is the "OnConflict" setter.

func (*DeletedRefUpsert) SetTombstonedAt

func (u *DeletedRefUpsert) SetTombstonedAt(v time.Time) *DeletedRefUpsert

SetTombstonedAt sets the "tombstoned_at" field.

func (*DeletedRefUpsert) UpdateTombstonedAt

func (u *DeletedRefUpsert) UpdateTombstonedAt() *DeletedRefUpsert

UpdateTombstonedAt sets the "tombstoned_at" field to the value that was provided on create.

type DeletedRefUpsertBulk

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

DeletedRefUpsertBulk is the builder for "upsert"-ing a bulk of DeletedRef nodes.

func (*DeletedRefUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DeletedRefUpsertBulk) Exec

Exec executes the query.

func (*DeletedRefUpsertBulk) ExecX

func (u *DeletedRefUpsertBulk) ExecX(ctx context.Context)

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

func (*DeletedRefUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DeletedRef.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*DeletedRefUpsertBulk) SetTombstonedAt

func (u *DeletedRefUpsertBulk) SetTombstonedAt(v time.Time) *DeletedRefUpsertBulk

SetTombstonedAt sets the "tombstoned_at" field.

func (*DeletedRefUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the DeletedRefCreateBulk.OnConflict documentation for more info.

func (*DeletedRefUpsertBulk) UpdateNewValues

func (u *DeletedRefUpsertBulk) UpdateNewValues() *DeletedRefUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.DeletedRef.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*DeletedRefUpsertBulk) UpdateTombstonedAt

func (u *DeletedRefUpsertBulk) UpdateTombstonedAt() *DeletedRefUpsertBulk

UpdateTombstonedAt sets the "tombstoned_at" field to the value that was provided on create.

type DeletedRefUpsertOne

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

DeletedRefUpsertOne is the builder for "upsert"-ing

one DeletedRef node.

func (*DeletedRefUpsertOne) DoNothing

func (u *DeletedRefUpsertOne) DoNothing() *DeletedRefUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DeletedRefUpsertOne) Exec

Exec executes the query.

func (*DeletedRefUpsertOne) ExecX

func (u *DeletedRefUpsertOne) ExecX(ctx context.Context)

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

func (*DeletedRefUpsertOne) ID

func (u *DeletedRefUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*DeletedRefUpsertOne) IDX

func (u *DeletedRefUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*DeletedRefUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.DeletedRef.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*DeletedRefUpsertOne) SetTombstonedAt

func (u *DeletedRefUpsertOne) SetTombstonedAt(v time.Time) *DeletedRefUpsertOne

SetTombstonedAt sets the "tombstoned_at" field.

func (*DeletedRefUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the DeletedRefCreate.OnConflict documentation for more info.

func (*DeletedRefUpsertOne) UpdateNewValues

func (u *DeletedRefUpsertOne) UpdateNewValues() *DeletedRefUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.DeletedRef.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*DeletedRefUpsertOne) UpdateTombstonedAt

func (u *DeletedRefUpsertOne) UpdateTombstonedAt() *DeletedRefUpsertOne

UpdateTombstonedAt sets the "tombstoned_at" field to the value that was provided on create.

type DeletedRefs

type DeletedRefs []*DeletedRef

DeletedRefs is a parsable slice of DeletedRef.

type File

type File struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SetID holds the value of the "set_id" field.
	SetID int64 `json:"set_id,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Dir holds the value of the "dir" field.
	Dir string `json:"dir,omitempty"`
	// ValidFrom holds the value of the "valid_from" field.
	ValidFrom time.Time `json:"valid_from,omitempty"`
	// ValidUntil holds the value of the "valid_until" field.
	ValidUntil *time.Time `json:"valid_until,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// MtimeNs holds the value of the "mtime_ns" field.
	MtimeNs int64 `json:"mtime_ns,omitempty"`
	// Mode holds the value of the "mode" field.
	Mode uint32 `json:"mode,omitempty"`
	// User holds the value of the "user" field.
	User string `json:"user,omitempty"`
	// Group holds the value of the "group" field.
	Group string `json:"group,omitempty"`
	// Size holds the value of the "size" field.
	Size int64 `json:"size,omitempty"`
	// Type holds the value of the "type" field.
	Type uint32 `json:"type,omitempty"`
	// LinkTarget holds the value of the "link_target" field.
	LinkTarget []byte `json:"link_target,omitempty"`
	// Lost holds the value of the "lost" field.
	Lost bool `json:"lost,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileQuery when eager-loading is set.
	Edges FileEdges `json:"edges"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) ExecContext

func (c *File) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*File) QueryContext

func (c *File) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*File) QuerySet

func (_m *File) QuerySet() *SetQuery

QuerySet queries the "set" edge of the File entity.

func (*File) String

func (_m *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap

func (_m *File) Unwrap() *File

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

func (_m *File) Update() *FileUpdateOne

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

func (*File) Value

func (_m *File) Value(name string) (ent.Value, error)

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

type FileClient

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

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

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

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(_m *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id int) *FileDeleteOne

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

func (*FileClient) ExecContext

func (c *FileClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id int) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id int) *File

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

func (*FileClient) Hooks

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

Hooks returns the client hooks.

func (*FileClient) Intercept

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

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

func (*FileClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FileClient) MapCreateBulk

func (c *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk

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 (*FileClient) Query

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) QueryContext

func (c *FileClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileClient) QuerySet

func (c *FileClient) QuerySet(_m *File) *SetQuery

QuerySet queries the set edge of a File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(_m *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id int) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

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

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

type FileCreate

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

FileCreate is the builder for creating a File entity.

func (*FileCreate) Exec

func (_c *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecContext

func (c *FileCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileCreate) ExecX

func (_c *FileCreate) ExecX(ctx context.Context)

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

func (*FileCreate) Mutation

func (_c *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) OnConflict

func (_c *FileCreate) OnConflict(opts ...sql.ConflictOption) *FileUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.File.Create().
	SetSetID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*FileCreate) OnConflictColumns

func (_c *FileCreate) OnConflictColumns(columns ...string) *FileUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FileCreate) QueryContext

func (c *FileCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileCreate) Save

func (_c *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (_c *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetDir

func (_c *FileCreate) SetDir(v string) *FileCreate

SetDir sets the "dir" field.

func (*FileCreate) SetGroup

func (_c *FileCreate) SetGroup(v string) *FileCreate

SetGroup sets the "group" field.

func (*FileCreate) SetLinkTarget

func (_c *FileCreate) SetLinkTarget(v []byte) *FileCreate

SetLinkTarget sets the "link_target" field.

func (*FileCreate) SetLost

func (_c *FileCreate) SetLost(v bool) *FileCreate

SetLost sets the "lost" field.

func (*FileCreate) SetMode

func (_c *FileCreate) SetMode(v uint32) *FileCreate

SetMode sets the "mode" field.

func (*FileCreate) SetMtimeNs

func (_c *FileCreate) SetMtimeNs(v int64) *FileCreate

SetMtimeNs sets the "mtime_ns" field.

func (*FileCreate) SetNillableLost

func (_c *FileCreate) SetNillableLost(v *bool) *FileCreate

SetNillableLost sets the "lost" field if the given value is not nil.

func (*FileCreate) SetNillableType

func (_c *FileCreate) SetNillableType(v *uint32) *FileCreate

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

func (*FileCreate) SetNillableValidUntil

func (_c *FileCreate) SetNillableValidUntil(v *time.Time) *FileCreate

SetNillableValidUntil sets the "valid_until" field if the given value is not nil.

func (*FileCreate) SetPath

func (_c *FileCreate) SetPath(v string) *FileCreate

SetPath sets the "path" field.

func (*FileCreate) SetRef

func (_c *FileCreate) SetRef(v []byte) *FileCreate

SetRef sets the "ref" field.

func (*FileCreate) SetSet

func (_c *FileCreate) SetSet(v *Set) *FileCreate

SetSet sets the "set" edge to the Set entity.

func (*FileCreate) SetSetID

func (_c *FileCreate) SetSetID(v int64) *FileCreate

SetSetID sets the "set_id" field.

func (*FileCreate) SetSize

func (_c *FileCreate) SetSize(v int64) *FileCreate

SetSize sets the "size" field.

func (*FileCreate) SetType

func (_c *FileCreate) SetType(v uint32) *FileCreate

SetType sets the "type" field.

func (*FileCreate) SetUser

func (_c *FileCreate) SetUser(v string) *FileCreate

SetUser sets the "user" field.

func (*FileCreate) SetValidFrom

func (_c *FileCreate) SetValidFrom(v time.Time) *FileCreate

SetValidFrom sets the "valid_from" field.

func (*FileCreate) SetValidUntil

func (_c *FileCreate) SetValidUntil(v time.Time) *FileCreate

SetValidUntil sets the "valid_until" field.

type FileCreateBulk

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

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (_c *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecContext

func (c *FileCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileCreateBulk) ExecX

func (_c *FileCreateBulk) ExecX(ctx context.Context)

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

func (*FileCreateBulk) OnConflict

func (_c *FileCreateBulk) OnConflict(opts ...sql.ConflictOption) *FileUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.File.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*FileCreateBulk) OnConflictColumns

func (_c *FileCreateBulk) OnConflictColumns(columns ...string) *FileUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FileCreateBulk) QueryContext

func (c *FileCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileCreateBulk) Save

func (_c *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (_c *FileCreateBulk) SaveX(ctx context.Context) []*File

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

type FileDelete

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

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (_d *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecContext

func (c *FileDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileDelete) ExecX

func (_d *FileDelete) ExecX(ctx context.Context) int

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

func (*FileDelete) QueryContext

func (c *FileDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileDelete) Where

func (_d *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

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

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (_d *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (_d *FileDeleteOne) ExecX(ctx context.Context)

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

func (*FileDeleteOne) Where

func (_d *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileEdges

type FileEdges struct {
	// Set holds the value of the set edge.
	Set *Set `json:"set,omitempty"`
	// contains filtered or unexported fields
}

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

func (FileEdges) SetOrErr

func (e FileEdges) SetOrErr() (*Set, error)

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

type FileGroupBy

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (_g *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

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

func (*FileGroupBy) Bool

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

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

func (*FileGroupBy) BoolX

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

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

func (*FileGroupBy) Bools

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

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

func (*FileGroupBy) BoolsX

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

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

func (*FileGroupBy) Float64

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

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

func (*FileGroupBy) Float64X

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

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

func (*FileGroupBy) Float64s

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

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

func (*FileGroupBy) Float64sX

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

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

func (*FileGroupBy) Int

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

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

func (*FileGroupBy) IntX

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

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

func (*FileGroupBy) Ints

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

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

func (*FileGroupBy) IntsX

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

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

func (*FileGroupBy) Scan

func (_g *FileGroupBy) Scan(ctx context.Context, v any) error

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

func (*FileGroupBy) ScanX

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

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

func (*FileGroupBy) String

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

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

func (*FileGroupBy) StringX

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

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

func (*FileGroupBy) Strings

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

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

func (*FileGroupBy) StringsX

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

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

type FileMutation

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

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddField

func (m *FileMutation) 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 (*FileMutation) AddMode

func (m *FileMutation) AddMode(u int32)

AddMode adds u to the "mode" field.

func (*FileMutation) AddMtimeNs

func (m *FileMutation) AddMtimeNs(i int64)

AddMtimeNs adds i to the "mtime_ns" field.

func (*FileMutation) AddSize

func (m *FileMutation) AddSize(i int64)

AddSize adds i to the "size" field.

func (*FileMutation) AddType

func (m *FileMutation) AddType(u int32)

AddType adds u to the "type" field.

func (*FileMutation) AddedEdges

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

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

func (*FileMutation) AddedField

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

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

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

func (*FileMutation) AddedIDs

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

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

func (*FileMutation) AddedMode

func (m *FileMutation) AddedMode() (r int32, exists bool)

AddedMode returns the value that was added to the "mode" field in this mutation.

func (*FileMutation) AddedMtimeNs

func (m *FileMutation) AddedMtimeNs() (r int64, exists bool)

AddedMtimeNs returns the value that was added to the "mtime_ns" field in this mutation.

func (*FileMutation) AddedSize

func (m *FileMutation) AddedSize() (r int64, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*FileMutation) AddedType

func (m *FileMutation) AddedType() (r int32, exists bool)

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

func (*FileMutation) ClearEdge

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

func (m *FileMutation) 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 (*FileMutation) ClearLinkTarget

func (m *FileMutation) ClearLinkTarget()

ClearLinkTarget clears the value of the "link_target" field.

func (*FileMutation) ClearRef

func (m *FileMutation) ClearRef()

ClearRef clears the value of the "ref" field.

func (*FileMutation) ClearSet

func (m *FileMutation) ClearSet()

ClearSet clears the "set" edge to the Set entity.

func (*FileMutation) ClearValidUntil

func (m *FileMutation) ClearValidUntil()

ClearValidUntil clears the value of the "valid_until" field.

func (*FileMutation) ClearedEdges

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

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

func (*FileMutation) ClearedFields

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

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

func (FileMutation) Client

func (m FileMutation) 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 (*FileMutation) Dir

func (m *FileMutation) Dir() (r string, exists bool)

Dir returns the value of the "dir" field in the mutation.

func (*FileMutation) EdgeCleared

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

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

func (*FileMutation) ExecContext

func (c *FileMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileMutation) Field

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

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

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

func (*FileMutation) Fields

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

func (m *FileMutation) GetType() (r uint32, exists bool)

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

func (*FileMutation) Group

func (m *FileMutation) Group() (r string, exists bool)

Group returns the value of the "group" field in the mutation.

func (*FileMutation) ID

func (m *FileMutation) 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 (*FileMutation) IDs

func (m *FileMutation) 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 (*FileMutation) LinkTarget

func (m *FileMutation) LinkTarget() (r []byte, exists bool)

LinkTarget returns the value of the "link_target" field in the mutation.

func (*FileMutation) LinkTargetCleared

func (m *FileMutation) LinkTargetCleared() bool

LinkTargetCleared returns if the "link_target" field was cleared in this mutation.

func (*FileMutation) Lost

func (m *FileMutation) Lost() (r bool, exists bool)

Lost returns the value of the "lost" field in the mutation.

func (*FileMutation) Mode

func (m *FileMutation) Mode() (r uint32, exists bool)

Mode returns the value of the "mode" field in the mutation.

func (*FileMutation) MtimeNs

func (m *FileMutation) MtimeNs() (r int64, exists bool)

MtimeNs returns the value of the "mtime_ns" field in the mutation.

func (*FileMutation) OldDir

func (m *FileMutation) OldDir(ctx context.Context) (v string, err error)

OldDir returns the old "dir" field's value of the File entity. If the File 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 (*FileMutation) OldField

func (m *FileMutation) 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 (*FileMutation) OldGroup

func (m *FileMutation) OldGroup(ctx context.Context) (v string, err error)

OldGroup returns the old "group" field's value of the File entity. If the File 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 (*FileMutation) OldLinkTarget

func (m *FileMutation) OldLinkTarget(ctx context.Context) (v []byte, err error)

OldLinkTarget returns the old "link_target" field's value of the File entity. If the File 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 (*FileMutation) OldLost

func (m *FileMutation) OldLost(ctx context.Context) (v bool, err error)

OldLost returns the old "lost" field's value of the File entity. If the File 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 (*FileMutation) OldMode

func (m *FileMutation) OldMode(ctx context.Context) (v uint32, err error)

OldMode returns the old "mode" field's value of the File entity. If the File 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 (*FileMutation) OldMtimeNs

func (m *FileMutation) OldMtimeNs(ctx context.Context) (v int64, err error)

OldMtimeNs returns the old "mtime_ns" field's value of the File entity. If the File 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 (*FileMutation) OldPath

func (m *FileMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the File entity. If the File 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 (*FileMutation) OldRef

func (m *FileMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the File entity. If the File 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 (*FileMutation) OldSetID

func (m *FileMutation) OldSetID(ctx context.Context) (v int64, err error)

OldSetID returns the old "set_id" field's value of the File entity. If the File 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 (*FileMutation) OldSize

func (m *FileMutation) OldSize(ctx context.Context) (v int64, err error)

OldSize returns the old "size" field's value of the File entity. If the File 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 (*FileMutation) OldType

func (m *FileMutation) OldType(ctx context.Context) (v uint32, err error)

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

func (m *FileMutation) OldUser(ctx context.Context) (v string, err error)

OldUser returns the old "user" field's value of the File entity. If the File 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 (*FileMutation) OldValidFrom

func (m *FileMutation) OldValidFrom(ctx context.Context) (v time.Time, err error)

OldValidFrom returns the old "valid_from" field's value of the File entity. If the File 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 (*FileMutation) OldValidUntil

func (m *FileMutation) OldValidUntil(ctx context.Context) (v *time.Time, err error)

OldValidUntil returns the old "valid_until" field's value of the File entity. If the File 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 (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) Path

func (m *FileMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*FileMutation) QueryContext

func (c *FileMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileMutation) Ref

func (m *FileMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*FileMutation) RefCleared

func (m *FileMutation) RefCleared() bool

RefCleared returns if the "ref" field was cleared in this mutation.

func (*FileMutation) RemovedEdges

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

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

func (*FileMutation) RemovedIDs

func (m *FileMutation) 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 (*FileMutation) ResetDir

func (m *FileMutation) ResetDir()

ResetDir resets all changes to the "dir" field.

func (*FileMutation) ResetEdge

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

func (m *FileMutation) 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 (*FileMutation) ResetGroup

func (m *FileMutation) ResetGroup()

ResetGroup resets all changes to the "group" field.

func (*FileMutation) ResetLinkTarget

func (m *FileMutation) ResetLinkTarget()

ResetLinkTarget resets all changes to the "link_target" field.

func (*FileMutation) ResetLost

func (m *FileMutation) ResetLost()

ResetLost resets all changes to the "lost" field.

func (*FileMutation) ResetMode

func (m *FileMutation) ResetMode()

ResetMode resets all changes to the "mode" field.

func (*FileMutation) ResetMtimeNs

func (m *FileMutation) ResetMtimeNs()

ResetMtimeNs resets all changes to the "mtime_ns" field.

func (*FileMutation) ResetPath

func (m *FileMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*FileMutation) ResetRef

func (m *FileMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*FileMutation) ResetSet

func (m *FileMutation) ResetSet()

ResetSet resets all changes to the "set" edge.

func (*FileMutation) ResetSetID

func (m *FileMutation) ResetSetID()

ResetSetID resets all changes to the "set_id" field.

func (*FileMutation) ResetSize

func (m *FileMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*FileMutation) ResetType

func (m *FileMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*FileMutation) ResetUser

func (m *FileMutation) ResetUser()

ResetUser resets all changes to the "user" field.

func (*FileMutation) ResetValidFrom

func (m *FileMutation) ResetValidFrom()

ResetValidFrom resets all changes to the "valid_from" field.

func (*FileMutation) ResetValidUntil

func (m *FileMutation) ResetValidUntil()

ResetValidUntil resets all changes to the "valid_until" field.

func (*FileMutation) SetCleared

func (m *FileMutation) SetCleared() bool

SetCleared reports if the "set" edge to the Set entity was cleared.

func (*FileMutation) SetDir

func (m *FileMutation) SetDir(s string)

SetDir sets the "dir" field.

func (*FileMutation) SetField

func (m *FileMutation) 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 (*FileMutation) SetGroup

func (m *FileMutation) SetGroup(s string)

SetGroup sets the "group" field.

func (*FileMutation) SetID

func (m *FileMutation) SetID() (r int64, exists bool)

SetID returns the value of the "set_id" field in the mutation.

func (*FileMutation) SetIDs

func (m *FileMutation) SetIDs() (ids []int64)

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

func (*FileMutation) SetLinkTarget

func (m *FileMutation) SetLinkTarget(b []byte)

SetLinkTarget sets the "link_target" field.

func (*FileMutation) SetLost

func (m *FileMutation) SetLost(b bool)

SetLost sets the "lost" field.

func (*FileMutation) SetMode

func (m *FileMutation) SetMode(u uint32)

SetMode sets the "mode" field.

func (*FileMutation) SetMtimeNs

func (m *FileMutation) SetMtimeNs(i int64)

SetMtimeNs sets the "mtime_ns" field.

func (*FileMutation) SetOp

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileMutation) SetPath

func (m *FileMutation) SetPath(s string)

SetPath sets the "path" field.

func (*FileMutation) SetRef

func (m *FileMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*FileMutation) SetSetID

func (m *FileMutation) SetSetID(i int64)

SetSetID sets the "set_id" field.

func (*FileMutation) SetSize

func (m *FileMutation) SetSize(i int64)

SetSize sets the "size" field.

func (*FileMutation) SetType

func (m *FileMutation) SetType(u uint32)

SetType sets the "type" field.

func (*FileMutation) SetUser

func (m *FileMutation) SetUser(s string)

SetUser sets the "user" field.

func (*FileMutation) SetValidFrom

func (m *FileMutation) SetValidFrom(t time.Time)

SetValidFrom sets the "valid_from" field.

func (*FileMutation) SetValidUntil

func (m *FileMutation) SetValidUntil(t time.Time)

SetValidUntil sets the "valid_until" field.

func (*FileMutation) Size

func (m *FileMutation) Size() (r int64, exists bool)

Size returns the value of the "size" field in the mutation.

func (FileMutation) Tx

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

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

func (*FileMutation) Type

func (m *FileMutation) Type() string

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

func (*FileMutation) User

func (m *FileMutation) User() (r string, exists bool)

User returns the value of the "user" field in the mutation.

func (*FileMutation) ValidFrom

func (m *FileMutation) ValidFrom() (r time.Time, exists bool)

ValidFrom returns the value of the "valid_from" field in the mutation.

func (*FileMutation) ValidUntil

func (m *FileMutation) ValidUntil() (r time.Time, exists bool)

ValidUntil returns the value of the "valid_until" field in the mutation.

func (*FileMutation) ValidUntilCleared

func (m *FileMutation) ValidUntilCleared() bool

ValidUntilCleared returns if the "valid_until" field was cleared in this mutation.

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP

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

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

type FileQuery

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

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate

func (_q *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

func (_q *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (_q *FileQuery) AllX(ctx context.Context) []*File

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

func (*FileQuery) Clone

func (_q *FileQuery) Clone() *FileQuery

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

func (*FileQuery) Count

func (_q *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (_q *FileQuery) CountX(ctx context.Context) int

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

func (*FileQuery) ExecContext

func (c *FileQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileQuery) Exist

func (_q *FileQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileQuery) ExistX

func (_q *FileQuery) ExistX(ctx context.Context) bool

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

func (*FileQuery) First

func (_q *FileQuery) First(ctx context.Context) (*File, error)

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

func (*FileQuery) FirstID

func (_q *FileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FileQuery) FirstIDX

func (_q *FileQuery) FirstIDX(ctx context.Context) int

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

func (*FileQuery) FirstX

func (_q *FileQuery) FirstX(ctx context.Context) *File

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

func (*FileQuery) ForShare

func (_q *FileQuery) ForShare(opts ...sql.LockOption) *FileQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*FileQuery) ForUpdate

func (_q *FileQuery) ForUpdate(opts ...sql.LockOption) *FileQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*FileQuery) GroupBy

func (_q *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

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 {
	SetID int64 `json:"set_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.File.Query().
	GroupBy(file.FieldSetID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs

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

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

func (*FileQuery) IDsX

func (_q *FileQuery) IDsX(ctx context.Context) []int

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

func (*FileQuery) Limit

func (_q *FileQuery) Limit(limit int) *FileQuery

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

func (*FileQuery) Offset

func (_q *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only

func (_q *FileQuery) Only(ctx context.Context) (*File, error)

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

func (*FileQuery) OnlyID

func (_q *FileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FileQuery) OnlyIDX

func (_q *FileQuery) OnlyIDX(ctx context.Context) int

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

func (*FileQuery) OnlyX

func (_q *FileQuery) OnlyX(ctx context.Context) *File

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

func (*FileQuery) Order

func (_q *FileQuery) Order(o ...file.OrderOption) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) QueryContext

func (c *FileQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileQuery) QuerySet

func (_q *FileQuery) QuerySet() *SetQuery

QuerySet chains the current query on the "set" edge.

func (*FileQuery) Select

func (_q *FileQuery) Select(fields ...string) *FileSelect

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 {
	SetID int64 `json:"set_id,omitempty"`
}

client.File.Query().
	Select(file.FieldSetID).
	Scan(ctx, &v)

func (*FileQuery) Unique

func (_q *FileQuery) Unique(unique bool) *FileQuery

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

func (_q *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WithSet

func (_q *FileQuery) WithSet(opts ...func(*SetQuery)) *FileQuery

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

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate

func (_s *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool

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

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

func (*FileSelect) BoolX

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

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

func (*FileSelect) Bools

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

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

func (*FileSelect) BoolsX

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

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

func (FileSelect) ExecContext

func (c FileSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileSelect) Float64

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

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

func (*FileSelect) Float64X

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

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

func (*FileSelect) Float64s

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

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

func (*FileSelect) Float64sX

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

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

func (*FileSelect) Int

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

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

func (*FileSelect) IntX

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

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

func (*FileSelect) Ints

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

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

func (*FileSelect) IntsX

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

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

func (FileSelect) QueryContext

func (c FileSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileSelect) Scan

func (_s *FileSelect) Scan(ctx context.Context, v any) error

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

func (*FileSelect) ScanX

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

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

func (*FileSelect) String

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

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

func (*FileSelect) StringX

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

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

func (*FileSelect) Strings

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

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

func (*FileSelect) StringsX

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

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

type FileUpdate

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

FileUpdate is the builder for updating File entities.

func (*FileUpdate) AddMode

func (_u *FileUpdate) AddMode(v int32) *FileUpdate

AddMode adds value to the "mode" field.

func (*FileUpdate) AddMtimeNs

func (_u *FileUpdate) AddMtimeNs(v int64) *FileUpdate

AddMtimeNs adds value to the "mtime_ns" field.

func (*FileUpdate) AddSize

func (_u *FileUpdate) AddSize(v int64) *FileUpdate

AddSize adds value to the "size" field.

func (*FileUpdate) AddType

func (_u *FileUpdate) AddType(v int32) *FileUpdate

AddType adds value to the "type" field.

func (*FileUpdate) ClearLinkTarget

func (_u *FileUpdate) ClearLinkTarget() *FileUpdate

ClearLinkTarget clears the value of the "link_target" field.

func (*FileUpdate) ClearRef

func (_u *FileUpdate) ClearRef() *FileUpdate

ClearRef clears the value of the "ref" field.

func (*FileUpdate) ClearSet

func (_u *FileUpdate) ClearSet() *FileUpdate

ClearSet clears the "set" edge to the Set entity.

func (*FileUpdate) ClearValidUntil

func (_u *FileUpdate) ClearValidUntil() *FileUpdate

ClearValidUntil clears the value of the "valid_until" field.

func (*FileUpdate) Exec

func (_u *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecContext

func (c *FileUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileUpdate) ExecX

func (_u *FileUpdate) ExecX(ctx context.Context)

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

func (*FileUpdate) Mutation

func (_u *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) QueryContext

func (c *FileUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileUpdate) Save

func (_u *FileUpdate) Save(ctx context.Context) (int, error)

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

func (*FileUpdate) SaveX

func (_u *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) SetDir

func (_u *FileUpdate) SetDir(v string) *FileUpdate

SetDir sets the "dir" field.

func (*FileUpdate) SetGroup

func (_u *FileUpdate) SetGroup(v string) *FileUpdate

SetGroup sets the "group" field.

func (*FileUpdate) SetLinkTarget

func (_u *FileUpdate) SetLinkTarget(v []byte) *FileUpdate

SetLinkTarget sets the "link_target" field.

func (*FileUpdate) SetLost

func (_u *FileUpdate) SetLost(v bool) *FileUpdate

SetLost sets the "lost" field.

func (*FileUpdate) SetMode

func (_u *FileUpdate) SetMode(v uint32) *FileUpdate

SetMode sets the "mode" field.

func (*FileUpdate) SetMtimeNs

func (_u *FileUpdate) SetMtimeNs(v int64) *FileUpdate

SetMtimeNs sets the "mtime_ns" field.

func (*FileUpdate) SetNillableDir

func (_u *FileUpdate) SetNillableDir(v *string) *FileUpdate

SetNillableDir sets the "dir" field if the given value is not nil.

func (*FileUpdate) SetNillableGroup

func (_u *FileUpdate) SetNillableGroup(v *string) *FileUpdate

SetNillableGroup sets the "group" field if the given value is not nil.

func (*FileUpdate) SetNillableLost

func (_u *FileUpdate) SetNillableLost(v *bool) *FileUpdate

SetNillableLost sets the "lost" field if the given value is not nil.

func (*FileUpdate) SetNillableMode

func (_u *FileUpdate) SetNillableMode(v *uint32) *FileUpdate

SetNillableMode sets the "mode" field if the given value is not nil.

func (*FileUpdate) SetNillableMtimeNs

func (_u *FileUpdate) SetNillableMtimeNs(v *int64) *FileUpdate

SetNillableMtimeNs sets the "mtime_ns" field if the given value is not nil.

func (*FileUpdate) SetNillablePath

func (_u *FileUpdate) SetNillablePath(v *string) *FileUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*FileUpdate) SetNillableSetID

func (_u *FileUpdate) SetNillableSetID(v *int64) *FileUpdate

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*FileUpdate) SetNillableSize

func (_u *FileUpdate) SetNillableSize(v *int64) *FileUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdate) SetNillableType

func (_u *FileUpdate) SetNillableType(v *uint32) *FileUpdate

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

func (*FileUpdate) SetNillableUser

func (_u *FileUpdate) SetNillableUser(v *string) *FileUpdate

SetNillableUser sets the "user" field if the given value is not nil.

func (*FileUpdate) SetNillableValidFrom

func (_u *FileUpdate) SetNillableValidFrom(v *time.Time) *FileUpdate

SetNillableValidFrom sets the "valid_from" field if the given value is not nil.

func (*FileUpdate) SetNillableValidUntil

func (_u *FileUpdate) SetNillableValidUntil(v *time.Time) *FileUpdate

SetNillableValidUntil sets the "valid_until" field if the given value is not nil.

func (*FileUpdate) SetPath

func (_u *FileUpdate) SetPath(v string) *FileUpdate

SetPath sets the "path" field.

func (*FileUpdate) SetRef

func (_u *FileUpdate) SetRef(v []byte) *FileUpdate

SetRef sets the "ref" field.

func (*FileUpdate) SetSet

func (_u *FileUpdate) SetSet(v *Set) *FileUpdate

SetSet sets the "set" edge to the Set entity.

func (*FileUpdate) SetSetID

func (_u *FileUpdate) SetSetID(v int64) *FileUpdate

SetSetID sets the "set_id" field.

func (*FileUpdate) SetSize

func (_u *FileUpdate) SetSize(v int64) *FileUpdate

SetSize sets the "size" field.

func (*FileUpdate) SetType

func (_u *FileUpdate) SetType(v uint32) *FileUpdate

SetType sets the "type" field.

func (*FileUpdate) SetUser

func (_u *FileUpdate) SetUser(v string) *FileUpdate

SetUser sets the "user" field.

func (*FileUpdate) SetValidFrom

func (_u *FileUpdate) SetValidFrom(v time.Time) *FileUpdate

SetValidFrom sets the "valid_from" field.

func (*FileUpdate) SetValidUntil

func (_u *FileUpdate) SetValidUntil(v time.Time) *FileUpdate

SetValidUntil sets the "valid_until" field.

func (*FileUpdate) Where

func (_u *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

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

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) AddMode

func (_u *FileUpdateOne) AddMode(v int32) *FileUpdateOne

AddMode adds value to the "mode" field.

func (*FileUpdateOne) AddMtimeNs

func (_u *FileUpdateOne) AddMtimeNs(v int64) *FileUpdateOne

AddMtimeNs adds value to the "mtime_ns" field.

func (*FileUpdateOne) AddSize

func (_u *FileUpdateOne) AddSize(v int64) *FileUpdateOne

AddSize adds value to the "size" field.

func (*FileUpdateOne) AddType

func (_u *FileUpdateOne) AddType(v int32) *FileUpdateOne

AddType adds value to the "type" field.

func (*FileUpdateOne) ClearLinkTarget

func (_u *FileUpdateOne) ClearLinkTarget() *FileUpdateOne

ClearLinkTarget clears the value of the "link_target" field.

func (*FileUpdateOne) ClearRef

func (_u *FileUpdateOne) ClearRef() *FileUpdateOne

ClearRef clears the value of the "ref" field.

func (*FileUpdateOne) ClearSet

func (_u *FileUpdateOne) ClearSet() *FileUpdateOne

ClearSet clears the "set" edge to the Set entity.

func (*FileUpdateOne) ClearValidUntil

func (_u *FileUpdateOne) ClearValidUntil() *FileUpdateOne

ClearValidUntil clears the value of the "valid_until" field.

func (*FileUpdateOne) Exec

func (_u *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecContext

func (c *FileUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileUpdateOne) ExecX

func (_u *FileUpdateOne) ExecX(ctx context.Context)

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

func (*FileUpdateOne) Mutation

func (_u *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) QueryContext

func (c *FileUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileUpdateOne) Save

func (_u *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (_u *FileUpdateOne) SaveX(ctx context.Context) *File

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

func (*FileUpdateOne) Select

func (_u *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

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

func (*FileUpdateOne) SetDir

func (_u *FileUpdateOne) SetDir(v string) *FileUpdateOne

SetDir sets the "dir" field.

func (*FileUpdateOne) SetGroup

func (_u *FileUpdateOne) SetGroup(v string) *FileUpdateOne

SetGroup sets the "group" field.

func (*FileUpdateOne) SetLinkTarget

func (_u *FileUpdateOne) SetLinkTarget(v []byte) *FileUpdateOne

SetLinkTarget sets the "link_target" field.

func (*FileUpdateOne) SetLost

func (_u *FileUpdateOne) SetLost(v bool) *FileUpdateOne

SetLost sets the "lost" field.

func (*FileUpdateOne) SetMode

func (_u *FileUpdateOne) SetMode(v uint32) *FileUpdateOne

SetMode sets the "mode" field.

func (*FileUpdateOne) SetMtimeNs

func (_u *FileUpdateOne) SetMtimeNs(v int64) *FileUpdateOne

SetMtimeNs sets the "mtime_ns" field.

func (*FileUpdateOne) SetNillableDir

func (_u *FileUpdateOne) SetNillableDir(v *string) *FileUpdateOne

SetNillableDir sets the "dir" field if the given value is not nil.

func (*FileUpdateOne) SetNillableGroup

func (_u *FileUpdateOne) SetNillableGroup(v *string) *FileUpdateOne

SetNillableGroup sets the "group" field if the given value is not nil.

func (*FileUpdateOne) SetNillableLost

func (_u *FileUpdateOne) SetNillableLost(v *bool) *FileUpdateOne

SetNillableLost sets the "lost" field if the given value is not nil.

func (*FileUpdateOne) SetNillableMode

func (_u *FileUpdateOne) SetNillableMode(v *uint32) *FileUpdateOne

SetNillableMode sets the "mode" field if the given value is not nil.

func (*FileUpdateOne) SetNillableMtimeNs

func (_u *FileUpdateOne) SetNillableMtimeNs(v *int64) *FileUpdateOne

SetNillableMtimeNs sets the "mtime_ns" field if the given value is not nil.

func (*FileUpdateOne) SetNillablePath

func (_u *FileUpdateOne) SetNillablePath(v *string) *FileUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*FileUpdateOne) SetNillableSetID

func (_u *FileUpdateOne) SetNillableSetID(v *int64) *FileUpdateOne

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*FileUpdateOne) SetNillableSize

func (_u *FileUpdateOne) SetNillableSize(v *int64) *FileUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdateOne) SetNillableType

func (_u *FileUpdateOne) SetNillableType(v *uint32) *FileUpdateOne

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

func (*FileUpdateOne) SetNillableUser

func (_u *FileUpdateOne) SetNillableUser(v *string) *FileUpdateOne

SetNillableUser sets the "user" field if the given value is not nil.

func (*FileUpdateOne) SetNillableValidFrom

func (_u *FileUpdateOne) SetNillableValidFrom(v *time.Time) *FileUpdateOne

SetNillableValidFrom sets the "valid_from" field if the given value is not nil.

func (*FileUpdateOne) SetNillableValidUntil

func (_u *FileUpdateOne) SetNillableValidUntil(v *time.Time) *FileUpdateOne

SetNillableValidUntil sets the "valid_until" field if the given value is not nil.

func (*FileUpdateOne) SetPath

func (_u *FileUpdateOne) SetPath(v string) *FileUpdateOne

SetPath sets the "path" field.

func (*FileUpdateOne) SetRef

func (_u *FileUpdateOne) SetRef(v []byte) *FileUpdateOne

SetRef sets the "ref" field.

func (*FileUpdateOne) SetSet

func (_u *FileUpdateOne) SetSet(v *Set) *FileUpdateOne

SetSet sets the "set" edge to the Set entity.

func (*FileUpdateOne) SetSetID

func (_u *FileUpdateOne) SetSetID(v int64) *FileUpdateOne

SetSetID sets the "set_id" field.

func (*FileUpdateOne) SetSize

func (_u *FileUpdateOne) SetSize(v int64) *FileUpdateOne

SetSize sets the "size" field.

func (*FileUpdateOne) SetType

func (_u *FileUpdateOne) SetType(v uint32) *FileUpdateOne

SetType sets the "type" field.

func (*FileUpdateOne) SetUser

func (_u *FileUpdateOne) SetUser(v string) *FileUpdateOne

SetUser sets the "user" field.

func (*FileUpdateOne) SetValidFrom

func (_u *FileUpdateOne) SetValidFrom(v time.Time) *FileUpdateOne

SetValidFrom sets the "valid_from" field.

func (*FileUpdateOne) SetValidUntil

func (_u *FileUpdateOne) SetValidUntil(v time.Time) *FileUpdateOne

SetValidUntil sets the "valid_until" field.

func (*FileUpdateOne) Where

func (_u *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type FileUpsert

type FileUpsert struct {
	*sql.UpdateSet
}

FileUpsert is the "OnConflict" setter.

func (*FileUpsert) AddMode

func (u *FileUpsert) AddMode(v uint32) *FileUpsert

AddMode adds v to the "mode" field.

func (*FileUpsert) AddMtimeNs

func (u *FileUpsert) AddMtimeNs(v int64) *FileUpsert

AddMtimeNs adds v to the "mtime_ns" field.

func (*FileUpsert) AddSize

func (u *FileUpsert) AddSize(v int64) *FileUpsert

AddSize adds v to the "size" field.

func (*FileUpsert) AddType

func (u *FileUpsert) AddType(v uint32) *FileUpsert

AddType adds v to the "type" field.

func (*FileUpsert) ClearLinkTarget

func (u *FileUpsert) ClearLinkTarget() *FileUpsert

ClearLinkTarget clears the value of the "link_target" field.

func (*FileUpsert) ClearRef

func (u *FileUpsert) ClearRef() *FileUpsert

ClearRef clears the value of the "ref" field.

func (*FileUpsert) ClearValidUntil

func (u *FileUpsert) ClearValidUntil() *FileUpsert

ClearValidUntil clears the value of the "valid_until" field.

func (*FileUpsert) SetDir

func (u *FileUpsert) SetDir(v string) *FileUpsert

SetDir sets the "dir" field.

func (*FileUpsert) SetGroup

func (u *FileUpsert) SetGroup(v string) *FileUpsert

SetGroup sets the "group" field.

func (*FileUpsert) SetLinkTarget

func (u *FileUpsert) SetLinkTarget(v []byte) *FileUpsert

SetLinkTarget sets the "link_target" field.

func (*FileUpsert) SetLost

func (u *FileUpsert) SetLost(v bool) *FileUpsert

SetLost sets the "lost" field.

func (*FileUpsert) SetMode

func (u *FileUpsert) SetMode(v uint32) *FileUpsert

SetMode sets the "mode" field.

func (*FileUpsert) SetMtimeNs

func (u *FileUpsert) SetMtimeNs(v int64) *FileUpsert

SetMtimeNs sets the "mtime_ns" field.

func (*FileUpsert) SetPath

func (u *FileUpsert) SetPath(v string) *FileUpsert

SetPath sets the "path" field.

func (*FileUpsert) SetRef

func (u *FileUpsert) SetRef(v []byte) *FileUpsert

SetRef sets the "ref" field.

func (*FileUpsert) SetSetID

func (u *FileUpsert) SetSetID(v int64) *FileUpsert

SetSetID sets the "set_id" field.

func (*FileUpsert) SetSize

func (u *FileUpsert) SetSize(v int64) *FileUpsert

SetSize sets the "size" field.

func (*FileUpsert) SetType

func (u *FileUpsert) SetType(v uint32) *FileUpsert

SetType sets the "type" field.

func (*FileUpsert) SetUser

func (u *FileUpsert) SetUser(v string) *FileUpsert

SetUser sets the "user" field.

func (*FileUpsert) SetValidFrom

func (u *FileUpsert) SetValidFrom(v time.Time) *FileUpsert

SetValidFrom sets the "valid_from" field.

func (*FileUpsert) SetValidUntil

func (u *FileUpsert) SetValidUntil(v time.Time) *FileUpsert

SetValidUntil sets the "valid_until" field.

func (*FileUpsert) UpdateDir

func (u *FileUpsert) UpdateDir() *FileUpsert

UpdateDir sets the "dir" field to the value that was provided on create.

func (*FileUpsert) UpdateGroup

func (u *FileUpsert) UpdateGroup() *FileUpsert

UpdateGroup sets the "group" field to the value that was provided on create.

func (*FileUpsert) UpdateLinkTarget

func (u *FileUpsert) UpdateLinkTarget() *FileUpsert

UpdateLinkTarget sets the "link_target" field to the value that was provided on create.

func (*FileUpsert) UpdateLost

func (u *FileUpsert) UpdateLost() *FileUpsert

UpdateLost sets the "lost" field to the value that was provided on create.

func (*FileUpsert) UpdateMode

func (u *FileUpsert) UpdateMode() *FileUpsert

UpdateMode sets the "mode" field to the value that was provided on create.

func (*FileUpsert) UpdateMtimeNs

func (u *FileUpsert) UpdateMtimeNs() *FileUpsert

UpdateMtimeNs sets the "mtime_ns" field to the value that was provided on create.

func (*FileUpsert) UpdatePath

func (u *FileUpsert) UpdatePath() *FileUpsert

UpdatePath sets the "path" field to the value that was provided on create.

func (*FileUpsert) UpdateRef

func (u *FileUpsert) UpdateRef() *FileUpsert

UpdateRef sets the "ref" field to the value that was provided on create.

func (*FileUpsert) UpdateSetID

func (u *FileUpsert) UpdateSetID() *FileUpsert

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*FileUpsert) UpdateSize

func (u *FileUpsert) UpdateSize() *FileUpsert

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsert) UpdateType

func (u *FileUpsert) UpdateType() *FileUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*FileUpsert) UpdateUser

func (u *FileUpsert) UpdateUser() *FileUpsert

UpdateUser sets the "user" field to the value that was provided on create.

func (*FileUpsert) UpdateValidFrom

func (u *FileUpsert) UpdateValidFrom() *FileUpsert

UpdateValidFrom sets the "valid_from" field to the value that was provided on create.

func (*FileUpsert) UpdateValidUntil

func (u *FileUpsert) UpdateValidUntil() *FileUpsert

UpdateValidUntil sets the "valid_until" field to the value that was provided on create.

type FileUpsertBulk

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

FileUpsertBulk is the builder for "upsert"-ing a bulk of File nodes.

func (*FileUpsertBulk) AddMode

func (u *FileUpsertBulk) AddMode(v uint32) *FileUpsertBulk

AddMode adds v to the "mode" field.

func (*FileUpsertBulk) AddMtimeNs

func (u *FileUpsertBulk) AddMtimeNs(v int64) *FileUpsertBulk

AddMtimeNs adds v to the "mtime_ns" field.

func (*FileUpsertBulk) AddSize

func (u *FileUpsertBulk) AddSize(v int64) *FileUpsertBulk

AddSize adds v to the "size" field.

func (*FileUpsertBulk) AddType

func (u *FileUpsertBulk) AddType(v uint32) *FileUpsertBulk

AddType adds v to the "type" field.

func (*FileUpsertBulk) ClearLinkTarget

func (u *FileUpsertBulk) ClearLinkTarget() *FileUpsertBulk

ClearLinkTarget clears the value of the "link_target" field.

func (*FileUpsertBulk) ClearRef

func (u *FileUpsertBulk) ClearRef() *FileUpsertBulk

ClearRef clears the value of the "ref" field.

func (*FileUpsertBulk) ClearValidUntil

func (u *FileUpsertBulk) ClearValidUntil() *FileUpsertBulk

ClearValidUntil clears the value of the "valid_until" field.

func (*FileUpsertBulk) DoNothing

func (u *FileUpsertBulk) DoNothing() *FileUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FileUpsertBulk) Exec

func (u *FileUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpsertBulk) ExecX

func (u *FileUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileUpsertBulk) Ignore

func (u *FileUpsertBulk) Ignore() *FileUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*FileUpsertBulk) SetDir

func (u *FileUpsertBulk) SetDir(v string) *FileUpsertBulk

SetDir sets the "dir" field.

func (*FileUpsertBulk) SetGroup

func (u *FileUpsertBulk) SetGroup(v string) *FileUpsertBulk

SetGroup sets the "group" field.

func (*FileUpsertBulk) SetLinkTarget

func (u *FileUpsertBulk) SetLinkTarget(v []byte) *FileUpsertBulk

SetLinkTarget sets the "link_target" field.

func (*FileUpsertBulk) SetLost

func (u *FileUpsertBulk) SetLost(v bool) *FileUpsertBulk

SetLost sets the "lost" field.

func (*FileUpsertBulk) SetMode

func (u *FileUpsertBulk) SetMode(v uint32) *FileUpsertBulk

SetMode sets the "mode" field.

func (*FileUpsertBulk) SetMtimeNs

func (u *FileUpsertBulk) SetMtimeNs(v int64) *FileUpsertBulk

SetMtimeNs sets the "mtime_ns" field.

func (*FileUpsertBulk) SetPath

func (u *FileUpsertBulk) SetPath(v string) *FileUpsertBulk

SetPath sets the "path" field.

func (*FileUpsertBulk) SetRef

func (u *FileUpsertBulk) SetRef(v []byte) *FileUpsertBulk

SetRef sets the "ref" field.

func (*FileUpsertBulk) SetSetID

func (u *FileUpsertBulk) SetSetID(v int64) *FileUpsertBulk

SetSetID sets the "set_id" field.

func (*FileUpsertBulk) SetSize

func (u *FileUpsertBulk) SetSize(v int64) *FileUpsertBulk

SetSize sets the "size" field.

func (*FileUpsertBulk) SetType

func (u *FileUpsertBulk) SetType(v uint32) *FileUpsertBulk

SetType sets the "type" field.

func (*FileUpsertBulk) SetUser

func (u *FileUpsertBulk) SetUser(v string) *FileUpsertBulk

SetUser sets the "user" field.

func (*FileUpsertBulk) SetValidFrom

func (u *FileUpsertBulk) SetValidFrom(v time.Time) *FileUpsertBulk

SetValidFrom sets the "valid_from" field.

func (*FileUpsertBulk) SetValidUntil

func (u *FileUpsertBulk) SetValidUntil(v time.Time) *FileUpsertBulk

SetValidUntil sets the "valid_until" field.

func (*FileUpsertBulk) Update

func (u *FileUpsertBulk) Update(set func(*FileUpsert)) *FileUpsertBulk

Update allows overriding fields `UPDATE` values. See the FileCreateBulk.OnConflict documentation for more info.

func (*FileUpsertBulk) UpdateDir

func (u *FileUpsertBulk) UpdateDir() *FileUpsertBulk

UpdateDir sets the "dir" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateGroup

func (u *FileUpsertBulk) UpdateGroup() *FileUpsertBulk

UpdateGroup sets the "group" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateLinkTarget

func (u *FileUpsertBulk) UpdateLinkTarget() *FileUpsertBulk

UpdateLinkTarget sets the "link_target" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateLost

func (u *FileUpsertBulk) UpdateLost() *FileUpsertBulk

UpdateLost sets the "lost" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateMode

func (u *FileUpsertBulk) UpdateMode() *FileUpsertBulk

UpdateMode sets the "mode" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateMtimeNs

func (u *FileUpsertBulk) UpdateMtimeNs() *FileUpsertBulk

UpdateMtimeNs sets the "mtime_ns" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateNewValues

func (u *FileUpsertBulk) UpdateNewValues() *FileUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.File.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*FileUpsertBulk) UpdatePath

func (u *FileUpsertBulk) UpdatePath() *FileUpsertBulk

UpdatePath sets the "path" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateRef

func (u *FileUpsertBulk) UpdateRef() *FileUpsertBulk

UpdateRef sets the "ref" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateSetID

func (u *FileUpsertBulk) UpdateSetID() *FileUpsertBulk

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateSize

func (u *FileUpsertBulk) UpdateSize() *FileUpsertBulk

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateType

func (u *FileUpsertBulk) UpdateType() *FileUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateUser

func (u *FileUpsertBulk) UpdateUser() *FileUpsertBulk

UpdateUser sets the "user" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateValidFrom

func (u *FileUpsertBulk) UpdateValidFrom() *FileUpsertBulk

UpdateValidFrom sets the "valid_from" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateValidUntil

func (u *FileUpsertBulk) UpdateValidUntil() *FileUpsertBulk

UpdateValidUntil sets the "valid_until" field to the value that was provided on create.

type FileUpsertOne

type FileUpsertOne struct {
	// contains filtered or unexported fields
}

FileUpsertOne is the builder for "upsert"-ing

one File node.

func (*FileUpsertOne) AddMode

func (u *FileUpsertOne) AddMode(v uint32) *FileUpsertOne

AddMode adds v to the "mode" field.

func (*FileUpsertOne) AddMtimeNs

func (u *FileUpsertOne) AddMtimeNs(v int64) *FileUpsertOne

AddMtimeNs adds v to the "mtime_ns" field.

func (*FileUpsertOne) AddSize

func (u *FileUpsertOne) AddSize(v int64) *FileUpsertOne

AddSize adds v to the "size" field.

func (*FileUpsertOne) AddType

func (u *FileUpsertOne) AddType(v uint32) *FileUpsertOne

AddType adds v to the "type" field.

func (*FileUpsertOne) ClearLinkTarget

func (u *FileUpsertOne) ClearLinkTarget() *FileUpsertOne

ClearLinkTarget clears the value of the "link_target" field.

func (*FileUpsertOne) ClearRef

func (u *FileUpsertOne) ClearRef() *FileUpsertOne

ClearRef clears the value of the "ref" field.

func (*FileUpsertOne) ClearValidUntil

func (u *FileUpsertOne) ClearValidUntil() *FileUpsertOne

ClearValidUntil clears the value of the "valid_until" field.

func (*FileUpsertOne) DoNothing

func (u *FileUpsertOne) DoNothing() *FileUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FileUpsertOne) Exec

func (u *FileUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpsertOne) ExecX

func (u *FileUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileUpsertOne) ID

func (u *FileUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*FileUpsertOne) IDX

func (u *FileUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*FileUpsertOne) Ignore

func (u *FileUpsertOne) Ignore() *FileUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.File.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*FileUpsertOne) SetDir

func (u *FileUpsertOne) SetDir(v string) *FileUpsertOne

SetDir sets the "dir" field.

func (*FileUpsertOne) SetGroup

func (u *FileUpsertOne) SetGroup(v string) *FileUpsertOne

SetGroup sets the "group" field.

func (*FileUpsertOne) SetLinkTarget

func (u *FileUpsertOne) SetLinkTarget(v []byte) *FileUpsertOne

SetLinkTarget sets the "link_target" field.

func (*FileUpsertOne) SetLost

func (u *FileUpsertOne) SetLost(v bool) *FileUpsertOne

SetLost sets the "lost" field.

func (*FileUpsertOne) SetMode

func (u *FileUpsertOne) SetMode(v uint32) *FileUpsertOne

SetMode sets the "mode" field.

func (*FileUpsertOne) SetMtimeNs

func (u *FileUpsertOne) SetMtimeNs(v int64) *FileUpsertOne

SetMtimeNs sets the "mtime_ns" field.

func (*FileUpsertOne) SetPath

func (u *FileUpsertOne) SetPath(v string) *FileUpsertOne

SetPath sets the "path" field.

func (*FileUpsertOne) SetRef

func (u *FileUpsertOne) SetRef(v []byte) *FileUpsertOne

SetRef sets the "ref" field.

func (*FileUpsertOne) SetSetID

func (u *FileUpsertOne) SetSetID(v int64) *FileUpsertOne

SetSetID sets the "set_id" field.

func (*FileUpsertOne) SetSize

func (u *FileUpsertOne) SetSize(v int64) *FileUpsertOne

SetSize sets the "size" field.

func (*FileUpsertOne) SetType

func (u *FileUpsertOne) SetType(v uint32) *FileUpsertOne

SetType sets the "type" field.

func (*FileUpsertOne) SetUser

func (u *FileUpsertOne) SetUser(v string) *FileUpsertOne

SetUser sets the "user" field.

func (*FileUpsertOne) SetValidFrom

func (u *FileUpsertOne) SetValidFrom(v time.Time) *FileUpsertOne

SetValidFrom sets the "valid_from" field.

func (*FileUpsertOne) SetValidUntil

func (u *FileUpsertOne) SetValidUntil(v time.Time) *FileUpsertOne

SetValidUntil sets the "valid_until" field.

func (*FileUpsertOne) Update

func (u *FileUpsertOne) Update(set func(*FileUpsert)) *FileUpsertOne

Update allows overriding fields `UPDATE` values. See the FileCreate.OnConflict documentation for more info.

func (*FileUpsertOne) UpdateDir

func (u *FileUpsertOne) UpdateDir() *FileUpsertOne

UpdateDir sets the "dir" field to the value that was provided on create.

func (*FileUpsertOne) UpdateGroup

func (u *FileUpsertOne) UpdateGroup() *FileUpsertOne

UpdateGroup sets the "group" field to the value that was provided on create.

func (*FileUpsertOne) UpdateLinkTarget

func (u *FileUpsertOne) UpdateLinkTarget() *FileUpsertOne

UpdateLinkTarget sets the "link_target" field to the value that was provided on create.

func (*FileUpsertOne) UpdateLost

func (u *FileUpsertOne) UpdateLost() *FileUpsertOne

UpdateLost sets the "lost" field to the value that was provided on create.

func (*FileUpsertOne) UpdateMode

func (u *FileUpsertOne) UpdateMode() *FileUpsertOne

UpdateMode sets the "mode" field to the value that was provided on create.

func (*FileUpsertOne) UpdateMtimeNs

func (u *FileUpsertOne) UpdateMtimeNs() *FileUpsertOne

UpdateMtimeNs sets the "mtime_ns" field to the value that was provided on create.

func (*FileUpsertOne) UpdateNewValues

func (u *FileUpsertOne) UpdateNewValues() *FileUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.File.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*FileUpsertOne) UpdatePath

func (u *FileUpsertOne) UpdatePath() *FileUpsertOne

UpdatePath sets the "path" field to the value that was provided on create.

func (*FileUpsertOne) UpdateRef

func (u *FileUpsertOne) UpdateRef() *FileUpsertOne

UpdateRef sets the "ref" field to the value that was provided on create.

func (*FileUpsertOne) UpdateSetID

func (u *FileUpsertOne) UpdateSetID() *FileUpsertOne

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*FileUpsertOne) UpdateSize

func (u *FileUpsertOne) UpdateSize() *FileUpsertOne

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsertOne) UpdateType

func (u *FileUpsertOne) UpdateType() *FileUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*FileUpsertOne) UpdateUser

func (u *FileUpsertOne) UpdateUser() *FileUpsertOne

UpdateUser sets the "user" field to the value that was provided on create.

func (*FileUpsertOne) UpdateValidFrom

func (u *FileUpsertOne) UpdateValidFrom() *FileUpsertOne

UpdateValidFrom sets the "valid_from" field to the value that was provided on create.

func (*FileUpsertOne) UpdateValidUntil

func (u *FileUpsertOne) UpdateValidUntil() *FileUpsertOne

UpdateValidUntil sets the "valid_until" field to the value that was provided on create.

type Files

type Files []*File

Files is a parsable slice of File.

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 Object

type Object struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// ArchiveID holds the value of the "archive_id" field.
	ArchiveID string `json:"archive_id,omitempty"`
	// Start holds the value of the "start" field.
	Start uint32 `json:"start,omitempty"`
	// Length holds the value of the "length" field.
	Length uint32 `json:"length,omitempty"`
	// Type holds the value of the "type" field.
	Type uint32 `json:"type,omitempty"`
	// CarriedTime holds the value of the "carried_time" field.
	CarriedTime int64 `json:"carried_time,omitempty"`
	// CarriedOffset holds the value of the "carried_offset" field.
	CarriedOffset uint32 `json:"carried_offset,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ObjectQuery when eager-loading is set.
	Edges ObjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

Object is the model entity for the Object schema.

func (*Object) ExecContext

func (c *Object) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Object) QueryArchive

func (_m *Object) QueryArchive() *ArchiveQuery

QueryArchive queries the "archive" edge of the Object entity.

func (*Object) QueryContext

func (c *Object) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Object) String

func (_m *Object) String() string

String implements the fmt.Stringer.

func (*Object) Unwrap

func (_m *Object) Unwrap() *Object

Unwrap unwraps the Object 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 (*Object) Update

func (_m *Object) Update() *ObjectUpdateOne

Update returns a builder for updating this Object. Note that you need to call Object.Unwrap() before calling this method if this Object was returned from a transaction, and the transaction was committed or rolled back.

func (*Object) Value

func (_m *Object) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Object. This includes values selected through modifiers, order, etc.

type ObjectClient

type ObjectClient struct {
	// contains filtered or unexported fields
}

ObjectClient is a client for the Object schema.

func NewObjectClient

func NewObjectClient(c config) *ObjectClient

NewObjectClient returns a client for the Object from the given config.

func (*ObjectClient) Create

func (c *ObjectClient) Create() *ObjectCreate

Create returns a builder for creating a Object entity.

func (*ObjectClient) CreateBulk

func (c *ObjectClient) CreateBulk(builders ...*ObjectCreate) *ObjectCreateBulk

CreateBulk returns a builder for creating a bulk of Object entities.

func (*ObjectClient) Delete

func (c *ObjectClient) Delete() *ObjectDelete

Delete returns a delete builder for Object.

func (*ObjectClient) DeleteOne

func (c *ObjectClient) DeleteOne(_m *Object) *ObjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ObjectClient) DeleteOneID

func (c *ObjectClient) DeleteOneID(id int) *ObjectDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ObjectClient) ExecContext

func (c *ObjectClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectClient) Get

func (c *ObjectClient) Get(ctx context.Context, id int) (*Object, error)

Get returns a Object entity by its id.

func (*ObjectClient) GetX

func (c *ObjectClient) GetX(ctx context.Context, id int) *Object

GetX is like Get, but panics if an error occurs.

func (*ObjectClient) Hooks

func (c *ObjectClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ObjectClient) Intercept

func (c *ObjectClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `object.Intercept(f(g(h())))`.

func (*ObjectClient) Interceptors

func (c *ObjectClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ObjectClient) MapCreateBulk

func (c *ObjectClient) MapCreateBulk(slice any, setFunc func(*ObjectCreate, int)) *ObjectCreateBulk

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 (*ObjectClient) Query

func (c *ObjectClient) Query() *ObjectQuery

Query returns a query builder for Object.

func (*ObjectClient) QueryArchive

func (c *ObjectClient) QueryArchive(_m *Object) *ArchiveQuery

QueryArchive queries the archive edge of a Object.

func (*ObjectClient) QueryContext

func (c *ObjectClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectClient) Update

func (c *ObjectClient) Update() *ObjectUpdate

Update returns an update builder for Object.

func (*ObjectClient) UpdateOne

func (c *ObjectClient) UpdateOne(_m *Object) *ObjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ObjectClient) UpdateOneID

func (c *ObjectClient) UpdateOneID(id int) *ObjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ObjectClient) Use

func (c *ObjectClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `object.Hooks(f(g(h())))`.

type ObjectCreate

type ObjectCreate struct {
	// contains filtered or unexported fields
}

ObjectCreate is the builder for creating a Object entity.

func (*ObjectCreate) Exec

func (_c *ObjectCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ObjectCreate) ExecContext

func (c *ObjectCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectCreate) ExecX

func (_c *ObjectCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectCreate) Mutation

func (_c *ObjectCreate) Mutation() *ObjectMutation

Mutation returns the ObjectMutation object of the builder.

func (*ObjectCreate) OnConflict

func (_c *ObjectCreate) OnConflict(opts ...sql.ConflictOption) *ObjectUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Object.Create().
	SetRef(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ObjectUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*ObjectCreate) OnConflictColumns

func (_c *ObjectCreate) OnConflictColumns(columns ...string) *ObjectUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Object.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ObjectCreate) QueryContext

func (c *ObjectCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectCreate) Save

func (_c *ObjectCreate) Save(ctx context.Context) (*Object, error)

Save creates the Object in the database.

func (*ObjectCreate) SaveX

func (_c *ObjectCreate) SaveX(ctx context.Context) *Object

SaveX calls Save and panics if Save returns an error.

func (*ObjectCreate) SetArchive

func (_c *ObjectCreate) SetArchive(v *Archive) *ObjectCreate

SetArchive sets the "archive" edge to the Archive entity.

func (*ObjectCreate) SetArchiveID

func (_c *ObjectCreate) SetArchiveID(v string) *ObjectCreate

SetArchiveID sets the "archive_id" field.

func (*ObjectCreate) SetCarriedOffset

func (_c *ObjectCreate) SetCarriedOffset(v uint32) *ObjectCreate

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectCreate) SetCarriedTime

func (_c *ObjectCreate) SetCarriedTime(v int64) *ObjectCreate

SetCarriedTime sets the "carried_time" field.

func (*ObjectCreate) SetLength

func (_c *ObjectCreate) SetLength(v uint32) *ObjectCreate

SetLength sets the "length" field.

func (*ObjectCreate) SetNillableCarriedOffset

func (_c *ObjectCreate) SetNillableCarriedOffset(v *uint32) *ObjectCreate

SetNillableCarriedOffset sets the "carried_offset" field if the given value is not nil.

func (*ObjectCreate) SetNillableCarriedTime

func (_c *ObjectCreate) SetNillableCarriedTime(v *int64) *ObjectCreate

SetNillableCarriedTime sets the "carried_time" field if the given value is not nil.

func (*ObjectCreate) SetRef

func (_c *ObjectCreate) SetRef(v []byte) *ObjectCreate

SetRef sets the "ref" field.

func (*ObjectCreate) SetStart

func (_c *ObjectCreate) SetStart(v uint32) *ObjectCreate

SetStart sets the "start" field.

func (*ObjectCreate) SetType

func (_c *ObjectCreate) SetType(v uint32) *ObjectCreate

SetType sets the "type" field.

type ObjectCreateBulk

type ObjectCreateBulk struct {
	// contains filtered or unexported fields
}

ObjectCreateBulk is the builder for creating many Object entities in bulk.

func (*ObjectCreateBulk) Exec

func (_c *ObjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ObjectCreateBulk) ExecContext

func (c *ObjectCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectCreateBulk) ExecX

func (_c *ObjectCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectCreateBulk) OnConflict

func (_c *ObjectCreateBulk) OnConflict(opts ...sql.ConflictOption) *ObjectUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Object.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ObjectUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*ObjectCreateBulk) OnConflictColumns

func (_c *ObjectCreateBulk) OnConflictColumns(columns ...string) *ObjectUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Object.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ObjectCreateBulk) QueryContext

func (c *ObjectCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectCreateBulk) Save

func (_c *ObjectCreateBulk) Save(ctx context.Context) ([]*Object, error)

Save creates the Object entities in the database.

func (*ObjectCreateBulk) SaveX

func (_c *ObjectCreateBulk) SaveX(ctx context.Context) []*Object

SaveX is like Save, but panics if an error occurs.

type ObjectDelete

type ObjectDelete struct {
	// contains filtered or unexported fields
}

ObjectDelete is the builder for deleting a Object entity.

func (*ObjectDelete) Exec

func (_d *ObjectDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ObjectDelete) ExecContext

func (c *ObjectDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectDelete) ExecX

func (_d *ObjectDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ObjectDelete) QueryContext

func (c *ObjectDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectDelete) Where

func (_d *ObjectDelete) Where(ps ...predicate.Object) *ObjectDelete

Where appends a list predicates to the ObjectDelete builder.

type ObjectDeleteOne

type ObjectDeleteOne struct {
	// contains filtered or unexported fields
}

ObjectDeleteOne is the builder for deleting a single Object entity.

func (*ObjectDeleteOne) Exec

func (_d *ObjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ObjectDeleteOne) ExecX

func (_d *ObjectDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectDeleteOne) Where

func (_d *ObjectDeleteOne) Where(ps ...predicate.Object) *ObjectDeleteOne

Where appends a list predicates to the ObjectDelete builder.

type ObjectEdges

type ObjectEdges struct {
	// Archive holds the value of the archive edge.
	Archive *Archive `json:"archive,omitempty"`
	// contains filtered or unexported fields
}

ObjectEdges holds the relations/edges for other nodes in the graph.

func (ObjectEdges) ArchiveOrErr

func (e ObjectEdges) ArchiveOrErr() (*Archive, error)

ArchiveOrErr returns the Archive value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ObjectGroupBy

type ObjectGroupBy struct {
	// contains filtered or unexported fields
}

ObjectGroupBy is the group-by builder for Object entities.

func (*ObjectGroupBy) Aggregate

func (_g *ObjectGroupBy) Aggregate(fns ...AggregateFunc) *ObjectGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ObjectGroupBy) Bool

func (s *ObjectGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) BoolX

func (s *ObjectGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ObjectGroupBy) Bools

func (s *ObjectGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) BoolsX

func (s *ObjectGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ObjectGroupBy) Float64

func (s *ObjectGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) Float64X

func (s *ObjectGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ObjectGroupBy) Float64s

func (s *ObjectGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) Float64sX

func (s *ObjectGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ObjectGroupBy) Int

func (s *ObjectGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) IntX

func (s *ObjectGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ObjectGroupBy) Ints

func (s *ObjectGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) IntsX

func (s *ObjectGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ObjectGroupBy) Scan

func (_g *ObjectGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ObjectGroupBy) ScanX

func (s *ObjectGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ObjectGroupBy) String

func (s *ObjectGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) StringX

func (s *ObjectGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ObjectGroupBy) Strings

func (s *ObjectGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ObjectGroupBy) StringsX

func (s *ObjectGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ObjectMutation

type ObjectMutation struct {
	// contains filtered or unexported fields
}

ObjectMutation represents an operation that mutates the Object nodes in the graph.

func (*ObjectMutation) AddCarriedOffset

func (m *ObjectMutation) AddCarriedOffset(u int32)

AddCarriedOffset adds u to the "carried_offset" field.

func (*ObjectMutation) AddCarriedTime

func (m *ObjectMutation) AddCarriedTime(i int64)

AddCarriedTime adds i to the "carried_time" field.

func (*ObjectMutation) AddField

func (m *ObjectMutation) 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 (*ObjectMutation) AddLength

func (m *ObjectMutation) AddLength(u int32)

AddLength adds u to the "length" field.

func (*ObjectMutation) AddStart

func (m *ObjectMutation) AddStart(u int32)

AddStart adds u to the "start" field.

func (*ObjectMutation) AddType

func (m *ObjectMutation) AddType(u int32)

AddType adds u to the "type" field.

func (*ObjectMutation) AddedCarriedOffset

func (m *ObjectMutation) AddedCarriedOffset() (r int32, exists bool)

AddedCarriedOffset returns the value that was added to the "carried_offset" field in this mutation.

func (*ObjectMutation) AddedCarriedTime

func (m *ObjectMutation) AddedCarriedTime() (r int64, exists bool)

AddedCarriedTime returns the value that was added to the "carried_time" field in this mutation.

func (*ObjectMutation) AddedEdges

func (m *ObjectMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ObjectMutation) AddedField

func (m *ObjectMutation) 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 (*ObjectMutation) AddedFields

func (m *ObjectMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ObjectMutation) AddedIDs

func (m *ObjectMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ObjectMutation) AddedLength

func (m *ObjectMutation) AddedLength() (r int32, exists bool)

AddedLength returns the value that was added to the "length" field in this mutation.

func (*ObjectMutation) AddedStart

func (m *ObjectMutation) AddedStart() (r int32, exists bool)

AddedStart returns the value that was added to the "start" field in this mutation.

func (*ObjectMutation) AddedType

func (m *ObjectMutation) AddedType() (r int32, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*ObjectMutation) ArchiveCleared

func (m *ObjectMutation) ArchiveCleared() bool

ArchiveCleared reports if the "archive" edge to the Archive entity was cleared.

func (*ObjectMutation) ArchiveID

func (m *ObjectMutation) ArchiveID() (r string, exists bool)

ArchiveID returns the value of the "archive_id" field in the mutation.

func (*ObjectMutation) ArchiveIDs

func (m *ObjectMutation) ArchiveIDs() (ids []string)

ArchiveIDs returns the "archive" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ArchiveID instead. It exists only for internal usage by the builders.

func (*ObjectMutation) CarriedOffset

func (m *ObjectMutation) CarriedOffset() (r uint32, exists bool)

CarriedOffset returns the value of the "carried_offset" field in the mutation.

func (*ObjectMutation) CarriedOffsetCleared

func (m *ObjectMutation) CarriedOffsetCleared() bool

CarriedOffsetCleared returns if the "carried_offset" field was cleared in this mutation.

func (*ObjectMutation) CarriedTime

func (m *ObjectMutation) CarriedTime() (r int64, exists bool)

CarriedTime returns the value of the "carried_time" field in the mutation.

func (*ObjectMutation) CarriedTimeCleared

func (m *ObjectMutation) CarriedTimeCleared() bool

CarriedTimeCleared returns if the "carried_time" field was cleared in this mutation.

func (*ObjectMutation) ClearArchive

func (m *ObjectMutation) ClearArchive()

ClearArchive clears the "archive" edge to the Archive entity.

func (*ObjectMutation) ClearCarriedOffset

func (m *ObjectMutation) ClearCarriedOffset()

ClearCarriedOffset clears the value of the "carried_offset" field.

func (*ObjectMutation) ClearCarriedTime

func (m *ObjectMutation) ClearCarriedTime()

ClearCarriedTime clears the value of the "carried_time" field.

func (*ObjectMutation) ClearEdge

func (m *ObjectMutation) 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 (*ObjectMutation) ClearField

func (m *ObjectMutation) 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 (*ObjectMutation) ClearedEdges

func (m *ObjectMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ObjectMutation) ClearedFields

func (m *ObjectMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ObjectMutation) Client

func (m ObjectMutation) 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 (*ObjectMutation) EdgeCleared

func (m *ObjectMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ObjectMutation) ExecContext

func (c *ObjectMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectMutation) Field

func (m *ObjectMutation) 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 (*ObjectMutation) FieldCleared

func (m *ObjectMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ObjectMutation) Fields

func (m *ObjectMutation) 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 (*ObjectMutation) GetType

func (m *ObjectMutation) GetType() (r uint32, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ObjectMutation) ID

func (m *ObjectMutation) 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 (*ObjectMutation) IDs

func (m *ObjectMutation) 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 (*ObjectMutation) Length

func (m *ObjectMutation) Length() (r uint32, exists bool)

Length returns the value of the "length" field in the mutation.

func (*ObjectMutation) OldArchiveID

func (m *ObjectMutation) OldArchiveID(ctx context.Context) (v string, err error)

OldArchiveID returns the old "archive_id" field's value of the Object entity. If the Object 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 (*ObjectMutation) OldCarriedOffset

func (m *ObjectMutation) OldCarriedOffset(ctx context.Context) (v uint32, err error)

OldCarriedOffset returns the old "carried_offset" field's value of the Object entity. If the Object 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 (*ObjectMutation) OldCarriedTime

func (m *ObjectMutation) OldCarriedTime(ctx context.Context) (v int64, err error)

OldCarriedTime returns the old "carried_time" field's value of the Object entity. If the Object 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 (*ObjectMutation) OldField

func (m *ObjectMutation) 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 (*ObjectMutation) OldLength

func (m *ObjectMutation) OldLength(ctx context.Context) (v uint32, err error)

OldLength returns the old "length" field's value of the Object entity. If the Object 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 (*ObjectMutation) OldRef

func (m *ObjectMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the Object entity. If the Object 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 (*ObjectMutation) OldStart

func (m *ObjectMutation) OldStart(ctx context.Context) (v uint32, err error)

OldStart returns the old "start" field's value of the Object entity. If the Object 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 (*ObjectMutation) OldType

func (m *ObjectMutation) OldType(ctx context.Context) (v uint32, err error)

OldType returns the old "type" field's value of the Object entity. If the Object 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 (*ObjectMutation) Op

func (m *ObjectMutation) Op() Op

Op returns the operation name.

func (*ObjectMutation) QueryContext

func (c *ObjectMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectMutation) Ref

func (m *ObjectMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*ObjectMutation) RemovedEdges

func (m *ObjectMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ObjectMutation) RemovedIDs

func (m *ObjectMutation) 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 (*ObjectMutation) ResetArchive

func (m *ObjectMutation) ResetArchive()

ResetArchive resets all changes to the "archive" edge.

func (*ObjectMutation) ResetArchiveID

func (m *ObjectMutation) ResetArchiveID()

ResetArchiveID resets all changes to the "archive_id" field.

func (*ObjectMutation) ResetCarriedOffset

func (m *ObjectMutation) ResetCarriedOffset()

ResetCarriedOffset resets all changes to the "carried_offset" field.

func (*ObjectMutation) ResetCarriedTime

func (m *ObjectMutation) ResetCarriedTime()

ResetCarriedTime resets all changes to the "carried_time" field.

func (*ObjectMutation) ResetEdge

func (m *ObjectMutation) 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 (*ObjectMutation) ResetField

func (m *ObjectMutation) 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 (*ObjectMutation) ResetLength

func (m *ObjectMutation) ResetLength()

ResetLength resets all changes to the "length" field.

func (*ObjectMutation) ResetRef

func (m *ObjectMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*ObjectMutation) ResetStart

func (m *ObjectMutation) ResetStart()

ResetStart resets all changes to the "start" field.

func (*ObjectMutation) ResetType

func (m *ObjectMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ObjectMutation) SetArchiveID

func (m *ObjectMutation) SetArchiveID(s string)

SetArchiveID sets the "archive_id" field.

func (*ObjectMutation) SetCarriedOffset

func (m *ObjectMutation) SetCarriedOffset(u uint32)

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectMutation) SetCarriedTime

func (m *ObjectMutation) SetCarriedTime(i int64)

SetCarriedTime sets the "carried_time" field.

func (*ObjectMutation) SetField

func (m *ObjectMutation) 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 (*ObjectMutation) SetLength

func (m *ObjectMutation) SetLength(u uint32)

SetLength sets the "length" field.

func (*ObjectMutation) SetOp

func (m *ObjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ObjectMutation) SetRef

func (m *ObjectMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*ObjectMutation) SetStart

func (m *ObjectMutation) SetStart(u uint32)

SetStart sets the "start" field.

func (*ObjectMutation) SetType

func (m *ObjectMutation) SetType(u uint32)

SetType sets the "type" field.

func (*ObjectMutation) Start

func (m *ObjectMutation) Start() (r uint32, exists bool)

Start returns the value of the "start" field in the mutation.

func (ObjectMutation) Tx

func (m ObjectMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ObjectMutation) Type

func (m *ObjectMutation) Type() string

Type returns the node type of this mutation (Object).

func (*ObjectMutation) Where

func (m *ObjectMutation) Where(ps ...predicate.Object)

Where appends a list predicates to the ObjectMutation builder.

func (*ObjectMutation) WhereP

func (m *ObjectMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ObjectMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ObjectQuery

type ObjectQuery struct {
	// contains filtered or unexported fields
}

ObjectQuery is the builder for querying Object entities.

func (*ObjectQuery) Aggregate

func (_q *ObjectQuery) Aggregate(fns ...AggregateFunc) *ObjectSelect

Aggregate returns a ObjectSelect configured with the given aggregations.

func (*ObjectQuery) All

func (_q *ObjectQuery) All(ctx context.Context) ([]*Object, error)

All executes the query and returns a list of Objects.

func (*ObjectQuery) AllX

func (_q *ObjectQuery) AllX(ctx context.Context) []*Object

AllX is like All, but panics if an error occurs.

func (*ObjectQuery) Clone

func (_q *ObjectQuery) Clone() *ObjectQuery

Clone returns a duplicate of the ObjectQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ObjectQuery) Count

func (_q *ObjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ObjectQuery) CountX

func (_q *ObjectQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ObjectQuery) ExecContext

func (c *ObjectQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectQuery) Exist

func (_q *ObjectQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ObjectQuery) ExistX

func (_q *ObjectQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ObjectQuery) First

func (_q *ObjectQuery) First(ctx context.Context) (*Object, error)

First returns the first Object entity from the query. Returns a *NotFoundError when no Object was found.

func (*ObjectQuery) FirstID

func (_q *ObjectQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Object ID from the query. Returns a *NotFoundError when no Object ID was found.

func (*ObjectQuery) FirstIDX

func (_q *ObjectQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ObjectQuery) FirstX

func (_q *ObjectQuery) FirstX(ctx context.Context) *Object

FirstX is like First, but panics if an error occurs.

func (*ObjectQuery) ForShare

func (_q *ObjectQuery) ForShare(opts ...sql.LockOption) *ObjectQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ObjectQuery) ForUpdate

func (_q *ObjectQuery) ForUpdate(opts ...sql.LockOption) *ObjectQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ObjectQuery) GroupBy

func (_q *ObjectQuery) GroupBy(field string, fields ...string) *ObjectGroupBy

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 {
	Ref []byte `json:"ref,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Object.Query().
	GroupBy(object.FieldRef).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ObjectQuery) IDs

func (_q *ObjectQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Object IDs.

func (*ObjectQuery) IDsX

func (_q *ObjectQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ObjectQuery) Limit

func (_q *ObjectQuery) Limit(limit int) *ObjectQuery

Limit the number of records to be returned by this query.

func (*ObjectQuery) Offset

func (_q *ObjectQuery) Offset(offset int) *ObjectQuery

Offset to start from.

func (*ObjectQuery) Only

func (_q *ObjectQuery) Only(ctx context.Context) (*Object, error)

Only returns a single Object entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Object entity is found. Returns a *NotFoundError when no Object entities are found.

func (*ObjectQuery) OnlyID

func (_q *ObjectQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Object ID in the query. Returns a *NotSingularError when more than one Object ID is found. Returns a *NotFoundError when no entities are found.

func (*ObjectQuery) OnlyIDX

func (_q *ObjectQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ObjectQuery) OnlyX

func (_q *ObjectQuery) OnlyX(ctx context.Context) *Object

OnlyX is like Only, but panics if an error occurs.

func (*ObjectQuery) Order

func (_q *ObjectQuery) Order(o ...object.OrderOption) *ObjectQuery

Order specifies how the records should be ordered.

func (*ObjectQuery) QueryArchive

func (_q *ObjectQuery) QueryArchive() *ArchiveQuery

QueryArchive chains the current query on the "archive" edge.

func (*ObjectQuery) QueryContext

func (c *ObjectQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectQuery) Select

func (_q *ObjectQuery) Select(fields ...string) *ObjectSelect

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 {
	Ref []byte `json:"ref,omitempty"`
}

client.Object.Query().
	Select(object.FieldRef).
	Scan(ctx, &v)

func (*ObjectQuery) Unique

func (_q *ObjectQuery) Unique(unique bool) *ObjectQuery

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 (*ObjectQuery) Where

func (_q *ObjectQuery) Where(ps ...predicate.Object) *ObjectQuery

Where adds a new predicate for the ObjectQuery builder.

func (*ObjectQuery) WithArchive

func (_q *ObjectQuery) WithArchive(opts ...func(*ArchiveQuery)) *ObjectQuery

WithArchive tells the query-builder to eager-load the nodes that are connected to the "archive" edge. The optional arguments are used to configure the query builder of the edge.

type ObjectSelect

type ObjectSelect struct {
	*ObjectQuery
	// contains filtered or unexported fields
}

ObjectSelect is the builder for selecting fields of Object entities.

func (*ObjectSelect) Aggregate

func (_s *ObjectSelect) Aggregate(fns ...AggregateFunc) *ObjectSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ObjectSelect) Bool

func (s *ObjectSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) BoolX

func (s *ObjectSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ObjectSelect) Bools

func (s *ObjectSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) BoolsX

func (s *ObjectSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (ObjectSelect) ExecContext

func (c ObjectSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectSelect) Float64

func (s *ObjectSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) Float64X

func (s *ObjectSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ObjectSelect) Float64s

func (s *ObjectSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) Float64sX

func (s *ObjectSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ObjectSelect) Int

func (s *ObjectSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) IntX

func (s *ObjectSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ObjectSelect) Ints

func (s *ObjectSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) IntsX

func (s *ObjectSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (ObjectSelect) QueryContext

func (c ObjectSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectSelect) Scan

func (_s *ObjectSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ObjectSelect) ScanX

func (s *ObjectSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ObjectSelect) String

func (s *ObjectSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) StringX

func (s *ObjectSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ObjectSelect) Strings

func (s *ObjectSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ObjectSelect) StringsX

func (s *ObjectSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ObjectUpdate

type ObjectUpdate struct {
	// contains filtered or unexported fields
}

ObjectUpdate is the builder for updating Object entities.

func (*ObjectUpdate) AddCarriedOffset

func (_u *ObjectUpdate) AddCarriedOffset(v int32) *ObjectUpdate

AddCarriedOffset adds value to the "carried_offset" field.

func (*ObjectUpdate) AddCarriedTime

func (_u *ObjectUpdate) AddCarriedTime(v int64) *ObjectUpdate

AddCarriedTime adds value to the "carried_time" field.

func (*ObjectUpdate) AddLength

func (_u *ObjectUpdate) AddLength(v int32) *ObjectUpdate

AddLength adds value to the "length" field.

func (*ObjectUpdate) AddStart

func (_u *ObjectUpdate) AddStart(v int32) *ObjectUpdate

AddStart adds value to the "start" field.

func (*ObjectUpdate) AddType

func (_u *ObjectUpdate) AddType(v int32) *ObjectUpdate

AddType adds value to the "type" field.

func (*ObjectUpdate) ClearArchive

func (_u *ObjectUpdate) ClearArchive() *ObjectUpdate

ClearArchive clears the "archive" edge to the Archive entity.

func (*ObjectUpdate) ClearCarriedOffset

func (_u *ObjectUpdate) ClearCarriedOffset() *ObjectUpdate

ClearCarriedOffset clears the value of the "carried_offset" field.

func (*ObjectUpdate) ClearCarriedTime

func (_u *ObjectUpdate) ClearCarriedTime() *ObjectUpdate

ClearCarriedTime clears the value of the "carried_time" field.

func (*ObjectUpdate) Exec

func (_u *ObjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ObjectUpdate) ExecContext

func (c *ObjectUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectUpdate) ExecX

func (_u *ObjectUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectUpdate) Mutation

func (_u *ObjectUpdate) Mutation() *ObjectMutation

Mutation returns the ObjectMutation object of the builder.

func (*ObjectUpdate) QueryContext

func (c *ObjectUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectUpdate) Save

func (_u *ObjectUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ObjectUpdate) SaveX

func (_u *ObjectUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ObjectUpdate) SetArchive

func (_u *ObjectUpdate) SetArchive(v *Archive) *ObjectUpdate

SetArchive sets the "archive" edge to the Archive entity.

func (*ObjectUpdate) SetArchiveID

func (_u *ObjectUpdate) SetArchiveID(v string) *ObjectUpdate

SetArchiveID sets the "archive_id" field.

func (*ObjectUpdate) SetCarriedOffset

func (_u *ObjectUpdate) SetCarriedOffset(v uint32) *ObjectUpdate

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectUpdate) SetCarriedTime

func (_u *ObjectUpdate) SetCarriedTime(v int64) *ObjectUpdate

SetCarriedTime sets the "carried_time" field.

func (*ObjectUpdate) SetLength

func (_u *ObjectUpdate) SetLength(v uint32) *ObjectUpdate

SetLength sets the "length" field.

func (*ObjectUpdate) SetNillableArchiveID

func (_u *ObjectUpdate) SetNillableArchiveID(v *string) *ObjectUpdate

SetNillableArchiveID sets the "archive_id" field if the given value is not nil.

func (*ObjectUpdate) SetNillableCarriedOffset

func (_u *ObjectUpdate) SetNillableCarriedOffset(v *uint32) *ObjectUpdate

SetNillableCarriedOffset sets the "carried_offset" field if the given value is not nil.

func (*ObjectUpdate) SetNillableCarriedTime

func (_u *ObjectUpdate) SetNillableCarriedTime(v *int64) *ObjectUpdate

SetNillableCarriedTime sets the "carried_time" field if the given value is not nil.

func (*ObjectUpdate) SetNillableLength

func (_u *ObjectUpdate) SetNillableLength(v *uint32) *ObjectUpdate

SetNillableLength sets the "length" field if the given value is not nil.

func (*ObjectUpdate) SetNillableStart

func (_u *ObjectUpdate) SetNillableStart(v *uint32) *ObjectUpdate

SetNillableStart sets the "start" field if the given value is not nil.

func (*ObjectUpdate) SetNillableType

func (_u *ObjectUpdate) SetNillableType(v *uint32) *ObjectUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ObjectUpdate) SetRef

func (_u *ObjectUpdate) SetRef(v []byte) *ObjectUpdate

SetRef sets the "ref" field.

func (*ObjectUpdate) SetStart

func (_u *ObjectUpdate) SetStart(v uint32) *ObjectUpdate

SetStart sets the "start" field.

func (*ObjectUpdate) SetType

func (_u *ObjectUpdate) SetType(v uint32) *ObjectUpdate

SetType sets the "type" field.

func (*ObjectUpdate) Where

func (_u *ObjectUpdate) Where(ps ...predicate.Object) *ObjectUpdate

Where appends a list predicates to the ObjectUpdate builder.

type ObjectUpdateOne

type ObjectUpdateOne struct {
	// contains filtered or unexported fields
}

ObjectUpdateOne is the builder for updating a single Object entity.

func (*ObjectUpdateOne) AddCarriedOffset

func (_u *ObjectUpdateOne) AddCarriedOffset(v int32) *ObjectUpdateOne

AddCarriedOffset adds value to the "carried_offset" field.

func (*ObjectUpdateOne) AddCarriedTime

func (_u *ObjectUpdateOne) AddCarriedTime(v int64) *ObjectUpdateOne

AddCarriedTime adds value to the "carried_time" field.

func (*ObjectUpdateOne) AddLength

func (_u *ObjectUpdateOne) AddLength(v int32) *ObjectUpdateOne

AddLength adds value to the "length" field.

func (*ObjectUpdateOne) AddStart

func (_u *ObjectUpdateOne) AddStart(v int32) *ObjectUpdateOne

AddStart adds value to the "start" field.

func (*ObjectUpdateOne) AddType

func (_u *ObjectUpdateOne) AddType(v int32) *ObjectUpdateOne

AddType adds value to the "type" field.

func (*ObjectUpdateOne) ClearArchive

func (_u *ObjectUpdateOne) ClearArchive() *ObjectUpdateOne

ClearArchive clears the "archive" edge to the Archive entity.

func (*ObjectUpdateOne) ClearCarriedOffset

func (_u *ObjectUpdateOne) ClearCarriedOffset() *ObjectUpdateOne

ClearCarriedOffset clears the value of the "carried_offset" field.

func (*ObjectUpdateOne) ClearCarriedTime

func (_u *ObjectUpdateOne) ClearCarriedTime() *ObjectUpdateOne

ClearCarriedTime clears the value of the "carried_time" field.

func (*ObjectUpdateOne) Exec

func (_u *ObjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ObjectUpdateOne) ExecContext

func (c *ObjectUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ObjectUpdateOne) ExecX

func (_u *ObjectUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectUpdateOne) Mutation

func (_u *ObjectUpdateOne) Mutation() *ObjectMutation

Mutation returns the ObjectMutation object of the builder.

func (*ObjectUpdateOne) QueryContext

func (c *ObjectUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ObjectUpdateOne) Save

func (_u *ObjectUpdateOne) Save(ctx context.Context) (*Object, error)

Save executes the query and returns the updated Object entity.

func (*ObjectUpdateOne) SaveX

func (_u *ObjectUpdateOne) SaveX(ctx context.Context) *Object

SaveX is like Save, but panics if an error occurs.

func (*ObjectUpdateOne) Select

func (_u *ObjectUpdateOne) Select(field string, fields ...string) *ObjectUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ObjectUpdateOne) SetArchive

func (_u *ObjectUpdateOne) SetArchive(v *Archive) *ObjectUpdateOne

SetArchive sets the "archive" edge to the Archive entity.

func (*ObjectUpdateOne) SetArchiveID

func (_u *ObjectUpdateOne) SetArchiveID(v string) *ObjectUpdateOne

SetArchiveID sets the "archive_id" field.

func (*ObjectUpdateOne) SetCarriedOffset

func (_u *ObjectUpdateOne) SetCarriedOffset(v uint32) *ObjectUpdateOne

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectUpdateOne) SetCarriedTime

func (_u *ObjectUpdateOne) SetCarriedTime(v int64) *ObjectUpdateOne

SetCarriedTime sets the "carried_time" field.

func (*ObjectUpdateOne) SetLength

func (_u *ObjectUpdateOne) SetLength(v uint32) *ObjectUpdateOne

SetLength sets the "length" field.

func (*ObjectUpdateOne) SetNillableArchiveID

func (_u *ObjectUpdateOne) SetNillableArchiveID(v *string) *ObjectUpdateOne

SetNillableArchiveID sets the "archive_id" field if the given value is not nil.

func (*ObjectUpdateOne) SetNillableCarriedOffset

func (_u *ObjectUpdateOne) SetNillableCarriedOffset(v *uint32) *ObjectUpdateOne

SetNillableCarriedOffset sets the "carried_offset" field if the given value is not nil.

func (*ObjectUpdateOne) SetNillableCarriedTime

func (_u *ObjectUpdateOne) SetNillableCarriedTime(v *int64) *ObjectUpdateOne

SetNillableCarriedTime sets the "carried_time" field if the given value is not nil.

func (*ObjectUpdateOne) SetNillableLength

func (_u *ObjectUpdateOne) SetNillableLength(v *uint32) *ObjectUpdateOne

SetNillableLength sets the "length" field if the given value is not nil.

func (*ObjectUpdateOne) SetNillableStart

func (_u *ObjectUpdateOne) SetNillableStart(v *uint32) *ObjectUpdateOne

SetNillableStart sets the "start" field if the given value is not nil.

func (*ObjectUpdateOne) SetNillableType

func (_u *ObjectUpdateOne) SetNillableType(v *uint32) *ObjectUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ObjectUpdateOne) SetRef

func (_u *ObjectUpdateOne) SetRef(v []byte) *ObjectUpdateOne

SetRef sets the "ref" field.

func (*ObjectUpdateOne) SetStart

func (_u *ObjectUpdateOne) SetStart(v uint32) *ObjectUpdateOne

SetStart sets the "start" field.

func (*ObjectUpdateOne) SetType

func (_u *ObjectUpdateOne) SetType(v uint32) *ObjectUpdateOne

SetType sets the "type" field.

func (*ObjectUpdateOne) Where

func (_u *ObjectUpdateOne) Where(ps ...predicate.Object) *ObjectUpdateOne

Where appends a list predicates to the ObjectUpdate builder.

type ObjectUpsert

type ObjectUpsert struct {
	*sql.UpdateSet
}

ObjectUpsert is the "OnConflict" setter.

func (*ObjectUpsert) AddCarriedOffset

func (u *ObjectUpsert) AddCarriedOffset(v uint32) *ObjectUpsert

AddCarriedOffset adds v to the "carried_offset" field.

func (*ObjectUpsert) AddCarriedTime

func (u *ObjectUpsert) AddCarriedTime(v int64) *ObjectUpsert

AddCarriedTime adds v to the "carried_time" field.

func (*ObjectUpsert) AddLength

func (u *ObjectUpsert) AddLength(v uint32) *ObjectUpsert

AddLength adds v to the "length" field.

func (*ObjectUpsert) AddStart

func (u *ObjectUpsert) AddStart(v uint32) *ObjectUpsert

AddStart adds v to the "start" field.

func (*ObjectUpsert) AddType

func (u *ObjectUpsert) AddType(v uint32) *ObjectUpsert

AddType adds v to the "type" field.

func (*ObjectUpsert) ClearCarriedOffset

func (u *ObjectUpsert) ClearCarriedOffset() *ObjectUpsert

ClearCarriedOffset clears the value of the "carried_offset" field.

func (*ObjectUpsert) ClearCarriedTime

func (u *ObjectUpsert) ClearCarriedTime() *ObjectUpsert

ClearCarriedTime clears the value of the "carried_time" field.

func (*ObjectUpsert) SetArchiveID

func (u *ObjectUpsert) SetArchiveID(v string) *ObjectUpsert

SetArchiveID sets the "archive_id" field.

func (*ObjectUpsert) SetCarriedOffset

func (u *ObjectUpsert) SetCarriedOffset(v uint32) *ObjectUpsert

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectUpsert) SetCarriedTime

func (u *ObjectUpsert) SetCarriedTime(v int64) *ObjectUpsert

SetCarriedTime sets the "carried_time" field.

func (*ObjectUpsert) SetLength

func (u *ObjectUpsert) SetLength(v uint32) *ObjectUpsert

SetLength sets the "length" field.

func (*ObjectUpsert) SetRef

func (u *ObjectUpsert) SetRef(v []byte) *ObjectUpsert

SetRef sets the "ref" field.

func (*ObjectUpsert) SetStart

func (u *ObjectUpsert) SetStart(v uint32) *ObjectUpsert

SetStart sets the "start" field.

func (*ObjectUpsert) SetType

func (u *ObjectUpsert) SetType(v uint32) *ObjectUpsert

SetType sets the "type" field.

func (*ObjectUpsert) UpdateArchiveID

func (u *ObjectUpsert) UpdateArchiveID() *ObjectUpsert

UpdateArchiveID sets the "archive_id" field to the value that was provided on create.

func (*ObjectUpsert) UpdateCarriedOffset

func (u *ObjectUpsert) UpdateCarriedOffset() *ObjectUpsert

UpdateCarriedOffset sets the "carried_offset" field to the value that was provided on create.

func (*ObjectUpsert) UpdateCarriedTime

func (u *ObjectUpsert) UpdateCarriedTime() *ObjectUpsert

UpdateCarriedTime sets the "carried_time" field to the value that was provided on create.

func (*ObjectUpsert) UpdateLength

func (u *ObjectUpsert) UpdateLength() *ObjectUpsert

UpdateLength sets the "length" field to the value that was provided on create.

func (*ObjectUpsert) UpdateRef

func (u *ObjectUpsert) UpdateRef() *ObjectUpsert

UpdateRef sets the "ref" field to the value that was provided on create.

func (*ObjectUpsert) UpdateStart

func (u *ObjectUpsert) UpdateStart() *ObjectUpsert

UpdateStart sets the "start" field to the value that was provided on create.

func (*ObjectUpsert) UpdateType

func (u *ObjectUpsert) UpdateType() *ObjectUpsert

UpdateType sets the "type" field to the value that was provided on create.

type ObjectUpsertBulk

type ObjectUpsertBulk struct {
	// contains filtered or unexported fields
}

ObjectUpsertBulk is the builder for "upsert"-ing a bulk of Object nodes.

func (*ObjectUpsertBulk) AddCarriedOffset

func (u *ObjectUpsertBulk) AddCarriedOffset(v uint32) *ObjectUpsertBulk

AddCarriedOffset adds v to the "carried_offset" field.

func (*ObjectUpsertBulk) AddCarriedTime

func (u *ObjectUpsertBulk) AddCarriedTime(v int64) *ObjectUpsertBulk

AddCarriedTime adds v to the "carried_time" field.

func (*ObjectUpsertBulk) AddLength

func (u *ObjectUpsertBulk) AddLength(v uint32) *ObjectUpsertBulk

AddLength adds v to the "length" field.

func (*ObjectUpsertBulk) AddStart

func (u *ObjectUpsertBulk) AddStart(v uint32) *ObjectUpsertBulk

AddStart adds v to the "start" field.

func (*ObjectUpsertBulk) AddType

func (u *ObjectUpsertBulk) AddType(v uint32) *ObjectUpsertBulk

AddType adds v to the "type" field.

func (*ObjectUpsertBulk) ClearCarriedOffset

func (u *ObjectUpsertBulk) ClearCarriedOffset() *ObjectUpsertBulk

ClearCarriedOffset clears the value of the "carried_offset" field.

func (*ObjectUpsertBulk) ClearCarriedTime

func (u *ObjectUpsertBulk) ClearCarriedTime() *ObjectUpsertBulk

ClearCarriedTime clears the value of the "carried_time" field.

func (*ObjectUpsertBulk) DoNothing

func (u *ObjectUpsertBulk) DoNothing() *ObjectUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ObjectUpsertBulk) Exec

func (u *ObjectUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ObjectUpsertBulk) ExecX

func (u *ObjectUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectUpsertBulk) Ignore

func (u *ObjectUpsertBulk) Ignore() *ObjectUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Object.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ObjectUpsertBulk) SetArchiveID

func (u *ObjectUpsertBulk) SetArchiveID(v string) *ObjectUpsertBulk

SetArchiveID sets the "archive_id" field.

func (*ObjectUpsertBulk) SetCarriedOffset

func (u *ObjectUpsertBulk) SetCarriedOffset(v uint32) *ObjectUpsertBulk

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectUpsertBulk) SetCarriedTime

func (u *ObjectUpsertBulk) SetCarriedTime(v int64) *ObjectUpsertBulk

SetCarriedTime sets the "carried_time" field.

func (*ObjectUpsertBulk) SetLength

func (u *ObjectUpsertBulk) SetLength(v uint32) *ObjectUpsertBulk

SetLength sets the "length" field.

func (*ObjectUpsertBulk) SetRef

func (u *ObjectUpsertBulk) SetRef(v []byte) *ObjectUpsertBulk

SetRef sets the "ref" field.

func (*ObjectUpsertBulk) SetStart

func (u *ObjectUpsertBulk) SetStart(v uint32) *ObjectUpsertBulk

SetStart sets the "start" field.

func (*ObjectUpsertBulk) SetType

func (u *ObjectUpsertBulk) SetType(v uint32) *ObjectUpsertBulk

SetType sets the "type" field.

func (*ObjectUpsertBulk) Update

func (u *ObjectUpsertBulk) Update(set func(*ObjectUpsert)) *ObjectUpsertBulk

Update allows overriding fields `UPDATE` values. See the ObjectCreateBulk.OnConflict documentation for more info.

func (*ObjectUpsertBulk) UpdateArchiveID

func (u *ObjectUpsertBulk) UpdateArchiveID() *ObjectUpsertBulk

UpdateArchiveID sets the "archive_id" field to the value that was provided on create.

func (*ObjectUpsertBulk) UpdateCarriedOffset

func (u *ObjectUpsertBulk) UpdateCarriedOffset() *ObjectUpsertBulk

UpdateCarriedOffset sets the "carried_offset" field to the value that was provided on create.

func (*ObjectUpsertBulk) UpdateCarriedTime

func (u *ObjectUpsertBulk) UpdateCarriedTime() *ObjectUpsertBulk

UpdateCarriedTime sets the "carried_time" field to the value that was provided on create.

func (*ObjectUpsertBulk) UpdateLength

func (u *ObjectUpsertBulk) UpdateLength() *ObjectUpsertBulk

UpdateLength sets the "length" field to the value that was provided on create.

func (*ObjectUpsertBulk) UpdateNewValues

func (u *ObjectUpsertBulk) UpdateNewValues() *ObjectUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Object.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ObjectUpsertBulk) UpdateRef

func (u *ObjectUpsertBulk) UpdateRef() *ObjectUpsertBulk

UpdateRef sets the "ref" field to the value that was provided on create.

func (*ObjectUpsertBulk) UpdateStart

func (u *ObjectUpsertBulk) UpdateStart() *ObjectUpsertBulk

UpdateStart sets the "start" field to the value that was provided on create.

func (*ObjectUpsertBulk) UpdateType

func (u *ObjectUpsertBulk) UpdateType() *ObjectUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

type ObjectUpsertOne

type ObjectUpsertOne struct {
	// contains filtered or unexported fields
}

ObjectUpsertOne is the builder for "upsert"-ing

one Object node.

func (*ObjectUpsertOne) AddCarriedOffset

func (u *ObjectUpsertOne) AddCarriedOffset(v uint32) *ObjectUpsertOne

AddCarriedOffset adds v to the "carried_offset" field.

func (*ObjectUpsertOne) AddCarriedTime

func (u *ObjectUpsertOne) AddCarriedTime(v int64) *ObjectUpsertOne

AddCarriedTime adds v to the "carried_time" field.

func (*ObjectUpsertOne) AddLength

func (u *ObjectUpsertOne) AddLength(v uint32) *ObjectUpsertOne

AddLength adds v to the "length" field.

func (*ObjectUpsertOne) AddStart

func (u *ObjectUpsertOne) AddStart(v uint32) *ObjectUpsertOne

AddStart adds v to the "start" field.

func (*ObjectUpsertOne) AddType

func (u *ObjectUpsertOne) AddType(v uint32) *ObjectUpsertOne

AddType adds v to the "type" field.

func (*ObjectUpsertOne) ClearCarriedOffset

func (u *ObjectUpsertOne) ClearCarriedOffset() *ObjectUpsertOne

ClearCarriedOffset clears the value of the "carried_offset" field.

func (*ObjectUpsertOne) ClearCarriedTime

func (u *ObjectUpsertOne) ClearCarriedTime() *ObjectUpsertOne

ClearCarriedTime clears the value of the "carried_time" field.

func (*ObjectUpsertOne) DoNothing

func (u *ObjectUpsertOne) DoNothing() *ObjectUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ObjectUpsertOne) Exec

func (u *ObjectUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ObjectUpsertOne) ExecX

func (u *ObjectUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ObjectUpsertOne) ID

func (u *ObjectUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ObjectUpsertOne) IDX

func (u *ObjectUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ObjectUpsertOne) Ignore

func (u *ObjectUpsertOne) Ignore() *ObjectUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Object.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ObjectUpsertOne) SetArchiveID

func (u *ObjectUpsertOne) SetArchiveID(v string) *ObjectUpsertOne

SetArchiveID sets the "archive_id" field.

func (*ObjectUpsertOne) SetCarriedOffset

func (u *ObjectUpsertOne) SetCarriedOffset(v uint32) *ObjectUpsertOne

SetCarriedOffset sets the "carried_offset" field.

func (*ObjectUpsertOne) SetCarriedTime

func (u *ObjectUpsertOne) SetCarriedTime(v int64) *ObjectUpsertOne

SetCarriedTime sets the "carried_time" field.

func (*ObjectUpsertOne) SetLength

func (u *ObjectUpsertOne) SetLength(v uint32) *ObjectUpsertOne

SetLength sets the "length" field.

func (*ObjectUpsertOne) SetRef

func (u *ObjectUpsertOne) SetRef(v []byte) *ObjectUpsertOne

SetRef sets the "ref" field.

func (*ObjectUpsertOne) SetStart

func (u *ObjectUpsertOne) SetStart(v uint32) *ObjectUpsertOne

SetStart sets the "start" field.

func (*ObjectUpsertOne) SetType

func (u *ObjectUpsertOne) SetType(v uint32) *ObjectUpsertOne

SetType sets the "type" field.

func (*ObjectUpsertOne) Update

func (u *ObjectUpsertOne) Update(set func(*ObjectUpsert)) *ObjectUpsertOne

Update allows overriding fields `UPDATE` values. See the ObjectCreate.OnConflict documentation for more info.

func (*ObjectUpsertOne) UpdateArchiveID

func (u *ObjectUpsertOne) UpdateArchiveID() *ObjectUpsertOne

UpdateArchiveID sets the "archive_id" field to the value that was provided on create.

func (*ObjectUpsertOne) UpdateCarriedOffset

func (u *ObjectUpsertOne) UpdateCarriedOffset() *ObjectUpsertOne

UpdateCarriedOffset sets the "carried_offset" field to the value that was provided on create.

func (*ObjectUpsertOne) UpdateCarriedTime

func (u *ObjectUpsertOne) UpdateCarriedTime() *ObjectUpsertOne

UpdateCarriedTime sets the "carried_time" field to the value that was provided on create.

func (*ObjectUpsertOne) UpdateLength

func (u *ObjectUpsertOne) UpdateLength() *ObjectUpsertOne

UpdateLength sets the "length" field to the value that was provided on create.

func (*ObjectUpsertOne) UpdateNewValues

func (u *ObjectUpsertOne) UpdateNewValues() *ObjectUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Object.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ObjectUpsertOne) UpdateRef

func (u *ObjectUpsertOne) UpdateRef() *ObjectUpsertOne

UpdateRef sets the "ref" field to the value that was provided on create.

func (*ObjectUpsertOne) UpdateStart

func (u *ObjectUpsertOne) UpdateStart() *ObjectUpsertOne

UpdateStart sets the "start" field to the value that was provided on create.

func (*ObjectUpsertOne) UpdateType

func (u *ObjectUpsertOne) UpdateType() *ObjectUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

type Objects

type Objects []*Object

Objects is a parsable slice of Object.

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 Pin

type Pin struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// Target holds the value of the "target" field.
	Target []byte `json:"target,omitempty"`
	// ReceivedAt holds the value of the "received_at" field.
	ReceivedAt time.Time `json:"received_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]string `json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

Pin is the model entity for the Pin schema.

func (*Pin) ExecContext

func (c *Pin) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Pin) QueryContext

func (c *Pin) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Pin) String

func (_m *Pin) String() string

String implements the fmt.Stringer.

func (*Pin) Unwrap

func (_m *Pin) Unwrap() *Pin

Unwrap unwraps the Pin 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 (*Pin) Update

func (_m *Pin) Update() *PinUpdateOne

Update returns a builder for updating this Pin. Note that you need to call Pin.Unwrap() before calling this method if this Pin was returned from a transaction, and the transaction was committed or rolled back.

func (*Pin) Value

func (_m *Pin) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Pin. This includes values selected through modifiers, order, etc.

type PinClient

type PinClient struct {
	// contains filtered or unexported fields
}

PinClient is a client for the Pin schema.

func NewPinClient

func NewPinClient(c config) *PinClient

NewPinClient returns a client for the Pin from the given config.

func (*PinClient) Create

func (c *PinClient) Create() *PinCreate

Create returns a builder for creating a Pin entity.

func (*PinClient) CreateBulk

func (c *PinClient) CreateBulk(builders ...*PinCreate) *PinCreateBulk

CreateBulk returns a builder for creating a bulk of Pin entities.

func (*PinClient) Delete

func (c *PinClient) Delete() *PinDelete

Delete returns a delete builder for Pin.

func (*PinClient) DeleteOne

func (c *PinClient) DeleteOne(_m *Pin) *PinDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PinClient) DeleteOneID

func (c *PinClient) DeleteOneID(id int) *PinDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PinClient) ExecContext

func (c *PinClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinClient) Get

func (c *PinClient) Get(ctx context.Context, id int) (*Pin, error)

Get returns a Pin entity by its id.

func (*PinClient) GetX

func (c *PinClient) GetX(ctx context.Context, id int) *Pin

GetX is like Get, but panics if an error occurs.

func (*PinClient) Hooks

func (c *PinClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PinClient) Intercept

func (c *PinClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pin.Intercept(f(g(h())))`.

func (*PinClient) Interceptors

func (c *PinClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PinClient) MapCreateBulk

func (c *PinClient) MapCreateBulk(slice any, setFunc func(*PinCreate, int)) *PinCreateBulk

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 (*PinClient) Query

func (c *PinClient) Query() *PinQuery

Query returns a query builder for Pin.

func (*PinClient) QueryContext

func (c *PinClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinClient) Update

func (c *PinClient) Update() *PinUpdate

Update returns an update builder for Pin.

func (*PinClient) UpdateOne

func (c *PinClient) UpdateOne(_m *Pin) *PinUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PinClient) UpdateOneID

func (c *PinClient) UpdateOneID(id int) *PinUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PinClient) Use

func (c *PinClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `pin.Hooks(f(g(h())))`.

type PinCreate

type PinCreate struct {
	// contains filtered or unexported fields
}

PinCreate is the builder for creating a Pin entity.

func (*PinCreate) Exec

func (_c *PinCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PinCreate) ExecContext

func (c *PinCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinCreate) ExecX

func (_c *PinCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinCreate) Mutation

func (_c *PinCreate) Mutation() *PinMutation

Mutation returns the PinMutation object of the builder.

func (*PinCreate) OnConflict

func (_c *PinCreate) OnConflict(opts ...sql.ConflictOption) *PinUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Pin.Create().
	SetRef(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PinUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*PinCreate) OnConflictColumns

func (_c *PinCreate) OnConflictColumns(columns ...string) *PinUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Pin.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PinCreate) QueryContext

func (c *PinCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinCreate) Save

func (_c *PinCreate) Save(ctx context.Context) (*Pin, error)

Save creates the Pin in the database.

func (*PinCreate) SaveX

func (_c *PinCreate) SaveX(ctx context.Context) *Pin

SaveX calls Save and panics if Save returns an error.

func (*PinCreate) SetDeletedAt

func (_c *PinCreate) SetDeletedAt(v time.Time) *PinCreate

SetDeletedAt sets the "deleted_at" field.

func (*PinCreate) SetMetadata

func (_c *PinCreate) SetMetadata(v map[string]string) *PinCreate

SetMetadata sets the "metadata" field.

func (*PinCreate) SetNillableDeletedAt

func (_c *PinCreate) SetNillableDeletedAt(v *time.Time) *PinCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PinCreate) SetReceivedAt

func (_c *PinCreate) SetReceivedAt(v time.Time) *PinCreate

SetReceivedAt sets the "received_at" field.

func (*PinCreate) SetRef

func (_c *PinCreate) SetRef(v []byte) *PinCreate

SetRef sets the "ref" field.

func (*PinCreate) SetTarget

func (_c *PinCreate) SetTarget(v []byte) *PinCreate

SetTarget sets the "target" field.

type PinCreateBulk

type PinCreateBulk struct {
	// contains filtered or unexported fields
}

PinCreateBulk is the builder for creating many Pin entities in bulk.

func (*PinCreateBulk) Exec

func (_c *PinCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PinCreateBulk) ExecContext

func (c *PinCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinCreateBulk) ExecX

func (_c *PinCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinCreateBulk) OnConflict

func (_c *PinCreateBulk) OnConflict(opts ...sql.ConflictOption) *PinUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Pin.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PinUpsert) {
		SetRef(v+v).
	}).
	Exec(ctx)

func (*PinCreateBulk) OnConflictColumns

func (_c *PinCreateBulk) OnConflictColumns(columns ...string) *PinUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Pin.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PinCreateBulk) QueryContext

func (c *PinCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinCreateBulk) Save

func (_c *PinCreateBulk) Save(ctx context.Context) ([]*Pin, error)

Save creates the Pin entities in the database.

func (*PinCreateBulk) SaveX

func (_c *PinCreateBulk) SaveX(ctx context.Context) []*Pin

SaveX is like Save, but panics if an error occurs.

type PinDelete

type PinDelete struct {
	// contains filtered or unexported fields
}

PinDelete is the builder for deleting a Pin entity.

func (*PinDelete) Exec

func (_d *PinDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PinDelete) ExecContext

func (c *PinDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinDelete) ExecX

func (_d *PinDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PinDelete) QueryContext

func (c *PinDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinDelete) Where

func (_d *PinDelete) Where(ps ...predicate.Pin) *PinDelete

Where appends a list predicates to the PinDelete builder.

type PinDeleteOne

type PinDeleteOne struct {
	// contains filtered or unexported fields
}

PinDeleteOne is the builder for deleting a single Pin entity.

func (*PinDeleteOne) Exec

func (_d *PinDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PinDeleteOne) ExecX

func (_d *PinDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinDeleteOne) Where

func (_d *PinDeleteOne) Where(ps ...predicate.Pin) *PinDeleteOne

Where appends a list predicates to the PinDelete builder.

type PinGroupBy

type PinGroupBy struct {
	// contains filtered or unexported fields
}

PinGroupBy is the group-by builder for Pin entities.

func (*PinGroupBy) Aggregate

func (_g *PinGroupBy) Aggregate(fns ...AggregateFunc) *PinGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PinGroupBy) Bool

func (s *PinGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) BoolX

func (s *PinGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PinGroupBy) Bools

func (s *PinGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) BoolsX

func (s *PinGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PinGroupBy) Float64

func (s *PinGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) Float64X

func (s *PinGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PinGroupBy) Float64s

func (s *PinGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) Float64sX

func (s *PinGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PinGroupBy) Int

func (s *PinGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) IntX

func (s *PinGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PinGroupBy) Ints

func (s *PinGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) IntsX

func (s *PinGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PinGroupBy) Scan

func (_g *PinGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PinGroupBy) ScanX

func (s *PinGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PinGroupBy) String

func (s *PinGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) StringX

func (s *PinGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PinGroupBy) Strings

func (s *PinGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PinGroupBy) StringsX

func (s *PinGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PinMutation

type PinMutation struct {
	// contains filtered or unexported fields
}

PinMutation represents an operation that mutates the Pin nodes in the graph.

func (*PinMutation) AddField

func (m *PinMutation) 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 (*PinMutation) AddedEdges

func (m *PinMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PinMutation) AddedField

func (m *PinMutation) 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 (*PinMutation) AddedFields

func (m *PinMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PinMutation) AddedIDs

func (m *PinMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PinMutation) ClearDeletedAt

func (m *PinMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PinMutation) ClearEdge

func (m *PinMutation) 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 (*PinMutation) ClearField

func (m *PinMutation) 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 (*PinMutation) ClearMetadata

func (m *PinMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*PinMutation) ClearedEdges

func (m *PinMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PinMutation) ClearedFields

func (m *PinMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PinMutation) Client

func (m PinMutation) 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 (*PinMutation) DeletedAt

func (m *PinMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PinMutation) DeletedAtCleared

func (m *PinMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PinMutation) EdgeCleared

func (m *PinMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PinMutation) ExecContext

func (c *PinMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinMutation) Field

func (m *PinMutation) 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 (*PinMutation) FieldCleared

func (m *PinMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PinMutation) Fields

func (m *PinMutation) 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 (*PinMutation) ID

func (m *PinMutation) 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 (*PinMutation) IDs

func (m *PinMutation) 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 (*PinMutation) Metadata

func (m *PinMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*PinMutation) MetadataCleared

func (m *PinMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*PinMutation) OldDeletedAt

func (m *PinMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Pin entity. If the Pin 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 (*PinMutation) OldField

func (m *PinMutation) 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 (*PinMutation) OldMetadata

func (m *PinMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Pin entity. If the Pin 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 (*PinMutation) OldReceivedAt

func (m *PinMutation) OldReceivedAt(ctx context.Context) (v time.Time, err error)

OldReceivedAt returns the old "received_at" field's value of the Pin entity. If the Pin 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 (*PinMutation) OldRef

func (m *PinMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the Pin entity. If the Pin 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 (*PinMutation) OldTarget

func (m *PinMutation) OldTarget(ctx context.Context) (v []byte, err error)

OldTarget returns the old "target" field's value of the Pin entity. If the Pin 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 (*PinMutation) Op

func (m *PinMutation) Op() Op

Op returns the operation name.

func (*PinMutation) QueryContext

func (c *PinMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinMutation) ReceivedAt

func (m *PinMutation) ReceivedAt() (r time.Time, exists bool)

ReceivedAt returns the value of the "received_at" field in the mutation.

func (*PinMutation) Ref

func (m *PinMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*PinMutation) RemovedEdges

func (m *PinMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PinMutation) RemovedIDs

func (m *PinMutation) 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 (*PinMutation) ResetDeletedAt

func (m *PinMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PinMutation) ResetEdge

func (m *PinMutation) 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 (*PinMutation) ResetField

func (m *PinMutation) 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 (*PinMutation) ResetMetadata

func (m *PinMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*PinMutation) ResetReceivedAt

func (m *PinMutation) ResetReceivedAt()

ResetReceivedAt resets all changes to the "received_at" field.

func (*PinMutation) ResetRef

func (m *PinMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*PinMutation) ResetTarget

func (m *PinMutation) ResetTarget()

ResetTarget resets all changes to the "target" field.

func (*PinMutation) SetDeletedAt

func (m *PinMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PinMutation) SetField

func (m *PinMutation) 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 (*PinMutation) SetMetadata

func (m *PinMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*PinMutation) SetOp

func (m *PinMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PinMutation) SetReceivedAt

func (m *PinMutation) SetReceivedAt(t time.Time)

SetReceivedAt sets the "received_at" field.

func (*PinMutation) SetRef

func (m *PinMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*PinMutation) SetTarget

func (m *PinMutation) SetTarget(b []byte)

SetTarget sets the "target" field.

func (*PinMutation) Target

func (m *PinMutation) Target() (r []byte, exists bool)

Target returns the value of the "target" field in the mutation.

func (PinMutation) Tx

func (m PinMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PinMutation) Type

func (m *PinMutation) Type() string

Type returns the node type of this mutation (Pin).

func (*PinMutation) Where

func (m *PinMutation) Where(ps ...predicate.Pin)

Where appends a list predicates to the PinMutation builder.

func (*PinMutation) WhereP

func (m *PinMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PinMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PinQuery

type PinQuery struct {
	// contains filtered or unexported fields
}

PinQuery is the builder for querying Pin entities.

func (*PinQuery) Aggregate

func (_q *PinQuery) Aggregate(fns ...AggregateFunc) *PinSelect

Aggregate returns a PinSelect configured with the given aggregations.

func (*PinQuery) All

func (_q *PinQuery) All(ctx context.Context) ([]*Pin, error)

All executes the query and returns a list of Pins.

func (*PinQuery) AllX

func (_q *PinQuery) AllX(ctx context.Context) []*Pin

AllX is like All, but panics if an error occurs.

func (*PinQuery) Clone

func (_q *PinQuery) Clone() *PinQuery

Clone returns a duplicate of the PinQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PinQuery) Count

func (_q *PinQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PinQuery) CountX

func (_q *PinQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PinQuery) ExecContext

func (c *PinQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinQuery) Exist

func (_q *PinQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PinQuery) ExistX

func (_q *PinQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PinQuery) First

func (_q *PinQuery) First(ctx context.Context) (*Pin, error)

First returns the first Pin entity from the query. Returns a *NotFoundError when no Pin was found.

func (*PinQuery) FirstID

func (_q *PinQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Pin ID from the query. Returns a *NotFoundError when no Pin ID was found.

func (*PinQuery) FirstIDX

func (_q *PinQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PinQuery) FirstX

func (_q *PinQuery) FirstX(ctx context.Context) *Pin

FirstX is like First, but panics if an error occurs.

func (*PinQuery) ForShare

func (_q *PinQuery) ForShare(opts ...sql.LockOption) *PinQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*PinQuery) ForUpdate

func (_q *PinQuery) ForUpdate(opts ...sql.LockOption) *PinQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*PinQuery) GroupBy

func (_q *PinQuery) GroupBy(field string, fields ...string) *PinGroupBy

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 {
	Ref []byte `json:"ref,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Pin.Query().
	GroupBy(pin.FieldRef).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PinQuery) IDs

func (_q *PinQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Pin IDs.

func (*PinQuery) IDsX

func (_q *PinQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PinQuery) Limit

func (_q *PinQuery) Limit(limit int) *PinQuery

Limit the number of records to be returned by this query.

func (*PinQuery) Offset

func (_q *PinQuery) Offset(offset int) *PinQuery

Offset to start from.

func (*PinQuery) Only

func (_q *PinQuery) Only(ctx context.Context) (*Pin, error)

Only returns a single Pin entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pin entity is found. Returns a *NotFoundError when no Pin entities are found.

func (*PinQuery) OnlyID

func (_q *PinQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Pin ID in the query. Returns a *NotSingularError when more than one Pin ID is found. Returns a *NotFoundError when no entities are found.

func (*PinQuery) OnlyIDX

func (_q *PinQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PinQuery) OnlyX

func (_q *PinQuery) OnlyX(ctx context.Context) *Pin

OnlyX is like Only, but panics if an error occurs.

func (*PinQuery) Order

func (_q *PinQuery) Order(o ...pin.OrderOption) *PinQuery

Order specifies how the records should be ordered.

func (*PinQuery) QueryContext

func (c *PinQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinQuery) Select

func (_q *PinQuery) Select(fields ...string) *PinSelect

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 {
	Ref []byte `json:"ref,omitempty"`
}

client.Pin.Query().
	Select(pin.FieldRef).
	Scan(ctx, &v)

func (*PinQuery) Unique

func (_q *PinQuery) Unique(unique bool) *PinQuery

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 (*PinQuery) Where

func (_q *PinQuery) Where(ps ...predicate.Pin) *PinQuery

Where adds a new predicate for the PinQuery builder.

type PinSelect

type PinSelect struct {
	*PinQuery
	// contains filtered or unexported fields
}

PinSelect is the builder for selecting fields of Pin entities.

func (*PinSelect) Aggregate

func (_s *PinSelect) Aggregate(fns ...AggregateFunc) *PinSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PinSelect) Bool

func (s *PinSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PinSelect) BoolX

func (s *PinSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PinSelect) Bools

func (s *PinSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PinSelect) BoolsX

func (s *PinSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (PinSelect) ExecContext

func (c PinSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinSelect) Float64

func (s *PinSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PinSelect) Float64X

func (s *PinSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PinSelect) Float64s

func (s *PinSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PinSelect) Float64sX

func (s *PinSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PinSelect) Int

func (s *PinSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PinSelect) IntX

func (s *PinSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PinSelect) Ints

func (s *PinSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PinSelect) IntsX

func (s *PinSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (PinSelect) QueryContext

func (c PinSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinSelect) Scan

func (_s *PinSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PinSelect) ScanX

func (s *PinSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PinSelect) String

func (s *PinSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PinSelect) StringX

func (s *PinSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PinSelect) Strings

func (s *PinSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PinSelect) StringsX

func (s *PinSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PinUpdate

type PinUpdate struct {
	// contains filtered or unexported fields
}

PinUpdate is the builder for updating Pin entities.

func (*PinUpdate) ClearDeletedAt

func (_u *PinUpdate) ClearDeletedAt() *PinUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PinUpdate) ClearMetadata

func (_u *PinUpdate) ClearMetadata() *PinUpdate

ClearMetadata clears the value of the "metadata" field.

func (*PinUpdate) Exec

func (_u *PinUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PinUpdate) ExecContext

func (c *PinUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinUpdate) ExecX

func (_u *PinUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinUpdate) Mutation

func (_u *PinUpdate) Mutation() *PinMutation

Mutation returns the PinMutation object of the builder.

func (*PinUpdate) QueryContext

func (c *PinUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinUpdate) Save

func (_u *PinUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PinUpdate) SaveX

func (_u *PinUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PinUpdate) SetDeletedAt

func (_u *PinUpdate) SetDeletedAt(v time.Time) *PinUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PinUpdate) SetMetadata

func (_u *PinUpdate) SetMetadata(v map[string]string) *PinUpdate

SetMetadata sets the "metadata" field.

func (*PinUpdate) SetNillableDeletedAt

func (_u *PinUpdate) SetNillableDeletedAt(v *time.Time) *PinUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PinUpdate) SetNillableReceivedAt

func (_u *PinUpdate) SetNillableReceivedAt(v *time.Time) *PinUpdate

SetNillableReceivedAt sets the "received_at" field if the given value is not nil.

func (*PinUpdate) SetReceivedAt

func (_u *PinUpdate) SetReceivedAt(v time.Time) *PinUpdate

SetReceivedAt sets the "received_at" field.

func (*PinUpdate) SetTarget

func (_u *PinUpdate) SetTarget(v []byte) *PinUpdate

SetTarget sets the "target" field.

func (*PinUpdate) Where

func (_u *PinUpdate) Where(ps ...predicate.Pin) *PinUpdate

Where appends a list predicates to the PinUpdate builder.

type PinUpdateOne

type PinUpdateOne struct {
	// contains filtered or unexported fields
}

PinUpdateOne is the builder for updating a single Pin entity.

func (*PinUpdateOne) ClearDeletedAt

func (_u *PinUpdateOne) ClearDeletedAt() *PinUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PinUpdateOne) ClearMetadata

func (_u *PinUpdateOne) ClearMetadata() *PinUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*PinUpdateOne) Exec

func (_u *PinUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PinUpdateOne) ExecContext

func (c *PinUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PinUpdateOne) ExecX

func (_u *PinUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinUpdateOne) Mutation

func (_u *PinUpdateOne) Mutation() *PinMutation

Mutation returns the PinMutation object of the builder.

func (*PinUpdateOne) QueryContext

func (c *PinUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PinUpdateOne) Save

func (_u *PinUpdateOne) Save(ctx context.Context) (*Pin, error)

Save executes the query and returns the updated Pin entity.

func (*PinUpdateOne) SaveX

func (_u *PinUpdateOne) SaveX(ctx context.Context) *Pin

SaveX is like Save, but panics if an error occurs.

func (*PinUpdateOne) Select

func (_u *PinUpdateOne) Select(field string, fields ...string) *PinUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PinUpdateOne) SetDeletedAt

func (_u *PinUpdateOne) SetDeletedAt(v time.Time) *PinUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PinUpdateOne) SetMetadata

func (_u *PinUpdateOne) SetMetadata(v map[string]string) *PinUpdateOne

SetMetadata sets the "metadata" field.

func (*PinUpdateOne) SetNillableDeletedAt

func (_u *PinUpdateOne) SetNillableDeletedAt(v *time.Time) *PinUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PinUpdateOne) SetNillableReceivedAt

func (_u *PinUpdateOne) SetNillableReceivedAt(v *time.Time) *PinUpdateOne

SetNillableReceivedAt sets the "received_at" field if the given value is not nil.

func (*PinUpdateOne) SetReceivedAt

func (_u *PinUpdateOne) SetReceivedAt(v time.Time) *PinUpdateOne

SetReceivedAt sets the "received_at" field.

func (*PinUpdateOne) SetTarget

func (_u *PinUpdateOne) SetTarget(v []byte) *PinUpdateOne

SetTarget sets the "target" field.

func (*PinUpdateOne) Where

func (_u *PinUpdateOne) Where(ps ...predicate.Pin) *PinUpdateOne

Where appends a list predicates to the PinUpdate builder.

type PinUpsert

type PinUpsert struct {
	*sql.UpdateSet
}

PinUpsert is the "OnConflict" setter.

func (*PinUpsert) ClearDeletedAt

func (u *PinUpsert) ClearDeletedAt() *PinUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PinUpsert) ClearMetadata

func (u *PinUpsert) ClearMetadata() *PinUpsert

ClearMetadata clears the value of the "metadata" field.

func (*PinUpsert) SetDeletedAt

func (u *PinUpsert) SetDeletedAt(v time.Time) *PinUpsert

SetDeletedAt sets the "deleted_at" field.

func (*PinUpsert) SetMetadata

func (u *PinUpsert) SetMetadata(v map[string]string) *PinUpsert

SetMetadata sets the "metadata" field.

func (*PinUpsert) SetReceivedAt

func (u *PinUpsert) SetReceivedAt(v time.Time) *PinUpsert

SetReceivedAt sets the "received_at" field.

func (*PinUpsert) SetTarget

func (u *PinUpsert) SetTarget(v []byte) *PinUpsert

SetTarget sets the "target" field.

func (*PinUpsert) UpdateDeletedAt

func (u *PinUpsert) UpdateDeletedAt() *PinUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PinUpsert) UpdateMetadata

func (u *PinUpsert) UpdateMetadata() *PinUpsert

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*PinUpsert) UpdateReceivedAt

func (u *PinUpsert) UpdateReceivedAt() *PinUpsert

UpdateReceivedAt sets the "received_at" field to the value that was provided on create.

func (*PinUpsert) UpdateTarget

func (u *PinUpsert) UpdateTarget() *PinUpsert

UpdateTarget sets the "target" field to the value that was provided on create.

type PinUpsertBulk

type PinUpsertBulk struct {
	// contains filtered or unexported fields
}

PinUpsertBulk is the builder for "upsert"-ing a bulk of Pin nodes.

func (*PinUpsertBulk) ClearDeletedAt

func (u *PinUpsertBulk) ClearDeletedAt() *PinUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PinUpsertBulk) ClearMetadata

func (u *PinUpsertBulk) ClearMetadata() *PinUpsertBulk

ClearMetadata clears the value of the "metadata" field.

func (*PinUpsertBulk) DoNothing

func (u *PinUpsertBulk) DoNothing() *PinUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PinUpsertBulk) Exec

func (u *PinUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PinUpsertBulk) ExecX

func (u *PinUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinUpsertBulk) Ignore

func (u *PinUpsertBulk) Ignore() *PinUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Pin.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PinUpsertBulk) SetDeletedAt

func (u *PinUpsertBulk) SetDeletedAt(v time.Time) *PinUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*PinUpsertBulk) SetMetadata

func (u *PinUpsertBulk) SetMetadata(v map[string]string) *PinUpsertBulk

SetMetadata sets the "metadata" field.

func (*PinUpsertBulk) SetReceivedAt

func (u *PinUpsertBulk) SetReceivedAt(v time.Time) *PinUpsertBulk

SetReceivedAt sets the "received_at" field.

func (*PinUpsertBulk) SetTarget

func (u *PinUpsertBulk) SetTarget(v []byte) *PinUpsertBulk

SetTarget sets the "target" field.

func (*PinUpsertBulk) Update

func (u *PinUpsertBulk) Update(set func(*PinUpsert)) *PinUpsertBulk

Update allows overriding fields `UPDATE` values. See the PinCreateBulk.OnConflict documentation for more info.

func (*PinUpsertBulk) UpdateDeletedAt

func (u *PinUpsertBulk) UpdateDeletedAt() *PinUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PinUpsertBulk) UpdateMetadata

func (u *PinUpsertBulk) UpdateMetadata() *PinUpsertBulk

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*PinUpsertBulk) UpdateNewValues

func (u *PinUpsertBulk) UpdateNewValues() *PinUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Pin.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PinUpsertBulk) UpdateReceivedAt

func (u *PinUpsertBulk) UpdateReceivedAt() *PinUpsertBulk

UpdateReceivedAt sets the "received_at" field to the value that was provided on create.

func (*PinUpsertBulk) UpdateTarget

func (u *PinUpsertBulk) UpdateTarget() *PinUpsertBulk

UpdateTarget sets the "target" field to the value that was provided on create.

type PinUpsertOne

type PinUpsertOne struct {
	// contains filtered or unexported fields
}

PinUpsertOne is the builder for "upsert"-ing

one Pin node.

func (*PinUpsertOne) ClearDeletedAt

func (u *PinUpsertOne) ClearDeletedAt() *PinUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PinUpsertOne) ClearMetadata

func (u *PinUpsertOne) ClearMetadata() *PinUpsertOne

ClearMetadata clears the value of the "metadata" field.

func (*PinUpsertOne) DoNothing

func (u *PinUpsertOne) DoNothing() *PinUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PinUpsertOne) Exec

func (u *PinUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PinUpsertOne) ExecX

func (u *PinUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PinUpsertOne) ID

func (u *PinUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PinUpsertOne) IDX

func (u *PinUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*PinUpsertOne) Ignore

func (u *PinUpsertOne) Ignore() *PinUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Pin.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PinUpsertOne) SetDeletedAt

func (u *PinUpsertOne) SetDeletedAt(v time.Time) *PinUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*PinUpsertOne) SetMetadata

func (u *PinUpsertOne) SetMetadata(v map[string]string) *PinUpsertOne

SetMetadata sets the "metadata" field.

func (*PinUpsertOne) SetReceivedAt

func (u *PinUpsertOne) SetReceivedAt(v time.Time) *PinUpsertOne

SetReceivedAt sets the "received_at" field.

func (*PinUpsertOne) SetTarget

func (u *PinUpsertOne) SetTarget(v []byte) *PinUpsertOne

SetTarget sets the "target" field.

func (*PinUpsertOne) Update

func (u *PinUpsertOne) Update(set func(*PinUpsert)) *PinUpsertOne

Update allows overriding fields `UPDATE` values. See the PinCreate.OnConflict documentation for more info.

func (*PinUpsertOne) UpdateDeletedAt

func (u *PinUpsertOne) UpdateDeletedAt() *PinUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PinUpsertOne) UpdateMetadata

func (u *PinUpsertOne) UpdateMetadata() *PinUpsertOne

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*PinUpsertOne) UpdateNewValues

func (u *PinUpsertOne) UpdateNewValues() *PinUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Pin.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PinUpsertOne) UpdateReceivedAt

func (u *PinUpsertOne) UpdateReceivedAt() *PinUpsertOne

UpdateReceivedAt sets the "received_at" field to the value that was provided on create.

func (*PinUpsertOne) UpdateTarget

func (u *PinUpsertOne) UpdateTarget() *PinUpsertOne

UpdateTarget sets the "target" field to the value that was provided on create.

type Pins

type Pins []*Pin

Pins is a parsable slice of Pin.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

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 Reindex

type Reindex struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Churn holds the value of the "churn" field.
	Churn int64 `json:"churn,omitempty"`
	// StatsReset holds the value of the "stats_reset" field.
	StatsReset *time.Time `json:"stats_reset,omitempty"`
	// ReindexedAt holds the value of the "reindexed_at" field.
	ReindexedAt time.Time `json:"reindexed_at,omitempty"`
	// contains filtered or unexported fields
}

Reindex is the model entity for the Reindex schema.

func (*Reindex) ExecContext

func (c *Reindex) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Reindex) QueryContext

func (c *Reindex) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Reindex) String

func (_m *Reindex) String() string

String implements the fmt.Stringer.

func (*Reindex) Unwrap

func (_m *Reindex) Unwrap() *Reindex

Unwrap unwraps the Reindex 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 (*Reindex) Update

func (_m *Reindex) Update() *ReindexUpdateOne

Update returns a builder for updating this Reindex. Note that you need to call Reindex.Unwrap() before calling this method if this Reindex was returned from a transaction, and the transaction was committed or rolled back.

func (*Reindex) Value

func (_m *Reindex) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Reindex. This includes values selected through modifiers, order, etc.

type ReindexClient

type ReindexClient struct {
	// contains filtered or unexported fields
}

ReindexClient is a client for the Reindex schema.

func NewReindexClient

func NewReindexClient(c config) *ReindexClient

NewReindexClient returns a client for the Reindex from the given config.

func (*ReindexClient) Create

func (c *ReindexClient) Create() *ReindexCreate

Create returns a builder for creating a Reindex entity.

func (*ReindexClient) CreateBulk

func (c *ReindexClient) CreateBulk(builders ...*ReindexCreate) *ReindexCreateBulk

CreateBulk returns a builder for creating a bulk of Reindex entities.

func (*ReindexClient) Delete

func (c *ReindexClient) Delete() *ReindexDelete

Delete returns a delete builder for Reindex.

func (*ReindexClient) DeleteOne

func (c *ReindexClient) DeleteOne(_m *Reindex) *ReindexDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReindexClient) DeleteOneID

func (c *ReindexClient) DeleteOneID(id string) *ReindexDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ReindexClient) ExecContext

func (c *ReindexClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexClient) Get

func (c *ReindexClient) Get(ctx context.Context, id string) (*Reindex, error)

Get returns a Reindex entity by its id.

func (*ReindexClient) GetX

func (c *ReindexClient) GetX(ctx context.Context, id string) *Reindex

GetX is like Get, but panics if an error occurs.

func (*ReindexClient) Hooks

func (c *ReindexClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ReindexClient) Intercept

func (c *ReindexClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `reindex.Intercept(f(g(h())))`.

func (*ReindexClient) Interceptors

func (c *ReindexClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReindexClient) MapCreateBulk

func (c *ReindexClient) MapCreateBulk(slice any, setFunc func(*ReindexCreate, int)) *ReindexCreateBulk

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 (*ReindexClient) Query

func (c *ReindexClient) Query() *ReindexQuery

Query returns a query builder for Reindex.

func (*ReindexClient) QueryContext

func (c *ReindexClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexClient) Update

func (c *ReindexClient) Update() *ReindexUpdate

Update returns an update builder for Reindex.

func (*ReindexClient) UpdateOne

func (c *ReindexClient) UpdateOne(_m *Reindex) *ReindexUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReindexClient) UpdateOneID

func (c *ReindexClient) UpdateOneID(id string) *ReindexUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReindexClient) Use

func (c *ReindexClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `reindex.Hooks(f(g(h())))`.

type ReindexCreate

type ReindexCreate struct {
	// contains filtered or unexported fields
}

ReindexCreate is the builder for creating a Reindex entity.

func (*ReindexCreate) Exec

func (_c *ReindexCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReindexCreate) ExecContext

func (c *ReindexCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexCreate) ExecX

func (_c *ReindexCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexCreate) Mutation

func (_c *ReindexCreate) Mutation() *ReindexMutation

Mutation returns the ReindexMutation object of the builder.

func (*ReindexCreate) OnConflict

func (_c *ReindexCreate) OnConflict(opts ...sql.ConflictOption) *ReindexUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Reindex.Create().
	SetChurn(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ReindexUpsert) {
		SetChurn(v+v).
	}).
	Exec(ctx)

func (*ReindexCreate) OnConflictColumns

func (_c *ReindexCreate) OnConflictColumns(columns ...string) *ReindexUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Reindex.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ReindexCreate) QueryContext

func (c *ReindexCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexCreate) Save

func (_c *ReindexCreate) Save(ctx context.Context) (*Reindex, error)

Save creates the Reindex in the database.

func (*ReindexCreate) SaveX

func (_c *ReindexCreate) SaveX(ctx context.Context) *Reindex

SaveX calls Save and panics if Save returns an error.

func (*ReindexCreate) SetChurn

func (_c *ReindexCreate) SetChurn(v int64) *ReindexCreate

SetChurn sets the "churn" field.

func (*ReindexCreate) SetID

func (_c *ReindexCreate) SetID(v string) *ReindexCreate

SetID sets the "id" field.

func (*ReindexCreate) SetNillableStatsReset

func (_c *ReindexCreate) SetNillableStatsReset(v *time.Time) *ReindexCreate

SetNillableStatsReset sets the "stats_reset" field if the given value is not nil.

func (*ReindexCreate) SetReindexedAt

func (_c *ReindexCreate) SetReindexedAt(v time.Time) *ReindexCreate

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexCreate) SetStatsReset

func (_c *ReindexCreate) SetStatsReset(v time.Time) *ReindexCreate

SetStatsReset sets the "stats_reset" field.

type ReindexCreateBulk

type ReindexCreateBulk struct {
	// contains filtered or unexported fields
}

ReindexCreateBulk is the builder for creating many Reindex entities in bulk.

func (*ReindexCreateBulk) Exec

func (_c *ReindexCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReindexCreateBulk) ExecContext

func (c *ReindexCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexCreateBulk) ExecX

func (_c *ReindexCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexCreateBulk) OnConflict

func (_c *ReindexCreateBulk) OnConflict(opts ...sql.ConflictOption) *ReindexUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Reindex.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ReindexUpsert) {
		SetChurn(v+v).
	}).
	Exec(ctx)

func (*ReindexCreateBulk) OnConflictColumns

func (_c *ReindexCreateBulk) OnConflictColumns(columns ...string) *ReindexUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Reindex.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ReindexCreateBulk) QueryContext

func (c *ReindexCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexCreateBulk) Save

func (_c *ReindexCreateBulk) Save(ctx context.Context) ([]*Reindex, error)

Save creates the Reindex entities in the database.

func (*ReindexCreateBulk) SaveX

func (_c *ReindexCreateBulk) SaveX(ctx context.Context) []*Reindex

SaveX is like Save, but panics if an error occurs.

type ReindexDelete

type ReindexDelete struct {
	// contains filtered or unexported fields
}

ReindexDelete is the builder for deleting a Reindex entity.

func (*ReindexDelete) Exec

func (_d *ReindexDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ReindexDelete) ExecContext

func (c *ReindexDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexDelete) ExecX

func (_d *ReindexDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ReindexDelete) QueryContext

func (c *ReindexDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexDelete) Where

func (_d *ReindexDelete) Where(ps ...predicate.Reindex) *ReindexDelete

Where appends a list predicates to the ReindexDelete builder.

type ReindexDeleteOne

type ReindexDeleteOne struct {
	// contains filtered or unexported fields
}

ReindexDeleteOne is the builder for deleting a single Reindex entity.

func (*ReindexDeleteOne) Exec

func (_d *ReindexDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReindexDeleteOne) ExecX

func (_d *ReindexDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexDeleteOne) Where

Where appends a list predicates to the ReindexDelete builder.

type ReindexGroupBy

type ReindexGroupBy struct {
	// contains filtered or unexported fields
}

ReindexGroupBy is the group-by builder for Reindex entities.

func (*ReindexGroupBy) Aggregate

func (_g *ReindexGroupBy) Aggregate(fns ...AggregateFunc) *ReindexGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReindexGroupBy) Bool

func (s *ReindexGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) BoolX

func (s *ReindexGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReindexGroupBy) Bools

func (s *ReindexGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) BoolsX

func (s *ReindexGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReindexGroupBy) Float64

func (s *ReindexGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) Float64X

func (s *ReindexGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReindexGroupBy) Float64s

func (s *ReindexGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) Float64sX

func (s *ReindexGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReindexGroupBy) Int

func (s *ReindexGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) IntX

func (s *ReindexGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReindexGroupBy) Ints

func (s *ReindexGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) IntsX

func (s *ReindexGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReindexGroupBy) Scan

func (_g *ReindexGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReindexGroupBy) ScanX

func (s *ReindexGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReindexGroupBy) String

func (s *ReindexGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) StringX

func (s *ReindexGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReindexGroupBy) Strings

func (s *ReindexGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReindexGroupBy) StringsX

func (s *ReindexGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReindexMutation

type ReindexMutation struct {
	// contains filtered or unexported fields
}

ReindexMutation represents an operation that mutates the Reindex nodes in the graph.

func (*ReindexMutation) AddChurn

func (m *ReindexMutation) AddChurn(i int64)

AddChurn adds i to the "churn" field.

func (*ReindexMutation) AddField

func (m *ReindexMutation) 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 (*ReindexMutation) AddedChurn

func (m *ReindexMutation) AddedChurn() (r int64, exists bool)

AddedChurn returns the value that was added to the "churn" field in this mutation.

func (*ReindexMutation) AddedEdges

func (m *ReindexMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReindexMutation) AddedField

func (m *ReindexMutation) 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 (*ReindexMutation) AddedFields

func (m *ReindexMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReindexMutation) AddedIDs

func (m *ReindexMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReindexMutation) Churn

func (m *ReindexMutation) Churn() (r int64, exists bool)

Churn returns the value of the "churn" field in the mutation.

func (*ReindexMutation) ClearEdge

func (m *ReindexMutation) 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 (*ReindexMutation) ClearField

func (m *ReindexMutation) 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 (*ReindexMutation) ClearStatsReset

func (m *ReindexMutation) ClearStatsReset()

ClearStatsReset clears the value of the "stats_reset" field.

func (*ReindexMutation) ClearedEdges

func (m *ReindexMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReindexMutation) ClearedFields

func (m *ReindexMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReindexMutation) Client

func (m ReindexMutation) 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 (*ReindexMutation) EdgeCleared

func (m *ReindexMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReindexMutation) ExecContext

func (c *ReindexMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexMutation) Field

func (m *ReindexMutation) 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 (*ReindexMutation) FieldCleared

func (m *ReindexMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReindexMutation) Fields

func (m *ReindexMutation) 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 (*ReindexMutation) ID

func (m *ReindexMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ReindexMutation) IDs

func (m *ReindexMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ReindexMutation) OldChurn

func (m *ReindexMutation) OldChurn(ctx context.Context) (v int64, err error)

OldChurn returns the old "churn" field's value of the Reindex entity. If the Reindex 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 (*ReindexMutation) OldField

func (m *ReindexMutation) 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 (*ReindexMutation) OldReindexedAt

func (m *ReindexMutation) OldReindexedAt(ctx context.Context) (v time.Time, err error)

OldReindexedAt returns the old "reindexed_at" field's value of the Reindex entity. If the Reindex 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 (*ReindexMutation) OldStatsReset

func (m *ReindexMutation) OldStatsReset(ctx context.Context) (v *time.Time, err error)

OldStatsReset returns the old "stats_reset" field's value of the Reindex entity. If the Reindex 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 (*ReindexMutation) Op

func (m *ReindexMutation) Op() Op

Op returns the operation name.

func (*ReindexMutation) QueryContext

func (c *ReindexMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexMutation) ReindexedAt

func (m *ReindexMutation) ReindexedAt() (r time.Time, exists bool)

ReindexedAt returns the value of the "reindexed_at" field in the mutation.

func (*ReindexMutation) RemovedEdges

func (m *ReindexMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReindexMutation) RemovedIDs

func (m *ReindexMutation) 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 (*ReindexMutation) ResetChurn

func (m *ReindexMutation) ResetChurn()

ResetChurn resets all changes to the "churn" field.

func (*ReindexMutation) ResetEdge

func (m *ReindexMutation) 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 (*ReindexMutation) ResetField

func (m *ReindexMutation) 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 (*ReindexMutation) ResetReindexedAt

func (m *ReindexMutation) ResetReindexedAt()

ResetReindexedAt resets all changes to the "reindexed_at" field.

func (*ReindexMutation) ResetStatsReset

func (m *ReindexMutation) ResetStatsReset()

ResetStatsReset resets all changes to the "stats_reset" field.

func (*ReindexMutation) SetChurn

func (m *ReindexMutation) SetChurn(i int64)

SetChurn sets the "churn" field.

func (*ReindexMutation) SetField

func (m *ReindexMutation) 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 (*ReindexMutation) SetID

func (m *ReindexMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Reindex entities.

func (*ReindexMutation) SetOp

func (m *ReindexMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReindexMutation) SetReindexedAt

func (m *ReindexMutation) SetReindexedAt(t time.Time)

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexMutation) SetStatsReset

func (m *ReindexMutation) SetStatsReset(t time.Time)

SetStatsReset sets the "stats_reset" field.

func (*ReindexMutation) StatsReset

func (m *ReindexMutation) StatsReset() (r time.Time, exists bool)

StatsReset returns the value of the "stats_reset" field in the mutation.

func (*ReindexMutation) StatsResetCleared

func (m *ReindexMutation) StatsResetCleared() bool

StatsResetCleared returns if the "stats_reset" field was cleared in this mutation.

func (ReindexMutation) Tx

func (m ReindexMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReindexMutation) Type

func (m *ReindexMutation) Type() string

Type returns the node type of this mutation (Reindex).

func (*ReindexMutation) Where

func (m *ReindexMutation) Where(ps ...predicate.Reindex)

Where appends a list predicates to the ReindexMutation builder.

func (*ReindexMutation) WhereP

func (m *ReindexMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReindexMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReindexQuery

type ReindexQuery struct {
	// contains filtered or unexported fields
}

ReindexQuery is the builder for querying Reindex entities.

func (*ReindexQuery) Aggregate

func (_q *ReindexQuery) Aggregate(fns ...AggregateFunc) *ReindexSelect

Aggregate returns a ReindexSelect configured with the given aggregations.

func (*ReindexQuery) All

func (_q *ReindexQuery) All(ctx context.Context) ([]*Reindex, error)

All executes the query and returns a list of Reindices.

func (*ReindexQuery) AllX

func (_q *ReindexQuery) AllX(ctx context.Context) []*Reindex

AllX is like All, but panics if an error occurs.

func (*ReindexQuery) Clone

func (_q *ReindexQuery) Clone() *ReindexQuery

Clone returns a duplicate of the ReindexQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReindexQuery) Count

func (_q *ReindexQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReindexQuery) CountX

func (_q *ReindexQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ReindexQuery) ExecContext

func (c *ReindexQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexQuery) Exist

func (_q *ReindexQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ReindexQuery) ExistX

func (_q *ReindexQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ReindexQuery) First

func (_q *ReindexQuery) First(ctx context.Context) (*Reindex, error)

First returns the first Reindex entity from the query. Returns a *NotFoundError when no Reindex was found.

func (*ReindexQuery) FirstID

func (_q *ReindexQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Reindex ID from the query. Returns a *NotFoundError when no Reindex ID was found.

func (*ReindexQuery) FirstIDX

func (_q *ReindexQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*ReindexQuery) FirstX

func (_q *ReindexQuery) FirstX(ctx context.Context) *Reindex

FirstX is like First, but panics if an error occurs.

func (*ReindexQuery) ForShare

func (_q *ReindexQuery) ForShare(opts ...sql.LockOption) *ReindexQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ReindexQuery) ForUpdate

func (_q *ReindexQuery) ForUpdate(opts ...sql.LockOption) *ReindexQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ReindexQuery) GroupBy

func (_q *ReindexQuery) GroupBy(field string, fields ...string) *ReindexGroupBy

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 {
	Churn int64 `json:"churn,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reindex.Query().
	GroupBy(reindex.FieldChurn).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReindexQuery) IDs

func (_q *ReindexQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Reindex IDs.

func (*ReindexQuery) IDsX

func (_q *ReindexQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*ReindexQuery) Limit

func (_q *ReindexQuery) Limit(limit int) *ReindexQuery

Limit the number of records to be returned by this query.

func (*ReindexQuery) Offset

func (_q *ReindexQuery) Offset(offset int) *ReindexQuery

Offset to start from.

func (*ReindexQuery) Only

func (_q *ReindexQuery) Only(ctx context.Context) (*Reindex, error)

Only returns a single Reindex entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Reindex entity is found. Returns a *NotFoundError when no Reindex entities are found.

func (*ReindexQuery) OnlyID

func (_q *ReindexQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Reindex ID in the query. Returns a *NotSingularError when more than one Reindex ID is found. Returns a *NotFoundError when no entities are found.

func (*ReindexQuery) OnlyIDX

func (_q *ReindexQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ReindexQuery) OnlyX

func (_q *ReindexQuery) OnlyX(ctx context.Context) *Reindex

OnlyX is like Only, but panics if an error occurs.

func (*ReindexQuery) Order

func (_q *ReindexQuery) Order(o ...reindex.OrderOption) *ReindexQuery

Order specifies how the records should be ordered.

func (*ReindexQuery) QueryContext

func (c *ReindexQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexQuery) Select

func (_q *ReindexQuery) Select(fields ...string) *ReindexSelect

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 {
	Churn int64 `json:"churn,omitempty"`
}

client.Reindex.Query().
	Select(reindex.FieldChurn).
	Scan(ctx, &v)

func (*ReindexQuery) Unique

func (_q *ReindexQuery) Unique(unique bool) *ReindexQuery

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 (*ReindexQuery) Where

func (_q *ReindexQuery) Where(ps ...predicate.Reindex) *ReindexQuery

Where adds a new predicate for the ReindexQuery builder.

type ReindexSelect

type ReindexSelect struct {
	*ReindexQuery
	// contains filtered or unexported fields
}

ReindexSelect is the builder for selecting fields of Reindex entities.

func (*ReindexSelect) Aggregate

func (_s *ReindexSelect) Aggregate(fns ...AggregateFunc) *ReindexSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReindexSelect) Bool

func (s *ReindexSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) BoolX

func (s *ReindexSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReindexSelect) Bools

func (s *ReindexSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) BoolsX

func (s *ReindexSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (ReindexSelect) ExecContext

func (c ReindexSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexSelect) Float64

func (s *ReindexSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) Float64X

func (s *ReindexSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReindexSelect) Float64s

func (s *ReindexSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) Float64sX

func (s *ReindexSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReindexSelect) Int

func (s *ReindexSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) IntX

func (s *ReindexSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReindexSelect) Ints

func (s *ReindexSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) IntsX

func (s *ReindexSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (ReindexSelect) QueryContext

func (c ReindexSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexSelect) Scan

func (_s *ReindexSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReindexSelect) ScanX

func (s *ReindexSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReindexSelect) String

func (s *ReindexSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) StringX

func (s *ReindexSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReindexSelect) Strings

func (s *ReindexSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReindexSelect) StringsX

func (s *ReindexSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReindexUpdate

type ReindexUpdate struct {
	// contains filtered or unexported fields
}

ReindexUpdate is the builder for updating Reindex entities.

func (*ReindexUpdate) AddChurn

func (_u *ReindexUpdate) AddChurn(v int64) *ReindexUpdate

AddChurn adds value to the "churn" field.

func (*ReindexUpdate) ClearStatsReset

func (_u *ReindexUpdate) ClearStatsReset() *ReindexUpdate

ClearStatsReset clears the value of the "stats_reset" field.

func (*ReindexUpdate) Exec

func (_u *ReindexUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReindexUpdate) ExecContext

func (c *ReindexUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexUpdate) ExecX

func (_u *ReindexUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexUpdate) Mutation

func (_u *ReindexUpdate) Mutation() *ReindexMutation

Mutation returns the ReindexMutation object of the builder.

func (*ReindexUpdate) QueryContext

func (c *ReindexUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexUpdate) Save

func (_u *ReindexUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReindexUpdate) SaveX

func (_u *ReindexUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReindexUpdate) SetChurn

func (_u *ReindexUpdate) SetChurn(v int64) *ReindexUpdate

SetChurn sets the "churn" field.

func (*ReindexUpdate) SetNillableChurn

func (_u *ReindexUpdate) SetNillableChurn(v *int64) *ReindexUpdate

SetNillableChurn sets the "churn" field if the given value is not nil.

func (*ReindexUpdate) SetNillableReindexedAt

func (_u *ReindexUpdate) SetNillableReindexedAt(v *time.Time) *ReindexUpdate

SetNillableReindexedAt sets the "reindexed_at" field if the given value is not nil.

func (*ReindexUpdate) SetNillableStatsReset

func (_u *ReindexUpdate) SetNillableStatsReset(v *time.Time) *ReindexUpdate

SetNillableStatsReset sets the "stats_reset" field if the given value is not nil.

func (*ReindexUpdate) SetReindexedAt

func (_u *ReindexUpdate) SetReindexedAt(v time.Time) *ReindexUpdate

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexUpdate) SetStatsReset

func (_u *ReindexUpdate) SetStatsReset(v time.Time) *ReindexUpdate

SetStatsReset sets the "stats_reset" field.

func (*ReindexUpdate) Where

func (_u *ReindexUpdate) Where(ps ...predicate.Reindex) *ReindexUpdate

Where appends a list predicates to the ReindexUpdate builder.

type ReindexUpdateOne

type ReindexUpdateOne struct {
	// contains filtered or unexported fields
}

ReindexUpdateOne is the builder for updating a single Reindex entity.

func (*ReindexUpdateOne) AddChurn

func (_u *ReindexUpdateOne) AddChurn(v int64) *ReindexUpdateOne

AddChurn adds value to the "churn" field.

func (*ReindexUpdateOne) ClearStatsReset

func (_u *ReindexUpdateOne) ClearStatsReset() *ReindexUpdateOne

ClearStatsReset clears the value of the "stats_reset" field.

func (*ReindexUpdateOne) Exec

func (_u *ReindexUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReindexUpdateOne) ExecContext

func (c *ReindexUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*ReindexUpdateOne) ExecX

func (_u *ReindexUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexUpdateOne) Mutation

func (_u *ReindexUpdateOne) Mutation() *ReindexMutation

Mutation returns the ReindexMutation object of the builder.

func (*ReindexUpdateOne) QueryContext

func (c *ReindexUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*ReindexUpdateOne) Save

func (_u *ReindexUpdateOne) Save(ctx context.Context) (*Reindex, error)

Save executes the query and returns the updated Reindex entity.

func (*ReindexUpdateOne) SaveX

func (_u *ReindexUpdateOne) SaveX(ctx context.Context) *Reindex

SaveX is like Save, but panics if an error occurs.

func (*ReindexUpdateOne) Select

func (_u *ReindexUpdateOne) Select(field string, fields ...string) *ReindexUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReindexUpdateOne) SetChurn

func (_u *ReindexUpdateOne) SetChurn(v int64) *ReindexUpdateOne

SetChurn sets the "churn" field.

func (*ReindexUpdateOne) SetNillableChurn

func (_u *ReindexUpdateOne) SetNillableChurn(v *int64) *ReindexUpdateOne

SetNillableChurn sets the "churn" field if the given value is not nil.

func (*ReindexUpdateOne) SetNillableReindexedAt

func (_u *ReindexUpdateOne) SetNillableReindexedAt(v *time.Time) *ReindexUpdateOne

SetNillableReindexedAt sets the "reindexed_at" field if the given value is not nil.

func (*ReindexUpdateOne) SetNillableStatsReset

func (_u *ReindexUpdateOne) SetNillableStatsReset(v *time.Time) *ReindexUpdateOne

SetNillableStatsReset sets the "stats_reset" field if the given value is not nil.

func (*ReindexUpdateOne) SetReindexedAt

func (_u *ReindexUpdateOne) SetReindexedAt(v time.Time) *ReindexUpdateOne

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexUpdateOne) SetStatsReset

func (_u *ReindexUpdateOne) SetStatsReset(v time.Time) *ReindexUpdateOne

SetStatsReset sets the "stats_reset" field.

func (*ReindexUpdateOne) Where

Where appends a list predicates to the ReindexUpdate builder.

type ReindexUpsert

type ReindexUpsert struct {
	*sql.UpdateSet
}

ReindexUpsert is the "OnConflict" setter.

func (*ReindexUpsert) AddChurn

func (u *ReindexUpsert) AddChurn(v int64) *ReindexUpsert

AddChurn adds v to the "churn" field.

func (*ReindexUpsert) ClearStatsReset

func (u *ReindexUpsert) ClearStatsReset() *ReindexUpsert

ClearStatsReset clears the value of the "stats_reset" field.

func (*ReindexUpsert) SetChurn

func (u *ReindexUpsert) SetChurn(v int64) *ReindexUpsert

SetChurn sets the "churn" field.

func (*ReindexUpsert) SetReindexedAt

func (u *ReindexUpsert) SetReindexedAt(v time.Time) *ReindexUpsert

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexUpsert) SetStatsReset

func (u *ReindexUpsert) SetStatsReset(v time.Time) *ReindexUpsert

SetStatsReset sets the "stats_reset" field.

func (*ReindexUpsert) UpdateChurn

func (u *ReindexUpsert) UpdateChurn() *ReindexUpsert

UpdateChurn sets the "churn" field to the value that was provided on create.

func (*ReindexUpsert) UpdateReindexedAt

func (u *ReindexUpsert) UpdateReindexedAt() *ReindexUpsert

UpdateReindexedAt sets the "reindexed_at" field to the value that was provided on create.

func (*ReindexUpsert) UpdateStatsReset

func (u *ReindexUpsert) UpdateStatsReset() *ReindexUpsert

UpdateStatsReset sets the "stats_reset" field to the value that was provided on create.

type ReindexUpsertBulk

type ReindexUpsertBulk struct {
	// contains filtered or unexported fields
}

ReindexUpsertBulk is the builder for "upsert"-ing a bulk of Reindex nodes.

func (*ReindexUpsertBulk) AddChurn

func (u *ReindexUpsertBulk) AddChurn(v int64) *ReindexUpsertBulk

AddChurn adds v to the "churn" field.

func (*ReindexUpsertBulk) ClearStatsReset

func (u *ReindexUpsertBulk) ClearStatsReset() *ReindexUpsertBulk

ClearStatsReset clears the value of the "stats_reset" field.

func (*ReindexUpsertBulk) DoNothing

func (u *ReindexUpsertBulk) DoNothing() *ReindexUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ReindexUpsertBulk) Exec

func (u *ReindexUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReindexUpsertBulk) ExecX

func (u *ReindexUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexUpsertBulk) Ignore

func (u *ReindexUpsertBulk) Ignore() *ReindexUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Reindex.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ReindexUpsertBulk) SetChurn

func (u *ReindexUpsertBulk) SetChurn(v int64) *ReindexUpsertBulk

SetChurn sets the "churn" field.

func (*ReindexUpsertBulk) SetReindexedAt

func (u *ReindexUpsertBulk) SetReindexedAt(v time.Time) *ReindexUpsertBulk

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexUpsertBulk) SetStatsReset

func (u *ReindexUpsertBulk) SetStatsReset(v time.Time) *ReindexUpsertBulk

SetStatsReset sets the "stats_reset" field.

func (*ReindexUpsertBulk) Update

func (u *ReindexUpsertBulk) Update(set func(*ReindexUpsert)) *ReindexUpsertBulk

Update allows overriding fields `UPDATE` values. See the ReindexCreateBulk.OnConflict documentation for more info.

func (*ReindexUpsertBulk) UpdateChurn

func (u *ReindexUpsertBulk) UpdateChurn() *ReindexUpsertBulk

UpdateChurn sets the "churn" field to the value that was provided on create.

func (*ReindexUpsertBulk) UpdateNewValues

func (u *ReindexUpsertBulk) UpdateNewValues() *ReindexUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Reindex.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(reindex.FieldID)
		}),
	).
	Exec(ctx)

func (*ReindexUpsertBulk) UpdateReindexedAt

func (u *ReindexUpsertBulk) UpdateReindexedAt() *ReindexUpsertBulk

UpdateReindexedAt sets the "reindexed_at" field to the value that was provided on create.

func (*ReindexUpsertBulk) UpdateStatsReset

func (u *ReindexUpsertBulk) UpdateStatsReset() *ReindexUpsertBulk

UpdateStatsReset sets the "stats_reset" field to the value that was provided on create.

type ReindexUpsertOne

type ReindexUpsertOne struct {
	// contains filtered or unexported fields
}

ReindexUpsertOne is the builder for "upsert"-ing

one Reindex node.

func (*ReindexUpsertOne) AddChurn

func (u *ReindexUpsertOne) AddChurn(v int64) *ReindexUpsertOne

AddChurn adds v to the "churn" field.

func (*ReindexUpsertOne) ClearStatsReset

func (u *ReindexUpsertOne) ClearStatsReset() *ReindexUpsertOne

ClearStatsReset clears the value of the "stats_reset" field.

func (*ReindexUpsertOne) DoNothing

func (u *ReindexUpsertOne) DoNothing() *ReindexUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ReindexUpsertOne) Exec

func (u *ReindexUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ReindexUpsertOne) ExecX

func (u *ReindexUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReindexUpsertOne) ID

func (u *ReindexUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ReindexUpsertOne) IDX

func (u *ReindexUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*ReindexUpsertOne) Ignore

func (u *ReindexUpsertOne) Ignore() *ReindexUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Reindex.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ReindexUpsertOne) SetChurn

func (u *ReindexUpsertOne) SetChurn(v int64) *ReindexUpsertOne

SetChurn sets the "churn" field.

func (*ReindexUpsertOne) SetReindexedAt

func (u *ReindexUpsertOne) SetReindexedAt(v time.Time) *ReindexUpsertOne

SetReindexedAt sets the "reindexed_at" field.

func (*ReindexUpsertOne) SetStatsReset

func (u *ReindexUpsertOne) SetStatsReset(v time.Time) *ReindexUpsertOne

SetStatsReset sets the "stats_reset" field.

func (*ReindexUpsertOne) Update

func (u *ReindexUpsertOne) Update(set func(*ReindexUpsert)) *ReindexUpsertOne

Update allows overriding fields `UPDATE` values. See the ReindexCreate.OnConflict documentation for more info.

func (*ReindexUpsertOne) UpdateChurn

func (u *ReindexUpsertOne) UpdateChurn() *ReindexUpsertOne

UpdateChurn sets the "churn" field to the value that was provided on create.

func (*ReindexUpsertOne) UpdateNewValues

func (u *ReindexUpsertOne) UpdateNewValues() *ReindexUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Reindex.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(reindex.FieldID)
		}),
	).
	Exec(ctx)

func (*ReindexUpsertOne) UpdateReindexedAt

func (u *ReindexUpsertOne) UpdateReindexedAt() *ReindexUpsertOne

UpdateReindexedAt sets the "reindexed_at" field to the value that was provided on create.

func (*ReindexUpsertOne) UpdateStatsReset

func (u *ReindexUpsertOne) UpdateStatsReset() *ReindexUpsertOne

UpdateStatsReset sets the "stats_reset" field to the value that was provided on create.

type Reindices

type Reindices []*Reindex

Reindices is a parsable slice of Reindex.

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 Session

type Session struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// AgentID holds the value of the "agent_id" field.
	AgentID string `json:"agent_id,omitempty"`
	// BackupSet holds the value of the "backup_set" field.
	BackupSet string `json:"backup_set,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// LastSeen holds the value of the "last_seen" field.
	LastSeen time.Time `json:"last_seen,omitempty"`
	// RestoreRef holds the value of the "restore_ref" field.
	RestoreRef []byte `json:"restore_ref,omitempty"`
	// InitialRetention holds the value of the "initial_retention" field.
	InitialRetention *retention.Policy `json:"initial_retention,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SessionQuery when eager-loading is set.
	Edges SessionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Session is the model entity for the Session schema.

func (*Session) ExecContext

func (c *Session) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Session) QueryArchives

func (_m *Session) QueryArchives() *ArchiveQuery

QueryArchives queries the "archives" edge of the Session entity.

func (*Session) QueryContext

func (c *Session) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Session) String

func (_m *Session) String() string

String implements the fmt.Stringer.

func (*Session) Unwrap

func (_m *Session) Unwrap() *Session

Unwrap unwraps the Session 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 (*Session) Update

func (_m *Session) Update() *SessionUpdateOne

Update returns a builder for updating this Session. Note that you need to call Session.Unwrap() before calling this method if this Session was returned from a transaction, and the transaction was committed or rolled back.

func (*Session) Value

func (_m *Session) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Session. This includes values selected through modifiers, order, etc.

type SessionClient

type SessionClient struct {
	// contains filtered or unexported fields
}

SessionClient is a client for the Session schema.

func NewSessionClient

func NewSessionClient(c config) *SessionClient

NewSessionClient returns a client for the Session from the given config.

func (*SessionClient) Create

func (c *SessionClient) Create() *SessionCreate

Create returns a builder for creating a Session entity.

func (*SessionClient) CreateBulk

func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk

CreateBulk returns a builder for creating a bulk of Session entities.

func (*SessionClient) Delete

func (c *SessionClient) Delete() *SessionDelete

Delete returns a delete builder for Session.

func (*SessionClient) DeleteOne

func (c *SessionClient) DeleteOne(_m *Session) *SessionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SessionClient) DeleteOneID

func (c *SessionClient) DeleteOneID(id string) *SessionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SessionClient) ExecContext

func (c *SessionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionClient) Get

func (c *SessionClient) Get(ctx context.Context, id string) (*Session, error)

Get returns a Session entity by its id.

func (*SessionClient) GetX

func (c *SessionClient) GetX(ctx context.Context, id string) *Session

GetX is like Get, but panics if an error occurs.

func (*SessionClient) Hooks

func (c *SessionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SessionClient) Intercept

func (c *SessionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `session.Intercept(f(g(h())))`.

func (*SessionClient) Interceptors

func (c *SessionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SessionClient) MapCreateBulk

func (c *SessionClient) MapCreateBulk(slice any, setFunc func(*SessionCreate, int)) *SessionCreateBulk

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 (*SessionClient) Query

func (c *SessionClient) Query() *SessionQuery

Query returns a query builder for Session.

func (*SessionClient) QueryArchives

func (c *SessionClient) QueryArchives(_m *Session) *ArchiveQuery

QueryArchives queries the archives edge of a Session.

func (*SessionClient) QueryContext

func (c *SessionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionClient) Update

func (c *SessionClient) Update() *SessionUpdate

Update returns an update builder for Session.

func (*SessionClient) UpdateOne

func (c *SessionClient) UpdateOne(_m *Session) *SessionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SessionClient) UpdateOneID

func (c *SessionClient) UpdateOneID(id string) *SessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SessionClient) Use

func (c *SessionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `session.Hooks(f(g(h())))`.

type SessionCreate

type SessionCreate struct {
	// contains filtered or unexported fields
}

SessionCreate is the builder for creating a Session entity.

func (*SessionCreate) AddArchiveIDs

func (_c *SessionCreate) AddArchiveIDs(ids ...string) *SessionCreate

AddArchiveIDs adds the "archives" edge to the Archive entity by IDs.

func (*SessionCreate) AddArchives

func (_c *SessionCreate) AddArchives(v ...*Archive) *SessionCreate

AddArchives adds the "archives" edges to the Archive entity.

func (*SessionCreate) Exec

func (_c *SessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreate) ExecContext

func (c *SessionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionCreate) ExecX

func (_c *SessionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionCreate) Mutation

func (_c *SessionCreate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionCreate) OnConflict

func (_c *SessionCreate) OnConflict(opts ...sql.ConflictOption) *SessionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Session.Create().
	SetAgentID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SessionUpsert) {
		SetAgentID(v+v).
	}).
	Exec(ctx)

func (*SessionCreate) OnConflictColumns

func (_c *SessionCreate) OnConflictColumns(columns ...string) *SessionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Session.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SessionCreate) QueryContext

func (c *SessionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionCreate) Save

func (_c *SessionCreate) Save(ctx context.Context) (*Session, error)

Save creates the Session in the database.

func (*SessionCreate) SaveX

func (_c *SessionCreate) SaveX(ctx context.Context) *Session

SaveX calls Save and panics if Save returns an error.

func (*SessionCreate) SetAgentID

func (_c *SessionCreate) SetAgentID(v string) *SessionCreate

SetAgentID sets the "agent_id" field.

func (*SessionCreate) SetBackupSet

func (_c *SessionCreate) SetBackupSet(v string) *SessionCreate

SetBackupSet sets the "backup_set" field.

func (*SessionCreate) SetID

func (_c *SessionCreate) SetID(v string) *SessionCreate

SetID sets the "id" field.

func (*SessionCreate) SetInitialRetention added in v1.65.0

func (_c *SessionCreate) SetInitialRetention(v *retention.Policy) *SessionCreate

SetInitialRetention sets the "initial_retention" field.

func (*SessionCreate) SetLastSeen

func (_c *SessionCreate) SetLastSeen(v time.Time) *SessionCreate

SetLastSeen sets the "last_seen" field.

func (*SessionCreate) SetRestoreRef

func (_c *SessionCreate) SetRestoreRef(v []byte) *SessionCreate

SetRestoreRef sets the "restore_ref" field.

func (*SessionCreate) SetStartedAt

func (_c *SessionCreate) SetStartedAt(v time.Time) *SessionCreate

SetStartedAt sets the "started_at" field.

type SessionCreateBulk

type SessionCreateBulk struct {
	// contains filtered or unexported fields
}

SessionCreateBulk is the builder for creating many Session entities in bulk.

func (*SessionCreateBulk) Exec

func (_c *SessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreateBulk) ExecContext

func (c *SessionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionCreateBulk) ExecX

func (_c *SessionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionCreateBulk) OnConflict

func (_c *SessionCreateBulk) OnConflict(opts ...sql.ConflictOption) *SessionUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Session.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SessionUpsert) {
		SetAgentID(v+v).
	}).
	Exec(ctx)

func (*SessionCreateBulk) OnConflictColumns

func (_c *SessionCreateBulk) OnConflictColumns(columns ...string) *SessionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Session.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SessionCreateBulk) QueryContext

func (c *SessionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionCreateBulk) Save

func (_c *SessionCreateBulk) Save(ctx context.Context) ([]*Session, error)

Save creates the Session entities in the database.

func (*SessionCreateBulk) SaveX

func (_c *SessionCreateBulk) SaveX(ctx context.Context) []*Session

SaveX is like Save, but panics if an error occurs.

type SessionDelete

type SessionDelete struct {
	// contains filtered or unexported fields
}

SessionDelete is the builder for deleting a Session entity.

func (*SessionDelete) Exec

func (_d *SessionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SessionDelete) ExecContext

func (c *SessionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionDelete) ExecX

func (_d *SessionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SessionDelete) QueryContext

func (c *SessionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionDelete) Where

func (_d *SessionDelete) Where(ps ...predicate.Session) *SessionDelete

Where appends a list predicates to the SessionDelete builder.

type SessionDeleteOne

type SessionDeleteOne struct {
	// contains filtered or unexported fields
}

SessionDeleteOne is the builder for deleting a single Session entity.

func (*SessionDeleteOne) Exec

func (_d *SessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SessionDeleteOne) ExecX

func (_d *SessionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionDeleteOne) Where

Where appends a list predicates to the SessionDelete builder.

type SessionEdges

type SessionEdges struct {
	// Archives holds the value of the archives edge.
	Archives []*Archive `json:"archives,omitempty"`
	// contains filtered or unexported fields
}

SessionEdges holds the relations/edges for other nodes in the graph.

func (SessionEdges) ArchivesOrErr

func (e SessionEdges) ArchivesOrErr() ([]*Archive, error)

ArchivesOrErr returns the Archives value or an error if the edge was not loaded in eager-loading.

type SessionGroupBy

type SessionGroupBy struct {
	// contains filtered or unexported fields
}

SessionGroupBy is the group-by builder for Session entities.

func (*SessionGroupBy) Aggregate

func (_g *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SessionGroupBy) Bool

func (s *SessionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) BoolX

func (s *SessionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionGroupBy) Bools

func (s *SessionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) BoolsX

func (s *SessionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SessionGroupBy) Float64

func (s *SessionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) Float64X

func (s *SessionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionGroupBy) Float64s

func (s *SessionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) Float64sX

func (s *SessionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionGroupBy) Int

func (s *SessionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) IntX

func (s *SessionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionGroupBy) Ints

func (s *SessionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) IntsX

func (s *SessionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SessionGroupBy) Scan

func (_g *SessionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SessionGroupBy) ScanX

func (s *SessionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SessionGroupBy) String

func (s *SessionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) StringX

func (s *SessionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionGroupBy) Strings

func (s *SessionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionGroupBy) StringsX

func (s *SessionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionMutation

type SessionMutation struct {
	// contains filtered or unexported fields
}

SessionMutation represents an operation that mutates the Session nodes in the graph.

func (*SessionMutation) AddArchiveIDs

func (m *SessionMutation) AddArchiveIDs(ids ...string)

AddArchiveIDs adds the "archives" edge to the Archive entity by ids.

func (*SessionMutation) AddField

func (m *SessionMutation) 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 (*SessionMutation) AddedEdges

func (m *SessionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SessionMutation) AddedField

func (m *SessionMutation) 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 (*SessionMutation) AddedFields

func (m *SessionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SessionMutation) AddedIDs

func (m *SessionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SessionMutation) AgentID

func (m *SessionMutation) AgentID() (r string, exists bool)

AgentID returns the value of the "agent_id" field in the mutation.

func (*SessionMutation) ArchivesCleared

func (m *SessionMutation) ArchivesCleared() bool

ArchivesCleared reports if the "archives" edge to the Archive entity was cleared.

func (*SessionMutation) ArchivesIDs

func (m *SessionMutation) ArchivesIDs() (ids []string)

ArchivesIDs returns the "archives" edge IDs in the mutation.

func (*SessionMutation) BackupSet

func (m *SessionMutation) BackupSet() (r string, exists bool)

BackupSet returns the value of the "backup_set" field in the mutation.

func (*SessionMutation) ClearArchives

func (m *SessionMutation) ClearArchives()

ClearArchives clears the "archives" edge to the Archive entity.

func (*SessionMutation) ClearEdge

func (m *SessionMutation) 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 (*SessionMutation) ClearField

func (m *SessionMutation) 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 (*SessionMutation) ClearInitialRetention added in v1.65.0

func (m *SessionMutation) ClearInitialRetention()

ClearInitialRetention clears the value of the "initial_retention" field.

func (*SessionMutation) ClearRestoreRef

func (m *SessionMutation) ClearRestoreRef()

ClearRestoreRef clears the value of the "restore_ref" field.

func (*SessionMutation) ClearedEdges

func (m *SessionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SessionMutation) ClearedFields

func (m *SessionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SessionMutation) Client

func (m SessionMutation) 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 (*SessionMutation) EdgeCleared

func (m *SessionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SessionMutation) ExecContext

func (c *SessionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionMutation) Field

func (m *SessionMutation) 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 (*SessionMutation) FieldCleared

func (m *SessionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SessionMutation) Fields

func (m *SessionMutation) 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 (*SessionMutation) ID

func (m *SessionMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SessionMutation) IDs

func (m *SessionMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SessionMutation) InitialRetention added in v1.65.0

func (m *SessionMutation) InitialRetention() (r *retention.Policy, exists bool)

InitialRetention returns the value of the "initial_retention" field in the mutation.

func (*SessionMutation) InitialRetentionCleared added in v1.65.0

func (m *SessionMutation) InitialRetentionCleared() bool

InitialRetentionCleared returns if the "initial_retention" field was cleared in this mutation.

func (*SessionMutation) LastSeen

func (m *SessionMutation) LastSeen() (r time.Time, exists bool)

LastSeen returns the value of the "last_seen" field in the mutation.

func (*SessionMutation) OldAgentID

func (m *SessionMutation) OldAgentID(ctx context.Context) (v string, err error)

OldAgentID returns the old "agent_id" field's value of the Session entity. If the Session 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 (*SessionMutation) OldBackupSet

func (m *SessionMutation) OldBackupSet(ctx context.Context) (v string, err error)

OldBackupSet returns the old "backup_set" field's value of the Session entity. If the Session 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 (*SessionMutation) OldField

func (m *SessionMutation) 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 (*SessionMutation) OldInitialRetention added in v1.65.0

func (m *SessionMutation) OldInitialRetention(ctx context.Context) (v *retention.Policy, err error)

OldInitialRetention returns the old "initial_retention" field's value of the Session entity. If the Session 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 (*SessionMutation) OldLastSeen

func (m *SessionMutation) OldLastSeen(ctx context.Context) (v time.Time, err error)

OldLastSeen returns the old "last_seen" field's value of the Session entity. If the Session 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 (*SessionMutation) OldRestoreRef

func (m *SessionMutation) OldRestoreRef(ctx context.Context) (v []byte, err error)

OldRestoreRef returns the old "restore_ref" field's value of the Session entity. If the Session 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 (*SessionMutation) OldStartedAt

func (m *SessionMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old "started_at" field's value of the Session entity. If the Session 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 (*SessionMutation) Op

func (m *SessionMutation) Op() Op

Op returns the operation name.

func (*SessionMutation) QueryContext

func (c *SessionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionMutation) RemoveArchiveIDs

func (m *SessionMutation) RemoveArchiveIDs(ids ...string)

RemoveArchiveIDs removes the "archives" edge to the Archive entity by IDs.

func (*SessionMutation) RemovedArchivesIDs

func (m *SessionMutation) RemovedArchivesIDs() (ids []string)

RemovedArchives returns the removed IDs of the "archives" edge to the Archive entity.

func (*SessionMutation) RemovedEdges

func (m *SessionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SessionMutation) RemovedIDs

func (m *SessionMutation) 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 (*SessionMutation) ResetAgentID

func (m *SessionMutation) ResetAgentID()

ResetAgentID resets all changes to the "agent_id" field.

func (*SessionMutation) ResetArchives

func (m *SessionMutation) ResetArchives()

ResetArchives resets all changes to the "archives" edge.

func (*SessionMutation) ResetBackupSet

func (m *SessionMutation) ResetBackupSet()

ResetBackupSet resets all changes to the "backup_set" field.

func (*SessionMutation) ResetEdge

func (m *SessionMutation) 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 (*SessionMutation) ResetField

func (m *SessionMutation) 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 (*SessionMutation) ResetInitialRetention added in v1.65.0

func (m *SessionMutation) ResetInitialRetention()

ResetInitialRetention resets all changes to the "initial_retention" field.

func (*SessionMutation) ResetLastSeen

func (m *SessionMutation) ResetLastSeen()

ResetLastSeen resets all changes to the "last_seen" field.

func (*SessionMutation) ResetRestoreRef

func (m *SessionMutation) ResetRestoreRef()

ResetRestoreRef resets all changes to the "restore_ref" field.

func (*SessionMutation) ResetStartedAt

func (m *SessionMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*SessionMutation) RestoreRef

func (m *SessionMutation) RestoreRef() (r []byte, exists bool)

RestoreRef returns the value of the "restore_ref" field in the mutation.

func (*SessionMutation) RestoreRefCleared

func (m *SessionMutation) RestoreRefCleared() bool

RestoreRefCleared returns if the "restore_ref" field was cleared in this mutation.

func (*SessionMutation) SetAgentID

func (m *SessionMutation) SetAgentID(s string)

SetAgentID sets the "agent_id" field.

func (*SessionMutation) SetBackupSet

func (m *SessionMutation) SetBackupSet(s string)

SetBackupSet sets the "backup_set" field.

func (*SessionMutation) SetField

func (m *SessionMutation) 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 (*SessionMutation) SetID

func (m *SessionMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Session entities.

func (*SessionMutation) SetInitialRetention added in v1.65.0

func (m *SessionMutation) SetInitialRetention(r *retention.Policy)

SetInitialRetention sets the "initial_retention" field.

func (*SessionMutation) SetLastSeen

func (m *SessionMutation) SetLastSeen(t time.Time)

SetLastSeen sets the "last_seen" field.

func (*SessionMutation) SetOp

func (m *SessionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SessionMutation) SetRestoreRef

func (m *SessionMutation) SetRestoreRef(b []byte)

SetRestoreRef sets the "restore_ref" field.

func (*SessionMutation) SetStartedAt

func (m *SessionMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*SessionMutation) StartedAt

func (m *SessionMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (SessionMutation) Tx

func (m SessionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SessionMutation) Type

func (m *SessionMutation) Type() string

Type returns the node type of this mutation (Session).

func (*SessionMutation) Where

func (m *SessionMutation) Where(ps ...predicate.Session)

Where appends a list predicates to the SessionMutation builder.

func (*SessionMutation) WhereP

func (m *SessionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SessionQuery

type SessionQuery struct {
	// contains filtered or unexported fields
}

SessionQuery is the builder for querying Session entities.

func (*SessionQuery) Aggregate

func (_q *SessionQuery) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate returns a SessionSelect configured with the given aggregations.

func (*SessionQuery) All

func (_q *SessionQuery) All(ctx context.Context) ([]*Session, error)

All executes the query and returns a list of Sessions.

func (*SessionQuery) AllX

func (_q *SessionQuery) AllX(ctx context.Context) []*Session

AllX is like All, but panics if an error occurs.

func (*SessionQuery) Clone

func (_q *SessionQuery) Clone() *SessionQuery

Clone returns a duplicate of the SessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SessionQuery) Count

func (_q *SessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SessionQuery) CountX

func (_q *SessionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SessionQuery) ExecContext

func (c *SessionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionQuery) Exist

func (_q *SessionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SessionQuery) ExistX

func (_q *SessionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SessionQuery) First

func (_q *SessionQuery) First(ctx context.Context) (*Session, error)

First returns the first Session entity from the query. Returns a *NotFoundError when no Session was found.

func (*SessionQuery) FirstID

func (_q *SessionQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Session ID from the query. Returns a *NotFoundError when no Session ID was found.

func (*SessionQuery) FirstIDX

func (_q *SessionQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*SessionQuery) FirstX

func (_q *SessionQuery) FirstX(ctx context.Context) *Session

FirstX is like First, but panics if an error occurs.

func (*SessionQuery) ForShare

func (_q *SessionQuery) ForShare(opts ...sql.LockOption) *SessionQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*SessionQuery) ForUpdate

func (_q *SessionQuery) ForUpdate(opts ...sql.LockOption) *SessionQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*SessionQuery) GroupBy

func (_q *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy

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 {
	AgentID string `json:"agent_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Session.Query().
	GroupBy(session.FieldAgentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SessionQuery) IDs

func (_q *SessionQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Session IDs.

func (*SessionQuery) IDsX

func (_q *SessionQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*SessionQuery) Limit

func (_q *SessionQuery) Limit(limit int) *SessionQuery

Limit the number of records to be returned by this query.

func (*SessionQuery) Offset

func (_q *SessionQuery) Offset(offset int) *SessionQuery

Offset to start from.

func (*SessionQuery) Only

func (_q *SessionQuery) Only(ctx context.Context) (*Session, error)

Only returns a single Session entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Session entity is found. Returns a *NotFoundError when no Session entities are found.

func (*SessionQuery) OnlyID

func (_q *SessionQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Session ID in the query. Returns a *NotSingularError when more than one Session ID is found. Returns a *NotFoundError when no entities are found.

func (*SessionQuery) OnlyIDX

func (_q *SessionQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SessionQuery) OnlyX

func (_q *SessionQuery) OnlyX(ctx context.Context) *Session

OnlyX is like Only, but panics if an error occurs.

func (*SessionQuery) Order

func (_q *SessionQuery) Order(o ...session.OrderOption) *SessionQuery

Order specifies how the records should be ordered.

func (*SessionQuery) QueryArchives

func (_q *SessionQuery) QueryArchives() *ArchiveQuery

QueryArchives chains the current query on the "archives" edge.

func (*SessionQuery) QueryContext

func (c *SessionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionQuery) Select

func (_q *SessionQuery) Select(fields ...string) *SessionSelect

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 {
	AgentID string `json:"agent_id,omitempty"`
}

client.Session.Query().
	Select(session.FieldAgentID).
	Scan(ctx, &v)

func (*SessionQuery) Unique

func (_q *SessionQuery) Unique(unique bool) *SessionQuery

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 (*SessionQuery) Where

func (_q *SessionQuery) Where(ps ...predicate.Session) *SessionQuery

Where adds a new predicate for the SessionQuery builder.

func (*SessionQuery) WithArchives

func (_q *SessionQuery) WithArchives(opts ...func(*ArchiveQuery)) *SessionQuery

WithArchives tells the query-builder to eager-load the nodes that are connected to the "archives" edge. The optional arguments are used to configure the query builder of the edge.

type SessionSelect

type SessionSelect struct {
	*SessionQuery
	// contains filtered or unexported fields
}

SessionSelect is the builder for selecting fields of Session entities.

func (*SessionSelect) Aggregate

func (_s *SessionSelect) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SessionSelect) Bool

func (s *SessionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolX

func (s *SessionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionSelect) Bools

func (s *SessionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolsX

func (s *SessionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (SessionSelect) ExecContext

func (c SessionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionSelect) Float64

func (s *SessionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64X

func (s *SessionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionSelect) Float64s

func (s *SessionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64sX

func (s *SessionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionSelect) Int

func (s *SessionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntX

func (s *SessionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionSelect) Ints

func (s *SessionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntsX

func (s *SessionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (SessionSelect) QueryContext

func (c SessionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionSelect) Scan

func (_s *SessionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SessionSelect) ScanX

func (s *SessionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SessionSelect) String

func (s *SessionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringX

func (s *SessionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionSelect) Strings

func (s *SessionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringsX

func (s *SessionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionUpdate

type SessionUpdate struct {
	// contains filtered or unexported fields
}

SessionUpdate is the builder for updating Session entities.

func (*SessionUpdate) AddArchiveIDs

func (_u *SessionUpdate) AddArchiveIDs(ids ...string) *SessionUpdate

AddArchiveIDs adds the "archives" edge to the Archive entity by IDs.

func (*SessionUpdate) AddArchives

func (_u *SessionUpdate) AddArchives(v ...*Archive) *SessionUpdate

AddArchives adds the "archives" edges to the Archive entity.

func (*SessionUpdate) ClearArchives

func (_u *SessionUpdate) ClearArchives() *SessionUpdate

ClearArchives clears all "archives" edges to the Archive entity.

func (*SessionUpdate) ClearInitialRetention added in v1.65.0

func (_u *SessionUpdate) ClearInitialRetention() *SessionUpdate

ClearInitialRetention clears the value of the "initial_retention" field.

func (*SessionUpdate) ClearRestoreRef

func (_u *SessionUpdate) ClearRestoreRef() *SessionUpdate

ClearRestoreRef clears the value of the "restore_ref" field.

func (*SessionUpdate) Exec

func (_u *SessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpdate) ExecContext

func (c *SessionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionUpdate) ExecX

func (_u *SessionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdate) Mutation

func (_u *SessionUpdate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdate) QueryContext

func (c *SessionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionUpdate) RemoveArchiveIDs

func (_u *SessionUpdate) RemoveArchiveIDs(ids ...string) *SessionUpdate

RemoveArchiveIDs removes the "archives" edge to Archive entities by IDs.

func (*SessionUpdate) RemoveArchives

func (_u *SessionUpdate) RemoveArchives(v ...*Archive) *SessionUpdate

RemoveArchives removes "archives" edges to Archive entities.

func (*SessionUpdate) Save

func (_u *SessionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SessionUpdate) SaveX

func (_u *SessionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdate) SetAgentID

func (_u *SessionUpdate) SetAgentID(v string) *SessionUpdate

SetAgentID sets the "agent_id" field.

func (*SessionUpdate) SetBackupSet

func (_u *SessionUpdate) SetBackupSet(v string) *SessionUpdate

SetBackupSet sets the "backup_set" field.

func (*SessionUpdate) SetInitialRetention added in v1.65.0

func (_u *SessionUpdate) SetInitialRetention(v *retention.Policy) *SessionUpdate

SetInitialRetention sets the "initial_retention" field.

func (*SessionUpdate) SetLastSeen

func (_u *SessionUpdate) SetLastSeen(v time.Time) *SessionUpdate

SetLastSeen sets the "last_seen" field.

func (*SessionUpdate) SetNillableAgentID

func (_u *SessionUpdate) SetNillableAgentID(v *string) *SessionUpdate

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*SessionUpdate) SetNillableBackupSet

func (_u *SessionUpdate) SetNillableBackupSet(v *string) *SessionUpdate

SetNillableBackupSet sets the "backup_set" field if the given value is not nil.

func (*SessionUpdate) SetNillableLastSeen

func (_u *SessionUpdate) SetNillableLastSeen(v *time.Time) *SessionUpdate

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*SessionUpdate) SetNillableStartedAt

func (_u *SessionUpdate) SetNillableStartedAt(v *time.Time) *SessionUpdate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*SessionUpdate) SetRestoreRef

func (_u *SessionUpdate) SetRestoreRef(v []byte) *SessionUpdate

SetRestoreRef sets the "restore_ref" field.

func (*SessionUpdate) SetStartedAt

func (_u *SessionUpdate) SetStartedAt(v time.Time) *SessionUpdate

SetStartedAt sets the "started_at" field.

func (*SessionUpdate) Where

func (_u *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate

Where appends a list predicates to the SessionUpdate builder.

type SessionUpdateOne

type SessionUpdateOne struct {
	// contains filtered or unexported fields
}

SessionUpdateOne is the builder for updating a single Session entity.

func (*SessionUpdateOne) AddArchiveIDs

func (_u *SessionUpdateOne) AddArchiveIDs(ids ...string) *SessionUpdateOne

AddArchiveIDs adds the "archives" edge to the Archive entity by IDs.

func (*SessionUpdateOne) AddArchives

func (_u *SessionUpdateOne) AddArchives(v ...*Archive) *SessionUpdateOne

AddArchives adds the "archives" edges to the Archive entity.

func (*SessionUpdateOne) ClearArchives

func (_u *SessionUpdateOne) ClearArchives() *SessionUpdateOne

ClearArchives clears all "archives" edges to the Archive entity.

func (*SessionUpdateOne) ClearInitialRetention added in v1.65.0

func (_u *SessionUpdateOne) ClearInitialRetention() *SessionUpdateOne

ClearInitialRetention clears the value of the "initial_retention" field.

func (*SessionUpdateOne) ClearRestoreRef

func (_u *SessionUpdateOne) ClearRestoreRef() *SessionUpdateOne

ClearRestoreRef clears the value of the "restore_ref" field.

func (*SessionUpdateOne) Exec

func (_u *SessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SessionUpdateOne) ExecContext

func (c *SessionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SessionUpdateOne) ExecX

func (_u *SessionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdateOne) Mutation

func (_u *SessionUpdateOne) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdateOne) QueryContext

func (c *SessionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SessionUpdateOne) RemoveArchiveIDs

func (_u *SessionUpdateOne) RemoveArchiveIDs(ids ...string) *SessionUpdateOne

RemoveArchiveIDs removes the "archives" edge to Archive entities by IDs.

func (*SessionUpdateOne) RemoveArchives

func (_u *SessionUpdateOne) RemoveArchives(v ...*Archive) *SessionUpdateOne

RemoveArchives removes "archives" edges to Archive entities.

func (*SessionUpdateOne) Save

func (_u *SessionUpdateOne) Save(ctx context.Context) (*Session, error)

Save executes the query and returns the updated Session entity.

func (*SessionUpdateOne) SaveX

func (_u *SessionUpdateOne) SaveX(ctx context.Context) *Session

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdateOne) Select

func (_u *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SessionUpdateOne) SetAgentID

func (_u *SessionUpdateOne) SetAgentID(v string) *SessionUpdateOne

SetAgentID sets the "agent_id" field.

func (*SessionUpdateOne) SetBackupSet

func (_u *SessionUpdateOne) SetBackupSet(v string) *SessionUpdateOne

SetBackupSet sets the "backup_set" field.

func (*SessionUpdateOne) SetInitialRetention added in v1.65.0

func (_u *SessionUpdateOne) SetInitialRetention(v *retention.Policy) *SessionUpdateOne

SetInitialRetention sets the "initial_retention" field.

func (*SessionUpdateOne) SetLastSeen

func (_u *SessionUpdateOne) SetLastSeen(v time.Time) *SessionUpdateOne

SetLastSeen sets the "last_seen" field.

func (*SessionUpdateOne) SetNillableAgentID

func (_u *SessionUpdateOne) SetNillableAgentID(v *string) *SessionUpdateOne

SetNillableAgentID sets the "agent_id" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableBackupSet

func (_u *SessionUpdateOne) SetNillableBackupSet(v *string) *SessionUpdateOne

SetNillableBackupSet sets the "backup_set" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableLastSeen

func (_u *SessionUpdateOne) SetNillableLastSeen(v *time.Time) *SessionUpdateOne

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableStartedAt

func (_u *SessionUpdateOne) SetNillableStartedAt(v *time.Time) *SessionUpdateOne

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*SessionUpdateOne) SetRestoreRef

func (_u *SessionUpdateOne) SetRestoreRef(v []byte) *SessionUpdateOne

SetRestoreRef sets the "restore_ref" field.

func (*SessionUpdateOne) SetStartedAt

func (_u *SessionUpdateOne) SetStartedAt(v time.Time) *SessionUpdateOne

SetStartedAt sets the "started_at" field.

func (*SessionUpdateOne) Where

Where appends a list predicates to the SessionUpdate builder.

type SessionUpsert

type SessionUpsert struct {
	*sql.UpdateSet
}

SessionUpsert is the "OnConflict" setter.

func (*SessionUpsert) ClearInitialRetention added in v1.65.0

func (u *SessionUpsert) ClearInitialRetention() *SessionUpsert

ClearInitialRetention clears the value of the "initial_retention" field.

func (*SessionUpsert) ClearRestoreRef

func (u *SessionUpsert) ClearRestoreRef() *SessionUpsert

ClearRestoreRef clears the value of the "restore_ref" field.

func (*SessionUpsert) SetAgentID

func (u *SessionUpsert) SetAgentID(v string) *SessionUpsert

SetAgentID sets the "agent_id" field.

func (*SessionUpsert) SetBackupSet

func (u *SessionUpsert) SetBackupSet(v string) *SessionUpsert

SetBackupSet sets the "backup_set" field.

func (*SessionUpsert) SetInitialRetention added in v1.65.0

func (u *SessionUpsert) SetInitialRetention(v *retention.Policy) *SessionUpsert

SetInitialRetention sets the "initial_retention" field.

func (*SessionUpsert) SetLastSeen

func (u *SessionUpsert) SetLastSeen(v time.Time) *SessionUpsert

SetLastSeen sets the "last_seen" field.

func (*SessionUpsert) SetRestoreRef

func (u *SessionUpsert) SetRestoreRef(v []byte) *SessionUpsert

SetRestoreRef sets the "restore_ref" field.

func (*SessionUpsert) SetStartedAt

func (u *SessionUpsert) SetStartedAt(v time.Time) *SessionUpsert

SetStartedAt sets the "started_at" field.

func (*SessionUpsert) UpdateAgentID

func (u *SessionUpsert) UpdateAgentID() *SessionUpsert

UpdateAgentID sets the "agent_id" field to the value that was provided on create.

func (*SessionUpsert) UpdateBackupSet

func (u *SessionUpsert) UpdateBackupSet() *SessionUpsert

UpdateBackupSet sets the "backup_set" field to the value that was provided on create.

func (*SessionUpsert) UpdateInitialRetention added in v1.65.0

func (u *SessionUpsert) UpdateInitialRetention() *SessionUpsert

UpdateInitialRetention sets the "initial_retention" field to the value that was provided on create.

func (*SessionUpsert) UpdateLastSeen

func (u *SessionUpsert) UpdateLastSeen() *SessionUpsert

UpdateLastSeen sets the "last_seen" field to the value that was provided on create.

func (*SessionUpsert) UpdateRestoreRef

func (u *SessionUpsert) UpdateRestoreRef() *SessionUpsert

UpdateRestoreRef sets the "restore_ref" field to the value that was provided on create.

func (*SessionUpsert) UpdateStartedAt

func (u *SessionUpsert) UpdateStartedAt() *SessionUpsert

UpdateStartedAt sets the "started_at" field to the value that was provided on create.

type SessionUpsertBulk

type SessionUpsertBulk struct {
	// contains filtered or unexported fields
}

SessionUpsertBulk is the builder for "upsert"-ing a bulk of Session nodes.

func (*SessionUpsertBulk) ClearInitialRetention added in v1.65.0

func (u *SessionUpsertBulk) ClearInitialRetention() *SessionUpsertBulk

ClearInitialRetention clears the value of the "initial_retention" field.

func (*SessionUpsertBulk) ClearRestoreRef

func (u *SessionUpsertBulk) ClearRestoreRef() *SessionUpsertBulk

ClearRestoreRef clears the value of the "restore_ref" field.

func (*SessionUpsertBulk) DoNothing

func (u *SessionUpsertBulk) DoNothing() *SessionUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SessionUpsertBulk) Exec

func (u *SessionUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpsertBulk) ExecX

func (u *SessionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpsertBulk) Ignore

func (u *SessionUpsertBulk) Ignore() *SessionUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Session.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SessionUpsertBulk) SetAgentID

func (u *SessionUpsertBulk) SetAgentID(v string) *SessionUpsertBulk

SetAgentID sets the "agent_id" field.

func (*SessionUpsertBulk) SetBackupSet

func (u *SessionUpsertBulk) SetBackupSet(v string) *SessionUpsertBulk

SetBackupSet sets the "backup_set" field.

func (*SessionUpsertBulk) SetInitialRetention added in v1.65.0

func (u *SessionUpsertBulk) SetInitialRetention(v *retention.Policy) *SessionUpsertBulk

SetInitialRetention sets the "initial_retention" field.

func (*SessionUpsertBulk) SetLastSeen

func (u *SessionUpsertBulk) SetLastSeen(v time.Time) *SessionUpsertBulk

SetLastSeen sets the "last_seen" field.

func (*SessionUpsertBulk) SetRestoreRef

func (u *SessionUpsertBulk) SetRestoreRef(v []byte) *SessionUpsertBulk

SetRestoreRef sets the "restore_ref" field.

func (*SessionUpsertBulk) SetStartedAt

func (u *SessionUpsertBulk) SetStartedAt(v time.Time) *SessionUpsertBulk

SetStartedAt sets the "started_at" field.

func (*SessionUpsertBulk) Update

func (u *SessionUpsertBulk) Update(set func(*SessionUpsert)) *SessionUpsertBulk

Update allows overriding fields `UPDATE` values. See the SessionCreateBulk.OnConflict documentation for more info.

func (*SessionUpsertBulk) UpdateAgentID

func (u *SessionUpsertBulk) UpdateAgentID() *SessionUpsertBulk

UpdateAgentID sets the "agent_id" field to the value that was provided on create.

func (*SessionUpsertBulk) UpdateBackupSet

func (u *SessionUpsertBulk) UpdateBackupSet() *SessionUpsertBulk

UpdateBackupSet sets the "backup_set" field to the value that was provided on create.

func (*SessionUpsertBulk) UpdateInitialRetention added in v1.65.0

func (u *SessionUpsertBulk) UpdateInitialRetention() *SessionUpsertBulk

UpdateInitialRetention sets the "initial_retention" field to the value that was provided on create.

func (*SessionUpsertBulk) UpdateLastSeen

func (u *SessionUpsertBulk) UpdateLastSeen() *SessionUpsertBulk

UpdateLastSeen sets the "last_seen" field to the value that was provided on create.

func (*SessionUpsertBulk) UpdateNewValues

func (u *SessionUpsertBulk) UpdateNewValues() *SessionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Session.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(session.FieldID)
		}),
	).
	Exec(ctx)

func (*SessionUpsertBulk) UpdateRestoreRef

func (u *SessionUpsertBulk) UpdateRestoreRef() *SessionUpsertBulk

UpdateRestoreRef sets the "restore_ref" field to the value that was provided on create.

func (*SessionUpsertBulk) UpdateStartedAt

func (u *SessionUpsertBulk) UpdateStartedAt() *SessionUpsertBulk

UpdateStartedAt sets the "started_at" field to the value that was provided on create.

type SessionUpsertOne

type SessionUpsertOne struct {
	// contains filtered or unexported fields
}

SessionUpsertOne is the builder for "upsert"-ing

one Session node.

func (*SessionUpsertOne) ClearInitialRetention added in v1.65.0

func (u *SessionUpsertOne) ClearInitialRetention() *SessionUpsertOne

ClearInitialRetention clears the value of the "initial_retention" field.

func (*SessionUpsertOne) ClearRestoreRef

func (u *SessionUpsertOne) ClearRestoreRef() *SessionUpsertOne

ClearRestoreRef clears the value of the "restore_ref" field.

func (*SessionUpsertOne) DoNothing

func (u *SessionUpsertOne) DoNothing() *SessionUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SessionUpsertOne) Exec

func (u *SessionUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpsertOne) ExecX

func (u *SessionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpsertOne) ID

func (u *SessionUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SessionUpsertOne) IDX

func (u *SessionUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*SessionUpsertOne) Ignore

func (u *SessionUpsertOne) Ignore() *SessionUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Session.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SessionUpsertOne) SetAgentID

func (u *SessionUpsertOne) SetAgentID(v string) *SessionUpsertOne

SetAgentID sets the "agent_id" field.

func (*SessionUpsertOne) SetBackupSet

func (u *SessionUpsertOne) SetBackupSet(v string) *SessionUpsertOne

SetBackupSet sets the "backup_set" field.

func (*SessionUpsertOne) SetInitialRetention added in v1.65.0

func (u *SessionUpsertOne) SetInitialRetention(v *retention.Policy) *SessionUpsertOne

SetInitialRetention sets the "initial_retention" field.

func (*SessionUpsertOne) SetLastSeen

func (u *SessionUpsertOne) SetLastSeen(v time.Time) *SessionUpsertOne

SetLastSeen sets the "last_seen" field.

func (*SessionUpsertOne) SetRestoreRef

func (u *SessionUpsertOne) SetRestoreRef(v []byte) *SessionUpsertOne

SetRestoreRef sets the "restore_ref" field.

func (*SessionUpsertOne) SetStartedAt

func (u *SessionUpsertOne) SetStartedAt(v time.Time) *SessionUpsertOne

SetStartedAt sets the "started_at" field.

func (*SessionUpsertOne) Update

func (u *SessionUpsertOne) Update(set func(*SessionUpsert)) *SessionUpsertOne

Update allows overriding fields `UPDATE` values. See the SessionCreate.OnConflict documentation for more info.

func (*SessionUpsertOne) UpdateAgentID

func (u *SessionUpsertOne) UpdateAgentID() *SessionUpsertOne

UpdateAgentID sets the "agent_id" field to the value that was provided on create.

func (*SessionUpsertOne) UpdateBackupSet

func (u *SessionUpsertOne) UpdateBackupSet() *SessionUpsertOne

UpdateBackupSet sets the "backup_set" field to the value that was provided on create.

func (*SessionUpsertOne) UpdateInitialRetention added in v1.65.0

func (u *SessionUpsertOne) UpdateInitialRetention() *SessionUpsertOne

UpdateInitialRetention sets the "initial_retention" field to the value that was provided on create.

func (*SessionUpsertOne) UpdateLastSeen

func (u *SessionUpsertOne) UpdateLastSeen() *SessionUpsertOne

UpdateLastSeen sets the "last_seen" field to the value that was provided on create.

func (*SessionUpsertOne) UpdateNewValues

func (u *SessionUpsertOne) UpdateNewValues() *SessionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Session.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(session.FieldID)
		}),
	).
	Exec(ctx)

func (*SessionUpsertOne) UpdateRestoreRef

func (u *SessionUpsertOne) UpdateRestoreRef() *SessionUpsertOne

UpdateRestoreRef sets the "restore_ref" field to the value that was provided on create.

func (*SessionUpsertOne) UpdateStartedAt

func (u *SessionUpsertOne) UpdateStartedAt() *SessionUpsertOne

UpdateStartedAt sets the "started_at" field to the value that was provided on create.

type Sessions

type Sessions []*Session

Sessions is a parsable slice of Session.

type Set

type Set struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// State holds the value of the "state" field.
	State set.State `json:"state,omitempty"`
	// RetentionPolicy holds the value of the "retention_policy" field.
	RetentionPolicy *string `json:"retention_policy,omitempty"`
	// RetentionPaused holds the value of the "retention_paused" field.
	RetentionPaused bool `json:"retention_paused,omitempty"`
	// Erase holds the value of the "erase" field.
	Erase bool `json:"erase,omitempty"`
	// Rescan holds the value of the "rescan" field.
	Rescan bool `json:"rescan,omitempty"`
	// PhysicalSize holds the value of the "physical_size" field.
	PhysicalSize *int64 `json:"physical_size,omitempty"`
	// DeduplicatedSize holds the value of the "deduplicated_size" field.
	DeduplicatedSize *int64 `json:"deduplicated_size,omitempty"`
	// AloneSize holds the value of the "alone_size" field.
	AloneSize *int64 `json:"alone_size,omitempty"`
	// ExclusiveSize holds the value of the "exclusive_size" field.
	ExclusiveSize *int64 `json:"exclusive_size,omitempty"`
	// DeduplicatedAloneSize holds the value of the "deduplicated_alone_size" field.
	DeduplicatedAloneSize *int64 `json:"deduplicated_alone_size,omitempty"`
	// LogicalSize holds the value of the "logical_size" field.
	LogicalSize *int64 `json:"logical_size,omitempty"`
	// KeptLogicalSize holds the value of the "kept_logical_size" field.
	KeptLogicalSize *int64 `json:"kept_logical_size,omitempty"`
	// UniqueSize holds the value of the "unique_size" field.
	UniqueSize *int64 `json:"unique_size,omitempty"`
	// SizesDigest holds the value of the "sizes_digest" field.
	SizesDigest []byte `json:"sizes_digest,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SetQuery when eager-loading is set.
	Edges SetEdges `json:"edges"`
	// contains filtered or unexported fields
}

Set is the model entity for the Set schema.

func (*Set) ExecContext

func (c *Set) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Set) QueryContext

func (c *Set) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Set) QueryDamaged

func (_m *Set) QueryDamaged() *DamagedPathQuery

QueryDamaged queries the "damaged" edge of the Set entity.

func (*Set) QueryFiles

func (_m *Set) QueryFiles() *FileQuery

QueryFiles queries the "files" edge of the Set entity.

func (*Set) QueryRefs

func (_m *Set) QueryRefs() *SetRefQuery

QueryRefs queries the "refs" edge of the Set entity.

func (*Set) QueryTrees

func (_m *Set) QueryTrees() *TreeQuery

QueryTrees queries the "trees" edge of the Set entity.

func (*Set) String

func (_m *Set) String() string

String implements the fmt.Stringer.

func (*Set) Unwrap

func (_m *Set) Unwrap() *Set

Unwrap unwraps the Set 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 (*Set) Update

func (_m *Set) Update() *SetUpdateOne

Update returns a builder for updating this Set. Note that you need to call Set.Unwrap() before calling this method if this Set was returned from a transaction, and the transaction was committed or rolled back.

func (*Set) Value

func (_m *Set) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Set. This includes values selected through modifiers, order, etc.

type SetClient

type SetClient struct {
	// contains filtered or unexported fields
}

SetClient is a client for the Set schema.

func NewSetClient

func NewSetClient(c config) *SetClient

NewSetClient returns a client for the Set from the given config.

func (*SetClient) Create

func (c *SetClient) Create() *SetCreate

Create returns a builder for creating a Set entity.

func (*SetClient) CreateBulk

func (c *SetClient) CreateBulk(builders ...*SetCreate) *SetCreateBulk

CreateBulk returns a builder for creating a bulk of Set entities.

func (*SetClient) Delete

func (c *SetClient) Delete() *SetDelete

Delete returns a delete builder for Set.

func (*SetClient) DeleteOne

func (c *SetClient) DeleteOne(_m *Set) *SetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SetClient) DeleteOneID

func (c *SetClient) DeleteOneID(id int64) *SetDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SetClient) ExecContext

func (c *SetClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetClient) Get

func (c *SetClient) Get(ctx context.Context, id int64) (*Set, error)

Get returns a Set entity by its id.

func (*SetClient) GetX

func (c *SetClient) GetX(ctx context.Context, id int64) *Set

GetX is like Get, but panics if an error occurs.

func (*SetClient) Hooks

func (c *SetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SetClient) Intercept

func (c *SetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `set.Intercept(f(g(h())))`.

func (*SetClient) Interceptors

func (c *SetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SetClient) MapCreateBulk

func (c *SetClient) MapCreateBulk(slice any, setFunc func(*SetCreate, int)) *SetCreateBulk

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 (*SetClient) Query

func (c *SetClient) Query() *SetQuery

Query returns a query builder for Set.

func (*SetClient) QueryContext

func (c *SetClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetClient) QueryDamaged

func (c *SetClient) QueryDamaged(_m *Set) *DamagedPathQuery

QueryDamaged queries the damaged edge of a Set.

func (*SetClient) QueryFiles

func (c *SetClient) QueryFiles(_m *Set) *FileQuery

QueryFiles queries the files edge of a Set.

func (*SetClient) QueryRefs

func (c *SetClient) QueryRefs(_m *Set) *SetRefQuery

QueryRefs queries the refs edge of a Set.

func (*SetClient) QueryTrees

func (c *SetClient) QueryTrees(_m *Set) *TreeQuery

QueryTrees queries the trees edge of a Set.

func (*SetClient) Update

func (c *SetClient) Update() *SetUpdate

Update returns an update builder for Set.

func (*SetClient) UpdateOne

func (c *SetClient) UpdateOne(_m *Set) *SetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SetClient) UpdateOneID

func (c *SetClient) UpdateOneID(id int64) *SetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SetClient) Use

func (c *SetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `set.Hooks(f(g(h())))`.

type SetCreate

type SetCreate struct {
	// contains filtered or unexported fields
}

SetCreate is the builder for creating a Set entity.

func (*SetCreate) AddDamaged

func (_c *SetCreate) AddDamaged(v ...*DamagedPath) *SetCreate

AddDamaged adds the "damaged" edges to the DamagedPath entity.

func (*SetCreate) AddDamagedIDs

func (_c *SetCreate) AddDamagedIDs(ids ...int) *SetCreate

AddDamagedIDs adds the "damaged" edge to the DamagedPath entity by IDs.

func (*SetCreate) AddFileIDs

func (_c *SetCreate) AddFileIDs(ids ...int) *SetCreate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*SetCreate) AddFiles

func (_c *SetCreate) AddFiles(v ...*File) *SetCreate

AddFiles adds the "files" edges to the File entity.

func (*SetCreate) AddRefIDs

func (_c *SetCreate) AddRefIDs(ids ...int) *SetCreate

AddRefIDs adds the "refs" edge to the SetRef entity by IDs.

func (*SetCreate) AddRefs

func (_c *SetCreate) AddRefs(v ...*SetRef) *SetCreate

AddRefs adds the "refs" edges to the SetRef entity.

func (*SetCreate) AddTreeIDs

func (_c *SetCreate) AddTreeIDs(ids ...int) *SetCreate

AddTreeIDs adds the "trees" edge to the Tree entity by IDs.

func (*SetCreate) AddTrees

func (_c *SetCreate) AddTrees(v ...*Tree) *SetCreate

AddTrees adds the "trees" edges to the Tree entity.

func (*SetCreate) Exec

func (_c *SetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetCreate) ExecContext

func (c *SetCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetCreate) ExecX

func (_c *SetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetCreate) Mutation

func (_c *SetCreate) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetCreate) OnConflict

func (_c *SetCreate) OnConflict(opts ...sql.ConflictOption) *SetUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Set.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SetUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*SetCreate) OnConflictColumns

func (_c *SetCreate) OnConflictColumns(columns ...string) *SetUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Set.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SetCreate) QueryContext

func (c *SetCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetCreate) Save

func (_c *SetCreate) Save(ctx context.Context) (*Set, error)

Save creates the Set in the database.

func (*SetCreate) SaveX

func (_c *SetCreate) SaveX(ctx context.Context) *Set

SaveX calls Save and panics if Save returns an error.

func (*SetCreate) SetAloneSize

func (_c *SetCreate) SetAloneSize(v int64) *SetCreate

SetAloneSize sets the "alone_size" field.

func (*SetCreate) SetDeduplicatedAloneSize

func (_c *SetCreate) SetDeduplicatedAloneSize(v int64) *SetCreate

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetCreate) SetDeduplicatedSize

func (_c *SetCreate) SetDeduplicatedSize(v int64) *SetCreate

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetCreate) SetErase

func (_c *SetCreate) SetErase(v bool) *SetCreate

SetErase sets the "erase" field.

func (*SetCreate) SetExclusiveSize

func (_c *SetCreate) SetExclusiveSize(v int64) *SetCreate

SetExclusiveSize sets the "exclusive_size" field.

func (*SetCreate) SetID

func (_c *SetCreate) SetID(v int64) *SetCreate

SetID sets the "id" field.

func (*SetCreate) SetKeptLogicalSize

func (_c *SetCreate) SetKeptLogicalSize(v int64) *SetCreate

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetCreate) SetLogicalSize

func (_c *SetCreate) SetLogicalSize(v int64) *SetCreate

SetLogicalSize sets the "logical_size" field.

func (*SetCreate) SetName

func (_c *SetCreate) SetName(v string) *SetCreate

SetName sets the "name" field.

func (*SetCreate) SetNillableAloneSize

func (_c *SetCreate) SetNillableAloneSize(v *int64) *SetCreate

SetNillableAloneSize sets the "alone_size" field if the given value is not nil.

func (*SetCreate) SetNillableDeduplicatedAloneSize

func (_c *SetCreate) SetNillableDeduplicatedAloneSize(v *int64) *SetCreate

SetNillableDeduplicatedAloneSize sets the "deduplicated_alone_size" field if the given value is not nil.

func (*SetCreate) SetNillableDeduplicatedSize

func (_c *SetCreate) SetNillableDeduplicatedSize(v *int64) *SetCreate

SetNillableDeduplicatedSize sets the "deduplicated_size" field if the given value is not nil.

func (*SetCreate) SetNillableErase

func (_c *SetCreate) SetNillableErase(v *bool) *SetCreate

SetNillableErase sets the "erase" field if the given value is not nil.

func (*SetCreate) SetNillableExclusiveSize

func (_c *SetCreate) SetNillableExclusiveSize(v *int64) *SetCreate

SetNillableExclusiveSize sets the "exclusive_size" field if the given value is not nil.

func (*SetCreate) SetNillableKeptLogicalSize

func (_c *SetCreate) SetNillableKeptLogicalSize(v *int64) *SetCreate

SetNillableKeptLogicalSize sets the "kept_logical_size" field if the given value is not nil.

func (*SetCreate) SetNillableLogicalSize

func (_c *SetCreate) SetNillableLogicalSize(v *int64) *SetCreate

SetNillableLogicalSize sets the "logical_size" field if the given value is not nil.

func (*SetCreate) SetNillablePhysicalSize

func (_c *SetCreate) SetNillablePhysicalSize(v *int64) *SetCreate

SetNillablePhysicalSize sets the "physical_size" field if the given value is not nil.

func (*SetCreate) SetNillableRescan

func (_c *SetCreate) SetNillableRescan(v *bool) *SetCreate

SetNillableRescan sets the "rescan" field if the given value is not nil.

func (*SetCreate) SetNillableRetentionPaused

func (_c *SetCreate) SetNillableRetentionPaused(v *bool) *SetCreate

SetNillableRetentionPaused sets the "retention_paused" field if the given value is not nil.

func (*SetCreate) SetNillableRetentionPolicy

func (_c *SetCreate) SetNillableRetentionPolicy(v *string) *SetCreate

SetNillableRetentionPolicy sets the "retention_policy" field if the given value is not nil.

func (*SetCreate) SetNillableState

func (_c *SetCreate) SetNillableState(v *set.State) *SetCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*SetCreate) SetNillableUniqueSize

func (_c *SetCreate) SetNillableUniqueSize(v *int64) *SetCreate

SetNillableUniqueSize sets the "unique_size" field if the given value is not nil.

func (*SetCreate) SetPhysicalSize

func (_c *SetCreate) SetPhysicalSize(v int64) *SetCreate

SetPhysicalSize sets the "physical_size" field.

func (*SetCreate) SetRescan

func (_c *SetCreate) SetRescan(v bool) *SetCreate

SetRescan sets the "rescan" field.

func (*SetCreate) SetRetentionPaused

func (_c *SetCreate) SetRetentionPaused(v bool) *SetCreate

SetRetentionPaused sets the "retention_paused" field.

func (*SetCreate) SetRetentionPolicy

func (_c *SetCreate) SetRetentionPolicy(v string) *SetCreate

SetRetentionPolicy sets the "retention_policy" field.

func (*SetCreate) SetSizesDigest

func (_c *SetCreate) SetSizesDigest(v []byte) *SetCreate

SetSizesDigest sets the "sizes_digest" field.

func (*SetCreate) SetState

func (_c *SetCreate) SetState(v set.State) *SetCreate

SetState sets the "state" field.

func (*SetCreate) SetUniqueSize

func (_c *SetCreate) SetUniqueSize(v int64) *SetCreate

SetUniqueSize sets the "unique_size" field.

type SetCreateBulk

type SetCreateBulk struct {
	// contains filtered or unexported fields
}

SetCreateBulk is the builder for creating many Set entities in bulk.

func (*SetCreateBulk) Exec

func (_c *SetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SetCreateBulk) ExecContext

func (c *SetCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetCreateBulk) ExecX

func (_c *SetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetCreateBulk) OnConflict

func (_c *SetCreateBulk) OnConflict(opts ...sql.ConflictOption) *SetUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Set.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SetUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*SetCreateBulk) OnConflictColumns

func (_c *SetCreateBulk) OnConflictColumns(columns ...string) *SetUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Set.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SetCreateBulk) QueryContext

func (c *SetCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetCreateBulk) Save

func (_c *SetCreateBulk) Save(ctx context.Context) ([]*Set, error)

Save creates the Set entities in the database.

func (*SetCreateBulk) SaveX

func (_c *SetCreateBulk) SaveX(ctx context.Context) []*Set

SaveX is like Save, but panics if an error occurs.

type SetDelete

type SetDelete struct {
	// contains filtered or unexported fields
}

SetDelete is the builder for deleting a Set entity.

func (*SetDelete) Exec

func (_d *SetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SetDelete) ExecContext

func (c *SetDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetDelete) ExecX

func (_d *SetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SetDelete) QueryContext

func (c *SetDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetDelete) Where

func (_d *SetDelete) Where(ps ...predicate.Set) *SetDelete

Where appends a list predicates to the SetDelete builder.

type SetDeleteOne

type SetDeleteOne struct {
	// contains filtered or unexported fields
}

SetDeleteOne is the builder for deleting a single Set entity.

func (*SetDeleteOne) Exec

func (_d *SetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SetDeleteOne) ExecX

func (_d *SetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetDeleteOne) Where

func (_d *SetDeleteOne) Where(ps ...predicate.Set) *SetDeleteOne

Where appends a list predicates to the SetDelete builder.

type SetEdges

type SetEdges struct {
	// Files holds the value of the files edge.
	Files []*File `json:"files,omitempty"`
	// Trees holds the value of the trees edge.
	Trees []*Tree `json:"trees,omitempty"`
	// Refs holds the value of the refs edge.
	Refs []*SetRef `json:"refs,omitempty"`
	// Damaged holds the value of the damaged edge.
	Damaged []*DamagedPath `json:"damaged,omitempty"`
	// contains filtered or unexported fields
}

SetEdges holds the relations/edges for other nodes in the graph.

func (SetEdges) DamagedOrErr

func (e SetEdges) DamagedOrErr() ([]*DamagedPath, error)

DamagedOrErr returns the Damaged value or an error if the edge was not loaded in eager-loading.

func (SetEdges) FilesOrErr

func (e SetEdges) FilesOrErr() ([]*File, error)

FilesOrErr returns the Files value or an error if the edge was not loaded in eager-loading.

func (SetEdges) RefsOrErr

func (e SetEdges) RefsOrErr() ([]*SetRef, error)

RefsOrErr returns the Refs value or an error if the edge was not loaded in eager-loading.

func (SetEdges) TreesOrErr

func (e SetEdges) TreesOrErr() ([]*Tree, error)

TreesOrErr returns the Trees value or an error if the edge was not loaded in eager-loading.

type SetGroupBy

type SetGroupBy struct {
	// contains filtered or unexported fields
}

SetGroupBy is the group-by builder for Set entities.

func (*SetGroupBy) Aggregate

func (_g *SetGroupBy) Aggregate(fns ...AggregateFunc) *SetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SetGroupBy) Bool

func (s *SetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) BoolX

func (s *SetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetGroupBy) Bools

func (s *SetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) BoolsX

func (s *SetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SetGroupBy) Float64

func (s *SetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) Float64X

func (s *SetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetGroupBy) Float64s

func (s *SetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) Float64sX

func (s *SetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetGroupBy) Int

func (s *SetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) IntX

func (s *SetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetGroupBy) Ints

func (s *SetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) IntsX

func (s *SetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SetGroupBy) Scan

func (_g *SetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetGroupBy) ScanX

func (s *SetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetGroupBy) String

func (s *SetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) StringX

func (s *SetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetGroupBy) Strings

func (s *SetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) StringsX

func (s *SetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetMutation

type SetMutation struct {
	// contains filtered or unexported fields
}

SetMutation represents an operation that mutates the Set nodes in the graph.

func (*SetMutation) AddAloneSize

func (m *SetMutation) AddAloneSize(i int64)

AddAloneSize adds i to the "alone_size" field.

func (*SetMutation) AddDamagedIDs

func (m *SetMutation) AddDamagedIDs(ids ...int)

AddDamagedIDs adds the "damaged" edge to the DamagedPath entity by ids.

func (*SetMutation) AddDeduplicatedAloneSize

func (m *SetMutation) AddDeduplicatedAloneSize(i int64)

AddDeduplicatedAloneSize adds i to the "deduplicated_alone_size" field.

func (*SetMutation) AddDeduplicatedSize

func (m *SetMutation) AddDeduplicatedSize(i int64)

AddDeduplicatedSize adds i to the "deduplicated_size" field.

func (*SetMutation) AddExclusiveSize

func (m *SetMutation) AddExclusiveSize(i int64)

AddExclusiveSize adds i to the "exclusive_size" field.

func (*SetMutation) AddField

func (m *SetMutation) 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 (*SetMutation) AddFileIDs

func (m *SetMutation) AddFileIDs(ids ...int)

AddFileIDs adds the "files" edge to the File entity by ids.

func (*SetMutation) AddKeptLogicalSize

func (m *SetMutation) AddKeptLogicalSize(i int64)

AddKeptLogicalSize adds i to the "kept_logical_size" field.

func (*SetMutation) AddLogicalSize

func (m *SetMutation) AddLogicalSize(i int64)

AddLogicalSize adds i to the "logical_size" field.

func (*SetMutation) AddPhysicalSize

func (m *SetMutation) AddPhysicalSize(i int64)

AddPhysicalSize adds i to the "physical_size" field.

func (*SetMutation) AddRefIDs

func (m *SetMutation) AddRefIDs(ids ...int)

AddRefIDs adds the "refs" edge to the SetRef entity by ids.

func (*SetMutation) AddTreeIDs

func (m *SetMutation) AddTreeIDs(ids ...int)

AddTreeIDs adds the "trees" edge to the Tree entity by ids.

func (*SetMutation) AddUniqueSize

func (m *SetMutation) AddUniqueSize(i int64)

AddUniqueSize adds i to the "unique_size" field.

func (*SetMutation) AddedAloneSize

func (m *SetMutation) AddedAloneSize() (r int64, exists bool)

AddedAloneSize returns the value that was added to the "alone_size" field in this mutation.

func (*SetMutation) AddedDeduplicatedAloneSize

func (m *SetMutation) AddedDeduplicatedAloneSize() (r int64, exists bool)

AddedDeduplicatedAloneSize returns the value that was added to the "deduplicated_alone_size" field in this mutation.

func (*SetMutation) AddedDeduplicatedSize

func (m *SetMutation) AddedDeduplicatedSize() (r int64, exists bool)

AddedDeduplicatedSize returns the value that was added to the "deduplicated_size" field in this mutation.

func (*SetMutation) AddedEdges

func (m *SetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SetMutation) AddedExclusiveSize

func (m *SetMutation) AddedExclusiveSize() (r int64, exists bool)

AddedExclusiveSize returns the value that was added to the "exclusive_size" field in this mutation.

func (*SetMutation) AddedField

func (m *SetMutation) 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 (*SetMutation) AddedFields

func (m *SetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SetMutation) AddedIDs

func (m *SetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SetMutation) AddedKeptLogicalSize

func (m *SetMutation) AddedKeptLogicalSize() (r int64, exists bool)

AddedKeptLogicalSize returns the value that was added to the "kept_logical_size" field in this mutation.

func (*SetMutation) AddedLogicalSize

func (m *SetMutation) AddedLogicalSize() (r int64, exists bool)

AddedLogicalSize returns the value that was added to the "logical_size" field in this mutation.

func (*SetMutation) AddedPhysicalSize

func (m *SetMutation) AddedPhysicalSize() (r int64, exists bool)

AddedPhysicalSize returns the value that was added to the "physical_size" field in this mutation.

func (*SetMutation) AddedUniqueSize

func (m *SetMutation) AddedUniqueSize() (r int64, exists bool)

AddedUniqueSize returns the value that was added to the "unique_size" field in this mutation.

func (*SetMutation) AloneSize

func (m *SetMutation) AloneSize() (r int64, exists bool)

AloneSize returns the value of the "alone_size" field in the mutation.

func (*SetMutation) AloneSizeCleared

func (m *SetMutation) AloneSizeCleared() bool

AloneSizeCleared returns if the "alone_size" field was cleared in this mutation.

func (*SetMutation) ClearAloneSize

func (m *SetMutation) ClearAloneSize()

ClearAloneSize clears the value of the "alone_size" field.

func (*SetMutation) ClearDamaged

func (m *SetMutation) ClearDamaged()

ClearDamaged clears the "damaged" edge to the DamagedPath entity.

func (*SetMutation) ClearDeduplicatedAloneSize

func (m *SetMutation) ClearDeduplicatedAloneSize()

ClearDeduplicatedAloneSize clears the value of the "deduplicated_alone_size" field.

func (*SetMutation) ClearDeduplicatedSize

func (m *SetMutation) ClearDeduplicatedSize()

ClearDeduplicatedSize clears the value of the "deduplicated_size" field.

func (*SetMutation) ClearEdge

func (m *SetMutation) 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 (*SetMutation) ClearExclusiveSize

func (m *SetMutation) ClearExclusiveSize()

ClearExclusiveSize clears the value of the "exclusive_size" field.

func (*SetMutation) ClearField

func (m *SetMutation) 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 (*SetMutation) ClearFiles

func (m *SetMutation) ClearFiles()

ClearFiles clears the "files" edge to the File entity.

func (*SetMutation) ClearKeptLogicalSize

func (m *SetMutation) ClearKeptLogicalSize()

ClearKeptLogicalSize clears the value of the "kept_logical_size" field.

func (*SetMutation) ClearLogicalSize

func (m *SetMutation) ClearLogicalSize()

ClearLogicalSize clears the value of the "logical_size" field.

func (*SetMutation) ClearPhysicalSize

func (m *SetMutation) ClearPhysicalSize()

ClearPhysicalSize clears the value of the "physical_size" field.

func (*SetMutation) ClearRefs

func (m *SetMutation) ClearRefs()

ClearRefs clears the "refs" edge to the SetRef entity.

func (*SetMutation) ClearRetentionPolicy

func (m *SetMutation) ClearRetentionPolicy()

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SetMutation) ClearSizesDigest

func (m *SetMutation) ClearSizesDigest()

ClearSizesDigest clears the value of the "sizes_digest" field.

func (*SetMutation) ClearTrees

func (m *SetMutation) ClearTrees()

ClearTrees clears the "trees" edge to the Tree entity.

func (*SetMutation) ClearUniqueSize

func (m *SetMutation) ClearUniqueSize()

ClearUniqueSize clears the value of the "unique_size" field.

func (*SetMutation) ClearedEdges

func (m *SetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SetMutation) ClearedFields

func (m *SetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SetMutation) Client

func (m SetMutation) 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 (*SetMutation) DamagedCleared

func (m *SetMutation) DamagedCleared() bool

DamagedCleared reports if the "damaged" edge to the DamagedPath entity was cleared.

func (*SetMutation) DamagedIDs

func (m *SetMutation) DamagedIDs() (ids []int)

DamagedIDs returns the "damaged" edge IDs in the mutation.

func (*SetMutation) DeduplicatedAloneSize

func (m *SetMutation) DeduplicatedAloneSize() (r int64, exists bool)

DeduplicatedAloneSize returns the value of the "deduplicated_alone_size" field in the mutation.

func (*SetMutation) DeduplicatedAloneSizeCleared

func (m *SetMutation) DeduplicatedAloneSizeCleared() bool

DeduplicatedAloneSizeCleared returns if the "deduplicated_alone_size" field was cleared in this mutation.

func (*SetMutation) DeduplicatedSize

func (m *SetMutation) DeduplicatedSize() (r int64, exists bool)

DeduplicatedSize returns the value of the "deduplicated_size" field in the mutation.

func (*SetMutation) DeduplicatedSizeCleared

func (m *SetMutation) DeduplicatedSizeCleared() bool

DeduplicatedSizeCleared returns if the "deduplicated_size" field was cleared in this mutation.

func (*SetMutation) EdgeCleared

func (m *SetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SetMutation) Erase

func (m *SetMutation) Erase() (r bool, exists bool)

Erase returns the value of the "erase" field in the mutation.

func (*SetMutation) ExclusiveSize

func (m *SetMutation) ExclusiveSize() (r int64, exists bool)

ExclusiveSize returns the value of the "exclusive_size" field in the mutation.

func (*SetMutation) ExclusiveSizeCleared

func (m *SetMutation) ExclusiveSizeCleared() bool

ExclusiveSizeCleared returns if the "exclusive_size" field was cleared in this mutation.

func (*SetMutation) ExecContext

func (c *SetMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetMutation) Field

func (m *SetMutation) 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 (*SetMutation) FieldCleared

func (m *SetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SetMutation) Fields

func (m *SetMutation) 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 (*SetMutation) FilesCleared

func (m *SetMutation) FilesCleared() bool

FilesCleared reports if the "files" edge to the File entity was cleared.

func (*SetMutation) FilesIDs

func (m *SetMutation) FilesIDs() (ids []int)

FilesIDs returns the "files" edge IDs in the mutation.

func (*SetMutation) ID

func (m *SetMutation) ID() (id int64, 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 (*SetMutation) IDs

func (m *SetMutation) IDs(ctx context.Context) ([]int64, 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 (*SetMutation) KeptLogicalSize

func (m *SetMutation) KeptLogicalSize() (r int64, exists bool)

KeptLogicalSize returns the value of the "kept_logical_size" field in the mutation.

func (*SetMutation) KeptLogicalSizeCleared

func (m *SetMutation) KeptLogicalSizeCleared() bool

KeptLogicalSizeCleared returns if the "kept_logical_size" field was cleared in this mutation.

func (*SetMutation) LogicalSize

func (m *SetMutation) LogicalSize() (r int64, exists bool)

LogicalSize returns the value of the "logical_size" field in the mutation.

func (*SetMutation) LogicalSizeCleared

func (m *SetMutation) LogicalSizeCleared() bool

LogicalSizeCleared returns if the "logical_size" field was cleared in this mutation.

func (*SetMutation) Name

func (m *SetMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SetMutation) OldAloneSize

func (m *SetMutation) OldAloneSize(ctx context.Context) (v *int64, err error)

OldAloneSize returns the old "alone_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldDeduplicatedAloneSize

func (m *SetMutation) OldDeduplicatedAloneSize(ctx context.Context) (v *int64, err error)

OldDeduplicatedAloneSize returns the old "deduplicated_alone_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldDeduplicatedSize

func (m *SetMutation) OldDeduplicatedSize(ctx context.Context) (v *int64, err error)

OldDeduplicatedSize returns the old "deduplicated_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldErase

func (m *SetMutation) OldErase(ctx context.Context) (v bool, err error)

OldErase returns the old "erase" field's value of the Set entity. If the Set 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 (*SetMutation) OldExclusiveSize

func (m *SetMutation) OldExclusiveSize(ctx context.Context) (v *int64, err error)

OldExclusiveSize returns the old "exclusive_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldField

func (m *SetMutation) 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 (*SetMutation) OldKeptLogicalSize

func (m *SetMutation) OldKeptLogicalSize(ctx context.Context) (v *int64, err error)

OldKeptLogicalSize returns the old "kept_logical_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldLogicalSize

func (m *SetMutation) OldLogicalSize(ctx context.Context) (v *int64, err error)

OldLogicalSize returns the old "logical_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldName

func (m *SetMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Set entity. If the Set 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 (*SetMutation) OldPhysicalSize

func (m *SetMutation) OldPhysicalSize(ctx context.Context) (v *int64, err error)

OldPhysicalSize returns the old "physical_size" field's value of the Set entity. If the Set 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 (*SetMutation) OldRescan

func (m *SetMutation) OldRescan(ctx context.Context) (v bool, err error)

OldRescan returns the old "rescan" field's value of the Set entity. If the Set 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 (*SetMutation) OldRetentionPaused

func (m *SetMutation) OldRetentionPaused(ctx context.Context) (v bool, err error)

OldRetentionPaused returns the old "retention_paused" field's value of the Set entity. If the Set 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 (*SetMutation) OldRetentionPolicy

func (m *SetMutation) OldRetentionPolicy(ctx context.Context) (v *string, err error)

OldRetentionPolicy returns the old "retention_policy" field's value of the Set entity. If the Set 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 (*SetMutation) OldSizesDigest

func (m *SetMutation) OldSizesDigest(ctx context.Context) (v []byte, err error)

OldSizesDigest returns the old "sizes_digest" field's value of the Set entity. If the Set 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 (*SetMutation) OldState

func (m *SetMutation) OldState(ctx context.Context) (v set.State, err error)

OldState returns the old "state" field's value of the Set entity. If the Set 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 (*SetMutation) OldUniqueSize

func (m *SetMutation) OldUniqueSize(ctx context.Context) (v *int64, err error)

OldUniqueSize returns the old "unique_size" field's value of the Set entity. If the Set 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 (*SetMutation) Op

func (m *SetMutation) Op() Op

Op returns the operation name.

func (*SetMutation) PhysicalSize

func (m *SetMutation) PhysicalSize() (r int64, exists bool)

PhysicalSize returns the value of the "physical_size" field in the mutation.

func (*SetMutation) PhysicalSizeCleared

func (m *SetMutation) PhysicalSizeCleared() bool

PhysicalSizeCleared returns if the "physical_size" field was cleared in this mutation.

func (*SetMutation) QueryContext

func (c *SetMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetMutation) RefsCleared

func (m *SetMutation) RefsCleared() bool

RefsCleared reports if the "refs" edge to the SetRef entity was cleared.

func (*SetMutation) RefsIDs

func (m *SetMutation) RefsIDs() (ids []int)

RefsIDs returns the "refs" edge IDs in the mutation.

func (*SetMutation) RemoveDamagedIDs

func (m *SetMutation) RemoveDamagedIDs(ids ...int)

RemoveDamagedIDs removes the "damaged" edge to the DamagedPath entity by IDs.

func (*SetMutation) RemoveFileIDs

func (m *SetMutation) RemoveFileIDs(ids ...int)

RemoveFileIDs removes the "files" edge to the File entity by IDs.

func (*SetMutation) RemoveRefIDs

func (m *SetMutation) RemoveRefIDs(ids ...int)

RemoveRefIDs removes the "refs" edge to the SetRef entity by IDs.

func (*SetMutation) RemoveTreeIDs

func (m *SetMutation) RemoveTreeIDs(ids ...int)

RemoveTreeIDs removes the "trees" edge to the Tree entity by IDs.

func (*SetMutation) RemovedDamagedIDs

func (m *SetMutation) RemovedDamagedIDs() (ids []int)

RemovedDamaged returns the removed IDs of the "damaged" edge to the DamagedPath entity.

func (*SetMutation) RemovedEdges

func (m *SetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SetMutation) RemovedFilesIDs

func (m *SetMutation) RemovedFilesIDs() (ids []int)

RemovedFiles returns the removed IDs of the "files" edge to the File entity.

func (*SetMutation) RemovedIDs

func (m *SetMutation) 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 (*SetMutation) RemovedRefsIDs

func (m *SetMutation) RemovedRefsIDs() (ids []int)

RemovedRefs returns the removed IDs of the "refs" edge to the SetRef entity.

func (*SetMutation) RemovedTreesIDs

func (m *SetMutation) RemovedTreesIDs() (ids []int)

RemovedTrees returns the removed IDs of the "trees" edge to the Tree entity.

func (*SetMutation) Rescan

func (m *SetMutation) Rescan() (r bool, exists bool)

Rescan returns the value of the "rescan" field in the mutation.

func (*SetMutation) ResetAloneSize

func (m *SetMutation) ResetAloneSize()

ResetAloneSize resets all changes to the "alone_size" field.

func (*SetMutation) ResetDamaged

func (m *SetMutation) ResetDamaged()

ResetDamaged resets all changes to the "damaged" edge.

func (*SetMutation) ResetDeduplicatedAloneSize

func (m *SetMutation) ResetDeduplicatedAloneSize()

ResetDeduplicatedAloneSize resets all changes to the "deduplicated_alone_size" field.

func (*SetMutation) ResetDeduplicatedSize

func (m *SetMutation) ResetDeduplicatedSize()

ResetDeduplicatedSize resets all changes to the "deduplicated_size" field.

func (*SetMutation) ResetEdge

func (m *SetMutation) 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 (*SetMutation) ResetErase

func (m *SetMutation) ResetErase()

ResetErase resets all changes to the "erase" field.

func (*SetMutation) ResetExclusiveSize

func (m *SetMutation) ResetExclusiveSize()

ResetExclusiveSize resets all changes to the "exclusive_size" field.

func (*SetMutation) ResetField

func (m *SetMutation) 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 (*SetMutation) ResetFiles

func (m *SetMutation) ResetFiles()

ResetFiles resets all changes to the "files" edge.

func (*SetMutation) ResetKeptLogicalSize

func (m *SetMutation) ResetKeptLogicalSize()

ResetKeptLogicalSize resets all changes to the "kept_logical_size" field.

func (*SetMutation) ResetLogicalSize

func (m *SetMutation) ResetLogicalSize()

ResetLogicalSize resets all changes to the "logical_size" field.

func (*SetMutation) ResetName

func (m *SetMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SetMutation) ResetPhysicalSize

func (m *SetMutation) ResetPhysicalSize()

ResetPhysicalSize resets all changes to the "physical_size" field.

func (*SetMutation) ResetRefs

func (m *SetMutation) ResetRefs()

ResetRefs resets all changes to the "refs" edge.

func (*SetMutation) ResetRescan

func (m *SetMutation) ResetRescan()

ResetRescan resets all changes to the "rescan" field.

func (*SetMutation) ResetRetentionPaused

func (m *SetMutation) ResetRetentionPaused()

ResetRetentionPaused resets all changes to the "retention_paused" field.

func (*SetMutation) ResetRetentionPolicy

func (m *SetMutation) ResetRetentionPolicy()

ResetRetentionPolicy resets all changes to the "retention_policy" field.

func (*SetMutation) ResetSizesDigest

func (m *SetMutation) ResetSizesDigest()

ResetSizesDigest resets all changes to the "sizes_digest" field.

func (*SetMutation) ResetState

func (m *SetMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*SetMutation) ResetTrees

func (m *SetMutation) ResetTrees()

ResetTrees resets all changes to the "trees" edge.

func (*SetMutation) ResetUniqueSize

func (m *SetMutation) ResetUniqueSize()

ResetUniqueSize resets all changes to the "unique_size" field.

func (*SetMutation) RetentionPaused

func (m *SetMutation) RetentionPaused() (r bool, exists bool)

RetentionPaused returns the value of the "retention_paused" field in the mutation.

func (*SetMutation) RetentionPolicy

func (m *SetMutation) RetentionPolicy() (r string, exists bool)

RetentionPolicy returns the value of the "retention_policy" field in the mutation.

func (*SetMutation) RetentionPolicyCleared

func (m *SetMutation) RetentionPolicyCleared() bool

RetentionPolicyCleared returns if the "retention_policy" field was cleared in this mutation.

func (*SetMutation) SetAloneSize

func (m *SetMutation) SetAloneSize(i int64)

SetAloneSize sets the "alone_size" field.

func (*SetMutation) SetDeduplicatedAloneSize

func (m *SetMutation) SetDeduplicatedAloneSize(i int64)

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetMutation) SetDeduplicatedSize

func (m *SetMutation) SetDeduplicatedSize(i int64)

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetMutation) SetErase

func (m *SetMutation) SetErase(b bool)

SetErase sets the "erase" field.

func (*SetMutation) SetExclusiveSize

func (m *SetMutation) SetExclusiveSize(i int64)

SetExclusiveSize sets the "exclusive_size" field.

func (*SetMutation) SetField

func (m *SetMutation) 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 (*SetMutation) SetID

func (m *SetMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Set entities.

func (*SetMutation) SetKeptLogicalSize

func (m *SetMutation) SetKeptLogicalSize(i int64)

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetMutation) SetLogicalSize

func (m *SetMutation) SetLogicalSize(i int64)

SetLogicalSize sets the "logical_size" field.

func (*SetMutation) SetName

func (m *SetMutation) SetName(s string)

SetName sets the "name" field.

func (*SetMutation) SetOp

func (m *SetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SetMutation) SetPhysicalSize

func (m *SetMutation) SetPhysicalSize(i int64)

SetPhysicalSize sets the "physical_size" field.

func (*SetMutation) SetRescan

func (m *SetMutation) SetRescan(b bool)

SetRescan sets the "rescan" field.

func (*SetMutation) SetRetentionPaused

func (m *SetMutation) SetRetentionPaused(b bool)

SetRetentionPaused sets the "retention_paused" field.

func (*SetMutation) SetRetentionPolicy

func (m *SetMutation) SetRetentionPolicy(s string)

SetRetentionPolicy sets the "retention_policy" field.

func (*SetMutation) SetSizesDigest

func (m *SetMutation) SetSizesDigest(b []byte)

SetSizesDigest sets the "sizes_digest" field.

func (*SetMutation) SetState

func (m *SetMutation) SetState(s set.State)

SetState sets the "state" field.

func (*SetMutation) SetUniqueSize

func (m *SetMutation) SetUniqueSize(i int64)

SetUniqueSize sets the "unique_size" field.

func (*SetMutation) SizesDigest

func (m *SetMutation) SizesDigest() (r []byte, exists bool)

SizesDigest returns the value of the "sizes_digest" field in the mutation.

func (*SetMutation) SizesDigestCleared

func (m *SetMutation) SizesDigestCleared() bool

SizesDigestCleared returns if the "sizes_digest" field was cleared in this mutation.

func (*SetMutation) State

func (m *SetMutation) State() (r set.State, exists bool)

State returns the value of the "state" field in the mutation.

func (*SetMutation) TreesCleared

func (m *SetMutation) TreesCleared() bool

TreesCleared reports if the "trees" edge to the Tree entity was cleared.

func (*SetMutation) TreesIDs

func (m *SetMutation) TreesIDs() (ids []int)

TreesIDs returns the "trees" edge IDs in the mutation.

func (SetMutation) Tx

func (m SetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SetMutation) Type

func (m *SetMutation) Type() string

Type returns the node type of this mutation (Set).

func (*SetMutation) UniqueSize

func (m *SetMutation) UniqueSize() (r int64, exists bool)

UniqueSize returns the value of the "unique_size" field in the mutation.

func (*SetMutation) UniqueSizeCleared

func (m *SetMutation) UniqueSizeCleared() bool

UniqueSizeCleared returns if the "unique_size" field was cleared in this mutation.

func (*SetMutation) Where

func (m *SetMutation) Where(ps ...predicate.Set)

Where appends a list predicates to the SetMutation builder.

func (*SetMutation) WhereP

func (m *SetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SetQuery

type SetQuery struct {
	// contains filtered or unexported fields
}

SetQuery is the builder for querying Set entities.

func (*SetQuery) Aggregate

func (_q *SetQuery) Aggregate(fns ...AggregateFunc) *SetSelect

Aggregate returns a SetSelect configured with the given aggregations.

func (*SetQuery) All

func (_q *SetQuery) All(ctx context.Context) ([]*Set, error)

All executes the query and returns a list of Sets.

func (*SetQuery) AllX

func (_q *SetQuery) AllX(ctx context.Context) []*Set

AllX is like All, but panics if an error occurs.

func (*SetQuery) Clone

func (_q *SetQuery) Clone() *SetQuery

Clone returns a duplicate of the SetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SetQuery) Count

func (_q *SetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SetQuery) CountX

func (_q *SetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SetQuery) ExecContext

func (c *SetQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetQuery) Exist

func (_q *SetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SetQuery) ExistX

func (_q *SetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SetQuery) First

func (_q *SetQuery) First(ctx context.Context) (*Set, error)

First returns the first Set entity from the query. Returns a *NotFoundError when no Set was found.

func (*SetQuery) FirstID

func (_q *SetQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Set ID from the query. Returns a *NotFoundError when no Set ID was found.

func (*SetQuery) FirstIDX

func (_q *SetQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*SetQuery) FirstX

func (_q *SetQuery) FirstX(ctx context.Context) *Set

FirstX is like First, but panics if an error occurs.

func (*SetQuery) ForShare

func (_q *SetQuery) ForShare(opts ...sql.LockOption) *SetQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*SetQuery) ForUpdate

func (_q *SetQuery) ForUpdate(opts ...sql.LockOption) *SetQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*SetQuery) GroupBy

func (_q *SetQuery) GroupBy(field string, fields ...string) *SetGroupBy

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.Set.Query().
	GroupBy(set.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SetQuery) IDs

func (_q *SetQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of Set IDs.

func (*SetQuery) IDsX

func (_q *SetQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*SetQuery) Limit

func (_q *SetQuery) Limit(limit int) *SetQuery

Limit the number of records to be returned by this query.

func (*SetQuery) Offset

func (_q *SetQuery) Offset(offset int) *SetQuery

Offset to start from.

func (*SetQuery) Only

func (_q *SetQuery) Only(ctx context.Context) (*Set, error)

Only returns a single Set entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Set entity is found. Returns a *NotFoundError when no Set entities are found.

func (*SetQuery) OnlyID

func (_q *SetQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Set ID in the query. Returns a *NotSingularError when more than one Set ID is found. Returns a *NotFoundError when no entities are found.

func (*SetQuery) OnlyIDX

func (_q *SetQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SetQuery) OnlyX

func (_q *SetQuery) OnlyX(ctx context.Context) *Set

OnlyX is like Only, but panics if an error occurs.

func (*SetQuery) Order

func (_q *SetQuery) Order(o ...set.OrderOption) *SetQuery

Order specifies how the records should be ordered.

func (*SetQuery) QueryContext

func (c *SetQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetQuery) QueryDamaged

func (_q *SetQuery) QueryDamaged() *DamagedPathQuery

QueryDamaged chains the current query on the "damaged" edge.

func (*SetQuery) QueryFiles

func (_q *SetQuery) QueryFiles() *FileQuery

QueryFiles chains the current query on the "files" edge.

func (*SetQuery) QueryRefs

func (_q *SetQuery) QueryRefs() *SetRefQuery

QueryRefs chains the current query on the "refs" edge.

func (*SetQuery) QueryTrees

func (_q *SetQuery) QueryTrees() *TreeQuery

QueryTrees chains the current query on the "trees" edge.

func (*SetQuery) Select

func (_q *SetQuery) Select(fields ...string) *SetSelect

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.Set.Query().
	Select(set.FieldName).
	Scan(ctx, &v)

func (*SetQuery) Unique

func (_q *SetQuery) Unique(unique bool) *SetQuery

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 (*SetQuery) Where

func (_q *SetQuery) Where(ps ...predicate.Set) *SetQuery

Where adds a new predicate for the SetQuery builder.

func (*SetQuery) WithDamaged

func (_q *SetQuery) WithDamaged(opts ...func(*DamagedPathQuery)) *SetQuery

WithDamaged tells the query-builder to eager-load the nodes that are connected to the "damaged" edge. The optional arguments are used to configure the query builder of the edge.

func (*SetQuery) WithFiles

func (_q *SetQuery) WithFiles(opts ...func(*FileQuery)) *SetQuery

WithFiles tells the query-builder to eager-load the nodes that are connected to the "files" edge. The optional arguments are used to configure the query builder of the edge.

func (*SetQuery) WithRefs

func (_q *SetQuery) WithRefs(opts ...func(*SetRefQuery)) *SetQuery

WithRefs tells the query-builder to eager-load the nodes that are connected to the "refs" edge. The optional arguments are used to configure the query builder of the edge.

func (*SetQuery) WithTrees

func (_q *SetQuery) WithTrees(opts ...func(*TreeQuery)) *SetQuery

WithTrees tells the query-builder to eager-load the nodes that are connected to the "trees" edge. The optional arguments are used to configure the query builder of the edge.

type SetRef

type SetRef struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SetID holds the value of the "set_id" field.
	SetID int64 `json:"set_id,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SetRefQuery when eager-loading is set.
	Edges SetRefEdges `json:"edges"`
	// contains filtered or unexported fields
}

SetRef is the model entity for the SetRef schema.

func (*SetRef) ExecContext

func (c *SetRef) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRef) QueryContext

func (c *SetRef) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRef) QuerySet

func (_m *SetRef) QuerySet() *SetQuery

QuerySet queries the "set" edge of the SetRef entity.

func (*SetRef) String

func (_m *SetRef) String() string

String implements the fmt.Stringer.

func (*SetRef) Unwrap

func (_m *SetRef) Unwrap() *SetRef

Unwrap unwraps the SetRef 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 (*SetRef) Update

func (_m *SetRef) Update() *SetRefUpdateOne

Update returns a builder for updating this SetRef. Note that you need to call SetRef.Unwrap() before calling this method if this SetRef was returned from a transaction, and the transaction was committed or rolled back.

func (*SetRef) Value

func (_m *SetRef) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SetRef. This includes values selected through modifiers, order, etc.

type SetRefClient

type SetRefClient struct {
	// contains filtered or unexported fields
}

SetRefClient is a client for the SetRef schema.

func NewSetRefClient

func NewSetRefClient(c config) *SetRefClient

NewSetRefClient returns a client for the SetRef from the given config.

func (*SetRefClient) Create

func (c *SetRefClient) Create() *SetRefCreate

Create returns a builder for creating a SetRef entity.

func (*SetRefClient) CreateBulk

func (c *SetRefClient) CreateBulk(builders ...*SetRefCreate) *SetRefCreateBulk

CreateBulk returns a builder for creating a bulk of SetRef entities.

func (*SetRefClient) Delete

func (c *SetRefClient) Delete() *SetRefDelete

Delete returns a delete builder for SetRef.

func (*SetRefClient) DeleteOne

func (c *SetRefClient) DeleteOne(_m *SetRef) *SetRefDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SetRefClient) DeleteOneID

func (c *SetRefClient) DeleteOneID(id int) *SetRefDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SetRefClient) ExecContext

func (c *SetRefClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefClient) Get

func (c *SetRefClient) Get(ctx context.Context, id int) (*SetRef, error)

Get returns a SetRef entity by its id.

func (*SetRefClient) GetX

func (c *SetRefClient) GetX(ctx context.Context, id int) *SetRef

GetX is like Get, but panics if an error occurs.

func (*SetRefClient) Hooks

func (c *SetRefClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SetRefClient) Intercept

func (c *SetRefClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `setref.Intercept(f(g(h())))`.

func (*SetRefClient) Interceptors

func (c *SetRefClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SetRefClient) MapCreateBulk

func (c *SetRefClient) MapCreateBulk(slice any, setFunc func(*SetRefCreate, int)) *SetRefCreateBulk

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 (*SetRefClient) Query

func (c *SetRefClient) Query() *SetRefQuery

Query returns a query builder for SetRef.

func (*SetRefClient) QueryContext

func (c *SetRefClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefClient) QuerySet

func (c *SetRefClient) QuerySet(_m *SetRef) *SetQuery

QuerySet queries the set edge of a SetRef.

func (*SetRefClient) Update

func (c *SetRefClient) Update() *SetRefUpdate

Update returns an update builder for SetRef.

func (*SetRefClient) UpdateOne

func (c *SetRefClient) UpdateOne(_m *SetRef) *SetRefUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SetRefClient) UpdateOneID

func (c *SetRefClient) UpdateOneID(id int) *SetRefUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SetRefClient) Use

func (c *SetRefClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `setref.Hooks(f(g(h())))`.

type SetRefCreate

type SetRefCreate struct {
	// contains filtered or unexported fields
}

SetRefCreate is the builder for creating a SetRef entity.

func (*SetRefCreate) Exec

func (_c *SetRefCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetRefCreate) ExecContext

func (c *SetRefCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefCreate) ExecX

func (_c *SetRefCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefCreate) Mutation

func (_c *SetRefCreate) Mutation() *SetRefMutation

Mutation returns the SetRefMutation object of the builder.

func (*SetRefCreate) OnConflict

func (_c *SetRefCreate) OnConflict(opts ...sql.ConflictOption) *SetRefUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.SetRef.Create().
	SetSetID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SetRefUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*SetRefCreate) OnConflictColumns

func (_c *SetRefCreate) OnConflictColumns(columns ...string) *SetRefUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.SetRef.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SetRefCreate) QueryContext

func (c *SetRefCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefCreate) Save

func (_c *SetRefCreate) Save(ctx context.Context) (*SetRef, error)

Save creates the SetRef in the database.

func (*SetRefCreate) SaveX

func (_c *SetRefCreate) SaveX(ctx context.Context) *SetRef

SaveX calls Save and panics if Save returns an error.

func (*SetRefCreate) SetRef

func (_c *SetRefCreate) SetRef(v []byte) *SetRefCreate

SetRef sets the "ref" field.

func (*SetRefCreate) SetSet

func (_c *SetRefCreate) SetSet(v *Set) *SetRefCreate

SetSet sets the "set" edge to the Set entity.

func (*SetRefCreate) SetSetID

func (_c *SetRefCreate) SetSetID(v int64) *SetRefCreate

SetSetID sets the "set_id" field.

type SetRefCreateBulk

type SetRefCreateBulk struct {
	// contains filtered or unexported fields
}

SetRefCreateBulk is the builder for creating many SetRef entities in bulk.

func (*SetRefCreateBulk) Exec

func (_c *SetRefCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SetRefCreateBulk) ExecContext

func (c *SetRefCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefCreateBulk) ExecX

func (_c *SetRefCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefCreateBulk) OnConflict

func (_c *SetRefCreateBulk) OnConflict(opts ...sql.ConflictOption) *SetRefUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.SetRef.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SetRefUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*SetRefCreateBulk) OnConflictColumns

func (_c *SetRefCreateBulk) OnConflictColumns(columns ...string) *SetRefUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.SetRef.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SetRefCreateBulk) QueryContext

func (c *SetRefCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefCreateBulk) Save

func (_c *SetRefCreateBulk) Save(ctx context.Context) ([]*SetRef, error)

Save creates the SetRef entities in the database.

func (*SetRefCreateBulk) SaveX

func (_c *SetRefCreateBulk) SaveX(ctx context.Context) []*SetRef

SaveX is like Save, but panics if an error occurs.

type SetRefDelete

type SetRefDelete struct {
	// contains filtered or unexported fields
}

SetRefDelete is the builder for deleting a SetRef entity.

func (*SetRefDelete) Exec

func (_d *SetRefDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SetRefDelete) ExecContext

func (c *SetRefDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefDelete) ExecX

func (_d *SetRefDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SetRefDelete) QueryContext

func (c *SetRefDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefDelete) Where

func (_d *SetRefDelete) Where(ps ...predicate.SetRef) *SetRefDelete

Where appends a list predicates to the SetRefDelete builder.

type SetRefDeleteOne

type SetRefDeleteOne struct {
	// contains filtered or unexported fields
}

SetRefDeleteOne is the builder for deleting a single SetRef entity.

func (*SetRefDeleteOne) Exec

func (_d *SetRefDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SetRefDeleteOne) ExecX

func (_d *SetRefDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefDeleteOne) Where

func (_d *SetRefDeleteOne) Where(ps ...predicate.SetRef) *SetRefDeleteOne

Where appends a list predicates to the SetRefDelete builder.

type SetRefEdges

type SetRefEdges struct {
	// Set holds the value of the set edge.
	Set *Set `json:"set,omitempty"`
	// contains filtered or unexported fields
}

SetRefEdges holds the relations/edges for other nodes in the graph.

func (SetRefEdges) SetOrErr

func (e SetRefEdges) SetOrErr() (*Set, error)

SetOrErr returns the Set value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SetRefGroupBy

type SetRefGroupBy struct {
	// contains filtered or unexported fields
}

SetRefGroupBy is the group-by builder for SetRef entities.

func (*SetRefGroupBy) Aggregate

func (_g *SetRefGroupBy) Aggregate(fns ...AggregateFunc) *SetRefGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SetRefGroupBy) Bool

func (s *SetRefGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) BoolX

func (s *SetRefGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetRefGroupBy) Bools

func (s *SetRefGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) BoolsX

func (s *SetRefGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SetRefGroupBy) Float64

func (s *SetRefGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) Float64X

func (s *SetRefGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetRefGroupBy) Float64s

func (s *SetRefGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) Float64sX

func (s *SetRefGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetRefGroupBy) Int

func (s *SetRefGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) IntX

func (s *SetRefGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetRefGroupBy) Ints

func (s *SetRefGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) IntsX

func (s *SetRefGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SetRefGroupBy) Scan

func (_g *SetRefGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetRefGroupBy) ScanX

func (s *SetRefGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetRefGroupBy) String

func (s *SetRefGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) StringX

func (s *SetRefGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetRefGroupBy) Strings

func (s *SetRefGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetRefGroupBy) StringsX

func (s *SetRefGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetRefMutation

type SetRefMutation struct {
	// contains filtered or unexported fields
}

SetRefMutation represents an operation that mutates the SetRef nodes in the graph.

func (*SetRefMutation) AddField

func (m *SetRefMutation) 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 (*SetRefMutation) AddedEdges

func (m *SetRefMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SetRefMutation) AddedField

func (m *SetRefMutation) 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 (*SetRefMutation) AddedFields

func (m *SetRefMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SetRefMutation) AddedIDs

func (m *SetRefMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SetRefMutation) ClearEdge

func (m *SetRefMutation) 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 (*SetRefMutation) ClearField

func (m *SetRefMutation) 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 (*SetRefMutation) ClearSet

func (m *SetRefMutation) ClearSet()

ClearSet clears the "set" edge to the Set entity.

func (*SetRefMutation) ClearedEdges

func (m *SetRefMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SetRefMutation) ClearedFields

func (m *SetRefMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SetRefMutation) Client

func (m SetRefMutation) 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 (*SetRefMutation) EdgeCleared

func (m *SetRefMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SetRefMutation) ExecContext

func (c *SetRefMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefMutation) Field

func (m *SetRefMutation) 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 (*SetRefMutation) FieldCleared

func (m *SetRefMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SetRefMutation) Fields

func (m *SetRefMutation) 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 (*SetRefMutation) ID

func (m *SetRefMutation) 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 (*SetRefMutation) IDs

func (m *SetRefMutation) 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 (*SetRefMutation) OldField

func (m *SetRefMutation) 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 (*SetRefMutation) OldRef

func (m *SetRefMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the SetRef entity. If the SetRef 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 (*SetRefMutation) OldSetID

func (m *SetRefMutation) OldSetID(ctx context.Context) (v int64, err error)

OldSetID returns the old "set_id" field's value of the SetRef entity. If the SetRef 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 (*SetRefMutation) Op

func (m *SetRefMutation) Op() Op

Op returns the operation name.

func (*SetRefMutation) QueryContext

func (c *SetRefMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefMutation) Ref

func (m *SetRefMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*SetRefMutation) RemovedEdges

func (m *SetRefMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SetRefMutation) RemovedIDs

func (m *SetRefMutation) 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 (*SetRefMutation) ResetEdge

func (m *SetRefMutation) 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 (*SetRefMutation) ResetField

func (m *SetRefMutation) 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 (*SetRefMutation) ResetRef

func (m *SetRefMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*SetRefMutation) ResetSet

func (m *SetRefMutation) ResetSet()

ResetSet resets all changes to the "set" edge.

func (*SetRefMutation) ResetSetID

func (m *SetRefMutation) ResetSetID()

ResetSetID resets all changes to the "set_id" field.

func (*SetRefMutation) SetCleared

func (m *SetRefMutation) SetCleared() bool

SetCleared reports if the "set" edge to the Set entity was cleared.

func (*SetRefMutation) SetField

func (m *SetRefMutation) 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 (*SetRefMutation) SetID

func (m *SetRefMutation) SetID() (r int64, exists bool)

SetID returns the value of the "set_id" field in the mutation.

func (*SetRefMutation) SetIDs

func (m *SetRefMutation) SetIDs() (ids []int64)

SetIDs returns the "set" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SetID instead. It exists only for internal usage by the builders.

func (*SetRefMutation) SetOp

func (m *SetRefMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SetRefMutation) SetRef

func (m *SetRefMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*SetRefMutation) SetSetID

func (m *SetRefMutation) SetSetID(i int64)

SetSetID sets the "set_id" field.

func (SetRefMutation) Tx

func (m SetRefMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SetRefMutation) Type

func (m *SetRefMutation) Type() string

Type returns the node type of this mutation (SetRef).

func (*SetRefMutation) Where

func (m *SetRefMutation) Where(ps ...predicate.SetRef)

Where appends a list predicates to the SetRefMutation builder.

func (*SetRefMutation) WhereP

func (m *SetRefMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SetRefMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SetRefQuery

type SetRefQuery struct {
	// contains filtered or unexported fields
}

SetRefQuery is the builder for querying SetRef entities.

func (*SetRefQuery) Aggregate

func (_q *SetRefQuery) Aggregate(fns ...AggregateFunc) *SetRefSelect

Aggregate returns a SetRefSelect configured with the given aggregations.

func (*SetRefQuery) All

func (_q *SetRefQuery) All(ctx context.Context) ([]*SetRef, error)

All executes the query and returns a list of SetRefs.

func (*SetRefQuery) AllX

func (_q *SetRefQuery) AllX(ctx context.Context) []*SetRef

AllX is like All, but panics if an error occurs.

func (*SetRefQuery) Clone

func (_q *SetRefQuery) Clone() *SetRefQuery

Clone returns a duplicate of the SetRefQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SetRefQuery) Count

func (_q *SetRefQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SetRefQuery) CountX

func (_q *SetRefQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SetRefQuery) ExecContext

func (c *SetRefQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefQuery) Exist

func (_q *SetRefQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SetRefQuery) ExistX

func (_q *SetRefQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SetRefQuery) First

func (_q *SetRefQuery) First(ctx context.Context) (*SetRef, error)

First returns the first SetRef entity from the query. Returns a *NotFoundError when no SetRef was found.

func (*SetRefQuery) FirstID

func (_q *SetRefQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SetRef ID from the query. Returns a *NotFoundError when no SetRef ID was found.

func (*SetRefQuery) FirstIDX

func (_q *SetRefQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SetRefQuery) FirstX

func (_q *SetRefQuery) FirstX(ctx context.Context) *SetRef

FirstX is like First, but panics if an error occurs.

func (*SetRefQuery) ForShare

func (_q *SetRefQuery) ForShare(opts ...sql.LockOption) *SetRefQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*SetRefQuery) ForUpdate

func (_q *SetRefQuery) ForUpdate(opts ...sql.LockOption) *SetRefQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*SetRefQuery) GroupBy

func (_q *SetRefQuery) GroupBy(field string, fields ...string) *SetRefGroupBy

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 {
	SetID int64 `json:"set_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SetRef.Query().
	GroupBy(setref.FieldSetID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SetRefQuery) IDs

func (_q *SetRefQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of SetRef IDs.

func (*SetRefQuery) IDsX

func (_q *SetRefQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SetRefQuery) Limit

func (_q *SetRefQuery) Limit(limit int) *SetRefQuery

Limit the number of records to be returned by this query.

func (*SetRefQuery) Offset

func (_q *SetRefQuery) Offset(offset int) *SetRefQuery

Offset to start from.

func (*SetRefQuery) Only

func (_q *SetRefQuery) Only(ctx context.Context) (*SetRef, error)

Only returns a single SetRef entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SetRef entity is found. Returns a *NotFoundError when no SetRef entities are found.

func (*SetRefQuery) OnlyID

func (_q *SetRefQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SetRef ID in the query. Returns a *NotSingularError when more than one SetRef ID is found. Returns a *NotFoundError when no entities are found.

func (*SetRefQuery) OnlyIDX

func (_q *SetRefQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SetRefQuery) OnlyX

func (_q *SetRefQuery) OnlyX(ctx context.Context) *SetRef

OnlyX is like Only, but panics if an error occurs.

func (*SetRefQuery) Order

func (_q *SetRefQuery) Order(o ...setref.OrderOption) *SetRefQuery

Order specifies how the records should be ordered.

func (*SetRefQuery) QueryContext

func (c *SetRefQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefQuery) QuerySet

func (_q *SetRefQuery) QuerySet() *SetQuery

QuerySet chains the current query on the "set" edge.

func (*SetRefQuery) Select

func (_q *SetRefQuery) Select(fields ...string) *SetRefSelect

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 {
	SetID int64 `json:"set_id,omitempty"`
}

client.SetRef.Query().
	Select(setref.FieldSetID).
	Scan(ctx, &v)

func (*SetRefQuery) Unique

func (_q *SetRefQuery) Unique(unique bool) *SetRefQuery

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 (*SetRefQuery) Where

func (_q *SetRefQuery) Where(ps ...predicate.SetRef) *SetRefQuery

Where adds a new predicate for the SetRefQuery builder.

func (*SetRefQuery) WithSet

func (_q *SetRefQuery) WithSet(opts ...func(*SetQuery)) *SetRefQuery

WithSet tells the query-builder to eager-load the nodes that are connected to the "set" edge. The optional arguments are used to configure the query builder of the edge.

type SetRefSelect

type SetRefSelect struct {
	*SetRefQuery
	// contains filtered or unexported fields
}

SetRefSelect is the builder for selecting fields of SetRef entities.

func (*SetRefSelect) Aggregate

func (_s *SetRefSelect) Aggregate(fns ...AggregateFunc) *SetRefSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SetRefSelect) Bool

func (s *SetRefSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) BoolX

func (s *SetRefSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetRefSelect) Bools

func (s *SetRefSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) BoolsX

func (s *SetRefSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (SetRefSelect) ExecContext

func (c SetRefSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefSelect) Float64

func (s *SetRefSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) Float64X

func (s *SetRefSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetRefSelect) Float64s

func (s *SetRefSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) Float64sX

func (s *SetRefSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetRefSelect) Int

func (s *SetRefSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) IntX

func (s *SetRefSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetRefSelect) Ints

func (s *SetRefSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) IntsX

func (s *SetRefSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (SetRefSelect) QueryContext

func (c SetRefSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefSelect) Scan

func (_s *SetRefSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetRefSelect) ScanX

func (s *SetRefSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetRefSelect) String

func (s *SetRefSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) StringX

func (s *SetRefSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetRefSelect) Strings

func (s *SetRefSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetRefSelect) StringsX

func (s *SetRefSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetRefUpdate

type SetRefUpdate struct {
	// contains filtered or unexported fields
}

SetRefUpdate is the builder for updating SetRef entities.

func (*SetRefUpdate) ClearSet

func (_u *SetRefUpdate) ClearSet() *SetRefUpdate

ClearSet clears the "set" edge to the Set entity.

func (*SetRefUpdate) Exec

func (_u *SetRefUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetRefUpdate) ExecContext

func (c *SetRefUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefUpdate) ExecX

func (_u *SetRefUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefUpdate) Mutation

func (_u *SetRefUpdate) Mutation() *SetRefMutation

Mutation returns the SetRefMutation object of the builder.

func (*SetRefUpdate) QueryContext

func (c *SetRefUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefUpdate) Save

func (_u *SetRefUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SetRefUpdate) SaveX

func (_u *SetRefUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SetRefUpdate) SetNillableSetID

func (_u *SetRefUpdate) SetNillableSetID(v *int64) *SetRefUpdate

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*SetRefUpdate) SetRef

func (_u *SetRefUpdate) SetRef(v []byte) *SetRefUpdate

SetRef sets the "ref" field.

func (*SetRefUpdate) SetSet

func (_u *SetRefUpdate) SetSet(v *Set) *SetRefUpdate

SetSet sets the "set" edge to the Set entity.

func (*SetRefUpdate) SetSetID

func (_u *SetRefUpdate) SetSetID(v int64) *SetRefUpdate

SetSetID sets the "set_id" field.

func (*SetRefUpdate) Where

func (_u *SetRefUpdate) Where(ps ...predicate.SetRef) *SetRefUpdate

Where appends a list predicates to the SetRefUpdate builder.

type SetRefUpdateOne

type SetRefUpdateOne struct {
	// contains filtered or unexported fields
}

SetRefUpdateOne is the builder for updating a single SetRef entity.

func (*SetRefUpdateOne) ClearSet

func (_u *SetRefUpdateOne) ClearSet() *SetRefUpdateOne

ClearSet clears the "set" edge to the Set entity.

func (*SetRefUpdateOne) Exec

func (_u *SetRefUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SetRefUpdateOne) ExecContext

func (c *SetRefUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetRefUpdateOne) ExecX

func (_u *SetRefUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefUpdateOne) Mutation

func (_u *SetRefUpdateOne) Mutation() *SetRefMutation

Mutation returns the SetRefMutation object of the builder.

func (*SetRefUpdateOne) QueryContext

func (c *SetRefUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetRefUpdateOne) Save

func (_u *SetRefUpdateOne) Save(ctx context.Context) (*SetRef, error)

Save executes the query and returns the updated SetRef entity.

func (*SetRefUpdateOne) SaveX

func (_u *SetRefUpdateOne) SaveX(ctx context.Context) *SetRef

SaveX is like Save, but panics if an error occurs.

func (*SetRefUpdateOne) Select

func (_u *SetRefUpdateOne) Select(field string, fields ...string) *SetRefUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SetRefUpdateOne) SetNillableSetID

func (_u *SetRefUpdateOne) SetNillableSetID(v *int64) *SetRefUpdateOne

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*SetRefUpdateOne) SetRef

func (_u *SetRefUpdateOne) SetRef(v []byte) *SetRefUpdateOne

SetRef sets the "ref" field.

func (*SetRefUpdateOne) SetSet

func (_u *SetRefUpdateOne) SetSet(v *Set) *SetRefUpdateOne

SetSet sets the "set" edge to the Set entity.

func (*SetRefUpdateOne) SetSetID

func (_u *SetRefUpdateOne) SetSetID(v int64) *SetRefUpdateOne

SetSetID sets the "set_id" field.

func (*SetRefUpdateOne) Where

func (_u *SetRefUpdateOne) Where(ps ...predicate.SetRef) *SetRefUpdateOne

Where appends a list predicates to the SetRefUpdate builder.

type SetRefUpsert

type SetRefUpsert struct {
	*sql.UpdateSet
}

SetRefUpsert is the "OnConflict" setter.

func (*SetRefUpsert) SetRef

func (u *SetRefUpsert) SetRef(v []byte) *SetRefUpsert

SetRef sets the "ref" field.

func (*SetRefUpsert) SetSetID

func (u *SetRefUpsert) SetSetID(v int64) *SetRefUpsert

SetSetID sets the "set_id" field.

func (*SetRefUpsert) UpdateRef

func (u *SetRefUpsert) UpdateRef() *SetRefUpsert

UpdateRef sets the "ref" field to the value that was provided on create.

func (*SetRefUpsert) UpdateSetID

func (u *SetRefUpsert) UpdateSetID() *SetRefUpsert

UpdateSetID sets the "set_id" field to the value that was provided on create.

type SetRefUpsertBulk

type SetRefUpsertBulk struct {
	// contains filtered or unexported fields
}

SetRefUpsertBulk is the builder for "upsert"-ing a bulk of SetRef nodes.

func (*SetRefUpsertBulk) DoNothing

func (u *SetRefUpsertBulk) DoNothing() *SetRefUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SetRefUpsertBulk) Exec

func (u *SetRefUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SetRefUpsertBulk) ExecX

func (u *SetRefUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefUpsertBulk) Ignore

func (u *SetRefUpsertBulk) Ignore() *SetRefUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.SetRef.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SetRefUpsertBulk) SetRef

func (u *SetRefUpsertBulk) SetRef(v []byte) *SetRefUpsertBulk

SetRef sets the "ref" field.

func (*SetRefUpsertBulk) SetSetID

func (u *SetRefUpsertBulk) SetSetID(v int64) *SetRefUpsertBulk

SetSetID sets the "set_id" field.

func (*SetRefUpsertBulk) Update

func (u *SetRefUpsertBulk) Update(set func(*SetRefUpsert)) *SetRefUpsertBulk

Update allows overriding fields `UPDATE` values. See the SetRefCreateBulk.OnConflict documentation for more info.

func (*SetRefUpsertBulk) UpdateNewValues

func (u *SetRefUpsertBulk) UpdateNewValues() *SetRefUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.SetRef.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*SetRefUpsertBulk) UpdateRef

func (u *SetRefUpsertBulk) UpdateRef() *SetRefUpsertBulk

UpdateRef sets the "ref" field to the value that was provided on create.

func (*SetRefUpsertBulk) UpdateSetID

func (u *SetRefUpsertBulk) UpdateSetID() *SetRefUpsertBulk

UpdateSetID sets the "set_id" field to the value that was provided on create.

type SetRefUpsertOne

type SetRefUpsertOne struct {
	// contains filtered or unexported fields
}

SetRefUpsertOne is the builder for "upsert"-ing

one SetRef node.

func (*SetRefUpsertOne) DoNothing

func (u *SetRefUpsertOne) DoNothing() *SetRefUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SetRefUpsertOne) Exec

func (u *SetRefUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SetRefUpsertOne) ExecX

func (u *SetRefUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetRefUpsertOne) ID

func (u *SetRefUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SetRefUpsertOne) IDX

func (u *SetRefUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*SetRefUpsertOne) Ignore

func (u *SetRefUpsertOne) Ignore() *SetRefUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.SetRef.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SetRefUpsertOne) SetRef

func (u *SetRefUpsertOne) SetRef(v []byte) *SetRefUpsertOne

SetRef sets the "ref" field.

func (*SetRefUpsertOne) SetSetID

func (u *SetRefUpsertOne) SetSetID(v int64) *SetRefUpsertOne

SetSetID sets the "set_id" field.

func (*SetRefUpsertOne) Update

func (u *SetRefUpsertOne) Update(set func(*SetRefUpsert)) *SetRefUpsertOne

Update allows overriding fields `UPDATE` values. See the SetRefCreate.OnConflict documentation for more info.

func (*SetRefUpsertOne) UpdateNewValues

func (u *SetRefUpsertOne) UpdateNewValues() *SetRefUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.SetRef.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*SetRefUpsertOne) UpdateRef

func (u *SetRefUpsertOne) UpdateRef() *SetRefUpsertOne

UpdateRef sets the "ref" field to the value that was provided on create.

func (*SetRefUpsertOne) UpdateSetID

func (u *SetRefUpsertOne) UpdateSetID() *SetRefUpsertOne

UpdateSetID sets the "set_id" field to the value that was provided on create.

type SetRefs

type SetRefs []*SetRef

SetRefs is a parsable slice of SetRef.

type SetSelect

type SetSelect struct {
	*SetQuery
	// contains filtered or unexported fields
}

SetSelect is the builder for selecting fields of Set entities.

func (*SetSelect) Aggregate

func (_s *SetSelect) Aggregate(fns ...AggregateFunc) *SetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SetSelect) Bool

func (s *SetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetSelect) BoolX

func (s *SetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetSelect) Bools

func (s *SetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetSelect) BoolsX

func (s *SetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (SetSelect) ExecContext

func (c SetSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetSelect) Float64

func (s *SetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetSelect) Float64X

func (s *SetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetSelect) Float64s

func (s *SetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetSelect) Float64sX

func (s *SetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetSelect) Int

func (s *SetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetSelect) IntX

func (s *SetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetSelect) Ints

func (s *SetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetSelect) IntsX

func (s *SetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (SetSelect) QueryContext

func (c SetSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetSelect) Scan

func (_s *SetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetSelect) ScanX

func (s *SetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetSelect) String

func (s *SetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetSelect) StringX

func (s *SetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetSelect) Strings

func (s *SetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetSelect) StringsX

func (s *SetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetUpdate

type SetUpdate struct {
	// contains filtered or unexported fields
}

SetUpdate is the builder for updating Set entities.

func (*SetUpdate) AddAloneSize

func (_u *SetUpdate) AddAloneSize(v int64) *SetUpdate

AddAloneSize adds value to the "alone_size" field.

func (*SetUpdate) AddDamaged

func (_u *SetUpdate) AddDamaged(v ...*DamagedPath) *SetUpdate

AddDamaged adds the "damaged" edges to the DamagedPath entity.

func (*SetUpdate) AddDamagedIDs

func (_u *SetUpdate) AddDamagedIDs(ids ...int) *SetUpdate

AddDamagedIDs adds the "damaged" edge to the DamagedPath entity by IDs.

func (*SetUpdate) AddDeduplicatedAloneSize

func (_u *SetUpdate) AddDeduplicatedAloneSize(v int64) *SetUpdate

AddDeduplicatedAloneSize adds value to the "deduplicated_alone_size" field.

func (*SetUpdate) AddDeduplicatedSize

func (_u *SetUpdate) AddDeduplicatedSize(v int64) *SetUpdate

AddDeduplicatedSize adds value to the "deduplicated_size" field.

func (*SetUpdate) AddExclusiveSize

func (_u *SetUpdate) AddExclusiveSize(v int64) *SetUpdate

AddExclusiveSize adds value to the "exclusive_size" field.

func (*SetUpdate) AddFileIDs

func (_u *SetUpdate) AddFileIDs(ids ...int) *SetUpdate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*SetUpdate) AddFiles

func (_u *SetUpdate) AddFiles(v ...*File) *SetUpdate

AddFiles adds the "files" edges to the File entity.

func (*SetUpdate) AddKeptLogicalSize

func (_u *SetUpdate) AddKeptLogicalSize(v int64) *SetUpdate

AddKeptLogicalSize adds value to the "kept_logical_size" field.

func (*SetUpdate) AddLogicalSize

func (_u *SetUpdate) AddLogicalSize(v int64) *SetUpdate

AddLogicalSize adds value to the "logical_size" field.

func (*SetUpdate) AddPhysicalSize

func (_u *SetUpdate) AddPhysicalSize(v int64) *SetUpdate

AddPhysicalSize adds value to the "physical_size" field.

func (*SetUpdate) AddRefIDs

func (_u *SetUpdate) AddRefIDs(ids ...int) *SetUpdate

AddRefIDs adds the "refs" edge to the SetRef entity by IDs.

func (*SetUpdate) AddRefs

func (_u *SetUpdate) AddRefs(v ...*SetRef) *SetUpdate

AddRefs adds the "refs" edges to the SetRef entity.

func (*SetUpdate) AddTreeIDs

func (_u *SetUpdate) AddTreeIDs(ids ...int) *SetUpdate

AddTreeIDs adds the "trees" edge to the Tree entity by IDs.

func (*SetUpdate) AddTrees

func (_u *SetUpdate) AddTrees(v ...*Tree) *SetUpdate

AddTrees adds the "trees" edges to the Tree entity.

func (*SetUpdate) AddUniqueSize

func (_u *SetUpdate) AddUniqueSize(v int64) *SetUpdate

AddUniqueSize adds value to the "unique_size" field.

func (*SetUpdate) ClearAloneSize

func (_u *SetUpdate) ClearAloneSize() *SetUpdate

ClearAloneSize clears the value of the "alone_size" field.

func (*SetUpdate) ClearDamaged

func (_u *SetUpdate) ClearDamaged() *SetUpdate

ClearDamaged clears all "damaged" edges to the DamagedPath entity.

func (*SetUpdate) ClearDeduplicatedAloneSize

func (_u *SetUpdate) ClearDeduplicatedAloneSize() *SetUpdate

ClearDeduplicatedAloneSize clears the value of the "deduplicated_alone_size" field.

func (*SetUpdate) ClearDeduplicatedSize

func (_u *SetUpdate) ClearDeduplicatedSize() *SetUpdate

ClearDeduplicatedSize clears the value of the "deduplicated_size" field.

func (*SetUpdate) ClearExclusiveSize

func (_u *SetUpdate) ClearExclusiveSize() *SetUpdate

ClearExclusiveSize clears the value of the "exclusive_size" field.

func (*SetUpdate) ClearFiles

func (_u *SetUpdate) ClearFiles() *SetUpdate

ClearFiles clears all "files" edges to the File entity.

func (*SetUpdate) ClearKeptLogicalSize

func (_u *SetUpdate) ClearKeptLogicalSize() *SetUpdate

ClearKeptLogicalSize clears the value of the "kept_logical_size" field.

func (*SetUpdate) ClearLogicalSize

func (_u *SetUpdate) ClearLogicalSize() *SetUpdate

ClearLogicalSize clears the value of the "logical_size" field.

func (*SetUpdate) ClearPhysicalSize

func (_u *SetUpdate) ClearPhysicalSize() *SetUpdate

ClearPhysicalSize clears the value of the "physical_size" field.

func (*SetUpdate) ClearRefs

func (_u *SetUpdate) ClearRefs() *SetUpdate

ClearRefs clears all "refs" edges to the SetRef entity.

func (*SetUpdate) ClearRetentionPolicy

func (_u *SetUpdate) ClearRetentionPolicy() *SetUpdate

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SetUpdate) ClearSizesDigest

func (_u *SetUpdate) ClearSizesDigest() *SetUpdate

ClearSizesDigest clears the value of the "sizes_digest" field.

func (*SetUpdate) ClearTrees

func (_u *SetUpdate) ClearTrees() *SetUpdate

ClearTrees clears all "trees" edges to the Tree entity.

func (*SetUpdate) ClearUniqueSize

func (_u *SetUpdate) ClearUniqueSize() *SetUpdate

ClearUniqueSize clears the value of the "unique_size" field.

func (*SetUpdate) Exec

func (_u *SetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetUpdate) ExecContext

func (c *SetUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetUpdate) ExecX

func (_u *SetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetUpdate) Mutation

func (_u *SetUpdate) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetUpdate) QueryContext

func (c *SetUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetUpdate) RemoveDamaged

func (_u *SetUpdate) RemoveDamaged(v ...*DamagedPath) *SetUpdate

RemoveDamaged removes "damaged" edges to DamagedPath entities.

func (*SetUpdate) RemoveDamagedIDs

func (_u *SetUpdate) RemoveDamagedIDs(ids ...int) *SetUpdate

RemoveDamagedIDs removes the "damaged" edge to DamagedPath entities by IDs.

func (*SetUpdate) RemoveFileIDs

func (_u *SetUpdate) RemoveFileIDs(ids ...int) *SetUpdate

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*SetUpdate) RemoveFiles

func (_u *SetUpdate) RemoveFiles(v ...*File) *SetUpdate

RemoveFiles removes "files" edges to File entities.

func (*SetUpdate) RemoveRefIDs

func (_u *SetUpdate) RemoveRefIDs(ids ...int) *SetUpdate

RemoveRefIDs removes the "refs" edge to SetRef entities by IDs.

func (*SetUpdate) RemoveRefs

func (_u *SetUpdate) RemoveRefs(v ...*SetRef) *SetUpdate

RemoveRefs removes "refs" edges to SetRef entities.

func (*SetUpdate) RemoveTreeIDs

func (_u *SetUpdate) RemoveTreeIDs(ids ...int) *SetUpdate

RemoveTreeIDs removes the "trees" edge to Tree entities by IDs.

func (*SetUpdate) RemoveTrees

func (_u *SetUpdate) RemoveTrees(v ...*Tree) *SetUpdate

RemoveTrees removes "trees" edges to Tree entities.

func (*SetUpdate) Save

func (_u *SetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SetUpdate) SaveX

func (_u *SetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SetUpdate) SetAloneSize

func (_u *SetUpdate) SetAloneSize(v int64) *SetUpdate

SetAloneSize sets the "alone_size" field.

func (*SetUpdate) SetDeduplicatedAloneSize

func (_u *SetUpdate) SetDeduplicatedAloneSize(v int64) *SetUpdate

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetUpdate) SetDeduplicatedSize

func (_u *SetUpdate) SetDeduplicatedSize(v int64) *SetUpdate

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetUpdate) SetErase

func (_u *SetUpdate) SetErase(v bool) *SetUpdate

SetErase sets the "erase" field.

func (*SetUpdate) SetExclusiveSize

func (_u *SetUpdate) SetExclusiveSize(v int64) *SetUpdate

SetExclusiveSize sets the "exclusive_size" field.

func (*SetUpdate) SetKeptLogicalSize

func (_u *SetUpdate) SetKeptLogicalSize(v int64) *SetUpdate

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetUpdate) SetLogicalSize

func (_u *SetUpdate) SetLogicalSize(v int64) *SetUpdate

SetLogicalSize sets the "logical_size" field.

func (*SetUpdate) SetName

func (_u *SetUpdate) SetName(v string) *SetUpdate

SetName sets the "name" field.

func (*SetUpdate) SetNillableAloneSize

func (_u *SetUpdate) SetNillableAloneSize(v *int64) *SetUpdate

SetNillableAloneSize sets the "alone_size" field if the given value is not nil.

func (*SetUpdate) SetNillableDeduplicatedAloneSize

func (_u *SetUpdate) SetNillableDeduplicatedAloneSize(v *int64) *SetUpdate

SetNillableDeduplicatedAloneSize sets the "deduplicated_alone_size" field if the given value is not nil.

func (*SetUpdate) SetNillableDeduplicatedSize

func (_u *SetUpdate) SetNillableDeduplicatedSize(v *int64) *SetUpdate

SetNillableDeduplicatedSize sets the "deduplicated_size" field if the given value is not nil.

func (*SetUpdate) SetNillableErase

func (_u *SetUpdate) SetNillableErase(v *bool) *SetUpdate

SetNillableErase sets the "erase" field if the given value is not nil.

func (*SetUpdate) SetNillableExclusiveSize

func (_u *SetUpdate) SetNillableExclusiveSize(v *int64) *SetUpdate

SetNillableExclusiveSize sets the "exclusive_size" field if the given value is not nil.

func (*SetUpdate) SetNillableKeptLogicalSize

func (_u *SetUpdate) SetNillableKeptLogicalSize(v *int64) *SetUpdate

SetNillableKeptLogicalSize sets the "kept_logical_size" field if the given value is not nil.

func (*SetUpdate) SetNillableLogicalSize

func (_u *SetUpdate) SetNillableLogicalSize(v *int64) *SetUpdate

SetNillableLogicalSize sets the "logical_size" field if the given value is not nil.

func (*SetUpdate) SetNillableName

func (_u *SetUpdate) SetNillableName(v *string) *SetUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SetUpdate) SetNillablePhysicalSize

func (_u *SetUpdate) SetNillablePhysicalSize(v *int64) *SetUpdate

SetNillablePhysicalSize sets the "physical_size" field if the given value is not nil.

func (*SetUpdate) SetNillableRescan

func (_u *SetUpdate) SetNillableRescan(v *bool) *SetUpdate

SetNillableRescan sets the "rescan" field if the given value is not nil.

func (*SetUpdate) SetNillableRetentionPaused

func (_u *SetUpdate) SetNillableRetentionPaused(v *bool) *SetUpdate

SetNillableRetentionPaused sets the "retention_paused" field if the given value is not nil.

func (*SetUpdate) SetNillableRetentionPolicy

func (_u *SetUpdate) SetNillableRetentionPolicy(v *string) *SetUpdate

SetNillableRetentionPolicy sets the "retention_policy" field if the given value is not nil.

func (*SetUpdate) SetNillableState

func (_u *SetUpdate) SetNillableState(v *set.State) *SetUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*SetUpdate) SetNillableUniqueSize

func (_u *SetUpdate) SetNillableUniqueSize(v *int64) *SetUpdate

SetNillableUniqueSize sets the "unique_size" field if the given value is not nil.

func (*SetUpdate) SetPhysicalSize

func (_u *SetUpdate) SetPhysicalSize(v int64) *SetUpdate

SetPhysicalSize sets the "physical_size" field.

func (*SetUpdate) SetRescan

func (_u *SetUpdate) SetRescan(v bool) *SetUpdate

SetRescan sets the "rescan" field.

func (*SetUpdate) SetRetentionPaused

func (_u *SetUpdate) SetRetentionPaused(v bool) *SetUpdate

SetRetentionPaused sets the "retention_paused" field.

func (*SetUpdate) SetRetentionPolicy

func (_u *SetUpdate) SetRetentionPolicy(v string) *SetUpdate

SetRetentionPolicy sets the "retention_policy" field.

func (*SetUpdate) SetSizesDigest

func (_u *SetUpdate) SetSizesDigest(v []byte) *SetUpdate

SetSizesDigest sets the "sizes_digest" field.

func (*SetUpdate) SetState

func (_u *SetUpdate) SetState(v set.State) *SetUpdate

SetState sets the "state" field.

func (*SetUpdate) SetUniqueSize

func (_u *SetUpdate) SetUniqueSize(v int64) *SetUpdate

SetUniqueSize sets the "unique_size" field.

func (*SetUpdate) Where

func (_u *SetUpdate) Where(ps ...predicate.Set) *SetUpdate

Where appends a list predicates to the SetUpdate builder.

type SetUpdateOne

type SetUpdateOne struct {
	// contains filtered or unexported fields
}

SetUpdateOne is the builder for updating a single Set entity.

func (*SetUpdateOne) AddAloneSize

func (_u *SetUpdateOne) AddAloneSize(v int64) *SetUpdateOne

AddAloneSize adds value to the "alone_size" field.

func (*SetUpdateOne) AddDamaged

func (_u *SetUpdateOne) AddDamaged(v ...*DamagedPath) *SetUpdateOne

AddDamaged adds the "damaged" edges to the DamagedPath entity.

func (*SetUpdateOne) AddDamagedIDs

func (_u *SetUpdateOne) AddDamagedIDs(ids ...int) *SetUpdateOne

AddDamagedIDs adds the "damaged" edge to the DamagedPath entity by IDs.

func (*SetUpdateOne) AddDeduplicatedAloneSize

func (_u *SetUpdateOne) AddDeduplicatedAloneSize(v int64) *SetUpdateOne

AddDeduplicatedAloneSize adds value to the "deduplicated_alone_size" field.

func (*SetUpdateOne) AddDeduplicatedSize

func (_u *SetUpdateOne) AddDeduplicatedSize(v int64) *SetUpdateOne

AddDeduplicatedSize adds value to the "deduplicated_size" field.

func (*SetUpdateOne) AddExclusiveSize

func (_u *SetUpdateOne) AddExclusiveSize(v int64) *SetUpdateOne

AddExclusiveSize adds value to the "exclusive_size" field.

func (*SetUpdateOne) AddFileIDs

func (_u *SetUpdateOne) AddFileIDs(ids ...int) *SetUpdateOne

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*SetUpdateOne) AddFiles

func (_u *SetUpdateOne) AddFiles(v ...*File) *SetUpdateOne

AddFiles adds the "files" edges to the File entity.

func (*SetUpdateOne) AddKeptLogicalSize

func (_u *SetUpdateOne) AddKeptLogicalSize(v int64) *SetUpdateOne

AddKeptLogicalSize adds value to the "kept_logical_size" field.

func (*SetUpdateOne) AddLogicalSize

func (_u *SetUpdateOne) AddLogicalSize(v int64) *SetUpdateOne

AddLogicalSize adds value to the "logical_size" field.

func (*SetUpdateOne) AddPhysicalSize

func (_u *SetUpdateOne) AddPhysicalSize(v int64) *SetUpdateOne

AddPhysicalSize adds value to the "physical_size" field.

func (*SetUpdateOne) AddRefIDs

func (_u *SetUpdateOne) AddRefIDs(ids ...int) *SetUpdateOne

AddRefIDs adds the "refs" edge to the SetRef entity by IDs.

func (*SetUpdateOne) AddRefs

func (_u *SetUpdateOne) AddRefs(v ...*SetRef) *SetUpdateOne

AddRefs adds the "refs" edges to the SetRef entity.

func (*SetUpdateOne) AddTreeIDs

func (_u *SetUpdateOne) AddTreeIDs(ids ...int) *SetUpdateOne

AddTreeIDs adds the "trees" edge to the Tree entity by IDs.

func (*SetUpdateOne) AddTrees

func (_u *SetUpdateOne) AddTrees(v ...*Tree) *SetUpdateOne

AddTrees adds the "trees" edges to the Tree entity.

func (*SetUpdateOne) AddUniqueSize

func (_u *SetUpdateOne) AddUniqueSize(v int64) *SetUpdateOne

AddUniqueSize adds value to the "unique_size" field.

func (*SetUpdateOne) ClearAloneSize

func (_u *SetUpdateOne) ClearAloneSize() *SetUpdateOne

ClearAloneSize clears the value of the "alone_size" field.

func (*SetUpdateOne) ClearDamaged

func (_u *SetUpdateOne) ClearDamaged() *SetUpdateOne

ClearDamaged clears all "damaged" edges to the DamagedPath entity.

func (*SetUpdateOne) ClearDeduplicatedAloneSize

func (_u *SetUpdateOne) ClearDeduplicatedAloneSize() *SetUpdateOne

ClearDeduplicatedAloneSize clears the value of the "deduplicated_alone_size" field.

func (*SetUpdateOne) ClearDeduplicatedSize

func (_u *SetUpdateOne) ClearDeduplicatedSize() *SetUpdateOne

ClearDeduplicatedSize clears the value of the "deduplicated_size" field.

func (*SetUpdateOne) ClearExclusiveSize

func (_u *SetUpdateOne) ClearExclusiveSize() *SetUpdateOne

ClearExclusiveSize clears the value of the "exclusive_size" field.

func (*SetUpdateOne) ClearFiles

func (_u *SetUpdateOne) ClearFiles() *SetUpdateOne

ClearFiles clears all "files" edges to the File entity.

func (*SetUpdateOne) ClearKeptLogicalSize

func (_u *SetUpdateOne) ClearKeptLogicalSize() *SetUpdateOne

ClearKeptLogicalSize clears the value of the "kept_logical_size" field.

func (*SetUpdateOne) ClearLogicalSize

func (_u *SetUpdateOne) ClearLogicalSize() *SetUpdateOne

ClearLogicalSize clears the value of the "logical_size" field.

func (*SetUpdateOne) ClearPhysicalSize

func (_u *SetUpdateOne) ClearPhysicalSize() *SetUpdateOne

ClearPhysicalSize clears the value of the "physical_size" field.

func (*SetUpdateOne) ClearRefs

func (_u *SetUpdateOne) ClearRefs() *SetUpdateOne

ClearRefs clears all "refs" edges to the SetRef entity.

func (*SetUpdateOne) ClearRetentionPolicy

func (_u *SetUpdateOne) ClearRetentionPolicy() *SetUpdateOne

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SetUpdateOne) ClearSizesDigest

func (_u *SetUpdateOne) ClearSizesDigest() *SetUpdateOne

ClearSizesDigest clears the value of the "sizes_digest" field.

func (*SetUpdateOne) ClearTrees

func (_u *SetUpdateOne) ClearTrees() *SetUpdateOne

ClearTrees clears all "trees" edges to the Tree entity.

func (*SetUpdateOne) ClearUniqueSize

func (_u *SetUpdateOne) ClearUniqueSize() *SetUpdateOne

ClearUniqueSize clears the value of the "unique_size" field.

func (*SetUpdateOne) Exec

func (_u *SetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SetUpdateOne) ExecContext

func (c *SetUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SetUpdateOne) ExecX

func (_u *SetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetUpdateOne) Mutation

func (_u *SetUpdateOne) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetUpdateOne) QueryContext

func (c *SetUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SetUpdateOne) RemoveDamaged

func (_u *SetUpdateOne) RemoveDamaged(v ...*DamagedPath) *SetUpdateOne

RemoveDamaged removes "damaged" edges to DamagedPath entities.

func (*SetUpdateOne) RemoveDamagedIDs

func (_u *SetUpdateOne) RemoveDamagedIDs(ids ...int) *SetUpdateOne

RemoveDamagedIDs removes the "damaged" edge to DamagedPath entities by IDs.

func (*SetUpdateOne) RemoveFileIDs

func (_u *SetUpdateOne) RemoveFileIDs(ids ...int) *SetUpdateOne

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*SetUpdateOne) RemoveFiles

func (_u *SetUpdateOne) RemoveFiles(v ...*File) *SetUpdateOne

RemoveFiles removes "files" edges to File entities.

func (*SetUpdateOne) RemoveRefIDs

func (_u *SetUpdateOne) RemoveRefIDs(ids ...int) *SetUpdateOne

RemoveRefIDs removes the "refs" edge to SetRef entities by IDs.

func (*SetUpdateOne) RemoveRefs

func (_u *SetUpdateOne) RemoveRefs(v ...*SetRef) *SetUpdateOne

RemoveRefs removes "refs" edges to SetRef entities.

func (*SetUpdateOne) RemoveTreeIDs

func (_u *SetUpdateOne) RemoveTreeIDs(ids ...int) *SetUpdateOne

RemoveTreeIDs removes the "trees" edge to Tree entities by IDs.

func (*SetUpdateOne) RemoveTrees

func (_u *SetUpdateOne) RemoveTrees(v ...*Tree) *SetUpdateOne

RemoveTrees removes "trees" edges to Tree entities.

func (*SetUpdateOne) Save

func (_u *SetUpdateOne) Save(ctx context.Context) (*Set, error)

Save executes the query and returns the updated Set entity.

func (*SetUpdateOne) SaveX

func (_u *SetUpdateOne) SaveX(ctx context.Context) *Set

SaveX is like Save, but panics if an error occurs.

func (*SetUpdateOne) Select

func (_u *SetUpdateOne) Select(field string, fields ...string) *SetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SetUpdateOne) SetAloneSize

func (_u *SetUpdateOne) SetAloneSize(v int64) *SetUpdateOne

SetAloneSize sets the "alone_size" field.

func (*SetUpdateOne) SetDeduplicatedAloneSize

func (_u *SetUpdateOne) SetDeduplicatedAloneSize(v int64) *SetUpdateOne

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetUpdateOne) SetDeduplicatedSize

func (_u *SetUpdateOne) SetDeduplicatedSize(v int64) *SetUpdateOne

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetUpdateOne) SetErase

func (_u *SetUpdateOne) SetErase(v bool) *SetUpdateOne

SetErase sets the "erase" field.

func (*SetUpdateOne) SetExclusiveSize

func (_u *SetUpdateOne) SetExclusiveSize(v int64) *SetUpdateOne

SetExclusiveSize sets the "exclusive_size" field.

func (*SetUpdateOne) SetKeptLogicalSize

func (_u *SetUpdateOne) SetKeptLogicalSize(v int64) *SetUpdateOne

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetUpdateOne) SetLogicalSize

func (_u *SetUpdateOne) SetLogicalSize(v int64) *SetUpdateOne

SetLogicalSize sets the "logical_size" field.

func (*SetUpdateOne) SetName

func (_u *SetUpdateOne) SetName(v string) *SetUpdateOne

SetName sets the "name" field.

func (*SetUpdateOne) SetNillableAloneSize

func (_u *SetUpdateOne) SetNillableAloneSize(v *int64) *SetUpdateOne

SetNillableAloneSize sets the "alone_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableDeduplicatedAloneSize

func (_u *SetUpdateOne) SetNillableDeduplicatedAloneSize(v *int64) *SetUpdateOne

SetNillableDeduplicatedAloneSize sets the "deduplicated_alone_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableDeduplicatedSize

func (_u *SetUpdateOne) SetNillableDeduplicatedSize(v *int64) *SetUpdateOne

SetNillableDeduplicatedSize sets the "deduplicated_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableErase

func (_u *SetUpdateOne) SetNillableErase(v *bool) *SetUpdateOne

SetNillableErase sets the "erase" field if the given value is not nil.

func (*SetUpdateOne) SetNillableExclusiveSize

func (_u *SetUpdateOne) SetNillableExclusiveSize(v *int64) *SetUpdateOne

SetNillableExclusiveSize sets the "exclusive_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableKeptLogicalSize

func (_u *SetUpdateOne) SetNillableKeptLogicalSize(v *int64) *SetUpdateOne

SetNillableKeptLogicalSize sets the "kept_logical_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableLogicalSize

func (_u *SetUpdateOne) SetNillableLogicalSize(v *int64) *SetUpdateOne

SetNillableLogicalSize sets the "logical_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableName

func (_u *SetUpdateOne) SetNillableName(v *string) *SetUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SetUpdateOne) SetNillablePhysicalSize

func (_u *SetUpdateOne) SetNillablePhysicalSize(v *int64) *SetUpdateOne

SetNillablePhysicalSize sets the "physical_size" field if the given value is not nil.

func (*SetUpdateOne) SetNillableRescan

func (_u *SetUpdateOne) SetNillableRescan(v *bool) *SetUpdateOne

SetNillableRescan sets the "rescan" field if the given value is not nil.

func (*SetUpdateOne) SetNillableRetentionPaused

func (_u *SetUpdateOne) SetNillableRetentionPaused(v *bool) *SetUpdateOne

SetNillableRetentionPaused sets the "retention_paused" field if the given value is not nil.

func (*SetUpdateOne) SetNillableRetentionPolicy

func (_u *SetUpdateOne) SetNillableRetentionPolicy(v *string) *SetUpdateOne

SetNillableRetentionPolicy sets the "retention_policy" field if the given value is not nil.

func (*SetUpdateOne) SetNillableState

func (_u *SetUpdateOne) SetNillableState(v *set.State) *SetUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*SetUpdateOne) SetNillableUniqueSize

func (_u *SetUpdateOne) SetNillableUniqueSize(v *int64) *SetUpdateOne

SetNillableUniqueSize sets the "unique_size" field if the given value is not nil.

func (*SetUpdateOne) SetPhysicalSize

func (_u *SetUpdateOne) SetPhysicalSize(v int64) *SetUpdateOne

SetPhysicalSize sets the "physical_size" field.

func (*SetUpdateOne) SetRescan

func (_u *SetUpdateOne) SetRescan(v bool) *SetUpdateOne

SetRescan sets the "rescan" field.

func (*SetUpdateOne) SetRetentionPaused

func (_u *SetUpdateOne) SetRetentionPaused(v bool) *SetUpdateOne

SetRetentionPaused sets the "retention_paused" field.

func (*SetUpdateOne) SetRetentionPolicy

func (_u *SetUpdateOne) SetRetentionPolicy(v string) *SetUpdateOne

SetRetentionPolicy sets the "retention_policy" field.

func (*SetUpdateOne) SetSizesDigest

func (_u *SetUpdateOne) SetSizesDigest(v []byte) *SetUpdateOne

SetSizesDigest sets the "sizes_digest" field.

func (*SetUpdateOne) SetState

func (_u *SetUpdateOne) SetState(v set.State) *SetUpdateOne

SetState sets the "state" field.

func (*SetUpdateOne) SetUniqueSize

func (_u *SetUpdateOne) SetUniqueSize(v int64) *SetUpdateOne

SetUniqueSize sets the "unique_size" field.

func (*SetUpdateOne) Where

func (_u *SetUpdateOne) Where(ps ...predicate.Set) *SetUpdateOne

Where appends a list predicates to the SetUpdate builder.

type SetUpsert

type SetUpsert struct {
	*sql.UpdateSet
}

SetUpsert is the "OnConflict" setter.

func (*SetUpsert) AddAloneSize

func (u *SetUpsert) AddAloneSize(v int64) *SetUpsert

AddAloneSize adds v to the "alone_size" field.

func (*SetUpsert) AddDeduplicatedAloneSize

func (u *SetUpsert) AddDeduplicatedAloneSize(v int64) *SetUpsert

AddDeduplicatedAloneSize adds v to the "deduplicated_alone_size" field.

func (*SetUpsert) AddDeduplicatedSize

func (u *SetUpsert) AddDeduplicatedSize(v int64) *SetUpsert

AddDeduplicatedSize adds v to the "deduplicated_size" field.

func (*SetUpsert) AddExclusiveSize

func (u *SetUpsert) AddExclusiveSize(v int64) *SetUpsert

AddExclusiveSize adds v to the "exclusive_size" field.

func (*SetUpsert) AddKeptLogicalSize

func (u *SetUpsert) AddKeptLogicalSize(v int64) *SetUpsert

AddKeptLogicalSize adds v to the "kept_logical_size" field.

func (*SetUpsert) AddLogicalSize

func (u *SetUpsert) AddLogicalSize(v int64) *SetUpsert

AddLogicalSize adds v to the "logical_size" field.

func (*SetUpsert) AddPhysicalSize

func (u *SetUpsert) AddPhysicalSize(v int64) *SetUpsert

AddPhysicalSize adds v to the "physical_size" field.

func (*SetUpsert) AddUniqueSize

func (u *SetUpsert) AddUniqueSize(v int64) *SetUpsert

AddUniqueSize adds v to the "unique_size" field.

func (*SetUpsert) ClearAloneSize

func (u *SetUpsert) ClearAloneSize() *SetUpsert

ClearAloneSize clears the value of the "alone_size" field.

func (*SetUpsert) ClearDeduplicatedAloneSize

func (u *SetUpsert) ClearDeduplicatedAloneSize() *SetUpsert

ClearDeduplicatedAloneSize clears the value of the "deduplicated_alone_size" field.

func (*SetUpsert) ClearDeduplicatedSize

func (u *SetUpsert) ClearDeduplicatedSize() *SetUpsert

ClearDeduplicatedSize clears the value of the "deduplicated_size" field.

func (*SetUpsert) ClearExclusiveSize

func (u *SetUpsert) ClearExclusiveSize() *SetUpsert

ClearExclusiveSize clears the value of the "exclusive_size" field.

func (*SetUpsert) ClearKeptLogicalSize

func (u *SetUpsert) ClearKeptLogicalSize() *SetUpsert

ClearKeptLogicalSize clears the value of the "kept_logical_size" field.

func (*SetUpsert) ClearLogicalSize

func (u *SetUpsert) ClearLogicalSize() *SetUpsert

ClearLogicalSize clears the value of the "logical_size" field.

func (*SetUpsert) ClearPhysicalSize

func (u *SetUpsert) ClearPhysicalSize() *SetUpsert

ClearPhysicalSize clears the value of the "physical_size" field.

func (*SetUpsert) ClearRetentionPolicy

func (u *SetUpsert) ClearRetentionPolicy() *SetUpsert

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SetUpsert) ClearSizesDigest

func (u *SetUpsert) ClearSizesDigest() *SetUpsert

ClearSizesDigest clears the value of the "sizes_digest" field.

func (*SetUpsert) ClearUniqueSize

func (u *SetUpsert) ClearUniqueSize() *SetUpsert

ClearUniqueSize clears the value of the "unique_size" field.

func (*SetUpsert) SetAloneSize

func (u *SetUpsert) SetAloneSize(v int64) *SetUpsert

SetAloneSize sets the "alone_size" field.

func (*SetUpsert) SetDeduplicatedAloneSize

func (u *SetUpsert) SetDeduplicatedAloneSize(v int64) *SetUpsert

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetUpsert) SetDeduplicatedSize

func (u *SetUpsert) SetDeduplicatedSize(v int64) *SetUpsert

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetUpsert) SetErase

func (u *SetUpsert) SetErase(v bool) *SetUpsert

SetErase sets the "erase" field.

func (*SetUpsert) SetExclusiveSize

func (u *SetUpsert) SetExclusiveSize(v int64) *SetUpsert

SetExclusiveSize sets the "exclusive_size" field.

func (*SetUpsert) SetKeptLogicalSize

func (u *SetUpsert) SetKeptLogicalSize(v int64) *SetUpsert

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetUpsert) SetLogicalSize

func (u *SetUpsert) SetLogicalSize(v int64) *SetUpsert

SetLogicalSize sets the "logical_size" field.

func (*SetUpsert) SetName

func (u *SetUpsert) SetName(v string) *SetUpsert

SetName sets the "name" field.

func (*SetUpsert) SetPhysicalSize

func (u *SetUpsert) SetPhysicalSize(v int64) *SetUpsert

SetPhysicalSize sets the "physical_size" field.

func (*SetUpsert) SetRescan

func (u *SetUpsert) SetRescan(v bool) *SetUpsert

SetRescan sets the "rescan" field.

func (*SetUpsert) SetRetentionPaused

func (u *SetUpsert) SetRetentionPaused(v bool) *SetUpsert

SetRetentionPaused sets the "retention_paused" field.

func (*SetUpsert) SetRetentionPolicy

func (u *SetUpsert) SetRetentionPolicy(v string) *SetUpsert

SetRetentionPolicy sets the "retention_policy" field.

func (*SetUpsert) SetSizesDigest

func (u *SetUpsert) SetSizesDigest(v []byte) *SetUpsert

SetSizesDigest sets the "sizes_digest" field.

func (*SetUpsert) SetState

func (u *SetUpsert) SetState(v set.State) *SetUpsert

SetState sets the "state" field.

func (*SetUpsert) SetUniqueSize

func (u *SetUpsert) SetUniqueSize(v int64) *SetUpsert

SetUniqueSize sets the "unique_size" field.

func (*SetUpsert) UpdateAloneSize

func (u *SetUpsert) UpdateAloneSize() *SetUpsert

UpdateAloneSize sets the "alone_size" field to the value that was provided on create.

func (*SetUpsert) UpdateDeduplicatedAloneSize

func (u *SetUpsert) UpdateDeduplicatedAloneSize() *SetUpsert

UpdateDeduplicatedAloneSize sets the "deduplicated_alone_size" field to the value that was provided on create.

func (*SetUpsert) UpdateDeduplicatedSize

func (u *SetUpsert) UpdateDeduplicatedSize() *SetUpsert

UpdateDeduplicatedSize sets the "deduplicated_size" field to the value that was provided on create.

func (*SetUpsert) UpdateErase

func (u *SetUpsert) UpdateErase() *SetUpsert

UpdateErase sets the "erase" field to the value that was provided on create.

func (*SetUpsert) UpdateExclusiveSize

func (u *SetUpsert) UpdateExclusiveSize() *SetUpsert

UpdateExclusiveSize sets the "exclusive_size" field to the value that was provided on create.

func (*SetUpsert) UpdateKeptLogicalSize

func (u *SetUpsert) UpdateKeptLogicalSize() *SetUpsert

UpdateKeptLogicalSize sets the "kept_logical_size" field to the value that was provided on create.

func (*SetUpsert) UpdateLogicalSize

func (u *SetUpsert) UpdateLogicalSize() *SetUpsert

UpdateLogicalSize sets the "logical_size" field to the value that was provided on create.

func (*SetUpsert) UpdateName

func (u *SetUpsert) UpdateName() *SetUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*SetUpsert) UpdatePhysicalSize

func (u *SetUpsert) UpdatePhysicalSize() *SetUpsert

UpdatePhysicalSize sets the "physical_size" field to the value that was provided on create.

func (*SetUpsert) UpdateRescan

func (u *SetUpsert) UpdateRescan() *SetUpsert

UpdateRescan sets the "rescan" field to the value that was provided on create.

func (*SetUpsert) UpdateRetentionPaused

func (u *SetUpsert) UpdateRetentionPaused() *SetUpsert

UpdateRetentionPaused sets the "retention_paused" field to the value that was provided on create.

func (*SetUpsert) UpdateRetentionPolicy

func (u *SetUpsert) UpdateRetentionPolicy() *SetUpsert

UpdateRetentionPolicy sets the "retention_policy" field to the value that was provided on create.

func (*SetUpsert) UpdateSizesDigest

func (u *SetUpsert) UpdateSizesDigest() *SetUpsert

UpdateSizesDigest sets the "sizes_digest" field to the value that was provided on create.

func (*SetUpsert) UpdateState

func (u *SetUpsert) UpdateState() *SetUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*SetUpsert) UpdateUniqueSize

func (u *SetUpsert) UpdateUniqueSize() *SetUpsert

UpdateUniqueSize sets the "unique_size" field to the value that was provided on create.

type SetUpsertBulk

type SetUpsertBulk struct {
	// contains filtered or unexported fields
}

SetUpsertBulk is the builder for "upsert"-ing a bulk of Set nodes.

func (*SetUpsertBulk) AddAloneSize

func (u *SetUpsertBulk) AddAloneSize(v int64) *SetUpsertBulk

AddAloneSize adds v to the "alone_size" field.

func (*SetUpsertBulk) AddDeduplicatedAloneSize

func (u *SetUpsertBulk) AddDeduplicatedAloneSize(v int64) *SetUpsertBulk

AddDeduplicatedAloneSize adds v to the "deduplicated_alone_size" field.

func (*SetUpsertBulk) AddDeduplicatedSize

func (u *SetUpsertBulk) AddDeduplicatedSize(v int64) *SetUpsertBulk

AddDeduplicatedSize adds v to the "deduplicated_size" field.

func (*SetUpsertBulk) AddExclusiveSize

func (u *SetUpsertBulk) AddExclusiveSize(v int64) *SetUpsertBulk

AddExclusiveSize adds v to the "exclusive_size" field.

func (*SetUpsertBulk) AddKeptLogicalSize

func (u *SetUpsertBulk) AddKeptLogicalSize(v int64) *SetUpsertBulk

AddKeptLogicalSize adds v to the "kept_logical_size" field.

func (*SetUpsertBulk) AddLogicalSize

func (u *SetUpsertBulk) AddLogicalSize(v int64) *SetUpsertBulk

AddLogicalSize adds v to the "logical_size" field.

func (*SetUpsertBulk) AddPhysicalSize

func (u *SetUpsertBulk) AddPhysicalSize(v int64) *SetUpsertBulk

AddPhysicalSize adds v to the "physical_size" field.

func (*SetUpsertBulk) AddUniqueSize

func (u *SetUpsertBulk) AddUniqueSize(v int64) *SetUpsertBulk

AddUniqueSize adds v to the "unique_size" field.

func (*SetUpsertBulk) ClearAloneSize

func (u *SetUpsertBulk) ClearAloneSize() *SetUpsertBulk

ClearAloneSize clears the value of the "alone_size" field.

func (*SetUpsertBulk) ClearDeduplicatedAloneSize

func (u *SetUpsertBulk) ClearDeduplicatedAloneSize() *SetUpsertBulk

ClearDeduplicatedAloneSize clears the value of the "deduplicated_alone_size" field.

func (*SetUpsertBulk) ClearDeduplicatedSize

func (u *SetUpsertBulk) ClearDeduplicatedSize() *SetUpsertBulk

ClearDeduplicatedSize clears the value of the "deduplicated_size" field.

func (*SetUpsertBulk) ClearExclusiveSize

func (u *SetUpsertBulk) ClearExclusiveSize() *SetUpsertBulk

ClearExclusiveSize clears the value of the "exclusive_size" field.

func (*SetUpsertBulk) ClearKeptLogicalSize

func (u *SetUpsertBulk) ClearKeptLogicalSize() *SetUpsertBulk

ClearKeptLogicalSize clears the value of the "kept_logical_size" field.

func (*SetUpsertBulk) ClearLogicalSize

func (u *SetUpsertBulk) ClearLogicalSize() *SetUpsertBulk

ClearLogicalSize clears the value of the "logical_size" field.

func (*SetUpsertBulk) ClearPhysicalSize

func (u *SetUpsertBulk) ClearPhysicalSize() *SetUpsertBulk

ClearPhysicalSize clears the value of the "physical_size" field.

func (*SetUpsertBulk) ClearRetentionPolicy

func (u *SetUpsertBulk) ClearRetentionPolicy() *SetUpsertBulk

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SetUpsertBulk) ClearSizesDigest

func (u *SetUpsertBulk) ClearSizesDigest() *SetUpsertBulk

ClearSizesDigest clears the value of the "sizes_digest" field.

func (*SetUpsertBulk) ClearUniqueSize

func (u *SetUpsertBulk) ClearUniqueSize() *SetUpsertBulk

ClearUniqueSize clears the value of the "unique_size" field.

func (*SetUpsertBulk) DoNothing

func (u *SetUpsertBulk) DoNothing() *SetUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SetUpsertBulk) Exec

func (u *SetUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SetUpsertBulk) ExecX

func (u *SetUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetUpsertBulk) Ignore

func (u *SetUpsertBulk) Ignore() *SetUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Set.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SetUpsertBulk) SetAloneSize

func (u *SetUpsertBulk) SetAloneSize(v int64) *SetUpsertBulk

SetAloneSize sets the "alone_size" field.

func (*SetUpsertBulk) SetDeduplicatedAloneSize

func (u *SetUpsertBulk) SetDeduplicatedAloneSize(v int64) *SetUpsertBulk

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetUpsertBulk) SetDeduplicatedSize

func (u *SetUpsertBulk) SetDeduplicatedSize(v int64) *SetUpsertBulk

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetUpsertBulk) SetErase

func (u *SetUpsertBulk) SetErase(v bool) *SetUpsertBulk

SetErase sets the "erase" field.

func (*SetUpsertBulk) SetExclusiveSize

func (u *SetUpsertBulk) SetExclusiveSize(v int64) *SetUpsertBulk

SetExclusiveSize sets the "exclusive_size" field.

func (*SetUpsertBulk) SetKeptLogicalSize

func (u *SetUpsertBulk) SetKeptLogicalSize(v int64) *SetUpsertBulk

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetUpsertBulk) SetLogicalSize

func (u *SetUpsertBulk) SetLogicalSize(v int64) *SetUpsertBulk

SetLogicalSize sets the "logical_size" field.

func (*SetUpsertBulk) SetName

func (u *SetUpsertBulk) SetName(v string) *SetUpsertBulk

SetName sets the "name" field.

func (*SetUpsertBulk) SetPhysicalSize

func (u *SetUpsertBulk) SetPhysicalSize(v int64) *SetUpsertBulk

SetPhysicalSize sets the "physical_size" field.

func (*SetUpsertBulk) SetRescan

func (u *SetUpsertBulk) SetRescan(v bool) *SetUpsertBulk

SetRescan sets the "rescan" field.

func (*SetUpsertBulk) SetRetentionPaused

func (u *SetUpsertBulk) SetRetentionPaused(v bool) *SetUpsertBulk

SetRetentionPaused sets the "retention_paused" field.

func (*SetUpsertBulk) SetRetentionPolicy

func (u *SetUpsertBulk) SetRetentionPolicy(v string) *SetUpsertBulk

SetRetentionPolicy sets the "retention_policy" field.

func (*SetUpsertBulk) SetSizesDigest

func (u *SetUpsertBulk) SetSizesDigest(v []byte) *SetUpsertBulk

SetSizesDigest sets the "sizes_digest" field.

func (*SetUpsertBulk) SetState

func (u *SetUpsertBulk) SetState(v set.State) *SetUpsertBulk

SetState sets the "state" field.

func (*SetUpsertBulk) SetUniqueSize

func (u *SetUpsertBulk) SetUniqueSize(v int64) *SetUpsertBulk

SetUniqueSize sets the "unique_size" field.

func (*SetUpsertBulk) Update

func (u *SetUpsertBulk) Update(set func(*SetUpsert)) *SetUpsertBulk

Update allows overriding fields `UPDATE` values. See the SetCreateBulk.OnConflict documentation for more info.

func (*SetUpsertBulk) UpdateAloneSize

func (u *SetUpsertBulk) UpdateAloneSize() *SetUpsertBulk

UpdateAloneSize sets the "alone_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateDeduplicatedAloneSize

func (u *SetUpsertBulk) UpdateDeduplicatedAloneSize() *SetUpsertBulk

UpdateDeduplicatedAloneSize sets the "deduplicated_alone_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateDeduplicatedSize

func (u *SetUpsertBulk) UpdateDeduplicatedSize() *SetUpsertBulk

UpdateDeduplicatedSize sets the "deduplicated_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateErase

func (u *SetUpsertBulk) UpdateErase() *SetUpsertBulk

UpdateErase sets the "erase" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateExclusiveSize

func (u *SetUpsertBulk) UpdateExclusiveSize() *SetUpsertBulk

UpdateExclusiveSize sets the "exclusive_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateKeptLogicalSize

func (u *SetUpsertBulk) UpdateKeptLogicalSize() *SetUpsertBulk

UpdateKeptLogicalSize sets the "kept_logical_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateLogicalSize

func (u *SetUpsertBulk) UpdateLogicalSize() *SetUpsertBulk

UpdateLogicalSize sets the "logical_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateName

func (u *SetUpsertBulk) UpdateName() *SetUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateNewValues

func (u *SetUpsertBulk) UpdateNewValues() *SetUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Set.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(set.FieldID)
		}),
	).
	Exec(ctx)

func (*SetUpsertBulk) UpdatePhysicalSize

func (u *SetUpsertBulk) UpdatePhysicalSize() *SetUpsertBulk

UpdatePhysicalSize sets the "physical_size" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateRescan

func (u *SetUpsertBulk) UpdateRescan() *SetUpsertBulk

UpdateRescan sets the "rescan" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateRetentionPaused

func (u *SetUpsertBulk) UpdateRetentionPaused() *SetUpsertBulk

UpdateRetentionPaused sets the "retention_paused" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateRetentionPolicy

func (u *SetUpsertBulk) UpdateRetentionPolicy() *SetUpsertBulk

UpdateRetentionPolicy sets the "retention_policy" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateSizesDigest

func (u *SetUpsertBulk) UpdateSizesDigest() *SetUpsertBulk

UpdateSizesDigest sets the "sizes_digest" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateState

func (u *SetUpsertBulk) UpdateState() *SetUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*SetUpsertBulk) UpdateUniqueSize

func (u *SetUpsertBulk) UpdateUniqueSize() *SetUpsertBulk

UpdateUniqueSize sets the "unique_size" field to the value that was provided on create.

type SetUpsertOne

type SetUpsertOne struct {
	// contains filtered or unexported fields
}

SetUpsertOne is the builder for "upsert"-ing

one Set node.

func (*SetUpsertOne) AddAloneSize

func (u *SetUpsertOne) AddAloneSize(v int64) *SetUpsertOne

AddAloneSize adds v to the "alone_size" field.

func (*SetUpsertOne) AddDeduplicatedAloneSize

func (u *SetUpsertOne) AddDeduplicatedAloneSize(v int64) *SetUpsertOne

AddDeduplicatedAloneSize adds v to the "deduplicated_alone_size" field.

func (*SetUpsertOne) AddDeduplicatedSize

func (u *SetUpsertOne) AddDeduplicatedSize(v int64) *SetUpsertOne

AddDeduplicatedSize adds v to the "deduplicated_size" field.

func (*SetUpsertOne) AddExclusiveSize

func (u *SetUpsertOne) AddExclusiveSize(v int64) *SetUpsertOne

AddExclusiveSize adds v to the "exclusive_size" field.

func (*SetUpsertOne) AddKeptLogicalSize

func (u *SetUpsertOne) AddKeptLogicalSize(v int64) *SetUpsertOne

AddKeptLogicalSize adds v to the "kept_logical_size" field.

func (*SetUpsertOne) AddLogicalSize

func (u *SetUpsertOne) AddLogicalSize(v int64) *SetUpsertOne

AddLogicalSize adds v to the "logical_size" field.

func (*SetUpsertOne) AddPhysicalSize

func (u *SetUpsertOne) AddPhysicalSize(v int64) *SetUpsertOne

AddPhysicalSize adds v to the "physical_size" field.

func (*SetUpsertOne) AddUniqueSize

func (u *SetUpsertOne) AddUniqueSize(v int64) *SetUpsertOne

AddUniqueSize adds v to the "unique_size" field.

func (*SetUpsertOne) ClearAloneSize

func (u *SetUpsertOne) ClearAloneSize() *SetUpsertOne

ClearAloneSize clears the value of the "alone_size" field.

func (*SetUpsertOne) ClearDeduplicatedAloneSize

func (u *SetUpsertOne) ClearDeduplicatedAloneSize() *SetUpsertOne

ClearDeduplicatedAloneSize clears the value of the "deduplicated_alone_size" field.

func (*SetUpsertOne) ClearDeduplicatedSize

func (u *SetUpsertOne) ClearDeduplicatedSize() *SetUpsertOne

ClearDeduplicatedSize clears the value of the "deduplicated_size" field.

func (*SetUpsertOne) ClearExclusiveSize

func (u *SetUpsertOne) ClearExclusiveSize() *SetUpsertOne

ClearExclusiveSize clears the value of the "exclusive_size" field.

func (*SetUpsertOne) ClearKeptLogicalSize

func (u *SetUpsertOne) ClearKeptLogicalSize() *SetUpsertOne

ClearKeptLogicalSize clears the value of the "kept_logical_size" field.

func (*SetUpsertOne) ClearLogicalSize

func (u *SetUpsertOne) ClearLogicalSize() *SetUpsertOne

ClearLogicalSize clears the value of the "logical_size" field.

func (*SetUpsertOne) ClearPhysicalSize

func (u *SetUpsertOne) ClearPhysicalSize() *SetUpsertOne

ClearPhysicalSize clears the value of the "physical_size" field.

func (*SetUpsertOne) ClearRetentionPolicy

func (u *SetUpsertOne) ClearRetentionPolicy() *SetUpsertOne

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SetUpsertOne) ClearSizesDigest

func (u *SetUpsertOne) ClearSizesDigest() *SetUpsertOne

ClearSizesDigest clears the value of the "sizes_digest" field.

func (*SetUpsertOne) ClearUniqueSize

func (u *SetUpsertOne) ClearUniqueSize() *SetUpsertOne

ClearUniqueSize clears the value of the "unique_size" field.

func (*SetUpsertOne) DoNothing

func (u *SetUpsertOne) DoNothing() *SetUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SetUpsertOne) Exec

func (u *SetUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SetUpsertOne) ExecX

func (u *SetUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetUpsertOne) ID

func (u *SetUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SetUpsertOne) IDX

func (u *SetUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*SetUpsertOne) Ignore

func (u *SetUpsertOne) Ignore() *SetUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Set.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SetUpsertOne) SetAloneSize

func (u *SetUpsertOne) SetAloneSize(v int64) *SetUpsertOne

SetAloneSize sets the "alone_size" field.

func (*SetUpsertOne) SetDeduplicatedAloneSize

func (u *SetUpsertOne) SetDeduplicatedAloneSize(v int64) *SetUpsertOne

SetDeduplicatedAloneSize sets the "deduplicated_alone_size" field.

func (*SetUpsertOne) SetDeduplicatedSize

func (u *SetUpsertOne) SetDeduplicatedSize(v int64) *SetUpsertOne

SetDeduplicatedSize sets the "deduplicated_size" field.

func (*SetUpsertOne) SetErase

func (u *SetUpsertOne) SetErase(v bool) *SetUpsertOne

SetErase sets the "erase" field.

func (*SetUpsertOne) SetExclusiveSize

func (u *SetUpsertOne) SetExclusiveSize(v int64) *SetUpsertOne

SetExclusiveSize sets the "exclusive_size" field.

func (*SetUpsertOne) SetKeptLogicalSize

func (u *SetUpsertOne) SetKeptLogicalSize(v int64) *SetUpsertOne

SetKeptLogicalSize sets the "kept_logical_size" field.

func (*SetUpsertOne) SetLogicalSize

func (u *SetUpsertOne) SetLogicalSize(v int64) *SetUpsertOne

SetLogicalSize sets the "logical_size" field.

func (*SetUpsertOne) SetName

func (u *SetUpsertOne) SetName(v string) *SetUpsertOne

SetName sets the "name" field.

func (*SetUpsertOne) SetPhysicalSize

func (u *SetUpsertOne) SetPhysicalSize(v int64) *SetUpsertOne

SetPhysicalSize sets the "physical_size" field.

func (*SetUpsertOne) SetRescan

func (u *SetUpsertOne) SetRescan(v bool) *SetUpsertOne

SetRescan sets the "rescan" field.

func (*SetUpsertOne) SetRetentionPaused

func (u *SetUpsertOne) SetRetentionPaused(v bool) *SetUpsertOne

SetRetentionPaused sets the "retention_paused" field.

func (*SetUpsertOne) SetRetentionPolicy

func (u *SetUpsertOne) SetRetentionPolicy(v string) *SetUpsertOne

SetRetentionPolicy sets the "retention_policy" field.

func (*SetUpsertOne) SetSizesDigest

func (u *SetUpsertOne) SetSizesDigest(v []byte) *SetUpsertOne

SetSizesDigest sets the "sizes_digest" field.

func (*SetUpsertOne) SetState

func (u *SetUpsertOne) SetState(v set.State) *SetUpsertOne

SetState sets the "state" field.

func (*SetUpsertOne) SetUniqueSize

func (u *SetUpsertOne) SetUniqueSize(v int64) *SetUpsertOne

SetUniqueSize sets the "unique_size" field.

func (*SetUpsertOne) Update

func (u *SetUpsertOne) Update(set func(*SetUpsert)) *SetUpsertOne

Update allows overriding fields `UPDATE` values. See the SetCreate.OnConflict documentation for more info.

func (*SetUpsertOne) UpdateAloneSize

func (u *SetUpsertOne) UpdateAloneSize() *SetUpsertOne

UpdateAloneSize sets the "alone_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateDeduplicatedAloneSize

func (u *SetUpsertOne) UpdateDeduplicatedAloneSize() *SetUpsertOne

UpdateDeduplicatedAloneSize sets the "deduplicated_alone_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateDeduplicatedSize

func (u *SetUpsertOne) UpdateDeduplicatedSize() *SetUpsertOne

UpdateDeduplicatedSize sets the "deduplicated_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateErase

func (u *SetUpsertOne) UpdateErase() *SetUpsertOne

UpdateErase sets the "erase" field to the value that was provided on create.

func (*SetUpsertOne) UpdateExclusiveSize

func (u *SetUpsertOne) UpdateExclusiveSize() *SetUpsertOne

UpdateExclusiveSize sets the "exclusive_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateKeptLogicalSize

func (u *SetUpsertOne) UpdateKeptLogicalSize() *SetUpsertOne

UpdateKeptLogicalSize sets the "kept_logical_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateLogicalSize

func (u *SetUpsertOne) UpdateLogicalSize() *SetUpsertOne

UpdateLogicalSize sets the "logical_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateName

func (u *SetUpsertOne) UpdateName() *SetUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*SetUpsertOne) UpdateNewValues

func (u *SetUpsertOne) UpdateNewValues() *SetUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Set.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(set.FieldID)
		}),
	).
	Exec(ctx)

func (*SetUpsertOne) UpdatePhysicalSize

func (u *SetUpsertOne) UpdatePhysicalSize() *SetUpsertOne

UpdatePhysicalSize sets the "physical_size" field to the value that was provided on create.

func (*SetUpsertOne) UpdateRescan

func (u *SetUpsertOne) UpdateRescan() *SetUpsertOne

UpdateRescan sets the "rescan" field to the value that was provided on create.

func (*SetUpsertOne) UpdateRetentionPaused

func (u *SetUpsertOne) UpdateRetentionPaused() *SetUpsertOne

UpdateRetentionPaused sets the "retention_paused" field to the value that was provided on create.

func (*SetUpsertOne) UpdateRetentionPolicy

func (u *SetUpsertOne) UpdateRetentionPolicy() *SetUpsertOne

UpdateRetentionPolicy sets the "retention_policy" field to the value that was provided on create.

func (*SetUpsertOne) UpdateSizesDigest

func (u *SetUpsertOne) UpdateSizesDigest() *SetUpsertOne

UpdateSizesDigest sets the "sizes_digest" field to the value that was provided on create.

func (*SetUpsertOne) UpdateState

func (u *SetUpsertOne) UpdateState() *SetUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*SetUpsertOne) UpdateUniqueSize

func (u *SetUpsertOne) UpdateUniqueSize() *SetUpsertOne

UpdateUniqueSize sets the "unique_size" field to the value that was provided on create.

type Sets

type Sets []*Set

Sets is a parsable slice of Set.

type Settings

type Settings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Policy holds the value of the "policy" field.
	Policy *string `json:"policy,omitempty"`
	// PolicyVersion holds the value of the "policy_version" field.
	PolicyVersion uint32 `json:"policy_version,omitempty"`
	// KeyAcknowledgedAt holds the value of the "key_acknowledged_at" field.
	KeyAcknowledgedAt *time.Time `json:"key_acknowledged_at,omitempty"`
	// RetentionPolicy holds the value of the "retention_policy" field.
	RetentionPolicy *string `json:"retention_policy,omitempty"`
	// TrashDays holds the value of the "trash_days" field.
	TrashDays int `json:"trash_days,omitempty"`
	// PolicySequence holds the value of the "policy_sequence" field.
	PolicySequence uint64 `json:"policy_sequence,omitempty"`
	// contains filtered or unexported fields
}

Settings is the model entity for the Settings schema.

func (*Settings) ExecContext

func (c *Settings) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Settings) QueryContext

func (c *Settings) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Settings) String

func (_m *Settings) String() string

String implements the fmt.Stringer.

func (*Settings) Unwrap

func (_m *Settings) Unwrap() *Settings

Unwrap unwraps the Settings 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 (*Settings) Update

func (_m *Settings) Update() *SettingsUpdateOne

Update returns a builder for updating this Settings. Note that you need to call Settings.Unwrap() before calling this method if this Settings was returned from a transaction, and the transaction was committed or rolled back.

func (*Settings) Value

func (_m *Settings) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Settings. This includes values selected through modifiers, order, etc.

type SettingsClient

type SettingsClient struct {
	// contains filtered or unexported fields
}

SettingsClient is a client for the Settings schema.

func NewSettingsClient

func NewSettingsClient(c config) *SettingsClient

NewSettingsClient returns a client for the Settings from the given config.

func (*SettingsClient) Create

func (c *SettingsClient) Create() *SettingsCreate

Create returns a builder for creating a Settings entity.

func (*SettingsClient) CreateBulk

func (c *SettingsClient) CreateBulk(builders ...*SettingsCreate) *SettingsCreateBulk

CreateBulk returns a builder for creating a bulk of Settings entities.

func (*SettingsClient) Delete

func (c *SettingsClient) Delete() *SettingsDelete

Delete returns a delete builder for Settings.

func (*SettingsClient) DeleteOne

func (c *SettingsClient) DeleteOne(_m *Settings) *SettingsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SettingsClient) DeleteOneID

func (c *SettingsClient) DeleteOneID(id int) *SettingsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SettingsClient) ExecContext

func (c *SettingsClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsClient) Get

func (c *SettingsClient) Get(ctx context.Context, id int) (*Settings, error)

Get returns a Settings entity by its id.

func (*SettingsClient) GetX

func (c *SettingsClient) GetX(ctx context.Context, id int) *Settings

GetX is like Get, but panics if an error occurs.

func (*SettingsClient) Hooks

func (c *SettingsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SettingsClient) Intercept

func (c *SettingsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `settings.Intercept(f(g(h())))`.

func (*SettingsClient) Interceptors

func (c *SettingsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SettingsClient) MapCreateBulk

func (c *SettingsClient) MapCreateBulk(slice any, setFunc func(*SettingsCreate, int)) *SettingsCreateBulk

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 (*SettingsClient) Query

func (c *SettingsClient) Query() *SettingsQuery

Query returns a query builder for Settings.

func (*SettingsClient) QueryContext

func (c *SettingsClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsClient) Update

func (c *SettingsClient) Update() *SettingsUpdate

Update returns an update builder for Settings.

func (*SettingsClient) UpdateOne

func (c *SettingsClient) UpdateOne(_m *Settings) *SettingsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SettingsClient) UpdateOneID

func (c *SettingsClient) UpdateOneID(id int) *SettingsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SettingsClient) Use

func (c *SettingsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `settings.Hooks(f(g(h())))`.

type SettingsCreate

type SettingsCreate struct {
	// contains filtered or unexported fields
}

SettingsCreate is the builder for creating a Settings entity.

func (*SettingsCreate) Exec

func (_c *SettingsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsCreate) ExecContext

func (c *SettingsCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsCreate) ExecX

func (_c *SettingsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsCreate) Mutation

func (_c *SettingsCreate) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsCreate) OnConflict

func (_c *SettingsCreate) OnConflict(opts ...sql.ConflictOption) *SettingsUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Settings.Create().
	SetPolicy(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SettingsUpsert) {
		SetPolicy(v+v).
	}).
	Exec(ctx)

func (*SettingsCreate) OnConflictColumns

func (_c *SettingsCreate) OnConflictColumns(columns ...string) *SettingsUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Settings.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SettingsCreate) QueryContext

func (c *SettingsCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsCreate) Save

func (_c *SettingsCreate) Save(ctx context.Context) (*Settings, error)

Save creates the Settings in the database.

func (*SettingsCreate) SaveX

func (_c *SettingsCreate) SaveX(ctx context.Context) *Settings

SaveX calls Save and panics if Save returns an error.

func (*SettingsCreate) SetID

func (_c *SettingsCreate) SetID(v int) *SettingsCreate

SetID sets the "id" field.

func (*SettingsCreate) SetKeyAcknowledgedAt

func (_c *SettingsCreate) SetKeyAcknowledgedAt(v time.Time) *SettingsCreate

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsCreate) SetNillableKeyAcknowledgedAt

func (_c *SettingsCreate) SetNillableKeyAcknowledgedAt(v *time.Time) *SettingsCreate

SetNillableKeyAcknowledgedAt sets the "key_acknowledged_at" field if the given value is not nil.

func (*SettingsCreate) SetNillablePolicy

func (_c *SettingsCreate) SetNillablePolicy(v *string) *SettingsCreate

SetNillablePolicy sets the "policy" field if the given value is not nil.

func (*SettingsCreate) SetNillablePolicySequence

func (_c *SettingsCreate) SetNillablePolicySequence(v *uint64) *SettingsCreate

SetNillablePolicySequence sets the "policy_sequence" field if the given value is not nil.

func (*SettingsCreate) SetNillablePolicyVersion

func (_c *SettingsCreate) SetNillablePolicyVersion(v *uint32) *SettingsCreate

SetNillablePolicyVersion sets the "policy_version" field if the given value is not nil.

func (*SettingsCreate) SetNillableRetentionPolicy

func (_c *SettingsCreate) SetNillableRetentionPolicy(v *string) *SettingsCreate

SetNillableRetentionPolicy sets the "retention_policy" field if the given value is not nil.

func (*SettingsCreate) SetNillableTrashDays

func (_c *SettingsCreate) SetNillableTrashDays(v *int) *SettingsCreate

SetNillableTrashDays sets the "trash_days" field if the given value is not nil.

func (*SettingsCreate) SetPolicy

func (_c *SettingsCreate) SetPolicy(v string) *SettingsCreate

SetPolicy sets the "policy" field.

func (*SettingsCreate) SetPolicySequence

func (_c *SettingsCreate) SetPolicySequence(v uint64) *SettingsCreate

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsCreate) SetPolicyVersion

func (_c *SettingsCreate) SetPolicyVersion(v uint32) *SettingsCreate

SetPolicyVersion sets the "policy_version" field.

func (*SettingsCreate) SetRetentionPolicy

func (_c *SettingsCreate) SetRetentionPolicy(v string) *SettingsCreate

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsCreate) SetTrashDays

func (_c *SettingsCreate) SetTrashDays(v int) *SettingsCreate

SetTrashDays sets the "trash_days" field.

type SettingsCreateBulk

type SettingsCreateBulk struct {
	// contains filtered or unexported fields
}

SettingsCreateBulk is the builder for creating many Settings entities in bulk.

func (*SettingsCreateBulk) Exec

func (_c *SettingsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsCreateBulk) ExecContext

func (c *SettingsCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsCreateBulk) ExecX

func (_c *SettingsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsCreateBulk) OnConflict

func (_c *SettingsCreateBulk) OnConflict(opts ...sql.ConflictOption) *SettingsUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Settings.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.SettingsUpsert) {
		SetPolicy(v+v).
	}).
	Exec(ctx)

func (*SettingsCreateBulk) OnConflictColumns

func (_c *SettingsCreateBulk) OnConflictColumns(columns ...string) *SettingsUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Settings.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*SettingsCreateBulk) QueryContext

func (c *SettingsCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsCreateBulk) Save

func (_c *SettingsCreateBulk) Save(ctx context.Context) ([]*Settings, error)

Save creates the Settings entities in the database.

func (*SettingsCreateBulk) SaveX

func (_c *SettingsCreateBulk) SaveX(ctx context.Context) []*Settings

SaveX is like Save, but panics if an error occurs.

type SettingsDelete

type SettingsDelete struct {
	// contains filtered or unexported fields
}

SettingsDelete is the builder for deleting a Settings entity.

func (*SettingsDelete) Exec

func (_d *SettingsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SettingsDelete) ExecContext

func (c *SettingsDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsDelete) ExecX

func (_d *SettingsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SettingsDelete) QueryContext

func (c *SettingsDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsDelete) Where

func (_d *SettingsDelete) Where(ps ...predicate.Settings) *SettingsDelete

Where appends a list predicates to the SettingsDelete builder.

type SettingsDeleteOne

type SettingsDeleteOne struct {
	// contains filtered or unexported fields
}

SettingsDeleteOne is the builder for deleting a single Settings entity.

func (*SettingsDeleteOne) Exec

func (_d *SettingsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SettingsDeleteOne) ExecX

func (_d *SettingsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsDeleteOne) Where

Where appends a list predicates to the SettingsDelete builder.

type SettingsGroupBy

type SettingsGroupBy struct {
	// contains filtered or unexported fields
}

SettingsGroupBy is the group-by builder for Settings entities.

func (*SettingsGroupBy) Aggregate

func (_g *SettingsGroupBy) Aggregate(fns ...AggregateFunc) *SettingsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SettingsGroupBy) Bool

func (s *SettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) BoolX

func (s *SettingsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SettingsGroupBy) Bools

func (s *SettingsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) BoolsX

func (s *SettingsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SettingsGroupBy) Float64

func (s *SettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) Float64X

func (s *SettingsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SettingsGroupBy) Float64s

func (s *SettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) Float64sX

func (s *SettingsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SettingsGroupBy) Int

func (s *SettingsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) IntX

func (s *SettingsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SettingsGroupBy) Ints

func (s *SettingsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) IntsX

func (s *SettingsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SettingsGroupBy) Scan

func (_g *SettingsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SettingsGroupBy) ScanX

func (s *SettingsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SettingsGroupBy) String

func (s *SettingsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) StringX

func (s *SettingsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SettingsGroupBy) Strings

func (s *SettingsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) StringsX

func (s *SettingsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SettingsMutation

type SettingsMutation struct {
	// contains filtered or unexported fields
}

SettingsMutation represents an operation that mutates the Settings nodes in the graph.

func (*SettingsMutation) AddField

func (m *SettingsMutation) 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 (*SettingsMutation) AddPolicySequence

func (m *SettingsMutation) AddPolicySequence(u int64)

AddPolicySequence adds u to the "policy_sequence" field.

func (*SettingsMutation) AddPolicyVersion

func (m *SettingsMutation) AddPolicyVersion(u int32)

AddPolicyVersion adds u to the "policy_version" field.

func (*SettingsMutation) AddTrashDays

func (m *SettingsMutation) AddTrashDays(i int)

AddTrashDays adds i to the "trash_days" field.

func (*SettingsMutation) AddedEdges

func (m *SettingsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SettingsMutation) AddedField

func (m *SettingsMutation) 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 (*SettingsMutation) AddedFields

func (m *SettingsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SettingsMutation) AddedIDs

func (m *SettingsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SettingsMutation) AddedPolicySequence

func (m *SettingsMutation) AddedPolicySequence() (r int64, exists bool)

AddedPolicySequence returns the value that was added to the "policy_sequence" field in this mutation.

func (*SettingsMutation) AddedPolicyVersion

func (m *SettingsMutation) AddedPolicyVersion() (r int32, exists bool)

AddedPolicyVersion returns the value that was added to the "policy_version" field in this mutation.

func (*SettingsMutation) AddedTrashDays

func (m *SettingsMutation) AddedTrashDays() (r int, exists bool)

AddedTrashDays returns the value that was added to the "trash_days" field in this mutation.

func (*SettingsMutation) ClearEdge

func (m *SettingsMutation) 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 (*SettingsMutation) ClearField

func (m *SettingsMutation) 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 (*SettingsMutation) ClearKeyAcknowledgedAt

func (m *SettingsMutation) ClearKeyAcknowledgedAt()

ClearKeyAcknowledgedAt clears the value of the "key_acknowledged_at" field.

func (*SettingsMutation) ClearPolicy

func (m *SettingsMutation) ClearPolicy()

ClearPolicy clears the value of the "policy" field.

func (*SettingsMutation) ClearRetentionPolicy

func (m *SettingsMutation) ClearRetentionPolicy()

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SettingsMutation) ClearedEdges

func (m *SettingsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SettingsMutation) ClearedFields

func (m *SettingsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SettingsMutation) Client

func (m SettingsMutation) 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 (*SettingsMutation) EdgeCleared

func (m *SettingsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SettingsMutation) ExecContext

func (c *SettingsMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsMutation) Field

func (m *SettingsMutation) 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 (*SettingsMutation) FieldCleared

func (m *SettingsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SettingsMutation) Fields

func (m *SettingsMutation) 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 (*SettingsMutation) ID

func (m *SettingsMutation) 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 (*SettingsMutation) IDs

func (m *SettingsMutation) 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 (*SettingsMutation) KeyAcknowledgedAt

func (m *SettingsMutation) KeyAcknowledgedAt() (r time.Time, exists bool)

KeyAcknowledgedAt returns the value of the "key_acknowledged_at" field in the mutation.

func (*SettingsMutation) KeyAcknowledgedAtCleared

func (m *SettingsMutation) KeyAcknowledgedAtCleared() bool

KeyAcknowledgedAtCleared returns if the "key_acknowledged_at" field was cleared in this mutation.

func (*SettingsMutation) OldField

func (m *SettingsMutation) 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 (*SettingsMutation) OldKeyAcknowledgedAt

func (m *SettingsMutation) OldKeyAcknowledgedAt(ctx context.Context) (v *time.Time, err error)

OldKeyAcknowledgedAt returns the old "key_acknowledged_at" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldPolicy

func (m *SettingsMutation) OldPolicy(ctx context.Context) (v *string, err error)

OldPolicy returns the old "policy" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldPolicySequence

func (m *SettingsMutation) OldPolicySequence(ctx context.Context) (v uint64, err error)

OldPolicySequence returns the old "policy_sequence" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldPolicyVersion

func (m *SettingsMutation) OldPolicyVersion(ctx context.Context) (v uint32, err error)

OldPolicyVersion returns the old "policy_version" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldRetentionPolicy

func (m *SettingsMutation) OldRetentionPolicy(ctx context.Context) (v *string, err error)

OldRetentionPolicy returns the old "retention_policy" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldTrashDays

func (m *SettingsMutation) OldTrashDays(ctx context.Context) (v int, err error)

OldTrashDays returns the old "trash_days" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) Op

func (m *SettingsMutation) Op() Op

Op returns the operation name.

func (*SettingsMutation) Policy

func (m *SettingsMutation) Policy() (r string, exists bool)

Policy returns the value of the "policy" field in the mutation.

func (*SettingsMutation) PolicyCleared

func (m *SettingsMutation) PolicyCleared() bool

PolicyCleared returns if the "policy" field was cleared in this mutation.

func (*SettingsMutation) PolicySequence

func (m *SettingsMutation) PolicySequence() (r uint64, exists bool)

PolicySequence returns the value of the "policy_sequence" field in the mutation.

func (*SettingsMutation) PolicyVersion

func (m *SettingsMutation) PolicyVersion() (r uint32, exists bool)

PolicyVersion returns the value of the "policy_version" field in the mutation.

func (*SettingsMutation) QueryContext

func (c *SettingsMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsMutation) RemovedEdges

func (m *SettingsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SettingsMutation) RemovedIDs

func (m *SettingsMutation) 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 (*SettingsMutation) ResetEdge

func (m *SettingsMutation) 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 (*SettingsMutation) ResetField

func (m *SettingsMutation) 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 (*SettingsMutation) ResetKeyAcknowledgedAt

func (m *SettingsMutation) ResetKeyAcknowledgedAt()

ResetKeyAcknowledgedAt resets all changes to the "key_acknowledged_at" field.

func (*SettingsMutation) ResetPolicy

func (m *SettingsMutation) ResetPolicy()

ResetPolicy resets all changes to the "policy" field.

func (*SettingsMutation) ResetPolicySequence

func (m *SettingsMutation) ResetPolicySequence()

ResetPolicySequence resets all changes to the "policy_sequence" field.

func (*SettingsMutation) ResetPolicyVersion

func (m *SettingsMutation) ResetPolicyVersion()

ResetPolicyVersion resets all changes to the "policy_version" field.

func (*SettingsMutation) ResetRetentionPolicy

func (m *SettingsMutation) ResetRetentionPolicy()

ResetRetentionPolicy resets all changes to the "retention_policy" field.

func (*SettingsMutation) ResetTrashDays

func (m *SettingsMutation) ResetTrashDays()

ResetTrashDays resets all changes to the "trash_days" field.

func (*SettingsMutation) RetentionPolicy

func (m *SettingsMutation) RetentionPolicy() (r string, exists bool)

RetentionPolicy returns the value of the "retention_policy" field in the mutation.

func (*SettingsMutation) RetentionPolicyCleared

func (m *SettingsMutation) RetentionPolicyCleared() bool

RetentionPolicyCleared returns if the "retention_policy" field was cleared in this mutation.

func (*SettingsMutation) SetField

func (m *SettingsMutation) 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 (*SettingsMutation) SetID

func (m *SettingsMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Settings entities.

func (*SettingsMutation) SetKeyAcknowledgedAt

func (m *SettingsMutation) SetKeyAcknowledgedAt(t time.Time)

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsMutation) SetOp

func (m *SettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SettingsMutation) SetPolicy

func (m *SettingsMutation) SetPolicy(s string)

SetPolicy sets the "policy" field.

func (*SettingsMutation) SetPolicySequence

func (m *SettingsMutation) SetPolicySequence(u uint64)

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsMutation) SetPolicyVersion

func (m *SettingsMutation) SetPolicyVersion(u uint32)

SetPolicyVersion sets the "policy_version" field.

func (*SettingsMutation) SetRetentionPolicy

func (m *SettingsMutation) SetRetentionPolicy(s string)

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsMutation) SetTrashDays

func (m *SettingsMutation) SetTrashDays(i int)

SetTrashDays sets the "trash_days" field.

func (*SettingsMutation) TrashDays

func (m *SettingsMutation) TrashDays() (r int, exists bool)

TrashDays returns the value of the "trash_days" field in the mutation.

func (SettingsMutation) Tx

func (m SettingsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SettingsMutation) Type

func (m *SettingsMutation) Type() string

Type returns the node type of this mutation (Settings).

func (*SettingsMutation) Where

func (m *SettingsMutation) Where(ps ...predicate.Settings)

Where appends a list predicates to the SettingsMutation builder.

func (*SettingsMutation) WhereP

func (m *SettingsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SettingsQuery

type SettingsQuery struct {
	// contains filtered or unexported fields
}

SettingsQuery is the builder for querying Settings entities.

func (*SettingsQuery) Aggregate

func (_q *SettingsQuery) Aggregate(fns ...AggregateFunc) *SettingsSelect

Aggregate returns a SettingsSelect configured with the given aggregations.

func (*SettingsQuery) All

func (_q *SettingsQuery) All(ctx context.Context) ([]*Settings, error)

All executes the query and returns a list of SettingsSlice.

func (*SettingsQuery) AllX

func (_q *SettingsQuery) AllX(ctx context.Context) []*Settings

AllX is like All, but panics if an error occurs.

func (*SettingsQuery) Clone

func (_q *SettingsQuery) Clone() *SettingsQuery

Clone returns a duplicate of the SettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SettingsQuery) Count

func (_q *SettingsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SettingsQuery) CountX

func (_q *SettingsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SettingsQuery) ExecContext

func (c *SettingsQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsQuery) Exist

func (_q *SettingsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SettingsQuery) ExistX

func (_q *SettingsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SettingsQuery) First

func (_q *SettingsQuery) First(ctx context.Context) (*Settings, error)

First returns the first Settings entity from the query. Returns a *NotFoundError when no Settings was found.

func (*SettingsQuery) FirstID

func (_q *SettingsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Settings ID from the query. Returns a *NotFoundError when no Settings ID was found.

func (*SettingsQuery) FirstIDX

func (_q *SettingsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SettingsQuery) FirstX

func (_q *SettingsQuery) FirstX(ctx context.Context) *Settings

FirstX is like First, but panics if an error occurs.

func (*SettingsQuery) ForShare

func (_q *SettingsQuery) ForShare(opts ...sql.LockOption) *SettingsQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*SettingsQuery) ForUpdate

func (_q *SettingsQuery) ForUpdate(opts ...sql.LockOption) *SettingsQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*SettingsQuery) GroupBy

func (_q *SettingsQuery) GroupBy(field string, fields ...string) *SettingsGroupBy

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 {
	Policy string `json:"policy,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Settings.Query().
	GroupBy(settings.FieldPolicy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SettingsQuery) IDs

func (_q *SettingsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Settings IDs.

func (*SettingsQuery) IDsX

func (_q *SettingsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SettingsQuery) Limit

func (_q *SettingsQuery) Limit(limit int) *SettingsQuery

Limit the number of records to be returned by this query.

func (*SettingsQuery) Offset

func (_q *SettingsQuery) Offset(offset int) *SettingsQuery

Offset to start from.

func (*SettingsQuery) Only

func (_q *SettingsQuery) Only(ctx context.Context) (*Settings, error)

Only returns a single Settings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Settings entity is found. Returns a *NotFoundError when no Settings entities are found.

func (*SettingsQuery) OnlyID

func (_q *SettingsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Settings ID in the query. Returns a *NotSingularError when more than one Settings ID is found. Returns a *NotFoundError when no entities are found.

func (*SettingsQuery) OnlyIDX

func (_q *SettingsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SettingsQuery) OnlyX

func (_q *SettingsQuery) OnlyX(ctx context.Context) *Settings

OnlyX is like Only, but panics if an error occurs.

func (*SettingsQuery) Order

Order specifies how the records should be ordered.

func (*SettingsQuery) QueryContext

func (c *SettingsQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsQuery) Select

func (_q *SettingsQuery) Select(fields ...string) *SettingsSelect

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 {
	Policy string `json:"policy,omitempty"`
}

client.Settings.Query().
	Select(settings.FieldPolicy).
	Scan(ctx, &v)

func (*SettingsQuery) Unique

func (_q *SettingsQuery) Unique(unique bool) *SettingsQuery

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 (*SettingsQuery) Where

func (_q *SettingsQuery) Where(ps ...predicate.Settings) *SettingsQuery

Where adds a new predicate for the SettingsQuery builder.

type SettingsSelect

type SettingsSelect struct {
	*SettingsQuery
	// contains filtered or unexported fields
}

SettingsSelect is the builder for selecting fields of Settings entities.

func (*SettingsSelect) Aggregate

func (_s *SettingsSelect) Aggregate(fns ...AggregateFunc) *SettingsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SettingsSelect) Bool

func (s *SettingsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) BoolX

func (s *SettingsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SettingsSelect) Bools

func (s *SettingsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) BoolsX

func (s *SettingsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (SettingsSelect) ExecContext

func (c SettingsSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsSelect) Float64

func (s *SettingsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) Float64X

func (s *SettingsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SettingsSelect) Float64s

func (s *SettingsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) Float64sX

func (s *SettingsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SettingsSelect) Int

func (s *SettingsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) IntX

func (s *SettingsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SettingsSelect) Ints

func (s *SettingsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) IntsX

func (s *SettingsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (SettingsSelect) QueryContext

func (c SettingsSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsSelect) Scan

func (_s *SettingsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SettingsSelect) ScanX

func (s *SettingsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SettingsSelect) String

func (s *SettingsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) StringX

func (s *SettingsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SettingsSelect) Strings

func (s *SettingsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) StringsX

func (s *SettingsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SettingsSlice

type SettingsSlice []*Settings

SettingsSlice is a parsable slice of Settings.

type SettingsUpdate

type SettingsUpdate struct {
	// contains filtered or unexported fields
}

SettingsUpdate is the builder for updating Settings entities.

func (*SettingsUpdate) AddPolicySequence

func (_u *SettingsUpdate) AddPolicySequence(v int64) *SettingsUpdate

AddPolicySequence adds value to the "policy_sequence" field.

func (*SettingsUpdate) AddPolicyVersion

func (_u *SettingsUpdate) AddPolicyVersion(v int32) *SettingsUpdate

AddPolicyVersion adds value to the "policy_version" field.

func (*SettingsUpdate) AddTrashDays

func (_u *SettingsUpdate) AddTrashDays(v int) *SettingsUpdate

AddTrashDays adds value to the "trash_days" field.

func (*SettingsUpdate) ClearKeyAcknowledgedAt

func (_u *SettingsUpdate) ClearKeyAcknowledgedAt() *SettingsUpdate

ClearKeyAcknowledgedAt clears the value of the "key_acknowledged_at" field.

func (*SettingsUpdate) ClearPolicy

func (_u *SettingsUpdate) ClearPolicy() *SettingsUpdate

ClearPolicy clears the value of the "policy" field.

func (*SettingsUpdate) ClearRetentionPolicy

func (_u *SettingsUpdate) ClearRetentionPolicy() *SettingsUpdate

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SettingsUpdate) Exec

func (_u *SettingsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsUpdate) ExecContext

func (c *SettingsUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsUpdate) ExecX

func (_u *SettingsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsUpdate) Mutation

func (_u *SettingsUpdate) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsUpdate) QueryContext

func (c *SettingsUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsUpdate) Save

func (_u *SettingsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SettingsUpdate) SaveX

func (_u *SettingsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SettingsUpdate) SetKeyAcknowledgedAt

func (_u *SettingsUpdate) SetKeyAcknowledgedAt(v time.Time) *SettingsUpdate

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsUpdate) SetNillableKeyAcknowledgedAt

func (_u *SettingsUpdate) SetNillableKeyAcknowledgedAt(v *time.Time) *SettingsUpdate

SetNillableKeyAcknowledgedAt sets the "key_acknowledged_at" field if the given value is not nil.

func (*SettingsUpdate) SetNillablePolicy

func (_u *SettingsUpdate) SetNillablePolicy(v *string) *SettingsUpdate

SetNillablePolicy sets the "policy" field if the given value is not nil.

func (*SettingsUpdate) SetNillablePolicySequence

func (_u *SettingsUpdate) SetNillablePolicySequence(v *uint64) *SettingsUpdate

SetNillablePolicySequence sets the "policy_sequence" field if the given value is not nil.

func (*SettingsUpdate) SetNillablePolicyVersion

func (_u *SettingsUpdate) SetNillablePolicyVersion(v *uint32) *SettingsUpdate

SetNillablePolicyVersion sets the "policy_version" field if the given value is not nil.

func (*SettingsUpdate) SetNillableRetentionPolicy

func (_u *SettingsUpdate) SetNillableRetentionPolicy(v *string) *SettingsUpdate

SetNillableRetentionPolicy sets the "retention_policy" field if the given value is not nil.

func (*SettingsUpdate) SetNillableTrashDays

func (_u *SettingsUpdate) SetNillableTrashDays(v *int) *SettingsUpdate

SetNillableTrashDays sets the "trash_days" field if the given value is not nil.

func (*SettingsUpdate) SetPolicy

func (_u *SettingsUpdate) SetPolicy(v string) *SettingsUpdate

SetPolicy sets the "policy" field.

func (*SettingsUpdate) SetPolicySequence

func (_u *SettingsUpdate) SetPolicySequence(v uint64) *SettingsUpdate

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsUpdate) SetPolicyVersion

func (_u *SettingsUpdate) SetPolicyVersion(v uint32) *SettingsUpdate

SetPolicyVersion sets the "policy_version" field.

func (*SettingsUpdate) SetRetentionPolicy

func (_u *SettingsUpdate) SetRetentionPolicy(v string) *SettingsUpdate

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsUpdate) SetTrashDays

func (_u *SettingsUpdate) SetTrashDays(v int) *SettingsUpdate

SetTrashDays sets the "trash_days" field.

func (*SettingsUpdate) Where

func (_u *SettingsUpdate) Where(ps ...predicate.Settings) *SettingsUpdate

Where appends a list predicates to the SettingsUpdate builder.

type SettingsUpdateOne

type SettingsUpdateOne struct {
	// contains filtered or unexported fields
}

SettingsUpdateOne is the builder for updating a single Settings entity.

func (*SettingsUpdateOne) AddPolicySequence

func (_u *SettingsUpdateOne) AddPolicySequence(v int64) *SettingsUpdateOne

AddPolicySequence adds value to the "policy_sequence" field.

func (*SettingsUpdateOne) AddPolicyVersion

func (_u *SettingsUpdateOne) AddPolicyVersion(v int32) *SettingsUpdateOne

AddPolicyVersion adds value to the "policy_version" field.

func (*SettingsUpdateOne) AddTrashDays

func (_u *SettingsUpdateOne) AddTrashDays(v int) *SettingsUpdateOne

AddTrashDays adds value to the "trash_days" field.

func (*SettingsUpdateOne) ClearKeyAcknowledgedAt

func (_u *SettingsUpdateOne) ClearKeyAcknowledgedAt() *SettingsUpdateOne

ClearKeyAcknowledgedAt clears the value of the "key_acknowledged_at" field.

func (*SettingsUpdateOne) ClearPolicy

func (_u *SettingsUpdateOne) ClearPolicy() *SettingsUpdateOne

ClearPolicy clears the value of the "policy" field.

func (*SettingsUpdateOne) ClearRetentionPolicy

func (_u *SettingsUpdateOne) ClearRetentionPolicy() *SettingsUpdateOne

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SettingsUpdateOne) Exec

func (_u *SettingsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SettingsUpdateOne) ExecContext

func (c *SettingsUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*SettingsUpdateOne) ExecX

func (_u *SettingsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsUpdateOne) Mutation

func (_u *SettingsUpdateOne) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsUpdateOne) QueryContext

func (c *SettingsUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*SettingsUpdateOne) Save

func (_u *SettingsUpdateOne) Save(ctx context.Context) (*Settings, error)

Save executes the query and returns the updated Settings entity.

func (*SettingsUpdateOne) SaveX

func (_u *SettingsUpdateOne) SaveX(ctx context.Context) *Settings

SaveX is like Save, but panics if an error occurs.

func (*SettingsUpdateOne) Select

func (_u *SettingsUpdateOne) Select(field string, fields ...string) *SettingsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SettingsUpdateOne) SetKeyAcknowledgedAt

func (_u *SettingsUpdateOne) SetKeyAcknowledgedAt(v time.Time) *SettingsUpdateOne

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsUpdateOne) SetNillableKeyAcknowledgedAt

func (_u *SettingsUpdateOne) SetNillableKeyAcknowledgedAt(v *time.Time) *SettingsUpdateOne

SetNillableKeyAcknowledgedAt sets the "key_acknowledged_at" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillablePolicy

func (_u *SettingsUpdateOne) SetNillablePolicy(v *string) *SettingsUpdateOne

SetNillablePolicy sets the "policy" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillablePolicySequence

func (_u *SettingsUpdateOne) SetNillablePolicySequence(v *uint64) *SettingsUpdateOne

SetNillablePolicySequence sets the "policy_sequence" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillablePolicyVersion

func (_u *SettingsUpdateOne) SetNillablePolicyVersion(v *uint32) *SettingsUpdateOne

SetNillablePolicyVersion sets the "policy_version" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableRetentionPolicy

func (_u *SettingsUpdateOne) SetNillableRetentionPolicy(v *string) *SettingsUpdateOne

SetNillableRetentionPolicy sets the "retention_policy" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableTrashDays

func (_u *SettingsUpdateOne) SetNillableTrashDays(v *int) *SettingsUpdateOne

SetNillableTrashDays sets the "trash_days" field if the given value is not nil.

func (*SettingsUpdateOne) SetPolicy

func (_u *SettingsUpdateOne) SetPolicy(v string) *SettingsUpdateOne

SetPolicy sets the "policy" field.

func (*SettingsUpdateOne) SetPolicySequence

func (_u *SettingsUpdateOne) SetPolicySequence(v uint64) *SettingsUpdateOne

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsUpdateOne) SetPolicyVersion

func (_u *SettingsUpdateOne) SetPolicyVersion(v uint32) *SettingsUpdateOne

SetPolicyVersion sets the "policy_version" field.

func (*SettingsUpdateOne) SetRetentionPolicy

func (_u *SettingsUpdateOne) SetRetentionPolicy(v string) *SettingsUpdateOne

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsUpdateOne) SetTrashDays

func (_u *SettingsUpdateOne) SetTrashDays(v int) *SettingsUpdateOne

SetTrashDays sets the "trash_days" field.

func (*SettingsUpdateOne) Where

Where appends a list predicates to the SettingsUpdate builder.

type SettingsUpsert

type SettingsUpsert struct {
	*sql.UpdateSet
}

SettingsUpsert is the "OnConflict" setter.

func (*SettingsUpsert) AddPolicySequence

func (u *SettingsUpsert) AddPolicySequence(v uint64) *SettingsUpsert

AddPolicySequence adds v to the "policy_sequence" field.

func (*SettingsUpsert) AddPolicyVersion

func (u *SettingsUpsert) AddPolicyVersion(v uint32) *SettingsUpsert

AddPolicyVersion adds v to the "policy_version" field.

func (*SettingsUpsert) AddTrashDays

func (u *SettingsUpsert) AddTrashDays(v int) *SettingsUpsert

AddTrashDays adds v to the "trash_days" field.

func (*SettingsUpsert) ClearKeyAcknowledgedAt

func (u *SettingsUpsert) ClearKeyAcknowledgedAt() *SettingsUpsert

ClearKeyAcknowledgedAt clears the value of the "key_acknowledged_at" field.

func (*SettingsUpsert) ClearPolicy

func (u *SettingsUpsert) ClearPolicy() *SettingsUpsert

ClearPolicy clears the value of the "policy" field.

func (*SettingsUpsert) ClearRetentionPolicy

func (u *SettingsUpsert) ClearRetentionPolicy() *SettingsUpsert

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SettingsUpsert) SetKeyAcknowledgedAt

func (u *SettingsUpsert) SetKeyAcknowledgedAt(v time.Time) *SettingsUpsert

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsUpsert) SetPolicy

func (u *SettingsUpsert) SetPolicy(v string) *SettingsUpsert

SetPolicy sets the "policy" field.

func (*SettingsUpsert) SetPolicySequence

func (u *SettingsUpsert) SetPolicySequence(v uint64) *SettingsUpsert

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsUpsert) SetPolicyVersion

func (u *SettingsUpsert) SetPolicyVersion(v uint32) *SettingsUpsert

SetPolicyVersion sets the "policy_version" field.

func (*SettingsUpsert) SetRetentionPolicy

func (u *SettingsUpsert) SetRetentionPolicy(v string) *SettingsUpsert

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsUpsert) SetTrashDays

func (u *SettingsUpsert) SetTrashDays(v int) *SettingsUpsert

SetTrashDays sets the "trash_days" field.

func (*SettingsUpsert) UpdateKeyAcknowledgedAt

func (u *SettingsUpsert) UpdateKeyAcknowledgedAt() *SettingsUpsert

UpdateKeyAcknowledgedAt sets the "key_acknowledged_at" field to the value that was provided on create.

func (*SettingsUpsert) UpdatePolicy

func (u *SettingsUpsert) UpdatePolicy() *SettingsUpsert

UpdatePolicy sets the "policy" field to the value that was provided on create.

func (*SettingsUpsert) UpdatePolicySequence

func (u *SettingsUpsert) UpdatePolicySequence() *SettingsUpsert

UpdatePolicySequence sets the "policy_sequence" field to the value that was provided on create.

func (*SettingsUpsert) UpdatePolicyVersion

func (u *SettingsUpsert) UpdatePolicyVersion() *SettingsUpsert

UpdatePolicyVersion sets the "policy_version" field to the value that was provided on create.

func (*SettingsUpsert) UpdateRetentionPolicy

func (u *SettingsUpsert) UpdateRetentionPolicy() *SettingsUpsert

UpdateRetentionPolicy sets the "retention_policy" field to the value that was provided on create.

func (*SettingsUpsert) UpdateTrashDays

func (u *SettingsUpsert) UpdateTrashDays() *SettingsUpsert

UpdateTrashDays sets the "trash_days" field to the value that was provided on create.

type SettingsUpsertBulk

type SettingsUpsertBulk struct {
	// contains filtered or unexported fields
}

SettingsUpsertBulk is the builder for "upsert"-ing a bulk of Settings nodes.

func (*SettingsUpsertBulk) AddPolicySequence

func (u *SettingsUpsertBulk) AddPolicySequence(v uint64) *SettingsUpsertBulk

AddPolicySequence adds v to the "policy_sequence" field.

func (*SettingsUpsertBulk) AddPolicyVersion

func (u *SettingsUpsertBulk) AddPolicyVersion(v uint32) *SettingsUpsertBulk

AddPolicyVersion adds v to the "policy_version" field.

func (*SettingsUpsertBulk) AddTrashDays

func (u *SettingsUpsertBulk) AddTrashDays(v int) *SettingsUpsertBulk

AddTrashDays adds v to the "trash_days" field.

func (*SettingsUpsertBulk) ClearKeyAcknowledgedAt

func (u *SettingsUpsertBulk) ClearKeyAcknowledgedAt() *SettingsUpsertBulk

ClearKeyAcknowledgedAt clears the value of the "key_acknowledged_at" field.

func (*SettingsUpsertBulk) ClearPolicy

func (u *SettingsUpsertBulk) ClearPolicy() *SettingsUpsertBulk

ClearPolicy clears the value of the "policy" field.

func (*SettingsUpsertBulk) ClearRetentionPolicy

func (u *SettingsUpsertBulk) ClearRetentionPolicy() *SettingsUpsertBulk

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SettingsUpsertBulk) DoNothing

func (u *SettingsUpsertBulk) DoNothing() *SettingsUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SettingsUpsertBulk) Exec

func (u *SettingsUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsUpsertBulk) ExecX

func (u *SettingsUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Settings.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*SettingsUpsertBulk) SetKeyAcknowledgedAt

func (u *SettingsUpsertBulk) SetKeyAcknowledgedAt(v time.Time) *SettingsUpsertBulk

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsUpsertBulk) SetPolicy

func (u *SettingsUpsertBulk) SetPolicy(v string) *SettingsUpsertBulk

SetPolicy sets the "policy" field.

func (*SettingsUpsertBulk) SetPolicySequence

func (u *SettingsUpsertBulk) SetPolicySequence(v uint64) *SettingsUpsertBulk

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsUpsertBulk) SetPolicyVersion

func (u *SettingsUpsertBulk) SetPolicyVersion(v uint32) *SettingsUpsertBulk

SetPolicyVersion sets the "policy_version" field.

func (*SettingsUpsertBulk) SetRetentionPolicy

func (u *SettingsUpsertBulk) SetRetentionPolicy(v string) *SettingsUpsertBulk

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsUpsertBulk) SetTrashDays

func (u *SettingsUpsertBulk) SetTrashDays(v int) *SettingsUpsertBulk

SetTrashDays sets the "trash_days" field.

func (*SettingsUpsertBulk) Update

func (u *SettingsUpsertBulk) Update(set func(*SettingsUpsert)) *SettingsUpsertBulk

Update allows overriding fields `UPDATE` values. See the SettingsCreateBulk.OnConflict documentation for more info.

func (*SettingsUpsertBulk) UpdateKeyAcknowledgedAt

func (u *SettingsUpsertBulk) UpdateKeyAcknowledgedAt() *SettingsUpsertBulk

UpdateKeyAcknowledgedAt sets the "key_acknowledged_at" field to the value that was provided on create.

func (*SettingsUpsertBulk) UpdateNewValues

func (u *SettingsUpsertBulk) UpdateNewValues() *SettingsUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Settings.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(settings.FieldID)
		}),
	).
	Exec(ctx)

func (*SettingsUpsertBulk) UpdatePolicy

func (u *SettingsUpsertBulk) UpdatePolicy() *SettingsUpsertBulk

UpdatePolicy sets the "policy" field to the value that was provided on create.

func (*SettingsUpsertBulk) UpdatePolicySequence

func (u *SettingsUpsertBulk) UpdatePolicySequence() *SettingsUpsertBulk

UpdatePolicySequence sets the "policy_sequence" field to the value that was provided on create.

func (*SettingsUpsertBulk) UpdatePolicyVersion

func (u *SettingsUpsertBulk) UpdatePolicyVersion() *SettingsUpsertBulk

UpdatePolicyVersion sets the "policy_version" field to the value that was provided on create.

func (*SettingsUpsertBulk) UpdateRetentionPolicy

func (u *SettingsUpsertBulk) UpdateRetentionPolicy() *SettingsUpsertBulk

UpdateRetentionPolicy sets the "retention_policy" field to the value that was provided on create.

func (*SettingsUpsertBulk) UpdateTrashDays

func (u *SettingsUpsertBulk) UpdateTrashDays() *SettingsUpsertBulk

UpdateTrashDays sets the "trash_days" field to the value that was provided on create.

type SettingsUpsertOne

type SettingsUpsertOne struct {
	// contains filtered or unexported fields
}

SettingsUpsertOne is the builder for "upsert"-ing

one Settings node.

func (*SettingsUpsertOne) AddPolicySequence

func (u *SettingsUpsertOne) AddPolicySequence(v uint64) *SettingsUpsertOne

AddPolicySequence adds v to the "policy_sequence" field.

func (*SettingsUpsertOne) AddPolicyVersion

func (u *SettingsUpsertOne) AddPolicyVersion(v uint32) *SettingsUpsertOne

AddPolicyVersion adds v to the "policy_version" field.

func (*SettingsUpsertOne) AddTrashDays

func (u *SettingsUpsertOne) AddTrashDays(v int) *SettingsUpsertOne

AddTrashDays adds v to the "trash_days" field.

func (*SettingsUpsertOne) ClearKeyAcknowledgedAt

func (u *SettingsUpsertOne) ClearKeyAcknowledgedAt() *SettingsUpsertOne

ClearKeyAcknowledgedAt clears the value of the "key_acknowledged_at" field.

func (*SettingsUpsertOne) ClearPolicy

func (u *SettingsUpsertOne) ClearPolicy() *SettingsUpsertOne

ClearPolicy clears the value of the "policy" field.

func (*SettingsUpsertOne) ClearRetentionPolicy

func (u *SettingsUpsertOne) ClearRetentionPolicy() *SettingsUpsertOne

ClearRetentionPolicy clears the value of the "retention_policy" field.

func (*SettingsUpsertOne) DoNothing

func (u *SettingsUpsertOne) DoNothing() *SettingsUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*SettingsUpsertOne) Exec

func (u *SettingsUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsUpsertOne) ExecX

func (u *SettingsUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsUpsertOne) ID

func (u *SettingsUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*SettingsUpsertOne) IDX

func (u *SettingsUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*SettingsUpsertOne) Ignore

func (u *SettingsUpsertOne) Ignore() *SettingsUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Settings.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*SettingsUpsertOne) SetKeyAcknowledgedAt

func (u *SettingsUpsertOne) SetKeyAcknowledgedAt(v time.Time) *SettingsUpsertOne

SetKeyAcknowledgedAt sets the "key_acknowledged_at" field.

func (*SettingsUpsertOne) SetPolicy

func (u *SettingsUpsertOne) SetPolicy(v string) *SettingsUpsertOne

SetPolicy sets the "policy" field.

func (*SettingsUpsertOne) SetPolicySequence

func (u *SettingsUpsertOne) SetPolicySequence(v uint64) *SettingsUpsertOne

SetPolicySequence sets the "policy_sequence" field.

func (*SettingsUpsertOne) SetPolicyVersion

func (u *SettingsUpsertOne) SetPolicyVersion(v uint32) *SettingsUpsertOne

SetPolicyVersion sets the "policy_version" field.

func (*SettingsUpsertOne) SetRetentionPolicy

func (u *SettingsUpsertOne) SetRetentionPolicy(v string) *SettingsUpsertOne

SetRetentionPolicy sets the "retention_policy" field.

func (*SettingsUpsertOne) SetTrashDays

func (u *SettingsUpsertOne) SetTrashDays(v int) *SettingsUpsertOne

SetTrashDays sets the "trash_days" field.

func (*SettingsUpsertOne) Update

func (u *SettingsUpsertOne) Update(set func(*SettingsUpsert)) *SettingsUpsertOne

Update allows overriding fields `UPDATE` values. See the SettingsCreate.OnConflict documentation for more info.

func (*SettingsUpsertOne) UpdateKeyAcknowledgedAt

func (u *SettingsUpsertOne) UpdateKeyAcknowledgedAt() *SettingsUpsertOne

UpdateKeyAcknowledgedAt sets the "key_acknowledged_at" field to the value that was provided on create.

func (*SettingsUpsertOne) UpdateNewValues

func (u *SettingsUpsertOne) UpdateNewValues() *SettingsUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Settings.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(settings.FieldID)
		}),
	).
	Exec(ctx)

func (*SettingsUpsertOne) UpdatePolicy

func (u *SettingsUpsertOne) UpdatePolicy() *SettingsUpsertOne

UpdatePolicy sets the "policy" field to the value that was provided on create.

func (*SettingsUpsertOne) UpdatePolicySequence

func (u *SettingsUpsertOne) UpdatePolicySequence() *SettingsUpsertOne

UpdatePolicySequence sets the "policy_sequence" field to the value that was provided on create.

func (*SettingsUpsertOne) UpdatePolicyVersion

func (u *SettingsUpsertOne) UpdatePolicyVersion() *SettingsUpsertOne

UpdatePolicyVersion sets the "policy_version" field to the value that was provided on create.

func (*SettingsUpsertOne) UpdateRetentionPolicy

func (u *SettingsUpsertOne) UpdateRetentionPolicy() *SettingsUpsertOne

UpdateRetentionPolicy sets the "retention_policy" field to the value that was provided on create.

func (*SettingsUpsertOne) UpdateTrashDays

func (u *SettingsUpsertOne) UpdateTrashDays() *SettingsUpsertOne

UpdateTrashDays sets the "trash_days" field to the value that was provided on create.

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 Tree

type Tree struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SetID holds the value of the "set_id" field.
	SetID int64 `json:"set_id,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Dir holds the value of the "dir" field.
	Dir string `json:"dir,omitempty"`
	// ValidFrom holds the value of the "valid_from" field.
	ValidFrom time.Time `json:"valid_from,omitempty"`
	// ValidUntil holds the value of the "valid_until" field.
	ValidUntil *time.Time `json:"valid_until,omitempty"`
	// Ref holds the value of the "ref" field.
	Ref []byte `json:"ref,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TreeQuery when eager-loading is set.
	Edges TreeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tree is the model entity for the Tree schema.

func (*Tree) ExecContext

func (c *Tree) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tree) QueryContext

func (c *Tree) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tree) QuerySet

func (_m *Tree) QuerySet() *SetQuery

QuerySet queries the "set" edge of the Tree entity.

func (*Tree) String

func (_m *Tree) String() string

String implements the fmt.Stringer.

func (*Tree) Unwrap

func (_m *Tree) Unwrap() *Tree

Unwrap unwraps the Tree 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 (*Tree) Update

func (_m *Tree) Update() *TreeUpdateOne

Update returns a builder for updating this Tree. Note that you need to call Tree.Unwrap() before calling this method if this Tree was returned from a transaction, and the transaction was committed or rolled back.

func (*Tree) Value

func (_m *Tree) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tree. This includes values selected through modifiers, order, etc.

type TreeClient

type TreeClient struct {
	// contains filtered or unexported fields
}

TreeClient is a client for the Tree schema.

func NewTreeClient

func NewTreeClient(c config) *TreeClient

NewTreeClient returns a client for the Tree from the given config.

func (*TreeClient) Create

func (c *TreeClient) Create() *TreeCreate

Create returns a builder for creating a Tree entity.

func (*TreeClient) CreateBulk

func (c *TreeClient) CreateBulk(builders ...*TreeCreate) *TreeCreateBulk

CreateBulk returns a builder for creating a bulk of Tree entities.

func (*TreeClient) Delete

func (c *TreeClient) Delete() *TreeDelete

Delete returns a delete builder for Tree.

func (*TreeClient) DeleteOne

func (c *TreeClient) DeleteOne(_m *Tree) *TreeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TreeClient) DeleteOneID

func (c *TreeClient) DeleteOneID(id int) *TreeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TreeClient) ExecContext

func (c *TreeClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeClient) Get

func (c *TreeClient) Get(ctx context.Context, id int) (*Tree, error)

Get returns a Tree entity by its id.

func (*TreeClient) GetX

func (c *TreeClient) GetX(ctx context.Context, id int) *Tree

GetX is like Get, but panics if an error occurs.

func (*TreeClient) Hooks

func (c *TreeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TreeClient) Intercept

func (c *TreeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tree.Intercept(f(g(h())))`.

func (*TreeClient) Interceptors

func (c *TreeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TreeClient) MapCreateBulk

func (c *TreeClient) MapCreateBulk(slice any, setFunc func(*TreeCreate, int)) *TreeCreateBulk

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 (*TreeClient) Query

func (c *TreeClient) Query() *TreeQuery

Query returns a query builder for Tree.

func (*TreeClient) QueryContext

func (c *TreeClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeClient) QuerySet

func (c *TreeClient) QuerySet(_m *Tree) *SetQuery

QuerySet queries the set edge of a Tree.

func (*TreeClient) Update

func (c *TreeClient) Update() *TreeUpdate

Update returns an update builder for Tree.

func (*TreeClient) UpdateOne

func (c *TreeClient) UpdateOne(_m *Tree) *TreeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TreeClient) UpdateOneID

func (c *TreeClient) UpdateOneID(id int) *TreeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TreeClient) Use

func (c *TreeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tree.Hooks(f(g(h())))`.

type TreeCreate

type TreeCreate struct {
	// contains filtered or unexported fields
}

TreeCreate is the builder for creating a Tree entity.

func (*TreeCreate) Exec

func (_c *TreeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TreeCreate) ExecContext

func (c *TreeCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeCreate) ExecX

func (_c *TreeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeCreate) Mutation

func (_c *TreeCreate) Mutation() *TreeMutation

Mutation returns the TreeMutation object of the builder.

func (*TreeCreate) OnConflict

func (_c *TreeCreate) OnConflict(opts ...sql.ConflictOption) *TreeUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tree.Create().
	SetSetID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TreeUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*TreeCreate) OnConflictColumns

func (_c *TreeCreate) OnConflictColumns(columns ...string) *TreeUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tree.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TreeCreate) QueryContext

func (c *TreeCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeCreate) Save

func (_c *TreeCreate) Save(ctx context.Context) (*Tree, error)

Save creates the Tree in the database.

func (*TreeCreate) SaveX

func (_c *TreeCreate) SaveX(ctx context.Context) *Tree

SaveX calls Save and panics if Save returns an error.

func (*TreeCreate) SetDir

func (_c *TreeCreate) SetDir(v string) *TreeCreate

SetDir sets the "dir" field.

func (*TreeCreate) SetNillableValidUntil

func (_c *TreeCreate) SetNillableValidUntil(v *time.Time) *TreeCreate

SetNillableValidUntil sets the "valid_until" field if the given value is not nil.

func (*TreeCreate) SetPath

func (_c *TreeCreate) SetPath(v string) *TreeCreate

SetPath sets the "path" field.

func (*TreeCreate) SetRef

func (_c *TreeCreate) SetRef(v []byte) *TreeCreate

SetRef sets the "ref" field.

func (*TreeCreate) SetSet

func (_c *TreeCreate) SetSet(v *Set) *TreeCreate

SetSet sets the "set" edge to the Set entity.

func (*TreeCreate) SetSetID

func (_c *TreeCreate) SetSetID(v int64) *TreeCreate

SetSetID sets the "set_id" field.

func (*TreeCreate) SetValidFrom

func (_c *TreeCreate) SetValidFrom(v time.Time) *TreeCreate

SetValidFrom sets the "valid_from" field.

func (*TreeCreate) SetValidUntil

func (_c *TreeCreate) SetValidUntil(v time.Time) *TreeCreate

SetValidUntil sets the "valid_until" field.

type TreeCreateBulk

type TreeCreateBulk struct {
	// contains filtered or unexported fields
}

TreeCreateBulk is the builder for creating many Tree entities in bulk.

func (*TreeCreateBulk) Exec

func (_c *TreeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TreeCreateBulk) ExecContext

func (c *TreeCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeCreateBulk) ExecX

func (_c *TreeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeCreateBulk) OnConflict

func (_c *TreeCreateBulk) OnConflict(opts ...sql.ConflictOption) *TreeUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tree.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TreeUpsert) {
		SetSetID(v+v).
	}).
	Exec(ctx)

func (*TreeCreateBulk) OnConflictColumns

func (_c *TreeCreateBulk) OnConflictColumns(columns ...string) *TreeUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tree.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TreeCreateBulk) QueryContext

func (c *TreeCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeCreateBulk) Save

func (_c *TreeCreateBulk) Save(ctx context.Context) ([]*Tree, error)

Save creates the Tree entities in the database.

func (*TreeCreateBulk) SaveX

func (_c *TreeCreateBulk) SaveX(ctx context.Context) []*Tree

SaveX is like Save, but panics if an error occurs.

type TreeDelete

type TreeDelete struct {
	// contains filtered or unexported fields
}

TreeDelete is the builder for deleting a Tree entity.

func (*TreeDelete) Exec

func (_d *TreeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TreeDelete) ExecContext

func (c *TreeDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeDelete) ExecX

func (_d *TreeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TreeDelete) QueryContext

func (c *TreeDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeDelete) Where

func (_d *TreeDelete) Where(ps ...predicate.Tree) *TreeDelete

Where appends a list predicates to the TreeDelete builder.

type TreeDeleteOne

type TreeDeleteOne struct {
	// contains filtered or unexported fields
}

TreeDeleteOne is the builder for deleting a single Tree entity.

func (*TreeDeleteOne) Exec

func (_d *TreeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TreeDeleteOne) ExecX

func (_d *TreeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeDeleteOne) Where

func (_d *TreeDeleteOne) Where(ps ...predicate.Tree) *TreeDeleteOne

Where appends a list predicates to the TreeDelete builder.

type TreeEdges

type TreeEdges struct {
	// Set holds the value of the set edge.
	Set *Set `json:"set,omitempty"`
	// contains filtered or unexported fields
}

TreeEdges holds the relations/edges for other nodes in the graph.

func (TreeEdges) SetOrErr

func (e TreeEdges) SetOrErr() (*Set, error)

SetOrErr returns the Set value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TreeGroupBy

type TreeGroupBy struct {
	// contains filtered or unexported fields
}

TreeGroupBy is the group-by builder for Tree entities.

func (*TreeGroupBy) Aggregate

func (_g *TreeGroupBy) Aggregate(fns ...AggregateFunc) *TreeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TreeGroupBy) Bool

func (s *TreeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) BoolX

func (s *TreeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TreeGroupBy) Bools

func (s *TreeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) BoolsX

func (s *TreeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TreeGroupBy) Float64

func (s *TreeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) Float64X

func (s *TreeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TreeGroupBy) Float64s

func (s *TreeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) Float64sX

func (s *TreeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TreeGroupBy) Int

func (s *TreeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) IntX

func (s *TreeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TreeGroupBy) Ints

func (s *TreeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) IntsX

func (s *TreeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TreeGroupBy) Scan

func (_g *TreeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TreeGroupBy) ScanX

func (s *TreeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TreeGroupBy) String

func (s *TreeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) StringX

func (s *TreeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TreeGroupBy) Strings

func (s *TreeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TreeGroupBy) StringsX

func (s *TreeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TreeMutation

type TreeMutation struct {
	// contains filtered or unexported fields
}

TreeMutation represents an operation that mutates the Tree nodes in the graph.

func (*TreeMutation) AddField

func (m *TreeMutation) 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 (*TreeMutation) AddedEdges

func (m *TreeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TreeMutation) AddedField

func (m *TreeMutation) 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 (*TreeMutation) AddedFields

func (m *TreeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TreeMutation) AddedIDs

func (m *TreeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TreeMutation) ClearEdge

func (m *TreeMutation) 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 (*TreeMutation) ClearField

func (m *TreeMutation) 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 (*TreeMutation) ClearSet

func (m *TreeMutation) ClearSet()

ClearSet clears the "set" edge to the Set entity.

func (*TreeMutation) ClearValidUntil

func (m *TreeMutation) ClearValidUntil()

ClearValidUntil clears the value of the "valid_until" field.

func (*TreeMutation) ClearedEdges

func (m *TreeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TreeMutation) ClearedFields

func (m *TreeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TreeMutation) Client

func (m TreeMutation) 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 (*TreeMutation) Dir

func (m *TreeMutation) Dir() (r string, exists bool)

Dir returns the value of the "dir" field in the mutation.

func (*TreeMutation) EdgeCleared

func (m *TreeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TreeMutation) ExecContext

func (c *TreeMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeMutation) Field

func (m *TreeMutation) 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 (*TreeMutation) FieldCleared

func (m *TreeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TreeMutation) Fields

func (m *TreeMutation) 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 (*TreeMutation) ID

func (m *TreeMutation) 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 (*TreeMutation) IDs

func (m *TreeMutation) 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 (*TreeMutation) OldDir

func (m *TreeMutation) OldDir(ctx context.Context) (v string, err error)

OldDir returns the old "dir" field's value of the Tree entity. If the Tree 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 (*TreeMutation) OldField

func (m *TreeMutation) 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 (*TreeMutation) OldPath

func (m *TreeMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Tree entity. If the Tree 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 (*TreeMutation) OldRef

func (m *TreeMutation) OldRef(ctx context.Context) (v []byte, err error)

OldRef returns the old "ref" field's value of the Tree entity. If the Tree 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 (*TreeMutation) OldSetID

func (m *TreeMutation) OldSetID(ctx context.Context) (v int64, err error)

OldSetID returns the old "set_id" field's value of the Tree entity. If the Tree 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 (*TreeMutation) OldValidFrom

func (m *TreeMutation) OldValidFrom(ctx context.Context) (v time.Time, err error)

OldValidFrom returns the old "valid_from" field's value of the Tree entity. If the Tree 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 (*TreeMutation) OldValidUntil

func (m *TreeMutation) OldValidUntil(ctx context.Context) (v *time.Time, err error)

OldValidUntil returns the old "valid_until" field's value of the Tree entity. If the Tree 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 (*TreeMutation) Op

func (m *TreeMutation) Op() Op

Op returns the operation name.

func (*TreeMutation) Path

func (m *TreeMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*TreeMutation) QueryContext

func (c *TreeMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeMutation) Ref

func (m *TreeMutation) Ref() (r []byte, exists bool)

Ref returns the value of the "ref" field in the mutation.

func (*TreeMutation) RemovedEdges

func (m *TreeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TreeMutation) RemovedIDs

func (m *TreeMutation) 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 (*TreeMutation) ResetDir

func (m *TreeMutation) ResetDir()

ResetDir resets all changes to the "dir" field.

func (*TreeMutation) ResetEdge

func (m *TreeMutation) 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 (*TreeMutation) ResetField

func (m *TreeMutation) 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 (*TreeMutation) ResetPath

func (m *TreeMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*TreeMutation) ResetRef

func (m *TreeMutation) ResetRef()

ResetRef resets all changes to the "ref" field.

func (*TreeMutation) ResetSet

func (m *TreeMutation) ResetSet()

ResetSet resets all changes to the "set" edge.

func (*TreeMutation) ResetSetID

func (m *TreeMutation) ResetSetID()

ResetSetID resets all changes to the "set_id" field.

func (*TreeMutation) ResetValidFrom

func (m *TreeMutation) ResetValidFrom()

ResetValidFrom resets all changes to the "valid_from" field.

func (*TreeMutation) ResetValidUntil

func (m *TreeMutation) ResetValidUntil()

ResetValidUntil resets all changes to the "valid_until" field.

func (*TreeMutation) SetCleared

func (m *TreeMutation) SetCleared() bool

SetCleared reports if the "set" edge to the Set entity was cleared.

func (*TreeMutation) SetDir

func (m *TreeMutation) SetDir(s string)

SetDir sets the "dir" field.

func (*TreeMutation) SetField

func (m *TreeMutation) 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 (*TreeMutation) SetID

func (m *TreeMutation) SetID() (r int64, exists bool)

SetID returns the value of the "set_id" field in the mutation.

func (*TreeMutation) SetIDs

func (m *TreeMutation) SetIDs() (ids []int64)

SetIDs returns the "set" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SetID instead. It exists only for internal usage by the builders.

func (*TreeMutation) SetOp

func (m *TreeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TreeMutation) SetPath

func (m *TreeMutation) SetPath(s string)

SetPath sets the "path" field.

func (*TreeMutation) SetRef

func (m *TreeMutation) SetRef(b []byte)

SetRef sets the "ref" field.

func (*TreeMutation) SetSetID

func (m *TreeMutation) SetSetID(i int64)

SetSetID sets the "set_id" field.

func (*TreeMutation) SetValidFrom

func (m *TreeMutation) SetValidFrom(t time.Time)

SetValidFrom sets the "valid_from" field.

func (*TreeMutation) SetValidUntil

func (m *TreeMutation) SetValidUntil(t time.Time)

SetValidUntil sets the "valid_until" field.

func (TreeMutation) Tx

func (m TreeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TreeMutation) Type

func (m *TreeMutation) Type() string

Type returns the node type of this mutation (Tree).

func (*TreeMutation) ValidFrom

func (m *TreeMutation) ValidFrom() (r time.Time, exists bool)

ValidFrom returns the value of the "valid_from" field in the mutation.

func (*TreeMutation) ValidUntil

func (m *TreeMutation) ValidUntil() (r time.Time, exists bool)

ValidUntil returns the value of the "valid_until" field in the mutation.

func (*TreeMutation) ValidUntilCleared

func (m *TreeMutation) ValidUntilCleared() bool

ValidUntilCleared returns if the "valid_until" field was cleared in this mutation.

func (*TreeMutation) Where

func (m *TreeMutation) Where(ps ...predicate.Tree)

Where appends a list predicates to the TreeMutation builder.

func (*TreeMutation) WhereP

func (m *TreeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TreeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TreeQuery

type TreeQuery struct {
	// contains filtered or unexported fields
}

TreeQuery is the builder for querying Tree entities.

func (*TreeQuery) Aggregate

func (_q *TreeQuery) Aggregate(fns ...AggregateFunc) *TreeSelect

Aggregate returns a TreeSelect configured with the given aggregations.

func (*TreeQuery) All

func (_q *TreeQuery) All(ctx context.Context) ([]*Tree, error)

All executes the query and returns a list of Trees.

func (*TreeQuery) AllX

func (_q *TreeQuery) AllX(ctx context.Context) []*Tree

AllX is like All, but panics if an error occurs.

func (*TreeQuery) Clone

func (_q *TreeQuery) Clone() *TreeQuery

Clone returns a duplicate of the TreeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TreeQuery) Count

func (_q *TreeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TreeQuery) CountX

func (_q *TreeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TreeQuery) ExecContext

func (c *TreeQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeQuery) Exist

func (_q *TreeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TreeQuery) ExistX

func (_q *TreeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TreeQuery) First

func (_q *TreeQuery) First(ctx context.Context) (*Tree, error)

First returns the first Tree entity from the query. Returns a *NotFoundError when no Tree was found.

func (*TreeQuery) FirstID

func (_q *TreeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tree ID from the query. Returns a *NotFoundError when no Tree ID was found.

func (*TreeQuery) FirstIDX

func (_q *TreeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TreeQuery) FirstX

func (_q *TreeQuery) FirstX(ctx context.Context) *Tree

FirstX is like First, but panics if an error occurs.

func (*TreeQuery) ForShare

func (_q *TreeQuery) ForShare(opts ...sql.LockOption) *TreeQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*TreeQuery) ForUpdate

func (_q *TreeQuery) ForUpdate(opts ...sql.LockOption) *TreeQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*TreeQuery) GroupBy

func (_q *TreeQuery) GroupBy(field string, fields ...string) *TreeGroupBy

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 {
	SetID int64 `json:"set_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tree.Query().
	GroupBy(tree.FieldSetID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TreeQuery) IDs

func (_q *TreeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tree IDs.

func (*TreeQuery) IDsX

func (_q *TreeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TreeQuery) Limit

func (_q *TreeQuery) Limit(limit int) *TreeQuery

Limit the number of records to be returned by this query.

func (*TreeQuery) Offset

func (_q *TreeQuery) Offset(offset int) *TreeQuery

Offset to start from.

func (*TreeQuery) Only

func (_q *TreeQuery) Only(ctx context.Context) (*Tree, error)

Only returns a single Tree entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tree entity is found. Returns a *NotFoundError when no Tree entities are found.

func (*TreeQuery) OnlyID

func (_q *TreeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Tree ID in the query. Returns a *NotSingularError when more than one Tree ID is found. Returns a *NotFoundError when no entities are found.

func (*TreeQuery) OnlyIDX

func (_q *TreeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TreeQuery) OnlyX

func (_q *TreeQuery) OnlyX(ctx context.Context) *Tree

OnlyX is like Only, but panics if an error occurs.

func (*TreeQuery) Order

func (_q *TreeQuery) Order(o ...tree.OrderOption) *TreeQuery

Order specifies how the records should be ordered.

func (*TreeQuery) QueryContext

func (c *TreeQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeQuery) QuerySet

func (_q *TreeQuery) QuerySet() *SetQuery

QuerySet chains the current query on the "set" edge.

func (*TreeQuery) Select

func (_q *TreeQuery) Select(fields ...string) *TreeSelect

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 {
	SetID int64 `json:"set_id,omitempty"`
}

client.Tree.Query().
	Select(tree.FieldSetID).
	Scan(ctx, &v)

func (*TreeQuery) Unique

func (_q *TreeQuery) Unique(unique bool) *TreeQuery

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 (*TreeQuery) Where

func (_q *TreeQuery) Where(ps ...predicate.Tree) *TreeQuery

Where adds a new predicate for the TreeQuery builder.

func (*TreeQuery) WithSet

func (_q *TreeQuery) WithSet(opts ...func(*SetQuery)) *TreeQuery

WithSet tells the query-builder to eager-load the nodes that are connected to the "set" edge. The optional arguments are used to configure the query builder of the edge.

type TreeSelect

type TreeSelect struct {
	*TreeQuery
	// contains filtered or unexported fields
}

TreeSelect is the builder for selecting fields of Tree entities.

func (*TreeSelect) Aggregate

func (_s *TreeSelect) Aggregate(fns ...AggregateFunc) *TreeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TreeSelect) Bool

func (s *TreeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TreeSelect) BoolX

func (s *TreeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TreeSelect) Bools

func (s *TreeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TreeSelect) BoolsX

func (s *TreeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (TreeSelect) ExecContext

func (c TreeSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeSelect) Float64

func (s *TreeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TreeSelect) Float64X

func (s *TreeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TreeSelect) Float64s

func (s *TreeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TreeSelect) Float64sX

func (s *TreeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TreeSelect) Int

func (s *TreeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TreeSelect) IntX

func (s *TreeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TreeSelect) Ints

func (s *TreeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TreeSelect) IntsX

func (s *TreeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (TreeSelect) QueryContext

func (c TreeSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeSelect) Scan

func (_s *TreeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TreeSelect) ScanX

func (s *TreeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TreeSelect) String

func (s *TreeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TreeSelect) StringX

func (s *TreeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TreeSelect) Strings

func (s *TreeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TreeSelect) StringsX

func (s *TreeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TreeUpdate

type TreeUpdate struct {
	// contains filtered or unexported fields
}

TreeUpdate is the builder for updating Tree entities.

func (*TreeUpdate) ClearSet

func (_u *TreeUpdate) ClearSet() *TreeUpdate

ClearSet clears the "set" edge to the Set entity.

func (*TreeUpdate) ClearValidUntil

func (_u *TreeUpdate) ClearValidUntil() *TreeUpdate

ClearValidUntil clears the value of the "valid_until" field.

func (*TreeUpdate) Exec

func (_u *TreeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TreeUpdate) ExecContext

func (c *TreeUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeUpdate) ExecX

func (_u *TreeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeUpdate) Mutation

func (_u *TreeUpdate) Mutation() *TreeMutation

Mutation returns the TreeMutation object of the builder.

func (*TreeUpdate) QueryContext

func (c *TreeUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeUpdate) Save

func (_u *TreeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TreeUpdate) SaveX

func (_u *TreeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TreeUpdate) SetDir

func (_u *TreeUpdate) SetDir(v string) *TreeUpdate

SetDir sets the "dir" field.

func (*TreeUpdate) SetNillableDir

func (_u *TreeUpdate) SetNillableDir(v *string) *TreeUpdate

SetNillableDir sets the "dir" field if the given value is not nil.

func (*TreeUpdate) SetNillablePath

func (_u *TreeUpdate) SetNillablePath(v *string) *TreeUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*TreeUpdate) SetNillableSetID

func (_u *TreeUpdate) SetNillableSetID(v *int64) *TreeUpdate

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*TreeUpdate) SetNillableValidFrom

func (_u *TreeUpdate) SetNillableValidFrom(v *time.Time) *TreeUpdate

SetNillableValidFrom sets the "valid_from" field if the given value is not nil.

func (*TreeUpdate) SetNillableValidUntil

func (_u *TreeUpdate) SetNillableValidUntil(v *time.Time) *TreeUpdate

SetNillableValidUntil sets the "valid_until" field if the given value is not nil.

func (*TreeUpdate) SetPath

func (_u *TreeUpdate) SetPath(v string) *TreeUpdate

SetPath sets the "path" field.

func (*TreeUpdate) SetRef

func (_u *TreeUpdate) SetRef(v []byte) *TreeUpdate

SetRef sets the "ref" field.

func (*TreeUpdate) SetSet

func (_u *TreeUpdate) SetSet(v *Set) *TreeUpdate

SetSet sets the "set" edge to the Set entity.

func (*TreeUpdate) SetSetID

func (_u *TreeUpdate) SetSetID(v int64) *TreeUpdate

SetSetID sets the "set_id" field.

func (*TreeUpdate) SetValidFrom

func (_u *TreeUpdate) SetValidFrom(v time.Time) *TreeUpdate

SetValidFrom sets the "valid_from" field.

func (*TreeUpdate) SetValidUntil

func (_u *TreeUpdate) SetValidUntil(v time.Time) *TreeUpdate

SetValidUntil sets the "valid_until" field.

func (*TreeUpdate) Where

func (_u *TreeUpdate) Where(ps ...predicate.Tree) *TreeUpdate

Where appends a list predicates to the TreeUpdate builder.

type TreeUpdateOne

type TreeUpdateOne struct {
	// contains filtered or unexported fields
}

TreeUpdateOne is the builder for updating a single Tree entity.

func (*TreeUpdateOne) ClearSet

func (_u *TreeUpdateOne) ClearSet() *TreeUpdateOne

ClearSet clears the "set" edge to the Set entity.

func (*TreeUpdateOne) ClearValidUntil

func (_u *TreeUpdateOne) ClearValidUntil() *TreeUpdateOne

ClearValidUntil clears the value of the "valid_until" field.

func (*TreeUpdateOne) Exec

func (_u *TreeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TreeUpdateOne) ExecContext

func (c *TreeUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TreeUpdateOne) ExecX

func (_u *TreeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeUpdateOne) Mutation

func (_u *TreeUpdateOne) Mutation() *TreeMutation

Mutation returns the TreeMutation object of the builder.

func (*TreeUpdateOne) QueryContext

func (c *TreeUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TreeUpdateOne) Save

func (_u *TreeUpdateOne) Save(ctx context.Context) (*Tree, error)

Save executes the query and returns the updated Tree entity.

func (*TreeUpdateOne) SaveX

func (_u *TreeUpdateOne) SaveX(ctx context.Context) *Tree

SaveX is like Save, but panics if an error occurs.

func (*TreeUpdateOne) Select

func (_u *TreeUpdateOne) Select(field string, fields ...string) *TreeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TreeUpdateOne) SetDir

func (_u *TreeUpdateOne) SetDir(v string) *TreeUpdateOne

SetDir sets the "dir" field.

func (*TreeUpdateOne) SetNillableDir

func (_u *TreeUpdateOne) SetNillableDir(v *string) *TreeUpdateOne

SetNillableDir sets the "dir" field if the given value is not nil.

func (*TreeUpdateOne) SetNillablePath

func (_u *TreeUpdateOne) SetNillablePath(v *string) *TreeUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*TreeUpdateOne) SetNillableSetID

func (_u *TreeUpdateOne) SetNillableSetID(v *int64) *TreeUpdateOne

SetNillableSetID sets the "set_id" field if the given value is not nil.

func (*TreeUpdateOne) SetNillableValidFrom

func (_u *TreeUpdateOne) SetNillableValidFrom(v *time.Time) *TreeUpdateOne

SetNillableValidFrom sets the "valid_from" field if the given value is not nil.

func (*TreeUpdateOne) SetNillableValidUntil

func (_u *TreeUpdateOne) SetNillableValidUntil(v *time.Time) *TreeUpdateOne

SetNillableValidUntil sets the "valid_until" field if the given value is not nil.

func (*TreeUpdateOne) SetPath

func (_u *TreeUpdateOne) SetPath(v string) *TreeUpdateOne

SetPath sets the "path" field.

func (*TreeUpdateOne) SetRef

func (_u *TreeUpdateOne) SetRef(v []byte) *TreeUpdateOne

SetRef sets the "ref" field.

func (*TreeUpdateOne) SetSet

func (_u *TreeUpdateOne) SetSet(v *Set) *TreeUpdateOne

SetSet sets the "set" edge to the Set entity.

func (*TreeUpdateOne) SetSetID

func (_u *TreeUpdateOne) SetSetID(v int64) *TreeUpdateOne

SetSetID sets the "set_id" field.

func (*TreeUpdateOne) SetValidFrom

func (_u *TreeUpdateOne) SetValidFrom(v time.Time) *TreeUpdateOne

SetValidFrom sets the "valid_from" field.

func (*TreeUpdateOne) SetValidUntil

func (_u *TreeUpdateOne) SetValidUntil(v time.Time) *TreeUpdateOne

SetValidUntil sets the "valid_until" field.

func (*TreeUpdateOne) Where

func (_u *TreeUpdateOne) Where(ps ...predicate.Tree) *TreeUpdateOne

Where appends a list predicates to the TreeUpdate builder.

type TreeUpsert

type TreeUpsert struct {
	*sql.UpdateSet
}

TreeUpsert is the "OnConflict" setter.

func (*TreeUpsert) ClearValidUntil

func (u *TreeUpsert) ClearValidUntil() *TreeUpsert

ClearValidUntil clears the value of the "valid_until" field.

func (*TreeUpsert) SetDir

func (u *TreeUpsert) SetDir(v string) *TreeUpsert

SetDir sets the "dir" field.

func (*TreeUpsert) SetPath

func (u *TreeUpsert) SetPath(v string) *TreeUpsert

SetPath sets the "path" field.

func (*TreeUpsert) SetRef

func (u *TreeUpsert) SetRef(v []byte) *TreeUpsert

SetRef sets the "ref" field.

func (*TreeUpsert) SetSetID

func (u *TreeUpsert) SetSetID(v int64) *TreeUpsert

SetSetID sets the "set_id" field.

func (*TreeUpsert) SetValidFrom

func (u *TreeUpsert) SetValidFrom(v time.Time) *TreeUpsert

SetValidFrom sets the "valid_from" field.

func (*TreeUpsert) SetValidUntil

func (u *TreeUpsert) SetValidUntil(v time.Time) *TreeUpsert

SetValidUntil sets the "valid_until" field.

func (*TreeUpsert) UpdateDir

func (u *TreeUpsert) UpdateDir() *TreeUpsert

UpdateDir sets the "dir" field to the value that was provided on create.

func (*TreeUpsert) UpdatePath

func (u *TreeUpsert) UpdatePath() *TreeUpsert

UpdatePath sets the "path" field to the value that was provided on create.

func (*TreeUpsert) UpdateRef

func (u *TreeUpsert) UpdateRef() *TreeUpsert

UpdateRef sets the "ref" field to the value that was provided on create.

func (*TreeUpsert) UpdateSetID

func (u *TreeUpsert) UpdateSetID() *TreeUpsert

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*TreeUpsert) UpdateValidFrom

func (u *TreeUpsert) UpdateValidFrom() *TreeUpsert

UpdateValidFrom sets the "valid_from" field to the value that was provided on create.

func (*TreeUpsert) UpdateValidUntil

func (u *TreeUpsert) UpdateValidUntil() *TreeUpsert

UpdateValidUntil sets the "valid_until" field to the value that was provided on create.

type TreeUpsertBulk

type TreeUpsertBulk struct {
	// contains filtered or unexported fields
}

TreeUpsertBulk is the builder for "upsert"-ing a bulk of Tree nodes.

func (*TreeUpsertBulk) ClearValidUntil

func (u *TreeUpsertBulk) ClearValidUntil() *TreeUpsertBulk

ClearValidUntil clears the value of the "valid_until" field.

func (*TreeUpsertBulk) DoNothing

func (u *TreeUpsertBulk) DoNothing() *TreeUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TreeUpsertBulk) Exec

func (u *TreeUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TreeUpsertBulk) ExecX

func (u *TreeUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeUpsertBulk) Ignore

func (u *TreeUpsertBulk) Ignore() *TreeUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tree.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TreeUpsertBulk) SetDir

func (u *TreeUpsertBulk) SetDir(v string) *TreeUpsertBulk

SetDir sets the "dir" field.

func (*TreeUpsertBulk) SetPath

func (u *TreeUpsertBulk) SetPath(v string) *TreeUpsertBulk

SetPath sets the "path" field.

func (*TreeUpsertBulk) SetRef

func (u *TreeUpsertBulk) SetRef(v []byte) *TreeUpsertBulk

SetRef sets the "ref" field.

func (*TreeUpsertBulk) SetSetID

func (u *TreeUpsertBulk) SetSetID(v int64) *TreeUpsertBulk

SetSetID sets the "set_id" field.

func (*TreeUpsertBulk) SetValidFrom

func (u *TreeUpsertBulk) SetValidFrom(v time.Time) *TreeUpsertBulk

SetValidFrom sets the "valid_from" field.

func (*TreeUpsertBulk) SetValidUntil

func (u *TreeUpsertBulk) SetValidUntil(v time.Time) *TreeUpsertBulk

SetValidUntil sets the "valid_until" field.

func (*TreeUpsertBulk) Update

func (u *TreeUpsertBulk) Update(set func(*TreeUpsert)) *TreeUpsertBulk

Update allows overriding fields `UPDATE` values. See the TreeCreateBulk.OnConflict documentation for more info.

func (*TreeUpsertBulk) UpdateDir

func (u *TreeUpsertBulk) UpdateDir() *TreeUpsertBulk

UpdateDir sets the "dir" field to the value that was provided on create.

func (*TreeUpsertBulk) UpdateNewValues

func (u *TreeUpsertBulk) UpdateNewValues() *TreeUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tree.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TreeUpsertBulk) UpdatePath

func (u *TreeUpsertBulk) UpdatePath() *TreeUpsertBulk

UpdatePath sets the "path" field to the value that was provided on create.

func (*TreeUpsertBulk) UpdateRef

func (u *TreeUpsertBulk) UpdateRef() *TreeUpsertBulk

UpdateRef sets the "ref" field to the value that was provided on create.

func (*TreeUpsertBulk) UpdateSetID

func (u *TreeUpsertBulk) UpdateSetID() *TreeUpsertBulk

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*TreeUpsertBulk) UpdateValidFrom

func (u *TreeUpsertBulk) UpdateValidFrom() *TreeUpsertBulk

UpdateValidFrom sets the "valid_from" field to the value that was provided on create.

func (*TreeUpsertBulk) UpdateValidUntil

func (u *TreeUpsertBulk) UpdateValidUntil() *TreeUpsertBulk

UpdateValidUntil sets the "valid_until" field to the value that was provided on create.

type TreeUpsertOne

type TreeUpsertOne struct {
	// contains filtered or unexported fields
}

TreeUpsertOne is the builder for "upsert"-ing

one Tree node.

func (*TreeUpsertOne) ClearValidUntil

func (u *TreeUpsertOne) ClearValidUntil() *TreeUpsertOne

ClearValidUntil clears the value of the "valid_until" field.

func (*TreeUpsertOne) DoNothing

func (u *TreeUpsertOne) DoNothing() *TreeUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TreeUpsertOne) Exec

func (u *TreeUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TreeUpsertOne) ExecX

func (u *TreeUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TreeUpsertOne) ID

func (u *TreeUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TreeUpsertOne) IDX

func (u *TreeUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*TreeUpsertOne) Ignore

func (u *TreeUpsertOne) Ignore() *TreeUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tree.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TreeUpsertOne) SetDir

func (u *TreeUpsertOne) SetDir(v string) *TreeUpsertOne

SetDir sets the "dir" field.

func (*TreeUpsertOne) SetPath

func (u *TreeUpsertOne) SetPath(v string) *TreeUpsertOne

SetPath sets the "path" field.

func (*TreeUpsertOne) SetRef

func (u *TreeUpsertOne) SetRef(v []byte) *TreeUpsertOne

SetRef sets the "ref" field.

func (*TreeUpsertOne) SetSetID

func (u *TreeUpsertOne) SetSetID(v int64) *TreeUpsertOne

SetSetID sets the "set_id" field.

func (*TreeUpsertOne) SetValidFrom

func (u *TreeUpsertOne) SetValidFrom(v time.Time) *TreeUpsertOne

SetValidFrom sets the "valid_from" field.

func (*TreeUpsertOne) SetValidUntil

func (u *TreeUpsertOne) SetValidUntil(v time.Time) *TreeUpsertOne

SetValidUntil sets the "valid_until" field.

func (*TreeUpsertOne) Update

func (u *TreeUpsertOne) Update(set func(*TreeUpsert)) *TreeUpsertOne

Update allows overriding fields `UPDATE` values. See the TreeCreate.OnConflict documentation for more info.

func (*TreeUpsertOne) UpdateDir

func (u *TreeUpsertOne) UpdateDir() *TreeUpsertOne

UpdateDir sets the "dir" field to the value that was provided on create.

func (*TreeUpsertOne) UpdateNewValues

func (u *TreeUpsertOne) UpdateNewValues() *TreeUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tree.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*TreeUpsertOne) UpdatePath

func (u *TreeUpsertOne) UpdatePath() *TreeUpsertOne

UpdatePath sets the "path" field to the value that was provided on create.

func (*TreeUpsertOne) UpdateRef

func (u *TreeUpsertOne) UpdateRef() *TreeUpsertOne

UpdateRef sets the "ref" field to the value that was provided on create.

func (*TreeUpsertOne) UpdateSetID

func (u *TreeUpsertOne) UpdateSetID() *TreeUpsertOne

UpdateSetID sets the "set_id" field to the value that was provided on create.

func (*TreeUpsertOne) UpdateValidFrom

func (u *TreeUpsertOne) UpdateValidFrom() *TreeUpsertOne

UpdateValidFrom sets the "valid_from" field to the value that was provided on create.

func (*TreeUpsertOne) UpdateValidUntil

func (u *TreeUpsertOne) UpdateValidUntil() *TreeUpsertOne

UpdateValidUntil sets the "valid_until" field to the value that was provided on create.

type Trees

type Trees []*Tree

Trees is a parsable slice of Tree.

type Tx

type Tx struct {

	// Archive is the client for interacting with the Archive builders.
	Archive *ArchiveClient
	// CommitRow is the client for interacting with the CommitRow builders.
	CommitRow *CommitRowClient
	// DamagedPath is the client for interacting with the DamagedPath builders.
	DamagedPath *DamagedPathClient
	// DeletedRef is the client for interacting with the DeletedRef builders.
	DeletedRef *DeletedRefClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Object is the client for interacting with the Object builders.
	Object *ObjectClient
	// Pin is the client for interacting with the Pin builders.
	Pin *PinClient
	// Reindex is the client for interacting with the Reindex builders.
	Reindex *ReindexClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// Set is the client for interacting with the Set builders.
	Set *SetClient
	// SetRef is the client for interacting with the SetRef builders.
	SetRef *SetRefClient
	// Settings is the client for interacting with the Settings builders.
	Settings *SettingsClient
	// Tree is the client for interacting with the Tree builders.
	Tree *TreeClient
	// WalkedArchive is the client for interacting with the WalkedArchive builders.
	WalkedArchive *WalkedArchiveClient
	// 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) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tx) 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) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*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.

type WalkedArchive

type WalkedArchive struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// contains filtered or unexported fields
}

WalkedArchive is the model entity for the WalkedArchive schema.

func (*WalkedArchive) ExecContext

func (c *WalkedArchive) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchive) QueryContext

func (c *WalkedArchive) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchive) String

func (_m *WalkedArchive) String() string

String implements the fmt.Stringer.

func (*WalkedArchive) Unwrap

func (_m *WalkedArchive) Unwrap() *WalkedArchive

Unwrap unwraps the WalkedArchive 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 (*WalkedArchive) Update

func (_m *WalkedArchive) Update() *WalkedArchiveUpdateOne

Update returns a builder for updating this WalkedArchive. Note that you need to call WalkedArchive.Unwrap() before calling this method if this WalkedArchive was returned from a transaction, and the transaction was committed or rolled back.

func (*WalkedArchive) Value

func (_m *WalkedArchive) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WalkedArchive. This includes values selected through modifiers, order, etc.

type WalkedArchiveClient

type WalkedArchiveClient struct {
	// contains filtered or unexported fields
}

WalkedArchiveClient is a client for the WalkedArchive schema.

func NewWalkedArchiveClient

func NewWalkedArchiveClient(c config) *WalkedArchiveClient

NewWalkedArchiveClient returns a client for the WalkedArchive from the given config.

func (*WalkedArchiveClient) Create

Create returns a builder for creating a WalkedArchive entity.

func (*WalkedArchiveClient) CreateBulk

CreateBulk returns a builder for creating a bulk of WalkedArchive entities.

func (*WalkedArchiveClient) Delete

Delete returns a delete builder for WalkedArchive.

func (*WalkedArchiveClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WalkedArchiveClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WalkedArchiveClient) ExecContext

func (c *WalkedArchiveClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveClient) Get

Get returns a WalkedArchive entity by its id.

func (*WalkedArchiveClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WalkedArchiveClient) Hooks

func (c *WalkedArchiveClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WalkedArchiveClient) Intercept

func (c *WalkedArchiveClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `walkedarchive.Intercept(f(g(h())))`.

func (*WalkedArchiveClient) Interceptors

func (c *WalkedArchiveClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WalkedArchiveClient) MapCreateBulk

func (c *WalkedArchiveClient) MapCreateBulk(slice any, setFunc func(*WalkedArchiveCreate, int)) *WalkedArchiveCreateBulk

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 (*WalkedArchiveClient) Query

Query returns a query builder for WalkedArchive.

func (*WalkedArchiveClient) QueryContext

func (c *WalkedArchiveClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveClient) Update

Update returns an update builder for WalkedArchive.

func (*WalkedArchiveClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WalkedArchiveClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WalkedArchiveClient) Use

func (c *WalkedArchiveClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `walkedarchive.Hooks(f(g(h())))`.

type WalkedArchiveCreate

type WalkedArchiveCreate struct {
	// contains filtered or unexported fields
}

WalkedArchiveCreate is the builder for creating a WalkedArchive entity.

func (*WalkedArchiveCreate) Exec

func (_c *WalkedArchiveCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WalkedArchiveCreate) ExecContext

func (c *WalkedArchiveCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveCreate) ExecX

func (_c *WalkedArchiveCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveCreate) Mutation

Mutation returns the WalkedArchiveMutation object of the builder.

func (*WalkedArchiveCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.WalkedArchive.Create().
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*WalkedArchiveCreate) OnConflictColumns

func (_c *WalkedArchiveCreate) OnConflictColumns(columns ...string) *WalkedArchiveUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.WalkedArchive.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*WalkedArchiveCreate) QueryContext

func (c *WalkedArchiveCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveCreate) Save

Save creates the WalkedArchive in the database.

func (*WalkedArchiveCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WalkedArchiveCreate) SetID

SetID sets the "id" field.

type WalkedArchiveCreateBulk

type WalkedArchiveCreateBulk struct {
	// contains filtered or unexported fields
}

WalkedArchiveCreateBulk is the builder for creating many WalkedArchive entities in bulk.

func (*WalkedArchiveCreateBulk) Exec

Exec executes the query.

func (*WalkedArchiveCreateBulk) ExecContext

func (c *WalkedArchiveCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveCreateBulk) ExecX

func (_c *WalkedArchiveCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.WalkedArchive.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*WalkedArchiveCreateBulk) OnConflictColumns

func (_c *WalkedArchiveCreateBulk) OnConflictColumns(columns ...string) *WalkedArchiveUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.WalkedArchive.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*WalkedArchiveCreateBulk) QueryContext

func (c *WalkedArchiveCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveCreateBulk) Save

Save creates the WalkedArchive entities in the database.

func (*WalkedArchiveCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WalkedArchiveDelete

type WalkedArchiveDelete struct {
	// contains filtered or unexported fields
}

WalkedArchiveDelete is the builder for deleting a WalkedArchive entity.

func (*WalkedArchiveDelete) Exec

func (_d *WalkedArchiveDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WalkedArchiveDelete) ExecContext

func (c *WalkedArchiveDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveDelete) ExecX

func (_d *WalkedArchiveDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveDelete) QueryContext

func (c *WalkedArchiveDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveDelete) Where

Where appends a list predicates to the WalkedArchiveDelete builder.

type WalkedArchiveDeleteOne

type WalkedArchiveDeleteOne struct {
	// contains filtered or unexported fields
}

WalkedArchiveDeleteOne is the builder for deleting a single WalkedArchive entity.

func (*WalkedArchiveDeleteOne) Exec

Exec executes the deletion query.

func (*WalkedArchiveDeleteOne) ExecX

func (_d *WalkedArchiveDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveDeleteOne) Where

Where appends a list predicates to the WalkedArchiveDelete builder.

type WalkedArchiveGroupBy

type WalkedArchiveGroupBy struct {
	// contains filtered or unexported fields
}

WalkedArchiveGroupBy is the group-by builder for WalkedArchive entities.

func (*WalkedArchiveGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*WalkedArchiveGroupBy) Bool

func (s *WalkedArchiveGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) BoolX

func (s *WalkedArchiveGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Bools

func (s *WalkedArchiveGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) BoolsX

func (s *WalkedArchiveGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Float64

func (s *WalkedArchiveGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) Float64X

func (s *WalkedArchiveGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Float64s

func (s *WalkedArchiveGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) Float64sX

func (s *WalkedArchiveGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Int

func (s *WalkedArchiveGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) IntX

func (s *WalkedArchiveGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Ints

func (s *WalkedArchiveGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) IntsX

func (s *WalkedArchiveGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Scan

func (_g *WalkedArchiveGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WalkedArchiveGroupBy) ScanX

func (s *WalkedArchiveGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WalkedArchiveGroupBy) String

func (s *WalkedArchiveGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) StringX

func (s *WalkedArchiveGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WalkedArchiveGroupBy) Strings

func (s *WalkedArchiveGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveGroupBy) StringsX

func (s *WalkedArchiveGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WalkedArchiveMutation

type WalkedArchiveMutation struct {
	// contains filtered or unexported fields
}

WalkedArchiveMutation represents an operation that mutates the WalkedArchive nodes in the graph.

func (*WalkedArchiveMutation) AddField

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) AddedEdges

func (m *WalkedArchiveMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WalkedArchiveMutation) AddedField

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) AddedFields

func (m *WalkedArchiveMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WalkedArchiveMutation) AddedIDs

func (m *WalkedArchiveMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WalkedArchiveMutation) ClearEdge

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) ClearField

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) ClearedEdges

func (m *WalkedArchiveMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WalkedArchiveMutation) ClearedFields

func (m *WalkedArchiveMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WalkedArchiveMutation) Client

func (m WalkedArchiveMutation) 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 (*WalkedArchiveMutation) EdgeCleared

func (m *WalkedArchiveMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WalkedArchiveMutation) ExecContext

func (c *WalkedArchiveMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveMutation) Field

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) FieldCleared

func (m *WalkedArchiveMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WalkedArchiveMutation) Fields

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) ID

func (m *WalkedArchiveMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*WalkedArchiveMutation) 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 (*WalkedArchiveMutation) OldField

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) Op

func (m *WalkedArchiveMutation) Op() Op

Op returns the operation name.

func (*WalkedArchiveMutation) QueryContext

func (c *WalkedArchiveMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveMutation) RemovedEdges

func (m *WalkedArchiveMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WalkedArchiveMutation) RemovedIDs

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) ResetEdge

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) ResetField

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) SetField

func (m *WalkedArchiveMutation) 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 (*WalkedArchiveMutation) SetID

func (m *WalkedArchiveMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WalkedArchive entities.

func (*WalkedArchiveMutation) SetOp

func (m *WalkedArchiveMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (WalkedArchiveMutation) Tx

func (m WalkedArchiveMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WalkedArchiveMutation) Type

func (m *WalkedArchiveMutation) Type() string

Type returns the node type of this mutation (WalkedArchive).

func (*WalkedArchiveMutation) Where

Where appends a list predicates to the WalkedArchiveMutation builder.

func (*WalkedArchiveMutation) WhereP

func (m *WalkedArchiveMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WalkedArchiveMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WalkedArchiveQuery

type WalkedArchiveQuery struct {
	// contains filtered or unexported fields
}

WalkedArchiveQuery is the builder for querying WalkedArchive entities.

func (*WalkedArchiveQuery) Aggregate

func (_q *WalkedArchiveQuery) Aggregate(fns ...AggregateFunc) *WalkedArchiveSelect

Aggregate returns a WalkedArchiveSelect configured with the given aggregations.

func (*WalkedArchiveQuery) All

All executes the query and returns a list of WalkedArchives.

func (*WalkedArchiveQuery) AllX

AllX is like All, but panics if an error occurs.

func (*WalkedArchiveQuery) Clone

Clone returns a duplicate of the WalkedArchiveQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WalkedArchiveQuery) Count

func (_q *WalkedArchiveQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WalkedArchiveQuery) CountX

func (_q *WalkedArchiveQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WalkedArchiveQuery) ExecContext

func (c *WalkedArchiveQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveQuery) Exist

func (_q *WalkedArchiveQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WalkedArchiveQuery) ExistX

func (_q *WalkedArchiveQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WalkedArchiveQuery) First

First returns the first WalkedArchive entity from the query. Returns a *NotFoundError when no WalkedArchive was found.

func (*WalkedArchiveQuery) FirstID

func (_q *WalkedArchiveQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first WalkedArchive ID from the query. Returns a *NotFoundError when no WalkedArchive ID was found.

func (*WalkedArchiveQuery) FirstIDX

func (_q *WalkedArchiveQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*WalkedArchiveQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WalkedArchiveQuery) ForShare

func (_q *WalkedArchiveQuery) ForShare(opts ...sql.LockOption) *WalkedArchiveQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*WalkedArchiveQuery) ForUpdate

func (_q *WalkedArchiveQuery) ForUpdate(opts ...sql.LockOption) *WalkedArchiveQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*WalkedArchiveQuery) GroupBy

func (_q *WalkedArchiveQuery) GroupBy(field string, fields ...string) *WalkedArchiveGroupBy

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.

func (*WalkedArchiveQuery) IDs

func (_q *WalkedArchiveQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of WalkedArchive IDs.

func (*WalkedArchiveQuery) IDsX

func (_q *WalkedArchiveQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*WalkedArchiveQuery) Limit

func (_q *WalkedArchiveQuery) Limit(limit int) *WalkedArchiveQuery

Limit the number of records to be returned by this query.

func (*WalkedArchiveQuery) Offset

func (_q *WalkedArchiveQuery) Offset(offset int) *WalkedArchiveQuery

Offset to start from.

func (*WalkedArchiveQuery) Only

Only returns a single WalkedArchive entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WalkedArchive entity is found. Returns a *NotFoundError when no WalkedArchive entities are found.

func (*WalkedArchiveQuery) OnlyID

func (_q *WalkedArchiveQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only WalkedArchive ID in the query. Returns a *NotSingularError when more than one WalkedArchive ID is found. Returns a *NotFoundError when no entities are found.

func (*WalkedArchiveQuery) OnlyIDX

func (_q *WalkedArchiveQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WalkedArchiveQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WalkedArchiveQuery) Order

Order specifies how the records should be ordered.

func (*WalkedArchiveQuery) QueryContext

func (c *WalkedArchiveQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveQuery) Select

func (_q *WalkedArchiveQuery) Select(fields ...string) *WalkedArchiveSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*WalkedArchiveQuery) Unique

func (_q *WalkedArchiveQuery) Unique(unique bool) *WalkedArchiveQuery

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 (*WalkedArchiveQuery) Where

Where adds a new predicate for the WalkedArchiveQuery builder.

type WalkedArchiveSelect

type WalkedArchiveSelect struct {
	*WalkedArchiveQuery
	// contains filtered or unexported fields
}

WalkedArchiveSelect is the builder for selecting fields of WalkedArchive entities.

func (*WalkedArchiveSelect) Aggregate

func (_s *WalkedArchiveSelect) Aggregate(fns ...AggregateFunc) *WalkedArchiveSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WalkedArchiveSelect) Bool

func (s *WalkedArchiveSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) BoolX

func (s *WalkedArchiveSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WalkedArchiveSelect) Bools

func (s *WalkedArchiveSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) BoolsX

func (s *WalkedArchiveSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (WalkedArchiveSelect) ExecContext

func (c WalkedArchiveSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveSelect) Float64

func (s *WalkedArchiveSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) Float64X

func (s *WalkedArchiveSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WalkedArchiveSelect) Float64s

func (s *WalkedArchiveSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) Float64sX

func (s *WalkedArchiveSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WalkedArchiveSelect) Int

func (s *WalkedArchiveSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) IntX

func (s *WalkedArchiveSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WalkedArchiveSelect) Ints

func (s *WalkedArchiveSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) IntsX

func (s *WalkedArchiveSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (WalkedArchiveSelect) QueryContext

func (c WalkedArchiveSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveSelect) Scan

func (_s *WalkedArchiveSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WalkedArchiveSelect) ScanX

func (s *WalkedArchiveSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WalkedArchiveSelect) String

func (s *WalkedArchiveSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) StringX

func (s *WalkedArchiveSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WalkedArchiveSelect) Strings

func (s *WalkedArchiveSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WalkedArchiveSelect) StringsX

func (s *WalkedArchiveSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WalkedArchiveUpdate

type WalkedArchiveUpdate struct {
	// contains filtered or unexported fields
}

WalkedArchiveUpdate is the builder for updating WalkedArchive entities.

func (*WalkedArchiveUpdate) Exec

func (_u *WalkedArchiveUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WalkedArchiveUpdate) ExecContext

func (c *WalkedArchiveUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveUpdate) ExecX

func (_u *WalkedArchiveUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveUpdate) Mutation

Mutation returns the WalkedArchiveMutation object of the builder.

func (*WalkedArchiveUpdate) QueryContext

func (c *WalkedArchiveUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveUpdate) Save

func (_u *WalkedArchiveUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WalkedArchiveUpdate) SaveX

func (_u *WalkedArchiveUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WalkedArchiveUpdate) Where

Where appends a list predicates to the WalkedArchiveUpdate builder.

type WalkedArchiveUpdateOne

type WalkedArchiveUpdateOne struct {
	// contains filtered or unexported fields
}

WalkedArchiveUpdateOne is the builder for updating a single WalkedArchive entity.

func (*WalkedArchiveUpdateOne) Exec

Exec executes the query on the entity.

func (*WalkedArchiveUpdateOne) ExecContext

func (c *WalkedArchiveUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*WalkedArchiveUpdateOne) ExecX

func (_u *WalkedArchiveUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveUpdateOne) Mutation

Mutation returns the WalkedArchiveMutation object of the builder.

func (*WalkedArchiveUpdateOne) QueryContext

func (c *WalkedArchiveUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*WalkedArchiveUpdateOne) Save

Save executes the query and returns the updated WalkedArchive entity.

func (*WalkedArchiveUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WalkedArchiveUpdateOne) Select

func (_u *WalkedArchiveUpdateOne) Select(field string, fields ...string) *WalkedArchiveUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WalkedArchiveUpdateOne) Where

Where appends a list predicates to the WalkedArchiveUpdate builder.

type WalkedArchiveUpsert

type WalkedArchiveUpsert struct {
	*sql.UpdateSet
}

WalkedArchiveUpsert is the "OnConflict" setter.

type WalkedArchiveUpsertBulk

type WalkedArchiveUpsertBulk struct {
	// contains filtered or unexported fields
}

WalkedArchiveUpsertBulk is the builder for "upsert"-ing a bulk of WalkedArchive nodes.

func (*WalkedArchiveUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*WalkedArchiveUpsertBulk) Exec

Exec executes the query.

func (*WalkedArchiveUpsertBulk) ExecX

func (u *WalkedArchiveUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.WalkedArchive.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*WalkedArchiveUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the WalkedArchiveCreateBulk.OnConflict documentation for more info.

func (*WalkedArchiveUpsertBulk) UpdateNewValues

func (u *WalkedArchiveUpsertBulk) UpdateNewValues() *WalkedArchiveUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.WalkedArchive.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(walkedarchive.FieldID)
		}),
	).
	Exec(ctx)

type WalkedArchiveUpsertOne

type WalkedArchiveUpsertOne struct {
	// contains filtered or unexported fields
}

WalkedArchiveUpsertOne is the builder for "upsert"-ing

one WalkedArchive node.

func (*WalkedArchiveUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*WalkedArchiveUpsertOne) Exec

Exec executes the query.

func (*WalkedArchiveUpsertOne) ExecX

func (u *WalkedArchiveUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalkedArchiveUpsertOne) ID

func (u *WalkedArchiveUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*WalkedArchiveUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*WalkedArchiveUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.WalkedArchive.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*WalkedArchiveUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the WalkedArchiveCreate.OnConflict documentation for more info.

func (*WalkedArchiveUpsertOne) UpdateNewValues

func (u *WalkedArchiveUpsertOne) UpdateNewValues() *WalkedArchiveUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.WalkedArchive.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(walkedarchive.FieldID)
		}),
	).
	Exec(ctx)

type WalkedArchives

type WalkedArchives []*WalkedArchive

WalkedArchives is a parsable slice of WalkedArchive.

Directories

Path Synopsis
Package schema is the ent schema of the index: store settings, sets with their commits, versions, refs and retention state, pins, tombstoned refs and the archive index, in one database.
Package schema is the ent schema of the index: store settings, sets with their commits, versions, refs and retention state, pins, tombstoned refs and the archive index, in one database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL