generated

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 28 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.
	TypeHistory            = "History"
	TypeLock               = "Lock"
	TypeNode               = "Node"
	TypeNodeState          = "NodeState"
	TypeUser               = "User"
	TypeUserSettings       = "UserSettings"
	TypeWorkflowSettings   = "WorkflowSettings"
	TypeWorkflowState      = "WorkflowState"
	TypeWorkflowTransition = "WorkflowTransition"
)

Variables

View Source
var ErrTxStarted = errors.New("generated: 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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
	// History is the client for interacting with the History builders.
	History *HistoryClient
	// Lock is the client for interacting with the Lock builders.
	Lock *LockClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// NodeState is the client for interacting with the NodeState builders.
	NodeState *NodeStateClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserSettings is the client for interacting with the UserSettings builders.
	UserSettings *UserSettingsClient
	// WorkflowSettings is the client for interacting with the WorkflowSettings builders.
	WorkflowSettings *WorkflowSettingsClient
	// WorkflowState is the client for interacting with the WorkflowState builders.
	WorkflowState *WorkflowStateClient
	// WorkflowTransition is the client for interacting with the WorkflowTransition builders.
	WorkflowTransition *WorkflowTransitionClient
	// 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().
	History.
	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 Histories

type Histories []*History

Histories is a parsable slice of History.

type History

type History struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Nid holds the value of the "nid" field.
	Nid int `json:"nid,omitempty"`
	// FromState holds the value of the "from_state" field.
	FromState string `json:"from_state,omitempty"`
	// ToState holds the value of the "to_state" field.
	ToState string `json:"to_state,omitempty"`
	// UID holds the value of the "uid" field.
	UID int `json:"uid,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment string `json:"comment,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HistoryQuery when eager-loading is set.
	Edges HistoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

History is the model entity for the History schema.

func (*History) QueryNode

func (_m *History) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the History entity.

func (*History) String

func (_m *History) String() string

String implements the fmt.Stringer.

func (*History) Unwrap

func (_m *History) Unwrap() *History

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

func (_m *History) Update() *HistoryUpdateOne

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

func (*History) Value

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

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

type HistoryClient

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

HistoryClient is a client for the History schema.

func NewHistoryClient

func NewHistoryClient(c config) *HistoryClient

NewHistoryClient returns a client for the History from the given config.

func (*HistoryClient) Create

func (c *HistoryClient) Create() *HistoryCreate

Create returns a builder for creating a History entity.

func (*HistoryClient) CreateBulk

func (c *HistoryClient) CreateBulk(builders ...*HistoryCreate) *HistoryCreateBulk

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

func (*HistoryClient) Delete

func (c *HistoryClient) Delete() *HistoryDelete

Delete returns a delete builder for History.

func (*HistoryClient) DeleteOne

func (c *HistoryClient) DeleteOne(_m *History) *HistoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*HistoryClient) DeleteOneID

func (c *HistoryClient) DeleteOneID(id int) *HistoryDeleteOne

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

func (*HistoryClient) Get

func (c *HistoryClient) Get(ctx context.Context, id int) (*History, error)

Get returns a History entity by its id.

func (*HistoryClient) GetX

func (c *HistoryClient) GetX(ctx context.Context, id int) *History

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

func (*HistoryClient) Hooks

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

Hooks returns the client hooks.

func (*HistoryClient) Intercept

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

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

func (*HistoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*HistoryClient) MapCreateBulk

func (c *HistoryClient) MapCreateBulk(slice any, setFunc func(*HistoryCreate, int)) *HistoryCreateBulk

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

func (c *HistoryClient) Query() *HistoryQuery

Query returns a query builder for History.

func (*HistoryClient) QueryNode

func (c *HistoryClient) QueryNode(_m *History) *NodeQuery

QueryNode queries the node edge of a History.

func (*HistoryClient) Update

func (c *HistoryClient) Update() *HistoryUpdate

Update returns an update builder for History.

func (*HistoryClient) UpdateOne

func (c *HistoryClient) UpdateOne(_m *History) *HistoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*HistoryClient) UpdateOneID

func (c *HistoryClient) UpdateOneID(id int) *HistoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HistoryClient) Use

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

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

type HistoryCreate

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

HistoryCreate is the builder for creating a History entity.

func (*HistoryCreate) Exec

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

Exec executes the query.

func (*HistoryCreate) ExecX

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

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

func (*HistoryCreate) Mutation

func (_c *HistoryCreate) Mutation() *HistoryMutation

Mutation returns the HistoryMutation object of the builder.

func (*HistoryCreate) Save

func (_c *HistoryCreate) Save(ctx context.Context) (*History, error)

Save creates the History in the database.

func (*HistoryCreate) SaveX

func (_c *HistoryCreate) SaveX(ctx context.Context) *History

SaveX calls Save and panics if Save returns an error.

func (*HistoryCreate) SetComment

func (_c *HistoryCreate) SetComment(v string) *HistoryCreate

SetComment sets the "comment" field.

func (*HistoryCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*HistoryCreate) SetFromState

func (_c *HistoryCreate) SetFromState(v string) *HistoryCreate

SetFromState sets the "from_state" field.

func (*HistoryCreate) SetID

func (_c *HistoryCreate) SetID(v int) *HistoryCreate

SetID sets the "id" field.

func (*HistoryCreate) SetNid

func (_c *HistoryCreate) SetNid(v int) *HistoryCreate

SetNid sets the "nid" field.

func (*HistoryCreate) SetNillableUID

func (_c *HistoryCreate) SetNillableUID(v *int) *HistoryCreate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*HistoryCreate) SetNode

func (_c *HistoryCreate) SetNode(v *Node) *HistoryCreate

SetNode sets the "node" edge to the Node entity.

func (*HistoryCreate) SetNodeID

func (_c *HistoryCreate) SetNodeID(id int) *HistoryCreate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*HistoryCreate) SetToState

func (_c *HistoryCreate) SetToState(v string) *HistoryCreate

SetToState sets the "to_state" field.

func (*HistoryCreate) SetUID

func (_c *HistoryCreate) SetUID(v int) *HistoryCreate

SetUID sets the "uid" field.

type HistoryCreateBulk

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

HistoryCreateBulk is the builder for creating many History entities in bulk.

func (*HistoryCreateBulk) Exec

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

Exec executes the query.

func (*HistoryCreateBulk) ExecX

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

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

func (*HistoryCreateBulk) Save

func (_c *HistoryCreateBulk) Save(ctx context.Context) ([]*History, error)

Save creates the History entities in the database.

func (*HistoryCreateBulk) SaveX

func (_c *HistoryCreateBulk) SaveX(ctx context.Context) []*History

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

type HistoryDelete

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

HistoryDelete is the builder for deleting a History entity.

func (*HistoryDelete) Exec

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

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

func (*HistoryDelete) ExecX

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

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

func (*HistoryDelete) Where

func (_d *HistoryDelete) Where(ps ...predicate.History) *HistoryDelete

Where appends a list predicates to the HistoryDelete builder.

type HistoryDeleteOne

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

HistoryDeleteOne is the builder for deleting a single History entity.

func (*HistoryDeleteOne) Exec

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

Exec executes the deletion query.

func (*HistoryDeleteOne) ExecX

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

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

func (*HistoryDeleteOne) Where

Where appends a list predicates to the HistoryDelete builder.

type HistoryEdges

type HistoryEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

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

func (HistoryEdges) NodeOrErr

func (e HistoryEdges) NodeOrErr() (*Node, error)

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

type HistoryGroupBy

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

HistoryGroupBy is the group-by builder for History entities.

func (*HistoryGroupBy) Aggregate

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

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

func (*HistoryGroupBy) Bool

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

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

func (*HistoryGroupBy) BoolX

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

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

func (*HistoryGroupBy) Bools

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

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

func (*HistoryGroupBy) BoolsX

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

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

func (*HistoryGroupBy) Float64

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

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

func (*HistoryGroupBy) Float64X

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

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

func (*HistoryGroupBy) Float64s

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

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

func (*HistoryGroupBy) Float64sX

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

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

func (*HistoryGroupBy) Int

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

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

func (*HistoryGroupBy) IntX

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

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

func (*HistoryGroupBy) Ints

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

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

func (*HistoryGroupBy) IntsX

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

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

func (*HistoryGroupBy) Scan

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

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

func (*HistoryGroupBy) ScanX

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

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

func (*HistoryGroupBy) String

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

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

func (*HistoryGroupBy) StringX

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

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

func (*HistoryGroupBy) Strings

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

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

func (*HistoryGroupBy) StringsX

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

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

type HistoryMutation

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

HistoryMutation represents an operation that mutates the History nodes in the graph.

func (*HistoryMutation) AddField

func (m *HistoryMutation) 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 (*HistoryMutation) AddUID

func (m *HistoryMutation) AddUID(i int)

AddUID adds i to the "uid" field.

func (*HistoryMutation) AddedEdges

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

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

func (*HistoryMutation) AddedField

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

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

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

func (*HistoryMutation) AddedIDs

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

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

func (*HistoryMutation) AddedUID

func (m *HistoryMutation) AddedUID() (r int, exists bool)

AddedUID returns the value that was added to the "uid" field in this mutation.

func (*HistoryMutation) ClearEdge

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

func (m *HistoryMutation) 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 (*HistoryMutation) ClearNode

func (m *HistoryMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*HistoryMutation) ClearedEdges

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

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

func (*HistoryMutation) ClearedFields

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

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

func (HistoryMutation) Client

func (m HistoryMutation) 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 (*HistoryMutation) Comment

func (m *HistoryMutation) Comment() (r string, exists bool)

Comment returns the value of the "comment" field in the mutation.

func (*HistoryMutation) CreatedAt

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

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

func (*HistoryMutation) EdgeCleared

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

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

func (*HistoryMutation) Field

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

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

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

func (*HistoryMutation) Fields

func (m *HistoryMutation) 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 (*HistoryMutation) FromState

func (m *HistoryMutation) FromState() (r string, exists bool)

FromState returns the value of the "from_state" field in the mutation.

func (*HistoryMutation) ID

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

func (m *HistoryMutation) 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 (*HistoryMutation) Nid

func (m *HistoryMutation) Nid() (r int, exists bool)

Nid returns the value of the "nid" field in the mutation.

func (*HistoryMutation) NodeCleared

func (m *HistoryMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*HistoryMutation) NodeID

func (m *HistoryMutation) NodeID() (id int, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*HistoryMutation) NodeIDs

func (m *HistoryMutation) NodeIDs() (ids []int)

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

func (*HistoryMutation) OldComment

func (m *HistoryMutation) OldComment(ctx context.Context) (v string, err error)

OldComment returns the old "comment" field's value of the History entity. If the History 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 (*HistoryMutation) OldCreatedAt

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

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

func (m *HistoryMutation) 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 (*HistoryMutation) OldFromState

func (m *HistoryMutation) OldFromState(ctx context.Context) (v string, err error)

OldFromState returns the old "from_state" field's value of the History entity. If the History 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 (*HistoryMutation) OldNid

func (m *HistoryMutation) OldNid(ctx context.Context) (v int, err error)

OldNid returns the old "nid" field's value of the History entity. If the History 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 (*HistoryMutation) OldToState

func (m *HistoryMutation) OldToState(ctx context.Context) (v string, err error)

OldToState returns the old "to_state" field's value of the History entity. If the History 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 (*HistoryMutation) OldUID

func (m *HistoryMutation) OldUID(ctx context.Context) (v int, err error)

OldUID returns the old "uid" field's value of the History entity. If the History 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 (*HistoryMutation) Op

func (m *HistoryMutation) Op() Op

Op returns the operation name.

func (*HistoryMutation) RemovedEdges

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

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

func (*HistoryMutation) RemovedIDs

func (m *HistoryMutation) 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 (*HistoryMutation) ResetComment

func (m *HistoryMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*HistoryMutation) ResetCreatedAt

func (m *HistoryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*HistoryMutation) ResetEdge

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

func (m *HistoryMutation) 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 (*HistoryMutation) ResetFromState

func (m *HistoryMutation) ResetFromState()

ResetFromState resets all changes to the "from_state" field.

func (*HistoryMutation) ResetNid

func (m *HistoryMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*HistoryMutation) ResetNode

func (m *HistoryMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*HistoryMutation) ResetToState

func (m *HistoryMutation) ResetToState()

ResetToState resets all changes to the "to_state" field.

func (*HistoryMutation) ResetUID

func (m *HistoryMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*HistoryMutation) SetComment

func (m *HistoryMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*HistoryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*HistoryMutation) SetField

func (m *HistoryMutation) 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 (*HistoryMutation) SetFromState

func (m *HistoryMutation) SetFromState(s string)

SetFromState sets the "from_state" field.

func (*HistoryMutation) SetID

func (m *HistoryMutation) SetID(id int)

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

func (*HistoryMutation) SetNid

func (m *HistoryMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*HistoryMutation) SetNodeID

func (m *HistoryMutation) SetNodeID(id int)

SetNodeID sets the "node" edge to the Node entity by id.

func (*HistoryMutation) SetOp

func (m *HistoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*HistoryMutation) SetToState

func (m *HistoryMutation) SetToState(s string)

SetToState sets the "to_state" field.

func (*HistoryMutation) SetUID

func (m *HistoryMutation) SetUID(i int)

SetUID sets the "uid" field.

func (*HistoryMutation) ToState

func (m *HistoryMutation) ToState() (r string, exists bool)

ToState returns the value of the "to_state" field in the mutation.

func (HistoryMutation) Tx

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

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

func (*HistoryMutation) Type

func (m *HistoryMutation) Type() string

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

func (*HistoryMutation) UID

func (m *HistoryMutation) UID() (r int, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*HistoryMutation) Where

func (m *HistoryMutation) Where(ps ...predicate.History)

Where appends a list predicates to the HistoryMutation builder.

func (*HistoryMutation) WhereP

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

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

type HistoryQuery

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

HistoryQuery is the builder for querying History entities.

func (*HistoryQuery) Aggregate

func (_q *HistoryQuery) Aggregate(fns ...AggregateFunc) *HistorySelect

Aggregate returns a HistorySelect configured with the given aggregations.

func (*HistoryQuery) All

func (_q *HistoryQuery) All(ctx context.Context) ([]*History, error)

All executes the query and returns a list of Histories.

func (*HistoryQuery) AllX

func (_q *HistoryQuery) AllX(ctx context.Context) []*History

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

func (*HistoryQuery) Clone

func (_q *HistoryQuery) Clone() *HistoryQuery

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

func (*HistoryQuery) Count

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

Count returns the count of the given query.

func (*HistoryQuery) CountX

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

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

func (*HistoryQuery) Exist

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

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

func (*HistoryQuery) ExistX

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

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

func (*HistoryQuery) First

func (_q *HistoryQuery) First(ctx context.Context) (*History, error)

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

func (*HistoryQuery) FirstID

func (_q *HistoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*HistoryQuery) FirstIDX

func (_q *HistoryQuery) FirstIDX(ctx context.Context) int

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

func (*HistoryQuery) FirstX

func (_q *HistoryQuery) FirstX(ctx context.Context) *History

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

func (*HistoryQuery) GroupBy

func (_q *HistoryQuery) GroupBy(field string, fields ...string) *HistoryGroupBy

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 {
	Nid int `json:"nid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.History.Query().
	GroupBy(history.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*HistoryQuery) IDs

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

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

func (*HistoryQuery) IDsX

func (_q *HistoryQuery) IDsX(ctx context.Context) []int

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

func (*HistoryQuery) Limit

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

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

func (*HistoryQuery) Offset

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

Offset to start from.

func (*HistoryQuery) Only

func (_q *HistoryQuery) Only(ctx context.Context) (*History, error)

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

func (*HistoryQuery) OnlyID

func (_q *HistoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*HistoryQuery) OnlyIDX

func (_q *HistoryQuery) OnlyIDX(ctx context.Context) int

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

func (*HistoryQuery) OnlyX

func (_q *HistoryQuery) OnlyX(ctx context.Context) *History

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

func (*HistoryQuery) Order

func (_q *HistoryQuery) Order(o ...history.OrderOption) *HistoryQuery

Order specifies how the records should be ordered.

func (*HistoryQuery) QueryNode

func (_q *HistoryQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*HistoryQuery) Select

func (_q *HistoryQuery) Select(fields ...string) *HistorySelect

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 {
	Nid int `json:"nid,omitempty"`
}

client.History.Query().
	Select(history.FieldNid).
	Scan(ctx, &v)

func (*HistoryQuery) Unique

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

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

func (_q *HistoryQuery) Where(ps ...predicate.History) *HistoryQuery

Where adds a new predicate for the HistoryQuery builder.

func (*HistoryQuery) WithNode

func (_q *HistoryQuery) WithNode(opts ...func(*NodeQuery)) *HistoryQuery

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

type HistorySelect

type HistorySelect struct {
	*HistoryQuery
	// contains filtered or unexported fields
}

HistorySelect is the builder for selecting fields of History entities.

func (*HistorySelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*HistorySelect) Bool

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

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

func (*HistorySelect) BoolX

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

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

func (*HistorySelect) Bools

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

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

func (*HistorySelect) BoolsX

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

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

func (*HistorySelect) Float64

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

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

func (*HistorySelect) Float64X

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

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

func (*HistorySelect) Float64s

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

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

func (*HistorySelect) Float64sX

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

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

func (*HistorySelect) Int

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

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

func (*HistorySelect) IntX

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

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

func (*HistorySelect) Ints

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

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

func (*HistorySelect) IntsX

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

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

func (*HistorySelect) Scan

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

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

func (*HistorySelect) ScanX

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

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

func (*HistorySelect) String

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

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

func (*HistorySelect) StringX

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

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

func (*HistorySelect) Strings

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

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

func (*HistorySelect) StringsX

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

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

type HistoryUpdate

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

HistoryUpdate is the builder for updating History entities.

func (*HistoryUpdate) AddUID

func (_u *HistoryUpdate) AddUID(v int) *HistoryUpdate

AddUID adds value to the "uid" field.

func (*HistoryUpdate) ClearNode

func (_u *HistoryUpdate) ClearNode() *HistoryUpdate

ClearNode clears the "node" edge to the Node entity.

func (*HistoryUpdate) Exec

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

Exec executes the query.

func (*HistoryUpdate) ExecX

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

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

func (*HistoryUpdate) Mutation

func (_u *HistoryUpdate) Mutation() *HistoryMutation

Mutation returns the HistoryMutation object of the builder.

func (*HistoryUpdate) Save

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

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

func (*HistoryUpdate) SaveX

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

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

func (*HistoryUpdate) SetComment

func (_u *HistoryUpdate) SetComment(v string) *HistoryUpdate

SetComment sets the "comment" field.

func (*HistoryUpdate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*HistoryUpdate) SetFromState

func (_u *HistoryUpdate) SetFromState(v string) *HistoryUpdate

SetFromState sets the "from_state" field.

func (*HistoryUpdate) SetNid

func (_u *HistoryUpdate) SetNid(v int) *HistoryUpdate

SetNid sets the "nid" field.

func (*HistoryUpdate) SetNillableComment

func (_u *HistoryUpdate) SetNillableComment(v *string) *HistoryUpdate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*HistoryUpdate) SetNillableCreatedAt

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

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

func (*HistoryUpdate) SetNillableFromState

func (_u *HistoryUpdate) SetNillableFromState(v *string) *HistoryUpdate

SetNillableFromState sets the "from_state" field if the given value is not nil.

func (*HistoryUpdate) SetNillableNid

func (_u *HistoryUpdate) SetNillableNid(v *int) *HistoryUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*HistoryUpdate) SetNillableToState

func (_u *HistoryUpdate) SetNillableToState(v *string) *HistoryUpdate

SetNillableToState sets the "to_state" field if the given value is not nil.

func (*HistoryUpdate) SetNillableUID

func (_u *HistoryUpdate) SetNillableUID(v *int) *HistoryUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*HistoryUpdate) SetNode

func (_u *HistoryUpdate) SetNode(v *Node) *HistoryUpdate

SetNode sets the "node" edge to the Node entity.

func (*HistoryUpdate) SetNodeID

func (_u *HistoryUpdate) SetNodeID(id int) *HistoryUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*HistoryUpdate) SetToState

func (_u *HistoryUpdate) SetToState(v string) *HistoryUpdate

SetToState sets the "to_state" field.

func (*HistoryUpdate) SetUID

func (_u *HistoryUpdate) SetUID(v int) *HistoryUpdate

SetUID sets the "uid" field.

func (*HistoryUpdate) Where

func (_u *HistoryUpdate) Where(ps ...predicate.History) *HistoryUpdate

Where appends a list predicates to the HistoryUpdate builder.

type HistoryUpdateOne

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

HistoryUpdateOne is the builder for updating a single History entity.

func (*HistoryUpdateOne) AddUID

func (_u *HistoryUpdateOne) AddUID(v int) *HistoryUpdateOne

AddUID adds value to the "uid" field.

func (*HistoryUpdateOne) ClearNode

func (_u *HistoryUpdateOne) ClearNode() *HistoryUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*HistoryUpdateOne) Exec

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

Exec executes the query on the entity.

func (*HistoryUpdateOne) ExecX

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

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

func (*HistoryUpdateOne) Mutation

func (_u *HistoryUpdateOne) Mutation() *HistoryMutation

Mutation returns the HistoryMutation object of the builder.

func (*HistoryUpdateOne) Save

func (_u *HistoryUpdateOne) Save(ctx context.Context) (*History, error)

Save executes the query and returns the updated History entity.

func (*HistoryUpdateOne) SaveX

func (_u *HistoryUpdateOne) SaveX(ctx context.Context) *History

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

func (*HistoryUpdateOne) Select

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

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

func (*HistoryUpdateOne) SetComment

func (_u *HistoryUpdateOne) SetComment(v string) *HistoryUpdateOne

SetComment sets the "comment" field.

func (*HistoryUpdateOne) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*HistoryUpdateOne) SetFromState

func (_u *HistoryUpdateOne) SetFromState(v string) *HistoryUpdateOne

SetFromState sets the "from_state" field.

func (*HistoryUpdateOne) SetNid

func (_u *HistoryUpdateOne) SetNid(v int) *HistoryUpdateOne

SetNid sets the "nid" field.

func (*HistoryUpdateOne) SetNillableComment

func (_u *HistoryUpdateOne) SetNillableComment(v *string) *HistoryUpdateOne

SetNillableComment sets the "comment" field if the given value is not nil.

func (*HistoryUpdateOne) SetNillableCreatedAt

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

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

func (*HistoryUpdateOne) SetNillableFromState

func (_u *HistoryUpdateOne) SetNillableFromState(v *string) *HistoryUpdateOne

SetNillableFromState sets the "from_state" field if the given value is not nil.

func (*HistoryUpdateOne) SetNillableNid

func (_u *HistoryUpdateOne) SetNillableNid(v *int) *HistoryUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*HistoryUpdateOne) SetNillableToState

func (_u *HistoryUpdateOne) SetNillableToState(v *string) *HistoryUpdateOne

SetNillableToState sets the "to_state" field if the given value is not nil.

func (*HistoryUpdateOne) SetNillableUID

func (_u *HistoryUpdateOne) SetNillableUID(v *int) *HistoryUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*HistoryUpdateOne) SetNode

func (_u *HistoryUpdateOne) SetNode(v *Node) *HistoryUpdateOne

SetNode sets the "node" edge to the Node entity.

func (*HistoryUpdateOne) SetNodeID

func (_u *HistoryUpdateOne) SetNodeID(id int) *HistoryUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*HistoryUpdateOne) SetToState

func (_u *HistoryUpdateOne) SetToState(v string) *HistoryUpdateOne

SetToState sets the "to_state" field.

func (*HistoryUpdateOne) SetUID

func (_u *HistoryUpdateOne) SetUID(v int) *HistoryUpdateOne

SetUID sets the "uid" field.

func (*HistoryUpdateOne) Where

Where appends a list predicates to the HistoryUpdate builder.

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 Lock

type Lock struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Nid holds the value of the "nid" field.
	Nid int `json:"nid,omitempty"`
	// UID holds the value of the "uid" field.
	UID int `json:"uid,omitempty"`
	// LockedAt holds the value of the "locked_at" field.
	LockedAt time.Time `json:"locked_at,omitempty"`
	// TouchedAt holds the value of the "touched_at" field.
	TouchedAt time.Time `json:"touched_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LockQuery when eager-loading is set.
	Edges LockEdges `json:"edges"`
	// contains filtered or unexported fields
}

Lock is the model entity for the Lock schema.

func (*Lock) QueryNode

func (_m *Lock) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the Lock entity.

func (*Lock) String

func (_m *Lock) String() string

String implements the fmt.Stringer.

func (*Lock) Unwrap

func (_m *Lock) Unwrap() *Lock

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

func (_m *Lock) Update() *LockUpdateOne

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

func (*Lock) Value

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

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

type LockClient

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

LockClient is a client for the Lock schema.

func NewLockClient

func NewLockClient(c config) *LockClient

NewLockClient returns a client for the Lock from the given config.

func (*LockClient) Create

func (c *LockClient) Create() *LockCreate

Create returns a builder for creating a Lock entity.

func (*LockClient) CreateBulk

func (c *LockClient) CreateBulk(builders ...*LockCreate) *LockCreateBulk

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

func (*LockClient) Delete

func (c *LockClient) Delete() *LockDelete

Delete returns a delete builder for Lock.

func (*LockClient) DeleteOne

func (c *LockClient) DeleteOne(_m *Lock) *LockDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LockClient) DeleteOneID

func (c *LockClient) DeleteOneID(id int) *LockDeleteOne

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

func (*LockClient) Get

func (c *LockClient) Get(ctx context.Context, id int) (*Lock, error)

Get returns a Lock entity by its id.

func (*LockClient) GetX

func (c *LockClient) GetX(ctx context.Context, id int) *Lock

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

func (*LockClient) Hooks

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

Hooks returns the client hooks.

func (*LockClient) Intercept

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

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

func (*LockClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LockClient) MapCreateBulk

func (c *LockClient) MapCreateBulk(slice any, setFunc func(*LockCreate, int)) *LockCreateBulk

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

func (c *LockClient) Query() *LockQuery

Query returns a query builder for Lock.

func (*LockClient) QueryNode

func (c *LockClient) QueryNode(_m *Lock) *NodeQuery

QueryNode queries the node edge of a Lock.

func (*LockClient) Update

func (c *LockClient) Update() *LockUpdate

Update returns an update builder for Lock.

func (*LockClient) UpdateOne

func (c *LockClient) UpdateOne(_m *Lock) *LockUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LockClient) UpdateOneID

func (c *LockClient) UpdateOneID(id int) *LockUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LockClient) Use

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

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

type LockCreate

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

LockCreate is the builder for creating a Lock entity.

func (*LockCreate) Exec

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

Exec executes the query.

func (*LockCreate) ExecX

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

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

func (*LockCreate) Mutation

func (_c *LockCreate) Mutation() *LockMutation

Mutation returns the LockMutation object of the builder.

func (*LockCreate) Save

func (_c *LockCreate) Save(ctx context.Context) (*Lock, error)

Save creates the Lock in the database.

func (*LockCreate) SaveX

func (_c *LockCreate) SaveX(ctx context.Context) *Lock

SaveX calls Save and panics if Save returns an error.

func (*LockCreate) SetID

func (_c *LockCreate) SetID(v int) *LockCreate

SetID sets the "id" field.

func (*LockCreate) SetLockedAt

func (_c *LockCreate) SetLockedAt(v time.Time) *LockCreate

SetLockedAt sets the "locked_at" field.

func (*LockCreate) SetNid

func (_c *LockCreate) SetNid(v int) *LockCreate

SetNid sets the "nid" field.

func (*LockCreate) SetNode

func (_c *LockCreate) SetNode(v *Node) *LockCreate

SetNode sets the "node" edge to the Node entity.

func (*LockCreate) SetNodeID

func (_c *LockCreate) SetNodeID(id int) *LockCreate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*LockCreate) SetTouchedAt

func (_c *LockCreate) SetTouchedAt(v time.Time) *LockCreate

SetTouchedAt sets the "touched_at" field.

func (*LockCreate) SetUID

func (_c *LockCreate) SetUID(v int) *LockCreate

SetUID sets the "uid" field.

type LockCreateBulk

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

LockCreateBulk is the builder for creating many Lock entities in bulk.

func (*LockCreateBulk) Exec

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

Exec executes the query.

func (*LockCreateBulk) ExecX

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

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

func (*LockCreateBulk) Save

func (_c *LockCreateBulk) Save(ctx context.Context) ([]*Lock, error)

Save creates the Lock entities in the database.

func (*LockCreateBulk) SaveX

func (_c *LockCreateBulk) SaveX(ctx context.Context) []*Lock

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

type LockDelete

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

LockDelete is the builder for deleting a Lock entity.

func (*LockDelete) Exec

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

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

func (*LockDelete) ExecX

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

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

func (*LockDelete) Where

func (_d *LockDelete) Where(ps ...predicate.Lock) *LockDelete

Where appends a list predicates to the LockDelete builder.

type LockDeleteOne

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

LockDeleteOne is the builder for deleting a single Lock entity.

func (*LockDeleteOne) Exec

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

Exec executes the deletion query.

func (*LockDeleteOne) ExecX

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

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

func (*LockDeleteOne) Where

func (_d *LockDeleteOne) Where(ps ...predicate.Lock) *LockDeleteOne

Where appends a list predicates to the LockDelete builder.

type LockEdges

type LockEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

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

func (LockEdges) NodeOrErr

func (e LockEdges) NodeOrErr() (*Node, error)

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

type LockGroupBy

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

LockGroupBy is the group-by builder for Lock entities.

func (*LockGroupBy) Aggregate

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

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

func (*LockGroupBy) Bool

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

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

func (*LockGroupBy) BoolX

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

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

func (*LockGroupBy) Bools

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

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

func (*LockGroupBy) BoolsX

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

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

func (*LockGroupBy) Float64

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

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

func (*LockGroupBy) Float64X

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

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

func (*LockGroupBy) Float64s

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

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

func (*LockGroupBy) Float64sX

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

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

func (*LockGroupBy) Int

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

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

func (*LockGroupBy) IntX

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

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

func (*LockGroupBy) Ints

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

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

func (*LockGroupBy) IntsX

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

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

func (*LockGroupBy) Scan

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

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

func (*LockGroupBy) ScanX

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

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

func (*LockGroupBy) String

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

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

func (*LockGroupBy) StringX

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

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

func (*LockGroupBy) Strings

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

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

func (*LockGroupBy) StringsX

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

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

type LockMutation

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

LockMutation represents an operation that mutates the Lock nodes in the graph.

func (*LockMutation) AddField

func (m *LockMutation) 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 (*LockMutation) AddUID

func (m *LockMutation) AddUID(i int)

AddUID adds i to the "uid" field.

func (*LockMutation) AddedEdges

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

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

func (*LockMutation) AddedField

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

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

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

func (*LockMutation) AddedIDs

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

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

func (*LockMutation) AddedUID

func (m *LockMutation) AddedUID() (r int, exists bool)

AddedUID returns the value that was added to the "uid" field in this mutation.

func (*LockMutation) ClearEdge

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

func (m *LockMutation) 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 (*LockMutation) ClearNode

func (m *LockMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*LockMutation) ClearedEdges

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

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

func (*LockMutation) ClearedFields

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

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

func (LockMutation) Client

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

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

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

func (*LockMutation) Field

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

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

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

func (*LockMutation) Fields

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

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

func (m *LockMutation) 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 (*LockMutation) LockedAt

func (m *LockMutation) LockedAt() (r time.Time, exists bool)

LockedAt returns the value of the "locked_at" field in the mutation.

func (*LockMutation) Nid

func (m *LockMutation) Nid() (r int, exists bool)

Nid returns the value of the "nid" field in the mutation.

func (*LockMutation) NodeCleared

func (m *LockMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*LockMutation) NodeID

func (m *LockMutation) NodeID() (id int, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*LockMutation) NodeIDs

func (m *LockMutation) NodeIDs() (ids []int)

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

func (*LockMutation) OldField

func (m *LockMutation) 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 (*LockMutation) OldLockedAt

func (m *LockMutation) OldLockedAt(ctx context.Context) (v time.Time, err error)

OldLockedAt returns the old "locked_at" field's value of the Lock entity. If the Lock 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 (*LockMutation) OldNid

func (m *LockMutation) OldNid(ctx context.Context) (v int, err error)

OldNid returns the old "nid" field's value of the Lock entity. If the Lock 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 (*LockMutation) OldTouchedAt

func (m *LockMutation) OldTouchedAt(ctx context.Context) (v time.Time, err error)

OldTouchedAt returns the old "touched_at" field's value of the Lock entity. If the Lock 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 (*LockMutation) OldUID

func (m *LockMutation) OldUID(ctx context.Context) (v int, err error)

OldUID returns the old "uid" field's value of the Lock entity. If the Lock 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 (*LockMutation) Op

func (m *LockMutation) Op() Op

Op returns the operation name.

func (*LockMutation) RemovedEdges

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

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

func (*LockMutation) RemovedIDs

func (m *LockMutation) 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 (*LockMutation) ResetEdge

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

func (m *LockMutation) 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 (*LockMutation) ResetLockedAt

func (m *LockMutation) ResetLockedAt()

ResetLockedAt resets all changes to the "locked_at" field.

func (*LockMutation) ResetNid

func (m *LockMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*LockMutation) ResetNode

func (m *LockMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*LockMutation) ResetTouchedAt

func (m *LockMutation) ResetTouchedAt()

ResetTouchedAt resets all changes to the "touched_at" field.

func (*LockMutation) ResetUID

func (m *LockMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*LockMutation) SetField

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

func (m *LockMutation) SetID(id int)

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

func (*LockMutation) SetLockedAt

func (m *LockMutation) SetLockedAt(t time.Time)

SetLockedAt sets the "locked_at" field.

func (*LockMutation) SetNid

func (m *LockMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*LockMutation) SetNodeID

func (m *LockMutation) SetNodeID(id int)

SetNodeID sets the "node" edge to the Node entity by id.

func (*LockMutation) SetOp

func (m *LockMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LockMutation) SetTouchedAt

func (m *LockMutation) SetTouchedAt(t time.Time)

SetTouchedAt sets the "touched_at" field.

func (*LockMutation) SetUID

func (m *LockMutation) SetUID(i int)

SetUID sets the "uid" field.

func (*LockMutation) TouchedAt

func (m *LockMutation) TouchedAt() (r time.Time, exists bool)

TouchedAt returns the value of the "touched_at" field in the mutation.

func (LockMutation) Tx

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

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

func (*LockMutation) Type

func (m *LockMutation) Type() string

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

func (*LockMutation) UID

func (m *LockMutation) UID() (r int, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*LockMutation) Where

func (m *LockMutation) Where(ps ...predicate.Lock)

Where appends a list predicates to the LockMutation builder.

func (*LockMutation) WhereP

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

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

type LockQuery

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

LockQuery is the builder for querying Lock entities.

func (*LockQuery) Aggregate

func (_q *LockQuery) Aggregate(fns ...AggregateFunc) *LockSelect

Aggregate returns a LockSelect configured with the given aggregations.

func (*LockQuery) All

func (_q *LockQuery) All(ctx context.Context) ([]*Lock, error)

All executes the query and returns a list of Locks.

func (*LockQuery) AllX

func (_q *LockQuery) AllX(ctx context.Context) []*Lock

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

func (*LockQuery) Clone

func (_q *LockQuery) Clone() *LockQuery

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

func (*LockQuery) Count

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

Count returns the count of the given query.

func (*LockQuery) CountX

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

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

func (*LockQuery) Exist

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

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

func (*LockQuery) ExistX

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

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

func (*LockQuery) First

func (_q *LockQuery) First(ctx context.Context) (*Lock, error)

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

func (*LockQuery) FirstID

func (_q *LockQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LockQuery) FirstIDX

func (_q *LockQuery) FirstIDX(ctx context.Context) int

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

func (*LockQuery) FirstX

func (_q *LockQuery) FirstX(ctx context.Context) *Lock

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

func (*LockQuery) GroupBy

func (_q *LockQuery) GroupBy(field string, fields ...string) *LockGroupBy

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 {
	Nid int `json:"nid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Lock.Query().
	GroupBy(lock.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*LockQuery) IDs

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

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

func (*LockQuery) IDsX

func (_q *LockQuery) IDsX(ctx context.Context) []int

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

func (*LockQuery) Limit

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

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

func (*LockQuery) Offset

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

Offset to start from.

func (*LockQuery) Only

func (_q *LockQuery) Only(ctx context.Context) (*Lock, error)

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

func (*LockQuery) OnlyID

func (_q *LockQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LockQuery) OnlyIDX

func (_q *LockQuery) OnlyIDX(ctx context.Context) int

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

func (*LockQuery) OnlyX

func (_q *LockQuery) OnlyX(ctx context.Context) *Lock

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

func (*LockQuery) Order

func (_q *LockQuery) Order(o ...lock.OrderOption) *LockQuery

Order specifies how the records should be ordered.

func (*LockQuery) QueryNode

func (_q *LockQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*LockQuery) Select

func (_q *LockQuery) Select(fields ...string) *LockSelect

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 {
	Nid int `json:"nid,omitempty"`
}

client.Lock.Query().
	Select(lock.FieldNid).
	Scan(ctx, &v)

func (*LockQuery) Unique

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

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

func (_q *LockQuery) Where(ps ...predicate.Lock) *LockQuery

Where adds a new predicate for the LockQuery builder.

func (*LockQuery) WithNode

func (_q *LockQuery) WithNode(opts ...func(*NodeQuery)) *LockQuery

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

type LockSelect

type LockSelect struct {
	*LockQuery
	// contains filtered or unexported fields
}

LockSelect is the builder for selecting fields of Lock entities.

func (*LockSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*LockSelect) Bool

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

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

func (*LockSelect) BoolX

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

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

func (*LockSelect) Bools

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

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

func (*LockSelect) BoolsX

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

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

func (*LockSelect) Float64

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

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

func (*LockSelect) Float64X

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

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

func (*LockSelect) Float64s

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

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

func (*LockSelect) Float64sX

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

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

func (*LockSelect) Int

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

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

func (*LockSelect) IntX

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

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

func (*LockSelect) Ints

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

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

func (*LockSelect) IntsX

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

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

func (*LockSelect) Scan

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

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

func (*LockSelect) ScanX

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

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

func (*LockSelect) String

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

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

func (*LockSelect) StringX

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

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

func (*LockSelect) Strings

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

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

func (*LockSelect) StringsX

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

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

type LockUpdate

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

LockUpdate is the builder for updating Lock entities.

func (*LockUpdate) AddUID

func (_u *LockUpdate) AddUID(v int) *LockUpdate

AddUID adds value to the "uid" field.

func (*LockUpdate) ClearNode

func (_u *LockUpdate) ClearNode() *LockUpdate

ClearNode clears the "node" edge to the Node entity.

func (*LockUpdate) Exec

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

Exec executes the query.

func (*LockUpdate) ExecX

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

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

func (*LockUpdate) Mutation

func (_u *LockUpdate) Mutation() *LockMutation

Mutation returns the LockMutation object of the builder.

func (*LockUpdate) Save

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

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

func (*LockUpdate) SaveX

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

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

func (*LockUpdate) SetLockedAt

func (_u *LockUpdate) SetLockedAt(v time.Time) *LockUpdate

SetLockedAt sets the "locked_at" field.

func (*LockUpdate) SetNid

func (_u *LockUpdate) SetNid(v int) *LockUpdate

SetNid sets the "nid" field.

func (*LockUpdate) SetNillableLockedAt

func (_u *LockUpdate) SetNillableLockedAt(v *time.Time) *LockUpdate

SetNillableLockedAt sets the "locked_at" field if the given value is not nil.

func (*LockUpdate) SetNillableNid

func (_u *LockUpdate) SetNillableNid(v *int) *LockUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*LockUpdate) SetNillableTouchedAt

func (_u *LockUpdate) SetNillableTouchedAt(v *time.Time) *LockUpdate

SetNillableTouchedAt sets the "touched_at" field if the given value is not nil.

func (*LockUpdate) SetNillableUID

func (_u *LockUpdate) SetNillableUID(v *int) *LockUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*LockUpdate) SetNode

func (_u *LockUpdate) SetNode(v *Node) *LockUpdate

SetNode sets the "node" edge to the Node entity.

func (*LockUpdate) SetNodeID

func (_u *LockUpdate) SetNodeID(id int) *LockUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*LockUpdate) SetTouchedAt

func (_u *LockUpdate) SetTouchedAt(v time.Time) *LockUpdate

SetTouchedAt sets the "touched_at" field.

func (*LockUpdate) SetUID

func (_u *LockUpdate) SetUID(v int) *LockUpdate

SetUID sets the "uid" field.

func (*LockUpdate) Where

func (_u *LockUpdate) Where(ps ...predicate.Lock) *LockUpdate

Where appends a list predicates to the LockUpdate builder.

type LockUpdateOne

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

LockUpdateOne is the builder for updating a single Lock entity.

func (*LockUpdateOne) AddUID

func (_u *LockUpdateOne) AddUID(v int) *LockUpdateOne

AddUID adds value to the "uid" field.

func (*LockUpdateOne) ClearNode

func (_u *LockUpdateOne) ClearNode() *LockUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*LockUpdateOne) Exec

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

Exec executes the query on the entity.

func (*LockUpdateOne) ExecX

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

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

func (*LockUpdateOne) Mutation

func (_u *LockUpdateOne) Mutation() *LockMutation

Mutation returns the LockMutation object of the builder.

func (*LockUpdateOne) Save

func (_u *LockUpdateOne) Save(ctx context.Context) (*Lock, error)

Save executes the query and returns the updated Lock entity.

func (*LockUpdateOne) SaveX

func (_u *LockUpdateOne) SaveX(ctx context.Context) *Lock

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

func (*LockUpdateOne) Select

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

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

func (*LockUpdateOne) SetLockedAt

func (_u *LockUpdateOne) SetLockedAt(v time.Time) *LockUpdateOne

SetLockedAt sets the "locked_at" field.

func (*LockUpdateOne) SetNid

func (_u *LockUpdateOne) SetNid(v int) *LockUpdateOne

SetNid sets the "nid" field.

func (*LockUpdateOne) SetNillableLockedAt

func (_u *LockUpdateOne) SetNillableLockedAt(v *time.Time) *LockUpdateOne

SetNillableLockedAt sets the "locked_at" field if the given value is not nil.

func (*LockUpdateOne) SetNillableNid

func (_u *LockUpdateOne) SetNillableNid(v *int) *LockUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*LockUpdateOne) SetNillableTouchedAt

func (_u *LockUpdateOne) SetNillableTouchedAt(v *time.Time) *LockUpdateOne

SetNillableTouchedAt sets the "touched_at" field if the given value is not nil.

func (*LockUpdateOne) SetNillableUID

func (_u *LockUpdateOne) SetNillableUID(v *int) *LockUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*LockUpdateOne) SetNode

func (_u *LockUpdateOne) SetNode(v *Node) *LockUpdateOne

SetNode sets the "node" edge to the Node entity.

func (*LockUpdateOne) SetNodeID

func (_u *LockUpdateOne) SetNodeID(id int) *LockUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*LockUpdateOne) SetTouchedAt

func (_u *LockUpdateOne) SetTouchedAt(v time.Time) *LockUpdateOne

SetTouchedAt sets the "touched_at" field.

func (*LockUpdateOne) SetUID

func (_u *LockUpdateOne) SetUID(v int) *LockUpdateOne

SetUID sets the "uid" field.

func (*LockUpdateOne) Where

func (_u *LockUpdateOne) Where(ps ...predicate.Lock) *LockUpdateOne

Where appends a list predicates to the LockUpdate builder.

type Locks

type Locks []*Lock

Locks is a parsable slice of Lock.

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 Node

type Node struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Node is the model entity for the Node schema.

func (*Node) String

func (_m *Node) String() string

String implements the fmt.Stringer.

func (*Node) Unwrap

func (_m *Node) Unwrap() *Node

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

func (_m *Node) Update() *NodeUpdateOne

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

func (*Node) Value

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

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

type NodeClient

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

NodeClient is a client for the Node schema.

func NewNodeClient

func NewNodeClient(c config) *NodeClient

NewNodeClient returns a client for the Node from the given config.

func (*NodeClient) Create

func (c *NodeClient) Create() *NodeCreate

Create returns a builder for creating a Node entity.

func (*NodeClient) CreateBulk

func (c *NodeClient) CreateBulk(builders ...*NodeCreate) *NodeCreateBulk

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

func (*NodeClient) Delete

func (c *NodeClient) Delete() *NodeDelete

Delete returns a delete builder for Node.

func (*NodeClient) DeleteOne

func (c *NodeClient) DeleteOne(_m *Node) *NodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeClient) DeleteOneID

func (c *NodeClient) DeleteOneID(id int) *NodeDeleteOne

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

func (*NodeClient) Get

func (c *NodeClient) Get(ctx context.Context, id int) (*Node, error)

Get returns a Node entity by its id.

func (*NodeClient) GetX

func (c *NodeClient) GetX(ctx context.Context, id int) *Node

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

func (*NodeClient) Hooks

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

Hooks returns the client hooks.

func (*NodeClient) Intercept

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

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

func (*NodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeClient) MapCreateBulk

func (c *NodeClient) MapCreateBulk(slice any, setFunc func(*NodeCreate, int)) *NodeCreateBulk

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

func (c *NodeClient) Query() *NodeQuery

Query returns a query builder for Node.

func (*NodeClient) Update

func (c *NodeClient) Update() *NodeUpdate

Update returns an update builder for Node.

func (*NodeClient) UpdateOne

func (c *NodeClient) UpdateOne(_m *Node) *NodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeClient) UpdateOneID

func (c *NodeClient) UpdateOneID(id int) *NodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeClient) Use

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

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

type NodeCreate

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

NodeCreate is the builder for creating a Node entity.

func (*NodeCreate) Exec

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

Exec executes the query.

func (*NodeCreate) ExecX

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

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

func (*NodeCreate) Mutation

func (_c *NodeCreate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeCreate) Save

func (_c *NodeCreate) Save(ctx context.Context) (*Node, error)

Save creates the Node in the database.

func (*NodeCreate) SaveX

func (_c *NodeCreate) SaveX(ctx context.Context) *Node

SaveX calls Save and panics if Save returns an error.

func (*NodeCreate) SetID

func (_c *NodeCreate) SetID(v int) *NodeCreate

SetID sets the "id" field.

type NodeCreateBulk

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

NodeCreateBulk is the builder for creating many Node entities in bulk.

func (*NodeCreateBulk) Exec

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

Exec executes the query.

func (*NodeCreateBulk) ExecX

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

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

func (*NodeCreateBulk) Save

func (_c *NodeCreateBulk) Save(ctx context.Context) ([]*Node, error)

Save creates the Node entities in the database.

func (*NodeCreateBulk) SaveX

func (_c *NodeCreateBulk) SaveX(ctx context.Context) []*Node

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

type NodeDelete

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

NodeDelete is the builder for deleting a Node entity.

func (*NodeDelete) Exec

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

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

func (*NodeDelete) ExecX

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

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

func (*NodeDelete) Where

func (_d *NodeDelete) Where(ps ...predicate.Node) *NodeDelete

Where appends a list predicates to the NodeDelete builder.

type NodeDeleteOne

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

NodeDeleteOne is the builder for deleting a single Node entity.

func (*NodeDeleteOne) Exec

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

Exec executes the deletion query.

func (*NodeDeleteOne) ExecX

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

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

func (*NodeDeleteOne) Where

func (_d *NodeDeleteOne) Where(ps ...predicate.Node) *NodeDeleteOne

Where appends a list predicates to the NodeDelete builder.

type NodeGroupBy

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

NodeGroupBy is the group-by builder for Node entities.

func (*NodeGroupBy) Aggregate

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

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

func (*NodeGroupBy) Bool

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

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

func (*NodeGroupBy) BoolX

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

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

func (*NodeGroupBy) Bools

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

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

func (*NodeGroupBy) BoolsX

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

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

func (*NodeGroupBy) Float64

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

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

func (*NodeGroupBy) Float64X

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

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

func (*NodeGroupBy) Float64s

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

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

func (*NodeGroupBy) Float64sX

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

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

func (*NodeGroupBy) Int

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

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

func (*NodeGroupBy) IntX

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

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

func (*NodeGroupBy) Ints

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

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

func (*NodeGroupBy) IntsX

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

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

func (*NodeGroupBy) Scan

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

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

func (*NodeGroupBy) ScanX

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

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

func (*NodeGroupBy) String

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

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

func (*NodeGroupBy) StringX

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

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

func (*NodeGroupBy) Strings

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

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

func (*NodeGroupBy) StringsX

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

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

type NodeMutation

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

NodeMutation represents an operation that mutates the Node nodes in the graph.

func (*NodeMutation) AddField

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

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

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

func (*NodeMutation) AddedField

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

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

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

func (*NodeMutation) AddedIDs

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

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

func (*NodeMutation) ClearEdge

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

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

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

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

func (*NodeMutation) ClearedFields

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

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

func (NodeMutation) Client

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

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

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

func (*NodeMutation) Field

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

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

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

func (*NodeMutation) Fields

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

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

func (m *NodeMutation) 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 (*NodeMutation) OldField

func (m *NodeMutation) 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 (*NodeMutation) Op

func (m *NodeMutation) Op() Op

Op returns the operation name.

func (*NodeMutation) RemovedEdges

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

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

func (*NodeMutation) RemovedIDs

func (m *NodeMutation) 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 (*NodeMutation) ResetEdge

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

func (m *NodeMutation) 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 (*NodeMutation) SetField

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

func (m *NodeMutation) SetID(id int)

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

func (*NodeMutation) SetOp

func (m *NodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (NodeMutation) Tx

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

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

func (*NodeMutation) Type

func (m *NodeMutation) Type() string

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

func (*NodeMutation) Where

func (m *NodeMutation) Where(ps ...predicate.Node)

Where appends a list predicates to the NodeMutation builder.

func (*NodeMutation) WhereP

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

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

type NodeQuery

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

NodeQuery is the builder for querying Node entities.

func (*NodeQuery) Aggregate

func (_q *NodeQuery) Aggregate(fns ...AggregateFunc) *NodeSelect

Aggregate returns a NodeSelect configured with the given aggregations.

func (*NodeQuery) All

func (_q *NodeQuery) All(ctx context.Context) ([]*Node, error)

All executes the query and returns a list of Nodes.

func (*NodeQuery) AllX

func (_q *NodeQuery) AllX(ctx context.Context) []*Node

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

func (*NodeQuery) Clone

func (_q *NodeQuery) Clone() *NodeQuery

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

func (*NodeQuery) Count

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

Count returns the count of the given query.

func (*NodeQuery) CountX

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

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

func (*NodeQuery) Exist

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

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

func (*NodeQuery) ExistX

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

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

func (*NodeQuery) First

func (_q *NodeQuery) First(ctx context.Context) (*Node, error)

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

func (*NodeQuery) FirstID

func (_q *NodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) FirstIDX

func (_q *NodeQuery) FirstIDX(ctx context.Context) int

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

func (*NodeQuery) FirstX

func (_q *NodeQuery) FirstX(ctx context.Context) *Node

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

func (*NodeQuery) GroupBy

func (_q *NodeQuery) GroupBy(field string, fields ...string) *NodeGroupBy

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

func (*NodeQuery) IDs

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

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

func (*NodeQuery) IDsX

func (_q *NodeQuery) IDsX(ctx context.Context) []int

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

func (*NodeQuery) Limit

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

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

func (*NodeQuery) Offset

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

Offset to start from.

func (*NodeQuery) Only

func (_q *NodeQuery) Only(ctx context.Context) (*Node, error)

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

func (*NodeQuery) OnlyID

func (_q *NodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NodeQuery) OnlyIDX

func (_q *NodeQuery) OnlyIDX(ctx context.Context) int

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

func (*NodeQuery) OnlyX

func (_q *NodeQuery) OnlyX(ctx context.Context) *Node

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

func (*NodeQuery) Order

func (_q *NodeQuery) Order(o ...node.OrderOption) *NodeQuery

Order specifies how the records should be ordered.

func (*NodeQuery) Select

func (_q *NodeQuery) Select(fields ...string) *NodeSelect

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

func (*NodeQuery) Unique

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

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

func (_q *NodeQuery) Where(ps ...predicate.Node) *NodeQuery

Where adds a new predicate for the NodeQuery builder.

type NodeSelect

type NodeSelect struct {
	*NodeQuery
	// contains filtered or unexported fields
}

NodeSelect is the builder for selecting fields of Node entities.

func (*NodeSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*NodeSelect) Bool

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

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

func (*NodeSelect) BoolX

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

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

func (*NodeSelect) Bools

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

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

func (*NodeSelect) BoolsX

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

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

func (*NodeSelect) Float64

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

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

func (*NodeSelect) Float64X

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

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

func (*NodeSelect) Float64s

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

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

func (*NodeSelect) Float64sX

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

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

func (*NodeSelect) Int

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

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

func (*NodeSelect) IntX

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

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

func (*NodeSelect) Ints

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

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

func (*NodeSelect) IntsX

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

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

func (*NodeSelect) Scan

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

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

func (*NodeSelect) ScanX

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

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

func (*NodeSelect) String

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

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

func (*NodeSelect) StringX

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

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

func (*NodeSelect) Strings

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

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

func (*NodeSelect) StringsX

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

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

type NodeState

type NodeState struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Nid holds the value of the "nid" field.
	Nid int `json:"nid,omitempty"`
	// State holds the value of the "state" field.
	State string `json:"state,omitempty"`
	// ChangedAt holds the value of the "changed_at" field.
	ChangedAt time.Time `json:"changed_at,omitempty"`
	// ChangedBy holds the value of the "changed_by" field.
	ChangedBy int `json:"changed_by,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NodeStateQuery when eager-loading is set.
	Edges NodeStateEdges `json:"edges"`
	// contains filtered or unexported fields
}

NodeState is the model entity for the NodeState schema.

func (*NodeState) QueryNode

func (_m *NodeState) QueryNode() *NodeQuery

QueryNode queries the "node" edge of the NodeState entity.

func (*NodeState) String

func (_m *NodeState) String() string

String implements the fmt.Stringer.

func (*NodeState) Unwrap

func (_m *NodeState) Unwrap() *NodeState

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

func (_m *NodeState) Update() *NodeStateUpdateOne

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

func (*NodeState) Value

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

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

type NodeStateClient

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

NodeStateClient is a client for the NodeState schema.

func NewNodeStateClient

func NewNodeStateClient(c config) *NodeStateClient

NewNodeStateClient returns a client for the NodeState from the given config.

func (*NodeStateClient) Create

func (c *NodeStateClient) Create() *NodeStateCreate

Create returns a builder for creating a NodeState entity.

func (*NodeStateClient) CreateBulk

func (c *NodeStateClient) CreateBulk(builders ...*NodeStateCreate) *NodeStateCreateBulk

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

func (*NodeStateClient) Delete

func (c *NodeStateClient) Delete() *NodeStateDelete

Delete returns a delete builder for NodeState.

func (*NodeStateClient) DeleteOne

func (c *NodeStateClient) DeleteOne(_m *NodeState) *NodeStateDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NodeStateClient) DeleteOneID

func (c *NodeStateClient) DeleteOneID(id int) *NodeStateDeleteOne

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

func (*NodeStateClient) Get

func (c *NodeStateClient) Get(ctx context.Context, id int) (*NodeState, error)

Get returns a NodeState entity by its id.

func (*NodeStateClient) GetX

func (c *NodeStateClient) GetX(ctx context.Context, id int) *NodeState

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

func (*NodeStateClient) Hooks

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

Hooks returns the client hooks.

func (*NodeStateClient) Intercept

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

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

func (*NodeStateClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NodeStateClient) MapCreateBulk

func (c *NodeStateClient) MapCreateBulk(slice any, setFunc func(*NodeStateCreate, int)) *NodeStateCreateBulk

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

func (c *NodeStateClient) Query() *NodeStateQuery

Query returns a query builder for NodeState.

func (*NodeStateClient) QueryNode

func (c *NodeStateClient) QueryNode(_m *NodeState) *NodeQuery

QueryNode queries the node edge of a NodeState.

func (*NodeStateClient) Update

func (c *NodeStateClient) Update() *NodeStateUpdate

Update returns an update builder for NodeState.

func (*NodeStateClient) UpdateOne

func (c *NodeStateClient) UpdateOne(_m *NodeState) *NodeStateUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NodeStateClient) UpdateOneID

func (c *NodeStateClient) UpdateOneID(id int) *NodeStateUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NodeStateClient) Use

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

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

type NodeStateCreate

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

NodeStateCreate is the builder for creating a NodeState entity.

func (*NodeStateCreate) Exec

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

Exec executes the query.

func (*NodeStateCreate) ExecX

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

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

func (*NodeStateCreate) Mutation

func (_c *NodeStateCreate) Mutation() *NodeStateMutation

Mutation returns the NodeStateMutation object of the builder.

func (*NodeStateCreate) Save

func (_c *NodeStateCreate) Save(ctx context.Context) (*NodeState, error)

Save creates the NodeState in the database.

func (*NodeStateCreate) SaveX

func (_c *NodeStateCreate) SaveX(ctx context.Context) *NodeState

SaveX calls Save and panics if Save returns an error.

func (*NodeStateCreate) SetChangedAt

func (_c *NodeStateCreate) SetChangedAt(v time.Time) *NodeStateCreate

SetChangedAt sets the "changed_at" field.

func (*NodeStateCreate) SetChangedBy

func (_c *NodeStateCreate) SetChangedBy(v int) *NodeStateCreate

SetChangedBy sets the "changed_by" field.

func (*NodeStateCreate) SetID

func (_c *NodeStateCreate) SetID(v int) *NodeStateCreate

SetID sets the "id" field.

func (*NodeStateCreate) SetNid

func (_c *NodeStateCreate) SetNid(v int) *NodeStateCreate

SetNid sets the "nid" field.

func (*NodeStateCreate) SetNillableChangedBy

func (_c *NodeStateCreate) SetNillableChangedBy(v *int) *NodeStateCreate

SetNillableChangedBy sets the "changed_by" field if the given value is not nil.

func (*NodeStateCreate) SetNode

func (_c *NodeStateCreate) SetNode(v *Node) *NodeStateCreate

SetNode sets the "node" edge to the Node entity.

func (*NodeStateCreate) SetNodeID

func (_c *NodeStateCreate) SetNodeID(id int) *NodeStateCreate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*NodeStateCreate) SetState

func (_c *NodeStateCreate) SetState(v string) *NodeStateCreate

SetState sets the "state" field.

type NodeStateCreateBulk

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

NodeStateCreateBulk is the builder for creating many NodeState entities in bulk.

func (*NodeStateCreateBulk) Exec

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

Exec executes the query.

func (*NodeStateCreateBulk) ExecX

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

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

func (*NodeStateCreateBulk) Save

func (_c *NodeStateCreateBulk) Save(ctx context.Context) ([]*NodeState, error)

Save creates the NodeState entities in the database.

func (*NodeStateCreateBulk) SaveX

func (_c *NodeStateCreateBulk) SaveX(ctx context.Context) []*NodeState

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

type NodeStateDelete

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

NodeStateDelete is the builder for deleting a NodeState entity.

func (*NodeStateDelete) Exec

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

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

func (*NodeStateDelete) ExecX

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

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

func (*NodeStateDelete) Where

Where appends a list predicates to the NodeStateDelete builder.

type NodeStateDeleteOne

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

NodeStateDeleteOne is the builder for deleting a single NodeState entity.

func (*NodeStateDeleteOne) Exec

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

Exec executes the deletion query.

func (*NodeStateDeleteOne) ExecX

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

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

func (*NodeStateDeleteOne) Where

Where appends a list predicates to the NodeStateDelete builder.

type NodeStateEdges

type NodeStateEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// contains filtered or unexported fields
}

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

func (NodeStateEdges) NodeOrErr

func (e NodeStateEdges) NodeOrErr() (*Node, error)

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

type NodeStateGroupBy

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

NodeStateGroupBy is the group-by builder for NodeState entities.

func (*NodeStateGroupBy) Aggregate

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

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

func (*NodeStateGroupBy) Bool

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

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

func (*NodeStateGroupBy) BoolX

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

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

func (*NodeStateGroupBy) Bools

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

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

func (*NodeStateGroupBy) BoolsX

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

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

func (*NodeStateGroupBy) Float64

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

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

func (*NodeStateGroupBy) Float64X

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

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

func (*NodeStateGroupBy) Float64s

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

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

func (*NodeStateGroupBy) Float64sX

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

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

func (*NodeStateGroupBy) Int

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

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

func (*NodeStateGroupBy) IntX

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

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

func (*NodeStateGroupBy) Ints

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

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

func (*NodeStateGroupBy) IntsX

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

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

func (*NodeStateGroupBy) Scan

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

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

func (*NodeStateGroupBy) ScanX

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

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

func (*NodeStateGroupBy) String

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

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

func (*NodeStateGroupBy) StringX

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

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

func (*NodeStateGroupBy) Strings

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

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

func (*NodeStateGroupBy) StringsX

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

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

type NodeStateMutation

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

NodeStateMutation represents an operation that mutates the NodeState nodes in the graph.

func (*NodeStateMutation) AddChangedBy

func (m *NodeStateMutation) AddChangedBy(i int)

AddChangedBy adds i to the "changed_by" field.

func (*NodeStateMutation) AddField

func (m *NodeStateMutation) 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 (*NodeStateMutation) AddedChangedBy

func (m *NodeStateMutation) AddedChangedBy() (r int, exists bool)

AddedChangedBy returns the value that was added to the "changed_by" field in this mutation.

func (*NodeStateMutation) AddedEdges

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

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

func (*NodeStateMutation) AddedField

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

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

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

func (*NodeStateMutation) AddedIDs

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

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

func (*NodeStateMutation) ChangedAt

func (m *NodeStateMutation) ChangedAt() (r time.Time, exists bool)

ChangedAt returns the value of the "changed_at" field in the mutation.

func (*NodeStateMutation) ChangedBy

func (m *NodeStateMutation) ChangedBy() (r int, exists bool)

ChangedBy returns the value of the "changed_by" field in the mutation.

func (*NodeStateMutation) ClearEdge

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

func (m *NodeStateMutation) 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 (*NodeStateMutation) ClearNode

func (m *NodeStateMutation) ClearNode()

ClearNode clears the "node" edge to the Node entity.

func (*NodeStateMutation) ClearedEdges

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

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

func (*NodeStateMutation) ClearedFields

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

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

func (NodeStateMutation) Client

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

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

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

func (*NodeStateMutation) Field

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

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

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

func (*NodeStateMutation) Fields

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

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

func (m *NodeStateMutation) 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 (*NodeStateMutation) Nid

func (m *NodeStateMutation) Nid() (r int, exists bool)

Nid returns the value of the "nid" field in the mutation.

func (*NodeStateMutation) NodeCleared

func (m *NodeStateMutation) NodeCleared() bool

NodeCleared reports if the "node" edge to the Node entity was cleared.

func (*NodeStateMutation) NodeID

func (m *NodeStateMutation) NodeID() (id int, exists bool)

NodeID returns the "node" edge ID in the mutation.

func (*NodeStateMutation) NodeIDs

func (m *NodeStateMutation) NodeIDs() (ids []int)

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

func (*NodeStateMutation) OldChangedAt

func (m *NodeStateMutation) OldChangedAt(ctx context.Context) (v time.Time, err error)

OldChangedAt returns the old "changed_at" field's value of the NodeState entity. If the NodeState 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 (*NodeStateMutation) OldChangedBy

func (m *NodeStateMutation) OldChangedBy(ctx context.Context) (v int, err error)

OldChangedBy returns the old "changed_by" field's value of the NodeState entity. If the NodeState 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 (*NodeStateMutation) OldField

func (m *NodeStateMutation) 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 (*NodeStateMutation) OldNid

func (m *NodeStateMutation) OldNid(ctx context.Context) (v int, err error)

OldNid returns the old "nid" field's value of the NodeState entity. If the NodeState 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 (*NodeStateMutation) OldState

func (m *NodeStateMutation) OldState(ctx context.Context) (v string, err error)

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

func (m *NodeStateMutation) Op() Op

Op returns the operation name.

func (*NodeStateMutation) RemovedEdges

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

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

func (*NodeStateMutation) RemovedIDs

func (m *NodeStateMutation) 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 (*NodeStateMutation) ResetChangedAt

func (m *NodeStateMutation) ResetChangedAt()

ResetChangedAt resets all changes to the "changed_at" field.

func (*NodeStateMutation) ResetChangedBy

func (m *NodeStateMutation) ResetChangedBy()

ResetChangedBy resets all changes to the "changed_by" field.

func (*NodeStateMutation) ResetEdge

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

func (m *NodeStateMutation) 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 (*NodeStateMutation) ResetNid

func (m *NodeStateMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*NodeStateMutation) ResetNode

func (m *NodeStateMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*NodeStateMutation) ResetState

func (m *NodeStateMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*NodeStateMutation) SetChangedAt

func (m *NodeStateMutation) SetChangedAt(t time.Time)

SetChangedAt sets the "changed_at" field.

func (*NodeStateMutation) SetChangedBy

func (m *NodeStateMutation) SetChangedBy(i int)

SetChangedBy sets the "changed_by" field.

func (*NodeStateMutation) SetField

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

func (m *NodeStateMutation) SetID(id int)

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

func (*NodeStateMutation) SetNid

func (m *NodeStateMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*NodeStateMutation) SetNodeID

func (m *NodeStateMutation) SetNodeID(id int)

SetNodeID sets the "node" edge to the Node entity by id.

func (*NodeStateMutation) SetOp

func (m *NodeStateMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NodeStateMutation) SetState

func (m *NodeStateMutation) SetState(s string)

SetState sets the "state" field.

func (*NodeStateMutation) State

func (m *NodeStateMutation) State() (r string, exists bool)

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

func (NodeStateMutation) Tx

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

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

func (*NodeStateMutation) Type

func (m *NodeStateMutation) Type() string

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

func (*NodeStateMutation) Where

func (m *NodeStateMutation) Where(ps ...predicate.NodeState)

Where appends a list predicates to the NodeStateMutation builder.

func (*NodeStateMutation) WhereP

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

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

type NodeStateQuery

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

NodeStateQuery is the builder for querying NodeState entities.

func (*NodeStateQuery) Aggregate

func (_q *NodeStateQuery) Aggregate(fns ...AggregateFunc) *NodeStateSelect

Aggregate returns a NodeStateSelect configured with the given aggregations.

func (*NodeStateQuery) All

func (_q *NodeStateQuery) All(ctx context.Context) ([]*NodeState, error)

All executes the query and returns a list of NodeStates.

func (*NodeStateQuery) AllX

func (_q *NodeStateQuery) AllX(ctx context.Context) []*NodeState

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

func (*NodeStateQuery) Clone

func (_q *NodeStateQuery) Clone() *NodeStateQuery

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

func (*NodeStateQuery) Count

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

Count returns the count of the given query.

func (*NodeStateQuery) CountX

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

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

func (*NodeStateQuery) Exist

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

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

func (*NodeStateQuery) ExistX

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

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

func (*NodeStateQuery) First

func (_q *NodeStateQuery) First(ctx context.Context) (*NodeState, error)

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

func (*NodeStateQuery) FirstID

func (_q *NodeStateQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NodeStateQuery) FirstIDX

func (_q *NodeStateQuery) FirstIDX(ctx context.Context) int

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

func (*NodeStateQuery) FirstX

func (_q *NodeStateQuery) FirstX(ctx context.Context) *NodeState

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

func (*NodeStateQuery) GroupBy

func (_q *NodeStateQuery) GroupBy(field string, fields ...string) *NodeStateGroupBy

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 {
	Nid int `json:"nid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NodeState.Query().
	GroupBy(nodestate.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*NodeStateQuery) IDs

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

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

func (*NodeStateQuery) IDsX

func (_q *NodeStateQuery) IDsX(ctx context.Context) []int

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

func (*NodeStateQuery) Limit

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

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

func (*NodeStateQuery) Offset

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

Offset to start from.

func (*NodeStateQuery) Only

func (_q *NodeStateQuery) Only(ctx context.Context) (*NodeState, error)

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

func (*NodeStateQuery) OnlyID

func (_q *NodeStateQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NodeStateQuery) OnlyIDX

func (_q *NodeStateQuery) OnlyIDX(ctx context.Context) int

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

func (*NodeStateQuery) OnlyX

func (_q *NodeStateQuery) OnlyX(ctx context.Context) *NodeState

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

func (*NodeStateQuery) Order

Order specifies how the records should be ordered.

func (*NodeStateQuery) QueryNode

func (_q *NodeStateQuery) QueryNode() *NodeQuery

QueryNode chains the current query on the "node" edge.

func (*NodeStateQuery) Select

func (_q *NodeStateQuery) Select(fields ...string) *NodeStateSelect

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 {
	Nid int `json:"nid,omitempty"`
}

client.NodeState.Query().
	Select(nodestate.FieldNid).
	Scan(ctx, &v)

func (*NodeStateQuery) Unique

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

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

Where adds a new predicate for the NodeStateQuery builder.

func (*NodeStateQuery) WithNode

func (_q *NodeStateQuery) WithNode(opts ...func(*NodeQuery)) *NodeStateQuery

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

type NodeStateSelect

type NodeStateSelect struct {
	*NodeStateQuery
	// contains filtered or unexported fields
}

NodeStateSelect is the builder for selecting fields of NodeState entities.

func (*NodeStateSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*NodeStateSelect) Bool

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

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

func (*NodeStateSelect) BoolX

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

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

func (*NodeStateSelect) Bools

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

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

func (*NodeStateSelect) BoolsX

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

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

func (*NodeStateSelect) Float64

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

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

func (*NodeStateSelect) Float64X

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

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

func (*NodeStateSelect) Float64s

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

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

func (*NodeStateSelect) Float64sX

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

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

func (*NodeStateSelect) Int

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

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

func (*NodeStateSelect) IntX

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

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

func (*NodeStateSelect) Ints

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

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

func (*NodeStateSelect) IntsX

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

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

func (*NodeStateSelect) Scan

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

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

func (*NodeStateSelect) ScanX

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

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

func (*NodeStateSelect) String

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

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

func (*NodeStateSelect) StringX

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

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

func (*NodeStateSelect) Strings

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

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

func (*NodeStateSelect) StringsX

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

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

type NodeStateUpdate

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

NodeStateUpdate is the builder for updating NodeState entities.

func (*NodeStateUpdate) AddChangedBy

func (_u *NodeStateUpdate) AddChangedBy(v int) *NodeStateUpdate

AddChangedBy adds value to the "changed_by" field.

func (*NodeStateUpdate) ClearNode

func (_u *NodeStateUpdate) ClearNode() *NodeStateUpdate

ClearNode clears the "node" edge to the Node entity.

func (*NodeStateUpdate) Exec

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

Exec executes the query.

func (*NodeStateUpdate) ExecX

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

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

func (*NodeStateUpdate) Mutation

func (_u *NodeStateUpdate) Mutation() *NodeStateMutation

Mutation returns the NodeStateMutation object of the builder.

func (*NodeStateUpdate) Save

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

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

func (*NodeStateUpdate) SaveX

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

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

func (*NodeStateUpdate) SetChangedAt

func (_u *NodeStateUpdate) SetChangedAt(v time.Time) *NodeStateUpdate

SetChangedAt sets the "changed_at" field.

func (*NodeStateUpdate) SetChangedBy

func (_u *NodeStateUpdate) SetChangedBy(v int) *NodeStateUpdate

SetChangedBy sets the "changed_by" field.

func (*NodeStateUpdate) SetNid

func (_u *NodeStateUpdate) SetNid(v int) *NodeStateUpdate

SetNid sets the "nid" field.

func (*NodeStateUpdate) SetNillableChangedAt

func (_u *NodeStateUpdate) SetNillableChangedAt(v *time.Time) *NodeStateUpdate

SetNillableChangedAt sets the "changed_at" field if the given value is not nil.

func (*NodeStateUpdate) SetNillableChangedBy

func (_u *NodeStateUpdate) SetNillableChangedBy(v *int) *NodeStateUpdate

SetNillableChangedBy sets the "changed_by" field if the given value is not nil.

func (*NodeStateUpdate) SetNillableNid

func (_u *NodeStateUpdate) SetNillableNid(v *int) *NodeStateUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*NodeStateUpdate) SetNillableState

func (_u *NodeStateUpdate) SetNillableState(v *string) *NodeStateUpdate

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

func (*NodeStateUpdate) SetNode

func (_u *NodeStateUpdate) SetNode(v *Node) *NodeStateUpdate

SetNode sets the "node" edge to the Node entity.

func (*NodeStateUpdate) SetNodeID

func (_u *NodeStateUpdate) SetNodeID(id int) *NodeStateUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*NodeStateUpdate) SetState

func (_u *NodeStateUpdate) SetState(v string) *NodeStateUpdate

SetState sets the "state" field.

func (*NodeStateUpdate) Where

Where appends a list predicates to the NodeStateUpdate builder.

type NodeStateUpdateOne

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

NodeStateUpdateOne is the builder for updating a single NodeState entity.

func (*NodeStateUpdateOne) AddChangedBy

func (_u *NodeStateUpdateOne) AddChangedBy(v int) *NodeStateUpdateOne

AddChangedBy adds value to the "changed_by" field.

func (*NodeStateUpdateOne) ClearNode

func (_u *NodeStateUpdateOne) ClearNode() *NodeStateUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*NodeStateUpdateOne) Exec

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

Exec executes the query on the entity.

func (*NodeStateUpdateOne) ExecX

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

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

func (*NodeStateUpdateOne) Mutation

func (_u *NodeStateUpdateOne) Mutation() *NodeStateMutation

Mutation returns the NodeStateMutation object of the builder.

func (*NodeStateUpdateOne) Save

func (_u *NodeStateUpdateOne) Save(ctx context.Context) (*NodeState, error)

Save executes the query and returns the updated NodeState entity.

func (*NodeStateUpdateOne) SaveX

func (_u *NodeStateUpdateOne) SaveX(ctx context.Context) *NodeState

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

func (*NodeStateUpdateOne) Select

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

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

func (*NodeStateUpdateOne) SetChangedAt

func (_u *NodeStateUpdateOne) SetChangedAt(v time.Time) *NodeStateUpdateOne

SetChangedAt sets the "changed_at" field.

func (*NodeStateUpdateOne) SetChangedBy

func (_u *NodeStateUpdateOne) SetChangedBy(v int) *NodeStateUpdateOne

SetChangedBy sets the "changed_by" field.

func (*NodeStateUpdateOne) SetNid

func (_u *NodeStateUpdateOne) SetNid(v int) *NodeStateUpdateOne

SetNid sets the "nid" field.

func (*NodeStateUpdateOne) SetNillableChangedAt

func (_u *NodeStateUpdateOne) SetNillableChangedAt(v *time.Time) *NodeStateUpdateOne

SetNillableChangedAt sets the "changed_at" field if the given value is not nil.

func (*NodeStateUpdateOne) SetNillableChangedBy

func (_u *NodeStateUpdateOne) SetNillableChangedBy(v *int) *NodeStateUpdateOne

SetNillableChangedBy sets the "changed_by" field if the given value is not nil.

func (*NodeStateUpdateOne) SetNillableNid

func (_u *NodeStateUpdateOne) SetNillableNid(v *int) *NodeStateUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*NodeStateUpdateOne) SetNillableState

func (_u *NodeStateUpdateOne) SetNillableState(v *string) *NodeStateUpdateOne

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

func (*NodeStateUpdateOne) SetNode

func (_u *NodeStateUpdateOne) SetNode(v *Node) *NodeStateUpdateOne

SetNode sets the "node" edge to the Node entity.

func (*NodeStateUpdateOne) SetNodeID

func (_u *NodeStateUpdateOne) SetNodeID(id int) *NodeStateUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*NodeStateUpdateOne) SetState

func (_u *NodeStateUpdateOne) SetState(v string) *NodeStateUpdateOne

SetState sets the "state" field.

func (*NodeStateUpdateOne) Where

Where appends a list predicates to the NodeStateUpdate builder.

type NodeStates

type NodeStates []*NodeState

NodeStates is a parsable slice of NodeState.

type NodeUpdate

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

NodeUpdate is the builder for updating Node entities.

func (*NodeUpdate) Exec

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

Exec executes the query.

func (*NodeUpdate) ExecX

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

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

func (*NodeUpdate) Mutation

func (_u *NodeUpdate) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdate) Save

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

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

func (*NodeUpdate) SaveX

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

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

func (*NodeUpdate) Where

func (_u *NodeUpdate) Where(ps ...predicate.Node) *NodeUpdate

Where appends a list predicates to the NodeUpdate builder.

type NodeUpdateOne

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

NodeUpdateOne is the builder for updating a single Node entity.

func (*NodeUpdateOne) Exec

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

Exec executes the query on the entity.

func (*NodeUpdateOne) ExecX

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

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

func (*NodeUpdateOne) Mutation

func (_u *NodeUpdateOne) Mutation() *NodeMutation

Mutation returns the NodeMutation object of the builder.

func (*NodeUpdateOne) Save

func (_u *NodeUpdateOne) Save(ctx context.Context) (*Node, error)

Save executes the query and returns the updated Node entity.

func (*NodeUpdateOne) SaveX

func (_u *NodeUpdateOne) SaveX(ctx context.Context) *Node

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

func (*NodeUpdateOne) Select

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

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

func (*NodeUpdateOne) Where

func (_u *NodeUpdateOne) Where(ps ...predicate.Node) *NodeUpdateOne

Where appends a list predicates to the NodeUpdate builder.

type Nodes

type Nodes []*Node

Nodes is a parsable slice of Node.

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 {

	// History is the client for interacting with the History builders.
	History *HistoryClient
	// Lock is the client for interacting with the Lock builders.
	Lock *LockClient
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// NodeState is the client for interacting with the NodeState builders.
	NodeState *NodeStateClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserSettings is the client for interacting with the UserSettings builders.
	UserSettings *UserSettingsClient
	// WorkflowSettings is the client for interacting with the WorkflowSettings builders.
	WorkflowSettings *WorkflowSettingsClient
	// WorkflowState is the client for interacting with the WorkflowState builders.
	WorkflowState *WorkflowStateClient
	// WorkflowTransition is the client for interacting with the WorkflowTransition builders.
	WorkflowTransition *WorkflowTransitionClient
	// 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 User added in v0.1.2

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String added in v0.1.2

func (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap added in v0.1.2

func (_m *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update added in v0.1.2

func (_m *User) Update() *UserUpdateOne

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

func (*User) Value added in v0.1.2

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

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

type UserClient added in v0.1.2

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

UserClient is a client for the User schema.

func NewUserClient added in v0.1.2

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create added in v0.1.2

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk added in v0.1.2

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete added in v0.1.2

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne added in v0.1.2

func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID added in v0.1.2

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

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

func (*UserClient) Get added in v0.1.2

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX added in v0.1.2

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks added in v0.1.2

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

Hooks returns the client hooks.

func (*UserClient) Intercept added in v0.1.2

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

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

func (*UserClient) Interceptors added in v0.1.2

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

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk added in v0.1.2

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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 (*UserClient) Query added in v0.1.2

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update added in v0.1.2

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne added in v0.1.2

func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID added in v0.1.2

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use added in v0.1.2

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

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

type UserCreate added in v0.1.2

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec added in v0.1.2

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

Exec executes the query.

func (*UserCreate) ExecX added in v0.1.2

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

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

func (*UserCreate) Mutation added in v0.1.2

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save added in v0.1.2

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX added in v0.1.2

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetID added in v0.1.2

func (_c *UserCreate) SetID(v int) *UserCreate

SetID sets the "id" field.

type UserCreateBulk added in v0.1.2

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec added in v0.1.2

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

Exec executes the query.

func (*UserCreateBulk) ExecX added in v0.1.2

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

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

func (*UserCreateBulk) Save added in v0.1.2

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX added in v0.1.2

func (_c *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete added in v0.1.2

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec added in v0.1.2

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

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

func (*UserDelete) ExecX added in v0.1.2

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

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

func (*UserDelete) Where added in v0.1.2

func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne added in v0.1.2

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec added in v0.1.2

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

Exec executes the deletion query.

func (*UserDeleteOne) ExecX added in v0.1.2

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

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

func (*UserDeleteOne) Where added in v0.1.2

func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserGroupBy added in v0.1.2

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate added in v0.1.2

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

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

func (*UserGroupBy) Bool added in v0.1.2

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

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

func (*UserGroupBy) BoolX added in v0.1.2

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

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

func (*UserGroupBy) Bools added in v0.1.2

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

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

func (*UserGroupBy) BoolsX added in v0.1.2

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

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

func (*UserGroupBy) Float64 added in v0.1.2

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

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

func (*UserGroupBy) Float64X added in v0.1.2

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

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

func (*UserGroupBy) Float64s added in v0.1.2

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX added in v0.1.2

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int added in v0.1.2

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX added in v0.1.2

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints added in v0.1.2

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX added in v0.1.2

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan added in v0.1.2

func (_g *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX added in v0.1.2

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String added in v0.1.2

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX added in v0.1.2

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings added in v0.1.2

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX added in v0.1.2

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation added in v0.1.2

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) AddedEdges added in v0.1.2

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) AddedFields added in v0.1.2

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs added in v0.1.2

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) ClearField added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) ClearedEdges added in v0.1.2

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields added in v0.1.2

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client added in v0.1.2

func (m UserMutation) 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 (*UserMutation) EdgeCleared added in v0.1.2

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) FieldCleared added in v0.1.2

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) ID added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) IDs added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) OldField added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) Op added in v0.1.2

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemovedEdges added in v0.1.2

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) ResetEdge added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) ResetField added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) SetField added in v0.1.2

func (m *UserMutation) 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 (*UserMutation) SetID added in v0.1.2

func (m *UserMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetOp added in v0.1.2

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (UserMutation) Tx added in v0.1.2

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type added in v0.1.2

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) Where added in v0.1.2

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP added in v0.1.2

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery added in v0.1.2

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate added in v0.1.2

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All added in v0.1.2

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX added in v0.1.2

func (_q *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone added in v0.1.2

func (_q *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count added in v0.1.2

func (_q *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX added in v0.1.2

func (_q *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist added in v0.1.2

func (_q *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX added in v0.1.2

func (_q *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First added in v0.1.2

func (_q *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID added in v0.1.2

func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX added in v0.1.2

func (_q *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX added in v0.1.2

func (_q *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy added in v0.1.2

func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*UserQuery) IDs added in v0.1.2

func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX added in v0.1.2

func (_q *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit added in v0.1.2

func (_q *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset added in v0.1.2

func (_q *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only added in v0.1.2

func (_q *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID added in v0.1.2

func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX added in v0.1.2

func (_q *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX added in v0.1.2

func (_q *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order added in v0.1.2

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Select added in v0.1.2

func (_q *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*UserQuery) Unique added in v0.1.2

func (_q *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where added in v0.1.2

func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect added in v0.1.2

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate added in v0.1.2

func (_s *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool added in v0.1.2

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX added in v0.1.2

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools added in v0.1.2

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX added in v0.1.2

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64 added in v0.1.2

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X added in v0.1.2

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s added in v0.1.2

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX added in v0.1.2

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int added in v0.1.2

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX added in v0.1.2

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints added in v0.1.2

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX added in v0.1.2

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan added in v0.1.2

func (_s *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX added in v0.1.2

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String added in v0.1.2

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX added in v0.1.2

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings added in v0.1.2

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX added in v0.1.2

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserSettings added in v0.1.2

type UserSettings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// Mail holds the value of the "mail" field.
	Mail bool `json:"mail,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserSettingsQuery when eager-loading is set.
	Edges UserSettingsEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserSettings is the model entity for the UserSettings schema.

func (*UserSettings) QueryUser added in v0.1.2

func (_m *UserSettings) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserSettings entity.

func (*UserSettings) String added in v0.1.2

func (_m *UserSettings) String() string

String implements the fmt.Stringer.

func (*UserSettings) Unwrap added in v0.1.2

func (_m *UserSettings) Unwrap() *UserSettings

Unwrap unwraps the UserSettings 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 (*UserSettings) Update added in v0.1.2

func (_m *UserSettings) Update() *UserSettingsUpdateOne

Update returns a builder for updating this UserSettings. Note that you need to call UserSettings.Unwrap() before calling this method if this UserSettings was returned from a transaction, and the transaction was committed or rolled back.

func (*UserSettings) Value added in v0.1.2

func (_m *UserSettings) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserSettings. This includes values selected through modifiers, order, etc.

type UserSettingsClient added in v0.1.2

type UserSettingsClient struct {
	// contains filtered or unexported fields
}

UserSettingsClient is a client for the UserSettings schema.

func NewUserSettingsClient added in v0.1.2

func NewUserSettingsClient(c config) *UserSettingsClient

NewUserSettingsClient returns a client for the UserSettings from the given config.

func (*UserSettingsClient) Create added in v0.1.2

Create returns a builder for creating a UserSettings entity.

func (*UserSettingsClient) CreateBulk added in v0.1.2

func (c *UserSettingsClient) CreateBulk(builders ...*UserSettingsCreate) *UserSettingsCreateBulk

CreateBulk returns a builder for creating a bulk of UserSettings entities.

func (*UserSettingsClient) Delete added in v0.1.2

Delete returns a delete builder for UserSettings.

func (*UserSettingsClient) DeleteOne added in v0.1.2

DeleteOne returns a builder for deleting the given entity.

func (*UserSettingsClient) DeleteOneID added in v0.1.2

func (c *UserSettingsClient) DeleteOneID(id int) *UserSettingsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserSettingsClient) Get added in v0.1.2

Get returns a UserSettings entity by its id.

func (*UserSettingsClient) GetX added in v0.1.2

GetX is like Get, but panics if an error occurs.

func (*UserSettingsClient) Hooks added in v0.1.2

func (c *UserSettingsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserSettingsClient) Intercept added in v0.1.2

func (c *UserSettingsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usersettings.Intercept(f(g(h())))`.

func (*UserSettingsClient) Interceptors added in v0.1.2

func (c *UserSettingsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserSettingsClient) MapCreateBulk added in v0.1.2

func (c *UserSettingsClient) MapCreateBulk(slice any, setFunc func(*UserSettingsCreate, int)) *UserSettingsCreateBulk

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 (*UserSettingsClient) Query added in v0.1.2

Query returns a query builder for UserSettings.

func (*UserSettingsClient) QueryUser added in v0.1.2

func (c *UserSettingsClient) QueryUser(_m *UserSettings) *UserQuery

QueryUser queries the user edge of a UserSettings.

func (*UserSettingsClient) Update added in v0.1.2

Update returns an update builder for UserSettings.

func (*UserSettingsClient) UpdateOne added in v0.1.2

UpdateOne returns an update builder for the given entity.

func (*UserSettingsClient) UpdateOneID added in v0.1.2

func (c *UserSettingsClient) UpdateOneID(id int) *UserSettingsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserSettingsClient) Use added in v0.1.2

func (c *UserSettingsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usersettings.Hooks(f(g(h())))`.

type UserSettingsCreate added in v0.1.2

type UserSettingsCreate struct {
	// contains filtered or unexported fields
}

UserSettingsCreate is the builder for creating a UserSettings entity.

func (*UserSettingsCreate) Exec added in v0.1.2

func (_c *UserSettingsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSettingsCreate) ExecX added in v0.1.2

func (_c *UserSettingsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSettingsCreate) Mutation added in v0.1.2

func (_c *UserSettingsCreate) Mutation() *UserSettingsMutation

Mutation returns the UserSettingsMutation object of the builder.

func (*UserSettingsCreate) Save added in v0.1.2

Save creates the UserSettings in the database.

func (*UserSettingsCreate) SaveX added in v0.1.2

SaveX calls Save and panics if Save returns an error.

func (*UserSettingsCreate) SetID added in v0.1.2

SetID sets the "id" field.

func (*UserSettingsCreate) SetMail added in v0.1.2

func (_c *UserSettingsCreate) SetMail(v bool) *UserSettingsCreate

SetMail sets the "mail" field.

func (*UserSettingsCreate) SetNillableMail added in v0.1.2

func (_c *UserSettingsCreate) SetNillableMail(v *bool) *UserSettingsCreate

SetNillableMail sets the "mail" field if the given value is not nil.

func (*UserSettingsCreate) SetUser added in v0.1.2

func (_c *UserSettingsCreate) SetUser(v *User) *UserSettingsCreate

SetUser sets the "user" edge to the User entity.

func (*UserSettingsCreate) SetUserID added in v0.1.2

func (_c *UserSettingsCreate) SetUserID(v int) *UserSettingsCreate

SetUserID sets the "user_id" field.

type UserSettingsCreateBulk added in v0.1.2

type UserSettingsCreateBulk struct {
	// contains filtered or unexported fields
}

UserSettingsCreateBulk is the builder for creating many UserSettings entities in bulk.

func (*UserSettingsCreateBulk) Exec added in v0.1.2

Exec executes the query.

func (*UserSettingsCreateBulk) ExecX added in v0.1.2

func (_c *UserSettingsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSettingsCreateBulk) Save added in v0.1.2

Save creates the UserSettings entities in the database.

func (*UserSettingsCreateBulk) SaveX added in v0.1.2

SaveX is like Save, but panics if an error occurs.

type UserSettingsDelete added in v0.1.2

type UserSettingsDelete struct {
	// contains filtered or unexported fields
}

UserSettingsDelete is the builder for deleting a UserSettings entity.

func (*UserSettingsDelete) Exec added in v0.1.2

func (_d *UserSettingsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserSettingsDelete) ExecX added in v0.1.2

func (_d *UserSettingsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserSettingsDelete) Where added in v0.1.2

Where appends a list predicates to the UserSettingsDelete builder.

type UserSettingsDeleteOne added in v0.1.2

type UserSettingsDeleteOne struct {
	// contains filtered or unexported fields
}

UserSettingsDeleteOne is the builder for deleting a single UserSettings entity.

func (*UserSettingsDeleteOne) Exec added in v0.1.2

Exec executes the deletion query.

func (*UserSettingsDeleteOne) ExecX added in v0.1.2

func (_d *UserSettingsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSettingsDeleteOne) Where added in v0.1.2

Where appends a list predicates to the UserSettingsDelete builder.

type UserSettingsEdges added in v0.1.2

type UserSettingsEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

UserSettingsEdges holds the relations/edges for other nodes in the graph.

func (UserSettingsEdges) UserOrErr added in v0.1.2

func (e UserSettingsEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserSettingsGroupBy added in v0.1.2

type UserSettingsGroupBy struct {
	// contains filtered or unexported fields
}

UserSettingsGroupBy is the group-by builder for UserSettings entities.

func (*UserSettingsGroupBy) Aggregate added in v0.1.2

func (_g *UserSettingsGroupBy) Aggregate(fns ...AggregateFunc) *UserSettingsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserSettingsGroupBy) Bool added in v0.1.2

func (s *UserSettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) BoolX added in v0.1.2

func (s *UserSettingsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSettingsGroupBy) Bools added in v0.1.2

func (s *UserSettingsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) BoolsX added in v0.1.2

func (s *UserSettingsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSettingsGroupBy) Float64 added in v0.1.2

func (s *UserSettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) Float64X added in v0.1.2

func (s *UserSettingsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSettingsGroupBy) Float64s added in v0.1.2

func (s *UserSettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) Float64sX added in v0.1.2

func (s *UserSettingsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSettingsGroupBy) Int added in v0.1.2

func (s *UserSettingsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) IntX added in v0.1.2

func (s *UserSettingsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSettingsGroupBy) Ints added in v0.1.2

func (s *UserSettingsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) IntsX added in v0.1.2

func (s *UserSettingsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSettingsGroupBy) Scan added in v0.1.2

func (_g *UserSettingsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSettingsGroupBy) ScanX added in v0.1.2

func (s *UserSettingsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSettingsGroupBy) String added in v0.1.2

func (s *UserSettingsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) StringX added in v0.1.2

func (s *UserSettingsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSettingsGroupBy) Strings added in v0.1.2

func (s *UserSettingsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSettingsGroupBy) StringsX added in v0.1.2

func (s *UserSettingsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserSettingsMutation added in v0.1.2

type UserSettingsMutation struct {
	// contains filtered or unexported fields
}

UserSettingsMutation represents an operation that mutates the UserSettings nodes in the graph.

func (*UserSettingsMutation) AddField added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) AddedEdges added in v0.1.2

func (m *UserSettingsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserSettingsMutation) AddedField added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) AddedFields added in v0.1.2

func (m *UserSettingsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserSettingsMutation) AddedIDs added in v0.1.2

func (m *UserSettingsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserSettingsMutation) ClearEdge added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ClearField added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ClearUser added in v0.1.2

func (m *UserSettingsMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserSettingsMutation) ClearedEdges added in v0.1.2

func (m *UserSettingsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserSettingsMutation) ClearedFields added in v0.1.2

func (m *UserSettingsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserSettingsMutation) Client added in v0.1.2

func (m UserSettingsMutation) 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 (*UserSettingsMutation) EdgeCleared added in v0.1.2

func (m *UserSettingsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserSettingsMutation) Field added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) FieldCleared added in v0.1.2

func (m *UserSettingsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserSettingsMutation) Fields added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ID added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) IDs added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) Mail added in v0.1.2

func (m *UserSettingsMutation) Mail() (r bool, exists bool)

Mail returns the value of the "mail" field in the mutation.

func (*UserSettingsMutation) OldField added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) OldMail added in v0.1.2

func (m *UserSettingsMutation) OldMail(ctx context.Context) (v bool, err error)

OldMail returns the old "mail" field's value of the UserSettings entity. If the UserSettings 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 (*UserSettingsMutation) OldUserID added in v0.1.2

func (m *UserSettingsMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserSettings entity. If the UserSettings 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 (*UserSettingsMutation) Op added in v0.1.2

func (m *UserSettingsMutation) Op() Op

Op returns the operation name.

func (*UserSettingsMutation) RemovedEdges added in v0.1.2

func (m *UserSettingsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserSettingsMutation) RemovedIDs added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ResetEdge added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ResetField added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) ResetMail added in v0.1.2

func (m *UserSettingsMutation) ResetMail()

ResetMail resets all changes to the "mail" field.

func (*UserSettingsMutation) ResetUser added in v0.1.2

func (m *UserSettingsMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserSettingsMutation) ResetUserID added in v0.1.2

func (m *UserSettingsMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserSettingsMutation) SetField added in v0.1.2

func (m *UserSettingsMutation) 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 (*UserSettingsMutation) SetID added in v0.1.2

func (m *UserSettingsMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of UserSettings entities.

func (*UserSettingsMutation) SetMail added in v0.1.2

func (m *UserSettingsMutation) SetMail(b bool)

SetMail sets the "mail" field.

func (*UserSettingsMutation) SetOp added in v0.1.2

func (m *UserSettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserSettingsMutation) SetUserID added in v0.1.2

func (m *UserSettingsMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserSettingsMutation) Tx added in v0.1.2

func (m UserSettingsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserSettingsMutation) Type added in v0.1.2

func (m *UserSettingsMutation) Type() string

Type returns the node type of this mutation (UserSettings).

func (*UserSettingsMutation) UserCleared added in v0.1.2

func (m *UserSettingsMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserSettingsMutation) UserID added in v0.1.2

func (m *UserSettingsMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserSettingsMutation) UserIDs added in v0.1.2

func (m *UserSettingsMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*UserSettingsMutation) Where added in v0.1.2

Where appends a list predicates to the UserSettingsMutation builder.

func (*UserSettingsMutation) WhereP added in v0.1.2

func (m *UserSettingsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserSettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserSettingsQuery added in v0.1.2

type UserSettingsQuery struct {
	// contains filtered or unexported fields
}

UserSettingsQuery is the builder for querying UserSettings entities.

func (*UserSettingsQuery) Aggregate added in v0.1.2

func (_q *UserSettingsQuery) Aggregate(fns ...AggregateFunc) *UserSettingsSelect

Aggregate returns a UserSettingsSelect configured with the given aggregations.

func (*UserSettingsQuery) All added in v0.1.2

func (_q *UserSettingsQuery) All(ctx context.Context) ([]*UserSettings, error)

All executes the query and returns a list of UserSettingsSlice.

func (*UserSettingsQuery) AllX added in v0.1.2

func (_q *UserSettingsQuery) AllX(ctx context.Context) []*UserSettings

AllX is like All, but panics if an error occurs.

func (*UserSettingsQuery) Clone added in v0.1.2

func (_q *UserSettingsQuery) Clone() *UserSettingsQuery

Clone returns a duplicate of the UserSettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserSettingsQuery) Count added in v0.1.2

func (_q *UserSettingsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserSettingsQuery) CountX added in v0.1.2

func (_q *UserSettingsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserSettingsQuery) Exist added in v0.1.2

func (_q *UserSettingsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserSettingsQuery) ExistX added in v0.1.2

func (_q *UserSettingsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserSettingsQuery) First added in v0.1.2

func (_q *UserSettingsQuery) First(ctx context.Context) (*UserSettings, error)

First returns the first UserSettings entity from the query. Returns a *NotFoundError when no UserSettings was found.

func (*UserSettingsQuery) FirstID added in v0.1.2

func (_q *UserSettingsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserSettings ID from the query. Returns a *NotFoundError when no UserSettings ID was found.

func (*UserSettingsQuery) FirstIDX added in v0.1.2

func (_q *UserSettingsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserSettingsQuery) FirstX added in v0.1.2

func (_q *UserSettingsQuery) FirstX(ctx context.Context) *UserSettings

FirstX is like First, but panics if an error occurs.

func (*UserSettingsQuery) GroupBy added in v0.1.2

func (_q *UserSettingsQuery) GroupBy(field string, fields ...string) *UserSettingsGroupBy

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 {
	UserID int `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserSettings.Query().
	GroupBy(usersettings.FieldUserID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*UserSettingsQuery) IDs added in v0.1.2

func (_q *UserSettingsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserSettings IDs.

func (*UserSettingsQuery) IDsX added in v0.1.2

func (_q *UserSettingsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserSettingsQuery) Limit added in v0.1.2

func (_q *UserSettingsQuery) Limit(limit int) *UserSettingsQuery

Limit the number of records to be returned by this query.

func (*UserSettingsQuery) Offset added in v0.1.2

func (_q *UserSettingsQuery) Offset(offset int) *UserSettingsQuery

Offset to start from.

func (*UserSettingsQuery) Only added in v0.1.2

Only returns a single UserSettings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserSettings entity is found. Returns a *NotFoundError when no UserSettings entities are found.

func (*UserSettingsQuery) OnlyID added in v0.1.2

func (_q *UserSettingsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserSettings ID in the query. Returns a *NotSingularError when more than one UserSettings ID is found. Returns a *NotFoundError when no entities are found.

func (*UserSettingsQuery) OnlyIDX added in v0.1.2

func (_q *UserSettingsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserSettingsQuery) OnlyX added in v0.1.2

OnlyX is like Only, but panics if an error occurs.

func (*UserSettingsQuery) Order added in v0.1.2

Order specifies how the records should be ordered.

func (*UserSettingsQuery) QueryUser added in v0.1.2

func (_q *UserSettingsQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserSettingsQuery) Select added in v0.1.2

func (_q *UserSettingsQuery) Select(fields ...string) *UserSettingsSelect

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 {
	UserID int `json:"user_id,omitempty"`
}

client.UserSettings.Query().
	Select(usersettings.FieldUserID).
	Scan(ctx, &v)

func (*UserSettingsQuery) Unique added in v0.1.2

func (_q *UserSettingsQuery) Unique(unique bool) *UserSettingsQuery

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 (*UserSettingsQuery) Where added in v0.1.2

Where adds a new predicate for the UserSettingsQuery builder.

func (*UserSettingsQuery) WithUser added in v0.1.2

func (_q *UserSettingsQuery) WithUser(opts ...func(*UserQuery)) *UserSettingsQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type UserSettingsSelect added in v0.1.2

type UserSettingsSelect struct {
	*UserSettingsQuery
	// contains filtered or unexported fields
}

UserSettingsSelect is the builder for selecting fields of UserSettings entities.

func (*UserSettingsSelect) Aggregate added in v0.1.2

func (_s *UserSettingsSelect) Aggregate(fns ...AggregateFunc) *UserSettingsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSettingsSelect) Bool added in v0.1.2

func (s *UserSettingsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) BoolX added in v0.1.2

func (s *UserSettingsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSettingsSelect) Bools added in v0.1.2

func (s *UserSettingsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) BoolsX added in v0.1.2

func (s *UserSettingsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSettingsSelect) Float64 added in v0.1.2

func (s *UserSettingsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) Float64X added in v0.1.2

func (s *UserSettingsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSettingsSelect) Float64s added in v0.1.2

func (s *UserSettingsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) Float64sX added in v0.1.2

func (s *UserSettingsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSettingsSelect) Int added in v0.1.2

func (s *UserSettingsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) IntX added in v0.1.2

func (s *UserSettingsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSettingsSelect) Ints added in v0.1.2

func (s *UserSettingsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) IntsX added in v0.1.2

func (s *UserSettingsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSettingsSelect) Scan added in v0.1.2

func (_s *UserSettingsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSettingsSelect) ScanX added in v0.1.2

func (s *UserSettingsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSettingsSelect) String added in v0.1.2

func (s *UserSettingsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) StringX added in v0.1.2

func (s *UserSettingsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSettingsSelect) Strings added in v0.1.2

func (s *UserSettingsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSettingsSelect) StringsX added in v0.1.2

func (s *UserSettingsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserSettingsSlice added in v0.1.2

type UserSettingsSlice []*UserSettings

UserSettingsSlice is a parsable slice of UserSettings.

type UserSettingsUpdate added in v0.1.2

type UserSettingsUpdate struct {
	// contains filtered or unexported fields
}

UserSettingsUpdate is the builder for updating UserSettings entities.

func (*UserSettingsUpdate) ClearUser added in v0.1.2

func (_u *UserSettingsUpdate) ClearUser() *UserSettingsUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserSettingsUpdate) Exec added in v0.1.2

func (_u *UserSettingsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSettingsUpdate) ExecX added in v0.1.2

func (_u *UserSettingsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSettingsUpdate) Mutation added in v0.1.2

func (_u *UserSettingsUpdate) Mutation() *UserSettingsMutation

Mutation returns the UserSettingsMutation object of the builder.

func (*UserSettingsUpdate) Save added in v0.1.2

func (_u *UserSettingsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserSettingsUpdate) SaveX added in v0.1.2

func (_u *UserSettingsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserSettingsUpdate) SetMail added in v0.1.2

func (_u *UserSettingsUpdate) SetMail(v bool) *UserSettingsUpdate

SetMail sets the "mail" field.

func (*UserSettingsUpdate) SetNillableMail added in v0.1.2

func (_u *UserSettingsUpdate) SetNillableMail(v *bool) *UserSettingsUpdate

SetNillableMail sets the "mail" field if the given value is not nil.

func (*UserSettingsUpdate) SetNillableUserID added in v0.1.2

func (_u *UserSettingsUpdate) SetNillableUserID(v *int) *UserSettingsUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserSettingsUpdate) SetUser added in v0.1.2

func (_u *UserSettingsUpdate) SetUser(v *User) *UserSettingsUpdate

SetUser sets the "user" edge to the User entity.

func (*UserSettingsUpdate) SetUserID added in v0.1.2

func (_u *UserSettingsUpdate) SetUserID(v int) *UserSettingsUpdate

SetUserID sets the "user_id" field.

func (*UserSettingsUpdate) Where added in v0.1.2

Where appends a list predicates to the UserSettingsUpdate builder.

type UserSettingsUpdateOne added in v0.1.2

type UserSettingsUpdateOne struct {
	// contains filtered or unexported fields
}

UserSettingsUpdateOne is the builder for updating a single UserSettings entity.

func (*UserSettingsUpdateOne) ClearUser added in v0.1.2

ClearUser clears the "user" edge to the User entity.

func (*UserSettingsUpdateOne) Exec added in v0.1.2

Exec executes the query on the entity.

func (*UserSettingsUpdateOne) ExecX added in v0.1.2

func (_u *UserSettingsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserSettingsUpdateOne) Mutation added in v0.1.2

Mutation returns the UserSettingsMutation object of the builder.

func (*UserSettingsUpdateOne) Save added in v0.1.2

Save executes the query and returns the updated UserSettings entity.

func (*UserSettingsUpdateOne) SaveX added in v0.1.2

SaveX is like Save, but panics if an error occurs.

func (*UserSettingsUpdateOne) Select added in v0.1.2

func (_u *UserSettingsUpdateOne) Select(field string, fields ...string) *UserSettingsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserSettingsUpdateOne) SetMail added in v0.1.2

SetMail sets the "mail" field.

func (*UserSettingsUpdateOne) SetNillableMail added in v0.1.2

func (_u *UserSettingsUpdateOne) SetNillableMail(v *bool) *UserSettingsUpdateOne

SetNillableMail sets the "mail" field if the given value is not nil.

func (*UserSettingsUpdateOne) SetNillableUserID added in v0.1.2

func (_u *UserSettingsUpdateOne) SetNillableUserID(v *int) *UserSettingsUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserSettingsUpdateOne) SetUser added in v0.1.2

SetUser sets the "user" edge to the User entity.

func (*UserSettingsUpdateOne) SetUserID added in v0.1.2

SetUserID sets the "user_id" field.

func (*UserSettingsUpdateOne) Where added in v0.1.2

Where appends a list predicates to the UserSettingsUpdate builder.

type UserUpdate added in v0.1.2

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) Exec added in v0.1.2

func (_u *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX added in v0.1.2

func (_u *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation added in v0.1.2

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save added in v0.1.2

func (_u *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX added in v0.1.2

func (_u *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) Where added in v0.1.2

func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne added in v0.1.2

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) Exec added in v0.1.2

func (_u *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX added in v0.1.2

func (_u *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation added in v0.1.2

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save added in v0.1.2

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX added in v0.1.2

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select added in v0.1.2

func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) Where added in v0.1.2

func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users added in v0.1.2

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

type WorkflowSettings

type WorkflowSettings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ContentTypes holds the value of the "content_types" field.
	ContentTypes []string `json:"content_types,omitempty"`
	// LockMinutes holds the value of the "lock_minutes" field.
	LockMinutes int `json:"lock_minutes,omitempty"`
	// contains filtered or unexported fields
}

WorkflowSettings is the model entity for the WorkflowSettings schema.

func (*WorkflowSettings) String

func (_m *WorkflowSettings) String() string

String implements the fmt.Stringer.

func (*WorkflowSettings) Unwrap

func (_m *WorkflowSettings) Unwrap() *WorkflowSettings

Unwrap unwraps the WorkflowSettings 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 (*WorkflowSettings) Update

Update returns a builder for updating this WorkflowSettings. Note that you need to call WorkflowSettings.Unwrap() before calling this method if this WorkflowSettings was returned from a transaction, and the transaction was committed or rolled back.

func (*WorkflowSettings) Value

func (_m *WorkflowSettings) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WorkflowSettings. This includes values selected through modifiers, order, etc.

type WorkflowSettingsClient

type WorkflowSettingsClient struct {
	// contains filtered or unexported fields
}

WorkflowSettingsClient is a client for the WorkflowSettings schema.

func NewWorkflowSettingsClient

func NewWorkflowSettingsClient(c config) *WorkflowSettingsClient

NewWorkflowSettingsClient returns a client for the WorkflowSettings from the given config.

func (*WorkflowSettingsClient) Create

Create returns a builder for creating a WorkflowSettings entity.

func (*WorkflowSettingsClient) CreateBulk

CreateBulk returns a builder for creating a bulk of WorkflowSettings entities.

func (*WorkflowSettingsClient) Delete

Delete returns a delete builder for WorkflowSettings.

func (*WorkflowSettingsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkflowSettingsClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkflowSettingsClient) Get

Get returns a WorkflowSettings entity by its id.

func (*WorkflowSettingsClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WorkflowSettingsClient) Hooks

func (c *WorkflowSettingsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkflowSettingsClient) Intercept

func (c *WorkflowSettingsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workflowsettings.Intercept(f(g(h())))`.

func (*WorkflowSettingsClient) Interceptors

func (c *WorkflowSettingsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkflowSettingsClient) MapCreateBulk

func (c *WorkflowSettingsClient) MapCreateBulk(slice any, setFunc func(*WorkflowSettingsCreate, int)) *WorkflowSettingsCreateBulk

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 (*WorkflowSettingsClient) Query

Query returns a query builder for WorkflowSettings.

func (*WorkflowSettingsClient) Update

Update returns an update builder for WorkflowSettings.

func (*WorkflowSettingsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkflowSettingsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WorkflowSettingsClient) Use

func (c *WorkflowSettingsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workflowsettings.Hooks(f(g(h())))`.

type WorkflowSettingsCreate

type WorkflowSettingsCreate struct {
	// contains filtered or unexported fields
}

WorkflowSettingsCreate is the builder for creating a WorkflowSettings entity.

func (*WorkflowSettingsCreate) Exec

Exec executes the query.

func (*WorkflowSettingsCreate) ExecX

func (_c *WorkflowSettingsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowSettingsCreate) Mutation

Mutation returns the WorkflowSettingsMutation object of the builder.

func (*WorkflowSettingsCreate) Save

Save creates the WorkflowSettings in the database.

func (*WorkflowSettingsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WorkflowSettingsCreate) SetContentTypes

func (_c *WorkflowSettingsCreate) SetContentTypes(v []string) *WorkflowSettingsCreate

SetContentTypes sets the "content_types" field.

func (*WorkflowSettingsCreate) SetID

SetID sets the "id" field.

func (*WorkflowSettingsCreate) SetLockMinutes

func (_c *WorkflowSettingsCreate) SetLockMinutes(v int) *WorkflowSettingsCreate

SetLockMinutes sets the "lock_minutes" field.

func (*WorkflowSettingsCreate) SetNillableLockMinutes

func (_c *WorkflowSettingsCreate) SetNillableLockMinutes(v *int) *WorkflowSettingsCreate

SetNillableLockMinutes sets the "lock_minutes" field if the given value is not nil.

type WorkflowSettingsCreateBulk

type WorkflowSettingsCreateBulk struct {
	// contains filtered or unexported fields
}

WorkflowSettingsCreateBulk is the builder for creating many WorkflowSettings entities in bulk.

func (*WorkflowSettingsCreateBulk) Exec

Exec executes the query.

func (*WorkflowSettingsCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowSettingsCreateBulk) Save

Save creates the WorkflowSettings entities in the database.

func (*WorkflowSettingsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WorkflowSettingsDelete

type WorkflowSettingsDelete struct {
	// contains filtered or unexported fields
}

WorkflowSettingsDelete is the builder for deleting a WorkflowSettings entity.

func (*WorkflowSettingsDelete) Exec

func (_d *WorkflowSettingsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkflowSettingsDelete) ExecX

func (_d *WorkflowSettingsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowSettingsDelete) Where

Where appends a list predicates to the WorkflowSettingsDelete builder.

type WorkflowSettingsDeleteOne

type WorkflowSettingsDeleteOne struct {
	// contains filtered or unexported fields
}

WorkflowSettingsDeleteOne is the builder for deleting a single WorkflowSettings entity.

func (*WorkflowSettingsDeleteOne) Exec

Exec executes the deletion query.

func (*WorkflowSettingsDeleteOne) ExecX

func (_d *WorkflowSettingsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowSettingsDeleteOne) Where

Where appends a list predicates to the WorkflowSettingsDelete builder.

type WorkflowSettingsGroupBy

type WorkflowSettingsGroupBy struct {
	// contains filtered or unexported fields
}

WorkflowSettingsGroupBy is the group-by builder for WorkflowSettings entities.

func (*WorkflowSettingsGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkflowSettingsGroupBy) Bool

func (s *WorkflowSettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) BoolX

func (s *WorkflowSettingsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Bools

func (s *WorkflowSettingsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) BoolsX

func (s *WorkflowSettingsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Float64

func (s *WorkflowSettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) Float64X

func (s *WorkflowSettingsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Float64s

func (s *WorkflowSettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) Float64sX

func (s *WorkflowSettingsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Int

func (s *WorkflowSettingsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) IntX

func (s *WorkflowSettingsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Ints

func (s *WorkflowSettingsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) IntsX

func (s *WorkflowSettingsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Scan

func (_g *WorkflowSettingsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowSettingsGroupBy) ScanX

func (s *WorkflowSettingsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) String

func (s *WorkflowSettingsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) StringX

func (s *WorkflowSettingsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowSettingsGroupBy) Strings

func (s *WorkflowSettingsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsGroupBy) StringsX

func (s *WorkflowSettingsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowSettingsMutation

type WorkflowSettingsMutation struct {
	// contains filtered or unexported fields
}

WorkflowSettingsMutation represents an operation that mutates the WorkflowSettings nodes in the graph.

func (*WorkflowSettingsMutation) AddField

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) AddLockMinutes

func (m *WorkflowSettingsMutation) AddLockMinutes(i int)

AddLockMinutes adds i to the "lock_minutes" field.

func (*WorkflowSettingsMutation) AddedEdges

func (m *WorkflowSettingsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkflowSettingsMutation) AddedField

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) AddedFields

func (m *WorkflowSettingsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkflowSettingsMutation) AddedIDs

func (m *WorkflowSettingsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkflowSettingsMutation) AddedLockMinutes

func (m *WorkflowSettingsMutation) AddedLockMinutes() (r int, exists bool)

AddedLockMinutes returns the value that was added to the "lock_minutes" field in this mutation.

func (*WorkflowSettingsMutation) AppendContentTypes

func (m *WorkflowSettingsMutation) AppendContentTypes(s []string)

AppendContentTypes adds s to the "content_types" field.

func (*WorkflowSettingsMutation) AppendedContentTypes

func (m *WorkflowSettingsMutation) AppendedContentTypes() ([]string, bool)

AppendedContentTypes returns the list of values that were appended to the "content_types" field in this mutation.

func (*WorkflowSettingsMutation) ClearContentTypes

func (m *WorkflowSettingsMutation) ClearContentTypes()

ClearContentTypes clears the value of the "content_types" field.

func (*WorkflowSettingsMutation) ClearEdge

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ClearField

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ClearedEdges

func (m *WorkflowSettingsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkflowSettingsMutation) ClearedFields

func (m *WorkflowSettingsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkflowSettingsMutation) Client

func (m WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ContentTypes

func (m *WorkflowSettingsMutation) ContentTypes() (r []string, exists bool)

ContentTypes returns the value of the "content_types" field in the mutation.

func (*WorkflowSettingsMutation) ContentTypesCleared

func (m *WorkflowSettingsMutation) ContentTypesCleared() bool

ContentTypesCleared returns if the "content_types" field was cleared in this mutation.

func (*WorkflowSettingsMutation) EdgeCleared

func (m *WorkflowSettingsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkflowSettingsMutation) Field

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) FieldCleared

func (m *WorkflowSettingsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkflowSettingsMutation) Fields

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ID

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) LockMinutes

func (m *WorkflowSettingsMutation) LockMinutes() (r int, exists bool)

LockMinutes returns the value of the "lock_minutes" field in the mutation.

func (*WorkflowSettingsMutation) OldContentTypes

func (m *WorkflowSettingsMutation) OldContentTypes(ctx context.Context) (v []string, err error)

OldContentTypes returns the old "content_types" field's value of the WorkflowSettings entity. If the WorkflowSettings 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 (*WorkflowSettingsMutation) OldField

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) OldLockMinutes

func (m *WorkflowSettingsMutation) OldLockMinutes(ctx context.Context) (v int, err error)

OldLockMinutes returns the old "lock_minutes" field's value of the WorkflowSettings entity. If the WorkflowSettings 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 (*WorkflowSettingsMutation) Op

func (m *WorkflowSettingsMutation) Op() Op

Op returns the operation name.

func (*WorkflowSettingsMutation) RemovedEdges

func (m *WorkflowSettingsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkflowSettingsMutation) RemovedIDs

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ResetContentTypes

func (m *WorkflowSettingsMutation) ResetContentTypes()

ResetContentTypes resets all changes to the "content_types" field.

func (*WorkflowSettingsMutation) ResetEdge

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ResetField

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) ResetLockMinutes

func (m *WorkflowSettingsMutation) ResetLockMinutes()

ResetLockMinutes resets all changes to the "lock_minutes" field.

func (*WorkflowSettingsMutation) SetContentTypes

func (m *WorkflowSettingsMutation) SetContentTypes(s []string)

SetContentTypes sets the "content_types" field.

func (*WorkflowSettingsMutation) SetField

func (m *WorkflowSettingsMutation) 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 (*WorkflowSettingsMutation) SetID

func (m *WorkflowSettingsMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WorkflowSettings entities.

func (*WorkflowSettingsMutation) SetLockMinutes

func (m *WorkflowSettingsMutation) SetLockMinutes(i int)

SetLockMinutes sets the "lock_minutes" field.

func (*WorkflowSettingsMutation) SetOp

func (m *WorkflowSettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (WorkflowSettingsMutation) Tx

func (m WorkflowSettingsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkflowSettingsMutation) Type

func (m *WorkflowSettingsMutation) Type() string

Type returns the node type of this mutation (WorkflowSettings).

func (*WorkflowSettingsMutation) Where

Where appends a list predicates to the WorkflowSettingsMutation builder.

func (*WorkflowSettingsMutation) WhereP

func (m *WorkflowSettingsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkflowSettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WorkflowSettingsQuery

type WorkflowSettingsQuery struct {
	// contains filtered or unexported fields
}

WorkflowSettingsQuery is the builder for querying WorkflowSettings entities.

func (*WorkflowSettingsQuery) Aggregate

Aggregate returns a WorkflowSettingsSelect configured with the given aggregations.

func (*WorkflowSettingsQuery) All

All executes the query and returns a list of WorkflowSettingsSlice.

func (*WorkflowSettingsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*WorkflowSettingsQuery) Clone

Clone returns a duplicate of the WorkflowSettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkflowSettingsQuery) Count

func (_q *WorkflowSettingsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkflowSettingsQuery) CountX

func (_q *WorkflowSettingsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkflowSettingsQuery) Exist

func (_q *WorkflowSettingsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkflowSettingsQuery) ExistX

func (_q *WorkflowSettingsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkflowSettingsQuery) First

First returns the first WorkflowSettings entity from the query. Returns a *NotFoundError when no WorkflowSettings was found.

func (*WorkflowSettingsQuery) FirstID

func (_q *WorkflowSettingsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first WorkflowSettings ID from the query. Returns a *NotFoundError when no WorkflowSettings ID was found.

func (*WorkflowSettingsQuery) FirstIDX

func (_q *WorkflowSettingsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkflowSettingsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WorkflowSettingsQuery) GroupBy

func (_q *WorkflowSettingsQuery) GroupBy(field string, fields ...string) *WorkflowSettingsGroupBy

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 {
	ContentTypes []string `json:"content_types,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WorkflowSettings.Query().
	GroupBy(workflowsettings.FieldContentTypes).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WorkflowSettingsQuery) IDs

func (_q *WorkflowSettingsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of WorkflowSettings IDs.

func (*WorkflowSettingsQuery) IDsX

func (_q *WorkflowSettingsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*WorkflowSettingsQuery) Limit

Limit the number of records to be returned by this query.

func (*WorkflowSettingsQuery) Offset

func (_q *WorkflowSettingsQuery) Offset(offset int) *WorkflowSettingsQuery

Offset to start from.

func (*WorkflowSettingsQuery) Only

Only returns a single WorkflowSettings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WorkflowSettings entity is found. Returns a *NotFoundError when no WorkflowSettings entities are found.

func (*WorkflowSettingsQuery) OnlyID

func (_q *WorkflowSettingsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only WorkflowSettings ID in the query. Returns a *NotSingularError when more than one WorkflowSettings ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkflowSettingsQuery) OnlyIDX

func (_q *WorkflowSettingsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkflowSettingsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WorkflowSettingsQuery) Order

Order specifies how the records should be ordered.

func (*WorkflowSettingsQuery) Select

func (_q *WorkflowSettingsQuery) Select(fields ...string) *WorkflowSettingsSelect

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 {
	ContentTypes []string `json:"content_types,omitempty"`
}

client.WorkflowSettings.Query().
	Select(workflowsettings.FieldContentTypes).
	Scan(ctx, &v)

func (*WorkflowSettingsQuery) Unique

func (_q *WorkflowSettingsQuery) Unique(unique bool) *WorkflowSettingsQuery

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 (*WorkflowSettingsQuery) Where

Where adds a new predicate for the WorkflowSettingsQuery builder.

type WorkflowSettingsSelect

type WorkflowSettingsSelect struct {
	*WorkflowSettingsQuery
	// contains filtered or unexported fields
}

WorkflowSettingsSelect is the builder for selecting fields of WorkflowSettings entities.

func (*WorkflowSettingsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WorkflowSettingsSelect) Bool

func (s *WorkflowSettingsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) BoolX

func (s *WorkflowSettingsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowSettingsSelect) Bools

func (s *WorkflowSettingsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) BoolsX

func (s *WorkflowSettingsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowSettingsSelect) Float64

func (s *WorkflowSettingsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) Float64X

func (s *WorkflowSettingsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowSettingsSelect) Float64s

func (s *WorkflowSettingsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) Float64sX

func (s *WorkflowSettingsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowSettingsSelect) Int

func (s *WorkflowSettingsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) IntX

func (s *WorkflowSettingsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowSettingsSelect) Ints

func (s *WorkflowSettingsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) IntsX

func (s *WorkflowSettingsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowSettingsSelect) Scan

func (_s *WorkflowSettingsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowSettingsSelect) ScanX

func (s *WorkflowSettingsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowSettingsSelect) String

func (s *WorkflowSettingsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) StringX

func (s *WorkflowSettingsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowSettingsSelect) Strings

func (s *WorkflowSettingsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowSettingsSelect) StringsX

func (s *WorkflowSettingsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowSettingsSlice

type WorkflowSettingsSlice []*WorkflowSettings

WorkflowSettingsSlice is a parsable slice of WorkflowSettings.

type WorkflowSettingsUpdate

type WorkflowSettingsUpdate struct {
	// contains filtered or unexported fields
}

WorkflowSettingsUpdate is the builder for updating WorkflowSettings entities.

func (*WorkflowSettingsUpdate) AddLockMinutes

func (_u *WorkflowSettingsUpdate) AddLockMinutes(v int) *WorkflowSettingsUpdate

AddLockMinutes adds value to the "lock_minutes" field.

func (*WorkflowSettingsUpdate) AppendContentTypes

func (_u *WorkflowSettingsUpdate) AppendContentTypes(v []string) *WorkflowSettingsUpdate

AppendContentTypes appends value to the "content_types" field.

func (*WorkflowSettingsUpdate) ClearContentTypes

func (_u *WorkflowSettingsUpdate) ClearContentTypes() *WorkflowSettingsUpdate

ClearContentTypes clears the value of the "content_types" field.

func (*WorkflowSettingsUpdate) Exec

Exec executes the query.

func (*WorkflowSettingsUpdate) ExecX

func (_u *WorkflowSettingsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowSettingsUpdate) Mutation

Mutation returns the WorkflowSettingsMutation object of the builder.

func (*WorkflowSettingsUpdate) Save

func (_u *WorkflowSettingsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkflowSettingsUpdate) SaveX

func (_u *WorkflowSettingsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WorkflowSettingsUpdate) SetContentTypes

func (_u *WorkflowSettingsUpdate) SetContentTypes(v []string) *WorkflowSettingsUpdate

SetContentTypes sets the "content_types" field.

func (*WorkflowSettingsUpdate) SetLockMinutes

func (_u *WorkflowSettingsUpdate) SetLockMinutes(v int) *WorkflowSettingsUpdate

SetLockMinutes sets the "lock_minutes" field.

func (*WorkflowSettingsUpdate) SetNillableLockMinutes

func (_u *WorkflowSettingsUpdate) SetNillableLockMinutes(v *int) *WorkflowSettingsUpdate

SetNillableLockMinutes sets the "lock_minutes" field if the given value is not nil.

func (*WorkflowSettingsUpdate) Where

Where appends a list predicates to the WorkflowSettingsUpdate builder.

type WorkflowSettingsUpdateOne

type WorkflowSettingsUpdateOne struct {
	// contains filtered or unexported fields
}

WorkflowSettingsUpdateOne is the builder for updating a single WorkflowSettings entity.

func (*WorkflowSettingsUpdateOne) AddLockMinutes

AddLockMinutes adds value to the "lock_minutes" field.

func (*WorkflowSettingsUpdateOne) AppendContentTypes

func (_u *WorkflowSettingsUpdateOne) AppendContentTypes(v []string) *WorkflowSettingsUpdateOne

AppendContentTypes appends value to the "content_types" field.

func (*WorkflowSettingsUpdateOne) ClearContentTypes

func (_u *WorkflowSettingsUpdateOne) ClearContentTypes() *WorkflowSettingsUpdateOne

ClearContentTypes clears the value of the "content_types" field.

func (*WorkflowSettingsUpdateOne) Exec

Exec executes the query on the entity.

func (*WorkflowSettingsUpdateOne) ExecX

func (_u *WorkflowSettingsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowSettingsUpdateOne) Mutation

Mutation returns the WorkflowSettingsMutation object of the builder.

func (*WorkflowSettingsUpdateOne) Save

Save executes the query and returns the updated WorkflowSettings entity.

func (*WorkflowSettingsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkflowSettingsUpdateOne) Select

func (_u *WorkflowSettingsUpdateOne) Select(field string, fields ...string) *WorkflowSettingsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkflowSettingsUpdateOne) SetContentTypes

SetContentTypes sets the "content_types" field.

func (*WorkflowSettingsUpdateOne) SetLockMinutes

SetLockMinutes sets the "lock_minutes" field.

func (*WorkflowSettingsUpdateOne) SetNillableLockMinutes

func (_u *WorkflowSettingsUpdateOne) SetNillableLockMinutes(v *int) *WorkflowSettingsUpdateOne

SetNillableLockMinutes sets the "lock_minutes" field if the given value is not nil.

func (*WorkflowSettingsUpdateOne) Where

Where appends a list predicates to the WorkflowSettingsUpdate builder.

type WorkflowState

type WorkflowState struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// MachineName holds the value of the "machine_name" field.
	MachineName string `json:"machine_name,omitempty"`
	// Label holds the value of the "label" field.
	Label string `json:"label,omitempty"`
	// Published holds the value of the "published" field.
	Published bool `json:"published,omitempty"`
	// Color holds the value of the "color" field.
	Color string `json:"color,omitempty"`
	// Initial holds the value of the "initial" field.
	Initial bool `json:"initial,omitempty"`
	// Weight holds the value of the "weight" field.
	Weight int `json:"weight,omitempty"`
	// contains filtered or unexported fields
}

WorkflowState is the model entity for the WorkflowState schema.

func (*WorkflowState) String

func (_m *WorkflowState) String() string

String implements the fmt.Stringer.

func (*WorkflowState) Unwrap

func (_m *WorkflowState) Unwrap() *WorkflowState

Unwrap unwraps the WorkflowState 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 (*WorkflowState) Update

func (_m *WorkflowState) Update() *WorkflowStateUpdateOne

Update returns a builder for updating this WorkflowState. Note that you need to call WorkflowState.Unwrap() before calling this method if this WorkflowState was returned from a transaction, and the transaction was committed or rolled back.

func (*WorkflowState) Value

func (_m *WorkflowState) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WorkflowState. This includes values selected through modifiers, order, etc.

type WorkflowStateClient

type WorkflowStateClient struct {
	// contains filtered or unexported fields
}

WorkflowStateClient is a client for the WorkflowState schema.

func NewWorkflowStateClient

func NewWorkflowStateClient(c config) *WorkflowStateClient

NewWorkflowStateClient returns a client for the WorkflowState from the given config.

func (*WorkflowStateClient) Create

Create returns a builder for creating a WorkflowState entity.

func (*WorkflowStateClient) CreateBulk

CreateBulk returns a builder for creating a bulk of WorkflowState entities.

func (*WorkflowStateClient) Delete

Delete returns a delete builder for WorkflowState.

func (*WorkflowStateClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkflowStateClient) DeleteOneID

func (c *WorkflowStateClient) DeleteOneID(id int) *WorkflowStateDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkflowStateClient) Get

Get returns a WorkflowState entity by its id.

func (*WorkflowStateClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WorkflowStateClient) Hooks

func (c *WorkflowStateClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkflowStateClient) Intercept

func (c *WorkflowStateClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workflowstate.Intercept(f(g(h())))`.

func (*WorkflowStateClient) Interceptors

func (c *WorkflowStateClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkflowStateClient) MapCreateBulk

func (c *WorkflowStateClient) MapCreateBulk(slice any, setFunc func(*WorkflowStateCreate, int)) *WorkflowStateCreateBulk

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 (*WorkflowStateClient) Query

Query returns a query builder for WorkflowState.

func (*WorkflowStateClient) Update

Update returns an update builder for WorkflowState.

func (*WorkflowStateClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkflowStateClient) UpdateOneID

func (c *WorkflowStateClient) UpdateOneID(id int) *WorkflowStateUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WorkflowStateClient) Use

func (c *WorkflowStateClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workflowstate.Hooks(f(g(h())))`.

type WorkflowStateCreate

type WorkflowStateCreate struct {
	// contains filtered or unexported fields
}

WorkflowStateCreate is the builder for creating a WorkflowState entity.

func (*WorkflowStateCreate) Exec

func (_c *WorkflowStateCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowStateCreate) ExecX

func (_c *WorkflowStateCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStateCreate) Mutation

Mutation returns the WorkflowStateMutation object of the builder.

func (*WorkflowStateCreate) Save

Save creates the WorkflowState in the database.

func (*WorkflowStateCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WorkflowStateCreate) SetColor

SetColor sets the "color" field.

func (*WorkflowStateCreate) SetID

SetID sets the "id" field.

func (*WorkflowStateCreate) SetInitial

func (_c *WorkflowStateCreate) SetInitial(v bool) *WorkflowStateCreate

SetInitial sets the "initial" field.

func (*WorkflowStateCreate) SetLabel

SetLabel sets the "label" field.

func (*WorkflowStateCreate) SetMachineName

func (_c *WorkflowStateCreate) SetMachineName(v string) *WorkflowStateCreate

SetMachineName sets the "machine_name" field.

func (*WorkflowStateCreate) SetNillableColor

func (_c *WorkflowStateCreate) SetNillableColor(v *string) *WorkflowStateCreate

SetNillableColor sets the "color" field if the given value is not nil.

func (*WorkflowStateCreate) SetNillableInitial

func (_c *WorkflowStateCreate) SetNillableInitial(v *bool) *WorkflowStateCreate

SetNillableInitial sets the "initial" field if the given value is not nil.

func (*WorkflowStateCreate) SetNillablePublished

func (_c *WorkflowStateCreate) SetNillablePublished(v *bool) *WorkflowStateCreate

SetNillablePublished sets the "published" field if the given value is not nil.

func (*WorkflowStateCreate) SetNillableWeight

func (_c *WorkflowStateCreate) SetNillableWeight(v *int) *WorkflowStateCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WorkflowStateCreate) SetPublished

func (_c *WorkflowStateCreate) SetPublished(v bool) *WorkflowStateCreate

SetPublished sets the "published" field.

func (*WorkflowStateCreate) SetWeight

func (_c *WorkflowStateCreate) SetWeight(v int) *WorkflowStateCreate

SetWeight sets the "weight" field.

type WorkflowStateCreateBulk

type WorkflowStateCreateBulk struct {
	// contains filtered or unexported fields
}

WorkflowStateCreateBulk is the builder for creating many WorkflowState entities in bulk.

func (*WorkflowStateCreateBulk) Exec

Exec executes the query.

func (*WorkflowStateCreateBulk) ExecX

func (_c *WorkflowStateCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStateCreateBulk) Save

Save creates the WorkflowState entities in the database.

func (*WorkflowStateCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WorkflowStateDelete

type WorkflowStateDelete struct {
	// contains filtered or unexported fields
}

WorkflowStateDelete is the builder for deleting a WorkflowState entity.

func (*WorkflowStateDelete) Exec

func (_d *WorkflowStateDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkflowStateDelete) ExecX

func (_d *WorkflowStateDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStateDelete) Where

Where appends a list predicates to the WorkflowStateDelete builder.

type WorkflowStateDeleteOne

type WorkflowStateDeleteOne struct {
	// contains filtered or unexported fields
}

WorkflowStateDeleteOne is the builder for deleting a single WorkflowState entity.

func (*WorkflowStateDeleteOne) Exec

Exec executes the deletion query.

func (*WorkflowStateDeleteOne) ExecX

func (_d *WorkflowStateDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStateDeleteOne) Where

Where appends a list predicates to the WorkflowStateDelete builder.

type WorkflowStateGroupBy

type WorkflowStateGroupBy struct {
	// contains filtered or unexported fields
}

WorkflowStateGroupBy is the group-by builder for WorkflowState entities.

func (*WorkflowStateGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkflowStateGroupBy) Bool

func (s *WorkflowStateGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) BoolX

func (s *WorkflowStateGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowStateGroupBy) Bools

func (s *WorkflowStateGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) BoolsX

func (s *WorkflowStateGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowStateGroupBy) Float64

func (s *WorkflowStateGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) Float64X

func (s *WorkflowStateGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowStateGroupBy) Float64s

func (s *WorkflowStateGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) Float64sX

func (s *WorkflowStateGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowStateGroupBy) Int

func (s *WorkflowStateGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) IntX

func (s *WorkflowStateGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowStateGroupBy) Ints

func (s *WorkflowStateGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) IntsX

func (s *WorkflowStateGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowStateGroupBy) Scan

func (_g *WorkflowStateGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowStateGroupBy) ScanX

func (s *WorkflowStateGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowStateGroupBy) String

func (s *WorkflowStateGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) StringX

func (s *WorkflowStateGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowStateGroupBy) Strings

func (s *WorkflowStateGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowStateGroupBy) StringsX

func (s *WorkflowStateGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowStateMutation

type WorkflowStateMutation struct {
	// contains filtered or unexported fields
}

WorkflowStateMutation represents an operation that mutates the WorkflowState nodes in the graph.

func (*WorkflowStateMutation) AddField

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) AddWeight

func (m *WorkflowStateMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*WorkflowStateMutation) AddedEdges

func (m *WorkflowStateMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkflowStateMutation) AddedField

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) AddedFields

func (m *WorkflowStateMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkflowStateMutation) AddedIDs

func (m *WorkflowStateMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkflowStateMutation) AddedWeight

func (m *WorkflowStateMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*WorkflowStateMutation) ClearEdge

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) ClearField

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) ClearedEdges

func (m *WorkflowStateMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkflowStateMutation) ClearedFields

func (m *WorkflowStateMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkflowStateMutation) Client

func (m WorkflowStateMutation) 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 (*WorkflowStateMutation) Color

func (m *WorkflowStateMutation) Color() (r string, exists bool)

Color returns the value of the "color" field in the mutation.

func (*WorkflowStateMutation) EdgeCleared

func (m *WorkflowStateMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkflowStateMutation) Field

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) FieldCleared

func (m *WorkflowStateMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkflowStateMutation) Fields

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) ID

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) IDs

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) Initial

func (m *WorkflowStateMutation) Initial() (r bool, exists bool)

Initial returns the value of the "initial" field in the mutation.

func (*WorkflowStateMutation) Label

func (m *WorkflowStateMutation) Label() (r string, exists bool)

Label returns the value of the "label" field in the mutation.

func (*WorkflowStateMutation) MachineName

func (m *WorkflowStateMutation) MachineName() (r string, exists bool)

MachineName returns the value of the "machine_name" field in the mutation.

func (*WorkflowStateMutation) OldColor

func (m *WorkflowStateMutation) OldColor(ctx context.Context) (v string, err error)

OldColor returns the old "color" field's value of the WorkflowState entity. If the WorkflowState 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 (*WorkflowStateMutation) OldField

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) OldInitial

func (m *WorkflowStateMutation) OldInitial(ctx context.Context) (v bool, err error)

OldInitial returns the old "initial" field's value of the WorkflowState entity. If the WorkflowState 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 (*WorkflowStateMutation) OldLabel

func (m *WorkflowStateMutation) OldLabel(ctx context.Context) (v string, err error)

OldLabel returns the old "label" field's value of the WorkflowState entity. If the WorkflowState 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 (*WorkflowStateMutation) OldMachineName

func (m *WorkflowStateMutation) OldMachineName(ctx context.Context) (v string, err error)

OldMachineName returns the old "machine_name" field's value of the WorkflowState entity. If the WorkflowState 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 (*WorkflowStateMutation) OldPublished

func (m *WorkflowStateMutation) OldPublished(ctx context.Context) (v bool, err error)

OldPublished returns the old "published" field's value of the WorkflowState entity. If the WorkflowState 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 (*WorkflowStateMutation) OldWeight

func (m *WorkflowStateMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the WorkflowState entity. If the WorkflowState 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 (*WorkflowStateMutation) Op

func (m *WorkflowStateMutation) Op() Op

Op returns the operation name.

func (*WorkflowStateMutation) Published

func (m *WorkflowStateMutation) Published() (r bool, exists bool)

Published returns the value of the "published" field in the mutation.

func (*WorkflowStateMutation) RemovedEdges

func (m *WorkflowStateMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkflowStateMutation) RemovedIDs

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) ResetColor

func (m *WorkflowStateMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*WorkflowStateMutation) ResetEdge

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) ResetField

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) ResetInitial

func (m *WorkflowStateMutation) ResetInitial()

ResetInitial resets all changes to the "initial" field.

func (*WorkflowStateMutation) ResetLabel

func (m *WorkflowStateMutation) ResetLabel()

ResetLabel resets all changes to the "label" field.

func (*WorkflowStateMutation) ResetMachineName

func (m *WorkflowStateMutation) ResetMachineName()

ResetMachineName resets all changes to the "machine_name" field.

func (*WorkflowStateMutation) ResetPublished

func (m *WorkflowStateMutation) ResetPublished()

ResetPublished resets all changes to the "published" field.

func (*WorkflowStateMutation) ResetWeight

func (m *WorkflowStateMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*WorkflowStateMutation) SetColor

func (m *WorkflowStateMutation) SetColor(s string)

SetColor sets the "color" field.

func (*WorkflowStateMutation) SetField

func (m *WorkflowStateMutation) 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 (*WorkflowStateMutation) SetID

func (m *WorkflowStateMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WorkflowState entities.

func (*WorkflowStateMutation) SetInitial

func (m *WorkflowStateMutation) SetInitial(b bool)

SetInitial sets the "initial" field.

func (*WorkflowStateMutation) SetLabel

func (m *WorkflowStateMutation) SetLabel(s string)

SetLabel sets the "label" field.

func (*WorkflowStateMutation) SetMachineName

func (m *WorkflowStateMutation) SetMachineName(s string)

SetMachineName sets the "machine_name" field.

func (*WorkflowStateMutation) SetOp

func (m *WorkflowStateMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WorkflowStateMutation) SetPublished

func (m *WorkflowStateMutation) SetPublished(b bool)

SetPublished sets the "published" field.

func (*WorkflowStateMutation) SetWeight

func (m *WorkflowStateMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (WorkflowStateMutation) Tx

func (m WorkflowStateMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkflowStateMutation) Type

func (m *WorkflowStateMutation) Type() string

Type returns the node type of this mutation (WorkflowState).

func (*WorkflowStateMutation) Weight

func (m *WorkflowStateMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*WorkflowStateMutation) Where

Where appends a list predicates to the WorkflowStateMutation builder.

func (*WorkflowStateMutation) WhereP

func (m *WorkflowStateMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkflowStateMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WorkflowStateQuery

type WorkflowStateQuery struct {
	// contains filtered or unexported fields
}

WorkflowStateQuery is the builder for querying WorkflowState entities.

func (*WorkflowStateQuery) Aggregate

func (_q *WorkflowStateQuery) Aggregate(fns ...AggregateFunc) *WorkflowStateSelect

Aggregate returns a WorkflowStateSelect configured with the given aggregations.

func (*WorkflowStateQuery) All

All executes the query and returns a list of WorkflowStates.

func (*WorkflowStateQuery) AllX

AllX is like All, but panics if an error occurs.

func (*WorkflowStateQuery) Clone

Clone returns a duplicate of the WorkflowStateQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkflowStateQuery) Count

func (_q *WorkflowStateQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkflowStateQuery) CountX

func (_q *WorkflowStateQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkflowStateQuery) Exist

func (_q *WorkflowStateQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkflowStateQuery) ExistX

func (_q *WorkflowStateQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkflowStateQuery) First

First returns the first WorkflowState entity from the query. Returns a *NotFoundError when no WorkflowState was found.

func (*WorkflowStateQuery) FirstID

func (_q *WorkflowStateQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first WorkflowState ID from the query. Returns a *NotFoundError when no WorkflowState ID was found.

func (*WorkflowStateQuery) FirstIDX

func (_q *WorkflowStateQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkflowStateQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WorkflowStateQuery) GroupBy

func (_q *WorkflowStateQuery) GroupBy(field string, fields ...string) *WorkflowStateGroupBy

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 {
	MachineName string `json:"machine_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WorkflowState.Query().
	GroupBy(workflowstate.FieldMachineName).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WorkflowStateQuery) IDs

func (_q *WorkflowStateQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of WorkflowState IDs.

func (*WorkflowStateQuery) IDsX

func (_q *WorkflowStateQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*WorkflowStateQuery) Limit

func (_q *WorkflowStateQuery) Limit(limit int) *WorkflowStateQuery

Limit the number of records to be returned by this query.

func (*WorkflowStateQuery) Offset

func (_q *WorkflowStateQuery) Offset(offset int) *WorkflowStateQuery

Offset to start from.

func (*WorkflowStateQuery) Only

Only returns a single WorkflowState entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WorkflowState entity is found. Returns a *NotFoundError when no WorkflowState entities are found.

func (*WorkflowStateQuery) OnlyID

func (_q *WorkflowStateQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only WorkflowState ID in the query. Returns a *NotSingularError when more than one WorkflowState ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkflowStateQuery) OnlyIDX

func (_q *WorkflowStateQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkflowStateQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WorkflowStateQuery) Order

Order specifies how the records should be ordered.

func (*WorkflowStateQuery) Select

func (_q *WorkflowStateQuery) Select(fields ...string) *WorkflowStateSelect

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 {
	MachineName string `json:"machine_name,omitempty"`
}

client.WorkflowState.Query().
	Select(workflowstate.FieldMachineName).
	Scan(ctx, &v)

func (*WorkflowStateQuery) Unique

func (_q *WorkflowStateQuery) Unique(unique bool) *WorkflowStateQuery

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 (*WorkflowStateQuery) Where

Where adds a new predicate for the WorkflowStateQuery builder.

type WorkflowStateSelect

type WorkflowStateSelect struct {
	*WorkflowStateQuery
	// contains filtered or unexported fields
}

WorkflowStateSelect is the builder for selecting fields of WorkflowState entities.

func (*WorkflowStateSelect) Aggregate

func (_s *WorkflowStateSelect) Aggregate(fns ...AggregateFunc) *WorkflowStateSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WorkflowStateSelect) Bool

func (s *WorkflowStateSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) BoolX

func (s *WorkflowStateSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowStateSelect) Bools

func (s *WorkflowStateSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) BoolsX

func (s *WorkflowStateSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowStateSelect) Float64

func (s *WorkflowStateSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) Float64X

func (s *WorkflowStateSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowStateSelect) Float64s

func (s *WorkflowStateSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) Float64sX

func (s *WorkflowStateSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowStateSelect) Int

func (s *WorkflowStateSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) IntX

func (s *WorkflowStateSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowStateSelect) Ints

func (s *WorkflowStateSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) IntsX

func (s *WorkflowStateSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowStateSelect) Scan

func (_s *WorkflowStateSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkflowStateSelect) ScanX

func (s *WorkflowStateSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowStateSelect) String

func (s *WorkflowStateSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) StringX

func (s *WorkflowStateSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowStateSelect) Strings

func (s *WorkflowStateSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowStateSelect) StringsX

func (s *WorkflowStateSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowStateUpdate

type WorkflowStateUpdate struct {
	// contains filtered or unexported fields
}

WorkflowStateUpdate is the builder for updating WorkflowState entities.

func (*WorkflowStateUpdate) AddWeight

func (_u *WorkflowStateUpdate) AddWeight(v int) *WorkflowStateUpdate

AddWeight adds value to the "weight" field.

func (*WorkflowStateUpdate) Exec

func (_u *WorkflowStateUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkflowStateUpdate) ExecX

func (_u *WorkflowStateUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStateUpdate) Mutation

Mutation returns the WorkflowStateMutation object of the builder.

func (*WorkflowStateUpdate) Save

func (_u *WorkflowStateUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkflowStateUpdate) SaveX

func (_u *WorkflowStateUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WorkflowStateUpdate) SetColor

SetColor sets the "color" field.

func (*WorkflowStateUpdate) SetInitial

func (_u *WorkflowStateUpdate) SetInitial(v bool) *WorkflowStateUpdate

SetInitial sets the "initial" field.

func (*WorkflowStateUpdate) SetLabel

SetLabel sets the "label" field.

func (*WorkflowStateUpdate) SetMachineName

func (_u *WorkflowStateUpdate) SetMachineName(v string) *WorkflowStateUpdate

SetMachineName sets the "machine_name" field.

func (*WorkflowStateUpdate) SetNillableColor

func (_u *WorkflowStateUpdate) SetNillableColor(v *string) *WorkflowStateUpdate

SetNillableColor sets the "color" field if the given value is not nil.

func (*WorkflowStateUpdate) SetNillableInitial

func (_u *WorkflowStateUpdate) SetNillableInitial(v *bool) *WorkflowStateUpdate

SetNillableInitial sets the "initial" field if the given value is not nil.

func (*WorkflowStateUpdate) SetNillableLabel

func (_u *WorkflowStateUpdate) SetNillableLabel(v *string) *WorkflowStateUpdate

SetNillableLabel sets the "label" field if the given value is not nil.

func (*WorkflowStateUpdate) SetNillableMachineName

func (_u *WorkflowStateUpdate) SetNillableMachineName(v *string) *WorkflowStateUpdate

SetNillableMachineName sets the "machine_name" field if the given value is not nil.

func (*WorkflowStateUpdate) SetNillablePublished

func (_u *WorkflowStateUpdate) SetNillablePublished(v *bool) *WorkflowStateUpdate

SetNillablePublished sets the "published" field if the given value is not nil.

func (*WorkflowStateUpdate) SetNillableWeight

func (_u *WorkflowStateUpdate) SetNillableWeight(v *int) *WorkflowStateUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WorkflowStateUpdate) SetPublished

func (_u *WorkflowStateUpdate) SetPublished(v bool) *WorkflowStateUpdate

SetPublished sets the "published" field.

func (*WorkflowStateUpdate) SetWeight

func (_u *WorkflowStateUpdate) SetWeight(v int) *WorkflowStateUpdate

SetWeight sets the "weight" field.

func (*WorkflowStateUpdate) Where

Where appends a list predicates to the WorkflowStateUpdate builder.

type WorkflowStateUpdateOne

type WorkflowStateUpdateOne struct {
	// contains filtered or unexported fields
}

WorkflowStateUpdateOne is the builder for updating a single WorkflowState entity.

func (*WorkflowStateUpdateOne) AddWeight

AddWeight adds value to the "weight" field.

func (*WorkflowStateUpdateOne) Exec

Exec executes the query on the entity.

func (*WorkflowStateUpdateOne) ExecX

func (_u *WorkflowStateUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowStateUpdateOne) Mutation

Mutation returns the WorkflowStateMutation object of the builder.

func (*WorkflowStateUpdateOne) Save

Save executes the query and returns the updated WorkflowState entity.

func (*WorkflowStateUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkflowStateUpdateOne) Select

func (_u *WorkflowStateUpdateOne) Select(field string, fields ...string) *WorkflowStateUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkflowStateUpdateOne) SetColor

SetColor sets the "color" field.

func (*WorkflowStateUpdateOne) SetInitial

SetInitial sets the "initial" field.

func (*WorkflowStateUpdateOne) SetLabel

SetLabel sets the "label" field.

func (*WorkflowStateUpdateOne) SetMachineName

func (_u *WorkflowStateUpdateOne) SetMachineName(v string) *WorkflowStateUpdateOne

SetMachineName sets the "machine_name" field.

func (*WorkflowStateUpdateOne) SetNillableColor

func (_u *WorkflowStateUpdateOne) SetNillableColor(v *string) *WorkflowStateUpdateOne

SetNillableColor sets the "color" field if the given value is not nil.

func (*WorkflowStateUpdateOne) SetNillableInitial

func (_u *WorkflowStateUpdateOne) SetNillableInitial(v *bool) *WorkflowStateUpdateOne

SetNillableInitial sets the "initial" field if the given value is not nil.

func (*WorkflowStateUpdateOne) SetNillableLabel

func (_u *WorkflowStateUpdateOne) SetNillableLabel(v *string) *WorkflowStateUpdateOne

SetNillableLabel sets the "label" field if the given value is not nil.

func (*WorkflowStateUpdateOne) SetNillableMachineName

func (_u *WorkflowStateUpdateOne) SetNillableMachineName(v *string) *WorkflowStateUpdateOne

SetNillableMachineName sets the "machine_name" field if the given value is not nil.

func (*WorkflowStateUpdateOne) SetNillablePublished

func (_u *WorkflowStateUpdateOne) SetNillablePublished(v *bool) *WorkflowStateUpdateOne

SetNillablePublished sets the "published" field if the given value is not nil.

func (*WorkflowStateUpdateOne) SetNillableWeight

func (_u *WorkflowStateUpdateOne) SetNillableWeight(v *int) *WorkflowStateUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WorkflowStateUpdateOne) SetPublished

func (_u *WorkflowStateUpdateOne) SetPublished(v bool) *WorkflowStateUpdateOne

SetPublished sets the "published" field.

func (*WorkflowStateUpdateOne) SetWeight

SetWeight sets the "weight" field.

func (*WorkflowStateUpdateOne) Where

Where appends a list predicates to the WorkflowStateUpdate builder.

type WorkflowStates

type WorkflowStates []*WorkflowState

WorkflowStates is a parsable slice of WorkflowState.

type WorkflowTransition

type WorkflowTransition struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// FromStates holds the value of the "from_states" field.
	FromStates []string `json:"from_states,omitempty"`
	// ToState holds the value of the "to_state" field.
	ToState string `json:"to_state,omitempty"`
	// Label holds the value of the "label" field.
	Label string `json:"label,omitempty"`
	// Roles holds the value of the "roles" field.
	Roles []string `json:"roles,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment string `json:"comment,omitempty"`
	// Weight holds the value of the "weight" field.
	Weight int `json:"weight,omitempty"`
	// contains filtered or unexported fields
}

WorkflowTransition is the model entity for the WorkflowTransition schema.

func (*WorkflowTransition) String

func (_m *WorkflowTransition) String() string

String implements the fmt.Stringer.

func (*WorkflowTransition) Unwrap

func (_m *WorkflowTransition) Unwrap() *WorkflowTransition

Unwrap unwraps the WorkflowTransition 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 (*WorkflowTransition) Update

Update returns a builder for updating this WorkflowTransition. Note that you need to call WorkflowTransition.Unwrap() before calling this method if this WorkflowTransition was returned from a transaction, and the transaction was committed or rolled back.

func (*WorkflowTransition) Value

func (_m *WorkflowTransition) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the WorkflowTransition. This includes values selected through modifiers, order, etc.

type WorkflowTransitionClient

type WorkflowTransitionClient struct {
	// contains filtered or unexported fields
}

WorkflowTransitionClient is a client for the WorkflowTransition schema.

func NewWorkflowTransitionClient

func NewWorkflowTransitionClient(c config) *WorkflowTransitionClient

NewWorkflowTransitionClient returns a client for the WorkflowTransition from the given config.

func (*WorkflowTransitionClient) Create

Create returns a builder for creating a WorkflowTransition entity.

func (*WorkflowTransitionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of WorkflowTransition entities.

func (*WorkflowTransitionClient) Delete

Delete returns a delete builder for WorkflowTransition.

func (*WorkflowTransitionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkflowTransitionClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkflowTransitionClient) Get

Get returns a WorkflowTransition entity by its id.

func (*WorkflowTransitionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*WorkflowTransitionClient) Hooks

func (c *WorkflowTransitionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkflowTransitionClient) Intercept

func (c *WorkflowTransitionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workflowtransition.Intercept(f(g(h())))`.

func (*WorkflowTransitionClient) Interceptors

func (c *WorkflowTransitionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkflowTransitionClient) MapCreateBulk

func (c *WorkflowTransitionClient) MapCreateBulk(slice any, setFunc func(*WorkflowTransitionCreate, int)) *WorkflowTransitionCreateBulk

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 (*WorkflowTransitionClient) Query

Query returns a query builder for WorkflowTransition.

func (*WorkflowTransitionClient) Update

Update returns an update builder for WorkflowTransition.

func (*WorkflowTransitionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkflowTransitionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WorkflowTransitionClient) Use

func (c *WorkflowTransitionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workflowtransition.Hooks(f(g(h())))`.

type WorkflowTransitionCreate

type WorkflowTransitionCreate struct {
	// contains filtered or unexported fields
}

WorkflowTransitionCreate is the builder for creating a WorkflowTransition entity.

func (*WorkflowTransitionCreate) Exec

Exec executes the query.

func (*WorkflowTransitionCreate) ExecX

func (_c *WorkflowTransitionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowTransitionCreate) Mutation

Mutation returns the WorkflowTransitionMutation object of the builder.

func (*WorkflowTransitionCreate) Save

Save creates the WorkflowTransition in the database.

func (*WorkflowTransitionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WorkflowTransitionCreate) SetComment

SetComment sets the "comment" field.

func (*WorkflowTransitionCreate) SetFromStates

SetFromStates sets the "from_states" field.

func (*WorkflowTransitionCreate) SetID

SetID sets the "id" field.

func (*WorkflowTransitionCreate) SetLabel

SetLabel sets the "label" field.

func (*WorkflowTransitionCreate) SetNillableComment

func (_c *WorkflowTransitionCreate) SetNillableComment(v *string) *WorkflowTransitionCreate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*WorkflowTransitionCreate) SetNillableWeight

func (_c *WorkflowTransitionCreate) SetNillableWeight(v *int) *WorkflowTransitionCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WorkflowTransitionCreate) SetRoles

SetRoles sets the "roles" field.

func (*WorkflowTransitionCreate) SetToState

SetToState sets the "to_state" field.

func (*WorkflowTransitionCreate) SetWeight

SetWeight sets the "weight" field.

type WorkflowTransitionCreateBulk

type WorkflowTransitionCreateBulk struct {
	// contains filtered or unexported fields
}

WorkflowTransitionCreateBulk is the builder for creating many WorkflowTransition entities in bulk.

func (*WorkflowTransitionCreateBulk) Exec

Exec executes the query.

func (*WorkflowTransitionCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowTransitionCreateBulk) Save

Save creates the WorkflowTransition entities in the database.

func (*WorkflowTransitionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type WorkflowTransitionDelete

type WorkflowTransitionDelete struct {
	// contains filtered or unexported fields
}

WorkflowTransitionDelete is the builder for deleting a WorkflowTransition entity.

func (*WorkflowTransitionDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkflowTransitionDelete) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowTransitionDelete) Where

Where appends a list predicates to the WorkflowTransitionDelete builder.

type WorkflowTransitionDeleteOne

type WorkflowTransitionDeleteOne struct {
	// contains filtered or unexported fields
}

WorkflowTransitionDeleteOne is the builder for deleting a single WorkflowTransition entity.

func (*WorkflowTransitionDeleteOne) Exec

Exec executes the deletion query.

func (*WorkflowTransitionDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowTransitionDeleteOne) Where

Where appends a list predicates to the WorkflowTransitionDelete builder.

type WorkflowTransitionGroupBy

type WorkflowTransitionGroupBy struct {
	// contains filtered or unexported fields
}

WorkflowTransitionGroupBy is the group-by builder for WorkflowTransition entities.

func (*WorkflowTransitionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkflowTransitionGroupBy) Bool

func (s *WorkflowTransitionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) BoolX

func (s *WorkflowTransitionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Bools

func (s *WorkflowTransitionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) BoolsX

func (s *WorkflowTransitionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Float64

func (s *WorkflowTransitionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) Float64X

func (s *WorkflowTransitionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Float64s

func (s *WorkflowTransitionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) Float64sX

func (s *WorkflowTransitionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Int

func (s *WorkflowTransitionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) IntX

func (s *WorkflowTransitionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Ints

func (s *WorkflowTransitionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) IntsX

func (s *WorkflowTransitionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*WorkflowTransitionGroupBy) ScanX

func (s *WorkflowTransitionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) String

func (s *WorkflowTransitionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) StringX

func (s *WorkflowTransitionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowTransitionGroupBy) Strings

func (s *WorkflowTransitionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionGroupBy) StringsX

func (s *WorkflowTransitionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowTransitionMutation

type WorkflowTransitionMutation struct {
	// contains filtered or unexported fields
}

WorkflowTransitionMutation represents an operation that mutates the WorkflowTransition nodes in the graph.

func (*WorkflowTransitionMutation) AddField

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) AddWeight

func (m *WorkflowTransitionMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*WorkflowTransitionMutation) AddedEdges

func (m *WorkflowTransitionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkflowTransitionMutation) AddedField

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) AddedFields

func (m *WorkflowTransitionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkflowTransitionMutation) AddedIDs

func (m *WorkflowTransitionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkflowTransitionMutation) AddedWeight

func (m *WorkflowTransitionMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*WorkflowTransitionMutation) AppendFromStates

func (m *WorkflowTransitionMutation) AppendFromStates(s []string)

AppendFromStates adds s to the "from_states" field.

func (*WorkflowTransitionMutation) AppendRoles

func (m *WorkflowTransitionMutation) AppendRoles(s []string)

AppendRoles adds s to the "roles" field.

func (*WorkflowTransitionMutation) AppendedFromStates

func (m *WorkflowTransitionMutation) AppendedFromStates() ([]string, bool)

AppendedFromStates returns the list of values that were appended to the "from_states" field in this mutation.

func (*WorkflowTransitionMutation) AppendedRoles

func (m *WorkflowTransitionMutation) AppendedRoles() ([]string, bool)

AppendedRoles returns the list of values that were appended to the "roles" field in this mutation.

func (*WorkflowTransitionMutation) ClearEdge

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) ClearField

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) ClearedEdges

func (m *WorkflowTransitionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkflowTransitionMutation) ClearedFields

func (m *WorkflowTransitionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkflowTransitionMutation) Client

func (m WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) Comment

func (m *WorkflowTransitionMutation) Comment() (r string, exists bool)

Comment returns the value of the "comment" field in the mutation.

func (*WorkflowTransitionMutation) EdgeCleared

func (m *WorkflowTransitionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkflowTransitionMutation) Field

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) FieldCleared

func (m *WorkflowTransitionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkflowTransitionMutation) Fields

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) FromStates

func (m *WorkflowTransitionMutation) FromStates() (r []string, exists bool)

FromStates returns the value of the "from_states" field in the mutation.

func (*WorkflowTransitionMutation) ID

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) Label

func (m *WorkflowTransitionMutation) Label() (r string, exists bool)

Label returns the value of the "label" field in the mutation.

func (*WorkflowTransitionMutation) OldComment

func (m *WorkflowTransitionMutation) OldComment(ctx context.Context) (v string, err error)

OldComment returns the old "comment" field's value of the WorkflowTransition entity. If the WorkflowTransition 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 (*WorkflowTransitionMutation) OldField

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) OldFromStates

func (m *WorkflowTransitionMutation) OldFromStates(ctx context.Context) (v []string, err error)

OldFromStates returns the old "from_states" field's value of the WorkflowTransition entity. If the WorkflowTransition 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 (*WorkflowTransitionMutation) OldLabel

func (m *WorkflowTransitionMutation) OldLabel(ctx context.Context) (v string, err error)

OldLabel returns the old "label" field's value of the WorkflowTransition entity. If the WorkflowTransition 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 (*WorkflowTransitionMutation) OldRoles

func (m *WorkflowTransitionMutation) OldRoles(ctx context.Context) (v []string, err error)

OldRoles returns the old "roles" field's value of the WorkflowTransition entity. If the WorkflowTransition 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 (*WorkflowTransitionMutation) OldToState

func (m *WorkflowTransitionMutation) OldToState(ctx context.Context) (v string, err error)

OldToState returns the old "to_state" field's value of the WorkflowTransition entity. If the WorkflowTransition 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 (*WorkflowTransitionMutation) OldWeight

func (m *WorkflowTransitionMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the WorkflowTransition entity. If the WorkflowTransition 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 (*WorkflowTransitionMutation) Op

Op returns the operation name.

func (*WorkflowTransitionMutation) RemovedEdges

func (m *WorkflowTransitionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkflowTransitionMutation) RemovedIDs

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) ResetComment

func (m *WorkflowTransitionMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*WorkflowTransitionMutation) ResetEdge

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) ResetField

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) ResetFromStates

func (m *WorkflowTransitionMutation) ResetFromStates()

ResetFromStates resets all changes to the "from_states" field.

func (*WorkflowTransitionMutation) ResetLabel

func (m *WorkflowTransitionMutation) ResetLabel()

ResetLabel resets all changes to the "label" field.

func (*WorkflowTransitionMutation) ResetRoles

func (m *WorkflowTransitionMutation) ResetRoles()

ResetRoles resets all changes to the "roles" field.

func (*WorkflowTransitionMutation) ResetToState

func (m *WorkflowTransitionMutation) ResetToState()

ResetToState resets all changes to the "to_state" field.

func (*WorkflowTransitionMutation) ResetWeight

func (m *WorkflowTransitionMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*WorkflowTransitionMutation) Roles

func (m *WorkflowTransitionMutation) Roles() (r []string, exists bool)

Roles returns the value of the "roles" field in the mutation.

func (*WorkflowTransitionMutation) SetComment

func (m *WorkflowTransitionMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*WorkflowTransitionMutation) SetField

func (m *WorkflowTransitionMutation) 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 (*WorkflowTransitionMutation) SetFromStates

func (m *WorkflowTransitionMutation) SetFromStates(s []string)

SetFromStates sets the "from_states" field.

func (*WorkflowTransitionMutation) SetID

func (m *WorkflowTransitionMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of WorkflowTransition entities.

func (*WorkflowTransitionMutation) SetLabel

func (m *WorkflowTransitionMutation) SetLabel(s string)

SetLabel sets the "label" field.

func (*WorkflowTransitionMutation) SetOp

func (m *WorkflowTransitionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WorkflowTransitionMutation) SetRoles

func (m *WorkflowTransitionMutation) SetRoles(s []string)

SetRoles sets the "roles" field.

func (*WorkflowTransitionMutation) SetToState

func (m *WorkflowTransitionMutation) SetToState(s string)

SetToState sets the "to_state" field.

func (*WorkflowTransitionMutation) SetWeight

func (m *WorkflowTransitionMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (*WorkflowTransitionMutation) ToState

func (m *WorkflowTransitionMutation) ToState() (r string, exists bool)

ToState returns the value of the "to_state" field in the mutation.

func (WorkflowTransitionMutation) Tx

func (m WorkflowTransitionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkflowTransitionMutation) Type

Type returns the node type of this mutation (WorkflowTransition).

func (*WorkflowTransitionMutation) Weight

func (m *WorkflowTransitionMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*WorkflowTransitionMutation) Where

Where appends a list predicates to the WorkflowTransitionMutation builder.

func (*WorkflowTransitionMutation) WhereP

func (m *WorkflowTransitionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkflowTransitionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WorkflowTransitionQuery

type WorkflowTransitionQuery struct {
	// contains filtered or unexported fields
}

WorkflowTransitionQuery is the builder for querying WorkflowTransition entities.

func (*WorkflowTransitionQuery) Aggregate

Aggregate returns a WorkflowTransitionSelect configured with the given aggregations.

func (*WorkflowTransitionQuery) All

All executes the query and returns a list of WorkflowTransitions.

func (*WorkflowTransitionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*WorkflowTransitionQuery) Clone

Clone returns a duplicate of the WorkflowTransitionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkflowTransitionQuery) Count

func (_q *WorkflowTransitionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkflowTransitionQuery) CountX

func (_q *WorkflowTransitionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkflowTransitionQuery) Exist

func (_q *WorkflowTransitionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkflowTransitionQuery) ExistX

func (_q *WorkflowTransitionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkflowTransitionQuery) First

First returns the first WorkflowTransition entity from the query. Returns a *NotFoundError when no WorkflowTransition was found.

func (*WorkflowTransitionQuery) FirstID

func (_q *WorkflowTransitionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first WorkflowTransition ID from the query. Returns a *NotFoundError when no WorkflowTransition ID was found.

func (*WorkflowTransitionQuery) FirstIDX

func (_q *WorkflowTransitionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkflowTransitionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WorkflowTransitionQuery) GroupBy

func (_q *WorkflowTransitionQuery) GroupBy(field string, fields ...string) *WorkflowTransitionGroupBy

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 {
	FromStates []string `json:"from_states,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WorkflowTransition.Query().
	GroupBy(workflowtransition.FieldFromStates).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WorkflowTransitionQuery) IDs

func (_q *WorkflowTransitionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of WorkflowTransition IDs.

func (*WorkflowTransitionQuery) IDsX

func (_q *WorkflowTransitionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*WorkflowTransitionQuery) Limit

Limit the number of records to be returned by this query.

func (*WorkflowTransitionQuery) Offset

Offset to start from.

func (*WorkflowTransitionQuery) Only

Only returns a single WorkflowTransition entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WorkflowTransition entity is found. Returns a *NotFoundError when no WorkflowTransition entities are found.

func (*WorkflowTransitionQuery) OnlyID

func (_q *WorkflowTransitionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only WorkflowTransition ID in the query. Returns a *NotSingularError when more than one WorkflowTransition ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkflowTransitionQuery) OnlyIDX

func (_q *WorkflowTransitionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkflowTransitionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WorkflowTransitionQuery) Order

Order specifies how the records should be ordered.

func (*WorkflowTransitionQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	FromStates []string `json:"from_states,omitempty"`
}

client.WorkflowTransition.Query().
	Select(workflowtransition.FieldFromStates).
	Scan(ctx, &v)

func (*WorkflowTransitionQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*WorkflowTransitionQuery) Where

Where adds a new predicate for the WorkflowTransitionQuery builder.

type WorkflowTransitionSelect

type WorkflowTransitionSelect struct {
	*WorkflowTransitionQuery
	// contains filtered or unexported fields
}

WorkflowTransitionSelect is the builder for selecting fields of WorkflowTransition entities.

func (*WorkflowTransitionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WorkflowTransitionSelect) Bool

func (s *WorkflowTransitionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) BoolX

func (s *WorkflowTransitionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkflowTransitionSelect) Bools

func (s *WorkflowTransitionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) BoolsX

func (s *WorkflowTransitionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkflowTransitionSelect) Float64

func (s *WorkflowTransitionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) Float64X

func (s *WorkflowTransitionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkflowTransitionSelect) Float64s

func (s *WorkflowTransitionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) Float64sX

func (s *WorkflowTransitionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkflowTransitionSelect) Int

func (s *WorkflowTransitionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) IntX

func (s *WorkflowTransitionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkflowTransitionSelect) Ints

func (s *WorkflowTransitionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) IntsX

func (s *WorkflowTransitionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkflowTransitionSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*WorkflowTransitionSelect) ScanX

func (s *WorkflowTransitionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkflowTransitionSelect) String

func (s *WorkflowTransitionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) StringX

func (s *WorkflowTransitionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkflowTransitionSelect) Strings

func (s *WorkflowTransitionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkflowTransitionSelect) StringsX

func (s *WorkflowTransitionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkflowTransitionUpdate

type WorkflowTransitionUpdate struct {
	// contains filtered or unexported fields
}

WorkflowTransitionUpdate is the builder for updating WorkflowTransition entities.

func (*WorkflowTransitionUpdate) AddWeight

AddWeight adds value to the "weight" field.

func (*WorkflowTransitionUpdate) AppendFromStates

func (_u *WorkflowTransitionUpdate) AppendFromStates(v []string) *WorkflowTransitionUpdate

AppendFromStates appends value to the "from_states" field.

func (*WorkflowTransitionUpdate) AppendRoles

AppendRoles appends value to the "roles" field.

func (*WorkflowTransitionUpdate) Exec

Exec executes the query.

func (*WorkflowTransitionUpdate) ExecX

func (_u *WorkflowTransitionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowTransitionUpdate) Mutation

Mutation returns the WorkflowTransitionMutation object of the builder.

func (*WorkflowTransitionUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkflowTransitionUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkflowTransitionUpdate) SetComment

SetComment sets the "comment" field.

func (*WorkflowTransitionUpdate) SetFromStates

SetFromStates sets the "from_states" field.

func (*WorkflowTransitionUpdate) SetLabel

SetLabel sets the "label" field.

func (*WorkflowTransitionUpdate) SetNillableComment

func (_u *WorkflowTransitionUpdate) SetNillableComment(v *string) *WorkflowTransitionUpdate

SetNillableComment sets the "comment" field if the given value is not nil.

func (*WorkflowTransitionUpdate) SetNillableLabel

func (_u *WorkflowTransitionUpdate) SetNillableLabel(v *string) *WorkflowTransitionUpdate

SetNillableLabel sets the "label" field if the given value is not nil.

func (*WorkflowTransitionUpdate) SetNillableToState

func (_u *WorkflowTransitionUpdate) SetNillableToState(v *string) *WorkflowTransitionUpdate

SetNillableToState sets the "to_state" field if the given value is not nil.

func (*WorkflowTransitionUpdate) SetNillableWeight

func (_u *WorkflowTransitionUpdate) SetNillableWeight(v *int) *WorkflowTransitionUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WorkflowTransitionUpdate) SetRoles

SetRoles sets the "roles" field.

func (*WorkflowTransitionUpdate) SetToState

SetToState sets the "to_state" field.

func (*WorkflowTransitionUpdate) SetWeight

SetWeight sets the "weight" field.

func (*WorkflowTransitionUpdate) Where

Where appends a list predicates to the WorkflowTransitionUpdate builder.

type WorkflowTransitionUpdateOne

type WorkflowTransitionUpdateOne struct {
	// contains filtered or unexported fields
}

WorkflowTransitionUpdateOne is the builder for updating a single WorkflowTransition entity.

func (*WorkflowTransitionUpdateOne) AddWeight

AddWeight adds value to the "weight" field.

func (*WorkflowTransitionUpdateOne) AppendFromStates

AppendFromStates appends value to the "from_states" field.

func (*WorkflowTransitionUpdateOne) AppendRoles

AppendRoles appends value to the "roles" field.

func (*WorkflowTransitionUpdateOne) Exec

Exec executes the query on the entity.

func (*WorkflowTransitionUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WorkflowTransitionUpdateOne) Mutation

Mutation returns the WorkflowTransitionMutation object of the builder.

func (*WorkflowTransitionUpdateOne) Save

Save executes the query and returns the updated WorkflowTransition entity.

func (*WorkflowTransitionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WorkflowTransitionUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkflowTransitionUpdateOne) SetComment

SetComment sets the "comment" field.

func (*WorkflowTransitionUpdateOne) SetFromStates

SetFromStates sets the "from_states" field.

func (*WorkflowTransitionUpdateOne) SetLabel

SetLabel sets the "label" field.

func (*WorkflowTransitionUpdateOne) SetNillableComment

SetNillableComment sets the "comment" field if the given value is not nil.

func (*WorkflowTransitionUpdateOne) SetNillableLabel

SetNillableLabel sets the "label" field if the given value is not nil.

func (*WorkflowTransitionUpdateOne) SetNillableToState

SetNillableToState sets the "to_state" field if the given value is not nil.

func (*WorkflowTransitionUpdateOne) SetNillableWeight

func (_u *WorkflowTransitionUpdateOne) SetNillableWeight(v *int) *WorkflowTransitionUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WorkflowTransitionUpdateOne) SetRoles

SetRoles sets the "roles" field.

func (*WorkflowTransitionUpdateOne) SetToState

SetToState sets the "to_state" field.

func (*WorkflowTransitionUpdateOne) SetWeight

SetWeight sets the "weight" field.

func (*WorkflowTransitionUpdateOne) Where

Where appends a list predicates to the WorkflowTransitionUpdate builder.

type WorkflowTransitions

type WorkflowTransitions []*WorkflowTransition

WorkflowTransitions is a parsable slice of WorkflowTransition.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL