ent

package
v0.0.0-...-ab1f78f Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 23 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.
	TypeItem           = "Item"
	TypeMetadataFormat = "MetadataFormat"
	TypeRecord         = "Record"
	TypeSet            = "Set"
)

Variables

This section is empty.

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 Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// MetadataFormat is the client for interacting with the MetadataFormat builders.
	MetadataFormat *MetadataFormatClient
	// Record is the client for interacting with the Record builders.
	Record *RecordClient
	// Set is the client for interacting with the Set builders.
	Set *SetClient
	// 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().
	Item.
	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 Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type Item

type Item struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Identifier holds the value of the "identifier" field.
	Identifier string `json:"identifier,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemQuery when eager-loading is set.
	Edges ItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Item is the model entity for the Item schema.

func (*Item) ExecContext

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

func (c *Item) 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 (*Item) QueryRecords

func (i *Item) QueryRecords() *RecordQuery

QueryRecords queries the "records" edge of the Item entity.

func (*Item) QuerySets

func (i *Item) QuerySets() *SetQuery

QuerySets queries the "sets" edge of the Item entity.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

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

func (i *Item) Update() *ItemUpdateOne

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

func (*Item) Value

func (i *Item) Value(name string) (ent.Value, error)

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

type ItemClient

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

ItemClient is a client for the Item schema.

func NewItemClient

func NewItemClient(c config) *ItemClient

NewItemClient returns a client for the Item from the given config.

func (*ItemClient) Create

func (c *ItemClient) Create() *ItemCreate

Create returns a builder for creating a Item entity.

func (*ItemClient) CreateBulk

func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk

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

func (*ItemClient) Delete

func (c *ItemClient) Delete() *ItemDelete

Delete returns a delete builder for Item.

func (*ItemClient) DeleteOne

func (c *ItemClient) DeleteOne(i *Item) *ItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemClient) DeleteOneID

func (c *ItemClient) DeleteOneID(id int64) *ItemDeleteOne

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

func (*ItemClient) ExecContext

func (c *ItemClient) 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 (*ItemClient) Get

func (c *ItemClient) Get(ctx context.Context, id int64) (*Item, error)

Get returns a Item entity by its id.

func (*ItemClient) GetX

func (c *ItemClient) GetX(ctx context.Context, id int64) *Item

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

func (*ItemClient) Hooks

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

Hooks returns the client hooks.

func (*ItemClient) Intercept

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

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

func (*ItemClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ItemClient) Query

func (c *ItemClient) Query() *ItemQuery

Query returns a query builder for Item.

func (*ItemClient) QueryContext

func (c *ItemClient) 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 (*ItemClient) QueryRecords

func (c *ItemClient) QueryRecords(i *Item) *RecordQuery

QueryRecords queries the records edge of a Item.

func (*ItemClient) QuerySets

func (c *ItemClient) QuerySets(i *Item) *SetQuery

QuerySets queries the sets edge of a Item.

func (*ItemClient) Update

func (c *ItemClient) Update() *ItemUpdate

Update returns an update builder for Item.

func (*ItemClient) UpdateOne

func (c *ItemClient) UpdateOne(i *Item) *ItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemClient) UpdateOneID

func (c *ItemClient) UpdateOneID(id int64) *ItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemClient) Use

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

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

type ItemCreate

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

ItemCreate is the builder for creating a Item entity.

func (*ItemCreate) AddRecordIDs

func (ic *ItemCreate) AddRecordIDs(ids ...int64) *ItemCreate

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*ItemCreate) AddRecords

func (ic *ItemCreate) AddRecords(r ...*Record) *ItemCreate

AddRecords adds the "records" edges to the Record entity.

func (*ItemCreate) AddSetIDs

func (ic *ItemCreate) AddSetIDs(ids ...int64) *ItemCreate

AddSetIDs adds the "sets" edge to the Set entity by IDs.

func (*ItemCreate) AddSets

func (ic *ItemCreate) AddSets(s ...*Set) *ItemCreate

AddSets adds the "sets" edges to the Set entity.

func (*ItemCreate) Exec

func (ic *ItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreate) ExecContext

func (c *ItemCreate) 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 (*ItemCreate) ExecX

func (ic *ItemCreate) ExecX(ctx context.Context)

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

func (*ItemCreate) Mutation

func (ic *ItemCreate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemCreate) OnConflict

func (ic *ItemCreate) OnConflict(opts ...sql.ConflictOption) *ItemUpsertOne

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

client.Item.Create().
	SetIdentifier(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.ItemUpsert) {
		SetIdentifier(v+v).
	}).
	Exec(ctx)

func (*ItemCreate) OnConflictColumns

func (ic *ItemCreate) OnConflictColumns(columns ...string) *ItemUpsertOne

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

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

func (*ItemCreate) QueryContext

func (c *ItemCreate) 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 (*ItemCreate) Save

func (ic *ItemCreate) Save(ctx context.Context) (*Item, error)

Save creates the Item in the database.

func (*ItemCreate) SaveX

func (ic *ItemCreate) SaveX(ctx context.Context) *Item

SaveX calls Save and panics if Save returns an error.

func (*ItemCreate) SetID

func (ic *ItemCreate) SetID(i int64) *ItemCreate

SetID sets the "id" field.

func (*ItemCreate) SetIdentifier

func (ic *ItemCreate) SetIdentifier(s string) *ItemCreate

SetIdentifier sets the "identifier" field.

type ItemCreateBulk

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

ItemCreateBulk is the builder for creating many Item entities in bulk.

func (*ItemCreateBulk) Exec

func (icb *ItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreateBulk) ExecContext

func (c *ItemCreateBulk) 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 (*ItemCreateBulk) ExecX

func (icb *ItemCreateBulk) ExecX(ctx context.Context)

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

func (*ItemCreateBulk) OnConflict

func (icb *ItemCreateBulk) OnConflict(opts ...sql.ConflictOption) *ItemUpsertBulk

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

client.Item.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.ItemUpsert) {
		SetIdentifier(v+v).
	}).
	Exec(ctx)

func (*ItemCreateBulk) OnConflictColumns

func (icb *ItemCreateBulk) OnConflictColumns(columns ...string) *ItemUpsertBulk

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

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

func (*ItemCreateBulk) QueryContext

func (c *ItemCreateBulk) 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 (*ItemCreateBulk) Save

func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error)

Save creates the Item entities in the database.

func (*ItemCreateBulk) SaveX

func (icb *ItemCreateBulk) SaveX(ctx context.Context) []*Item

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

type ItemDelete

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

ItemDelete is the builder for deleting a Item entity.

func (*ItemDelete) Exec

func (id *ItemDelete) Exec(ctx context.Context) (int, error)

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

func (*ItemDelete) ExecContext

func (c *ItemDelete) 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 (*ItemDelete) ExecX

func (id *ItemDelete) ExecX(ctx context.Context) int

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

func (*ItemDelete) QueryContext

func (c *ItemDelete) 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 (*ItemDelete) Where

func (id *ItemDelete) Where(ps ...predicate.Item) *ItemDelete

Where appends a list predicates to the ItemDelete builder.

type ItemDeleteOne

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

ItemDeleteOne is the builder for deleting a single Item entity.

func (*ItemDeleteOne) Exec

func (ido *ItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemDeleteOne) ExecX

func (ido *ItemDeleteOne) ExecX(ctx context.Context)

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

func (*ItemDeleteOne) Where

func (ido *ItemDeleteOne) Where(ps ...predicate.Item) *ItemDeleteOne

Where appends a list predicates to the ItemDelete builder.

type ItemEdges

type ItemEdges struct {
	// Records holds the value of the records edge.
	Records []*Record `json:"records,omitempty"`
	// Sets holds the value of the sets edge.
	Sets []*Set `json:"sets,omitempty"`
	// contains filtered or unexported fields
}

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

func (ItemEdges) RecordsOrErr

func (e ItemEdges) RecordsOrErr() ([]*Record, error)

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

func (ItemEdges) SetsOrErr

func (e ItemEdges) SetsOrErr() ([]*Set, error)

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

type ItemGroupBy

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

ItemGroupBy is the group-by builder for Item entities.

func (*ItemGroupBy) Aggregate

func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy

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

func (*ItemGroupBy) Bool

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

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

func (*ItemGroupBy) BoolX

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

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

func (*ItemGroupBy) Bools

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

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

func (*ItemGroupBy) BoolsX

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

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

func (*ItemGroupBy) Float64

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

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

func (*ItemGroupBy) Float64X

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

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

func (*ItemGroupBy) Float64s

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

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

func (*ItemGroupBy) Float64sX

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

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

func (*ItemGroupBy) Int

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

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

func (*ItemGroupBy) IntX

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

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

func (*ItemGroupBy) Ints

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

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

func (*ItemGroupBy) IntsX

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

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

func (*ItemGroupBy) Scan

func (igb *ItemGroupBy) Scan(ctx context.Context, v any) error

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

func (*ItemGroupBy) ScanX

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

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

func (*ItemGroupBy) String

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

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

func (*ItemGroupBy) StringX

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

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

func (*ItemGroupBy) Strings

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

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

func (*ItemGroupBy) StringsX

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

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

type ItemMutation

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

ItemMutation represents an operation that mutates the Item nodes in the graph.

func (*ItemMutation) AddField

func (m *ItemMutation) 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 (*ItemMutation) AddRecordIDs

func (m *ItemMutation) AddRecordIDs(ids ...int64)

AddRecordIDs adds the "records" edge to the Record entity by ids.

func (*ItemMutation) AddSetIDs

func (m *ItemMutation) AddSetIDs(ids ...int64)

AddSetIDs adds the "sets" edge to the Set entity by ids.

func (*ItemMutation) AddedEdges

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

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

func (*ItemMutation) AddedField

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

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

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

func (*ItemMutation) AddedIDs

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

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

func (*ItemMutation) ClearEdge

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

func (m *ItemMutation) 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 (*ItemMutation) ClearRecords

func (m *ItemMutation) ClearRecords()

ClearRecords clears the "records" edge to the Record entity.

func (*ItemMutation) ClearSets

func (m *ItemMutation) ClearSets()

ClearSets clears the "sets" edge to the Set entity.

func (*ItemMutation) ClearedEdges

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

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

func (*ItemMutation) ClearedFields

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

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

func (ItemMutation) Client

func (m ItemMutation) 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 (*ItemMutation) EdgeCleared

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

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

func (*ItemMutation) ExecContext

func (c *ItemMutation) 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 (*ItemMutation) Field

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

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

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

func (*ItemMutation) Fields

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

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

func (m *ItemMutation) 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 (*ItemMutation) Identifier

func (m *ItemMutation) Identifier() (r string, exists bool)

Identifier returns the value of the "identifier" field in the mutation.

func (*ItemMutation) OldField

func (m *ItemMutation) 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 (*ItemMutation) OldIdentifier

func (m *ItemMutation) OldIdentifier(ctx context.Context) (v string, err error)

OldIdentifier returns the old "identifier" field's value of the Item entity. If the Item 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 (*ItemMutation) Op

func (m *ItemMutation) Op() Op

Op returns the operation name.

func (*ItemMutation) QueryContext

func (c *ItemMutation) 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 (*ItemMutation) RecordsCleared

func (m *ItemMutation) RecordsCleared() bool

RecordsCleared reports if the "records" edge to the Record entity was cleared.

func (*ItemMutation) RecordsIDs

func (m *ItemMutation) RecordsIDs() (ids []int64)

RecordsIDs returns the "records" edge IDs in the mutation.

func (*ItemMutation) RemoveRecordIDs

func (m *ItemMutation) RemoveRecordIDs(ids ...int64)

RemoveRecordIDs removes the "records" edge to the Record entity by IDs.

func (*ItemMutation) RemoveSetIDs

func (m *ItemMutation) RemoveSetIDs(ids ...int64)

RemoveSetIDs removes the "sets" edge to the Set entity by IDs.

func (*ItemMutation) RemovedEdges

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

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

func (*ItemMutation) RemovedIDs

func (m *ItemMutation) 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 (*ItemMutation) RemovedRecordsIDs

func (m *ItemMutation) RemovedRecordsIDs() (ids []int64)

RemovedRecords returns the removed IDs of the "records" edge to the Record entity.

func (*ItemMutation) RemovedSetsIDs

func (m *ItemMutation) RemovedSetsIDs() (ids []int64)

RemovedSets returns the removed IDs of the "sets" edge to the Set entity.

func (*ItemMutation) ResetEdge

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

func (m *ItemMutation) 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 (*ItemMutation) ResetIdentifier

func (m *ItemMutation) ResetIdentifier()

ResetIdentifier resets all changes to the "identifier" field.

func (*ItemMutation) ResetRecords

func (m *ItemMutation) ResetRecords()

ResetRecords resets all changes to the "records" edge.

func (*ItemMutation) ResetSets

func (m *ItemMutation) ResetSets()

ResetSets resets all changes to the "sets" edge.

func (*ItemMutation) SetField

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

func (m *ItemMutation) SetID(id int64)

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

func (*ItemMutation) SetIdentifier

func (m *ItemMutation) SetIdentifier(s string)

SetIdentifier sets the "identifier" field.

func (*ItemMutation) SetOp

func (m *ItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ItemMutation) SetsCleared

func (m *ItemMutation) SetsCleared() bool

SetsCleared reports if the "sets" edge to the Set entity was cleared.

func (*ItemMutation) SetsIDs

func (m *ItemMutation) SetsIDs() (ids []int64)

SetsIDs returns the "sets" edge IDs in the mutation.

func (ItemMutation) Tx

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

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

func (*ItemMutation) Type

func (m *ItemMutation) Type() string

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

func (*ItemMutation) Where

func (m *ItemMutation) Where(ps ...predicate.Item)

Where appends a list predicates to the ItemMutation builder.

func (*ItemMutation) WhereP

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

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

type ItemQuery

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

ItemQuery is the builder for querying Item entities.

func (*ItemQuery) Aggregate

func (iq *ItemQuery) Aggregate(fns ...AggregateFunc) *ItemSelect

Aggregate returns a ItemSelect configured with the given aggregations.

func (*ItemQuery) All

func (iq *ItemQuery) All(ctx context.Context) ([]*Item, error)

All executes the query and returns a list of Items.

func (*ItemQuery) AllX

func (iq *ItemQuery) AllX(ctx context.Context) []*Item

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

func (*ItemQuery) Clone

func (iq *ItemQuery) Clone() *ItemQuery

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

func (*ItemQuery) Count

func (iq *ItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemQuery) CountX

func (iq *ItemQuery) CountX(ctx context.Context) int

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

func (*ItemQuery) ExecContext

func (c *ItemQuery) 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 (*ItemQuery) Exist

func (iq *ItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*ItemQuery) ExistX

func (iq *ItemQuery) ExistX(ctx context.Context) bool

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

func (*ItemQuery) First

func (iq *ItemQuery) First(ctx context.Context) (*Item, error)

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

func (*ItemQuery) FirstID

func (iq *ItemQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*ItemQuery) FirstIDX

func (iq *ItemQuery) FirstIDX(ctx context.Context) int64

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

func (*ItemQuery) FirstX

func (iq *ItemQuery) FirstX(ctx context.Context) *Item

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

func (*ItemQuery) GroupBy

func (iq *ItemQuery) GroupBy(field string, fields ...string) *ItemGroupBy

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

client.Item.Query().
	GroupBy(item.FieldIdentifier).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemQuery) IDs

func (iq *ItemQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*ItemQuery) IDsX

func (iq *ItemQuery) IDsX(ctx context.Context) []int64

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

func (*ItemQuery) Limit

func (iq *ItemQuery) Limit(limit int) *ItemQuery

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

func (*ItemQuery) Offset

func (iq *ItemQuery) Offset(offset int) *ItemQuery

Offset to start from.

func (*ItemQuery) Only

func (iq *ItemQuery) Only(ctx context.Context) (*Item, error)

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

func (*ItemQuery) OnlyID

func (iq *ItemQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*ItemQuery) OnlyIDX

func (iq *ItemQuery) OnlyIDX(ctx context.Context) int64

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

func (*ItemQuery) OnlyX

func (iq *ItemQuery) OnlyX(ctx context.Context) *Item

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

func (*ItemQuery) Order

func (iq *ItemQuery) Order(o ...item.OrderOption) *ItemQuery

Order specifies how the records should be ordered.

func (*ItemQuery) QueryContext

func (c *ItemQuery) 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 (*ItemQuery) QueryRecords

func (iq *ItemQuery) QueryRecords() *RecordQuery

QueryRecords chains the current query on the "records" edge.

func (*ItemQuery) QuerySets

func (iq *ItemQuery) QuerySets() *SetQuery

QuerySets chains the current query on the "sets" edge.

func (*ItemQuery) Select

func (iq *ItemQuery) Select(fields ...string) *ItemSelect

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

client.Item.Query().
	Select(item.FieldIdentifier).
	Scan(ctx, &v)

func (*ItemQuery) Unique

func (iq *ItemQuery) Unique(unique bool) *ItemQuery

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

func (iq *ItemQuery) Where(ps ...predicate.Item) *ItemQuery

Where adds a new predicate for the ItemQuery builder.

func (*ItemQuery) WithRecords

func (iq *ItemQuery) WithRecords(opts ...func(*RecordQuery)) *ItemQuery

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

func (*ItemQuery) WithSets

func (iq *ItemQuery) WithSets(opts ...func(*SetQuery)) *ItemQuery

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

type ItemSelect

type ItemSelect struct {
	*ItemQuery
	// contains filtered or unexported fields
}

ItemSelect is the builder for selecting fields of Item entities.

func (*ItemSelect) Aggregate

func (is *ItemSelect) Aggregate(fns ...AggregateFunc) *ItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ItemSelect) Bool

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

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

func (*ItemSelect) BoolX

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

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

func (*ItemSelect) Bools

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

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

func (*ItemSelect) BoolsX

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

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

func (ItemSelect) ExecContext

func (c ItemSelect) 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 (*ItemSelect) Float64

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

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

func (*ItemSelect) Float64X

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

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

func (*ItemSelect) Float64s

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

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

func (*ItemSelect) Float64sX

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

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

func (*ItemSelect) Int

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

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

func (*ItemSelect) IntX

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

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

func (*ItemSelect) Ints

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

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

func (*ItemSelect) IntsX

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

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

func (ItemSelect) QueryContext

func (c ItemSelect) 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 (*ItemSelect) Scan

func (is *ItemSelect) Scan(ctx context.Context, v any) error

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

func (*ItemSelect) ScanX

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

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

func (*ItemSelect) String

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

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

func (*ItemSelect) StringX

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

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

func (*ItemSelect) Strings

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

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

func (*ItemSelect) StringsX

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

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

type ItemUpdate

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

ItemUpdate is the builder for updating Item entities.

func (*ItemUpdate) AddRecordIDs

func (iu *ItemUpdate) AddRecordIDs(ids ...int64) *ItemUpdate

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*ItemUpdate) AddRecords

func (iu *ItemUpdate) AddRecords(r ...*Record) *ItemUpdate

AddRecords adds the "records" edges to the Record entity.

func (*ItemUpdate) AddSetIDs

func (iu *ItemUpdate) AddSetIDs(ids ...int64) *ItemUpdate

AddSetIDs adds the "sets" edge to the Set entity by IDs.

func (*ItemUpdate) AddSets

func (iu *ItemUpdate) AddSets(s ...*Set) *ItemUpdate

AddSets adds the "sets" edges to the Set entity.

func (*ItemUpdate) ClearRecords

func (iu *ItemUpdate) ClearRecords() *ItemUpdate

ClearRecords clears all "records" edges to the Record entity.

func (*ItemUpdate) ClearSets

func (iu *ItemUpdate) ClearSets() *ItemUpdate

ClearSets clears all "sets" edges to the Set entity.

func (*ItemUpdate) Exec

func (iu *ItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpdate) ExecContext

func (c *ItemUpdate) 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 (*ItemUpdate) ExecX

func (iu *ItemUpdate) ExecX(ctx context.Context)

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

func (*ItemUpdate) Mutation

func (iu *ItemUpdate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdate) QueryContext

func (c *ItemUpdate) 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 (*ItemUpdate) RemoveRecordIDs

func (iu *ItemUpdate) RemoveRecordIDs(ids ...int64) *ItemUpdate

RemoveRecordIDs removes the "records" edge to Record entities by IDs.

func (*ItemUpdate) RemoveRecords

func (iu *ItemUpdate) RemoveRecords(r ...*Record) *ItemUpdate

RemoveRecords removes "records" edges to Record entities.

func (*ItemUpdate) RemoveSetIDs

func (iu *ItemUpdate) RemoveSetIDs(ids ...int64) *ItemUpdate

RemoveSetIDs removes the "sets" edge to Set entities by IDs.

func (*ItemUpdate) RemoveSets

func (iu *ItemUpdate) RemoveSets(s ...*Set) *ItemUpdate

RemoveSets removes "sets" edges to Set entities.

func (*ItemUpdate) Save

func (iu *ItemUpdate) Save(ctx context.Context) (int, error)

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

func (*ItemUpdate) SaveX

func (iu *ItemUpdate) SaveX(ctx context.Context) int

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

func (*ItemUpdate) SetIdentifier

func (iu *ItemUpdate) SetIdentifier(s string) *ItemUpdate

SetIdentifier sets the "identifier" field.

func (*ItemUpdate) Where

func (iu *ItemUpdate) Where(ps ...predicate.Item) *ItemUpdate

Where appends a list predicates to the ItemUpdate builder.

type ItemUpdateOne

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

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) AddRecordIDs

func (iuo *ItemUpdateOne) AddRecordIDs(ids ...int64) *ItemUpdateOne

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*ItemUpdateOne) AddRecords

func (iuo *ItemUpdateOne) AddRecords(r ...*Record) *ItemUpdateOne

AddRecords adds the "records" edges to the Record entity.

func (*ItemUpdateOne) AddSetIDs

func (iuo *ItemUpdateOne) AddSetIDs(ids ...int64) *ItemUpdateOne

AddSetIDs adds the "sets" edge to the Set entity by IDs.

func (*ItemUpdateOne) AddSets

func (iuo *ItemUpdateOne) AddSets(s ...*Set) *ItemUpdateOne

AddSets adds the "sets" edges to the Set entity.

func (*ItemUpdateOne) ClearRecords

func (iuo *ItemUpdateOne) ClearRecords() *ItemUpdateOne

ClearRecords clears all "records" edges to the Record entity.

func (*ItemUpdateOne) ClearSets

func (iuo *ItemUpdateOne) ClearSets() *ItemUpdateOne

ClearSets clears all "sets" edges to the Set entity.

func (*ItemUpdateOne) Exec

func (iuo *ItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemUpdateOne) ExecContext

func (c *ItemUpdateOne) 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 (*ItemUpdateOne) ExecX

func (iuo *ItemUpdateOne) ExecX(ctx context.Context)

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

func (*ItemUpdateOne) Mutation

func (iuo *ItemUpdateOne) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdateOne) QueryContext

func (c *ItemUpdateOne) 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 (*ItemUpdateOne) RemoveRecordIDs

func (iuo *ItemUpdateOne) RemoveRecordIDs(ids ...int64) *ItemUpdateOne

RemoveRecordIDs removes the "records" edge to Record entities by IDs.

func (*ItemUpdateOne) RemoveRecords

func (iuo *ItemUpdateOne) RemoveRecords(r ...*Record) *ItemUpdateOne

RemoveRecords removes "records" edges to Record entities.

func (*ItemUpdateOne) RemoveSetIDs

func (iuo *ItemUpdateOne) RemoveSetIDs(ids ...int64) *ItemUpdateOne

RemoveSetIDs removes the "sets" edge to Set entities by IDs.

func (*ItemUpdateOne) RemoveSets

func (iuo *ItemUpdateOne) RemoveSets(s ...*Set) *ItemUpdateOne

RemoveSets removes "sets" edges to Set entities.

func (*ItemUpdateOne) Save

func (iuo *ItemUpdateOne) Save(ctx context.Context) (*Item, error)

Save executes the query and returns the updated Item entity.

func (*ItemUpdateOne) SaveX

func (iuo *ItemUpdateOne) SaveX(ctx context.Context) *Item

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

func (*ItemUpdateOne) Select

func (iuo *ItemUpdateOne) Select(field string, fields ...string) *ItemUpdateOne

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

func (*ItemUpdateOne) SetIdentifier

func (iuo *ItemUpdateOne) SetIdentifier(s string) *ItemUpdateOne

SetIdentifier sets the "identifier" field.

func (*ItemUpdateOne) Where

func (iuo *ItemUpdateOne) Where(ps ...predicate.Item) *ItemUpdateOne

Where appends a list predicates to the ItemUpdate builder.

type ItemUpsert

type ItemUpsert struct {
	*sql.UpdateSet
}

ItemUpsert is the "OnConflict" setter.

func (*ItemUpsert) SetIdentifier

func (u *ItemUpsert) SetIdentifier(v string) *ItemUpsert

SetIdentifier sets the "identifier" field.

func (*ItemUpsert) UpdateIdentifier

func (u *ItemUpsert) UpdateIdentifier() *ItemUpsert

UpdateIdentifier sets the "identifier" field to the value that was provided on create.

type ItemUpsertBulk

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

ItemUpsertBulk is the builder for "upsert"-ing a bulk of Item nodes.

func (*ItemUpsertBulk) DoNothing

func (u *ItemUpsertBulk) DoNothing() *ItemUpsertBulk

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

func (*ItemUpsertBulk) Exec

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

Exec executes the query.

func (*ItemUpsertBulk) ExecX

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

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

func (*ItemUpsertBulk) Ignore

func (u *ItemUpsertBulk) Ignore() *ItemUpsertBulk

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

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

func (*ItemUpsertBulk) SetIdentifier

func (u *ItemUpsertBulk) SetIdentifier(v string) *ItemUpsertBulk

SetIdentifier sets the "identifier" field.

func (*ItemUpsertBulk) Update

func (u *ItemUpsertBulk) Update(set func(*ItemUpsert)) *ItemUpsertBulk

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

func (*ItemUpsertBulk) UpdateIdentifier

func (u *ItemUpsertBulk) UpdateIdentifier() *ItemUpsertBulk

UpdateIdentifier sets the "identifier" field to the value that was provided on create.

func (*ItemUpsertBulk) UpdateNewValues

func (u *ItemUpsertBulk) UpdateNewValues() *ItemUpsertBulk

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

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

type ItemUpsertOne

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

ItemUpsertOne is the builder for "upsert"-ing

one Item node.

func (*ItemUpsertOne) DoNothing

func (u *ItemUpsertOne) DoNothing() *ItemUpsertOne

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

func (*ItemUpsertOne) Exec

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

Exec executes the query.

func (*ItemUpsertOne) ExecX

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

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

func (*ItemUpsertOne) ID

func (u *ItemUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*ItemUpsertOne) IDX

func (u *ItemUpsertOne) IDX(ctx context.Context) int64

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

func (*ItemUpsertOne) Ignore

func (u *ItemUpsertOne) Ignore() *ItemUpsertOne

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

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

func (*ItemUpsertOne) SetIdentifier

func (u *ItemUpsertOne) SetIdentifier(v string) *ItemUpsertOne

SetIdentifier sets the "identifier" field.

func (*ItemUpsertOne) Update

func (u *ItemUpsertOne) Update(set func(*ItemUpsert)) *ItemUpsertOne

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

func (*ItemUpsertOne) UpdateIdentifier

func (u *ItemUpsertOne) UpdateIdentifier() *ItemUpsertOne

UpdateIdentifier sets the "identifier" field to the value that was provided on create.

func (*ItemUpsertOne) UpdateNewValues

func (u *ItemUpsertOne) UpdateNewValues() *ItemUpsertOne

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.Item.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(item.FieldID)
		}),
	).
	Exec(ctx)

type Items

type Items []*Item

Items is a parsable slice of Item.

type MetadataFormat

type MetadataFormat struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Prefix holds the value of the "prefix" field.
	Prefix string `json:"prefix,omitempty"`
	// Schema holds the value of the "schema" field.
	Schema string `json:"schema,omitempty"`
	// Namespace holds the value of the "namespace" field.
	Namespace string `json:"namespace,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MetadataFormatQuery when eager-loading is set.
	Edges MetadataFormatEdges `json:"edges"`
	// contains filtered or unexported fields
}

MetadataFormat is the model entity for the MetadataFormat schema.

func (*MetadataFormat) ExecContext

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

func (c *MetadataFormat) 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 (*MetadataFormat) QueryRecords

func (mf *MetadataFormat) QueryRecords() *RecordQuery

QueryRecords queries the "records" edge of the MetadataFormat entity.

func (*MetadataFormat) String

func (mf *MetadataFormat) String() string

String implements the fmt.Stringer.

func (*MetadataFormat) Unwrap

func (mf *MetadataFormat) Unwrap() *MetadataFormat

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

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

func (*MetadataFormat) Value

func (mf *MetadataFormat) Value(name string) (ent.Value, error)

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

type MetadataFormatClient

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

MetadataFormatClient is a client for the MetadataFormat schema.

func NewMetadataFormatClient

func NewMetadataFormatClient(c config) *MetadataFormatClient

NewMetadataFormatClient returns a client for the MetadataFormat from the given config.

func (*MetadataFormatClient) Create

Create returns a builder for creating a MetadataFormat entity.

func (*MetadataFormatClient) CreateBulk

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

func (*MetadataFormatClient) Delete

Delete returns a delete builder for MetadataFormat.

func (*MetadataFormatClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MetadataFormatClient) DeleteOneID

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

func (*MetadataFormatClient) ExecContext

func (c *MetadataFormatClient) 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 (*MetadataFormatClient) Get

Get returns a MetadataFormat entity by its id.

func (*MetadataFormatClient) GetX

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

func (*MetadataFormatClient) Hooks

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

Hooks returns the client hooks.

func (*MetadataFormatClient) Intercept

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

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

func (*MetadataFormatClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MetadataFormatClient) Query

Query returns a query builder for MetadataFormat.

func (*MetadataFormatClient) QueryContext

func (c *MetadataFormatClient) 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 (*MetadataFormatClient) QueryRecords

func (c *MetadataFormatClient) QueryRecords(mf *MetadataFormat) *RecordQuery

QueryRecords queries the records edge of a MetadataFormat.

func (*MetadataFormatClient) Update

Update returns an update builder for MetadataFormat.

func (*MetadataFormatClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetadataFormatClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MetadataFormatClient) Use

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

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

type MetadataFormatCreate

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

MetadataFormatCreate is the builder for creating a MetadataFormat entity.

func (*MetadataFormatCreate) AddRecordIDs

func (mfc *MetadataFormatCreate) AddRecordIDs(ids ...int64) *MetadataFormatCreate

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*MetadataFormatCreate) AddRecords

func (mfc *MetadataFormatCreate) AddRecords(r ...*Record) *MetadataFormatCreate

AddRecords adds the "records" edges to the Record entity.

func (*MetadataFormatCreate) Exec

func (mfc *MetadataFormatCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataFormatCreate) ExecContext

func (c *MetadataFormatCreate) 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 (*MetadataFormatCreate) ExecX

func (mfc *MetadataFormatCreate) ExecX(ctx context.Context)

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

func (*MetadataFormatCreate) Mutation

Mutation returns the MetadataFormatMutation object of the builder.

func (*MetadataFormatCreate) OnConflict

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

client.MetadataFormat.Create().
	SetPrefix(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.MetadataFormatUpsert) {
		SetPrefix(v+v).
	}).
	Exec(ctx)

func (*MetadataFormatCreate) OnConflictColumns

func (mfc *MetadataFormatCreate) OnConflictColumns(columns ...string) *MetadataFormatUpsertOne

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

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

func (*MetadataFormatCreate) QueryContext

func (c *MetadataFormatCreate) 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 (*MetadataFormatCreate) Save

Save creates the MetadataFormat in the database.

func (*MetadataFormatCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MetadataFormatCreate) SetID

SetID sets the "id" field.

func (*MetadataFormatCreate) SetNamespace

func (mfc *MetadataFormatCreate) SetNamespace(s string) *MetadataFormatCreate

SetNamespace sets the "namespace" field.

func (*MetadataFormatCreate) SetPrefix

SetPrefix sets the "prefix" field.

func (*MetadataFormatCreate) SetSchema

SetSchema sets the "schema" field.

type MetadataFormatCreateBulk

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

MetadataFormatCreateBulk is the builder for creating many MetadataFormat entities in bulk.

func (*MetadataFormatCreateBulk) Exec

Exec executes the query.

func (*MetadataFormatCreateBulk) ExecContext

func (c *MetadataFormatCreateBulk) 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 (*MetadataFormatCreateBulk) ExecX

func (mfcb *MetadataFormatCreateBulk) ExecX(ctx context.Context)

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

func (*MetadataFormatCreateBulk) OnConflict

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

client.MetadataFormat.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.MetadataFormatUpsert) {
		SetPrefix(v+v).
	}).
	Exec(ctx)

func (*MetadataFormatCreateBulk) OnConflictColumns

func (mfcb *MetadataFormatCreateBulk) OnConflictColumns(columns ...string) *MetadataFormatUpsertBulk

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

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

func (*MetadataFormatCreateBulk) QueryContext

func (c *MetadataFormatCreateBulk) 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 (*MetadataFormatCreateBulk) Save

Save creates the MetadataFormat entities in the database.

func (*MetadataFormatCreateBulk) SaveX

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

type MetadataFormatDelete

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

MetadataFormatDelete is the builder for deleting a MetadataFormat entity.

func (*MetadataFormatDelete) Exec

func (mfd *MetadataFormatDelete) Exec(ctx context.Context) (int, error)

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

func (*MetadataFormatDelete) ExecContext

func (c *MetadataFormatDelete) 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 (*MetadataFormatDelete) ExecX

func (mfd *MetadataFormatDelete) ExecX(ctx context.Context) int

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

func (*MetadataFormatDelete) QueryContext

func (c *MetadataFormatDelete) 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 (*MetadataFormatDelete) Where

Where appends a list predicates to the MetadataFormatDelete builder.

type MetadataFormatDeleteOne

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

MetadataFormatDeleteOne is the builder for deleting a single MetadataFormat entity.

func (*MetadataFormatDeleteOne) Exec

func (mfdo *MetadataFormatDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MetadataFormatDeleteOne) ExecX

func (mfdo *MetadataFormatDeleteOne) ExecX(ctx context.Context)

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

func (*MetadataFormatDeleteOne) Where

Where appends a list predicates to the MetadataFormatDelete builder.

type MetadataFormatEdges

type MetadataFormatEdges struct {
	// Records holds the value of the records edge.
	Records []*Record `json:"records,omitempty"`
	// contains filtered or unexported fields
}

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

func (MetadataFormatEdges) RecordsOrErr

func (e MetadataFormatEdges) RecordsOrErr() ([]*Record, error)

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

type MetadataFormatGroupBy

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

MetadataFormatGroupBy is the group-by builder for MetadataFormat entities.

func (*MetadataFormatGroupBy) Aggregate

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

func (*MetadataFormatGroupBy) Bool

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

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

func (*MetadataFormatGroupBy) BoolX

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

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

func (*MetadataFormatGroupBy) Bools

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

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

func (*MetadataFormatGroupBy) BoolsX

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

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

func (*MetadataFormatGroupBy) Float64

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

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

func (*MetadataFormatGroupBy) Float64X

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

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

func (*MetadataFormatGroupBy) Float64s

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

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

func (*MetadataFormatGroupBy) Float64sX

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

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

func (*MetadataFormatGroupBy) Int

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

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

func (*MetadataFormatGroupBy) IntX

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

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

func (*MetadataFormatGroupBy) Ints

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

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

func (*MetadataFormatGroupBy) IntsX

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

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

func (*MetadataFormatGroupBy) Scan

func (mfgb *MetadataFormatGroupBy) Scan(ctx context.Context, v any) error

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

func (*MetadataFormatGroupBy) ScanX

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

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

func (*MetadataFormatGroupBy) String

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

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

func (*MetadataFormatGroupBy) StringX

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

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

func (*MetadataFormatGroupBy) Strings

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

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

func (*MetadataFormatGroupBy) StringsX

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

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

type MetadataFormatMutation

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

MetadataFormatMutation represents an operation that mutates the MetadataFormat nodes in the graph.

func (*MetadataFormatMutation) AddField

func (m *MetadataFormatMutation) 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 (*MetadataFormatMutation) AddRecordIDs

func (m *MetadataFormatMutation) AddRecordIDs(ids ...int64)

AddRecordIDs adds the "records" edge to the Record entity by ids.

func (*MetadataFormatMutation) AddedEdges

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

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

func (*MetadataFormatMutation) AddedField

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

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

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

func (*MetadataFormatMutation) AddedIDs

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

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

func (*MetadataFormatMutation) ClearEdge

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

func (m *MetadataFormatMutation) 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 (*MetadataFormatMutation) ClearRecords

func (m *MetadataFormatMutation) ClearRecords()

ClearRecords clears the "records" edge to the Record entity.

func (*MetadataFormatMutation) ClearedEdges

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

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

func (*MetadataFormatMutation) ClearedFields

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

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

func (MetadataFormatMutation) Client

func (m MetadataFormatMutation) 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 (*MetadataFormatMutation) EdgeCleared

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

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

func (*MetadataFormatMutation) ExecContext

func (c *MetadataFormatMutation) 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 (*MetadataFormatMutation) Field

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

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

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

func (*MetadataFormatMutation) Fields

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

func (m *MetadataFormatMutation) 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 (*MetadataFormatMutation) 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 (*MetadataFormatMutation) Namespace

func (m *MetadataFormatMutation) Namespace() (r string, exists bool)

Namespace returns the value of the "namespace" field in the mutation.

func (*MetadataFormatMutation) OldField

func (m *MetadataFormatMutation) 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 (*MetadataFormatMutation) OldNamespace

func (m *MetadataFormatMutation) OldNamespace(ctx context.Context) (v string, err error)

OldNamespace returns the old "namespace" field's value of the MetadataFormat entity. If the MetadataFormat 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 (*MetadataFormatMutation) OldPrefix

func (m *MetadataFormatMutation) OldPrefix(ctx context.Context) (v string, err error)

OldPrefix returns the old "prefix" field's value of the MetadataFormat entity. If the MetadataFormat 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 (*MetadataFormatMutation) OldSchema

func (m *MetadataFormatMutation) OldSchema(ctx context.Context) (v string, err error)

OldSchema returns the old "schema" field's value of the MetadataFormat entity. If the MetadataFormat 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 (*MetadataFormatMutation) Op

func (m *MetadataFormatMutation) Op() Op

Op returns the operation name.

func (*MetadataFormatMutation) Prefix

func (m *MetadataFormatMutation) Prefix() (r string, exists bool)

Prefix returns the value of the "prefix" field in the mutation.

func (*MetadataFormatMutation) QueryContext

func (c *MetadataFormatMutation) 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 (*MetadataFormatMutation) RecordsCleared

func (m *MetadataFormatMutation) RecordsCleared() bool

RecordsCleared reports if the "records" edge to the Record entity was cleared.

func (*MetadataFormatMutation) RecordsIDs

func (m *MetadataFormatMutation) RecordsIDs() (ids []int64)

RecordsIDs returns the "records" edge IDs in the mutation.

func (*MetadataFormatMutation) RemoveRecordIDs

func (m *MetadataFormatMutation) RemoveRecordIDs(ids ...int64)

RemoveRecordIDs removes the "records" edge to the Record entity by IDs.

func (*MetadataFormatMutation) RemovedEdges

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

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

func (*MetadataFormatMutation) RemovedIDs

func (m *MetadataFormatMutation) 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 (*MetadataFormatMutation) RemovedRecordsIDs

func (m *MetadataFormatMutation) RemovedRecordsIDs() (ids []int64)

RemovedRecords returns the removed IDs of the "records" edge to the Record entity.

func (*MetadataFormatMutation) ResetEdge

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

func (m *MetadataFormatMutation) 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 (*MetadataFormatMutation) ResetNamespace

func (m *MetadataFormatMutation) ResetNamespace()

ResetNamespace resets all changes to the "namespace" field.

func (*MetadataFormatMutation) ResetPrefix

func (m *MetadataFormatMutation) ResetPrefix()

ResetPrefix resets all changes to the "prefix" field.

func (*MetadataFormatMutation) ResetRecords

func (m *MetadataFormatMutation) ResetRecords()

ResetRecords resets all changes to the "records" edge.

func (*MetadataFormatMutation) ResetSchema

func (m *MetadataFormatMutation) ResetSchema()

ResetSchema resets all changes to the "schema" field.

func (*MetadataFormatMutation) Schema

func (m *MetadataFormatMutation) Schema() (r string, exists bool)

Schema returns the value of the "schema" field in the mutation.

func (*MetadataFormatMutation) SetField

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

func (m *MetadataFormatMutation) SetID(id int64)

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

func (*MetadataFormatMutation) SetNamespace

func (m *MetadataFormatMutation) SetNamespace(s string)

SetNamespace sets the "namespace" field.

func (*MetadataFormatMutation) SetOp

func (m *MetadataFormatMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MetadataFormatMutation) SetPrefix

func (m *MetadataFormatMutation) SetPrefix(s string)

SetPrefix sets the "prefix" field.

func (*MetadataFormatMutation) SetSchema

func (m *MetadataFormatMutation) SetSchema(s string)

SetSchema sets the "schema" field.

func (MetadataFormatMutation) Tx

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

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

func (*MetadataFormatMutation) Type

func (m *MetadataFormatMutation) Type() string

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

func (*MetadataFormatMutation) Where

Where appends a list predicates to the MetadataFormatMutation builder.

func (*MetadataFormatMutation) WhereP

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

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

type MetadataFormatQuery

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

MetadataFormatQuery is the builder for querying MetadataFormat entities.

func (*MetadataFormatQuery) Aggregate

func (mfq *MetadataFormatQuery) Aggregate(fns ...AggregateFunc) *MetadataFormatSelect

Aggregate returns a MetadataFormatSelect configured with the given aggregations.

func (*MetadataFormatQuery) All

All executes the query and returns a list of MetadataFormats.

func (*MetadataFormatQuery) AllX

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

func (*MetadataFormatQuery) Clone

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

func (*MetadataFormatQuery) Count

func (mfq *MetadataFormatQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MetadataFormatQuery) CountX

func (mfq *MetadataFormatQuery) CountX(ctx context.Context) int

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

func (*MetadataFormatQuery) ExecContext

func (c *MetadataFormatQuery) 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 (*MetadataFormatQuery) Exist

func (mfq *MetadataFormatQuery) Exist(ctx context.Context) (bool, error)

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

func (*MetadataFormatQuery) ExistX

func (mfq *MetadataFormatQuery) ExistX(ctx context.Context) bool

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

func (*MetadataFormatQuery) First

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

func (*MetadataFormatQuery) FirstID

func (mfq *MetadataFormatQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*MetadataFormatQuery) FirstIDX

func (mfq *MetadataFormatQuery) FirstIDX(ctx context.Context) int64

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

func (*MetadataFormatQuery) FirstX

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

func (*MetadataFormatQuery) GroupBy

func (mfq *MetadataFormatQuery) GroupBy(field string, fields ...string) *MetadataFormatGroupBy

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

client.MetadataFormat.Query().
	GroupBy(metadataformat.FieldPrefix).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetadataFormatQuery) IDs

func (mfq *MetadataFormatQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*MetadataFormatQuery) IDsX

func (mfq *MetadataFormatQuery) IDsX(ctx context.Context) []int64

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

func (*MetadataFormatQuery) Limit

func (mfq *MetadataFormatQuery) Limit(limit int) *MetadataFormatQuery

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

func (*MetadataFormatQuery) Offset

func (mfq *MetadataFormatQuery) Offset(offset int) *MetadataFormatQuery

Offset to start from.

func (*MetadataFormatQuery) Only

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

func (*MetadataFormatQuery) OnlyID

func (mfq *MetadataFormatQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*MetadataFormatQuery) OnlyIDX

func (mfq *MetadataFormatQuery) OnlyIDX(ctx context.Context) int64

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

func (*MetadataFormatQuery) OnlyX

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

func (*MetadataFormatQuery) Order

Order specifies how the records should be ordered.

func (*MetadataFormatQuery) QueryContext

func (c *MetadataFormatQuery) 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 (*MetadataFormatQuery) QueryRecords

func (mfq *MetadataFormatQuery) QueryRecords() *RecordQuery

QueryRecords chains the current query on the "records" edge.

func (*MetadataFormatQuery) Select

func (mfq *MetadataFormatQuery) Select(fields ...string) *MetadataFormatSelect

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

client.MetadataFormat.Query().
	Select(metadataformat.FieldPrefix).
	Scan(ctx, &v)

func (*MetadataFormatQuery) Unique

func (mfq *MetadataFormatQuery) Unique(unique bool) *MetadataFormatQuery

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

Where adds a new predicate for the MetadataFormatQuery builder.

func (*MetadataFormatQuery) WithRecords

func (mfq *MetadataFormatQuery) WithRecords(opts ...func(*RecordQuery)) *MetadataFormatQuery

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

type MetadataFormatSelect

type MetadataFormatSelect struct {
	*MetadataFormatQuery
	// contains filtered or unexported fields
}

MetadataFormatSelect is the builder for selecting fields of MetadataFormat entities.

func (*MetadataFormatSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MetadataFormatSelect) Bool

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

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

func (*MetadataFormatSelect) BoolX

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

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

func (*MetadataFormatSelect) Bools

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

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

func (*MetadataFormatSelect) BoolsX

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

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

func (MetadataFormatSelect) ExecContext

func (c MetadataFormatSelect) 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 (*MetadataFormatSelect) Float64

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

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

func (*MetadataFormatSelect) Float64X

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

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

func (*MetadataFormatSelect) Float64s

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

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

func (*MetadataFormatSelect) Float64sX

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

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

func (*MetadataFormatSelect) Int

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

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

func (*MetadataFormatSelect) IntX

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

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

func (*MetadataFormatSelect) Ints

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

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

func (*MetadataFormatSelect) IntsX

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

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

func (MetadataFormatSelect) QueryContext

func (c MetadataFormatSelect) 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 (*MetadataFormatSelect) Scan

func (mfs *MetadataFormatSelect) Scan(ctx context.Context, v any) error

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

func (*MetadataFormatSelect) ScanX

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

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

func (*MetadataFormatSelect) String

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

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

func (*MetadataFormatSelect) StringX

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

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

func (*MetadataFormatSelect) Strings

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

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

func (*MetadataFormatSelect) StringsX

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

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

type MetadataFormatUpdate

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

MetadataFormatUpdate is the builder for updating MetadataFormat entities.

func (*MetadataFormatUpdate) AddRecordIDs

func (mfu *MetadataFormatUpdate) AddRecordIDs(ids ...int64) *MetadataFormatUpdate

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*MetadataFormatUpdate) AddRecords

func (mfu *MetadataFormatUpdate) AddRecords(r ...*Record) *MetadataFormatUpdate

AddRecords adds the "records" edges to the Record entity.

func (*MetadataFormatUpdate) ClearRecords

func (mfu *MetadataFormatUpdate) ClearRecords() *MetadataFormatUpdate

ClearRecords clears all "records" edges to the Record entity.

func (*MetadataFormatUpdate) Exec

func (mfu *MetadataFormatUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetadataFormatUpdate) ExecContext

func (c *MetadataFormatUpdate) 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 (*MetadataFormatUpdate) ExecX

func (mfu *MetadataFormatUpdate) ExecX(ctx context.Context)

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

func (*MetadataFormatUpdate) Mutation

Mutation returns the MetadataFormatMutation object of the builder.

func (*MetadataFormatUpdate) QueryContext

func (c *MetadataFormatUpdate) 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 (*MetadataFormatUpdate) RemoveRecordIDs

func (mfu *MetadataFormatUpdate) RemoveRecordIDs(ids ...int64) *MetadataFormatUpdate

RemoveRecordIDs removes the "records" edge to Record entities by IDs.

func (*MetadataFormatUpdate) RemoveRecords

func (mfu *MetadataFormatUpdate) RemoveRecords(r ...*Record) *MetadataFormatUpdate

RemoveRecords removes "records" edges to Record entities.

func (*MetadataFormatUpdate) Save

func (mfu *MetadataFormatUpdate) Save(ctx context.Context) (int, error)

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

func (*MetadataFormatUpdate) SaveX

func (mfu *MetadataFormatUpdate) SaveX(ctx context.Context) int

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

func (*MetadataFormatUpdate) SetNamespace

func (mfu *MetadataFormatUpdate) SetNamespace(s string) *MetadataFormatUpdate

SetNamespace sets the "namespace" field.

func (*MetadataFormatUpdate) SetPrefix

SetPrefix sets the "prefix" field.

func (*MetadataFormatUpdate) SetSchema

SetSchema sets the "schema" field.

func (*MetadataFormatUpdate) Where

Where appends a list predicates to the MetadataFormatUpdate builder.

type MetadataFormatUpdateOne

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

MetadataFormatUpdateOne is the builder for updating a single MetadataFormat entity.

func (*MetadataFormatUpdateOne) AddRecordIDs

func (mfuo *MetadataFormatUpdateOne) AddRecordIDs(ids ...int64) *MetadataFormatUpdateOne

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*MetadataFormatUpdateOne) AddRecords

func (mfuo *MetadataFormatUpdateOne) AddRecords(r ...*Record) *MetadataFormatUpdateOne

AddRecords adds the "records" edges to the Record entity.

func (*MetadataFormatUpdateOne) ClearRecords

func (mfuo *MetadataFormatUpdateOne) ClearRecords() *MetadataFormatUpdateOne

ClearRecords clears all "records" edges to the Record entity.

func (*MetadataFormatUpdateOne) Exec

func (mfuo *MetadataFormatUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MetadataFormatUpdateOne) ExecContext

func (c *MetadataFormatUpdateOne) 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 (*MetadataFormatUpdateOne) ExecX

func (mfuo *MetadataFormatUpdateOne) ExecX(ctx context.Context)

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

func (*MetadataFormatUpdateOne) Mutation

Mutation returns the MetadataFormatMutation object of the builder.

func (*MetadataFormatUpdateOne) QueryContext

func (c *MetadataFormatUpdateOne) 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 (*MetadataFormatUpdateOne) RemoveRecordIDs

func (mfuo *MetadataFormatUpdateOne) RemoveRecordIDs(ids ...int64) *MetadataFormatUpdateOne

RemoveRecordIDs removes the "records" edge to Record entities by IDs.

func (*MetadataFormatUpdateOne) RemoveRecords

func (mfuo *MetadataFormatUpdateOne) RemoveRecords(r ...*Record) *MetadataFormatUpdateOne

RemoveRecords removes "records" edges to Record entities.

func (*MetadataFormatUpdateOne) Save

Save executes the query and returns the updated MetadataFormat entity.

func (*MetadataFormatUpdateOne) SaveX

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

func (*MetadataFormatUpdateOne) Select

func (mfuo *MetadataFormatUpdateOne) Select(field string, fields ...string) *MetadataFormatUpdateOne

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

func (*MetadataFormatUpdateOne) SetNamespace

SetNamespace sets the "namespace" field.

func (*MetadataFormatUpdateOne) SetPrefix

SetPrefix sets the "prefix" field.

func (*MetadataFormatUpdateOne) SetSchema

SetSchema sets the "schema" field.

func (*MetadataFormatUpdateOne) Where

Where appends a list predicates to the MetadataFormatUpdate builder.

type MetadataFormatUpsert

type MetadataFormatUpsert struct {
	*sql.UpdateSet
}

MetadataFormatUpsert is the "OnConflict" setter.

func (*MetadataFormatUpsert) SetNamespace

func (u *MetadataFormatUpsert) SetNamespace(v string) *MetadataFormatUpsert

SetNamespace sets the "namespace" field.

func (*MetadataFormatUpsert) SetPrefix

SetPrefix sets the "prefix" field.

func (*MetadataFormatUpsert) SetSchema

SetSchema sets the "schema" field.

func (*MetadataFormatUpsert) UpdateNamespace

func (u *MetadataFormatUpsert) UpdateNamespace() *MetadataFormatUpsert

UpdateNamespace sets the "namespace" field to the value that was provided on create.

func (*MetadataFormatUpsert) UpdatePrefix

func (u *MetadataFormatUpsert) UpdatePrefix() *MetadataFormatUpsert

UpdatePrefix sets the "prefix" field to the value that was provided on create.

func (*MetadataFormatUpsert) UpdateSchema

func (u *MetadataFormatUpsert) UpdateSchema() *MetadataFormatUpsert

UpdateSchema sets the "schema" field to the value that was provided on create.

type MetadataFormatUpsertBulk

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

MetadataFormatUpsertBulk is the builder for "upsert"-ing a bulk of MetadataFormat nodes.

func (*MetadataFormatUpsertBulk) DoNothing

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

func (*MetadataFormatUpsertBulk) Exec

Exec executes the query.

func (*MetadataFormatUpsertBulk) ExecX

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

func (*MetadataFormatUpsertBulk) Ignore

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

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

func (*MetadataFormatUpsertBulk) SetNamespace

SetNamespace sets the "namespace" field.

func (*MetadataFormatUpsertBulk) SetPrefix

SetPrefix sets the "prefix" field.

func (*MetadataFormatUpsertBulk) SetSchema

SetSchema sets the "schema" field.

func (*MetadataFormatUpsertBulk) Update

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

func (*MetadataFormatUpsertBulk) UpdateNamespace

func (u *MetadataFormatUpsertBulk) UpdateNamespace() *MetadataFormatUpsertBulk

UpdateNamespace sets the "namespace" field to the value that was provided on create.

func (*MetadataFormatUpsertBulk) UpdateNewValues

func (u *MetadataFormatUpsertBulk) UpdateNewValues() *MetadataFormatUpsertBulk

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

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

func (*MetadataFormatUpsertBulk) UpdatePrefix

UpdatePrefix sets the "prefix" field to the value that was provided on create.

func (*MetadataFormatUpsertBulk) UpdateSchema

UpdateSchema sets the "schema" field to the value that was provided on create.

type MetadataFormatUpsertOne

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

MetadataFormatUpsertOne is the builder for "upsert"-ing

one MetadataFormat node.

func (*MetadataFormatUpsertOne) DoNothing

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

func (*MetadataFormatUpsertOne) Exec

Exec executes the query.

func (*MetadataFormatUpsertOne) ExecX

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

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

func (*MetadataFormatUpsertOne) ID

func (u *MetadataFormatUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*MetadataFormatUpsertOne) IDX

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

func (*MetadataFormatUpsertOne) Ignore

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

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

func (*MetadataFormatUpsertOne) SetNamespace

SetNamespace sets the "namespace" field.

func (*MetadataFormatUpsertOne) SetPrefix

SetPrefix sets the "prefix" field.

func (*MetadataFormatUpsertOne) SetSchema

SetSchema sets the "schema" field.

func (*MetadataFormatUpsertOne) Update

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

func (*MetadataFormatUpsertOne) UpdateNamespace

func (u *MetadataFormatUpsertOne) UpdateNamespace() *MetadataFormatUpsertOne

UpdateNamespace sets the "namespace" field to the value that was provided on create.

func (*MetadataFormatUpsertOne) UpdateNewValues

func (u *MetadataFormatUpsertOne) UpdateNewValues() *MetadataFormatUpsertOne

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.MetadataFormat.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(metadataformat.FieldID)
		}),
	).
	Exec(ctx)

func (*MetadataFormatUpsertOne) UpdatePrefix

UpdatePrefix sets the "prefix" field to the value that was provided on create.

func (*MetadataFormatUpsertOne) UpdateSchema

UpdateSchema sets the "schema" field to the value that was provided on create.

type MetadataFormats

type MetadataFormats []*MetadataFormat

MetadataFormats is a parsable slice of MetadataFormat.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type 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 Record

type Record struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// MetadataFormatID holds the value of the "metadata_format_id" field.
	MetadataFormatID int64 `json:"metadata_format_id,omitempty"`
	// ItemID holds the value of the "item_id" field.
	ItemID int64 `json:"item_id,omitempty"`
	// A record with NULL metadata is considered deleted.
	Metadata *string `json:"metadata,omitempty"`
	// Datestamp holds the value of the "datestamp" field.
	Datestamp time.Time `json:"datestamp,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RecordQuery when eager-loading is set.
	Edges RecordEdges `json:"edges"`
	// contains filtered or unexported fields
}

Record is the model entity for the Record schema.

func (*Record) ExecContext

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

func (c *Record) 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 (*Record) QueryItem

func (r *Record) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the Record entity.

func (*Record) QueryMetadataFormat

func (r *Record) QueryMetadataFormat() *MetadataFormatQuery

QueryMetadataFormat queries the "metadata_format" edge of the Record entity.

func (*Record) String

func (r *Record) String() string

String implements the fmt.Stringer.

func (*Record) Unwrap

func (r *Record) Unwrap() *Record

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

func (r *Record) Update() *RecordUpdateOne

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

func (*Record) Value

func (r *Record) Value(name string) (ent.Value, error)

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

type RecordClient

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

RecordClient is a client for the Record schema.

func NewRecordClient

func NewRecordClient(c config) *RecordClient

NewRecordClient returns a client for the Record from the given config.

func (*RecordClient) Create

func (c *RecordClient) Create() *RecordCreate

Create returns a builder for creating a Record entity.

func (*RecordClient) CreateBulk

func (c *RecordClient) CreateBulk(builders ...*RecordCreate) *RecordCreateBulk

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

func (*RecordClient) Delete

func (c *RecordClient) Delete() *RecordDelete

Delete returns a delete builder for Record.

func (*RecordClient) DeleteOne

func (c *RecordClient) DeleteOne(r *Record) *RecordDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RecordClient) DeleteOneID

func (c *RecordClient) DeleteOneID(id int64) *RecordDeleteOne

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

func (*RecordClient) ExecContext

func (c *RecordClient) 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 (*RecordClient) Get

func (c *RecordClient) Get(ctx context.Context, id int64) (*Record, error)

Get returns a Record entity by its id.

func (*RecordClient) GetX

func (c *RecordClient) GetX(ctx context.Context, id int64) *Record

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

func (*RecordClient) Hooks

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

Hooks returns the client hooks.

func (*RecordClient) Intercept

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

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

func (*RecordClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RecordClient) Query

func (c *RecordClient) Query() *RecordQuery

Query returns a query builder for Record.

func (*RecordClient) QueryContext

func (c *RecordClient) 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 (*RecordClient) QueryItem

func (c *RecordClient) QueryItem(r *Record) *ItemQuery

QueryItem queries the item edge of a Record.

func (*RecordClient) QueryMetadataFormat

func (c *RecordClient) QueryMetadataFormat(r *Record) *MetadataFormatQuery

QueryMetadataFormat queries the metadata_format edge of a Record.

func (*RecordClient) Update

func (c *RecordClient) Update() *RecordUpdate

Update returns an update builder for Record.

func (*RecordClient) UpdateOne

func (c *RecordClient) UpdateOne(r *Record) *RecordUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RecordClient) UpdateOneID

func (c *RecordClient) UpdateOneID(id int64) *RecordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RecordClient) Use

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

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

type RecordCreate

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

RecordCreate is the builder for creating a Record entity.

func (*RecordCreate) Exec

func (rc *RecordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RecordCreate) ExecContext

func (c *RecordCreate) 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 (*RecordCreate) ExecX

func (rc *RecordCreate) ExecX(ctx context.Context)

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

func (*RecordCreate) Mutation

func (rc *RecordCreate) Mutation() *RecordMutation

Mutation returns the RecordMutation object of the builder.

func (*RecordCreate) OnConflict

func (rc *RecordCreate) OnConflict(opts ...sql.ConflictOption) *RecordUpsertOne

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

client.Record.Create().
	SetMetadataFormatID(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.RecordUpsert) {
		SetMetadataFormatID(v+v).
	}).
	Exec(ctx)

func (*RecordCreate) OnConflictColumns

func (rc *RecordCreate) OnConflictColumns(columns ...string) *RecordUpsertOne

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

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

func (*RecordCreate) QueryContext

func (c *RecordCreate) 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 (*RecordCreate) Save

func (rc *RecordCreate) Save(ctx context.Context) (*Record, error)

Save creates the Record in the database.

func (*RecordCreate) SaveX

func (rc *RecordCreate) SaveX(ctx context.Context) *Record

SaveX calls Save and panics if Save returns an error.

func (*RecordCreate) SetDatestamp

func (rc *RecordCreate) SetDatestamp(t time.Time) *RecordCreate

SetDatestamp sets the "datestamp" field.

func (*RecordCreate) SetID

func (rc *RecordCreate) SetID(i int64) *RecordCreate

SetID sets the "id" field.

func (*RecordCreate) SetItem

func (rc *RecordCreate) SetItem(i *Item) *RecordCreate

SetItem sets the "item" edge to the Item entity.

func (*RecordCreate) SetItemID

func (rc *RecordCreate) SetItemID(i int64) *RecordCreate

SetItemID sets the "item_id" field.

func (*RecordCreate) SetMetadata

func (rc *RecordCreate) SetMetadata(s string) *RecordCreate

SetMetadata sets the "metadata" field.

func (*RecordCreate) SetMetadataFormat

func (rc *RecordCreate) SetMetadataFormat(m *MetadataFormat) *RecordCreate

SetMetadataFormat sets the "metadata_format" edge to the MetadataFormat entity.

func (*RecordCreate) SetMetadataFormatID

func (rc *RecordCreate) SetMetadataFormatID(i int64) *RecordCreate

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordCreate) SetNillableDatestamp

func (rc *RecordCreate) SetNillableDatestamp(t *time.Time) *RecordCreate

SetNillableDatestamp sets the "datestamp" field if the given value is not nil.

func (*RecordCreate) SetNillableMetadata

func (rc *RecordCreate) SetNillableMetadata(s *string) *RecordCreate

SetNillableMetadata sets the "metadata" field if the given value is not nil.

type RecordCreateBulk

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

RecordCreateBulk is the builder for creating many Record entities in bulk.

func (*RecordCreateBulk) Exec

func (rcb *RecordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RecordCreateBulk) ExecContext

func (c *RecordCreateBulk) 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 (*RecordCreateBulk) ExecX

func (rcb *RecordCreateBulk) ExecX(ctx context.Context)

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

func (*RecordCreateBulk) OnConflict

func (rcb *RecordCreateBulk) OnConflict(opts ...sql.ConflictOption) *RecordUpsertBulk

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

client.Record.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.RecordUpsert) {
		SetMetadataFormatID(v+v).
	}).
	Exec(ctx)

func (*RecordCreateBulk) OnConflictColumns

func (rcb *RecordCreateBulk) OnConflictColumns(columns ...string) *RecordUpsertBulk

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

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

func (*RecordCreateBulk) QueryContext

func (c *RecordCreateBulk) 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 (*RecordCreateBulk) Save

func (rcb *RecordCreateBulk) Save(ctx context.Context) ([]*Record, error)

Save creates the Record entities in the database.

func (*RecordCreateBulk) SaveX

func (rcb *RecordCreateBulk) SaveX(ctx context.Context) []*Record

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

type RecordDelete

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

RecordDelete is the builder for deleting a Record entity.

func (*RecordDelete) Exec

func (rd *RecordDelete) Exec(ctx context.Context) (int, error)

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

func (*RecordDelete) ExecContext

func (c *RecordDelete) 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 (*RecordDelete) ExecX

func (rd *RecordDelete) ExecX(ctx context.Context) int

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

func (*RecordDelete) QueryContext

func (c *RecordDelete) 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 (*RecordDelete) Where

func (rd *RecordDelete) Where(ps ...predicate.Record) *RecordDelete

Where appends a list predicates to the RecordDelete builder.

type RecordDeleteOne

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

RecordDeleteOne is the builder for deleting a single Record entity.

func (*RecordDeleteOne) Exec

func (rdo *RecordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RecordDeleteOne) ExecX

func (rdo *RecordDeleteOne) ExecX(ctx context.Context)

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

func (*RecordDeleteOne) Where

func (rdo *RecordDeleteOne) Where(ps ...predicate.Record) *RecordDeleteOne

Where appends a list predicates to the RecordDelete builder.

type RecordEdges

type RecordEdges struct {
	// MetadataFormat holds the value of the metadata_format edge.
	MetadataFormat *MetadataFormat `json:"metadata_format,omitempty"`
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// contains filtered or unexported fields
}

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

func (RecordEdges) ItemOrErr

func (e RecordEdges) ItemOrErr() (*Item, error)

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

func (RecordEdges) MetadataFormatOrErr

func (e RecordEdges) MetadataFormatOrErr() (*MetadataFormat, error)

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

type RecordGroupBy

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

RecordGroupBy is the group-by builder for Record entities.

func (*RecordGroupBy) Aggregate

func (rgb *RecordGroupBy) Aggregate(fns ...AggregateFunc) *RecordGroupBy

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

func (*RecordGroupBy) Bool

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

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

func (*RecordGroupBy) BoolX

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

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

func (*RecordGroupBy) Bools

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

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

func (*RecordGroupBy) BoolsX

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

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

func (*RecordGroupBy) Float64

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

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

func (*RecordGroupBy) Float64X

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

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

func (*RecordGroupBy) Float64s

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

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

func (*RecordGroupBy) Float64sX

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

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

func (*RecordGroupBy) Int

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

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

func (*RecordGroupBy) IntX

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

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

func (*RecordGroupBy) Ints

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

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

func (*RecordGroupBy) IntsX

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

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

func (*RecordGroupBy) Scan

func (rgb *RecordGroupBy) Scan(ctx context.Context, v any) error

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

func (*RecordGroupBy) ScanX

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

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

func (*RecordGroupBy) String

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

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

func (*RecordGroupBy) StringX

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

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

func (*RecordGroupBy) Strings

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

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

func (*RecordGroupBy) StringsX

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

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

type RecordMutation

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

RecordMutation represents an operation that mutates the Record nodes in the graph.

func (*RecordMutation) AddField

func (m *RecordMutation) 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 (*RecordMutation) AddedEdges

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

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

func (*RecordMutation) AddedField

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

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

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

func (*RecordMutation) AddedIDs

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

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

func (*RecordMutation) ClearEdge

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

func (m *RecordMutation) 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 (*RecordMutation) ClearItem

func (m *RecordMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*RecordMutation) ClearMetadata

func (m *RecordMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*RecordMutation) ClearMetadataFormat

func (m *RecordMutation) ClearMetadataFormat()

ClearMetadataFormat clears the "metadata_format" edge to the MetadataFormat entity.

func (*RecordMutation) ClearedEdges

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

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

func (*RecordMutation) ClearedFields

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

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

func (RecordMutation) Client

func (m RecordMutation) 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 (*RecordMutation) Datestamp

func (m *RecordMutation) Datestamp() (r time.Time, exists bool)

Datestamp returns the value of the "datestamp" field in the mutation.

func (*RecordMutation) EdgeCleared

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

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

func (*RecordMutation) ExecContext

func (c *RecordMutation) 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 (*RecordMutation) Field

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

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

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

func (*RecordMutation) Fields

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

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

func (m *RecordMutation) 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 (*RecordMutation) ItemCleared

func (m *RecordMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*RecordMutation) ItemID

func (m *RecordMutation) ItemID() (r int64, exists bool)

ItemID returns the value of the "item_id" field in the mutation.

func (*RecordMutation) ItemIDs

func (m *RecordMutation) ItemIDs() (ids []int64)

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

func (*RecordMutation) Metadata

func (m *RecordMutation) Metadata() (r string, exists bool)

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

func (*RecordMutation) MetadataCleared

func (m *RecordMutation) MetadataCleared() bool

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

func (*RecordMutation) MetadataFormatCleared

func (m *RecordMutation) MetadataFormatCleared() bool

MetadataFormatCleared reports if the "metadata_format" edge to the MetadataFormat entity was cleared.

func (*RecordMutation) MetadataFormatID

func (m *RecordMutation) MetadataFormatID() (r int64, exists bool)

MetadataFormatID returns the value of the "metadata_format_id" field in the mutation.

func (*RecordMutation) MetadataFormatIDs

func (m *RecordMutation) MetadataFormatIDs() (ids []int64)

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

func (*RecordMutation) OldDatestamp

func (m *RecordMutation) OldDatestamp(ctx context.Context) (v time.Time, err error)

OldDatestamp returns the old "datestamp" field's value of the Record entity. If the Record 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 (*RecordMutation) OldField

func (m *RecordMutation) 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 (*RecordMutation) OldItemID

func (m *RecordMutation) OldItemID(ctx context.Context) (v int64, err error)

OldItemID returns the old "item_id" field's value of the Record entity. If the Record 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 (*RecordMutation) OldMetadata

func (m *RecordMutation) OldMetadata(ctx context.Context) (v *string, err error)

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

func (m *RecordMutation) OldMetadataFormatID(ctx context.Context) (v int64, err error)

OldMetadataFormatID returns the old "metadata_format_id" field's value of the Record entity. If the Record 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 (*RecordMutation) Op

func (m *RecordMutation) Op() Op

Op returns the operation name.

func (*RecordMutation) QueryContext

func (c *RecordMutation) 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 (*RecordMutation) RemovedEdges

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

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

func (*RecordMutation) RemovedIDs

func (m *RecordMutation) 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 (*RecordMutation) ResetDatestamp

func (m *RecordMutation) ResetDatestamp()

ResetDatestamp resets all changes to the "datestamp" field.

func (*RecordMutation) ResetEdge

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

func (m *RecordMutation) 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 (*RecordMutation) ResetItem

func (m *RecordMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*RecordMutation) ResetItemID

func (m *RecordMutation) ResetItemID()

ResetItemID resets all changes to the "item_id" field.

func (*RecordMutation) ResetMetadata

func (m *RecordMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*RecordMutation) ResetMetadataFormat

func (m *RecordMutation) ResetMetadataFormat()

ResetMetadataFormat resets all changes to the "metadata_format" edge.

func (*RecordMutation) ResetMetadataFormatID

func (m *RecordMutation) ResetMetadataFormatID()

ResetMetadataFormatID resets all changes to the "metadata_format_id" field.

func (*RecordMutation) SetDatestamp

func (m *RecordMutation) SetDatestamp(t time.Time)

SetDatestamp sets the "datestamp" field.

func (*RecordMutation) SetField

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

func (m *RecordMutation) SetID(id int64)

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

func (*RecordMutation) SetItemID

func (m *RecordMutation) SetItemID(i int64)

SetItemID sets the "item_id" field.

func (*RecordMutation) SetMetadata

func (m *RecordMutation) SetMetadata(s string)

SetMetadata sets the "metadata" field.

func (*RecordMutation) SetMetadataFormatID

func (m *RecordMutation) SetMetadataFormatID(i int64)

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordMutation) SetOp

func (m *RecordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (RecordMutation) Tx

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

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

func (*RecordMutation) Type

func (m *RecordMutation) Type() string

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

func (*RecordMutation) Where

func (m *RecordMutation) Where(ps ...predicate.Record)

Where appends a list predicates to the RecordMutation builder.

func (*RecordMutation) WhereP

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

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

type RecordQuery

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

RecordQuery is the builder for querying Record entities.

func (*RecordQuery) Aggregate

func (rq *RecordQuery) Aggregate(fns ...AggregateFunc) *RecordSelect

Aggregate returns a RecordSelect configured with the given aggregations.

func (*RecordQuery) All

func (rq *RecordQuery) All(ctx context.Context) ([]*Record, error)

All executes the query and returns a list of Records.

func (*RecordQuery) AllX

func (rq *RecordQuery) AllX(ctx context.Context) []*Record

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

func (*RecordQuery) Clone

func (rq *RecordQuery) Clone() *RecordQuery

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

func (*RecordQuery) Count

func (rq *RecordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RecordQuery) CountX

func (rq *RecordQuery) CountX(ctx context.Context) int

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

func (*RecordQuery) ExecContext

func (c *RecordQuery) 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 (*RecordQuery) Exist

func (rq *RecordQuery) Exist(ctx context.Context) (bool, error)

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

func (*RecordQuery) ExistX

func (rq *RecordQuery) ExistX(ctx context.Context) bool

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

func (*RecordQuery) First

func (rq *RecordQuery) First(ctx context.Context) (*Record, error)

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

func (*RecordQuery) FirstID

func (rq *RecordQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RecordQuery) FirstIDX

func (rq *RecordQuery) FirstIDX(ctx context.Context) int64

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

func (*RecordQuery) FirstX

func (rq *RecordQuery) FirstX(ctx context.Context) *Record

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

func (*RecordQuery) GroupBy

func (rq *RecordQuery) GroupBy(field string, fields ...string) *RecordGroupBy

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 {
	MetadataFormatID int64 `json:"metadata_format_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Record.Query().
	GroupBy(record.FieldMetadataFormatID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RecordQuery) IDs

func (rq *RecordQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*RecordQuery) IDsX

func (rq *RecordQuery) IDsX(ctx context.Context) []int64

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

func (*RecordQuery) Limit

func (rq *RecordQuery) Limit(limit int) *RecordQuery

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

func (*RecordQuery) Offset

func (rq *RecordQuery) Offset(offset int) *RecordQuery

Offset to start from.

func (*RecordQuery) Only

func (rq *RecordQuery) Only(ctx context.Context) (*Record, error)

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

func (*RecordQuery) OnlyID

func (rq *RecordQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RecordQuery) OnlyIDX

func (rq *RecordQuery) OnlyIDX(ctx context.Context) int64

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

func (*RecordQuery) OnlyX

func (rq *RecordQuery) OnlyX(ctx context.Context) *Record

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

func (*RecordQuery) Order

func (rq *RecordQuery) Order(o ...record.OrderOption) *RecordQuery

Order specifies how the records should be ordered.

func (*RecordQuery) QueryContext

func (c *RecordQuery) 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 (*RecordQuery) QueryItem

func (rq *RecordQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*RecordQuery) QueryMetadataFormat

func (rq *RecordQuery) QueryMetadataFormat() *MetadataFormatQuery

QueryMetadataFormat chains the current query on the "metadata_format" edge.

func (*RecordQuery) Select

func (rq *RecordQuery) Select(fields ...string) *RecordSelect

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 {
	MetadataFormatID int64 `json:"metadata_format_id,omitempty"`
}

client.Record.Query().
	Select(record.FieldMetadataFormatID).
	Scan(ctx, &v)

func (*RecordQuery) Unique

func (rq *RecordQuery) Unique(unique bool) *RecordQuery

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

func (rq *RecordQuery) Where(ps ...predicate.Record) *RecordQuery

Where adds a new predicate for the RecordQuery builder.

func (*RecordQuery) WithItem

func (rq *RecordQuery) WithItem(opts ...func(*ItemQuery)) *RecordQuery

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

func (*RecordQuery) WithMetadataFormat

func (rq *RecordQuery) WithMetadataFormat(opts ...func(*MetadataFormatQuery)) *RecordQuery

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

type RecordSelect

type RecordSelect struct {
	*RecordQuery
	// contains filtered or unexported fields
}

RecordSelect is the builder for selecting fields of Record entities.

func (*RecordSelect) Aggregate

func (rs *RecordSelect) Aggregate(fns ...AggregateFunc) *RecordSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RecordSelect) Bool

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

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

func (*RecordSelect) BoolX

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

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

func (*RecordSelect) Bools

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

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

func (*RecordSelect) BoolsX

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

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

func (RecordSelect) ExecContext

func (c RecordSelect) 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 (*RecordSelect) Float64

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

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

func (*RecordSelect) Float64X

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

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

func (*RecordSelect) Float64s

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

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

func (*RecordSelect) Float64sX

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

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

func (*RecordSelect) Int

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

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

func (*RecordSelect) IntX

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

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

func (*RecordSelect) Ints

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

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

func (*RecordSelect) IntsX

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

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

func (RecordSelect) QueryContext

func (c RecordSelect) 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 (*RecordSelect) Scan

func (rs *RecordSelect) Scan(ctx context.Context, v any) error

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

func (*RecordSelect) ScanX

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

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

func (*RecordSelect) String

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

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

func (*RecordSelect) StringX

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

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

func (*RecordSelect) Strings

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

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

func (*RecordSelect) StringsX

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

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

type RecordUpdate

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

RecordUpdate is the builder for updating Record entities.

func (*RecordUpdate) ClearItem

func (ru *RecordUpdate) ClearItem() *RecordUpdate

ClearItem clears the "item" edge to the Item entity.

func (*RecordUpdate) ClearMetadata

func (ru *RecordUpdate) ClearMetadata() *RecordUpdate

ClearMetadata clears the value of the "metadata" field.

func (*RecordUpdate) ClearMetadataFormat

func (ru *RecordUpdate) ClearMetadataFormat() *RecordUpdate

ClearMetadataFormat clears the "metadata_format" edge to the MetadataFormat entity.

func (*RecordUpdate) Exec

func (ru *RecordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RecordUpdate) ExecContext

func (c *RecordUpdate) 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 (*RecordUpdate) ExecX

func (ru *RecordUpdate) ExecX(ctx context.Context)

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

func (*RecordUpdate) Mutation

func (ru *RecordUpdate) Mutation() *RecordMutation

Mutation returns the RecordMutation object of the builder.

func (*RecordUpdate) QueryContext

func (c *RecordUpdate) 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 (*RecordUpdate) Save

func (ru *RecordUpdate) Save(ctx context.Context) (int, error)

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

func (*RecordUpdate) SaveX

func (ru *RecordUpdate) SaveX(ctx context.Context) int

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

func (*RecordUpdate) SetDatestamp

func (ru *RecordUpdate) SetDatestamp(t time.Time) *RecordUpdate

SetDatestamp sets the "datestamp" field.

func (*RecordUpdate) SetItem

func (ru *RecordUpdate) SetItem(i *Item) *RecordUpdate

SetItem sets the "item" edge to the Item entity.

func (*RecordUpdate) SetItemID

func (ru *RecordUpdate) SetItemID(i int64) *RecordUpdate

SetItemID sets the "item_id" field.

func (*RecordUpdate) SetMetadata

func (ru *RecordUpdate) SetMetadata(s string) *RecordUpdate

SetMetadata sets the "metadata" field.

func (*RecordUpdate) SetMetadataFormat

func (ru *RecordUpdate) SetMetadataFormat(m *MetadataFormat) *RecordUpdate

SetMetadataFormat sets the "metadata_format" edge to the MetadataFormat entity.

func (*RecordUpdate) SetMetadataFormatID

func (ru *RecordUpdate) SetMetadataFormatID(i int64) *RecordUpdate

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordUpdate) SetNillableDatestamp

func (ru *RecordUpdate) SetNillableDatestamp(t *time.Time) *RecordUpdate

SetNillableDatestamp sets the "datestamp" field if the given value is not nil.

func (*RecordUpdate) SetNillableMetadata

func (ru *RecordUpdate) SetNillableMetadata(s *string) *RecordUpdate

SetNillableMetadata sets the "metadata" field if the given value is not nil.

func (*RecordUpdate) Where

func (ru *RecordUpdate) Where(ps ...predicate.Record) *RecordUpdate

Where appends a list predicates to the RecordUpdate builder.

type RecordUpdateOne

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

RecordUpdateOne is the builder for updating a single Record entity.

func (*RecordUpdateOne) ClearItem

func (ruo *RecordUpdateOne) ClearItem() *RecordUpdateOne

ClearItem clears the "item" edge to the Item entity.

func (*RecordUpdateOne) ClearMetadata

func (ruo *RecordUpdateOne) ClearMetadata() *RecordUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*RecordUpdateOne) ClearMetadataFormat

func (ruo *RecordUpdateOne) ClearMetadataFormat() *RecordUpdateOne

ClearMetadataFormat clears the "metadata_format" edge to the MetadataFormat entity.

func (*RecordUpdateOne) Exec

func (ruo *RecordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RecordUpdateOne) ExecContext

func (c *RecordUpdateOne) 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 (*RecordUpdateOne) ExecX

func (ruo *RecordUpdateOne) ExecX(ctx context.Context)

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

func (*RecordUpdateOne) Mutation

func (ruo *RecordUpdateOne) Mutation() *RecordMutation

Mutation returns the RecordMutation object of the builder.

func (*RecordUpdateOne) QueryContext

func (c *RecordUpdateOne) 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 (*RecordUpdateOne) Save

func (ruo *RecordUpdateOne) Save(ctx context.Context) (*Record, error)

Save executes the query and returns the updated Record entity.

func (*RecordUpdateOne) SaveX

func (ruo *RecordUpdateOne) SaveX(ctx context.Context) *Record

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

func (*RecordUpdateOne) Select

func (ruo *RecordUpdateOne) Select(field string, fields ...string) *RecordUpdateOne

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

func (*RecordUpdateOne) SetDatestamp

func (ruo *RecordUpdateOne) SetDatestamp(t time.Time) *RecordUpdateOne

SetDatestamp sets the "datestamp" field.

func (*RecordUpdateOne) SetItem

func (ruo *RecordUpdateOne) SetItem(i *Item) *RecordUpdateOne

SetItem sets the "item" edge to the Item entity.

func (*RecordUpdateOne) SetItemID

func (ruo *RecordUpdateOne) SetItemID(i int64) *RecordUpdateOne

SetItemID sets the "item_id" field.

func (*RecordUpdateOne) SetMetadata

func (ruo *RecordUpdateOne) SetMetadata(s string) *RecordUpdateOne

SetMetadata sets the "metadata" field.

func (*RecordUpdateOne) SetMetadataFormat

func (ruo *RecordUpdateOne) SetMetadataFormat(m *MetadataFormat) *RecordUpdateOne

SetMetadataFormat sets the "metadata_format" edge to the MetadataFormat entity.

func (*RecordUpdateOne) SetMetadataFormatID

func (ruo *RecordUpdateOne) SetMetadataFormatID(i int64) *RecordUpdateOne

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordUpdateOne) SetNillableDatestamp

func (ruo *RecordUpdateOne) SetNillableDatestamp(t *time.Time) *RecordUpdateOne

SetNillableDatestamp sets the "datestamp" field if the given value is not nil.

func (*RecordUpdateOne) SetNillableMetadata

func (ruo *RecordUpdateOne) SetNillableMetadata(s *string) *RecordUpdateOne

SetNillableMetadata sets the "metadata" field if the given value is not nil.

func (*RecordUpdateOne) Where

func (ruo *RecordUpdateOne) Where(ps ...predicate.Record) *RecordUpdateOne

Where appends a list predicates to the RecordUpdate builder.

type RecordUpsert

type RecordUpsert struct {
	*sql.UpdateSet
}

RecordUpsert is the "OnConflict" setter.

func (*RecordUpsert) ClearMetadata

func (u *RecordUpsert) ClearMetadata() *RecordUpsert

ClearMetadata clears the value of the "metadata" field.

func (*RecordUpsert) SetDatestamp

func (u *RecordUpsert) SetDatestamp(v time.Time) *RecordUpsert

SetDatestamp sets the "datestamp" field.

func (*RecordUpsert) SetItemID

func (u *RecordUpsert) SetItemID(v int64) *RecordUpsert

SetItemID sets the "item_id" field.

func (*RecordUpsert) SetMetadata

func (u *RecordUpsert) SetMetadata(v string) *RecordUpsert

SetMetadata sets the "metadata" field.

func (*RecordUpsert) SetMetadataFormatID

func (u *RecordUpsert) SetMetadataFormatID(v int64) *RecordUpsert

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordUpsert) UpdateDatestamp

func (u *RecordUpsert) UpdateDatestamp() *RecordUpsert

UpdateDatestamp sets the "datestamp" field to the value that was provided on create.

func (*RecordUpsert) UpdateItemID

func (u *RecordUpsert) UpdateItemID() *RecordUpsert

UpdateItemID sets the "item_id" field to the value that was provided on create.

func (*RecordUpsert) UpdateMetadata

func (u *RecordUpsert) UpdateMetadata() *RecordUpsert

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*RecordUpsert) UpdateMetadataFormatID

func (u *RecordUpsert) UpdateMetadataFormatID() *RecordUpsert

UpdateMetadataFormatID sets the "metadata_format_id" field to the value that was provided on create.

type RecordUpsertBulk

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

RecordUpsertBulk is the builder for "upsert"-ing a bulk of Record nodes.

func (*RecordUpsertBulk) ClearMetadata

func (u *RecordUpsertBulk) ClearMetadata() *RecordUpsertBulk

ClearMetadata clears the value of the "metadata" field.

func (*RecordUpsertBulk) DoNothing

func (u *RecordUpsertBulk) DoNothing() *RecordUpsertBulk

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

func (*RecordUpsertBulk) Exec

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

Exec executes the query.

func (*RecordUpsertBulk) ExecX

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

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

func (*RecordUpsertBulk) Ignore

func (u *RecordUpsertBulk) Ignore() *RecordUpsertBulk

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

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

func (*RecordUpsertBulk) SetDatestamp

func (u *RecordUpsertBulk) SetDatestamp(v time.Time) *RecordUpsertBulk

SetDatestamp sets the "datestamp" field.

func (*RecordUpsertBulk) SetItemID

func (u *RecordUpsertBulk) SetItemID(v int64) *RecordUpsertBulk

SetItemID sets the "item_id" field.

func (*RecordUpsertBulk) SetMetadata

func (u *RecordUpsertBulk) SetMetadata(v string) *RecordUpsertBulk

SetMetadata sets the "metadata" field.

func (*RecordUpsertBulk) SetMetadataFormatID

func (u *RecordUpsertBulk) SetMetadataFormatID(v int64) *RecordUpsertBulk

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordUpsertBulk) Update

func (u *RecordUpsertBulk) Update(set func(*RecordUpsert)) *RecordUpsertBulk

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

func (*RecordUpsertBulk) UpdateDatestamp

func (u *RecordUpsertBulk) UpdateDatestamp() *RecordUpsertBulk

UpdateDatestamp sets the "datestamp" field to the value that was provided on create.

func (*RecordUpsertBulk) UpdateItemID

func (u *RecordUpsertBulk) UpdateItemID() *RecordUpsertBulk

UpdateItemID sets the "item_id" field to the value that was provided on create.

func (*RecordUpsertBulk) UpdateMetadata

func (u *RecordUpsertBulk) UpdateMetadata() *RecordUpsertBulk

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*RecordUpsertBulk) UpdateMetadataFormatID

func (u *RecordUpsertBulk) UpdateMetadataFormatID() *RecordUpsertBulk

UpdateMetadataFormatID sets the "metadata_format_id" field to the value that was provided on create.

func (*RecordUpsertBulk) UpdateNewValues

func (u *RecordUpsertBulk) UpdateNewValues() *RecordUpsertBulk

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

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

type RecordUpsertOne

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

RecordUpsertOne is the builder for "upsert"-ing

one Record node.

func (*RecordUpsertOne) ClearMetadata

func (u *RecordUpsertOne) ClearMetadata() *RecordUpsertOne

ClearMetadata clears the value of the "metadata" field.

func (*RecordUpsertOne) DoNothing

func (u *RecordUpsertOne) DoNothing() *RecordUpsertOne

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

func (*RecordUpsertOne) Exec

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

Exec executes the query.

func (*RecordUpsertOne) ExecX

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

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

func (*RecordUpsertOne) ID

func (u *RecordUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*RecordUpsertOne) IDX

func (u *RecordUpsertOne) IDX(ctx context.Context) int64

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

func (*RecordUpsertOne) Ignore

func (u *RecordUpsertOne) Ignore() *RecordUpsertOne

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

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

func (*RecordUpsertOne) SetDatestamp

func (u *RecordUpsertOne) SetDatestamp(v time.Time) *RecordUpsertOne

SetDatestamp sets the "datestamp" field.

func (*RecordUpsertOne) SetItemID

func (u *RecordUpsertOne) SetItemID(v int64) *RecordUpsertOne

SetItemID sets the "item_id" field.

func (*RecordUpsertOne) SetMetadata

func (u *RecordUpsertOne) SetMetadata(v string) *RecordUpsertOne

SetMetadata sets the "metadata" field.

func (*RecordUpsertOne) SetMetadataFormatID

func (u *RecordUpsertOne) SetMetadataFormatID(v int64) *RecordUpsertOne

SetMetadataFormatID sets the "metadata_format_id" field.

func (*RecordUpsertOne) Update

func (u *RecordUpsertOne) Update(set func(*RecordUpsert)) *RecordUpsertOne

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

func (*RecordUpsertOne) UpdateDatestamp

func (u *RecordUpsertOne) UpdateDatestamp() *RecordUpsertOne

UpdateDatestamp sets the "datestamp" field to the value that was provided on create.

func (*RecordUpsertOne) UpdateItemID

func (u *RecordUpsertOne) UpdateItemID() *RecordUpsertOne

UpdateItemID sets the "item_id" field to the value that was provided on create.

func (*RecordUpsertOne) UpdateMetadata

func (u *RecordUpsertOne) UpdateMetadata() *RecordUpsertOne

UpdateMetadata sets the "metadata" field to the value that was provided on create.

func (*RecordUpsertOne) UpdateMetadataFormatID

func (u *RecordUpsertOne) UpdateMetadataFormatID() *RecordUpsertOne

UpdateMetadataFormatID sets the "metadata_format_id" field to the value that was provided on create.

func (*RecordUpsertOne) UpdateNewValues

func (u *RecordUpsertOne) UpdateNewValues() *RecordUpsertOne

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.Record.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(record.FieldID)
		}),
	).
	Exec(ctx)

type Records

type Records []*Record

Records is a parsable slice of Record.

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 Set

type Set struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Spec holds the value of the "spec" field.
	Spec string `json:"spec,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,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) QueryItems

func (s *Set) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Set entity.

func (*Set) String

func (s *Set) String() string

String implements the fmt.Stringer.

func (*Set) Unwrap

func (s *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 (s *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 (s *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(s *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) 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) QueryItems

func (c *SetClient) QueryItems(s *Set) *ItemQuery

QueryItems queries the items 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(s *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) AddItemIDs

func (sc *SetCreate) AddItemIDs(ids ...int64) *SetCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*SetCreate) AddItems

func (sc *SetCreate) AddItems(i ...*Item) *SetCreate

AddItems adds the "items" edges to the Item entity.

func (*SetCreate) Exec

func (sc *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 (sc *SetCreate) ExecX(ctx context.Context)

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

func (*SetCreate) Mutation

func (sc *SetCreate) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetCreate) OnConflict

func (sc *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().
	SetSpec(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) {
		SetSpec(v+v).
	}).
	Exec(ctx)

func (*SetCreate) OnConflictColumns

func (sc *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 (sc *SetCreate) Save(ctx context.Context) (*Set, error)

Save creates the Set in the database.

func (*SetCreate) SaveX

func (sc *SetCreate) SaveX(ctx context.Context) *Set

SaveX calls Save and panics if Save returns an error.

func (*SetCreate) SetDescription

func (sc *SetCreate) SetDescription(s string) *SetCreate

SetDescription sets the "description" field.

func (*SetCreate) SetID

func (sc *SetCreate) SetID(i int64) *SetCreate

SetID sets the "id" field.

func (*SetCreate) SetName

func (sc *SetCreate) SetName(s string) *SetCreate

SetName sets the "name" field.

func (*SetCreate) SetNillableDescription

func (sc *SetCreate) SetNillableDescription(s *string) *SetCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SetCreate) SetSpec

func (sc *SetCreate) SetSpec(s string) *SetCreate

SetSpec sets the "spec" 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 (scb *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 (scb *SetCreateBulk) ExecX(ctx context.Context)

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

func (*SetCreateBulk) OnConflict

func (scb *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) {
		SetSpec(v+v).
	}).
	Exec(ctx)

func (*SetCreateBulk) OnConflictColumns

func (scb *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 (scb *SetCreateBulk) Save(ctx context.Context) ([]*Set, error)

Save creates the Set entities in the database.

func (*SetCreateBulk) SaveX

func (scb *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 (sd *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 (sd *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 (sd *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 (sdo *SetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SetDeleteOne) ExecX

func (sdo *SetDeleteOne) ExecX(ctx context.Context)

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

func (*SetDeleteOne) Where

func (sdo *SetDeleteOne) Where(ps ...predicate.Set) *SetDeleteOne

Where appends a list predicates to the SetDelete builder.

type SetEdges

type SetEdges struct {
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// contains filtered or unexported fields
}

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

func (SetEdges) ItemsOrErr

func (e SetEdges) ItemsOrErr() ([]*Item, error)

ItemsOrErr returns the Items 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 (sgb *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 (sgb *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) 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) AddItemIDs

func (m *SetMutation) AddItemIDs(ids ...int64)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*SetMutation) AddedEdges

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

AddedEdges returns all edge names that were set/added 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) ClearDescription

func (m *SetMutation) ClearDescription()

ClearDescription clears the value of the "description" 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) 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) ClearItems

func (m *SetMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

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

func (m *SetMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*SetMutation) DescriptionCleared

func (m *SetMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" 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) 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) 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) ItemsCleared

func (m *SetMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*SetMutation) ItemsIDs

func (m *SetMutation) ItemsIDs() (ids []int64)

ItemsIDs returns the "items" edge IDs in the 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) OldDescription

func (m *SetMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" 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) 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) OldSpec

func (m *SetMutation) OldSpec(ctx context.Context) (v string, err error)

OldSpec returns the old "spec" 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) 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) RemoveItemIDs

func (m *SetMutation) RemoveItemIDs(ids ...int64)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*SetMutation) RemovedEdges

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

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

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

func (m *SetMutation) RemovedItemsIDs() (ids []int64)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*SetMutation) ResetDescription

func (m *SetMutation) ResetDescription()

ResetDescription resets all changes to the "description" 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) 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) ResetItems

func (m *SetMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*SetMutation) ResetName

func (m *SetMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SetMutation) ResetSpec

func (m *SetMutation) ResetSpec()

ResetSpec resets all changes to the "spec" field.

func (*SetMutation) SetDescription

func (m *SetMutation) SetDescription(s string)

SetDescription sets the "description" 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) 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) SetSpec

func (m *SetMutation) SetSpec(s string)

SetSpec sets the "spec" field.

func (*SetMutation) Spec

func (m *SetMutation) Spec() (r string, exists bool)

Spec returns the value of the "spec" field 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) 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 (sq *SetQuery) Aggregate(fns ...AggregateFunc) *SetSelect

Aggregate returns a SetSelect configured with the given aggregations.

func (*SetQuery) All

func (sq *SetQuery) All(ctx context.Context) ([]*Set, error)

All executes the query and returns a list of Sets.

func (*SetQuery) AllX

func (sq *SetQuery) AllX(ctx context.Context) []*Set

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

func (*SetQuery) Clone

func (sq *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 (sq *SetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SetQuery) CountX

func (sq *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 (sq *SetQuery) Exist(ctx context.Context) (bool, error)

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

func (*SetQuery) ExistX

func (sq *SetQuery) ExistX(ctx context.Context) bool

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

func (*SetQuery) First

func (sq *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 (sq *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 (sq *SetQuery) FirstIDX(ctx context.Context) int64

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

func (*SetQuery) FirstX

func (sq *SetQuery) FirstX(ctx context.Context) *Set

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

func (*SetQuery) GroupBy

func (sq *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 {
	Spec string `json:"spec,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Set.Query().
	GroupBy(set.FieldSpec).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SetQuery) IDs

func (sq *SetQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*SetQuery) IDsX

func (sq *SetQuery) IDsX(ctx context.Context) []int64

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

func (*SetQuery) Limit

func (sq *SetQuery) Limit(limit int) *SetQuery

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

func (*SetQuery) Offset

func (sq *SetQuery) Offset(offset int) *SetQuery

Offset to start from.

func (*SetQuery) Only

func (sq *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 (sq *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 (sq *SetQuery) OnlyIDX(ctx context.Context) int64

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

func (*SetQuery) OnlyX

func (sq *SetQuery) OnlyX(ctx context.Context) *Set

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

func (*SetQuery) Order

func (sq *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) QueryItems

func (sq *SetQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*SetQuery) Select

func (sq *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 {
	Spec string `json:"spec,omitempty"`
}

client.Set.Query().
	Select(set.FieldSpec).
	Scan(ctx, &v)

func (*SetQuery) Unique

func (sq *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 (sq *SetQuery) Where(ps ...predicate.Set) *SetQuery

Where adds a new predicate for the SetQuery builder.

func (*SetQuery) WithItems

func (sq *SetQuery) WithItems(opts ...func(*ItemQuery)) *SetQuery

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

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 (ss *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 (ss *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) AddItemIDs

func (su *SetUpdate) AddItemIDs(ids ...int64) *SetUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*SetUpdate) AddItems

func (su *SetUpdate) AddItems(i ...*Item) *SetUpdate

AddItems adds the "items" edges to the Item entity.

func (*SetUpdate) ClearDescription

func (su *SetUpdate) ClearDescription() *SetUpdate

ClearDescription clears the value of the "description" field.

func (*SetUpdate) ClearItems

func (su *SetUpdate) ClearItems() *SetUpdate

ClearItems clears all "items" edges to the Item entity.

func (*SetUpdate) Exec

func (su *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 (su *SetUpdate) ExecX(ctx context.Context)

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

func (*SetUpdate) Mutation

func (su *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) RemoveItemIDs

func (su *SetUpdate) RemoveItemIDs(ids ...int64) *SetUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*SetUpdate) RemoveItems

func (su *SetUpdate) RemoveItems(i ...*Item) *SetUpdate

RemoveItems removes "items" edges to Item entities.

func (*SetUpdate) Save

func (su *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 (su *SetUpdate) SaveX(ctx context.Context) int

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

func (*SetUpdate) SetDescription

func (su *SetUpdate) SetDescription(s string) *SetUpdate

SetDescription sets the "description" field.

func (*SetUpdate) SetName

func (su *SetUpdate) SetName(s string) *SetUpdate

SetName sets the "name" field.

func (*SetUpdate) SetNillableDescription

func (su *SetUpdate) SetNillableDescription(s *string) *SetUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SetUpdate) SetSpec

func (su *SetUpdate) SetSpec(s string) *SetUpdate

SetSpec sets the "spec" field.

func (*SetUpdate) Where

func (su *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) AddItemIDs

func (suo *SetUpdateOne) AddItemIDs(ids ...int64) *SetUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*SetUpdateOne) AddItems

func (suo *SetUpdateOne) AddItems(i ...*Item) *SetUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*SetUpdateOne) ClearDescription

func (suo *SetUpdateOne) ClearDescription() *SetUpdateOne

ClearDescription clears the value of the "description" field.

func (*SetUpdateOne) ClearItems

func (suo *SetUpdateOne) ClearItems() *SetUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*SetUpdateOne) Exec

func (suo *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 (suo *SetUpdateOne) ExecX(ctx context.Context)

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

func (*SetUpdateOne) Mutation

func (suo *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) RemoveItemIDs

func (suo *SetUpdateOne) RemoveItemIDs(ids ...int64) *SetUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*SetUpdateOne) RemoveItems

func (suo *SetUpdateOne) RemoveItems(i ...*Item) *SetUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*SetUpdateOne) Save

func (suo *SetUpdateOne) Save(ctx context.Context) (*Set, error)

Save executes the query and returns the updated Set entity.

func (*SetUpdateOne) SaveX

func (suo *SetUpdateOne) SaveX(ctx context.Context) *Set

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

func (*SetUpdateOne) Select

func (suo *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) SetDescription

func (suo *SetUpdateOne) SetDescription(s string) *SetUpdateOne

SetDescription sets the "description" field.

func (*SetUpdateOne) SetName

func (suo *SetUpdateOne) SetName(s string) *SetUpdateOne

SetName sets the "name" field.

func (*SetUpdateOne) SetNillableDescription

func (suo *SetUpdateOne) SetNillableDescription(s *string) *SetUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*SetUpdateOne) SetSpec

func (suo *SetUpdateOne) SetSpec(s string) *SetUpdateOne

SetSpec sets the "spec" field.

func (*SetUpdateOne) Where

func (suo *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) ClearDescription

func (u *SetUpsert) ClearDescription() *SetUpsert

ClearDescription clears the value of the "description" field.

func (*SetUpsert) SetDescription

func (u *SetUpsert) SetDescription(v string) *SetUpsert

SetDescription sets the "description" field.

func (*SetUpsert) SetName

func (u *SetUpsert) SetName(v string) *SetUpsert

SetName sets the "name" field.

func (*SetUpsert) SetSpec

func (u *SetUpsert) SetSpec(v string) *SetUpsert

SetSpec sets the "spec" field.

func (*SetUpsert) UpdateDescription

func (u *SetUpsert) UpdateDescription() *SetUpsert

UpdateDescription sets the "description" 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) UpdateSpec

func (u *SetUpsert) UpdateSpec() *SetUpsert

UpdateSpec sets the "spec" 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) ClearDescription

func (u *SetUpsertBulk) ClearDescription() *SetUpsertBulk

ClearDescription clears the value of the "description" 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) SetDescription

func (u *SetUpsertBulk) SetDescription(v string) *SetUpsertBulk

SetDescription sets the "description" field.

func (*SetUpsertBulk) SetName

func (u *SetUpsertBulk) SetName(v string) *SetUpsertBulk

SetName sets the "name" field.

func (*SetUpsertBulk) SetSpec

func (u *SetUpsertBulk) SetSpec(v string) *SetUpsertBulk

SetSpec sets the "spec" 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) UpdateDescription

func (u *SetUpsertBulk) UpdateDescription() *SetUpsertBulk

UpdateDescription sets the "description" 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) UpdateSpec

func (u *SetUpsertBulk) UpdateSpec() *SetUpsertBulk

UpdateSpec sets the "spec" 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) ClearDescription

func (u *SetUpsertOne) ClearDescription() *SetUpsertOne

ClearDescription clears the value of the "description" 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) SetDescription

func (u *SetUpsertOne) SetDescription(v string) *SetUpsertOne

SetDescription sets the "description" field.

func (*SetUpsertOne) SetName

func (u *SetUpsertOne) SetName(v string) *SetUpsertOne

SetName sets the "name" field.

func (*SetUpsertOne) SetSpec

func (u *SetUpsertOne) SetSpec(v string) *SetUpsertOne

SetSpec sets the "spec" 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) UpdateDescription

func (u *SetUpsertOne) UpdateDescription() *SetUpsertOne

UpdateDescription sets the "description" 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) UpdateSpec

func (u *SetUpsertOne) UpdateSpec() *SetUpsertOne

UpdateSpec sets the "spec" field to the value that was provided on create.

type Sets

type Sets []*Set

Sets is a parsable slice of Set.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// MetadataFormat is the client for interacting with the MetadataFormat builders.
	MetadataFormat *MetadataFormatClient
	// Record is the client for interacting with the Record builders.
	Record *RecordClient
	// Set is the client for interacting with the Set builders.
	Set *SetClient
	// 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL