gen

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 19 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.
	TypeFuncEdge = "FuncEdge"
	TypeFuncNode = "FuncNode"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(gen.As(gen.Sum(field1), "sum_field1"), (gen.As(gen.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
	// FuncEdge is the client for interacting with the FuncEdge builders.
	FuncEdge *FuncEdgeClient
	// FuncNode is the client for interacting with the FuncNode builders.
	FuncNode *FuncNodeClient
	// 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().
	FuncEdge.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type FuncEdge

type FuncEdge struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "CreatedAt" field.
	CreatedAt time.Time `json:"CreatedAt,omitempty"`
	// UpdatedAt holds the value of the "UpdatedAt" field.
	UpdatedAt time.Time `json:"UpdatedAt,omitempty"`
	// CallerKey holds the value of the "CallerKey" field.
	CallerKey string `json:"CallerKey,omitempty"`
	// CalleeKey holds the value of the "CalleeKey" field.
	CalleeKey string `json:"CalleeKey,omitempty"`
	// contains filtered or unexported fields
}

FuncEdge is the model entity for the FuncEdge schema.

func (*FuncEdge) String

func (fe *FuncEdge) String() string

String implements the fmt.Stringer.

func (*FuncEdge) Unwrap

func (fe *FuncEdge) Unwrap() *FuncEdge

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

func (fe *FuncEdge) Update() *FuncEdgeUpdateOne

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

func (*FuncEdge) Value

func (fe *FuncEdge) Value(name string) (ent.Value, error)

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

type FuncEdgeClient

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

FuncEdgeClient is a client for the FuncEdge schema.

func NewFuncEdgeClient

func NewFuncEdgeClient(c config) *FuncEdgeClient

NewFuncEdgeClient returns a client for the FuncEdge from the given config.

func (*FuncEdgeClient) Create

func (c *FuncEdgeClient) Create() *FuncEdgeCreate

Create returns a builder for creating a FuncEdge entity.

func (*FuncEdgeClient) CreateBulk

func (c *FuncEdgeClient) CreateBulk(builders ...*FuncEdgeCreate) *FuncEdgeCreateBulk

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

func (*FuncEdgeClient) Delete

func (c *FuncEdgeClient) Delete() *FuncEdgeDelete

Delete returns a delete builder for FuncEdge.

func (*FuncEdgeClient) DeleteOne

func (c *FuncEdgeClient) DeleteOne(fe *FuncEdge) *FuncEdgeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FuncEdgeClient) DeleteOneID

func (c *FuncEdgeClient) DeleteOneID(id int) *FuncEdgeDeleteOne

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

func (*FuncEdgeClient) Get

func (c *FuncEdgeClient) Get(ctx context.Context, id int) (*FuncEdge, error)

Get returns a FuncEdge entity by its id.

func (*FuncEdgeClient) GetX

func (c *FuncEdgeClient) GetX(ctx context.Context, id int) *FuncEdge

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

func (*FuncEdgeClient) Hooks

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

Hooks returns the client hooks.

func (*FuncEdgeClient) Intercept

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

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

func (*FuncEdgeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FuncEdgeClient) MapCreateBulk

func (c *FuncEdgeClient) MapCreateBulk(slice any, setFunc func(*FuncEdgeCreate, int)) *FuncEdgeCreateBulk

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

func (*FuncEdgeClient) Query

func (c *FuncEdgeClient) Query() *FuncEdgeQuery

Query returns a query builder for FuncEdge.

func (*FuncEdgeClient) Update

func (c *FuncEdgeClient) Update() *FuncEdgeUpdate

Update returns an update builder for FuncEdge.

func (*FuncEdgeClient) UpdateOne

func (c *FuncEdgeClient) UpdateOne(fe *FuncEdge) *FuncEdgeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FuncEdgeClient) UpdateOneID

func (c *FuncEdgeClient) UpdateOneID(id int) *FuncEdgeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FuncEdgeClient) Use

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

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

type FuncEdgeCreate

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

FuncEdgeCreate is the builder for creating a FuncEdge entity.

func (*FuncEdgeCreate) Exec

func (fec *FuncEdgeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncEdgeCreate) ExecX

func (fec *FuncEdgeCreate) ExecX(ctx context.Context)

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

func (*FuncEdgeCreate) Mutation

func (fec *FuncEdgeCreate) Mutation() *FuncEdgeMutation

Mutation returns the FuncEdgeMutation object of the builder.

func (*FuncEdgeCreate) Save

func (fec *FuncEdgeCreate) Save(ctx context.Context) (*FuncEdge, error)

Save creates the FuncEdge in the database.

func (*FuncEdgeCreate) SaveX

func (fec *FuncEdgeCreate) SaveX(ctx context.Context) *FuncEdge

SaveX calls Save and panics if Save returns an error.

func (*FuncEdgeCreate) SetCalleeKey

func (fec *FuncEdgeCreate) SetCalleeKey(s string) *FuncEdgeCreate

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeCreate) SetCallerKey

func (fec *FuncEdgeCreate) SetCallerKey(s string) *FuncEdgeCreate

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeCreate) SetCreatedAt

func (fec *FuncEdgeCreate) SetCreatedAt(t time.Time) *FuncEdgeCreate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeCreate) SetUpdatedAt

func (fec *FuncEdgeCreate) SetUpdatedAt(t time.Time) *FuncEdgeCreate

SetUpdatedAt sets the "UpdatedAt" field.

type FuncEdgeCreateBulk

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

FuncEdgeCreateBulk is the builder for creating many FuncEdge entities in bulk.

func (*FuncEdgeCreateBulk) Exec

func (fecb *FuncEdgeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncEdgeCreateBulk) ExecX

func (fecb *FuncEdgeCreateBulk) ExecX(ctx context.Context)

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

func (*FuncEdgeCreateBulk) Save

func (fecb *FuncEdgeCreateBulk) Save(ctx context.Context) ([]*FuncEdge, error)

Save creates the FuncEdge entities in the database.

func (*FuncEdgeCreateBulk) SaveX

func (fecb *FuncEdgeCreateBulk) SaveX(ctx context.Context) []*FuncEdge

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

type FuncEdgeDelete

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

FuncEdgeDelete is the builder for deleting a FuncEdge entity.

func (*FuncEdgeDelete) Exec

func (fed *FuncEdgeDelete) Exec(ctx context.Context) (int, error)

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

func (*FuncEdgeDelete) ExecX

func (fed *FuncEdgeDelete) ExecX(ctx context.Context) int

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

func (*FuncEdgeDelete) Where

func (fed *FuncEdgeDelete) Where(ps ...predicate.FuncEdge) *FuncEdgeDelete

Where appends a list predicates to the FuncEdgeDelete builder.

type FuncEdgeDeleteOne

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

FuncEdgeDeleteOne is the builder for deleting a single FuncEdge entity.

func (*FuncEdgeDeleteOne) Exec

func (fedo *FuncEdgeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FuncEdgeDeleteOne) ExecX

func (fedo *FuncEdgeDeleteOne) ExecX(ctx context.Context)

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

func (*FuncEdgeDeleteOne) Where

Where appends a list predicates to the FuncEdgeDelete builder.

type FuncEdgeGroupBy

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

FuncEdgeGroupBy is the group-by builder for FuncEdge entities.

func (*FuncEdgeGroupBy) Aggregate

func (fegb *FuncEdgeGroupBy) Aggregate(fns ...AggregateFunc) *FuncEdgeGroupBy

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

func (*FuncEdgeGroupBy) Bool

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

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

func (*FuncEdgeGroupBy) BoolX

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

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

func (*FuncEdgeGroupBy) Bools

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

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

func (*FuncEdgeGroupBy) BoolsX

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

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

func (*FuncEdgeGroupBy) Float64

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

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

func (*FuncEdgeGroupBy) Float64X

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

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

func (*FuncEdgeGroupBy) Float64s

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

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

func (*FuncEdgeGroupBy) Float64sX

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

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

func (*FuncEdgeGroupBy) Int

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

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

func (*FuncEdgeGroupBy) IntX

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

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

func (*FuncEdgeGroupBy) Ints

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

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

func (*FuncEdgeGroupBy) IntsX

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

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

func (*FuncEdgeGroupBy) Scan

func (fegb *FuncEdgeGroupBy) Scan(ctx context.Context, v any) error

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

func (*FuncEdgeGroupBy) ScanX

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

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

func (*FuncEdgeGroupBy) String

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

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

func (*FuncEdgeGroupBy) StringX

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

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

func (*FuncEdgeGroupBy) Strings

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

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

func (*FuncEdgeGroupBy) StringsX

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

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

type FuncEdgeMutation

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

FuncEdgeMutation represents an operation that mutates the FuncEdge nodes in the graph.

func (*FuncEdgeMutation) AddField

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) AddedEdges

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

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

func (*FuncEdgeMutation) AddedField

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

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

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

func (*FuncEdgeMutation) AddedIDs

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

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

func (*FuncEdgeMutation) CalleeKey

func (m *FuncEdgeMutation) CalleeKey() (r string, exists bool)

CalleeKey returns the value of the "CalleeKey" field in the mutation.

func (*FuncEdgeMutation) CallerKey

func (m *FuncEdgeMutation) CallerKey() (r string, exists bool)

CallerKey returns the value of the "CallerKey" field in the mutation.

func (*FuncEdgeMutation) ClearEdge

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

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ClearedEdges

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

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

func (*FuncEdgeMutation) ClearedFields

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

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

func (FuncEdgeMutation) Client

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

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

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

func (*FuncEdgeMutation) EdgeCleared

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

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

func (*FuncEdgeMutation) Field

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

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

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

func (*FuncEdgeMutation) Fields

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

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

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

func (*FuncEdgeMutation) IDs

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

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

func (*FuncEdgeMutation) OldCalleeKey

func (m *FuncEdgeMutation) OldCalleeKey(ctx context.Context) (v string, err error)

OldCalleeKey returns the old "CalleeKey" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCallerKey

func (m *FuncEdgeMutation) OldCallerKey(ctx context.Context) (v string, err error)

OldCallerKey returns the old "CallerKey" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCreatedAt

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

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

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) OldUpdatedAt

func (m *FuncEdgeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "UpdatedAt" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) Op

func (m *FuncEdgeMutation) Op() Op

Op returns the operation name.

func (*FuncEdgeMutation) RemovedEdges

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

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

func (*FuncEdgeMutation) RemovedIDs

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetCalleeKey

func (m *FuncEdgeMutation) ResetCalleeKey()

ResetCalleeKey resets all changes to the "CalleeKey" field.

func (*FuncEdgeMutation) ResetCallerKey

func (m *FuncEdgeMutation) ResetCallerKey()

ResetCallerKey resets all changes to the "CallerKey" field.

func (*FuncEdgeMutation) ResetCreatedAt

func (m *FuncEdgeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "CreatedAt" field.

func (*FuncEdgeMutation) ResetEdge

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

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetUpdatedAt

func (m *FuncEdgeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "UpdatedAt" field.

func (*FuncEdgeMutation) SetCalleeKey

func (m *FuncEdgeMutation) SetCalleeKey(s string)

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeMutation) SetCallerKey

func (m *FuncEdgeMutation) SetCallerKey(s string)

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeMutation) SetCreatedAt

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

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeMutation) SetField

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

func (m *FuncEdgeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FuncEdgeMutation) SetUpdatedAt

func (m *FuncEdgeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "UpdatedAt" field.

func (FuncEdgeMutation) Tx

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

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

func (*FuncEdgeMutation) Type

func (m *FuncEdgeMutation) Type() string

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

func (*FuncEdgeMutation) UpdatedAt

func (m *FuncEdgeMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "UpdatedAt" field in the mutation.

func (*FuncEdgeMutation) Where

func (m *FuncEdgeMutation) Where(ps ...predicate.FuncEdge)

Where appends a list predicates to the FuncEdgeMutation builder.

func (*FuncEdgeMutation) WhereP

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

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

type FuncEdgeQuery

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

FuncEdgeQuery is the builder for querying FuncEdge entities.

func (*FuncEdgeQuery) Aggregate

func (feq *FuncEdgeQuery) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect

Aggregate returns a FuncEdgeSelect configured with the given aggregations.

func (*FuncEdgeQuery) All

func (feq *FuncEdgeQuery) All(ctx context.Context) ([]*FuncEdge, error)

All executes the query and returns a list of FuncEdges.

func (*FuncEdgeQuery) AllX

func (feq *FuncEdgeQuery) AllX(ctx context.Context) []*FuncEdge

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

func (*FuncEdgeQuery) Clone

func (feq *FuncEdgeQuery) Clone() *FuncEdgeQuery

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

func (*FuncEdgeQuery) Count

func (feq *FuncEdgeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FuncEdgeQuery) CountX

func (feq *FuncEdgeQuery) CountX(ctx context.Context) int

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

func (*FuncEdgeQuery) Exist

func (feq *FuncEdgeQuery) Exist(ctx context.Context) (bool, error)

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

func (*FuncEdgeQuery) ExistX

func (feq *FuncEdgeQuery) ExistX(ctx context.Context) bool

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

func (*FuncEdgeQuery) First

func (feq *FuncEdgeQuery) First(ctx context.Context) (*FuncEdge, error)

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

func (*FuncEdgeQuery) FirstID

func (feq *FuncEdgeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FuncEdgeQuery) FirstIDX

func (feq *FuncEdgeQuery) FirstIDX(ctx context.Context) int

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

func (*FuncEdgeQuery) FirstX

func (feq *FuncEdgeQuery) FirstX(ctx context.Context) *FuncEdge

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

func (*FuncEdgeQuery) GroupBy

func (feq *FuncEdgeQuery) GroupBy(field string, fields ...string) *FuncEdgeGroupBy

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 {
	CreatedAt time.Time `json:"CreatedAt,omitempty"`
	Count int `json:"count,omitempty"`
}

client.FuncEdge.Query().
	GroupBy(funcedge.FieldCreatedAt).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*FuncEdgeQuery) IDs

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

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

func (*FuncEdgeQuery) IDsX

func (feq *FuncEdgeQuery) IDsX(ctx context.Context) []int

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

func (*FuncEdgeQuery) Limit

func (feq *FuncEdgeQuery) Limit(limit int) *FuncEdgeQuery

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

func (*FuncEdgeQuery) Offset

func (feq *FuncEdgeQuery) Offset(offset int) *FuncEdgeQuery

Offset to start from.

func (*FuncEdgeQuery) Only

func (feq *FuncEdgeQuery) Only(ctx context.Context) (*FuncEdge, error)

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

func (*FuncEdgeQuery) OnlyID

func (feq *FuncEdgeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FuncEdgeQuery) OnlyIDX

func (feq *FuncEdgeQuery) OnlyIDX(ctx context.Context) int

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

func (*FuncEdgeQuery) OnlyX

func (feq *FuncEdgeQuery) OnlyX(ctx context.Context) *FuncEdge

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

func (*FuncEdgeQuery) Order

func (feq *FuncEdgeQuery) Order(o ...funcedge.OrderOption) *FuncEdgeQuery

Order specifies how the records should be ordered.

func (*FuncEdgeQuery) Select

func (feq *FuncEdgeQuery) Select(fields ...string) *FuncEdgeSelect

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 {
	CreatedAt time.Time `json:"CreatedAt,omitempty"`
}

client.FuncEdge.Query().
	Select(funcedge.FieldCreatedAt).
	Scan(ctx, &v)

func (*FuncEdgeQuery) Unique

func (feq *FuncEdgeQuery) Unique(unique bool) *FuncEdgeQuery

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

func (feq *FuncEdgeQuery) Where(ps ...predicate.FuncEdge) *FuncEdgeQuery

Where adds a new predicate for the FuncEdgeQuery builder.

type FuncEdgeSelect

type FuncEdgeSelect struct {
	*FuncEdgeQuery
	// contains filtered or unexported fields
}

FuncEdgeSelect is the builder for selecting fields of FuncEdge entities.

func (*FuncEdgeSelect) Aggregate

func (fes *FuncEdgeSelect) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FuncEdgeSelect) Bool

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

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

func (*FuncEdgeSelect) BoolX

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

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

func (*FuncEdgeSelect) Bools

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

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

func (*FuncEdgeSelect) BoolsX

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

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

func (*FuncEdgeSelect) Float64

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

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

func (*FuncEdgeSelect) Float64X

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

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

func (*FuncEdgeSelect) Float64s

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

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

func (*FuncEdgeSelect) Float64sX

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

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

func (*FuncEdgeSelect) Int

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

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

func (*FuncEdgeSelect) IntX

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

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

func (*FuncEdgeSelect) Ints

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

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

func (*FuncEdgeSelect) IntsX

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

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

func (*FuncEdgeSelect) Scan

func (fes *FuncEdgeSelect) Scan(ctx context.Context, v any) error

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

func (*FuncEdgeSelect) ScanX

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

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

func (*FuncEdgeSelect) String

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

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

func (*FuncEdgeSelect) StringX

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

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

func (*FuncEdgeSelect) Strings

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

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

func (*FuncEdgeSelect) StringsX

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

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

type FuncEdgeUpdate

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

FuncEdgeUpdate is the builder for updating FuncEdge entities.

func (*FuncEdgeUpdate) Exec

func (feu *FuncEdgeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncEdgeUpdate) ExecX

func (feu *FuncEdgeUpdate) ExecX(ctx context.Context)

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

func (*FuncEdgeUpdate) Mutation

func (feu *FuncEdgeUpdate) Mutation() *FuncEdgeMutation

Mutation returns the FuncEdgeMutation object of the builder.

func (*FuncEdgeUpdate) Save

func (feu *FuncEdgeUpdate) Save(ctx context.Context) (int, error)

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

func (*FuncEdgeUpdate) SaveX

func (feu *FuncEdgeUpdate) SaveX(ctx context.Context) int

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

func (*FuncEdgeUpdate) SetCalleeKey

func (feu *FuncEdgeUpdate) SetCalleeKey(s string) *FuncEdgeUpdate

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeUpdate) SetCallerKey

func (feu *FuncEdgeUpdate) SetCallerKey(s string) *FuncEdgeUpdate

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeUpdate) SetCreatedAt

func (feu *FuncEdgeUpdate) SetCreatedAt(t time.Time) *FuncEdgeUpdate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeUpdate) SetNillableCalleeKey

func (feu *FuncEdgeUpdate) SetNillableCalleeKey(s *string) *FuncEdgeUpdate

SetNillableCalleeKey sets the "CalleeKey" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCallerKey

func (feu *FuncEdgeUpdate) SetNillableCallerKey(s *string) *FuncEdgeUpdate

SetNillableCallerKey sets the "CallerKey" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCreatedAt

func (feu *FuncEdgeUpdate) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdate

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

func (*FuncEdgeUpdate) SetNillableUpdatedAt

func (feu *FuncEdgeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdate

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncEdgeUpdate) SetUpdatedAt

func (feu *FuncEdgeUpdate) SetUpdatedAt(t time.Time) *FuncEdgeUpdate

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncEdgeUpdate) Where

func (feu *FuncEdgeUpdate) Where(ps ...predicate.FuncEdge) *FuncEdgeUpdate

Where appends a list predicates to the FuncEdgeUpdate builder.

type FuncEdgeUpdateOne

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

FuncEdgeUpdateOne is the builder for updating a single FuncEdge entity.

func (*FuncEdgeUpdateOne) Exec

func (feuo *FuncEdgeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FuncEdgeUpdateOne) ExecX

func (feuo *FuncEdgeUpdateOne) ExecX(ctx context.Context)

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

func (*FuncEdgeUpdateOne) Mutation

func (feuo *FuncEdgeUpdateOne) Mutation() *FuncEdgeMutation

Mutation returns the FuncEdgeMutation object of the builder.

func (*FuncEdgeUpdateOne) Save

func (feuo *FuncEdgeUpdateOne) Save(ctx context.Context) (*FuncEdge, error)

Save executes the query and returns the updated FuncEdge entity.

func (*FuncEdgeUpdateOne) SaveX

func (feuo *FuncEdgeUpdateOne) SaveX(ctx context.Context) *FuncEdge

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

func (*FuncEdgeUpdateOne) Select

func (feuo *FuncEdgeUpdateOne) Select(field string, fields ...string) *FuncEdgeUpdateOne

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

func (*FuncEdgeUpdateOne) SetCalleeKey

func (feuo *FuncEdgeUpdateOne) SetCalleeKey(s string) *FuncEdgeUpdateOne

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeUpdateOne) SetCallerKey

func (feuo *FuncEdgeUpdateOne) SetCallerKey(s string) *FuncEdgeUpdateOne

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeUpdateOne) SetCreatedAt

func (feuo *FuncEdgeUpdateOne) SetCreatedAt(t time.Time) *FuncEdgeUpdateOne

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeUpdateOne) SetNillableCalleeKey

func (feuo *FuncEdgeUpdateOne) SetNillableCalleeKey(s *string) *FuncEdgeUpdateOne

SetNillableCalleeKey sets the "CalleeKey" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCallerKey

func (feuo *FuncEdgeUpdateOne) SetNillableCallerKey(s *string) *FuncEdgeUpdateOne

SetNillableCallerKey sets the "CallerKey" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCreatedAt

func (feuo *FuncEdgeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdateOne

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

func (*FuncEdgeUpdateOne) SetNillableUpdatedAt

func (feuo *FuncEdgeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdateOne

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetUpdatedAt

func (feuo *FuncEdgeUpdateOne) SetUpdatedAt(t time.Time) *FuncEdgeUpdateOne

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncEdgeUpdateOne) Where

Where appends a list predicates to the FuncEdgeUpdate builder.

type FuncEdges

type FuncEdges []*FuncEdge

FuncEdges is a parsable slice of FuncEdge.

type FuncNode

type FuncNode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Pkg holds the value of the "pkg" field.
	Pkg string `json:"pkg,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// CreatedAt holds the value of the "CreatedAt" field.
	CreatedAt time.Time `json:"CreatedAt,omitempty"`
	// UpdatedAt holds the value of the "UpdatedAt" field.
	UpdatedAt time.Time `json:"UpdatedAt,omitempty"`
	// contains filtered or unexported fields
}

FuncNode is the model entity for the FuncNode schema.

func (*FuncNode) String

func (fn *FuncNode) String() string

String implements the fmt.Stringer.

func (*FuncNode) Unwrap

func (fn *FuncNode) Unwrap() *FuncNode

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

func (fn *FuncNode) Update() *FuncNodeUpdateOne

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

func (*FuncNode) Value

func (fn *FuncNode) Value(name string) (ent.Value, error)

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

type FuncNodeClient

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

FuncNodeClient is a client for the FuncNode schema.

func NewFuncNodeClient

func NewFuncNodeClient(c config) *FuncNodeClient

NewFuncNodeClient returns a client for the FuncNode from the given config.

func (*FuncNodeClient) Create

func (c *FuncNodeClient) Create() *FuncNodeCreate

Create returns a builder for creating a FuncNode entity.

func (*FuncNodeClient) CreateBulk

func (c *FuncNodeClient) CreateBulk(builders ...*FuncNodeCreate) *FuncNodeCreateBulk

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

func (*FuncNodeClient) Delete

func (c *FuncNodeClient) Delete() *FuncNodeDelete

Delete returns a delete builder for FuncNode.

func (*FuncNodeClient) DeleteOne

func (c *FuncNodeClient) DeleteOne(fn *FuncNode) *FuncNodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FuncNodeClient) DeleteOneID

func (c *FuncNodeClient) DeleteOneID(id int) *FuncNodeDeleteOne

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

func (*FuncNodeClient) Get

func (c *FuncNodeClient) Get(ctx context.Context, id int) (*FuncNode, error)

Get returns a FuncNode entity by its id.

func (*FuncNodeClient) GetX

func (c *FuncNodeClient) GetX(ctx context.Context, id int) *FuncNode

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

func (*FuncNodeClient) Hooks

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

Hooks returns the client hooks.

func (*FuncNodeClient) Intercept

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

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

func (*FuncNodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FuncNodeClient) MapCreateBulk

func (c *FuncNodeClient) MapCreateBulk(slice any, setFunc func(*FuncNodeCreate, int)) *FuncNodeCreateBulk

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

func (*FuncNodeClient) Query

func (c *FuncNodeClient) Query() *FuncNodeQuery

Query returns a query builder for FuncNode.

func (*FuncNodeClient) Update

func (c *FuncNodeClient) Update() *FuncNodeUpdate

Update returns an update builder for FuncNode.

func (*FuncNodeClient) UpdateOne

func (c *FuncNodeClient) UpdateOne(fn *FuncNode) *FuncNodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FuncNodeClient) UpdateOneID

func (c *FuncNodeClient) UpdateOneID(id int) *FuncNodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FuncNodeClient) Use

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

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

type FuncNodeCreate

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

FuncNodeCreate is the builder for creating a FuncNode entity.

func (*FuncNodeCreate) Exec

func (fnc *FuncNodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncNodeCreate) ExecX

func (fnc *FuncNodeCreate) ExecX(ctx context.Context)

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

func (*FuncNodeCreate) Mutation

func (fnc *FuncNodeCreate) Mutation() *FuncNodeMutation

Mutation returns the FuncNodeMutation object of the builder.

func (*FuncNodeCreate) Save

func (fnc *FuncNodeCreate) Save(ctx context.Context) (*FuncNode, error)

Save creates the FuncNode in the database.

func (*FuncNodeCreate) SaveX

func (fnc *FuncNodeCreate) SaveX(ctx context.Context) *FuncNode

SaveX calls Save and panics if Save returns an error.

func (*FuncNodeCreate) SetCreatedAt

func (fnc *FuncNodeCreate) SetCreatedAt(t time.Time) *FuncNodeCreate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeCreate) SetKey

func (fnc *FuncNodeCreate) SetKey(s string) *FuncNodeCreate

SetKey sets the "key" field.

func (*FuncNodeCreate) SetName

func (fnc *FuncNodeCreate) SetName(s string) *FuncNodeCreate

SetName sets the "name" field.

func (*FuncNodeCreate) SetNillableCreatedAt

func (fnc *FuncNodeCreate) SetNillableCreatedAt(t *time.Time) *FuncNodeCreate

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

func (*FuncNodeCreate) SetNillableUpdatedAt

func (fnc *FuncNodeCreate) SetNillableUpdatedAt(t *time.Time) *FuncNodeCreate

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncNodeCreate) SetPkg

func (fnc *FuncNodeCreate) SetPkg(s string) *FuncNodeCreate

SetPkg sets the "pkg" field.

func (*FuncNodeCreate) SetUpdatedAt

func (fnc *FuncNodeCreate) SetUpdatedAt(t time.Time) *FuncNodeCreate

SetUpdatedAt sets the "UpdatedAt" field.

type FuncNodeCreateBulk

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

FuncNodeCreateBulk is the builder for creating many FuncNode entities in bulk.

func (*FuncNodeCreateBulk) Exec

func (fncb *FuncNodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncNodeCreateBulk) ExecX

func (fncb *FuncNodeCreateBulk) ExecX(ctx context.Context)

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

func (*FuncNodeCreateBulk) Save

func (fncb *FuncNodeCreateBulk) Save(ctx context.Context) ([]*FuncNode, error)

Save creates the FuncNode entities in the database.

func (*FuncNodeCreateBulk) SaveX

func (fncb *FuncNodeCreateBulk) SaveX(ctx context.Context) []*FuncNode

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

type FuncNodeDelete

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

FuncNodeDelete is the builder for deleting a FuncNode entity.

func (*FuncNodeDelete) Exec

func (fnd *FuncNodeDelete) Exec(ctx context.Context) (int, error)

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

func (*FuncNodeDelete) ExecX

func (fnd *FuncNodeDelete) ExecX(ctx context.Context) int

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

func (*FuncNodeDelete) Where

func (fnd *FuncNodeDelete) Where(ps ...predicate.FuncNode) *FuncNodeDelete

Where appends a list predicates to the FuncNodeDelete builder.

type FuncNodeDeleteOne

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

FuncNodeDeleteOne is the builder for deleting a single FuncNode entity.

func (*FuncNodeDeleteOne) Exec

func (fndo *FuncNodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FuncNodeDeleteOne) ExecX

func (fndo *FuncNodeDeleteOne) ExecX(ctx context.Context)

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

func (*FuncNodeDeleteOne) Where

Where appends a list predicates to the FuncNodeDelete builder.

type FuncNodeGroupBy

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

FuncNodeGroupBy is the group-by builder for FuncNode entities.

func (*FuncNodeGroupBy) Aggregate

func (fngb *FuncNodeGroupBy) Aggregate(fns ...AggregateFunc) *FuncNodeGroupBy

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

func (*FuncNodeGroupBy) Bool

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

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

func (*FuncNodeGroupBy) BoolX

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

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

func (*FuncNodeGroupBy) Bools

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

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

func (*FuncNodeGroupBy) BoolsX

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

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

func (*FuncNodeGroupBy) Float64

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

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

func (*FuncNodeGroupBy) Float64X

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

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

func (*FuncNodeGroupBy) Float64s

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

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

func (*FuncNodeGroupBy) Float64sX

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

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

func (*FuncNodeGroupBy) Int

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

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

func (*FuncNodeGroupBy) IntX

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

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

func (*FuncNodeGroupBy) Ints

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

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

func (*FuncNodeGroupBy) IntsX

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

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

func (*FuncNodeGroupBy) Scan

func (fngb *FuncNodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*FuncNodeGroupBy) ScanX

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

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

func (*FuncNodeGroupBy) String

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

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

func (*FuncNodeGroupBy) StringX

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

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

func (*FuncNodeGroupBy) Strings

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

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

func (*FuncNodeGroupBy) StringsX

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

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

type FuncNodeMutation

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

FuncNodeMutation represents an operation that mutates the FuncNode nodes in the graph.

func (*FuncNodeMutation) AddField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) AddedEdges

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

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

func (*FuncNodeMutation) AddedField

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

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

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

func (*FuncNodeMutation) AddedIDs

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

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

func (*FuncNodeMutation) ClearEdge

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

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ClearedEdges

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

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

func (*FuncNodeMutation) ClearedFields

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

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

func (FuncNodeMutation) Client

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

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

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

func (*FuncNodeMutation) EdgeCleared

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

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

func (*FuncNodeMutation) Field

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

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

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

func (*FuncNodeMutation) Fields

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

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

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

func (*FuncNodeMutation) IDs

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

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

func (*FuncNodeMutation) Key

func (m *FuncNodeMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*FuncNodeMutation) Name

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

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

func (*FuncNodeMutation) OldCreatedAt

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

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

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) OldKey

func (m *FuncNodeMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldName

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

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

func (m *FuncNodeMutation) OldPkg(ctx context.Context) (v string, err error)

OldPkg returns the old "pkg" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldUpdatedAt

func (m *FuncNodeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "UpdatedAt" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) Op

func (m *FuncNodeMutation) Op() Op

Op returns the operation name.

func (*FuncNodeMutation) Pkg

func (m *FuncNodeMutation) Pkg() (r string, exists bool)

Pkg returns the value of the "pkg" field in the mutation.

func (*FuncNodeMutation) RemovedEdges

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

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

func (*FuncNodeMutation) RemovedIDs

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetCreatedAt

func (m *FuncNodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "CreatedAt" field.

func (*FuncNodeMutation) ResetEdge

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

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetKey

func (m *FuncNodeMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*FuncNodeMutation) ResetName

func (m *FuncNodeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FuncNodeMutation) ResetPkg

func (m *FuncNodeMutation) ResetPkg()

ResetPkg resets all changes to the "pkg" field.

func (*FuncNodeMutation) ResetUpdatedAt

func (m *FuncNodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "UpdatedAt" field.

func (*FuncNodeMutation) SetCreatedAt

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

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeMutation) SetField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) SetKey

func (m *FuncNodeMutation) SetKey(s string)

SetKey sets the "key" field.

func (*FuncNodeMutation) SetName

func (m *FuncNodeMutation) SetName(s string)

SetName sets the "name" field.

func (*FuncNodeMutation) SetOp

func (m *FuncNodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FuncNodeMutation) SetPkg

func (m *FuncNodeMutation) SetPkg(s string)

SetPkg sets the "pkg" field.

func (*FuncNodeMutation) SetUpdatedAt

func (m *FuncNodeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "UpdatedAt" field.

func (FuncNodeMutation) Tx

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

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

func (*FuncNodeMutation) Type

func (m *FuncNodeMutation) Type() string

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

func (*FuncNodeMutation) UpdatedAt

func (m *FuncNodeMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "UpdatedAt" field in the mutation.

func (*FuncNodeMutation) Where

func (m *FuncNodeMutation) Where(ps ...predicate.FuncNode)

Where appends a list predicates to the FuncNodeMutation builder.

func (*FuncNodeMutation) WhereP

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

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

type FuncNodeQuery

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

FuncNodeQuery is the builder for querying FuncNode entities.

func (*FuncNodeQuery) Aggregate

func (fnq *FuncNodeQuery) Aggregate(fns ...AggregateFunc) *FuncNodeSelect

Aggregate returns a FuncNodeSelect configured with the given aggregations.

func (*FuncNodeQuery) All

func (fnq *FuncNodeQuery) All(ctx context.Context) ([]*FuncNode, error)

All executes the query and returns a list of FuncNodes.

func (*FuncNodeQuery) AllX

func (fnq *FuncNodeQuery) AllX(ctx context.Context) []*FuncNode

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

func (*FuncNodeQuery) Clone

func (fnq *FuncNodeQuery) Clone() *FuncNodeQuery

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

func (*FuncNodeQuery) Count

func (fnq *FuncNodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FuncNodeQuery) CountX

func (fnq *FuncNodeQuery) CountX(ctx context.Context) int

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

func (*FuncNodeQuery) Exist

func (fnq *FuncNodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*FuncNodeQuery) ExistX

func (fnq *FuncNodeQuery) ExistX(ctx context.Context) bool

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

func (*FuncNodeQuery) First

func (fnq *FuncNodeQuery) First(ctx context.Context) (*FuncNode, error)

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

func (*FuncNodeQuery) FirstID

func (fnq *FuncNodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FuncNodeQuery) FirstIDX

func (fnq *FuncNodeQuery) FirstIDX(ctx context.Context) int

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

func (*FuncNodeQuery) FirstX

func (fnq *FuncNodeQuery) FirstX(ctx context.Context) *FuncNode

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

func (*FuncNodeQuery) GroupBy

func (fnq *FuncNodeQuery) GroupBy(field string, fields ...string) *FuncNodeGroupBy

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

client.FuncNode.Query().
	GroupBy(funcnode.FieldKey).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*FuncNodeQuery) IDs

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

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

func (*FuncNodeQuery) IDsX

func (fnq *FuncNodeQuery) IDsX(ctx context.Context) []int

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

func (*FuncNodeQuery) Limit

func (fnq *FuncNodeQuery) Limit(limit int) *FuncNodeQuery

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

func (*FuncNodeQuery) Offset

func (fnq *FuncNodeQuery) Offset(offset int) *FuncNodeQuery

Offset to start from.

func (*FuncNodeQuery) Only

func (fnq *FuncNodeQuery) Only(ctx context.Context) (*FuncNode, error)

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

func (*FuncNodeQuery) OnlyID

func (fnq *FuncNodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FuncNodeQuery) OnlyIDX

func (fnq *FuncNodeQuery) OnlyIDX(ctx context.Context) int

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

func (*FuncNodeQuery) OnlyX

func (fnq *FuncNodeQuery) OnlyX(ctx context.Context) *FuncNode

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

func (*FuncNodeQuery) Order

func (fnq *FuncNodeQuery) Order(o ...funcnode.OrderOption) *FuncNodeQuery

Order specifies how the records should be ordered.

func (*FuncNodeQuery) Select

func (fnq *FuncNodeQuery) Select(fields ...string) *FuncNodeSelect

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

client.FuncNode.Query().
	Select(funcnode.FieldKey).
	Scan(ctx, &v)

func (*FuncNodeQuery) Unique

func (fnq *FuncNodeQuery) Unique(unique bool) *FuncNodeQuery

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

func (fnq *FuncNodeQuery) Where(ps ...predicate.FuncNode) *FuncNodeQuery

Where adds a new predicate for the FuncNodeQuery builder.

type FuncNodeSelect

type FuncNodeSelect struct {
	*FuncNodeQuery
	// contains filtered or unexported fields
}

FuncNodeSelect is the builder for selecting fields of FuncNode entities.

func (*FuncNodeSelect) Aggregate

func (fns *FuncNodeSelect) Aggregate(agg ...AggregateFunc) *FuncNodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FuncNodeSelect) Bool

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

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

func (*FuncNodeSelect) BoolX

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

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

func (*FuncNodeSelect) Bools

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

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

func (*FuncNodeSelect) BoolsX

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

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

func (*FuncNodeSelect) Float64

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

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

func (*FuncNodeSelect) Float64X

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

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

func (*FuncNodeSelect) Float64s

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

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

func (*FuncNodeSelect) Float64sX

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

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

func (*FuncNodeSelect) Int

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

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

func (*FuncNodeSelect) IntX

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

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

func (*FuncNodeSelect) Ints

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

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

func (*FuncNodeSelect) IntsX

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

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

func (*FuncNodeSelect) Scan

func (fns *FuncNodeSelect) Scan(ctx context.Context, v any) error

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

func (*FuncNodeSelect) ScanX

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

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

func (*FuncNodeSelect) String

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

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

func (*FuncNodeSelect) StringX

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

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

func (*FuncNodeSelect) Strings

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

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

func (*FuncNodeSelect) StringsX

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

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

type FuncNodeUpdate

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

FuncNodeUpdate is the builder for updating FuncNode entities.

func (*FuncNodeUpdate) Exec

func (fnu *FuncNodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncNodeUpdate) ExecX

func (fnu *FuncNodeUpdate) ExecX(ctx context.Context)

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

func (*FuncNodeUpdate) Mutation

func (fnu *FuncNodeUpdate) Mutation() *FuncNodeMutation

Mutation returns the FuncNodeMutation object of the builder.

func (*FuncNodeUpdate) Save

func (fnu *FuncNodeUpdate) Save(ctx context.Context) (int, error)

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

func (*FuncNodeUpdate) SaveX

func (fnu *FuncNodeUpdate) SaveX(ctx context.Context) int

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

func (*FuncNodeUpdate) SetCreatedAt

func (fnu *FuncNodeUpdate) SetCreatedAt(t time.Time) *FuncNodeUpdate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeUpdate) SetKey

func (fnu *FuncNodeUpdate) SetKey(s string) *FuncNodeUpdate

SetKey sets the "key" field.

func (*FuncNodeUpdate) SetName

func (fnu *FuncNodeUpdate) SetName(s string) *FuncNodeUpdate

SetName sets the "name" field.

func (*FuncNodeUpdate) SetNillableCreatedAt

func (fnu *FuncNodeUpdate) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdate

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

func (*FuncNodeUpdate) SetNillableKey

func (fnu *FuncNodeUpdate) SetNillableKey(s *string) *FuncNodeUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableName

func (fnu *FuncNodeUpdate) SetNillableName(s *string) *FuncNodeUpdate

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

func (*FuncNodeUpdate) SetNillablePkg

func (fnu *FuncNodeUpdate) SetNillablePkg(s *string) *FuncNodeUpdate

SetNillablePkg sets the "pkg" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableUpdatedAt

func (fnu *FuncNodeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdate

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncNodeUpdate) SetPkg

func (fnu *FuncNodeUpdate) SetPkg(s string) *FuncNodeUpdate

SetPkg sets the "pkg" field.

func (*FuncNodeUpdate) SetUpdatedAt

func (fnu *FuncNodeUpdate) SetUpdatedAt(t time.Time) *FuncNodeUpdate

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncNodeUpdate) Where

func (fnu *FuncNodeUpdate) Where(ps ...predicate.FuncNode) *FuncNodeUpdate

Where appends a list predicates to the FuncNodeUpdate builder.

type FuncNodeUpdateOne

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

FuncNodeUpdateOne is the builder for updating a single FuncNode entity.

func (*FuncNodeUpdateOne) Exec

func (fnuo *FuncNodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FuncNodeUpdateOne) ExecX

func (fnuo *FuncNodeUpdateOne) ExecX(ctx context.Context)

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

func (*FuncNodeUpdateOne) Mutation

func (fnuo *FuncNodeUpdateOne) Mutation() *FuncNodeMutation

Mutation returns the FuncNodeMutation object of the builder.

func (*FuncNodeUpdateOne) Save

func (fnuo *FuncNodeUpdateOne) Save(ctx context.Context) (*FuncNode, error)

Save executes the query and returns the updated FuncNode entity.

func (*FuncNodeUpdateOne) SaveX

func (fnuo *FuncNodeUpdateOne) SaveX(ctx context.Context) *FuncNode

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

func (*FuncNodeUpdateOne) Select

func (fnuo *FuncNodeUpdateOne) Select(field string, fields ...string) *FuncNodeUpdateOne

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

func (*FuncNodeUpdateOne) SetCreatedAt

func (fnuo *FuncNodeUpdateOne) SetCreatedAt(t time.Time) *FuncNodeUpdateOne

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeUpdateOne) SetKey

func (fnuo *FuncNodeUpdateOne) SetKey(s string) *FuncNodeUpdateOne

SetKey sets the "key" field.

func (*FuncNodeUpdateOne) SetName

func (fnuo *FuncNodeUpdateOne) SetName(s string) *FuncNodeUpdateOne

SetName sets the "name" field.

func (*FuncNodeUpdateOne) SetNillableCreatedAt

func (fnuo *FuncNodeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdateOne

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

func (*FuncNodeUpdateOne) SetNillableKey

func (fnuo *FuncNodeUpdateOne) SetNillableKey(s *string) *FuncNodeUpdateOne

SetNillableKey sets the "key" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableName

func (fnuo *FuncNodeUpdateOne) SetNillableName(s *string) *FuncNodeUpdateOne

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

func (*FuncNodeUpdateOne) SetNillablePkg

func (fnuo *FuncNodeUpdateOne) SetNillablePkg(s *string) *FuncNodeUpdateOne

SetNillablePkg sets the "pkg" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableUpdatedAt

func (fnuo *FuncNodeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdateOne

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetPkg

func (fnuo *FuncNodeUpdateOne) SetPkg(s string) *FuncNodeUpdateOne

SetPkg sets the "pkg" field.

func (*FuncNodeUpdateOne) SetUpdatedAt

func (fnuo *FuncNodeUpdateOne) SetUpdatedAt(t time.Time) *FuncNodeUpdateOne

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncNodeUpdateOne) Where

Where appends a list predicates to the FuncNodeUpdate builder.

type FuncNodes

type FuncNodes []*FuncNode

FuncNodes is a parsable slice of FuncNode.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

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

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

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// FuncEdge is the client for interacting with the FuncEdge builders.
	FuncEdge *FuncEdgeClient
	// FuncNode is the client for interacting with the FuncNode builders.
	FuncNode *FuncNodeClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL