generated

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 25 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.
	TypeNode                   = "Node"
	TypeUser                   = "User"
	TypeWebform                = "Webform"
	TypeWebformElement         = "WebformElement"
	TypeWebformSubmission      = "WebformSubmission"
	TypeWebformSubmissionValue = "WebformSubmissionValue"
)

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
	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// Webform is the client for interacting with the Webform builders.
	Webform *WebformClient
	// WebformElement is the client for interacting with the WebformElement builders.
	WebformElement *WebformElementClient
	// WebformSubmission is the client for interacting with the WebformSubmission builders.
	WebformSubmission *WebformSubmissionClient
	// WebformSubmissionValue is the client for interacting with the WebformSubmissionValue builders.
	WebformSubmissionValue *WebformSubmissionValueClient
	// 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().
	Node.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

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

func (*NotFoundError) Is

func (e *NotFoundError) Is(target error) bool

Is makes errors.Is(err, schemakit.ErrEntityNotFound) true for ent's not-found errors, so the engine recognizes the module's missing record as it does the core's (its handlers answer 404).

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 {

	// Node is the client for interacting with the Node builders.
	Node *NodeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// Webform is the client for interacting with the Webform builders.
	Webform *WebformClient
	// WebformElement is the client for interacting with the WebformElement builders.
	WebformElement *WebformElementClient
	// WebformSubmission is the client for interacting with the WebformSubmission builders.
	WebformSubmission *WebformSubmissionClient
	// WebformSubmissionValue is the client for interacting with the WebformSubmissionValue builders.
	WebformSubmissionValue *WebformSubmissionValueClient
	// 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

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

func (_m *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

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

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

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

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(_m *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

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

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

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

Exec executes the query.

func (*UserCreate) ExecX

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

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

func (*UserCreate) Mutation

func (_c *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (_c *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (_c *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetID

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

SetID sets the "id" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

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

Exec executes the query.

func (*UserCreateBulk) ExecX

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

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

func (*UserCreateBulk) Save

func (_c *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (_c *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

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

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

func (*UserDelete) ExecX

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

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

func (*UserDelete) Where

func (_d *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

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

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

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

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

func (*UserDeleteOne) Where

func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

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

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

func (*UserGroupBy) Bool

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

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

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

func (*UserGroupBy) Bools

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

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

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

func (*UserGroupBy) Float64

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

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

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

func (*UserGroupBy) Float64s

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

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

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

func (*UserGroupBy) Int

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

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

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

func (*UserGroupBy) Ints

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

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

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

func (*UserGroupBy) Scan

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

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

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

func (*UserGroupBy) String

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

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

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

func (*UserGroupBy) Strings

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

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

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

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

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

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

func (*UserMutation) AddedField

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

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

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

func (*UserMutation) AddedIDs

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

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

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

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

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

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

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

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

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

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

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

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

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

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

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

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

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

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

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (UserMutation) Tx

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

func (m *UserMutation) Type() string

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

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (_q *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (_q *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

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

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

Count returns the count of the given query.

func (*UserQuery) CountX

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

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

func (*UserQuery) Exist

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

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

func (*UserQuery) ExistX

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

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

func (*UserQuery) First

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

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

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

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

func (*UserQuery) FirstX

func (_q *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

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

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

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

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

func (*UserQuery) Limit

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

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

func (*UserQuery) Offset

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

Offset to start from.

func (*UserQuery) Only

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

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

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

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

func (*UserQuery) OnlyX

func (_q *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Select

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

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

func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

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

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

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

func (*UserSelect) Bools

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

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

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

func (*UserSelect) Float64

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

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

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

func (*UserSelect) Float64s

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

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

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

func (*UserSelect) Int

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

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

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

func (*UserSelect) Ints

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

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

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

func (*UserSelect) Scan

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

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

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

func (*UserSelect) String

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

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

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

func (*UserSelect) Strings

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

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

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) Exec

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

Exec executes the query.

func (*UserUpdate) ExecX

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

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

func (*UserUpdate) Mutation

func (_u *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

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

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

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

func (*UserUpdate) Where

func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) Exec

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

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

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

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

func (*UserUpdateOne) Mutation

func (_u *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (_u *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

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

func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

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 Webform

type Webform struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Nid holds the value of the "nid" field.
	Nid int `json:"nid,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Confirmation holds the value of the "confirmation" field.
	Confirmation string `json:"confirmation,omitempty"`
	// ConfirmationURL holds the value of the "confirmation_url" field.
	ConfirmationURL string `json:"confirmation_url,omitempty"`
	// SubmitLabel holds the value of the "submit_label" field.
	SubmitLabel string `json:"submit_label,omitempty"`
	// Closed holds the value of the "closed" field.
	Closed bool `json:"closed,omitempty"`
	// NotifyEmail holds the value of the "notify_email" field.
	NotifyEmail string `json:"notify_email,omitempty"`
	// LimitPerUser holds the value of the "limit_per_user" field.
	LimitPerUser bool `json:"limit_per_user,omitempty"`
	// MaxSubmissions holds the value of the "max_submissions" field.
	MaxSubmissions int `json:"max_submissions,omitempty"`
	// ClosesAt holds the value of the "closes_at" field.
	ClosesAt *time.Time `json:"closes_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WebformQuery when eager-loading is set.
	Edges WebformEdges `json:"edges"`
	// contains filtered or unexported fields
}

Webform is the model entity for the Webform schema.

func (*Webform) QueryElements

func (_m *Webform) QueryElements() *WebformElementQuery

QueryElements queries the "elements" edge of the Webform entity.

func (*Webform) QueryNode

func (_m *Webform) QueryNode() *NodeQuery

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

func (*Webform) QuerySubmissions

func (_m *Webform) QuerySubmissions() *WebformSubmissionQuery

QuerySubmissions queries the "submissions" edge of the Webform entity.

func (*Webform) String

func (_m *Webform) String() string

String implements the fmt.Stringer.

func (*Webform) Unwrap

func (_m *Webform) Unwrap() *Webform

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

func (_m *Webform) Update() *WebformUpdateOne

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

func (*Webform) Value

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

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

type WebformClient

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

WebformClient is a client for the Webform schema.

func NewWebformClient

func NewWebformClient(c config) *WebformClient

NewWebformClient returns a client for the Webform from the given config.

func (*WebformClient) Create

func (c *WebformClient) Create() *WebformCreate

Create returns a builder for creating a Webform entity.

func (*WebformClient) CreateBulk

func (c *WebformClient) CreateBulk(builders ...*WebformCreate) *WebformCreateBulk

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

func (*WebformClient) Delete

func (c *WebformClient) Delete() *WebformDelete

Delete returns a delete builder for Webform.

func (*WebformClient) DeleteOne

func (c *WebformClient) DeleteOne(_m *Webform) *WebformDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WebformClient) DeleteOneID

func (c *WebformClient) DeleteOneID(id int) *WebformDeleteOne

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

func (*WebformClient) Get

func (c *WebformClient) Get(ctx context.Context, id int) (*Webform, error)

Get returns a Webform entity by its id.

func (*WebformClient) GetX

func (c *WebformClient) GetX(ctx context.Context, id int) *Webform

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

func (*WebformClient) Hooks

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

Hooks returns the client hooks.

func (*WebformClient) Intercept

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

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

func (*WebformClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WebformClient) MapCreateBulk

func (c *WebformClient) MapCreateBulk(slice any, setFunc func(*WebformCreate, int)) *WebformCreateBulk

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

func (c *WebformClient) Query() *WebformQuery

Query returns a query builder for Webform.

func (*WebformClient) QueryElements

func (c *WebformClient) QueryElements(_m *Webform) *WebformElementQuery

QueryElements queries the elements edge of a Webform.

func (*WebformClient) QueryNode

func (c *WebformClient) QueryNode(_m *Webform) *NodeQuery

QueryNode queries the node edge of a Webform.

func (*WebformClient) QuerySubmissions

func (c *WebformClient) QuerySubmissions(_m *Webform) *WebformSubmissionQuery

QuerySubmissions queries the submissions edge of a Webform.

func (*WebformClient) Update

func (c *WebformClient) Update() *WebformUpdate

Update returns an update builder for Webform.

func (*WebformClient) UpdateOne

func (c *WebformClient) UpdateOne(_m *Webform) *WebformUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WebformClient) UpdateOneID

func (c *WebformClient) UpdateOneID(id int) *WebformUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WebformClient) Use

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

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

type WebformCreate

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

WebformCreate is the builder for creating a Webform entity.

func (*WebformCreate) AddElementIDs

func (_c *WebformCreate) AddElementIDs(ids ...int) *WebformCreate

AddElementIDs adds the "elements" edge to the WebformElement entity by IDs.

func (*WebformCreate) AddElements

func (_c *WebformCreate) AddElements(v ...*WebformElement) *WebformCreate

AddElements adds the "elements" edges to the WebformElement entity.

func (*WebformCreate) AddSubmissionIDs

func (_c *WebformCreate) AddSubmissionIDs(ids ...int) *WebformCreate

AddSubmissionIDs adds the "submissions" edge to the WebformSubmission entity by IDs.

func (*WebformCreate) AddSubmissions

func (_c *WebformCreate) AddSubmissions(v ...*WebformSubmission) *WebformCreate

AddSubmissions adds the "submissions" edges to the WebformSubmission entity.

func (*WebformCreate) Exec

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

Exec executes the query.

func (*WebformCreate) ExecX

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

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

func (*WebformCreate) Mutation

func (_c *WebformCreate) Mutation() *WebformMutation

Mutation returns the WebformMutation object of the builder.

func (*WebformCreate) Save

func (_c *WebformCreate) Save(ctx context.Context) (*Webform, error)

Save creates the Webform in the database.

func (*WebformCreate) SaveX

func (_c *WebformCreate) SaveX(ctx context.Context) *Webform

SaveX calls Save and panics if Save returns an error.

func (*WebformCreate) SetClosed

func (_c *WebformCreate) SetClosed(v bool) *WebformCreate

SetClosed sets the "closed" field.

func (*WebformCreate) SetClosesAt

func (_c *WebformCreate) SetClosesAt(v time.Time) *WebformCreate

SetClosesAt sets the "closes_at" field.

func (*WebformCreate) SetConfirmation

func (_c *WebformCreate) SetConfirmation(v string) *WebformCreate

SetConfirmation sets the "confirmation" field.

func (*WebformCreate) SetConfirmationURL

func (_c *WebformCreate) SetConfirmationURL(v string) *WebformCreate

SetConfirmationURL sets the "confirmation_url" field.

func (*WebformCreate) SetDescription

func (_c *WebformCreate) SetDescription(v string) *WebformCreate

SetDescription sets the "description" field.

func (*WebformCreate) SetID

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

SetID sets the "id" field.

func (*WebformCreate) SetLimitPerUser

func (_c *WebformCreate) SetLimitPerUser(v bool) *WebformCreate

SetLimitPerUser sets the "limit_per_user" field.

func (*WebformCreate) SetMaxSubmissions

func (_c *WebformCreate) SetMaxSubmissions(v int) *WebformCreate

SetMaxSubmissions sets the "max_submissions" field.

func (*WebformCreate) SetNid

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

SetNid sets the "nid" field.

func (*WebformCreate) SetNillableClosed

func (_c *WebformCreate) SetNillableClosed(v *bool) *WebformCreate

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*WebformCreate) SetNillableClosesAt

func (_c *WebformCreate) SetNillableClosesAt(v *time.Time) *WebformCreate

SetNillableClosesAt sets the "closes_at" field if the given value is not nil.

func (*WebformCreate) SetNillableConfirmation

func (_c *WebformCreate) SetNillableConfirmation(v *string) *WebformCreate

SetNillableConfirmation sets the "confirmation" field if the given value is not nil.

func (*WebformCreate) SetNillableConfirmationURL

func (_c *WebformCreate) SetNillableConfirmationURL(v *string) *WebformCreate

SetNillableConfirmationURL sets the "confirmation_url" field if the given value is not nil.

func (*WebformCreate) SetNillableDescription

func (_c *WebformCreate) SetNillableDescription(v *string) *WebformCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WebformCreate) SetNillableLimitPerUser

func (_c *WebformCreate) SetNillableLimitPerUser(v *bool) *WebformCreate

SetNillableLimitPerUser sets the "limit_per_user" field if the given value is not nil.

func (*WebformCreate) SetNillableMaxSubmissions

func (_c *WebformCreate) SetNillableMaxSubmissions(v *int) *WebformCreate

SetNillableMaxSubmissions sets the "max_submissions" field if the given value is not nil.

func (*WebformCreate) SetNillableNotifyEmail

func (_c *WebformCreate) SetNillableNotifyEmail(v *string) *WebformCreate

SetNillableNotifyEmail sets the "notify_email" field if the given value is not nil.

func (*WebformCreate) SetNillableSubmitLabel

func (_c *WebformCreate) SetNillableSubmitLabel(v *string) *WebformCreate

SetNillableSubmitLabel sets the "submit_label" field if the given value is not nil.

func (*WebformCreate) SetNode

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

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

func (*WebformCreate) SetNodeID

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

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

func (*WebformCreate) SetNotifyEmail

func (_c *WebformCreate) SetNotifyEmail(v string) *WebformCreate

SetNotifyEmail sets the "notify_email" field.

func (*WebformCreate) SetSubmitLabel

func (_c *WebformCreate) SetSubmitLabel(v string) *WebformCreate

SetSubmitLabel sets the "submit_label" field.

type WebformCreateBulk

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

WebformCreateBulk is the builder for creating many Webform entities in bulk.

func (*WebformCreateBulk) Exec

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

Exec executes the query.

func (*WebformCreateBulk) ExecX

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

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

func (*WebformCreateBulk) Save

func (_c *WebformCreateBulk) Save(ctx context.Context) ([]*Webform, error)

Save creates the Webform entities in the database.

func (*WebformCreateBulk) SaveX

func (_c *WebformCreateBulk) SaveX(ctx context.Context) []*Webform

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

type WebformDelete

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

WebformDelete is the builder for deleting a Webform entity.

func (*WebformDelete) Exec

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

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

func (*WebformDelete) ExecX

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

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

func (*WebformDelete) Where

func (_d *WebformDelete) Where(ps ...predicate.Webform) *WebformDelete

Where appends a list predicates to the WebformDelete builder.

type WebformDeleteOne

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

WebformDeleteOne is the builder for deleting a single Webform entity.

func (*WebformDeleteOne) Exec

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

Exec executes the deletion query.

func (*WebformDeleteOne) ExecX

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

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

func (*WebformDeleteOne) Where

Where appends a list predicates to the WebformDelete builder.

type WebformEdges

type WebformEdges struct {
	// Node holds the value of the node edge.
	Node *Node `json:"node,omitempty"`
	// Elements holds the value of the elements edge.
	Elements []*WebformElement `json:"elements,omitempty"`
	// Submissions holds the value of the submissions edge.
	Submissions []*WebformSubmission `json:"submissions,omitempty"`
	// contains filtered or unexported fields
}

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

func (WebformEdges) ElementsOrErr

func (e WebformEdges) ElementsOrErr() ([]*WebformElement, error)

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

func (WebformEdges) NodeOrErr

func (e WebformEdges) 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.

func (WebformEdges) SubmissionsOrErr

func (e WebformEdges) SubmissionsOrErr() ([]*WebformSubmission, error)

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

type WebformElement

type WebformElement struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// WebformID holds the value of the "webform_id" field.
	WebformID int `json:"webform_id,omitempty"`
	// MachineName holds the value of the "machine_name" field.
	MachineName string `json:"machine_name,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Label holds the value of the "label" field.
	Label string `json:"label,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Required holds the value of the "required" field.
	Required bool `json:"required,omitempty"`
	// Options holds the value of the "options" field.
	Options string `json:"options,omitempty"`
	// Weight holds the value of the "weight" field.
	Weight int `json:"weight,omitempty"`
	// VisibleIfElement holds the value of the "visible_if_element" field.
	VisibleIfElement string `json:"visible_if_element,omitempty"`
	// VisibleIfValue holds the value of the "visible_if_value" field.
	VisibleIfValue string `json:"visible_if_value,omitempty"`
	// PrefillParam holds the value of the "prefill_param" field.
	PrefillParam string `json:"prefill_param,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WebformElementQuery when eager-loading is set.
	Edges WebformElementEdges `json:"edges"`
	// contains filtered or unexported fields
}

WebformElement is the model entity for the WebformElement schema.

func (*WebformElement) QueryValues

func (_m *WebformElement) QueryValues() *WebformSubmissionValueQuery

QueryValues queries the "values" edge of the WebformElement entity.

func (*WebformElement) QueryWebform

func (_m *WebformElement) QueryWebform() *WebformQuery

QueryWebform queries the "webform" edge of the WebformElement entity.

func (*WebformElement) String

func (_m *WebformElement) String() string

String implements the fmt.Stringer.

func (*WebformElement) Unwrap

func (_m *WebformElement) Unwrap() *WebformElement

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

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

func (*WebformElement) Value

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

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

type WebformElementClient

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

WebformElementClient is a client for the WebformElement schema.

func NewWebformElementClient

func NewWebformElementClient(c config) *WebformElementClient

NewWebformElementClient returns a client for the WebformElement from the given config.

func (*WebformElementClient) Create

Create returns a builder for creating a WebformElement entity.

func (*WebformElementClient) CreateBulk

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

func (*WebformElementClient) Delete

Delete returns a delete builder for WebformElement.

func (*WebformElementClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WebformElementClient) DeleteOneID

func (c *WebformElementClient) DeleteOneID(id int) *WebformElementDeleteOne

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

func (*WebformElementClient) Get

Get returns a WebformElement entity by its id.

func (*WebformElementClient) GetX

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

func (*WebformElementClient) Hooks

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

Hooks returns the client hooks.

func (*WebformElementClient) Intercept

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

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

func (*WebformElementClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WebformElementClient) MapCreateBulk

func (c *WebformElementClient) MapCreateBulk(slice any, setFunc func(*WebformElementCreate, int)) *WebformElementCreateBulk

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

Query returns a query builder for WebformElement.

func (*WebformElementClient) QueryValues

QueryValues queries the values edge of a WebformElement.

func (*WebformElementClient) QueryWebform

func (c *WebformElementClient) QueryWebform(_m *WebformElement) *WebformQuery

QueryWebform queries the webform edge of a WebformElement.

func (*WebformElementClient) Update

Update returns an update builder for WebformElement.

func (*WebformElementClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WebformElementClient) UpdateOneID

func (c *WebformElementClient) UpdateOneID(id int) *WebformElementUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WebformElementClient) Use

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

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

type WebformElementCreate

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

WebformElementCreate is the builder for creating a WebformElement entity.

func (*WebformElementCreate) AddValueIDs

func (_c *WebformElementCreate) AddValueIDs(ids ...int) *WebformElementCreate

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformElementCreate) AddValues

AddValues adds the "values" edges to the WebformSubmissionValue entity.

func (*WebformElementCreate) Exec

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

Exec executes the query.

func (*WebformElementCreate) ExecX

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

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

func (*WebformElementCreate) Mutation

Mutation returns the WebformElementMutation object of the builder.

func (*WebformElementCreate) Save

Save creates the WebformElement in the database.

func (*WebformElementCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WebformElementCreate) SetDescription

func (_c *WebformElementCreate) SetDescription(v string) *WebformElementCreate

SetDescription sets the "description" field.

func (*WebformElementCreate) SetID

SetID sets the "id" field.

func (*WebformElementCreate) SetLabel

SetLabel sets the "label" field.

func (*WebformElementCreate) SetMachineName

func (_c *WebformElementCreate) SetMachineName(v string) *WebformElementCreate

SetMachineName sets the "machine_name" field.

func (*WebformElementCreate) SetNillableDescription

func (_c *WebformElementCreate) SetNillableDescription(v *string) *WebformElementCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WebformElementCreate) SetNillableOptions

func (_c *WebformElementCreate) SetNillableOptions(v *string) *WebformElementCreate

SetNillableOptions sets the "options" field if the given value is not nil.

func (*WebformElementCreate) SetNillablePrefillParam

func (_c *WebformElementCreate) SetNillablePrefillParam(v *string) *WebformElementCreate

SetNillablePrefillParam sets the "prefill_param" field if the given value is not nil.

func (*WebformElementCreate) SetNillableRequired

func (_c *WebformElementCreate) SetNillableRequired(v *bool) *WebformElementCreate

SetNillableRequired sets the "required" field if the given value is not nil.

func (*WebformElementCreate) SetNillableVisibleIfElement

func (_c *WebformElementCreate) SetNillableVisibleIfElement(v *string) *WebformElementCreate

SetNillableVisibleIfElement sets the "visible_if_element" field if the given value is not nil.

func (*WebformElementCreate) SetNillableVisibleIfValue

func (_c *WebformElementCreate) SetNillableVisibleIfValue(v *string) *WebformElementCreate

SetNillableVisibleIfValue sets the "visible_if_value" field if the given value is not nil.

func (*WebformElementCreate) SetNillableWeight

func (_c *WebformElementCreate) SetNillableWeight(v *int) *WebformElementCreate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WebformElementCreate) SetOptions

SetOptions sets the "options" field.

func (*WebformElementCreate) SetPrefillParam

func (_c *WebformElementCreate) SetPrefillParam(v string) *WebformElementCreate

SetPrefillParam sets the "prefill_param" field.

func (*WebformElementCreate) SetRequired

func (_c *WebformElementCreate) SetRequired(v bool) *WebformElementCreate

SetRequired sets the "required" field.

func (*WebformElementCreate) SetType

SetType sets the "type" field.

func (*WebformElementCreate) SetVisibleIfElement

func (_c *WebformElementCreate) SetVisibleIfElement(v string) *WebformElementCreate

SetVisibleIfElement sets the "visible_if_element" field.

func (*WebformElementCreate) SetVisibleIfValue

func (_c *WebformElementCreate) SetVisibleIfValue(v string) *WebformElementCreate

SetVisibleIfValue sets the "visible_if_value" field.

func (*WebformElementCreate) SetWebform

SetWebform sets the "webform" edge to the Webform entity.

func (*WebformElementCreate) SetWebformID

func (_c *WebformElementCreate) SetWebformID(v int) *WebformElementCreate

SetWebformID sets the "webform_id" field.

func (*WebformElementCreate) SetWeight

func (_c *WebformElementCreate) SetWeight(v int) *WebformElementCreate

SetWeight sets the "weight" field.

type WebformElementCreateBulk

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

WebformElementCreateBulk is the builder for creating many WebformElement entities in bulk.

func (*WebformElementCreateBulk) Exec

Exec executes the query.

func (*WebformElementCreateBulk) ExecX

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

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

func (*WebformElementCreateBulk) Save

Save creates the WebformElement entities in the database.

func (*WebformElementCreateBulk) SaveX

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

type WebformElementDelete

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

WebformElementDelete is the builder for deleting a WebformElement entity.

func (*WebformElementDelete) Exec

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

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

func (*WebformElementDelete) ExecX

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

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

func (*WebformElementDelete) Where

Where appends a list predicates to the WebformElementDelete builder.

type WebformElementDeleteOne

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

WebformElementDeleteOne is the builder for deleting a single WebformElement entity.

func (*WebformElementDeleteOne) Exec

Exec executes the deletion query.

func (*WebformElementDeleteOne) ExecX

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

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

func (*WebformElementDeleteOne) Where

Where appends a list predicates to the WebformElementDelete builder.

type WebformElementEdges

type WebformElementEdges struct {
	// Webform holds the value of the webform edge.
	Webform *Webform `json:"webform,omitempty"`
	// Values holds the value of the values edge.
	Values []*WebformSubmissionValue `json:"values,omitempty"`
	// contains filtered or unexported fields
}

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

func (WebformElementEdges) ValuesOrErr

func (e WebformElementEdges) ValuesOrErr() ([]*WebformSubmissionValue, error)

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

func (WebformElementEdges) WebformOrErr

func (e WebformElementEdges) WebformOrErr() (*Webform, error)

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

type WebformElementGroupBy

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

WebformElementGroupBy is the group-by builder for WebformElement entities.

func (*WebformElementGroupBy) Aggregate

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

func (*WebformElementGroupBy) Bool

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

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

func (*WebformElementGroupBy) BoolX

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

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

func (*WebformElementGroupBy) Bools

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

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

func (*WebformElementGroupBy) BoolsX

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

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

func (*WebformElementGroupBy) Float64

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

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

func (*WebformElementGroupBy) Float64X

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

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

func (*WebformElementGroupBy) Float64s

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

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

func (*WebformElementGroupBy) Float64sX

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

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

func (*WebformElementGroupBy) Int

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

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

func (*WebformElementGroupBy) IntX

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

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

func (*WebformElementGroupBy) Ints

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

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

func (*WebformElementGroupBy) IntsX

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

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

func (*WebformElementGroupBy) Scan

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

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

func (*WebformElementGroupBy) ScanX

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

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

func (*WebformElementGroupBy) String

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

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

func (*WebformElementGroupBy) StringX

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

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

func (*WebformElementGroupBy) Strings

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

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

func (*WebformElementGroupBy) StringsX

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

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

type WebformElementMutation

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

WebformElementMutation represents an operation that mutates the WebformElement nodes in the graph.

func (*WebformElementMutation) AddField

func (m *WebformElementMutation) 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 (*WebformElementMutation) AddValueIDs

func (m *WebformElementMutation) AddValueIDs(ids ...int)

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by ids.

func (*WebformElementMutation) AddWeight

func (m *WebformElementMutation) AddWeight(i int)

AddWeight adds i to the "weight" field.

func (*WebformElementMutation) AddedEdges

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

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

func (*WebformElementMutation) AddedField

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

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

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

func (*WebformElementMutation) AddedIDs

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

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

func (*WebformElementMutation) AddedWeight

func (m *WebformElementMutation) AddedWeight() (r int, exists bool)

AddedWeight returns the value that was added to the "weight" field in this mutation.

func (*WebformElementMutation) ClearDescription

func (m *WebformElementMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*WebformElementMutation) ClearEdge

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

func (m *WebformElementMutation) 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 (*WebformElementMutation) ClearOptions

func (m *WebformElementMutation) ClearOptions()

ClearOptions clears the value of the "options" field.

func (*WebformElementMutation) ClearValues

func (m *WebformElementMutation) ClearValues()

ClearValues clears the "values" edge to the WebformSubmissionValue entity.

func (*WebformElementMutation) ClearWebform

func (m *WebformElementMutation) ClearWebform()

ClearWebform clears the "webform" edge to the Webform entity.

func (*WebformElementMutation) ClearedEdges

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

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

func (*WebformElementMutation) ClearedFields

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

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

func (WebformElementMutation) Client

func (m WebformElementMutation) 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 (*WebformElementMutation) Description

func (m *WebformElementMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*WebformElementMutation) DescriptionCleared

func (m *WebformElementMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*WebformElementMutation) EdgeCleared

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

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

func (*WebformElementMutation) Field

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

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

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

func (*WebformElementMutation) Fields

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

func (m *WebformElementMutation) GetType() (r string, exists bool)

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

func (*WebformElementMutation) ID

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

func (m *WebformElementMutation) 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 (*WebformElementMutation) Label

func (m *WebformElementMutation) Label() (r string, exists bool)

Label returns the value of the "label" field in the mutation.

func (*WebformElementMutation) MachineName

func (m *WebformElementMutation) MachineName() (r string, exists bool)

MachineName returns the value of the "machine_name" field in the mutation.

func (*WebformElementMutation) OldDescription

func (m *WebformElementMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldField

func (m *WebformElementMutation) 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 (*WebformElementMutation) OldLabel

func (m *WebformElementMutation) OldLabel(ctx context.Context) (v string, err error)

OldLabel returns the old "label" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldMachineName

func (m *WebformElementMutation) OldMachineName(ctx context.Context) (v string, err error)

OldMachineName returns the old "machine_name" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldOptions

func (m *WebformElementMutation) OldOptions(ctx context.Context) (v string, err error)

OldOptions returns the old "options" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldPrefillParam

func (m *WebformElementMutation) OldPrefillParam(ctx context.Context) (v string, err error)

OldPrefillParam returns the old "prefill_param" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldRequired

func (m *WebformElementMutation) OldRequired(ctx context.Context) (v bool, err error)

OldRequired returns the old "required" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldType

func (m *WebformElementMutation) OldType(ctx context.Context) (v string, err error)

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

func (m *WebformElementMutation) OldVisibleIfElement(ctx context.Context) (v string, err error)

OldVisibleIfElement returns the old "visible_if_element" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldVisibleIfValue

func (m *WebformElementMutation) OldVisibleIfValue(ctx context.Context) (v string, err error)

OldVisibleIfValue returns the old "visible_if_value" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldWebformID

func (m *WebformElementMutation) OldWebformID(ctx context.Context) (v int, err error)

OldWebformID returns the old "webform_id" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) OldWeight

func (m *WebformElementMutation) OldWeight(ctx context.Context) (v int, err error)

OldWeight returns the old "weight" field's value of the WebformElement entity. If the WebformElement 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 (*WebformElementMutation) Op

func (m *WebformElementMutation) Op() Op

Op returns the operation name.

func (*WebformElementMutation) Options

func (m *WebformElementMutation) Options() (r string, exists bool)

Options returns the value of the "options" field in the mutation.

func (*WebformElementMutation) OptionsCleared

func (m *WebformElementMutation) OptionsCleared() bool

OptionsCleared returns if the "options" field was cleared in this mutation.

func (*WebformElementMutation) PrefillParam

func (m *WebformElementMutation) PrefillParam() (r string, exists bool)

PrefillParam returns the value of the "prefill_param" field in the mutation.

func (*WebformElementMutation) RemoveValueIDs

func (m *WebformElementMutation) RemoveValueIDs(ids ...int)

RemoveValueIDs removes the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformElementMutation) RemovedEdges

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

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

func (*WebformElementMutation) RemovedIDs

func (m *WebformElementMutation) 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 (*WebformElementMutation) RemovedValuesIDs

func (m *WebformElementMutation) RemovedValuesIDs() (ids []int)

RemovedValues returns the removed IDs of the "values" edge to the WebformSubmissionValue entity.

func (*WebformElementMutation) Required

func (m *WebformElementMutation) Required() (r bool, exists bool)

Required returns the value of the "required" field in the mutation.

func (*WebformElementMutation) ResetDescription

func (m *WebformElementMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*WebformElementMutation) ResetEdge

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

func (m *WebformElementMutation) 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 (*WebformElementMutation) ResetLabel

func (m *WebformElementMutation) ResetLabel()

ResetLabel resets all changes to the "label" field.

func (*WebformElementMutation) ResetMachineName

func (m *WebformElementMutation) ResetMachineName()

ResetMachineName resets all changes to the "machine_name" field.

func (*WebformElementMutation) ResetOptions

func (m *WebformElementMutation) ResetOptions()

ResetOptions resets all changes to the "options" field.

func (*WebformElementMutation) ResetPrefillParam

func (m *WebformElementMutation) ResetPrefillParam()

ResetPrefillParam resets all changes to the "prefill_param" field.

func (*WebformElementMutation) ResetRequired

func (m *WebformElementMutation) ResetRequired()

ResetRequired resets all changes to the "required" field.

func (*WebformElementMutation) ResetType

func (m *WebformElementMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*WebformElementMutation) ResetValues

func (m *WebformElementMutation) ResetValues()

ResetValues resets all changes to the "values" edge.

func (*WebformElementMutation) ResetVisibleIfElement

func (m *WebformElementMutation) ResetVisibleIfElement()

ResetVisibleIfElement resets all changes to the "visible_if_element" field.

func (*WebformElementMutation) ResetVisibleIfValue

func (m *WebformElementMutation) ResetVisibleIfValue()

ResetVisibleIfValue resets all changes to the "visible_if_value" field.

func (*WebformElementMutation) ResetWebform

func (m *WebformElementMutation) ResetWebform()

ResetWebform resets all changes to the "webform" edge.

func (*WebformElementMutation) ResetWebformID

func (m *WebformElementMutation) ResetWebformID()

ResetWebformID resets all changes to the "webform_id" field.

func (*WebformElementMutation) ResetWeight

func (m *WebformElementMutation) ResetWeight()

ResetWeight resets all changes to the "weight" field.

func (*WebformElementMutation) SetDescription

func (m *WebformElementMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*WebformElementMutation) SetField

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

func (m *WebformElementMutation) SetID(id int)

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

func (*WebformElementMutation) SetLabel

func (m *WebformElementMutation) SetLabel(s string)

SetLabel sets the "label" field.

func (*WebformElementMutation) SetMachineName

func (m *WebformElementMutation) SetMachineName(s string)

SetMachineName sets the "machine_name" field.

func (*WebformElementMutation) SetOp

func (m *WebformElementMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WebformElementMutation) SetOptions

func (m *WebformElementMutation) SetOptions(s string)

SetOptions sets the "options" field.

func (*WebformElementMutation) SetPrefillParam

func (m *WebformElementMutation) SetPrefillParam(s string)

SetPrefillParam sets the "prefill_param" field.

func (*WebformElementMutation) SetRequired

func (m *WebformElementMutation) SetRequired(b bool)

SetRequired sets the "required" field.

func (*WebformElementMutation) SetType

func (m *WebformElementMutation) SetType(s string)

SetType sets the "type" field.

func (*WebformElementMutation) SetVisibleIfElement

func (m *WebformElementMutation) SetVisibleIfElement(s string)

SetVisibleIfElement sets the "visible_if_element" field.

func (*WebformElementMutation) SetVisibleIfValue

func (m *WebformElementMutation) SetVisibleIfValue(s string)

SetVisibleIfValue sets the "visible_if_value" field.

func (*WebformElementMutation) SetWebformID

func (m *WebformElementMutation) SetWebformID(i int)

SetWebformID sets the "webform_id" field.

func (*WebformElementMutation) SetWeight

func (m *WebformElementMutation) SetWeight(i int)

SetWeight sets the "weight" field.

func (WebformElementMutation) Tx

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

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

func (*WebformElementMutation) Type

func (m *WebformElementMutation) Type() string

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

func (*WebformElementMutation) ValuesCleared

func (m *WebformElementMutation) ValuesCleared() bool

ValuesCleared reports if the "values" edge to the WebformSubmissionValue entity was cleared.

func (*WebformElementMutation) ValuesIDs

func (m *WebformElementMutation) ValuesIDs() (ids []int)

ValuesIDs returns the "values" edge IDs in the mutation.

func (*WebformElementMutation) VisibleIfElement

func (m *WebformElementMutation) VisibleIfElement() (r string, exists bool)

VisibleIfElement returns the value of the "visible_if_element" field in the mutation.

func (*WebformElementMutation) VisibleIfValue

func (m *WebformElementMutation) VisibleIfValue() (r string, exists bool)

VisibleIfValue returns the value of the "visible_if_value" field in the mutation.

func (*WebformElementMutation) WebformCleared

func (m *WebformElementMutation) WebformCleared() bool

WebformCleared reports if the "webform" edge to the Webform entity was cleared.

func (*WebformElementMutation) WebformID

func (m *WebformElementMutation) WebformID() (r int, exists bool)

WebformID returns the value of the "webform_id" field in the mutation.

func (*WebformElementMutation) WebformIDs

func (m *WebformElementMutation) WebformIDs() (ids []int)

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

func (*WebformElementMutation) Weight

func (m *WebformElementMutation) Weight() (r int, exists bool)

Weight returns the value of the "weight" field in the mutation.

func (*WebformElementMutation) Where

Where appends a list predicates to the WebformElementMutation builder.

func (*WebformElementMutation) WhereP

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

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

type WebformElementQuery

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

WebformElementQuery is the builder for querying WebformElement entities.

func (*WebformElementQuery) Aggregate

Aggregate returns a WebformElementSelect configured with the given aggregations.

func (*WebformElementQuery) All

All executes the query and returns a list of WebformElements.

func (*WebformElementQuery) AllX

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

func (*WebformElementQuery) Clone

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

func (*WebformElementQuery) Count

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

Count returns the count of the given query.

func (*WebformElementQuery) CountX

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

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

func (*WebformElementQuery) Exist

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

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

func (*WebformElementQuery) ExistX

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

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

func (*WebformElementQuery) First

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

func (*WebformElementQuery) FirstID

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

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

func (*WebformElementQuery) FirstIDX

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

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

func (*WebformElementQuery) FirstX

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

func (*WebformElementQuery) GroupBy

func (_q *WebformElementQuery) GroupBy(field string, fields ...string) *WebformElementGroupBy

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

client.WebformElement.Query().
	GroupBy(webformelement.FieldWebformID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WebformElementQuery) IDs

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

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

func (*WebformElementQuery) IDsX

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

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

func (*WebformElementQuery) Limit

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

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

func (*WebformElementQuery) Offset

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

Offset to start from.

func (*WebformElementQuery) Only

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

func (*WebformElementQuery) OnlyID

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

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

func (*WebformElementQuery) OnlyIDX

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

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

func (*WebformElementQuery) OnlyX

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

func (*WebformElementQuery) Order

Order specifies how the records should be ordered.

func (*WebformElementQuery) QueryValues

QueryValues chains the current query on the "values" edge.

func (*WebformElementQuery) QueryWebform

func (_q *WebformElementQuery) QueryWebform() *WebformQuery

QueryWebform chains the current query on the "webform" edge.

func (*WebformElementQuery) Select

func (_q *WebformElementQuery) Select(fields ...string) *WebformElementSelect

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

client.WebformElement.Query().
	Select(webformelement.FieldWebformID).
	Scan(ctx, &v)

func (*WebformElementQuery) Unique

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

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

Where adds a new predicate for the WebformElementQuery builder.

func (*WebformElementQuery) WithValues

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

func (*WebformElementQuery) WithWebform

func (_q *WebformElementQuery) WithWebform(opts ...func(*WebformQuery)) *WebformElementQuery

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

type WebformElementSelect

type WebformElementSelect struct {
	*WebformElementQuery
	// contains filtered or unexported fields
}

WebformElementSelect is the builder for selecting fields of WebformElement entities.

func (*WebformElementSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WebformElementSelect) Bool

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

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

func (*WebformElementSelect) BoolX

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

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

func (*WebformElementSelect) Bools

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

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

func (*WebformElementSelect) BoolsX

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

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

func (*WebformElementSelect) Float64

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

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

func (*WebformElementSelect) Float64X

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

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

func (*WebformElementSelect) Float64s

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

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

func (*WebformElementSelect) Float64sX

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

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

func (*WebformElementSelect) Int

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

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

func (*WebformElementSelect) IntX

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

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

func (*WebformElementSelect) Ints

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

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

func (*WebformElementSelect) IntsX

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

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

func (*WebformElementSelect) Scan

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

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

func (*WebformElementSelect) ScanX

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

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

func (*WebformElementSelect) String

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

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

func (*WebformElementSelect) StringX

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

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

func (*WebformElementSelect) Strings

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

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

func (*WebformElementSelect) StringsX

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

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

type WebformElementUpdate

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

WebformElementUpdate is the builder for updating WebformElement entities.

func (*WebformElementUpdate) AddValueIDs

func (_u *WebformElementUpdate) AddValueIDs(ids ...int) *WebformElementUpdate

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformElementUpdate) AddValues

AddValues adds the "values" edges to the WebformSubmissionValue entity.

func (*WebformElementUpdate) AddWeight

func (_u *WebformElementUpdate) AddWeight(v int) *WebformElementUpdate

AddWeight adds value to the "weight" field.

func (*WebformElementUpdate) ClearDescription

func (_u *WebformElementUpdate) ClearDescription() *WebformElementUpdate

ClearDescription clears the value of the "description" field.

func (*WebformElementUpdate) ClearOptions

func (_u *WebformElementUpdate) ClearOptions() *WebformElementUpdate

ClearOptions clears the value of the "options" field.

func (*WebformElementUpdate) ClearValues

func (_u *WebformElementUpdate) ClearValues() *WebformElementUpdate

ClearValues clears all "values" edges to the WebformSubmissionValue entity.

func (*WebformElementUpdate) ClearWebform

func (_u *WebformElementUpdate) ClearWebform() *WebformElementUpdate

ClearWebform clears the "webform" edge to the Webform entity.

func (*WebformElementUpdate) Exec

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

Exec executes the query.

func (*WebformElementUpdate) ExecX

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

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

func (*WebformElementUpdate) Mutation

Mutation returns the WebformElementMutation object of the builder.

func (*WebformElementUpdate) RemoveValueIDs

func (_u *WebformElementUpdate) RemoveValueIDs(ids ...int) *WebformElementUpdate

RemoveValueIDs removes the "values" edge to WebformSubmissionValue entities by IDs.

func (*WebformElementUpdate) RemoveValues

RemoveValues removes "values" edges to WebformSubmissionValue entities.

func (*WebformElementUpdate) Save

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

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

func (*WebformElementUpdate) SaveX

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

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

func (*WebformElementUpdate) SetDescription

func (_u *WebformElementUpdate) SetDescription(v string) *WebformElementUpdate

SetDescription sets the "description" field.

func (*WebformElementUpdate) SetLabel

SetLabel sets the "label" field.

func (*WebformElementUpdate) SetMachineName

func (_u *WebformElementUpdate) SetMachineName(v string) *WebformElementUpdate

SetMachineName sets the "machine_name" field.

func (*WebformElementUpdate) SetNillableDescription

func (_u *WebformElementUpdate) SetNillableDescription(v *string) *WebformElementUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableLabel

func (_u *WebformElementUpdate) SetNillableLabel(v *string) *WebformElementUpdate

SetNillableLabel sets the "label" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableMachineName

func (_u *WebformElementUpdate) SetNillableMachineName(v *string) *WebformElementUpdate

SetNillableMachineName sets the "machine_name" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableOptions

func (_u *WebformElementUpdate) SetNillableOptions(v *string) *WebformElementUpdate

SetNillableOptions sets the "options" field if the given value is not nil.

func (*WebformElementUpdate) SetNillablePrefillParam

func (_u *WebformElementUpdate) SetNillablePrefillParam(v *string) *WebformElementUpdate

SetNillablePrefillParam sets the "prefill_param" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableRequired

func (_u *WebformElementUpdate) SetNillableRequired(v *bool) *WebformElementUpdate

SetNillableRequired sets the "required" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableType

func (_u *WebformElementUpdate) SetNillableType(v *string) *WebformElementUpdate

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

func (*WebformElementUpdate) SetNillableVisibleIfElement

func (_u *WebformElementUpdate) SetNillableVisibleIfElement(v *string) *WebformElementUpdate

SetNillableVisibleIfElement sets the "visible_if_element" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableVisibleIfValue

func (_u *WebformElementUpdate) SetNillableVisibleIfValue(v *string) *WebformElementUpdate

SetNillableVisibleIfValue sets the "visible_if_value" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableWebformID

func (_u *WebformElementUpdate) SetNillableWebformID(v *int) *WebformElementUpdate

SetNillableWebformID sets the "webform_id" field if the given value is not nil.

func (*WebformElementUpdate) SetNillableWeight

func (_u *WebformElementUpdate) SetNillableWeight(v *int) *WebformElementUpdate

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WebformElementUpdate) SetOptions

SetOptions sets the "options" field.

func (*WebformElementUpdate) SetPrefillParam

func (_u *WebformElementUpdate) SetPrefillParam(v string) *WebformElementUpdate

SetPrefillParam sets the "prefill_param" field.

func (*WebformElementUpdate) SetRequired

func (_u *WebformElementUpdate) SetRequired(v bool) *WebformElementUpdate

SetRequired sets the "required" field.

func (*WebformElementUpdate) SetType

SetType sets the "type" field.

func (*WebformElementUpdate) SetVisibleIfElement

func (_u *WebformElementUpdate) SetVisibleIfElement(v string) *WebformElementUpdate

SetVisibleIfElement sets the "visible_if_element" field.

func (*WebformElementUpdate) SetVisibleIfValue

func (_u *WebformElementUpdate) SetVisibleIfValue(v string) *WebformElementUpdate

SetVisibleIfValue sets the "visible_if_value" field.

func (*WebformElementUpdate) SetWebform

SetWebform sets the "webform" edge to the Webform entity.

func (*WebformElementUpdate) SetWebformID

func (_u *WebformElementUpdate) SetWebformID(v int) *WebformElementUpdate

SetWebformID sets the "webform_id" field.

func (*WebformElementUpdate) SetWeight

func (_u *WebformElementUpdate) SetWeight(v int) *WebformElementUpdate

SetWeight sets the "weight" field.

func (*WebformElementUpdate) Where

Where appends a list predicates to the WebformElementUpdate builder.

type WebformElementUpdateOne

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

WebformElementUpdateOne is the builder for updating a single WebformElement entity.

func (*WebformElementUpdateOne) AddValueIDs

func (_u *WebformElementUpdateOne) AddValueIDs(ids ...int) *WebformElementUpdateOne

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformElementUpdateOne) AddValues

AddValues adds the "values" edges to the WebformSubmissionValue entity.

func (*WebformElementUpdateOne) AddWeight

AddWeight adds value to the "weight" field.

func (*WebformElementUpdateOne) ClearDescription

func (_u *WebformElementUpdateOne) ClearDescription() *WebformElementUpdateOne

ClearDescription clears the value of the "description" field.

func (*WebformElementUpdateOne) ClearOptions

ClearOptions clears the value of the "options" field.

func (*WebformElementUpdateOne) ClearValues

ClearValues clears all "values" edges to the WebformSubmissionValue entity.

func (*WebformElementUpdateOne) ClearWebform

ClearWebform clears the "webform" edge to the Webform entity.

func (*WebformElementUpdateOne) Exec

Exec executes the query on the entity.

func (*WebformElementUpdateOne) ExecX

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

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

func (*WebformElementUpdateOne) Mutation

Mutation returns the WebformElementMutation object of the builder.

func (*WebformElementUpdateOne) RemoveValueIDs

func (_u *WebformElementUpdateOne) RemoveValueIDs(ids ...int) *WebformElementUpdateOne

RemoveValueIDs removes the "values" edge to WebformSubmissionValue entities by IDs.

func (*WebformElementUpdateOne) RemoveValues

RemoveValues removes "values" edges to WebformSubmissionValue entities.

func (*WebformElementUpdateOne) Save

Save executes the query and returns the updated WebformElement entity.

func (*WebformElementUpdateOne) SaveX

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

func (*WebformElementUpdateOne) Select

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

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

func (*WebformElementUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*WebformElementUpdateOne) SetLabel

SetLabel sets the "label" field.

func (*WebformElementUpdateOne) SetMachineName

SetMachineName sets the "machine_name" field.

func (*WebformElementUpdateOne) SetNillableDescription

func (_u *WebformElementUpdateOne) SetNillableDescription(v *string) *WebformElementUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableLabel

func (_u *WebformElementUpdateOne) SetNillableLabel(v *string) *WebformElementUpdateOne

SetNillableLabel sets the "label" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableMachineName

func (_u *WebformElementUpdateOne) SetNillableMachineName(v *string) *WebformElementUpdateOne

SetNillableMachineName sets the "machine_name" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableOptions

func (_u *WebformElementUpdateOne) SetNillableOptions(v *string) *WebformElementUpdateOne

SetNillableOptions sets the "options" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillablePrefillParam

func (_u *WebformElementUpdateOne) SetNillablePrefillParam(v *string) *WebformElementUpdateOne

SetNillablePrefillParam sets the "prefill_param" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableRequired

func (_u *WebformElementUpdateOne) SetNillableRequired(v *bool) *WebformElementUpdateOne

SetNillableRequired sets the "required" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableType

func (_u *WebformElementUpdateOne) SetNillableType(v *string) *WebformElementUpdateOne

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

func (*WebformElementUpdateOne) SetNillableVisibleIfElement

func (_u *WebformElementUpdateOne) SetNillableVisibleIfElement(v *string) *WebformElementUpdateOne

SetNillableVisibleIfElement sets the "visible_if_element" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableVisibleIfValue

func (_u *WebformElementUpdateOne) SetNillableVisibleIfValue(v *string) *WebformElementUpdateOne

SetNillableVisibleIfValue sets the "visible_if_value" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableWebformID

func (_u *WebformElementUpdateOne) SetNillableWebformID(v *int) *WebformElementUpdateOne

SetNillableWebformID sets the "webform_id" field if the given value is not nil.

func (*WebformElementUpdateOne) SetNillableWeight

func (_u *WebformElementUpdateOne) SetNillableWeight(v *int) *WebformElementUpdateOne

SetNillableWeight sets the "weight" field if the given value is not nil.

func (*WebformElementUpdateOne) SetOptions

SetOptions sets the "options" field.

func (*WebformElementUpdateOne) SetPrefillParam

func (_u *WebformElementUpdateOne) SetPrefillParam(v string) *WebformElementUpdateOne

SetPrefillParam sets the "prefill_param" field.

func (*WebformElementUpdateOne) SetRequired

SetRequired sets the "required" field.

func (*WebformElementUpdateOne) SetType

SetType sets the "type" field.

func (*WebformElementUpdateOne) SetVisibleIfElement

func (_u *WebformElementUpdateOne) SetVisibleIfElement(v string) *WebformElementUpdateOne

SetVisibleIfElement sets the "visible_if_element" field.

func (*WebformElementUpdateOne) SetVisibleIfValue

func (_u *WebformElementUpdateOne) SetVisibleIfValue(v string) *WebformElementUpdateOne

SetVisibleIfValue sets the "visible_if_value" field.

func (*WebformElementUpdateOne) SetWebform

SetWebform sets the "webform" edge to the Webform entity.

func (*WebformElementUpdateOne) SetWebformID

SetWebformID sets the "webform_id" field.

func (*WebformElementUpdateOne) SetWeight

SetWeight sets the "weight" field.

func (*WebformElementUpdateOne) Where

Where appends a list predicates to the WebformElementUpdate builder.

type WebformElements

type WebformElements []*WebformElement

WebformElements is a parsable slice of WebformElement.

type WebformGroupBy

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

WebformGroupBy is the group-by builder for Webform entities.

func (*WebformGroupBy) Aggregate

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

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

func (*WebformGroupBy) Bool

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

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

func (*WebformGroupBy) BoolX

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

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

func (*WebformGroupBy) Bools

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

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

func (*WebformGroupBy) BoolsX

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

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

func (*WebformGroupBy) Float64

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

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

func (*WebformGroupBy) Float64X

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

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

func (*WebformGroupBy) Float64s

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

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

func (*WebformGroupBy) Float64sX

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

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

func (*WebformGroupBy) Int

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

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

func (*WebformGroupBy) IntX

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

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

func (*WebformGroupBy) Ints

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

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

func (*WebformGroupBy) IntsX

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

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

func (*WebformGroupBy) Scan

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

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

func (*WebformGroupBy) ScanX

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

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

func (*WebformGroupBy) String

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

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

func (*WebformGroupBy) StringX

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

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

func (*WebformGroupBy) Strings

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

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

func (*WebformGroupBy) StringsX

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

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

type WebformMutation

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

WebformMutation represents an operation that mutates the Webform nodes in the graph.

func (*WebformMutation) AddElementIDs

func (m *WebformMutation) AddElementIDs(ids ...int)

AddElementIDs adds the "elements" edge to the WebformElement entity by ids.

func (*WebformMutation) AddField

func (m *WebformMutation) 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 (*WebformMutation) AddMaxSubmissions

func (m *WebformMutation) AddMaxSubmissions(i int)

AddMaxSubmissions adds i to the "max_submissions" field.

func (*WebformMutation) AddSubmissionIDs

func (m *WebformMutation) AddSubmissionIDs(ids ...int)

AddSubmissionIDs adds the "submissions" edge to the WebformSubmission entity by ids.

func (*WebformMutation) AddedEdges

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

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

func (*WebformMutation) AddedField

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

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

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

func (*WebformMutation) AddedIDs

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

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

func (*WebformMutation) AddedMaxSubmissions

func (m *WebformMutation) AddedMaxSubmissions() (r int, exists bool)

AddedMaxSubmissions returns the value that was added to the "max_submissions" field in this mutation.

func (*WebformMutation) ClearClosesAt

func (m *WebformMutation) ClearClosesAt()

ClearClosesAt clears the value of the "closes_at" field.

func (*WebformMutation) ClearConfirmation

func (m *WebformMutation) ClearConfirmation()

ClearConfirmation clears the value of the "confirmation" field.

func (*WebformMutation) ClearDescription

func (m *WebformMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*WebformMutation) ClearEdge

func (m *WebformMutation) 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 (*WebformMutation) ClearElements

func (m *WebformMutation) ClearElements()

ClearElements clears the "elements" edge to the WebformElement entity.

func (*WebformMutation) ClearField

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

func (m *WebformMutation) ClearNode()

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

func (*WebformMutation) ClearSubmissions

func (m *WebformMutation) ClearSubmissions()

ClearSubmissions clears the "submissions" edge to the WebformSubmission entity.

func (*WebformMutation) ClearedEdges

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

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

func (*WebformMutation) ClearedFields

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

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

func (WebformMutation) Client

func (m WebformMutation) 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 (*WebformMutation) Closed

func (m *WebformMutation) Closed() (r bool, exists bool)

Closed returns the value of the "closed" field in the mutation.

func (*WebformMutation) ClosesAt

func (m *WebformMutation) ClosesAt() (r time.Time, exists bool)

ClosesAt returns the value of the "closes_at" field in the mutation.

func (*WebformMutation) ClosesAtCleared

func (m *WebformMutation) ClosesAtCleared() bool

ClosesAtCleared returns if the "closes_at" field was cleared in this mutation.

func (*WebformMutation) Confirmation

func (m *WebformMutation) Confirmation() (r string, exists bool)

Confirmation returns the value of the "confirmation" field in the mutation.

func (*WebformMutation) ConfirmationCleared

func (m *WebformMutation) ConfirmationCleared() bool

ConfirmationCleared returns if the "confirmation" field was cleared in this mutation.

func (*WebformMutation) ConfirmationURL

func (m *WebformMutation) ConfirmationURL() (r string, exists bool)

ConfirmationURL returns the value of the "confirmation_url" field in the mutation.

func (*WebformMutation) Description

func (m *WebformMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*WebformMutation) DescriptionCleared

func (m *WebformMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*WebformMutation) EdgeCleared

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

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

func (*WebformMutation) ElementsCleared

func (m *WebformMutation) ElementsCleared() bool

ElementsCleared reports if the "elements" edge to the WebformElement entity was cleared.

func (*WebformMutation) ElementsIDs

func (m *WebformMutation) ElementsIDs() (ids []int)

ElementsIDs returns the "elements" edge IDs in the mutation.

func (*WebformMutation) Field

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

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

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

func (*WebformMutation) Fields

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

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

func (m *WebformMutation) 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 (*WebformMutation) LimitPerUser

func (m *WebformMutation) LimitPerUser() (r bool, exists bool)

LimitPerUser returns the value of the "limit_per_user" field in the mutation.

func (*WebformMutation) MaxSubmissions

func (m *WebformMutation) MaxSubmissions() (r int, exists bool)

MaxSubmissions returns the value of the "max_submissions" field in the mutation.

func (*WebformMutation) Nid

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

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

func (*WebformMutation) NodeCleared

func (m *WebformMutation) NodeCleared() bool

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

func (*WebformMutation) NodeID

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

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

func (*WebformMutation) NodeIDs

func (m *WebformMutation) 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 (*WebformMutation) NotifyEmail

func (m *WebformMutation) NotifyEmail() (r string, exists bool)

NotifyEmail returns the value of the "notify_email" field in the mutation.

func (*WebformMutation) OldClosed

func (m *WebformMutation) OldClosed(ctx context.Context) (v bool, err error)

OldClosed returns the old "closed" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldClosesAt

func (m *WebformMutation) OldClosesAt(ctx context.Context) (v *time.Time, err error)

OldClosesAt returns the old "closes_at" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldConfirmation

func (m *WebformMutation) OldConfirmation(ctx context.Context) (v string, err error)

OldConfirmation returns the old "confirmation" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldConfirmationURL

func (m *WebformMutation) OldConfirmationURL(ctx context.Context) (v string, err error)

OldConfirmationURL returns the old "confirmation_url" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldDescription

func (m *WebformMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldField

func (m *WebformMutation) 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 (*WebformMutation) OldLimitPerUser

func (m *WebformMutation) OldLimitPerUser(ctx context.Context) (v bool, err error)

OldLimitPerUser returns the old "limit_per_user" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldMaxSubmissions

func (m *WebformMutation) OldMaxSubmissions(ctx context.Context) (v int, err error)

OldMaxSubmissions returns the old "max_submissions" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldNid

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

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

func (m *WebformMutation) OldNotifyEmail(ctx context.Context) (v string, err error)

OldNotifyEmail returns the old "notify_email" field's value of the Webform entity. If the Webform 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 (*WebformMutation) OldSubmitLabel

func (m *WebformMutation) OldSubmitLabel(ctx context.Context) (v string, err error)

OldSubmitLabel returns the old "submit_label" field's value of the Webform entity. If the Webform 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 (*WebformMutation) Op

func (m *WebformMutation) Op() Op

Op returns the operation name.

func (*WebformMutation) RemoveElementIDs

func (m *WebformMutation) RemoveElementIDs(ids ...int)

RemoveElementIDs removes the "elements" edge to the WebformElement entity by IDs.

func (*WebformMutation) RemoveSubmissionIDs

func (m *WebformMutation) RemoveSubmissionIDs(ids ...int)

RemoveSubmissionIDs removes the "submissions" edge to the WebformSubmission entity by IDs.

func (*WebformMutation) RemovedEdges

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

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

func (*WebformMutation) RemovedElementsIDs

func (m *WebformMutation) RemovedElementsIDs() (ids []int)

RemovedElements returns the removed IDs of the "elements" edge to the WebformElement entity.

func (*WebformMutation) RemovedIDs

func (m *WebformMutation) 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 (*WebformMutation) RemovedSubmissionsIDs

func (m *WebformMutation) RemovedSubmissionsIDs() (ids []int)

RemovedSubmissions returns the removed IDs of the "submissions" edge to the WebformSubmission entity.

func (*WebformMutation) ResetClosed

func (m *WebformMutation) ResetClosed()

ResetClosed resets all changes to the "closed" field.

func (*WebformMutation) ResetClosesAt

func (m *WebformMutation) ResetClosesAt()

ResetClosesAt resets all changes to the "closes_at" field.

func (*WebformMutation) ResetConfirmation

func (m *WebformMutation) ResetConfirmation()

ResetConfirmation resets all changes to the "confirmation" field.

func (*WebformMutation) ResetConfirmationURL

func (m *WebformMutation) ResetConfirmationURL()

ResetConfirmationURL resets all changes to the "confirmation_url" field.

func (*WebformMutation) ResetDescription

func (m *WebformMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*WebformMutation) ResetEdge

func (m *WebformMutation) 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 (*WebformMutation) ResetElements

func (m *WebformMutation) ResetElements()

ResetElements resets all changes to the "elements" edge.

func (*WebformMutation) ResetField

func (m *WebformMutation) 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 (*WebformMutation) ResetLimitPerUser

func (m *WebformMutation) ResetLimitPerUser()

ResetLimitPerUser resets all changes to the "limit_per_user" field.

func (*WebformMutation) ResetMaxSubmissions

func (m *WebformMutation) ResetMaxSubmissions()

ResetMaxSubmissions resets all changes to the "max_submissions" field.

func (*WebformMutation) ResetNid

func (m *WebformMutation) ResetNid()

ResetNid resets all changes to the "nid" field.

func (*WebformMutation) ResetNode

func (m *WebformMutation) ResetNode()

ResetNode resets all changes to the "node" edge.

func (*WebformMutation) ResetNotifyEmail

func (m *WebformMutation) ResetNotifyEmail()

ResetNotifyEmail resets all changes to the "notify_email" field.

func (*WebformMutation) ResetSubmissions

func (m *WebformMutation) ResetSubmissions()

ResetSubmissions resets all changes to the "submissions" edge.

func (*WebformMutation) ResetSubmitLabel

func (m *WebformMutation) ResetSubmitLabel()

ResetSubmitLabel resets all changes to the "submit_label" field.

func (*WebformMutation) SetClosed

func (m *WebformMutation) SetClosed(b bool)

SetClosed sets the "closed" field.

func (*WebformMutation) SetClosesAt

func (m *WebformMutation) SetClosesAt(t time.Time)

SetClosesAt sets the "closes_at" field.

func (*WebformMutation) SetConfirmation

func (m *WebformMutation) SetConfirmation(s string)

SetConfirmation sets the "confirmation" field.

func (*WebformMutation) SetConfirmationURL

func (m *WebformMutation) SetConfirmationURL(s string)

SetConfirmationURL sets the "confirmation_url" field.

func (*WebformMutation) SetDescription

func (m *WebformMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*WebformMutation) SetField

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

func (m *WebformMutation) SetID(id int)

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

func (*WebformMutation) SetLimitPerUser

func (m *WebformMutation) SetLimitPerUser(b bool)

SetLimitPerUser sets the "limit_per_user" field.

func (*WebformMutation) SetMaxSubmissions

func (m *WebformMutation) SetMaxSubmissions(i int)

SetMaxSubmissions sets the "max_submissions" field.

func (*WebformMutation) SetNid

func (m *WebformMutation) SetNid(i int)

SetNid sets the "nid" field.

func (*WebformMutation) SetNodeID

func (m *WebformMutation) SetNodeID(id int)

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

func (*WebformMutation) SetNotifyEmail

func (m *WebformMutation) SetNotifyEmail(s string)

SetNotifyEmail sets the "notify_email" field.

func (*WebformMutation) SetOp

func (m *WebformMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WebformMutation) SetSubmitLabel

func (m *WebformMutation) SetSubmitLabel(s string)

SetSubmitLabel sets the "submit_label" field.

func (*WebformMutation) SubmissionsCleared

func (m *WebformMutation) SubmissionsCleared() bool

SubmissionsCleared reports if the "submissions" edge to the WebformSubmission entity was cleared.

func (*WebformMutation) SubmissionsIDs

func (m *WebformMutation) SubmissionsIDs() (ids []int)

SubmissionsIDs returns the "submissions" edge IDs in the mutation.

func (*WebformMutation) SubmitLabel

func (m *WebformMutation) SubmitLabel() (r string, exists bool)

SubmitLabel returns the value of the "submit_label" field in the mutation.

func (WebformMutation) Tx

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

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

func (*WebformMutation) Type

func (m *WebformMutation) Type() string

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

func (*WebformMutation) Where

func (m *WebformMutation) Where(ps ...predicate.Webform)

Where appends a list predicates to the WebformMutation builder.

func (*WebformMutation) WhereP

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

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

type WebformQuery

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

WebformQuery is the builder for querying Webform entities.

func (*WebformQuery) Aggregate

func (_q *WebformQuery) Aggregate(fns ...AggregateFunc) *WebformSelect

Aggregate returns a WebformSelect configured with the given aggregations.

func (*WebformQuery) All

func (_q *WebformQuery) All(ctx context.Context) ([]*Webform, error)

All executes the query and returns a list of Webforms.

func (*WebformQuery) AllX

func (_q *WebformQuery) AllX(ctx context.Context) []*Webform

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

func (*WebformQuery) Clone

func (_q *WebformQuery) Clone() *WebformQuery

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

func (*WebformQuery) Count

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

Count returns the count of the given query.

func (*WebformQuery) CountX

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

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

func (*WebformQuery) Exist

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

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

func (*WebformQuery) ExistX

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

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

func (*WebformQuery) First

func (_q *WebformQuery) First(ctx context.Context) (*Webform, error)

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

func (*WebformQuery) FirstID

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

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

func (*WebformQuery) FirstIDX

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

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

func (*WebformQuery) FirstX

func (_q *WebformQuery) FirstX(ctx context.Context) *Webform

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

func (*WebformQuery) GroupBy

func (_q *WebformQuery) GroupBy(field string, fields ...string) *WebformGroupBy

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.Webform.Query().
	GroupBy(webform.FieldNid).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WebformQuery) IDs

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

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

func (*WebformQuery) IDsX

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

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

func (*WebformQuery) Limit

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

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

func (*WebformQuery) Offset

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

Offset to start from.

func (*WebformQuery) Only

func (_q *WebformQuery) Only(ctx context.Context) (*Webform, error)

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

func (*WebformQuery) OnlyID

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

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

func (*WebformQuery) OnlyIDX

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

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

func (*WebformQuery) OnlyX

func (_q *WebformQuery) OnlyX(ctx context.Context) *Webform

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

func (*WebformQuery) Order

func (_q *WebformQuery) Order(o ...webform.OrderOption) *WebformQuery

Order specifies how the records should be ordered.

func (*WebformQuery) QueryElements

func (_q *WebformQuery) QueryElements() *WebformElementQuery

QueryElements chains the current query on the "elements" edge.

func (*WebformQuery) QueryNode

func (_q *WebformQuery) QueryNode() *NodeQuery

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

func (*WebformQuery) QuerySubmissions

func (_q *WebformQuery) QuerySubmissions() *WebformSubmissionQuery

QuerySubmissions chains the current query on the "submissions" edge.

func (*WebformQuery) Select

func (_q *WebformQuery) Select(fields ...string) *WebformSelect

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.Webform.Query().
	Select(webform.FieldNid).
	Scan(ctx, &v)

func (*WebformQuery) Unique

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

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

func (_q *WebformQuery) Where(ps ...predicate.Webform) *WebformQuery

Where adds a new predicate for the WebformQuery builder.

func (*WebformQuery) WithElements

func (_q *WebformQuery) WithElements(opts ...func(*WebformElementQuery)) *WebformQuery

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

func (*WebformQuery) WithNode

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

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.

func (*WebformQuery) WithSubmissions

func (_q *WebformQuery) WithSubmissions(opts ...func(*WebformSubmissionQuery)) *WebformQuery

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

type WebformSelect

type WebformSelect struct {
	*WebformQuery
	// contains filtered or unexported fields
}

WebformSelect is the builder for selecting fields of Webform entities.

func (*WebformSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*WebformSelect) Bool

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

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

func (*WebformSelect) BoolX

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

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

func (*WebformSelect) Bools

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

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

func (*WebformSelect) BoolsX

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

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

func (*WebformSelect) Float64

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

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

func (*WebformSelect) Float64X

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

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

func (*WebformSelect) Float64s

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

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

func (*WebformSelect) Float64sX

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

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

func (*WebformSelect) Int

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

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

func (*WebformSelect) IntX

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

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

func (*WebformSelect) Ints

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

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

func (*WebformSelect) IntsX

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

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

func (*WebformSelect) Scan

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

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

func (*WebformSelect) ScanX

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

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

func (*WebformSelect) String

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

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

func (*WebformSelect) StringX

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

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

func (*WebformSelect) Strings

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

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

func (*WebformSelect) StringsX

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

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

type WebformSubmission

type WebformSubmission struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// WebformID holds the value of the "webform_id" field.
	WebformID int `json:"webform_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID *int `json:"user_id,omitempty"`
	// RemoteIP holds the value of the "remote_ip" field.
	RemoteIP string `json:"remote_ip,omitempty"`
	// SourceURL holds the value of the "source_url" field.
	SourceURL string `json:"source_url,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 WebformSubmissionQuery when eager-loading is set.
	Edges WebformSubmissionEdges `json:"edges"`
	// contains filtered or unexported fields
}

WebformSubmission is the model entity for the WebformSubmission schema.

func (*WebformSubmission) QueryUser

func (_m *WebformSubmission) QueryUser() *UserQuery

QueryUser queries the "user" edge of the WebformSubmission entity.

func (*WebformSubmission) QueryValues

QueryValues queries the "values" edge of the WebformSubmission entity.

func (*WebformSubmission) QueryWebform

func (_m *WebformSubmission) QueryWebform() *WebformQuery

QueryWebform queries the "webform" edge of the WebformSubmission entity.

func (*WebformSubmission) String

func (_m *WebformSubmission) String() string

String implements the fmt.Stringer.

func (*WebformSubmission) Unwrap

func (_m *WebformSubmission) Unwrap() *WebformSubmission

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

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

func (*WebformSubmission) Value

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

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

type WebformSubmissionClient

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

WebformSubmissionClient is a client for the WebformSubmission schema.

func NewWebformSubmissionClient

func NewWebformSubmissionClient(c config) *WebformSubmissionClient

NewWebformSubmissionClient returns a client for the WebformSubmission from the given config.

func (*WebformSubmissionClient) Create

Create returns a builder for creating a WebformSubmission entity.

func (*WebformSubmissionClient) CreateBulk

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

func (*WebformSubmissionClient) Delete

Delete returns a delete builder for WebformSubmission.

func (*WebformSubmissionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WebformSubmissionClient) DeleteOneID

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

func (*WebformSubmissionClient) Get

Get returns a WebformSubmission entity by its id.

func (*WebformSubmissionClient) GetX

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

func (*WebformSubmissionClient) Hooks

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

Hooks returns the client hooks.

func (*WebformSubmissionClient) Intercept

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

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

func (*WebformSubmissionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WebformSubmissionClient) MapCreateBulk

func (c *WebformSubmissionClient) MapCreateBulk(slice any, setFunc func(*WebformSubmissionCreate, int)) *WebformSubmissionCreateBulk

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

Query returns a query builder for WebformSubmission.

func (*WebformSubmissionClient) QueryUser

QueryUser queries the user edge of a WebformSubmission.

func (*WebformSubmissionClient) QueryValues

QueryValues queries the values edge of a WebformSubmission.

func (*WebformSubmissionClient) QueryWebform

QueryWebform queries the webform edge of a WebformSubmission.

func (*WebformSubmissionClient) Update

Update returns an update builder for WebformSubmission.

func (*WebformSubmissionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WebformSubmissionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WebformSubmissionClient) Use

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

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

type WebformSubmissionCreate

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

WebformSubmissionCreate is the builder for creating a WebformSubmission entity.

func (*WebformSubmissionCreate) AddValueIDs

func (_c *WebformSubmissionCreate) AddValueIDs(ids ...int) *WebformSubmissionCreate

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformSubmissionCreate) AddValues

AddValues adds the "values" edges to the WebformSubmissionValue entity.

func (*WebformSubmissionCreate) Exec

Exec executes the query.

func (*WebformSubmissionCreate) ExecX

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

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

func (*WebformSubmissionCreate) Mutation

Mutation returns the WebformSubmissionMutation object of the builder.

func (*WebformSubmissionCreate) Save

Save creates the WebformSubmission in the database.

func (*WebformSubmissionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WebformSubmissionCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*WebformSubmissionCreate) SetID

SetID sets the "id" field.

func (*WebformSubmissionCreate) SetNillableCreatedAt

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

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

func (*WebformSubmissionCreate) SetNillableRemoteIP

func (_c *WebformSubmissionCreate) SetNillableRemoteIP(v *string) *WebformSubmissionCreate

SetNillableRemoteIP sets the "remote_ip" field if the given value is not nil.

func (*WebformSubmissionCreate) SetNillableSourceURL

func (_c *WebformSubmissionCreate) SetNillableSourceURL(v *string) *WebformSubmissionCreate

SetNillableSourceURL sets the "source_url" field if the given value is not nil.

func (*WebformSubmissionCreate) SetNillableUserID

func (_c *WebformSubmissionCreate) SetNillableUserID(v *int) *WebformSubmissionCreate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*WebformSubmissionCreate) SetRemoteIP

SetRemoteIP sets the "remote_ip" field.

func (*WebformSubmissionCreate) SetSourceURL

SetSourceURL sets the "source_url" field.

func (*WebformSubmissionCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*WebformSubmissionCreate) SetUserID

SetUserID sets the "user_id" field.

func (*WebformSubmissionCreate) SetWebform

SetWebform sets the "webform" edge to the Webform entity.

func (*WebformSubmissionCreate) SetWebformID

SetWebformID sets the "webform_id" field.

type WebformSubmissionCreateBulk

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

WebformSubmissionCreateBulk is the builder for creating many WebformSubmission entities in bulk.

func (*WebformSubmissionCreateBulk) Exec

Exec executes the query.

func (*WebformSubmissionCreateBulk) ExecX

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

func (*WebformSubmissionCreateBulk) Save

Save creates the WebformSubmission entities in the database.

func (*WebformSubmissionCreateBulk) SaveX

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

type WebformSubmissionDelete

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

WebformSubmissionDelete is the builder for deleting a WebformSubmission entity.

func (*WebformSubmissionDelete) Exec

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

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

func (*WebformSubmissionDelete) ExecX

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

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

func (*WebformSubmissionDelete) Where

Where appends a list predicates to the WebformSubmissionDelete builder.

type WebformSubmissionDeleteOne

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

WebformSubmissionDeleteOne is the builder for deleting a single WebformSubmission entity.

func (*WebformSubmissionDeleteOne) Exec

Exec executes the deletion query.

func (*WebformSubmissionDeleteOne) ExecX

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

func (*WebformSubmissionDeleteOne) Where

Where appends a list predicates to the WebformSubmissionDelete builder.

type WebformSubmissionEdges

type WebformSubmissionEdges struct {
	// Webform holds the value of the webform edge.
	Webform *Webform `json:"webform,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Values holds the value of the values edge.
	Values []*WebformSubmissionValue `json:"values,omitempty"`
	// contains filtered or unexported fields
}

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

func (WebformSubmissionEdges) UserOrErr

func (e WebformSubmissionEdges) 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.

func (WebformSubmissionEdges) ValuesOrErr

func (e WebformSubmissionEdges) ValuesOrErr() ([]*WebformSubmissionValue, error)

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

func (WebformSubmissionEdges) WebformOrErr

func (e WebformSubmissionEdges) WebformOrErr() (*Webform, error)

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

type WebformSubmissionGroupBy

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

WebformSubmissionGroupBy is the group-by builder for WebformSubmission entities.

func (*WebformSubmissionGroupBy) Aggregate

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

func (*WebformSubmissionGroupBy) Bool

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

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

func (*WebformSubmissionGroupBy) BoolX

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

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

func (*WebformSubmissionGroupBy) Bools

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

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

func (*WebformSubmissionGroupBy) BoolsX

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

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

func (*WebformSubmissionGroupBy) Float64

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

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

func (*WebformSubmissionGroupBy) Float64X

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

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

func (*WebformSubmissionGroupBy) Float64s

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

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

func (*WebformSubmissionGroupBy) Float64sX

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

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

func (*WebformSubmissionGroupBy) Int

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

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

func (*WebformSubmissionGroupBy) IntX

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

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

func (*WebformSubmissionGroupBy) Ints

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

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

func (*WebformSubmissionGroupBy) IntsX

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

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

func (*WebformSubmissionGroupBy) Scan

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

func (*WebformSubmissionGroupBy) ScanX

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

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

func (*WebformSubmissionGroupBy) String

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

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

func (*WebformSubmissionGroupBy) StringX

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

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

func (*WebformSubmissionGroupBy) Strings

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

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

func (*WebformSubmissionGroupBy) StringsX

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

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

type WebformSubmissionMutation

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

WebformSubmissionMutation represents an operation that mutates the WebformSubmission nodes in the graph.

func (*WebformSubmissionMutation) AddField

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) AddValueIDs

func (m *WebformSubmissionMutation) AddValueIDs(ids ...int)

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by ids.

func (*WebformSubmissionMutation) AddedEdges

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

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

func (*WebformSubmissionMutation) AddedField

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

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

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

func (*WebformSubmissionMutation) AddedIDs

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

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

func (*WebformSubmissionMutation) ClearEdge

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

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) ClearUser

func (m *WebformSubmissionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*WebformSubmissionMutation) ClearUserID

func (m *WebformSubmissionMutation) ClearUserID()

ClearUserID clears the value of the "user_id" field.

func (*WebformSubmissionMutation) ClearValues

func (m *WebformSubmissionMutation) ClearValues()

ClearValues clears the "values" edge to the WebformSubmissionValue entity.

func (*WebformSubmissionMutation) ClearWebform

func (m *WebformSubmissionMutation) ClearWebform()

ClearWebform clears the "webform" edge to the Webform entity.

func (*WebformSubmissionMutation) ClearedEdges

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

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

func (*WebformSubmissionMutation) ClearedFields

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

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

func (WebformSubmissionMutation) Client

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

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

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

func (*WebformSubmissionMutation) EdgeCleared

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

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

func (*WebformSubmissionMutation) Field

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

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

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

func (*WebformSubmissionMutation) Fields

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

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) 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 (*WebformSubmissionMutation) OldCreatedAt

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

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

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) OldRemoteIP

func (m *WebformSubmissionMutation) OldRemoteIP(ctx context.Context) (v string, err error)

OldRemoteIP returns the old "remote_ip" field's value of the WebformSubmission entity. If the WebformSubmission 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 (*WebformSubmissionMutation) OldSourceURL

func (m *WebformSubmissionMutation) OldSourceURL(ctx context.Context) (v string, err error)

OldSourceURL returns the old "source_url" field's value of the WebformSubmission entity. If the WebformSubmission 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 (*WebformSubmissionMutation) OldUserID

func (m *WebformSubmissionMutation) OldUserID(ctx context.Context) (v *int, err error)

OldUserID returns the old "user_id" field's value of the WebformSubmission entity. If the WebformSubmission 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 (*WebformSubmissionMutation) OldWebformID

func (m *WebformSubmissionMutation) OldWebformID(ctx context.Context) (v int, err error)

OldWebformID returns the old "webform_id" field's value of the WebformSubmission entity. If the WebformSubmission 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 (*WebformSubmissionMutation) Op

func (m *WebformSubmissionMutation) Op() Op

Op returns the operation name.

func (*WebformSubmissionMutation) RemoteIP

func (m *WebformSubmissionMutation) RemoteIP() (r string, exists bool)

RemoteIP returns the value of the "remote_ip" field in the mutation.

func (*WebformSubmissionMutation) RemoveValueIDs

func (m *WebformSubmissionMutation) RemoveValueIDs(ids ...int)

RemoveValueIDs removes the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformSubmissionMutation) RemovedEdges

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

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

func (*WebformSubmissionMutation) RemovedIDs

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) RemovedValuesIDs

func (m *WebformSubmissionMutation) RemovedValuesIDs() (ids []int)

RemovedValues returns the removed IDs of the "values" edge to the WebformSubmissionValue entity.

func (*WebformSubmissionMutation) ResetCreatedAt

func (m *WebformSubmissionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*WebformSubmissionMutation) ResetEdge

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

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) ResetRemoteIP

func (m *WebformSubmissionMutation) ResetRemoteIP()

ResetRemoteIP resets all changes to the "remote_ip" field.

func (*WebformSubmissionMutation) ResetSourceURL

func (m *WebformSubmissionMutation) ResetSourceURL()

ResetSourceURL resets all changes to the "source_url" field.

func (*WebformSubmissionMutation) ResetUser

func (m *WebformSubmissionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*WebformSubmissionMutation) ResetUserID

func (m *WebformSubmissionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*WebformSubmissionMutation) ResetValues

func (m *WebformSubmissionMutation) ResetValues()

ResetValues resets all changes to the "values" edge.

func (*WebformSubmissionMutation) ResetWebform

func (m *WebformSubmissionMutation) ResetWebform()

ResetWebform resets all changes to the "webform" edge.

func (*WebformSubmissionMutation) ResetWebformID

func (m *WebformSubmissionMutation) ResetWebformID()

ResetWebformID resets all changes to the "webform_id" field.

func (*WebformSubmissionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*WebformSubmissionMutation) SetField

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

func (m *WebformSubmissionMutation) SetID(id int)

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

func (*WebformSubmissionMutation) SetOp

func (m *WebformSubmissionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WebformSubmissionMutation) SetRemoteIP

func (m *WebformSubmissionMutation) SetRemoteIP(s string)

SetRemoteIP sets the "remote_ip" field.

func (*WebformSubmissionMutation) SetSourceURL

func (m *WebformSubmissionMutation) SetSourceURL(s string)

SetSourceURL sets the "source_url" field.

func (*WebformSubmissionMutation) SetUserID

func (m *WebformSubmissionMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*WebformSubmissionMutation) SetWebformID

func (m *WebformSubmissionMutation) SetWebformID(i int)

SetWebformID sets the "webform_id" field.

func (*WebformSubmissionMutation) SourceURL

func (m *WebformSubmissionMutation) SourceURL() (r string, exists bool)

SourceURL returns the value of the "source_url" field in the mutation.

func (WebformSubmissionMutation) Tx

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

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

func (*WebformSubmissionMutation) Type

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

func (*WebformSubmissionMutation) UserCleared

func (m *WebformSubmissionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*WebformSubmissionMutation) UserID

func (m *WebformSubmissionMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*WebformSubmissionMutation) UserIDCleared

func (m *WebformSubmissionMutation) UserIDCleared() bool

UserIDCleared returns if the "user_id" field was cleared in this mutation.

func (*WebformSubmissionMutation) UserIDs

func (m *WebformSubmissionMutation) 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 (*WebformSubmissionMutation) ValuesCleared

func (m *WebformSubmissionMutation) ValuesCleared() bool

ValuesCleared reports if the "values" edge to the WebformSubmissionValue entity was cleared.

func (*WebformSubmissionMutation) ValuesIDs

func (m *WebformSubmissionMutation) ValuesIDs() (ids []int)

ValuesIDs returns the "values" edge IDs in the mutation.

func (*WebformSubmissionMutation) WebformCleared

func (m *WebformSubmissionMutation) WebformCleared() bool

WebformCleared reports if the "webform" edge to the Webform entity was cleared.

func (*WebformSubmissionMutation) WebformID

func (m *WebformSubmissionMutation) WebformID() (r int, exists bool)

WebformID returns the value of the "webform_id" field in the mutation.

func (*WebformSubmissionMutation) WebformIDs

func (m *WebformSubmissionMutation) WebformIDs() (ids []int)

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

func (*WebformSubmissionMutation) Where

Where appends a list predicates to the WebformSubmissionMutation builder.

func (*WebformSubmissionMutation) WhereP

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

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

type WebformSubmissionQuery

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

WebformSubmissionQuery is the builder for querying WebformSubmission entities.

func (*WebformSubmissionQuery) Aggregate

Aggregate returns a WebformSubmissionSelect configured with the given aggregations.

func (*WebformSubmissionQuery) All

All executes the query and returns a list of WebformSubmissions.

func (*WebformSubmissionQuery) AllX

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

func (*WebformSubmissionQuery) Clone

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

func (*WebformSubmissionQuery) Count

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

Count returns the count of the given query.

func (*WebformSubmissionQuery) CountX

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

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

func (*WebformSubmissionQuery) Exist

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

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

func (*WebformSubmissionQuery) ExistX

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

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

func (*WebformSubmissionQuery) First

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

func (*WebformSubmissionQuery) FirstID

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

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

func (*WebformSubmissionQuery) FirstIDX

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

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

func (*WebformSubmissionQuery) FirstX

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

func (*WebformSubmissionQuery) GroupBy

func (_q *WebformSubmissionQuery) GroupBy(field string, fields ...string) *WebformSubmissionGroupBy

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

client.WebformSubmission.Query().
	GroupBy(webformsubmission.FieldWebformID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WebformSubmissionQuery) IDs

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

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

func (*WebformSubmissionQuery) IDsX

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

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

func (*WebformSubmissionQuery) Limit

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

func (*WebformSubmissionQuery) Offset

Offset to start from.

func (*WebformSubmissionQuery) Only

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

func (*WebformSubmissionQuery) OnlyID

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

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

func (*WebformSubmissionQuery) OnlyIDX

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

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

func (*WebformSubmissionQuery) OnlyX

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

func (*WebformSubmissionQuery) Order

Order specifies how the records should be ordered.

func (*WebformSubmissionQuery) QueryUser

func (_q *WebformSubmissionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*WebformSubmissionQuery) QueryValues

QueryValues chains the current query on the "values" edge.

func (*WebformSubmissionQuery) QueryWebform

func (_q *WebformSubmissionQuery) QueryWebform() *WebformQuery

QueryWebform chains the current query on the "webform" edge.

func (*WebformSubmissionQuery) Select

func (_q *WebformSubmissionQuery) Select(fields ...string) *WebformSubmissionSelect

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

client.WebformSubmission.Query().
	Select(webformsubmission.FieldWebformID).
	Scan(ctx, &v)

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

Where adds a new predicate for the WebformSubmissionQuery builder.

func (*WebformSubmissionQuery) WithUser

func (_q *WebformSubmissionQuery) WithUser(opts ...func(*UserQuery)) *WebformSubmissionQuery

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.

func (*WebformSubmissionQuery) WithValues

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

func (*WebformSubmissionQuery) WithWebform

func (_q *WebformSubmissionQuery) WithWebform(opts ...func(*WebformQuery)) *WebformSubmissionQuery

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

type WebformSubmissionSelect

type WebformSubmissionSelect struct {
	*WebformSubmissionQuery
	// contains filtered or unexported fields
}

WebformSubmissionSelect is the builder for selecting fields of WebformSubmission entities.

func (*WebformSubmissionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WebformSubmissionSelect) Bool

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

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

func (*WebformSubmissionSelect) BoolX

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

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

func (*WebformSubmissionSelect) Bools

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

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

func (*WebformSubmissionSelect) BoolsX

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

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

func (*WebformSubmissionSelect) Float64

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

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

func (*WebformSubmissionSelect) Float64X

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

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

func (*WebformSubmissionSelect) Float64s

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

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

func (*WebformSubmissionSelect) Float64sX

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

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

func (*WebformSubmissionSelect) Int

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

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

func (*WebformSubmissionSelect) IntX

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

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

func (*WebformSubmissionSelect) Ints

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

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

func (*WebformSubmissionSelect) IntsX

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

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

func (*WebformSubmissionSelect) Scan

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

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

func (*WebformSubmissionSelect) ScanX

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

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

func (*WebformSubmissionSelect) String

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

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

func (*WebformSubmissionSelect) StringX

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

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

func (*WebformSubmissionSelect) Strings

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

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

func (*WebformSubmissionSelect) StringsX

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

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

type WebformSubmissionUpdate

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

WebformSubmissionUpdate is the builder for updating WebformSubmission entities.

func (*WebformSubmissionUpdate) AddValueIDs

func (_u *WebformSubmissionUpdate) AddValueIDs(ids ...int) *WebformSubmissionUpdate

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformSubmissionUpdate) AddValues

AddValues adds the "values" edges to the WebformSubmissionValue entity.

func (*WebformSubmissionUpdate) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*WebformSubmissionUpdate) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*WebformSubmissionUpdate) ClearValues

ClearValues clears all "values" edges to the WebformSubmissionValue entity.

func (*WebformSubmissionUpdate) ClearWebform

ClearWebform clears the "webform" edge to the Webform entity.

func (*WebformSubmissionUpdate) Exec

Exec executes the query.

func (*WebformSubmissionUpdate) ExecX

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

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

func (*WebformSubmissionUpdate) Mutation

Mutation returns the WebformSubmissionMutation object of the builder.

func (*WebformSubmissionUpdate) RemoveValueIDs

func (_u *WebformSubmissionUpdate) RemoveValueIDs(ids ...int) *WebformSubmissionUpdate

RemoveValueIDs removes the "values" edge to WebformSubmissionValue entities by IDs.

func (*WebformSubmissionUpdate) RemoveValues

RemoveValues removes "values" edges to WebformSubmissionValue entities.

func (*WebformSubmissionUpdate) Save

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

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

func (*WebformSubmissionUpdate) SaveX

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

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

func (*WebformSubmissionUpdate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*WebformSubmissionUpdate) SetNillableCreatedAt

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

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

func (*WebformSubmissionUpdate) SetNillableRemoteIP

func (_u *WebformSubmissionUpdate) SetNillableRemoteIP(v *string) *WebformSubmissionUpdate

SetNillableRemoteIP sets the "remote_ip" field if the given value is not nil.

func (*WebformSubmissionUpdate) SetNillableSourceURL

func (_u *WebformSubmissionUpdate) SetNillableSourceURL(v *string) *WebformSubmissionUpdate

SetNillableSourceURL sets the "source_url" field if the given value is not nil.

func (*WebformSubmissionUpdate) SetNillableUserID

func (_u *WebformSubmissionUpdate) SetNillableUserID(v *int) *WebformSubmissionUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*WebformSubmissionUpdate) SetNillableWebformID

func (_u *WebformSubmissionUpdate) SetNillableWebformID(v *int) *WebformSubmissionUpdate

SetNillableWebformID sets the "webform_id" field if the given value is not nil.

func (*WebformSubmissionUpdate) SetRemoteIP

SetRemoteIP sets the "remote_ip" field.

func (*WebformSubmissionUpdate) SetSourceURL

SetSourceURL sets the "source_url" field.

func (*WebformSubmissionUpdate) SetUser

SetUser sets the "user" edge to the User entity.

func (*WebformSubmissionUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*WebformSubmissionUpdate) SetWebform

SetWebform sets the "webform" edge to the Webform entity.

func (*WebformSubmissionUpdate) SetWebformID

SetWebformID sets the "webform_id" field.

func (*WebformSubmissionUpdate) Where

Where appends a list predicates to the WebformSubmissionUpdate builder.

type WebformSubmissionUpdateOne

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

WebformSubmissionUpdateOne is the builder for updating a single WebformSubmission entity.

func (*WebformSubmissionUpdateOne) AddValueIDs

AddValueIDs adds the "values" edge to the WebformSubmissionValue entity by IDs.

func (*WebformSubmissionUpdateOne) AddValues

AddValues adds the "values" edges to the WebformSubmissionValue entity.

func (*WebformSubmissionUpdateOne) ClearUser

ClearUser clears the "user" edge to the User entity.

func (*WebformSubmissionUpdateOne) ClearUserID

ClearUserID clears the value of the "user_id" field.

func (*WebformSubmissionUpdateOne) ClearValues

ClearValues clears all "values" edges to the WebformSubmissionValue entity.

func (*WebformSubmissionUpdateOne) ClearWebform

ClearWebform clears the "webform" edge to the Webform entity.

func (*WebformSubmissionUpdateOne) Exec

Exec executes the query on the entity.

func (*WebformSubmissionUpdateOne) ExecX

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

func (*WebformSubmissionUpdateOne) Mutation

Mutation returns the WebformSubmissionMutation object of the builder.

func (*WebformSubmissionUpdateOne) RemoveValueIDs

func (_u *WebformSubmissionUpdateOne) RemoveValueIDs(ids ...int) *WebformSubmissionUpdateOne

RemoveValueIDs removes the "values" edge to WebformSubmissionValue entities by IDs.

func (*WebformSubmissionUpdateOne) RemoveValues

RemoveValues removes "values" edges to WebformSubmissionValue entities.

func (*WebformSubmissionUpdateOne) Save

Save executes the query and returns the updated WebformSubmission entity.

func (*WebformSubmissionUpdateOne) SaveX

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

func (*WebformSubmissionUpdateOne) 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 (*WebformSubmissionUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*WebformSubmissionUpdateOne) SetNillableCreatedAt

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

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

func (*WebformSubmissionUpdateOne) SetNillableRemoteIP

func (_u *WebformSubmissionUpdateOne) SetNillableRemoteIP(v *string) *WebformSubmissionUpdateOne

SetNillableRemoteIP sets the "remote_ip" field if the given value is not nil.

func (*WebformSubmissionUpdateOne) SetNillableSourceURL

func (_u *WebformSubmissionUpdateOne) SetNillableSourceURL(v *string) *WebformSubmissionUpdateOne

SetNillableSourceURL sets the "source_url" field if the given value is not nil.

func (*WebformSubmissionUpdateOne) SetNillableUserID

func (_u *WebformSubmissionUpdateOne) SetNillableUserID(v *int) *WebformSubmissionUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*WebformSubmissionUpdateOne) SetNillableWebformID

func (_u *WebformSubmissionUpdateOne) SetNillableWebformID(v *int) *WebformSubmissionUpdateOne

SetNillableWebformID sets the "webform_id" field if the given value is not nil.

func (*WebformSubmissionUpdateOne) SetRemoteIP

SetRemoteIP sets the "remote_ip" field.

func (*WebformSubmissionUpdateOne) SetSourceURL

SetSourceURL sets the "source_url" field.

func (*WebformSubmissionUpdateOne) SetUser

SetUser sets the "user" edge to the User entity.

func (*WebformSubmissionUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*WebformSubmissionUpdateOne) SetWebform

SetWebform sets the "webform" edge to the Webform entity.

func (*WebformSubmissionUpdateOne) SetWebformID

SetWebformID sets the "webform_id" field.

func (*WebformSubmissionUpdateOne) Where

Where appends a list predicates to the WebformSubmissionUpdate builder.

type WebformSubmissionValue

type WebformSubmissionValue struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SubmissionID holds the value of the "submission_id" field.
	SubmissionID int `json:"submission_id,omitempty"`
	// ElementID holds the value of the "element_id" field.
	ElementID int `json:"element_id,omitempty"`
	// Delta holds the value of the "delta" field.
	Delta int `json:"delta,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WebformSubmissionValueQuery when eager-loading is set.
	Edges WebformSubmissionValueEdges `json:"edges"`
	// contains filtered or unexported fields
}

WebformSubmissionValue is the model entity for the WebformSubmissionValue schema.

func (*WebformSubmissionValue) GetValue

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

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

func (*WebformSubmissionValue) QueryElement

func (_m *WebformSubmissionValue) QueryElement() *WebformElementQuery

QueryElement queries the "element" edge of the WebformSubmissionValue entity.

func (*WebformSubmissionValue) QuerySubmission

func (_m *WebformSubmissionValue) QuerySubmission() *WebformSubmissionQuery

QuerySubmission queries the "submission" edge of the WebformSubmissionValue entity.

func (*WebformSubmissionValue) String

func (_m *WebformSubmissionValue) String() string

String implements the fmt.Stringer.

func (*WebformSubmissionValue) Unwrap

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

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

type WebformSubmissionValueClient

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

WebformSubmissionValueClient is a client for the WebformSubmissionValue schema.

func NewWebformSubmissionValueClient

func NewWebformSubmissionValueClient(c config) *WebformSubmissionValueClient

NewWebformSubmissionValueClient returns a client for the WebformSubmissionValue from the given config.

func (*WebformSubmissionValueClient) Create

Create returns a builder for creating a WebformSubmissionValue entity.

func (*WebformSubmissionValueClient) CreateBulk

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

func (*WebformSubmissionValueClient) Delete

Delete returns a delete builder for WebformSubmissionValue.

func (*WebformSubmissionValueClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WebformSubmissionValueClient) DeleteOneID

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

func (*WebformSubmissionValueClient) Get

Get returns a WebformSubmissionValue entity by its id.

func (*WebformSubmissionValueClient) GetX

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

func (*WebformSubmissionValueClient) Hooks

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

Hooks returns the client hooks.

func (*WebformSubmissionValueClient) Intercept

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

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

func (*WebformSubmissionValueClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WebformSubmissionValueClient) MapCreateBulk

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

Query returns a query builder for WebformSubmissionValue.

func (*WebformSubmissionValueClient) QueryElement

QueryElement queries the element edge of a WebformSubmissionValue.

func (*WebformSubmissionValueClient) QuerySubmission

QuerySubmission queries the submission edge of a WebformSubmissionValue.

func (*WebformSubmissionValueClient) Update

Update returns an update builder for WebformSubmissionValue.

func (*WebformSubmissionValueClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*WebformSubmissionValueClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*WebformSubmissionValueClient) Use

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

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

type WebformSubmissionValueCreate

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

WebformSubmissionValueCreate is the builder for creating a WebformSubmissionValue entity.

func (*WebformSubmissionValueCreate) Exec

Exec executes the query.

func (*WebformSubmissionValueCreate) ExecX

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

func (*WebformSubmissionValueCreate) Mutation

Mutation returns the WebformSubmissionValueMutation object of the builder.

func (*WebformSubmissionValueCreate) Save

Save creates the WebformSubmissionValue in the database.

func (*WebformSubmissionValueCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*WebformSubmissionValueCreate) SetDelta

SetDelta sets the "delta" field.

func (*WebformSubmissionValueCreate) SetElement

SetElement sets the "element" edge to the WebformElement entity.

func (*WebformSubmissionValueCreate) SetElementID

SetElementID sets the "element_id" field.

func (*WebformSubmissionValueCreate) SetID

SetID sets the "id" field.

func (*WebformSubmissionValueCreate) SetNillableDelta

SetNillableDelta sets the "delta" field if the given value is not nil.

func (*WebformSubmissionValueCreate) SetSubmission

SetSubmission sets the "submission" edge to the WebformSubmission entity.

func (*WebformSubmissionValueCreate) SetSubmissionID

SetSubmissionID sets the "submission_id" field.

func (*WebformSubmissionValueCreate) SetValue

SetValue sets the "value" field.

type WebformSubmissionValueCreateBulk

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

WebformSubmissionValueCreateBulk is the builder for creating many WebformSubmissionValue entities in bulk.

func (*WebformSubmissionValueCreateBulk) Exec

Exec executes the query.

func (*WebformSubmissionValueCreateBulk) ExecX

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

func (*WebformSubmissionValueCreateBulk) Save

Save creates the WebformSubmissionValue entities in the database.

func (*WebformSubmissionValueCreateBulk) SaveX

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

type WebformSubmissionValueDelete

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

WebformSubmissionValueDelete is the builder for deleting a WebformSubmissionValue entity.

func (*WebformSubmissionValueDelete) Exec

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

func (*WebformSubmissionValueDelete) ExecX

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

func (*WebformSubmissionValueDelete) Where

Where appends a list predicates to the WebformSubmissionValueDelete builder.

type WebformSubmissionValueDeleteOne

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

WebformSubmissionValueDeleteOne is the builder for deleting a single WebformSubmissionValue entity.

func (*WebformSubmissionValueDeleteOne) Exec

Exec executes the deletion query.

func (*WebformSubmissionValueDeleteOne) ExecX

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

func (*WebformSubmissionValueDeleteOne) Where

Where appends a list predicates to the WebformSubmissionValueDelete builder.

type WebformSubmissionValueEdges

type WebformSubmissionValueEdges struct {
	// Submission holds the value of the submission edge.
	Submission *WebformSubmission `json:"submission,omitempty"`
	// Element holds the value of the element edge.
	Element *WebformElement `json:"element,omitempty"`
	// contains filtered or unexported fields
}

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

func (WebformSubmissionValueEdges) ElementOrErr

func (e WebformSubmissionValueEdges) ElementOrErr() (*WebformElement, error)

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

func (WebformSubmissionValueEdges) SubmissionOrErr

func (e WebformSubmissionValueEdges) SubmissionOrErr() (*WebformSubmission, error)

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

type WebformSubmissionValueGroupBy

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

WebformSubmissionValueGroupBy is the group-by builder for WebformSubmissionValue entities.

func (*WebformSubmissionValueGroupBy) Aggregate

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

func (*WebformSubmissionValueGroupBy) Bool

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

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

func (*WebformSubmissionValueGroupBy) BoolX

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

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

func (*WebformSubmissionValueGroupBy) Bools

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

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

func (*WebformSubmissionValueGroupBy) BoolsX

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

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

func (*WebformSubmissionValueGroupBy) Float64

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

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

func (*WebformSubmissionValueGroupBy) Float64X

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

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

func (*WebformSubmissionValueGroupBy) Float64s

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

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

func (*WebformSubmissionValueGroupBy) Float64sX

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

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

func (*WebformSubmissionValueGroupBy) Int

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

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

func (*WebformSubmissionValueGroupBy) IntX

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

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

func (*WebformSubmissionValueGroupBy) Ints

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

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

func (*WebformSubmissionValueGroupBy) IntsX

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

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

func (*WebformSubmissionValueGroupBy) Scan

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

func (*WebformSubmissionValueGroupBy) ScanX

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

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

func (*WebformSubmissionValueGroupBy) String

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

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

func (*WebformSubmissionValueGroupBy) StringX

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

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

func (*WebformSubmissionValueGroupBy) Strings

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

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

func (*WebformSubmissionValueGroupBy) StringsX

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

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

type WebformSubmissionValueMutation

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

WebformSubmissionValueMutation represents an operation that mutates the WebformSubmissionValue nodes in the graph.

func (*WebformSubmissionValueMutation) AddDelta

func (m *WebformSubmissionValueMutation) AddDelta(i int)

AddDelta adds i to the "delta" field.

func (*WebformSubmissionValueMutation) AddField

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) AddedDelta

func (m *WebformSubmissionValueMutation) AddedDelta() (r int, exists bool)

AddedDelta returns the value that was added to the "delta" field in this mutation.

func (*WebformSubmissionValueMutation) AddedEdges

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

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

func (*WebformSubmissionValueMutation) AddedField

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

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

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

func (*WebformSubmissionValueMutation) AddedIDs

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

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

func (*WebformSubmissionValueMutation) ClearEdge

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) ClearElement

func (m *WebformSubmissionValueMutation) ClearElement()

ClearElement clears the "element" edge to the WebformElement entity.

func (*WebformSubmissionValueMutation) ClearField

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) ClearSubmission

func (m *WebformSubmissionValueMutation) ClearSubmission()

ClearSubmission clears the "submission" edge to the WebformSubmission entity.

func (*WebformSubmissionValueMutation) ClearedEdges

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

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

func (*WebformSubmissionValueMutation) ClearedFields

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

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

func (WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) Delta

func (m *WebformSubmissionValueMutation) Delta() (r int, exists bool)

Delta returns the value of the "delta" field in the mutation.

func (*WebformSubmissionValueMutation) EdgeCleared

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

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

func (*WebformSubmissionValueMutation) ElementCleared

func (m *WebformSubmissionValueMutation) ElementCleared() bool

ElementCleared reports if the "element" edge to the WebformElement entity was cleared.

func (*WebformSubmissionValueMutation) ElementID

func (m *WebformSubmissionValueMutation) ElementID() (r int, exists bool)

ElementID returns the value of the "element_id" field in the mutation.

func (*WebformSubmissionValueMutation) ElementIDs

func (m *WebformSubmissionValueMutation) ElementIDs() (ids []int)

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

func (*WebformSubmissionValueMutation) Field

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 (*WebformSubmissionValueMutation) FieldCleared

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

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

func (*WebformSubmissionValueMutation) Fields

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

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) OldDelta

func (m *WebformSubmissionValueMutation) OldDelta(ctx context.Context) (v int, err error)

OldDelta returns the old "delta" field's value of the WebformSubmissionValue entity. If the WebformSubmissionValue 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 (*WebformSubmissionValueMutation) OldElementID

func (m *WebformSubmissionValueMutation) OldElementID(ctx context.Context) (v int, err error)

OldElementID returns the old "element_id" field's value of the WebformSubmissionValue entity. If the WebformSubmissionValue 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 (*WebformSubmissionValueMutation) OldField

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 (*WebformSubmissionValueMutation) OldSubmissionID

func (m *WebformSubmissionValueMutation) OldSubmissionID(ctx context.Context) (v int, err error)

OldSubmissionID returns the old "submission_id" field's value of the WebformSubmissionValue entity. If the WebformSubmissionValue 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 (*WebformSubmissionValueMutation) OldValue

func (m *WebformSubmissionValueMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the WebformSubmissionValue entity. If the WebformSubmissionValue 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 (*WebformSubmissionValueMutation) Op

Op returns the operation name.

func (*WebformSubmissionValueMutation) RemovedEdges

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

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

func (*WebformSubmissionValueMutation) RemovedIDs

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) ResetDelta

func (m *WebformSubmissionValueMutation) ResetDelta()

ResetDelta resets all changes to the "delta" field.

func (*WebformSubmissionValueMutation) ResetEdge

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) ResetElement

func (m *WebformSubmissionValueMutation) ResetElement()

ResetElement resets all changes to the "element" edge.

func (*WebformSubmissionValueMutation) ResetElementID

func (m *WebformSubmissionValueMutation) ResetElementID()

ResetElementID resets all changes to the "element_id" field.

func (*WebformSubmissionValueMutation) ResetField

func (m *WebformSubmissionValueMutation) 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 (*WebformSubmissionValueMutation) ResetSubmission

func (m *WebformSubmissionValueMutation) ResetSubmission()

ResetSubmission resets all changes to the "submission" edge.

func (*WebformSubmissionValueMutation) ResetSubmissionID

func (m *WebformSubmissionValueMutation) ResetSubmissionID()

ResetSubmissionID resets all changes to the "submission_id" field.

func (*WebformSubmissionValueMutation) ResetValue

func (m *WebformSubmissionValueMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*WebformSubmissionValueMutation) SetDelta

func (m *WebformSubmissionValueMutation) SetDelta(i int)

SetDelta sets the "delta" field.

func (*WebformSubmissionValueMutation) SetElementID

func (m *WebformSubmissionValueMutation) SetElementID(i int)

SetElementID sets the "element_id" field.

func (*WebformSubmissionValueMutation) SetField

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

func (m *WebformSubmissionValueMutation) SetID(id int)

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

func (*WebformSubmissionValueMutation) SetOp

func (m *WebformSubmissionValueMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WebformSubmissionValueMutation) SetSubmissionID

func (m *WebformSubmissionValueMutation) SetSubmissionID(i int)

SetSubmissionID sets the "submission_id" field.

func (*WebformSubmissionValueMutation) SetValue

func (m *WebformSubmissionValueMutation) SetValue(s string)

SetValue sets the "value" field.

func (*WebformSubmissionValueMutation) SubmissionCleared

func (m *WebformSubmissionValueMutation) SubmissionCleared() bool

SubmissionCleared reports if the "submission" edge to the WebformSubmission entity was cleared.

func (*WebformSubmissionValueMutation) SubmissionID

func (m *WebformSubmissionValueMutation) SubmissionID() (r int, exists bool)

SubmissionID returns the value of the "submission_id" field in the mutation.

func (*WebformSubmissionValueMutation) SubmissionIDs

func (m *WebformSubmissionValueMutation) SubmissionIDs() (ids []int)

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

func (WebformSubmissionValueMutation) Tx

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

func (*WebformSubmissionValueMutation) Type

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

func (*WebformSubmissionValueMutation) Value

func (m *WebformSubmissionValueMutation) Value() (r string, exists bool)

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

func (*WebformSubmissionValueMutation) Where

Where appends a list predicates to the WebformSubmissionValueMutation builder.

func (*WebformSubmissionValueMutation) WhereP

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

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

type WebformSubmissionValueQuery

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

WebformSubmissionValueQuery is the builder for querying WebformSubmissionValue entities.

func (*WebformSubmissionValueQuery) Aggregate

Aggregate returns a WebformSubmissionValueSelect configured with the given aggregations.

func (*WebformSubmissionValueQuery) All

All executes the query and returns a list of WebformSubmissionValues.

func (*WebformSubmissionValueQuery) AllX

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

func (*WebformSubmissionValueQuery) Clone

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

func (*WebformSubmissionValueQuery) Count

Count returns the count of the given query.

func (*WebformSubmissionValueQuery) CountX

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

func (*WebformSubmissionValueQuery) Exist

Exist returns true if the query has elements in the graph.

func (*WebformSubmissionValueQuery) ExistX

ExistX is like Exist, but panics if an error occurs.

func (*WebformSubmissionValueQuery) First

First returns the first WebformSubmissionValue entity from the query. Returns a *NotFoundError when no WebformSubmissionValue was found.

func (*WebformSubmissionValueQuery) FirstID

func (_q *WebformSubmissionValueQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first WebformSubmissionValue ID from the query. Returns a *NotFoundError when no WebformSubmissionValue ID was found.

func (*WebformSubmissionValueQuery) FirstIDX

func (_q *WebformSubmissionValueQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*WebformSubmissionValueQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*WebformSubmissionValueQuery) GroupBy

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 {
	SubmissionID int `json:"submission_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WebformSubmissionValue.Query().
	GroupBy(webformsubmissionvalue.FieldSubmissionID).
	Aggregate(generated.Count()).
	Scan(ctx, &v)

func (*WebformSubmissionValueQuery) IDs

func (_q *WebformSubmissionValueQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of WebformSubmissionValue IDs.

func (*WebformSubmissionValueQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*WebformSubmissionValueQuery) Limit

Limit the number of records to be returned by this query.

func (*WebformSubmissionValueQuery) Offset

Offset to start from.

func (*WebformSubmissionValueQuery) Only

Only returns a single WebformSubmissionValue entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one WebformSubmissionValue entity is found. Returns a *NotFoundError when no WebformSubmissionValue entities are found.

func (*WebformSubmissionValueQuery) OnlyID

func (_q *WebformSubmissionValueQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only WebformSubmissionValue ID in the query. Returns a *NotSingularError when more than one WebformSubmissionValue ID is found. Returns a *NotFoundError when no entities are found.

func (*WebformSubmissionValueQuery) OnlyIDX

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WebformSubmissionValueQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*WebformSubmissionValueQuery) Order

Order specifies how the records should be ordered.

func (*WebformSubmissionValueQuery) QueryElement

QueryElement chains the current query on the "element" edge.

func (*WebformSubmissionValueQuery) QuerySubmission

func (_q *WebformSubmissionValueQuery) QuerySubmission() *WebformSubmissionQuery

QuerySubmission chains the current query on the "submission" edge.

func (*WebformSubmissionValueQuery) 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 {
	SubmissionID int `json:"submission_id,omitempty"`
}

client.WebformSubmissionValue.Query().
	Select(webformsubmissionvalue.FieldSubmissionID).
	Scan(ctx, &v)

func (*WebformSubmissionValueQuery) 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 (*WebformSubmissionValueQuery) Where

Where adds a new predicate for the WebformSubmissionValueQuery builder.

func (*WebformSubmissionValueQuery) WithElement

WithElement tells the query-builder to eager-load the nodes that are connected to the "element" edge. The optional arguments are used to configure the query builder of the edge.

func (*WebformSubmissionValueQuery) WithSubmission

WithSubmission tells the query-builder to eager-load the nodes that are connected to the "submission" edge. The optional arguments are used to configure the query builder of the edge.

type WebformSubmissionValueSelect

type WebformSubmissionValueSelect struct {
	*WebformSubmissionValueQuery
	// contains filtered or unexported fields
}

WebformSubmissionValueSelect is the builder for selecting fields of WebformSubmissionValue entities.

func (*WebformSubmissionValueSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*WebformSubmissionValueSelect) Bool

func (s *WebformSubmissionValueSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) BoolX

func (s *WebformSubmissionValueSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Bools

func (s *WebformSubmissionValueSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) BoolsX

func (s *WebformSubmissionValueSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Float64

func (s *WebformSubmissionValueSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) Float64X

func (s *WebformSubmissionValueSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Float64s

func (s *WebformSubmissionValueSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) Float64sX

func (s *WebformSubmissionValueSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Int

func (s *WebformSubmissionValueSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) IntX

func (s *WebformSubmissionValueSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Ints

func (s *WebformSubmissionValueSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) IntsX

func (s *WebformSubmissionValueSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*WebformSubmissionValueSelect) ScanX

func (s *WebformSubmissionValueSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WebformSubmissionValueSelect) String

func (s *WebformSubmissionValueSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) StringX

func (s *WebformSubmissionValueSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WebformSubmissionValueSelect) Strings

func (s *WebformSubmissionValueSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WebformSubmissionValueSelect) StringsX

func (s *WebformSubmissionValueSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WebformSubmissionValueUpdate

type WebformSubmissionValueUpdate struct {
	// contains filtered or unexported fields
}

WebformSubmissionValueUpdate is the builder for updating WebformSubmissionValue entities.

func (*WebformSubmissionValueUpdate) AddDelta

AddDelta adds value to the "delta" field.

func (*WebformSubmissionValueUpdate) ClearElement

ClearElement clears the "element" edge to the WebformElement entity.

func (*WebformSubmissionValueUpdate) ClearSubmission

ClearSubmission clears the "submission" edge to the WebformSubmission entity.

func (*WebformSubmissionValueUpdate) Exec

Exec executes the query.

func (*WebformSubmissionValueUpdate) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WebformSubmissionValueUpdate) Mutation

Mutation returns the WebformSubmissionValueMutation object of the builder.

func (*WebformSubmissionValueUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*WebformSubmissionValueUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WebformSubmissionValueUpdate) SetDelta

SetDelta sets the "delta" field.

func (*WebformSubmissionValueUpdate) SetElement

SetElement sets the "element" edge to the WebformElement entity.

func (*WebformSubmissionValueUpdate) SetElementID

SetElementID sets the "element_id" field.

func (*WebformSubmissionValueUpdate) SetNillableDelta

SetNillableDelta sets the "delta" field if the given value is not nil.

func (*WebformSubmissionValueUpdate) SetNillableElementID

func (_u *WebformSubmissionValueUpdate) SetNillableElementID(v *int) *WebformSubmissionValueUpdate

SetNillableElementID sets the "element_id" field if the given value is not nil.

func (*WebformSubmissionValueUpdate) SetNillableSubmissionID

func (_u *WebformSubmissionValueUpdate) SetNillableSubmissionID(v *int) *WebformSubmissionValueUpdate

SetNillableSubmissionID sets the "submission_id" field if the given value is not nil.

func (*WebformSubmissionValueUpdate) SetNillableValue

SetNillableValue sets the "value" field if the given value is not nil.

func (*WebformSubmissionValueUpdate) SetSubmission

SetSubmission sets the "submission" edge to the WebformSubmission entity.

func (*WebformSubmissionValueUpdate) SetSubmissionID

SetSubmissionID sets the "submission_id" field.

func (*WebformSubmissionValueUpdate) SetValue

SetValue sets the "value" field.

func (*WebformSubmissionValueUpdate) Where

Where appends a list predicates to the WebformSubmissionValueUpdate builder.

type WebformSubmissionValueUpdateOne

type WebformSubmissionValueUpdateOne struct {
	// contains filtered or unexported fields
}

WebformSubmissionValueUpdateOne is the builder for updating a single WebformSubmissionValue entity.

func (*WebformSubmissionValueUpdateOne) AddDelta

AddDelta adds value to the "delta" field.

func (*WebformSubmissionValueUpdateOne) ClearElement

ClearElement clears the "element" edge to the WebformElement entity.

func (*WebformSubmissionValueUpdateOne) ClearSubmission

ClearSubmission clears the "submission" edge to the WebformSubmission entity.

func (*WebformSubmissionValueUpdateOne) Exec

Exec executes the query on the entity.

func (*WebformSubmissionValueUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*WebformSubmissionValueUpdateOne) Mutation

Mutation returns the WebformSubmissionValueMutation object of the builder.

func (*WebformSubmissionValueUpdateOne) Save

Save executes the query and returns the updated WebformSubmissionValue entity.

func (*WebformSubmissionValueUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*WebformSubmissionValueUpdateOne) 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 (*WebformSubmissionValueUpdateOne) SetDelta

SetDelta sets the "delta" field.

func (*WebformSubmissionValueUpdateOne) SetElement

SetElement sets the "element" edge to the WebformElement entity.

func (*WebformSubmissionValueUpdateOne) SetElementID

SetElementID sets the "element_id" field.

func (*WebformSubmissionValueUpdateOne) SetNillableDelta

SetNillableDelta sets the "delta" field if the given value is not nil.

func (*WebformSubmissionValueUpdateOne) SetNillableElementID

SetNillableElementID sets the "element_id" field if the given value is not nil.

func (*WebformSubmissionValueUpdateOne) SetNillableSubmissionID

func (_u *WebformSubmissionValueUpdateOne) SetNillableSubmissionID(v *int) *WebformSubmissionValueUpdateOne

SetNillableSubmissionID sets the "submission_id" field if the given value is not nil.

func (*WebformSubmissionValueUpdateOne) SetNillableValue

SetNillableValue sets the "value" field if the given value is not nil.

func (*WebformSubmissionValueUpdateOne) SetSubmission

SetSubmission sets the "submission" edge to the WebformSubmission entity.

func (*WebformSubmissionValueUpdateOne) SetSubmissionID

SetSubmissionID sets the "submission_id" field.

func (*WebformSubmissionValueUpdateOne) SetValue

SetValue sets the "value" field.

func (*WebformSubmissionValueUpdateOne) Where

Where appends a list predicates to the WebformSubmissionValueUpdate builder.

type WebformSubmissionValues

type WebformSubmissionValues []*WebformSubmissionValue

WebformSubmissionValues is a parsable slice of WebformSubmissionValue.

type WebformSubmissions

type WebformSubmissions []*WebformSubmission

WebformSubmissions is a parsable slice of WebformSubmission.

type WebformUpdate

type WebformUpdate struct {
	// contains filtered or unexported fields
}

WebformUpdate is the builder for updating Webform entities.

func (*WebformUpdate) AddElementIDs

func (_u *WebformUpdate) AddElementIDs(ids ...int) *WebformUpdate

AddElementIDs adds the "elements" edge to the WebformElement entity by IDs.

func (*WebformUpdate) AddElements

func (_u *WebformUpdate) AddElements(v ...*WebformElement) *WebformUpdate

AddElements adds the "elements" edges to the WebformElement entity.

func (*WebformUpdate) AddMaxSubmissions

func (_u *WebformUpdate) AddMaxSubmissions(v int) *WebformUpdate

AddMaxSubmissions adds value to the "max_submissions" field.

func (*WebformUpdate) AddSubmissionIDs

func (_u *WebformUpdate) AddSubmissionIDs(ids ...int) *WebformUpdate

AddSubmissionIDs adds the "submissions" edge to the WebformSubmission entity by IDs.

func (*WebformUpdate) AddSubmissions

func (_u *WebformUpdate) AddSubmissions(v ...*WebformSubmission) *WebformUpdate

AddSubmissions adds the "submissions" edges to the WebformSubmission entity.

func (*WebformUpdate) ClearClosesAt

func (_u *WebformUpdate) ClearClosesAt() *WebformUpdate

ClearClosesAt clears the value of the "closes_at" field.

func (*WebformUpdate) ClearConfirmation

func (_u *WebformUpdate) ClearConfirmation() *WebformUpdate

ClearConfirmation clears the value of the "confirmation" field.

func (*WebformUpdate) ClearDescription

func (_u *WebformUpdate) ClearDescription() *WebformUpdate

ClearDescription clears the value of the "description" field.

func (*WebformUpdate) ClearElements

func (_u *WebformUpdate) ClearElements() *WebformUpdate

ClearElements clears all "elements" edges to the WebformElement entity.

func (*WebformUpdate) ClearNode

func (_u *WebformUpdate) ClearNode() *WebformUpdate

ClearNode clears the "node" edge to the Node entity.

func (*WebformUpdate) ClearSubmissions

func (_u *WebformUpdate) ClearSubmissions() *WebformUpdate

ClearSubmissions clears all "submissions" edges to the WebformSubmission entity.

func (*WebformUpdate) Exec

func (_u *WebformUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WebformUpdate) ExecX

func (_u *WebformUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WebformUpdate) Mutation

func (_u *WebformUpdate) Mutation() *WebformMutation

Mutation returns the WebformMutation object of the builder.

func (*WebformUpdate) RemoveElementIDs

func (_u *WebformUpdate) RemoveElementIDs(ids ...int) *WebformUpdate

RemoveElementIDs removes the "elements" edge to WebformElement entities by IDs.

func (*WebformUpdate) RemoveElements

func (_u *WebformUpdate) RemoveElements(v ...*WebformElement) *WebformUpdate

RemoveElements removes "elements" edges to WebformElement entities.

func (*WebformUpdate) RemoveSubmissionIDs

func (_u *WebformUpdate) RemoveSubmissionIDs(ids ...int) *WebformUpdate

RemoveSubmissionIDs removes the "submissions" edge to WebformSubmission entities by IDs.

func (*WebformUpdate) RemoveSubmissions

func (_u *WebformUpdate) RemoveSubmissions(v ...*WebformSubmission) *WebformUpdate

RemoveSubmissions removes "submissions" edges to WebformSubmission entities.

func (*WebformUpdate) Save

func (_u *WebformUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WebformUpdate) SaveX

func (_u *WebformUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WebformUpdate) SetClosed

func (_u *WebformUpdate) SetClosed(v bool) *WebformUpdate

SetClosed sets the "closed" field.

func (*WebformUpdate) SetClosesAt

func (_u *WebformUpdate) SetClosesAt(v time.Time) *WebformUpdate

SetClosesAt sets the "closes_at" field.

func (*WebformUpdate) SetConfirmation

func (_u *WebformUpdate) SetConfirmation(v string) *WebformUpdate

SetConfirmation sets the "confirmation" field.

func (*WebformUpdate) SetConfirmationURL

func (_u *WebformUpdate) SetConfirmationURL(v string) *WebformUpdate

SetConfirmationURL sets the "confirmation_url" field.

func (*WebformUpdate) SetDescription

func (_u *WebformUpdate) SetDescription(v string) *WebformUpdate

SetDescription sets the "description" field.

func (*WebformUpdate) SetLimitPerUser

func (_u *WebformUpdate) SetLimitPerUser(v bool) *WebformUpdate

SetLimitPerUser sets the "limit_per_user" field.

func (*WebformUpdate) SetMaxSubmissions

func (_u *WebformUpdate) SetMaxSubmissions(v int) *WebformUpdate

SetMaxSubmissions sets the "max_submissions" field.

func (*WebformUpdate) SetNid

func (_u *WebformUpdate) SetNid(v int) *WebformUpdate

SetNid sets the "nid" field.

func (*WebformUpdate) SetNillableClosed

func (_u *WebformUpdate) SetNillableClosed(v *bool) *WebformUpdate

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*WebformUpdate) SetNillableClosesAt

func (_u *WebformUpdate) SetNillableClosesAt(v *time.Time) *WebformUpdate

SetNillableClosesAt sets the "closes_at" field if the given value is not nil.

func (*WebformUpdate) SetNillableConfirmation

func (_u *WebformUpdate) SetNillableConfirmation(v *string) *WebformUpdate

SetNillableConfirmation sets the "confirmation" field if the given value is not nil.

func (*WebformUpdate) SetNillableConfirmationURL

func (_u *WebformUpdate) SetNillableConfirmationURL(v *string) *WebformUpdate

SetNillableConfirmationURL sets the "confirmation_url" field if the given value is not nil.

func (*WebformUpdate) SetNillableDescription

func (_u *WebformUpdate) SetNillableDescription(v *string) *WebformUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WebformUpdate) SetNillableLimitPerUser

func (_u *WebformUpdate) SetNillableLimitPerUser(v *bool) *WebformUpdate

SetNillableLimitPerUser sets the "limit_per_user" field if the given value is not nil.

func (*WebformUpdate) SetNillableMaxSubmissions

func (_u *WebformUpdate) SetNillableMaxSubmissions(v *int) *WebformUpdate

SetNillableMaxSubmissions sets the "max_submissions" field if the given value is not nil.

func (*WebformUpdate) SetNillableNid

func (_u *WebformUpdate) SetNillableNid(v *int) *WebformUpdate

SetNillableNid sets the "nid" field if the given value is not nil.

func (*WebformUpdate) SetNillableNotifyEmail

func (_u *WebformUpdate) SetNillableNotifyEmail(v *string) *WebformUpdate

SetNillableNotifyEmail sets the "notify_email" field if the given value is not nil.

func (*WebformUpdate) SetNillableSubmitLabel

func (_u *WebformUpdate) SetNillableSubmitLabel(v *string) *WebformUpdate

SetNillableSubmitLabel sets the "submit_label" field if the given value is not nil.

func (*WebformUpdate) SetNode

func (_u *WebformUpdate) SetNode(v *Node) *WebformUpdate

SetNode sets the "node" edge to the Node entity.

func (*WebformUpdate) SetNodeID

func (_u *WebformUpdate) SetNodeID(id int) *WebformUpdate

SetNodeID sets the "node" edge to the Node entity by ID.

func (*WebformUpdate) SetNotifyEmail

func (_u *WebformUpdate) SetNotifyEmail(v string) *WebformUpdate

SetNotifyEmail sets the "notify_email" field.

func (*WebformUpdate) SetSubmitLabel

func (_u *WebformUpdate) SetSubmitLabel(v string) *WebformUpdate

SetSubmitLabel sets the "submit_label" field.

func (*WebformUpdate) Where

func (_u *WebformUpdate) Where(ps ...predicate.Webform) *WebformUpdate

Where appends a list predicates to the WebformUpdate builder.

type WebformUpdateOne

type WebformUpdateOne struct {
	// contains filtered or unexported fields
}

WebformUpdateOne is the builder for updating a single Webform entity.

func (*WebformUpdateOne) AddElementIDs

func (_u *WebformUpdateOne) AddElementIDs(ids ...int) *WebformUpdateOne

AddElementIDs adds the "elements" edge to the WebformElement entity by IDs.

func (*WebformUpdateOne) AddElements

func (_u *WebformUpdateOne) AddElements(v ...*WebformElement) *WebformUpdateOne

AddElements adds the "elements" edges to the WebformElement entity.

func (*WebformUpdateOne) AddMaxSubmissions

func (_u *WebformUpdateOne) AddMaxSubmissions(v int) *WebformUpdateOne

AddMaxSubmissions adds value to the "max_submissions" field.

func (*WebformUpdateOne) AddSubmissionIDs

func (_u *WebformUpdateOne) AddSubmissionIDs(ids ...int) *WebformUpdateOne

AddSubmissionIDs adds the "submissions" edge to the WebformSubmission entity by IDs.

func (*WebformUpdateOne) AddSubmissions

func (_u *WebformUpdateOne) AddSubmissions(v ...*WebformSubmission) *WebformUpdateOne

AddSubmissions adds the "submissions" edges to the WebformSubmission entity.

func (*WebformUpdateOne) ClearClosesAt

func (_u *WebformUpdateOne) ClearClosesAt() *WebformUpdateOne

ClearClosesAt clears the value of the "closes_at" field.

func (*WebformUpdateOne) ClearConfirmation

func (_u *WebformUpdateOne) ClearConfirmation() *WebformUpdateOne

ClearConfirmation clears the value of the "confirmation" field.

func (*WebformUpdateOne) ClearDescription

func (_u *WebformUpdateOne) ClearDescription() *WebformUpdateOne

ClearDescription clears the value of the "description" field.

func (*WebformUpdateOne) ClearElements

func (_u *WebformUpdateOne) ClearElements() *WebformUpdateOne

ClearElements clears all "elements" edges to the WebformElement entity.

func (*WebformUpdateOne) ClearNode

func (_u *WebformUpdateOne) ClearNode() *WebformUpdateOne

ClearNode clears the "node" edge to the Node entity.

func (*WebformUpdateOne) ClearSubmissions

func (_u *WebformUpdateOne) ClearSubmissions() *WebformUpdateOne

ClearSubmissions clears all "submissions" edges to the WebformSubmission entity.

func (*WebformUpdateOne) Exec

func (_u *WebformUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WebformUpdateOne) ExecX

func (_u *WebformUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WebformUpdateOne) Mutation

func (_u *WebformUpdateOne) Mutation() *WebformMutation

Mutation returns the WebformMutation object of the builder.

func (*WebformUpdateOne) RemoveElementIDs

func (_u *WebformUpdateOne) RemoveElementIDs(ids ...int) *WebformUpdateOne

RemoveElementIDs removes the "elements" edge to WebformElement entities by IDs.

func (*WebformUpdateOne) RemoveElements

func (_u *WebformUpdateOne) RemoveElements(v ...*WebformElement) *WebformUpdateOne

RemoveElements removes "elements" edges to WebformElement entities.

func (*WebformUpdateOne) RemoveSubmissionIDs

func (_u *WebformUpdateOne) RemoveSubmissionIDs(ids ...int) *WebformUpdateOne

RemoveSubmissionIDs removes the "submissions" edge to WebformSubmission entities by IDs.

func (*WebformUpdateOne) RemoveSubmissions

func (_u *WebformUpdateOne) RemoveSubmissions(v ...*WebformSubmission) *WebformUpdateOne

RemoveSubmissions removes "submissions" edges to WebformSubmission entities.

func (*WebformUpdateOne) Save

func (_u *WebformUpdateOne) Save(ctx context.Context) (*Webform, error)

Save executes the query and returns the updated Webform entity.

func (*WebformUpdateOne) SaveX

func (_u *WebformUpdateOne) SaveX(ctx context.Context) *Webform

SaveX is like Save, but panics if an error occurs.

func (*WebformUpdateOne) Select

func (_u *WebformUpdateOne) Select(field string, fields ...string) *WebformUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WebformUpdateOne) SetClosed

func (_u *WebformUpdateOne) SetClosed(v bool) *WebformUpdateOne

SetClosed sets the "closed" field.

func (*WebformUpdateOne) SetClosesAt

func (_u *WebformUpdateOne) SetClosesAt(v time.Time) *WebformUpdateOne

SetClosesAt sets the "closes_at" field.

func (*WebformUpdateOne) SetConfirmation

func (_u *WebformUpdateOne) SetConfirmation(v string) *WebformUpdateOne

SetConfirmation sets the "confirmation" field.

func (*WebformUpdateOne) SetConfirmationURL

func (_u *WebformUpdateOne) SetConfirmationURL(v string) *WebformUpdateOne

SetConfirmationURL sets the "confirmation_url" field.

func (*WebformUpdateOne) SetDescription

func (_u *WebformUpdateOne) SetDescription(v string) *WebformUpdateOne

SetDescription sets the "description" field.

func (*WebformUpdateOne) SetLimitPerUser

func (_u *WebformUpdateOne) SetLimitPerUser(v bool) *WebformUpdateOne

SetLimitPerUser sets the "limit_per_user" field.

func (*WebformUpdateOne) SetMaxSubmissions

func (_u *WebformUpdateOne) SetMaxSubmissions(v int) *WebformUpdateOne

SetMaxSubmissions sets the "max_submissions" field.

func (*WebformUpdateOne) SetNid

func (_u *WebformUpdateOne) SetNid(v int) *WebformUpdateOne

SetNid sets the "nid" field.

func (*WebformUpdateOne) SetNillableClosed

func (_u *WebformUpdateOne) SetNillableClosed(v *bool) *WebformUpdateOne

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableClosesAt

func (_u *WebformUpdateOne) SetNillableClosesAt(v *time.Time) *WebformUpdateOne

SetNillableClosesAt sets the "closes_at" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableConfirmation

func (_u *WebformUpdateOne) SetNillableConfirmation(v *string) *WebformUpdateOne

SetNillableConfirmation sets the "confirmation" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableConfirmationURL

func (_u *WebformUpdateOne) SetNillableConfirmationURL(v *string) *WebformUpdateOne

SetNillableConfirmationURL sets the "confirmation_url" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableDescription

func (_u *WebformUpdateOne) SetNillableDescription(v *string) *WebformUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableLimitPerUser

func (_u *WebformUpdateOne) SetNillableLimitPerUser(v *bool) *WebformUpdateOne

SetNillableLimitPerUser sets the "limit_per_user" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableMaxSubmissions

func (_u *WebformUpdateOne) SetNillableMaxSubmissions(v *int) *WebformUpdateOne

SetNillableMaxSubmissions sets the "max_submissions" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableNid

func (_u *WebformUpdateOne) SetNillableNid(v *int) *WebformUpdateOne

SetNillableNid sets the "nid" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableNotifyEmail

func (_u *WebformUpdateOne) SetNillableNotifyEmail(v *string) *WebformUpdateOne

SetNillableNotifyEmail sets the "notify_email" field if the given value is not nil.

func (*WebformUpdateOne) SetNillableSubmitLabel

func (_u *WebformUpdateOne) SetNillableSubmitLabel(v *string) *WebformUpdateOne

SetNillableSubmitLabel sets the "submit_label" field if the given value is not nil.

func (*WebformUpdateOne) SetNode

func (_u *WebformUpdateOne) SetNode(v *Node) *WebformUpdateOne

SetNode sets the "node" edge to the Node entity.

func (*WebformUpdateOne) SetNodeID

func (_u *WebformUpdateOne) SetNodeID(id int) *WebformUpdateOne

SetNodeID sets the "node" edge to the Node entity by ID.

func (*WebformUpdateOne) SetNotifyEmail

func (_u *WebformUpdateOne) SetNotifyEmail(v string) *WebformUpdateOne

SetNotifyEmail sets the "notify_email" field.

func (*WebformUpdateOne) SetSubmitLabel

func (_u *WebformUpdateOne) SetSubmitLabel(v string) *WebformUpdateOne

SetSubmitLabel sets the "submit_label" field.

func (*WebformUpdateOne) Where

Where appends a list predicates to the WebformUpdate builder.

type Webforms

type Webforms []*Webform

Webforms is a parsable slice of Webform.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL