ent

package
v0.0.0-...-e97b45c Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 34 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.
	TypeConversation         = "Conversation"
	TypeFinancialTransaction = "FinancialTransaction"
	TypeInvoice              = "Invoice"
	TypeInvoiceLineItem      = "InvoiceLineItem"
	TypeMessage              = "Message"
	TypeOrder                = "Order"
	TypeOrderLineItem        = "OrderLineItem"
	TypeOrderStatusCode      = "OrderStatusCode"
	TypePerson               = "Person"
	TypeProduct              = "Product"
	TypeProductImage         = "ProductImage"
	TypeProductTag           = "ProductTag"
	TypeTag                  = "Tag"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Conversation is the client for interacting with the Conversation builders.
	Conversation *ConversationClient
	// FinancialTransaction is the client for interacting with the FinancialTransaction builders.
	FinancialTransaction *FinancialTransactionClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// InvoiceLineItem is the client for interacting with the InvoiceLineItem builders.
	InvoiceLineItem *InvoiceLineItemClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// OrderLineItem is the client for interacting with the OrderLineItem builders.
	OrderLineItem *OrderLineItemClient
	// OrderStatusCode is the client for interacting with the OrderStatusCode builders.
	OrderStatusCode *OrderStatusCodeClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// ProductImage is the client for interacting with the ProductImage builders.
	ProductImage *ProductImageClient
	// ProductTag is the client for interacting with the ProductTag builders.
	ProductTag *ProductTagClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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().
	Conversation.
	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 Conversation

type Conversation struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Title holds the value of the "title" field.
	Title *string `json:"title,omitempty"`
	// PersonOneID holds the value of the "person_one_id" field.
	PersonOneID uuid.UUID `json:"person_one_id,omitempty"`
	// PersonTwoID holds the value of the "person_two_id" field.
	PersonTwoID uuid.UUID `json:"person_two_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ConversationQuery when eager-loading is set.
	Edges ConversationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Conversation is the model entity for the Conversation schema.

func (*Conversation) QueryPersonOne

func (c *Conversation) QueryPersonOne() *PersonQuery

QueryPersonOne queries the "person_one" edge of the Conversation entity.

func (*Conversation) QueryPersonTwo

func (c *Conversation) QueryPersonTwo() *PersonQuery

QueryPersonTwo queries the "person_two" edge of the Conversation entity.

func (*Conversation) String

func (c *Conversation) String() string

String implements the fmt.Stringer.

func (*Conversation) Unwrap

func (c *Conversation) Unwrap() *Conversation

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

func (c *Conversation) Update() *ConversationUpdateOne

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

func (*Conversation) Value

func (c *Conversation) Value(name string) (ent.Value, error)

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

type ConversationClient

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

ConversationClient is a client for the Conversation schema.

func NewConversationClient

func NewConversationClient(c config) *ConversationClient

NewConversationClient returns a client for the Conversation from the given config.

func (*ConversationClient) Create

Create returns a builder for creating a Conversation entity.

func (*ConversationClient) CreateBulk

func (c *ConversationClient) CreateBulk(builders ...*ConversationCreate) *ConversationCreateBulk

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

func (*ConversationClient) Delete

Delete returns a delete builder for Conversation.

func (*ConversationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ConversationClient) DeleteOneID

func (c *ConversationClient) DeleteOneID(id uuid.UUID) *ConversationDeleteOne

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

func (*ConversationClient) Get

Get returns a Conversation entity by its id.

func (*ConversationClient) GetX

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

func (*ConversationClient) Hooks

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

Hooks returns the client hooks.

func (*ConversationClient) Intercept

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

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

func (*ConversationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ConversationClient) MapCreateBulk

func (c *ConversationClient) MapCreateBulk(slice any, setFunc func(*ConversationCreate, int)) *ConversationCreateBulk

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

Query returns a query builder for Conversation.

func (*ConversationClient) QueryPersonOne

func (c *ConversationClient) QueryPersonOne(co *Conversation) *PersonQuery

QueryPersonOne queries the person_one edge of a Conversation.

func (*ConversationClient) QueryPersonTwo

func (c *ConversationClient) QueryPersonTwo(co *Conversation) *PersonQuery

QueryPersonTwo queries the person_two edge of a Conversation.

func (*ConversationClient) Update

Update returns an update builder for Conversation.

func (*ConversationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ConversationClient) UpdateOneID

func (c *ConversationClient) UpdateOneID(id uuid.UUID) *ConversationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ConversationClient) Use

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

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

type ConversationCreate

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

ConversationCreate is the builder for creating a Conversation entity.

func (*ConversationCreate) Exec

func (cc *ConversationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConversationCreate) ExecX

func (cc *ConversationCreate) ExecX(ctx context.Context)

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

func (*ConversationCreate) Mutation

func (cc *ConversationCreate) Mutation() *ConversationMutation

Mutation returns the ConversationMutation object of the builder.

func (*ConversationCreate) Save

Save creates the Conversation in the database.

func (*ConversationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ConversationCreate) SetCreatedAt

func (cc *ConversationCreate) SetCreatedAt(t time.Time) *ConversationCreate

SetCreatedAt sets the "created_at" field.

func (*ConversationCreate) SetID

SetID sets the "id" field.

func (*ConversationCreate) SetNillableCreatedAt

func (cc *ConversationCreate) SetNillableCreatedAt(t *time.Time) *ConversationCreate

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

func (*ConversationCreate) SetNillableID

func (cc *ConversationCreate) SetNillableID(u *uuid.UUID) *ConversationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ConversationCreate) SetNillableTitle

func (cc *ConversationCreate) SetNillableTitle(s *string) *ConversationCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ConversationCreate) SetNillableUpdatedAt

func (cc *ConversationCreate) SetNillableUpdatedAt(t *time.Time) *ConversationCreate

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

func (*ConversationCreate) SetPersonOne

func (cc *ConversationCreate) SetPersonOne(p *Person) *ConversationCreate

SetPersonOne sets the "person_one" edge to the Person entity.

func (*ConversationCreate) SetPersonOneID

func (cc *ConversationCreate) SetPersonOneID(u uuid.UUID) *ConversationCreate

SetPersonOneID sets the "person_one_id" field.

func (*ConversationCreate) SetPersonTwo

func (cc *ConversationCreate) SetPersonTwo(p *Person) *ConversationCreate

SetPersonTwo sets the "person_two" edge to the Person entity.

func (*ConversationCreate) SetPersonTwoID

func (cc *ConversationCreate) SetPersonTwoID(u uuid.UUID) *ConversationCreate

SetPersonTwoID sets the "person_two_id" field.

func (*ConversationCreate) SetTitle

func (cc *ConversationCreate) SetTitle(s string) *ConversationCreate

SetTitle sets the "title" field.

func (*ConversationCreate) SetUpdatedAt

func (cc *ConversationCreate) SetUpdatedAt(t time.Time) *ConversationCreate

SetUpdatedAt sets the "updated_at" field.

type ConversationCreateBulk

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

ConversationCreateBulk is the builder for creating many Conversation entities in bulk.

func (*ConversationCreateBulk) Exec

Exec executes the query.

func (*ConversationCreateBulk) ExecX

func (ccb *ConversationCreateBulk) ExecX(ctx context.Context)

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

func (*ConversationCreateBulk) Save

Save creates the Conversation entities in the database.

func (*ConversationCreateBulk) SaveX

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

type ConversationDelete

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

ConversationDelete is the builder for deleting a Conversation entity.

func (*ConversationDelete) Exec

func (cd *ConversationDelete) Exec(ctx context.Context) (int, error)

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

func (*ConversationDelete) ExecX

func (cd *ConversationDelete) ExecX(ctx context.Context) int

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

func (*ConversationDelete) Where

Where appends a list predicates to the ConversationDelete builder.

type ConversationDeleteOne

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

ConversationDeleteOne is the builder for deleting a single Conversation entity.

func (*ConversationDeleteOne) Exec

func (cdo *ConversationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ConversationDeleteOne) ExecX

func (cdo *ConversationDeleteOne) ExecX(ctx context.Context)

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

func (*ConversationDeleteOne) Where

Where appends a list predicates to the ConversationDelete builder.

type ConversationEdges

type ConversationEdges struct {
	// PersonOne holds the value of the person_one edge.
	PersonOne *Person `json:"person_one,omitempty"`
	// PersonTwo holds the value of the person_two edge.
	PersonTwo *Person `json:"person_two,omitempty"`
	// contains filtered or unexported fields
}

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

func (ConversationEdges) PersonOneOrErr

func (e ConversationEdges) PersonOneOrErr() (*Person, error)

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

func (ConversationEdges) PersonTwoOrErr

func (e ConversationEdges) PersonTwoOrErr() (*Person, error)

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

type ConversationGroupBy

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

ConversationGroupBy is the group-by builder for Conversation entities.

func (*ConversationGroupBy) Aggregate

func (cgb *ConversationGroupBy) Aggregate(fns ...AggregateFunc) *ConversationGroupBy

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

func (*ConversationGroupBy) Bool

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

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

func (*ConversationGroupBy) BoolX

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

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

func (*ConversationGroupBy) Bools

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

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

func (*ConversationGroupBy) BoolsX

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

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

func (*ConversationGroupBy) Float64

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

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

func (*ConversationGroupBy) Float64X

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

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

func (*ConversationGroupBy) Float64s

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

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

func (*ConversationGroupBy) Float64sX

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

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

func (*ConversationGroupBy) Int

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

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

func (*ConversationGroupBy) IntX

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

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

func (*ConversationGroupBy) Ints

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

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

func (*ConversationGroupBy) IntsX

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

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

func (*ConversationGroupBy) Scan

func (cgb *ConversationGroupBy) Scan(ctx context.Context, v any) error

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

func (*ConversationGroupBy) ScanX

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

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

func (*ConversationGroupBy) String

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

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

func (*ConversationGroupBy) StringX

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

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

func (*ConversationGroupBy) Strings

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

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

func (*ConversationGroupBy) StringsX

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

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

type ConversationMutation

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

ConversationMutation represents an operation that mutates the Conversation nodes in the graph.

func (*ConversationMutation) AddField

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

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

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

func (*ConversationMutation) AddedField

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

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

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

func (*ConversationMutation) AddedIDs

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

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

func (*ConversationMutation) ClearEdge

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

func (m *ConversationMutation) 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 (*ConversationMutation) ClearPersonOne

func (m *ConversationMutation) ClearPersonOne()

ClearPersonOne clears the "person_one" edge to the Person entity.

func (*ConversationMutation) ClearPersonTwo

func (m *ConversationMutation) ClearPersonTwo()

ClearPersonTwo clears the "person_two" edge to the Person entity.

func (*ConversationMutation) ClearTitle

func (m *ConversationMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*ConversationMutation) ClearedEdges

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

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

func (*ConversationMutation) ClearedFields

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

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

func (ConversationMutation) Client

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

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

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

func (*ConversationMutation) EdgeCleared

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

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

func (*ConversationMutation) Field

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

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

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

func (*ConversationMutation) Fields

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

func (m *ConversationMutation) ID() (id uuid.UUID, 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 (*ConversationMutation) 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 (*ConversationMutation) OldCreatedAt

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

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

func (m *ConversationMutation) 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 (*ConversationMutation) OldPersonOneID

func (m *ConversationMutation) OldPersonOneID(ctx context.Context) (v uuid.UUID, err error)

OldPersonOneID returns the old "person_one_id" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldPersonTwoID

func (m *ConversationMutation) OldPersonTwoID(ctx context.Context) (v uuid.UUID, err error)

OldPersonTwoID returns the old "person_two_id" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldTitle

func (m *ConversationMutation) OldTitle(ctx context.Context) (v *string, err error)

OldTitle returns the old "title" field's value of the Conversation entity. If the Conversation 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 (*ConversationMutation) OldUpdatedAt

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

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

func (m *ConversationMutation) Op() Op

Op returns the operation name.

func (*ConversationMutation) PersonOneCleared

func (m *ConversationMutation) PersonOneCleared() bool

PersonOneCleared reports if the "person_one" edge to the Person entity was cleared.

func (*ConversationMutation) PersonOneID

func (m *ConversationMutation) PersonOneID() (r uuid.UUID, exists bool)

PersonOneID returns the value of the "person_one_id" field in the mutation.

func (*ConversationMutation) PersonOneIDs

func (m *ConversationMutation) PersonOneIDs() (ids []uuid.UUID)

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

func (*ConversationMutation) PersonTwoCleared

func (m *ConversationMutation) PersonTwoCleared() bool

PersonTwoCleared reports if the "person_two" edge to the Person entity was cleared.

func (*ConversationMutation) PersonTwoID

func (m *ConversationMutation) PersonTwoID() (r uuid.UUID, exists bool)

PersonTwoID returns the value of the "person_two_id" field in the mutation.

func (*ConversationMutation) PersonTwoIDs

func (m *ConversationMutation) PersonTwoIDs() (ids []uuid.UUID)

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

func (*ConversationMutation) RemovedEdges

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

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

func (*ConversationMutation) RemovedIDs

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

func (m *ConversationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ConversationMutation) ResetEdge

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

func (m *ConversationMutation) 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 (*ConversationMutation) ResetPersonOne

func (m *ConversationMutation) ResetPersonOne()

ResetPersonOne resets all changes to the "person_one" edge.

func (*ConversationMutation) ResetPersonOneID

func (m *ConversationMutation) ResetPersonOneID()

ResetPersonOneID resets all changes to the "person_one_id" field.

func (*ConversationMutation) ResetPersonTwo

func (m *ConversationMutation) ResetPersonTwo()

ResetPersonTwo resets all changes to the "person_two" edge.

func (*ConversationMutation) ResetPersonTwoID

func (m *ConversationMutation) ResetPersonTwoID()

ResetPersonTwoID resets all changes to the "person_two_id" field.

func (*ConversationMutation) ResetTitle

func (m *ConversationMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ConversationMutation) ResetUpdatedAt

func (m *ConversationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ConversationMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ConversationMutation) SetField

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

func (m *ConversationMutation) SetID(id uuid.UUID)

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

func (*ConversationMutation) SetOp

func (m *ConversationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ConversationMutation) SetPersonOneID

func (m *ConversationMutation) SetPersonOneID(u uuid.UUID)

SetPersonOneID sets the "person_one_id" field.

func (*ConversationMutation) SetPersonTwoID

func (m *ConversationMutation) SetPersonTwoID(u uuid.UUID)

SetPersonTwoID sets the "person_two_id" field.

func (*ConversationMutation) SetTitle

func (m *ConversationMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ConversationMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ConversationMutation) Title

func (m *ConversationMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*ConversationMutation) TitleCleared

func (m *ConversationMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (ConversationMutation) Tx

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

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

func (*ConversationMutation) Type

func (m *ConversationMutation) Type() string

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

func (*ConversationMutation) UpdatedAt

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

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

func (*ConversationMutation) Where

Where appends a list predicates to the ConversationMutation builder.

func (*ConversationMutation) WhereP

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

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

type ConversationQuery

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

ConversationQuery is the builder for querying Conversation entities.

func (*ConversationQuery) Aggregate

func (cq *ConversationQuery) Aggregate(fns ...AggregateFunc) *ConversationSelect

Aggregate returns a ConversationSelect configured with the given aggregations.

func (*ConversationQuery) All

func (cq *ConversationQuery) All(ctx context.Context) ([]*Conversation, error)

All executes the query and returns a list of Conversations.

func (*ConversationQuery) AllX

func (cq *ConversationQuery) AllX(ctx context.Context) []*Conversation

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

func (*ConversationQuery) Clone

func (cq *ConversationQuery) Clone() *ConversationQuery

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

func (*ConversationQuery) Count

func (cq *ConversationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ConversationQuery) CountX

func (cq *ConversationQuery) CountX(ctx context.Context) int

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

func (*ConversationQuery) Exist

func (cq *ConversationQuery) Exist(ctx context.Context) (bool, error)

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

func (*ConversationQuery) ExistX

func (cq *ConversationQuery) ExistX(ctx context.Context) bool

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

func (*ConversationQuery) First

func (cq *ConversationQuery) First(ctx context.Context) (*Conversation, error)

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

func (*ConversationQuery) FirstID

func (cq *ConversationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ConversationQuery) FirstIDX

func (cq *ConversationQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ConversationQuery) FirstX

func (cq *ConversationQuery) FirstX(ctx context.Context) *Conversation

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

func (*ConversationQuery) GroupBy

func (cq *ConversationQuery) GroupBy(field string, fields ...string) *ConversationGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Conversation.Query().
	GroupBy(conversation.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ConversationQuery) IDs

func (cq *ConversationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*ConversationQuery) IDsX

func (cq *ConversationQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ConversationQuery) Limit

func (cq *ConversationQuery) Limit(limit int) *ConversationQuery

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

func (*ConversationQuery) Offset

func (cq *ConversationQuery) Offset(offset int) *ConversationQuery

Offset to start from.

func (*ConversationQuery) Only

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

func (*ConversationQuery) OnlyID

func (cq *ConversationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ConversationQuery) OnlyIDX

func (cq *ConversationQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ConversationQuery) OnlyX

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

func (*ConversationQuery) Order

Order specifies how the records should be ordered.

func (*ConversationQuery) QueryPersonOne

func (cq *ConversationQuery) QueryPersonOne() *PersonQuery

QueryPersonOne chains the current query on the "person_one" edge.

func (*ConversationQuery) QueryPersonTwo

func (cq *ConversationQuery) QueryPersonTwo() *PersonQuery

QueryPersonTwo chains the current query on the "person_two" edge.

func (*ConversationQuery) Select

func (cq *ConversationQuery) Select(fields ...string) *ConversationSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Conversation.Query().
	Select(conversation.FieldCreatedAt).
	Scan(ctx, &v)

func (*ConversationQuery) Unique

func (cq *ConversationQuery) Unique(unique bool) *ConversationQuery

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

Where adds a new predicate for the ConversationQuery builder.

func (*ConversationQuery) WithPersonOne

func (cq *ConversationQuery) WithPersonOne(opts ...func(*PersonQuery)) *ConversationQuery

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

func (*ConversationQuery) WithPersonTwo

func (cq *ConversationQuery) WithPersonTwo(opts ...func(*PersonQuery)) *ConversationQuery

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

type ConversationSelect

type ConversationSelect struct {
	*ConversationQuery
	// contains filtered or unexported fields
}

ConversationSelect is the builder for selecting fields of Conversation entities.

func (*ConversationSelect) Aggregate

func (cs *ConversationSelect) Aggregate(fns ...AggregateFunc) *ConversationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ConversationSelect) Bool

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

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

func (*ConversationSelect) BoolX

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

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

func (*ConversationSelect) Bools

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

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

func (*ConversationSelect) BoolsX

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

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

func (*ConversationSelect) Float64

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

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

func (*ConversationSelect) Float64X

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

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

func (*ConversationSelect) Float64s

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

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

func (*ConversationSelect) Float64sX

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

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

func (*ConversationSelect) Int

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

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

func (*ConversationSelect) IntX

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

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

func (*ConversationSelect) Ints

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

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

func (*ConversationSelect) IntsX

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

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

func (*ConversationSelect) Scan

func (cs *ConversationSelect) Scan(ctx context.Context, v any) error

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

func (*ConversationSelect) ScanX

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

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

func (*ConversationSelect) String

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

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

func (*ConversationSelect) StringX

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

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

func (*ConversationSelect) Strings

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

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

func (*ConversationSelect) StringsX

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

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

type ConversationUpdate

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

ConversationUpdate is the builder for updating Conversation entities.

func (*ConversationUpdate) ClearTitle

func (cu *ConversationUpdate) ClearTitle() *ConversationUpdate

ClearTitle clears the value of the "title" field.

func (*ConversationUpdate) Exec

func (cu *ConversationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ConversationUpdate) ExecX

func (cu *ConversationUpdate) ExecX(ctx context.Context)

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

func (*ConversationUpdate) Mutation

func (cu *ConversationUpdate) Mutation() *ConversationMutation

Mutation returns the ConversationMutation object of the builder.

func (*ConversationUpdate) Save

func (cu *ConversationUpdate) Save(ctx context.Context) (int, error)

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

func (*ConversationUpdate) SaveX

func (cu *ConversationUpdate) SaveX(ctx context.Context) int

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

func (*ConversationUpdate) SetNillableTitle

func (cu *ConversationUpdate) SetNillableTitle(s *string) *ConversationUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ConversationUpdate) SetTitle

func (cu *ConversationUpdate) SetTitle(s string) *ConversationUpdate

SetTitle sets the "title" field.

func (*ConversationUpdate) SetUpdatedAt

func (cu *ConversationUpdate) SetUpdatedAt(t time.Time) *ConversationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ConversationUpdate) Where

Where appends a list predicates to the ConversationUpdate builder.

type ConversationUpdateOne

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

ConversationUpdateOne is the builder for updating a single Conversation entity.

func (*ConversationUpdateOne) ClearTitle

func (cuo *ConversationUpdateOne) ClearTitle() *ConversationUpdateOne

ClearTitle clears the value of the "title" field.

func (*ConversationUpdateOne) Exec

func (cuo *ConversationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ConversationUpdateOne) ExecX

func (cuo *ConversationUpdateOne) ExecX(ctx context.Context)

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

func (*ConversationUpdateOne) Mutation

Mutation returns the ConversationMutation object of the builder.

func (*ConversationUpdateOne) Save

Save executes the query and returns the updated Conversation entity.

func (*ConversationUpdateOne) SaveX

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

func (*ConversationUpdateOne) Select

func (cuo *ConversationUpdateOne) Select(field string, fields ...string) *ConversationUpdateOne

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

func (*ConversationUpdateOne) SetNillableTitle

func (cuo *ConversationUpdateOne) SetNillableTitle(s *string) *ConversationUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*ConversationUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*ConversationUpdateOne) SetUpdatedAt

func (cuo *ConversationUpdateOne) SetUpdatedAt(t time.Time) *ConversationUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ConversationUpdateOne) Where

Where appends a list predicates to the ConversationUpdate builder.

type Conversations

type Conversations []*Conversation

Conversations is a parsable slice of Conversation.

type FinancialTransaction

type FinancialTransaction struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// InvoiceID holds the value of the "invoice_id" field.
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount decimal.Decimal `json:"amount,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment *string `json:"comment,omitempty"`
	// IsInternal holds the value of the "is_internal" field.
	IsInternal bool `json:"is_internal,omitempty"`
	// PaymentMethod holds the value of the "payment_method" field.
	PaymentMethod financialtransaction.PaymentMethod `json:"payment_method,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FinancialTransactionQuery when eager-loading is set.
	Edges FinancialTransactionEdges `json:"edges"`
	// contains filtered or unexported fields
}

FinancialTransaction is the model entity for the FinancialTransaction schema.

func (*FinancialTransaction) QueryInvoice

func (ft *FinancialTransaction) QueryInvoice() *InvoiceQuery

QueryInvoice queries the "invoice" edge of the FinancialTransaction entity.

func (*FinancialTransaction) String

func (ft *FinancialTransaction) String() string

String implements the fmt.Stringer.

func (*FinancialTransaction) Unwrap

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

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

func (*FinancialTransaction) Value

func (ft *FinancialTransaction) Value(name string) (ent.Value, error)

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

type FinancialTransactionClient

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

FinancialTransactionClient is a client for the FinancialTransaction schema.

func NewFinancialTransactionClient

func NewFinancialTransactionClient(c config) *FinancialTransactionClient

NewFinancialTransactionClient returns a client for the FinancialTransaction from the given config.

func (*FinancialTransactionClient) Create

Create returns a builder for creating a FinancialTransaction entity.

func (*FinancialTransactionClient) CreateBulk

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

func (*FinancialTransactionClient) Delete

Delete returns a delete builder for FinancialTransaction.

func (*FinancialTransactionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FinancialTransactionClient) DeleteOneID

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

func (*FinancialTransactionClient) Get

Get returns a FinancialTransaction entity by its id.

func (*FinancialTransactionClient) GetX

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

func (*FinancialTransactionClient) Hooks

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

Hooks returns the client hooks.

func (*FinancialTransactionClient) Intercept

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

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

func (*FinancialTransactionClient) Interceptors

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

Interceptors returns the client interceptors.

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

Query returns a query builder for FinancialTransaction.

func (*FinancialTransactionClient) QueryInvoice

QueryInvoice queries the invoice edge of a FinancialTransaction.

func (*FinancialTransactionClient) Update

Update returns an update builder for FinancialTransaction.

func (*FinancialTransactionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*FinancialTransactionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*FinancialTransactionClient) Use

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

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

type FinancialTransactionCreate

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

FinancialTransactionCreate is the builder for creating a FinancialTransaction entity.

func (*FinancialTransactionCreate) Exec

Exec executes the query.

func (*FinancialTransactionCreate) ExecX

func (ftc *FinancialTransactionCreate) ExecX(ctx context.Context)

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

func (*FinancialTransactionCreate) Mutation

Mutation returns the FinancialTransactionMutation object of the builder.

func (*FinancialTransactionCreate) Save

Save creates the FinancialTransaction in the database.

func (*FinancialTransactionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*FinancialTransactionCreate) SetAmount

SetAmount sets the "amount" field.

func (*FinancialTransactionCreate) SetComment

SetComment sets the "comment" field.

func (*FinancialTransactionCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*FinancialTransactionCreate) SetID

SetID sets the "id" field.

func (*FinancialTransactionCreate) SetInvoice

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*FinancialTransactionCreate) SetInvoiceID

SetInvoiceID sets the "invoice_id" field.

func (*FinancialTransactionCreate) SetIsInternal

SetIsInternal sets the "is_internal" field.

func (*FinancialTransactionCreate) SetNillableComment

func (ftc *FinancialTransactionCreate) SetNillableComment(s *string) *FinancialTransactionCreate

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

func (*FinancialTransactionCreate) SetNillableCreatedAt

func (ftc *FinancialTransactionCreate) SetNillableCreatedAt(t *time.Time) *FinancialTransactionCreate

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

func (*FinancialTransactionCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*FinancialTransactionCreate) SetNillableIsInternal

func (ftc *FinancialTransactionCreate) SetNillableIsInternal(b *bool) *FinancialTransactionCreate

SetNillableIsInternal sets the "is_internal" field if the given value is not nil.

func (*FinancialTransactionCreate) SetNillablePaymentMethod

SetNillablePaymentMethod sets the "payment_method" field if the given value is not nil.

func (*FinancialTransactionCreate) SetNillableUpdatedAt

func (ftc *FinancialTransactionCreate) SetNillableUpdatedAt(t *time.Time) *FinancialTransactionCreate

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

func (*FinancialTransactionCreate) SetPaymentMethod

SetPaymentMethod sets the "payment_method" field.

func (*FinancialTransactionCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type FinancialTransactionCreateBulk

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

FinancialTransactionCreateBulk is the builder for creating many FinancialTransaction entities in bulk.

func (*FinancialTransactionCreateBulk) Exec

Exec executes the query.

func (*FinancialTransactionCreateBulk) ExecX

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

func (*FinancialTransactionCreateBulk) Save

Save creates the FinancialTransaction entities in the database.

func (*FinancialTransactionCreateBulk) SaveX

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

type FinancialTransactionDelete

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

FinancialTransactionDelete is the builder for deleting a FinancialTransaction entity.

func (*FinancialTransactionDelete) Exec

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

func (*FinancialTransactionDelete) ExecX

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

func (*FinancialTransactionDelete) Where

Where appends a list predicates to the FinancialTransactionDelete builder.

type FinancialTransactionDeleteOne

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

FinancialTransactionDeleteOne is the builder for deleting a single FinancialTransaction entity.

func (*FinancialTransactionDeleteOne) Exec

Exec executes the deletion query.

func (*FinancialTransactionDeleteOne) ExecX

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

func (*FinancialTransactionDeleteOne) Where

Where appends a list predicates to the FinancialTransactionDelete builder.

type FinancialTransactionEdges

type FinancialTransactionEdges struct {
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// contains filtered or unexported fields
}

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

func (FinancialTransactionEdges) InvoiceOrErr

func (e FinancialTransactionEdges) InvoiceOrErr() (*Invoice, error)

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

type FinancialTransactionGroupBy

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

FinancialTransactionGroupBy is the group-by builder for FinancialTransaction entities.

func (*FinancialTransactionGroupBy) Aggregate

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

func (*FinancialTransactionGroupBy) Bool

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

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

func (*FinancialTransactionGroupBy) BoolX

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

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

func (*FinancialTransactionGroupBy) Bools

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

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

func (*FinancialTransactionGroupBy) BoolsX

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

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

func (*FinancialTransactionGroupBy) Float64

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

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

func (*FinancialTransactionGroupBy) Float64X

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

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

func (*FinancialTransactionGroupBy) Float64s

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

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

func (*FinancialTransactionGroupBy) Float64sX

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

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

func (*FinancialTransactionGroupBy) Int

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

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

func (*FinancialTransactionGroupBy) IntX

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

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

func (*FinancialTransactionGroupBy) Ints

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

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

func (*FinancialTransactionGroupBy) IntsX

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

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

func (*FinancialTransactionGroupBy) Scan

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

func (*FinancialTransactionGroupBy) ScanX

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

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

func (*FinancialTransactionGroupBy) String

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

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

func (*FinancialTransactionGroupBy) StringX

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

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

func (*FinancialTransactionGroupBy) Strings

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

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

func (*FinancialTransactionGroupBy) StringsX

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

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

type FinancialTransactionMutation

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

FinancialTransactionMutation represents an operation that mutates the FinancialTransaction nodes in the graph.

func (*FinancialTransactionMutation) AddAmount

AddAmount adds d to the "amount" field.

func (*FinancialTransactionMutation) AddField

func (m *FinancialTransactionMutation) 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 (*FinancialTransactionMutation) AddedAmount

func (m *FinancialTransactionMutation) AddedAmount() (r decimal.Decimal, exists bool)

AddedAmount returns the value that was added to the "amount" field in this mutation.

func (*FinancialTransactionMutation) AddedEdges

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

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

func (*FinancialTransactionMutation) AddedField

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

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

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

func (*FinancialTransactionMutation) AddedIDs

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

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

func (*FinancialTransactionMutation) Amount

func (m *FinancialTransactionMutation) Amount() (r decimal.Decimal, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*FinancialTransactionMutation) ClearComment

func (m *FinancialTransactionMutation) ClearComment()

ClearComment clears the value of the "comment" field.

func (*FinancialTransactionMutation) ClearEdge

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

func (m *FinancialTransactionMutation) 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 (*FinancialTransactionMutation) ClearInvoice

func (m *FinancialTransactionMutation) ClearInvoice()

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*FinancialTransactionMutation) ClearedEdges

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

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

func (*FinancialTransactionMutation) ClearedFields

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

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

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

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

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

func (*FinancialTransactionMutation) CommentCleared

func (m *FinancialTransactionMutation) CommentCleared() bool

CommentCleared returns if the "comment" field was cleared in this mutation.

func (*FinancialTransactionMutation) CreatedAt

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

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

func (*FinancialTransactionMutation) EdgeCleared

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

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

func (*FinancialTransactionMutation) Field

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

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

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

func (*FinancialTransactionMutation) Fields

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

func (m *FinancialTransactionMutation) ID() (id uuid.UUID, 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 (*FinancialTransactionMutation) 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 (*FinancialTransactionMutation) InvoiceCleared

func (m *FinancialTransactionMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*FinancialTransactionMutation) InvoiceID

func (m *FinancialTransactionMutation) InvoiceID() (r uuid.UUID, exists bool)

InvoiceID returns the value of the "invoice_id" field in the mutation.

func (*FinancialTransactionMutation) InvoiceIDs

func (m *FinancialTransactionMutation) InvoiceIDs() (ids []uuid.UUID)

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

func (*FinancialTransactionMutation) IsInternal

func (m *FinancialTransactionMutation) IsInternal() (r bool, exists bool)

IsInternal returns the value of the "is_internal" field in the mutation.

func (*FinancialTransactionMutation) OldAmount

func (m *FinancialTransactionMutation) OldAmount(ctx context.Context) (v decimal.Decimal, err error)

OldAmount returns the old "amount" field's value of the FinancialTransaction entity. If the FinancialTransaction 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 (*FinancialTransactionMutation) OldComment

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

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

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

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

func (m *FinancialTransactionMutation) 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 (*FinancialTransactionMutation) OldInvoiceID

func (m *FinancialTransactionMutation) OldInvoiceID(ctx context.Context) (v uuid.UUID, err error)

OldInvoiceID returns the old "invoice_id" field's value of the FinancialTransaction entity. If the FinancialTransaction 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 (*FinancialTransactionMutation) OldIsInternal

func (m *FinancialTransactionMutation) OldIsInternal(ctx context.Context) (v bool, err error)

OldIsInternal returns the old "is_internal" field's value of the FinancialTransaction entity. If the FinancialTransaction 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 (*FinancialTransactionMutation) OldPaymentMethod

OldPaymentMethod returns the old "payment_method" field's value of the FinancialTransaction entity. If the FinancialTransaction 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 (*FinancialTransactionMutation) OldUpdatedAt

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

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

Op returns the operation name.

func (*FinancialTransactionMutation) PaymentMethod

PaymentMethod returns the value of the "payment_method" field in the mutation.

func (*FinancialTransactionMutation) RemovedEdges

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

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

func (*FinancialTransactionMutation) RemovedIDs

func (m *FinancialTransactionMutation) 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 (*FinancialTransactionMutation) ResetAmount

func (m *FinancialTransactionMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*FinancialTransactionMutation) ResetComment

func (m *FinancialTransactionMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*FinancialTransactionMutation) ResetCreatedAt

func (m *FinancialTransactionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FinancialTransactionMutation) ResetEdge

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

func (m *FinancialTransactionMutation) 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 (*FinancialTransactionMutation) ResetInvoice

func (m *FinancialTransactionMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*FinancialTransactionMutation) ResetInvoiceID

func (m *FinancialTransactionMutation) ResetInvoiceID()

ResetInvoiceID resets all changes to the "invoice_id" field.

func (*FinancialTransactionMutation) ResetIsInternal

func (m *FinancialTransactionMutation) ResetIsInternal()

ResetIsInternal resets all changes to the "is_internal" field.

func (*FinancialTransactionMutation) ResetPaymentMethod

func (m *FinancialTransactionMutation) ResetPaymentMethod()

ResetPaymentMethod resets all changes to the "payment_method" field.

func (*FinancialTransactionMutation) ResetUpdatedAt

func (m *FinancialTransactionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FinancialTransactionMutation) SetAmount

SetAmount sets the "amount" field.

func (*FinancialTransactionMutation) SetComment

func (m *FinancialTransactionMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*FinancialTransactionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FinancialTransactionMutation) SetField

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

func (m *FinancialTransactionMutation) SetID(id uuid.UUID)

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

func (*FinancialTransactionMutation) SetInvoiceID

func (m *FinancialTransactionMutation) SetInvoiceID(u uuid.UUID)

SetInvoiceID sets the "invoice_id" field.

func (*FinancialTransactionMutation) SetIsInternal

func (m *FinancialTransactionMutation) SetIsInternal(b bool)

SetIsInternal sets the "is_internal" field.

func (*FinancialTransactionMutation) SetOp

func (m *FinancialTransactionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FinancialTransactionMutation) SetPaymentMethod

SetPaymentMethod sets the "payment_method" field.

func (*FinancialTransactionMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (FinancialTransactionMutation) Tx

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

func (*FinancialTransactionMutation) Type

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

func (*FinancialTransactionMutation) UpdatedAt

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

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

func (*FinancialTransactionMutation) Where

Where appends a list predicates to the FinancialTransactionMutation builder.

func (*FinancialTransactionMutation) WhereP

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

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

type FinancialTransactionQuery

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

FinancialTransactionQuery is the builder for querying FinancialTransaction entities.

func (*FinancialTransactionQuery) Aggregate

Aggregate returns a FinancialTransactionSelect configured with the given aggregations.

func (*FinancialTransactionQuery) All

All executes the query and returns a list of FinancialTransactions.

func (*FinancialTransactionQuery) AllX

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

func (*FinancialTransactionQuery) Clone

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

func (*FinancialTransactionQuery) Count

func (ftq *FinancialTransactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FinancialTransactionQuery) CountX

func (ftq *FinancialTransactionQuery) CountX(ctx context.Context) int

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

func (*FinancialTransactionQuery) Exist

func (ftq *FinancialTransactionQuery) Exist(ctx context.Context) (bool, error)

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

func (*FinancialTransactionQuery) ExistX

func (ftq *FinancialTransactionQuery) ExistX(ctx context.Context) bool

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

func (*FinancialTransactionQuery) First

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

func (*FinancialTransactionQuery) FirstID

func (ftq *FinancialTransactionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FinancialTransactionQuery) FirstIDX

func (ftq *FinancialTransactionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*FinancialTransactionQuery) FirstX

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

func (*FinancialTransactionQuery) GroupBy

func (ftq *FinancialTransactionQuery) GroupBy(field string, fields ...string) *FinancialTransactionGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.FinancialTransaction.Query().
	GroupBy(financialtransaction.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FinancialTransactionQuery) IDs

func (ftq *FinancialTransactionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*FinancialTransactionQuery) IDsX

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

func (*FinancialTransactionQuery) Limit

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

func (*FinancialTransactionQuery) Offset

Offset to start from.

func (*FinancialTransactionQuery) Only

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

func (*FinancialTransactionQuery) OnlyID

func (ftq *FinancialTransactionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*FinancialTransactionQuery) OnlyIDX

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

func (*FinancialTransactionQuery) OnlyX

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

func (*FinancialTransactionQuery) Order

Order specifies how the records should be ordered.

func (*FinancialTransactionQuery) QueryInvoice

func (ftq *FinancialTransactionQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*FinancialTransactionQuery) 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.FinancialTransaction.Query().
	Select(financialtransaction.FieldCreatedAt).
	Scan(ctx, &v)

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

Where adds a new predicate for the FinancialTransactionQuery builder.

func (*FinancialTransactionQuery) WithInvoice

func (ftq *FinancialTransactionQuery) WithInvoice(opts ...func(*InvoiceQuery)) *FinancialTransactionQuery

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

type FinancialTransactionSelect

type FinancialTransactionSelect struct {
	*FinancialTransactionQuery
	// contains filtered or unexported fields
}

FinancialTransactionSelect is the builder for selecting fields of FinancialTransaction entities.

func (*FinancialTransactionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*FinancialTransactionSelect) Bool

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

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

func (*FinancialTransactionSelect) BoolX

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

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

func (*FinancialTransactionSelect) Bools

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

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

func (*FinancialTransactionSelect) BoolsX

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

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

func (*FinancialTransactionSelect) Float64

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

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

func (*FinancialTransactionSelect) Float64X

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

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

func (*FinancialTransactionSelect) Float64s

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

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

func (*FinancialTransactionSelect) Float64sX

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

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

func (*FinancialTransactionSelect) Int

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

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

func (*FinancialTransactionSelect) IntX

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

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

func (*FinancialTransactionSelect) Ints

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

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

func (*FinancialTransactionSelect) IntsX

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

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

func (*FinancialTransactionSelect) Scan

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

func (*FinancialTransactionSelect) ScanX

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

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

func (*FinancialTransactionSelect) String

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

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

func (*FinancialTransactionSelect) StringX

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

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

func (*FinancialTransactionSelect) Strings

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

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

func (*FinancialTransactionSelect) StringsX

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

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

type FinancialTransactionUpdate

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

FinancialTransactionUpdate is the builder for updating FinancialTransaction entities.

func (*FinancialTransactionUpdate) ClearComment

ClearComment clears the value of the "comment" field.

func (*FinancialTransactionUpdate) Exec

Exec executes the query.

func (*FinancialTransactionUpdate) ExecX

func (ftu *FinancialTransactionUpdate) ExecX(ctx context.Context)

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

func (*FinancialTransactionUpdate) Mutation

Mutation returns the FinancialTransactionMutation object of the builder.

func (*FinancialTransactionUpdate) Save

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

func (*FinancialTransactionUpdate) SaveX

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

func (*FinancialTransactionUpdate) SetComment

SetComment sets the "comment" field.

func (*FinancialTransactionUpdate) SetNillableComment

func (ftu *FinancialTransactionUpdate) SetNillableComment(s *string) *FinancialTransactionUpdate

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

func (*FinancialTransactionUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialTransactionUpdate) Where

Where appends a list predicates to the FinancialTransactionUpdate builder.

type FinancialTransactionUpdateOne

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

FinancialTransactionUpdateOne is the builder for updating a single FinancialTransaction entity.

func (*FinancialTransactionUpdateOne) ClearComment

ClearComment clears the value of the "comment" field.

func (*FinancialTransactionUpdateOne) Exec

Exec executes the query on the entity.

func (*FinancialTransactionUpdateOne) ExecX

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

func (*FinancialTransactionUpdateOne) Mutation

Mutation returns the FinancialTransactionMutation object of the builder.

func (*FinancialTransactionUpdateOne) Save

Save executes the query and returns the updated FinancialTransaction entity.

func (*FinancialTransactionUpdateOne) SaveX

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

func (*FinancialTransactionUpdateOne) 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 (*FinancialTransactionUpdateOne) SetComment

SetComment sets the "comment" field.

func (*FinancialTransactionUpdateOne) SetNillableComment

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

func (*FinancialTransactionUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*FinancialTransactionUpdateOne) Where

Where appends a list predicates to the FinancialTransactionUpdate builder.

type FinancialTransactions

type FinancialTransactions []*FinancialTransaction

FinancialTransactions is a parsable slice of FinancialTransaction.

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 Invoice

type Invoice struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// Total holds the value of the "total" field.
	Total decimal.Decimal `json:"total,omitempty"`
	// Comment holds the value of the "comment" field.
	Comment *string `json:"comment,omitempty"`
	// Note holds the value of the "note" field.
	Note *string `json:"note,omitempty"`
	// Type holds the value of the "type" field.
	Type invoice.Type `json:"type,omitempty"`
	// Status holds the value of the "status" field.
	Status invoice.Status `json:"status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InvoiceQuery when eager-loading is set.
	Edges InvoiceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Invoice is the model entity for the Invoice schema.

func (*Invoice) QueryOrder

func (i *Invoice) QueryOrder() *OrderQuery

QueryOrder queries the "order" edge of the Invoice entity.

func (*Invoice) String

func (i *Invoice) String() string

String implements the fmt.Stringer.

func (*Invoice) Unwrap

func (i *Invoice) Unwrap() *Invoice

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

func (i *Invoice) Update() *InvoiceUpdateOne

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

func (*Invoice) Value

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

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

type InvoiceClient

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

InvoiceClient is a client for the Invoice schema.

func NewInvoiceClient

func NewInvoiceClient(c config) *InvoiceClient

NewInvoiceClient returns a client for the Invoice from the given config.

func (*InvoiceClient) Create

func (c *InvoiceClient) Create() *InvoiceCreate

Create returns a builder for creating a Invoice entity.

func (*InvoiceClient) CreateBulk

func (c *InvoiceClient) CreateBulk(builders ...*InvoiceCreate) *InvoiceCreateBulk

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

func (*InvoiceClient) Delete

func (c *InvoiceClient) Delete() *InvoiceDelete

Delete returns a delete builder for Invoice.

func (*InvoiceClient) DeleteOne

func (c *InvoiceClient) DeleteOne(i *Invoice) *InvoiceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvoiceClient) DeleteOneID

func (c *InvoiceClient) DeleteOneID(id uuid.UUID) *InvoiceDeleteOne

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

func (*InvoiceClient) Get

func (c *InvoiceClient) Get(ctx context.Context, id uuid.UUID) (*Invoice, error)

Get returns a Invoice entity by its id.

func (*InvoiceClient) GetX

func (c *InvoiceClient) GetX(ctx context.Context, id uuid.UUID) *Invoice

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

func (*InvoiceClient) Hooks

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

Hooks returns the client hooks.

func (*InvoiceClient) Intercept

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

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

func (*InvoiceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InvoiceClient) MapCreateBulk

func (c *InvoiceClient) MapCreateBulk(slice any, setFunc func(*InvoiceCreate, int)) *InvoiceCreateBulk

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

func (c *InvoiceClient) Query() *InvoiceQuery

Query returns a query builder for Invoice.

func (*InvoiceClient) QueryOrder

func (c *InvoiceClient) QueryOrder(i *Invoice) *OrderQuery

QueryOrder queries the order edge of a Invoice.

func (*InvoiceClient) Update

func (c *InvoiceClient) Update() *InvoiceUpdate

Update returns an update builder for Invoice.

func (*InvoiceClient) UpdateOne

func (c *InvoiceClient) UpdateOne(i *Invoice) *InvoiceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvoiceClient) UpdateOneID

func (c *InvoiceClient) UpdateOneID(id uuid.UUID) *InvoiceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InvoiceClient) Use

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

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

type InvoiceCreate

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

InvoiceCreate is the builder for creating a Invoice entity.

func (*InvoiceCreate) Exec

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

Exec executes the query.

func (*InvoiceCreate) ExecX

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

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

func (*InvoiceCreate) Mutation

func (ic *InvoiceCreate) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

func (*InvoiceCreate) Save

func (ic *InvoiceCreate) Save(ctx context.Context) (*Invoice, error)

Save creates the Invoice in the database.

func (*InvoiceCreate) SaveX

func (ic *InvoiceCreate) SaveX(ctx context.Context) *Invoice

SaveX calls Save and panics if Save returns an error.

func (*InvoiceCreate) SetComment

func (ic *InvoiceCreate) SetComment(s string) *InvoiceCreate

SetComment sets the "comment" field.

func (*InvoiceCreate) SetCreatedAt

func (ic *InvoiceCreate) SetCreatedAt(t time.Time) *InvoiceCreate

SetCreatedAt sets the "created_at" field.

func (*InvoiceCreate) SetID

func (ic *InvoiceCreate) SetID(u uuid.UUID) *InvoiceCreate

SetID sets the "id" field.

func (*InvoiceCreate) SetNillableComment

func (ic *InvoiceCreate) SetNillableComment(s *string) *InvoiceCreate

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

func (*InvoiceCreate) SetNillableCreatedAt

func (ic *InvoiceCreate) SetNillableCreatedAt(t *time.Time) *InvoiceCreate

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

func (*InvoiceCreate) SetNillableID

func (ic *InvoiceCreate) SetNillableID(u *uuid.UUID) *InvoiceCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*InvoiceCreate) SetNillableNote

func (ic *InvoiceCreate) SetNillableNote(s *string) *InvoiceCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*InvoiceCreate) SetNillableStatus

func (ic *InvoiceCreate) SetNillableStatus(i *invoice.Status) *InvoiceCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceCreate) SetNillableType

func (ic *InvoiceCreate) SetNillableType(i *invoice.Type) *InvoiceCreate

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

func (*InvoiceCreate) SetNillableUpdatedAt

func (ic *InvoiceCreate) SetNillableUpdatedAt(t *time.Time) *InvoiceCreate

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

func (*InvoiceCreate) SetNote

func (ic *InvoiceCreate) SetNote(s string) *InvoiceCreate

SetNote sets the "note" field.

func (*InvoiceCreate) SetOrder

func (ic *InvoiceCreate) SetOrder(o *Order) *InvoiceCreate

SetOrder sets the "order" edge to the Order entity.

func (*InvoiceCreate) SetOrderID

func (ic *InvoiceCreate) SetOrderID(u uuid.UUID) *InvoiceCreate

SetOrderID sets the "order_id" field.

func (*InvoiceCreate) SetStatus

func (ic *InvoiceCreate) SetStatus(i invoice.Status) *InvoiceCreate

SetStatus sets the "status" field.

func (*InvoiceCreate) SetTotal

func (ic *InvoiceCreate) SetTotal(d decimal.Decimal) *InvoiceCreate

SetTotal sets the "total" field.

func (*InvoiceCreate) SetType

func (ic *InvoiceCreate) SetType(i invoice.Type) *InvoiceCreate

SetType sets the "type" field.

func (*InvoiceCreate) SetUpdatedAt

func (ic *InvoiceCreate) SetUpdatedAt(t time.Time) *InvoiceCreate

SetUpdatedAt sets the "updated_at" field.

type InvoiceCreateBulk

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

InvoiceCreateBulk is the builder for creating many Invoice entities in bulk.

func (*InvoiceCreateBulk) Exec

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

Exec executes the query.

func (*InvoiceCreateBulk) ExecX

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

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

func (*InvoiceCreateBulk) Save

func (icb *InvoiceCreateBulk) Save(ctx context.Context) ([]*Invoice, error)

Save creates the Invoice entities in the database.

func (*InvoiceCreateBulk) SaveX

func (icb *InvoiceCreateBulk) SaveX(ctx context.Context) []*Invoice

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

type InvoiceDelete

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

InvoiceDelete is the builder for deleting a Invoice entity.

func (*InvoiceDelete) Exec

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

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

func (*InvoiceDelete) ExecX

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

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

func (*InvoiceDelete) Where

func (id *InvoiceDelete) Where(ps ...predicate.Invoice) *InvoiceDelete

Where appends a list predicates to the InvoiceDelete builder.

type InvoiceDeleteOne

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

InvoiceDeleteOne is the builder for deleting a single Invoice entity.

func (*InvoiceDeleteOne) Exec

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

Exec executes the deletion query.

func (*InvoiceDeleteOne) ExecX

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

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

func (*InvoiceDeleteOne) Where

Where appends a list predicates to the InvoiceDelete builder.

type InvoiceEdges

type InvoiceEdges struct {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvoiceEdges) OrderOrErr

func (e InvoiceEdges) OrderOrErr() (*Order, error)

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

type InvoiceGroupBy

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

InvoiceGroupBy is the group-by builder for Invoice entities.

func (*InvoiceGroupBy) Aggregate

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

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

func (*InvoiceGroupBy) Bool

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

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

func (*InvoiceGroupBy) BoolX

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

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

func (*InvoiceGroupBy) Bools

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

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

func (*InvoiceGroupBy) BoolsX

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

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

func (*InvoiceGroupBy) Float64

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

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

func (*InvoiceGroupBy) Float64X

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

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

func (*InvoiceGroupBy) Float64s

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

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

func (*InvoiceGroupBy) Float64sX

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

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

func (*InvoiceGroupBy) Int

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

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

func (*InvoiceGroupBy) IntX

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

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

func (*InvoiceGroupBy) Ints

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

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

func (*InvoiceGroupBy) IntsX

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

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

func (*InvoiceGroupBy) Scan

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

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

func (*InvoiceGroupBy) ScanX

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

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

func (*InvoiceGroupBy) String

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

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

func (*InvoiceGroupBy) StringX

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

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

func (*InvoiceGroupBy) Strings

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

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

func (*InvoiceGroupBy) StringsX

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

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

type InvoiceLineItem

type InvoiceLineItem struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// InvoiceID holds the value of the "invoice_id" field.
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
	// OrderLineItemID holds the value of the "order_line_item_id" field.
	OrderLineItemID uuid.UUID `json:"order_line_item_id,omitempty"`
	// Qty holds the value of the "qty" field.
	Qty decimal.Decimal `json:"qty,omitempty"`
	// Total holds the value of the "total" field.
	Total decimal.Decimal `json:"total,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 InvoiceLineItemQuery when eager-loading is set.
	Edges InvoiceLineItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

InvoiceLineItem is the model entity for the InvoiceLineItem schema.

func (*InvoiceLineItem) QueryInvoice

func (ili *InvoiceLineItem) QueryInvoice() *InvoiceQuery

QueryInvoice queries the "invoice" edge of the InvoiceLineItem entity.

func (*InvoiceLineItem) QueryOrderLineItem

func (ili *InvoiceLineItem) QueryOrderLineItem() *OrderLineItemQuery

QueryOrderLineItem queries the "order_line_item" edge of the InvoiceLineItem entity.

func (*InvoiceLineItem) String

func (ili *InvoiceLineItem) String() string

String implements the fmt.Stringer.

func (*InvoiceLineItem) Unwrap

func (ili *InvoiceLineItem) Unwrap() *InvoiceLineItem

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

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

func (*InvoiceLineItem) Value

func (ili *InvoiceLineItem) Value(name string) (ent.Value, error)

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

type InvoiceLineItemClient

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

InvoiceLineItemClient is a client for the InvoiceLineItem schema.

func NewInvoiceLineItemClient

func NewInvoiceLineItemClient(c config) *InvoiceLineItemClient

NewInvoiceLineItemClient returns a client for the InvoiceLineItem from the given config.

func (*InvoiceLineItemClient) Create

Create returns a builder for creating a InvoiceLineItem entity.

func (*InvoiceLineItemClient) CreateBulk

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

func (*InvoiceLineItemClient) Delete

Delete returns a delete builder for InvoiceLineItem.

func (*InvoiceLineItemClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InvoiceLineItemClient) DeleteOneID

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

func (*InvoiceLineItemClient) Get

Get returns a InvoiceLineItem entity by its id.

func (*InvoiceLineItemClient) GetX

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

func (*InvoiceLineItemClient) Hooks

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

Hooks returns the client hooks.

func (*InvoiceLineItemClient) Intercept

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

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

func (*InvoiceLineItemClient) Interceptors

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

Interceptors returns the client interceptors.

func (*InvoiceLineItemClient) MapCreateBulk

func (c *InvoiceLineItemClient) MapCreateBulk(slice any, setFunc func(*InvoiceLineItemCreate, int)) *InvoiceLineItemCreateBulk

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

Query returns a query builder for InvoiceLineItem.

func (*InvoiceLineItemClient) QueryInvoice

func (c *InvoiceLineItemClient) QueryInvoice(ili *InvoiceLineItem) *InvoiceQuery

QueryInvoice queries the invoice edge of a InvoiceLineItem.

func (*InvoiceLineItemClient) QueryOrderLineItem

func (c *InvoiceLineItemClient) QueryOrderLineItem(ili *InvoiceLineItem) *OrderLineItemQuery

QueryOrderLineItem queries the order_line_item edge of a InvoiceLineItem.

func (*InvoiceLineItemClient) Update

Update returns an update builder for InvoiceLineItem.

func (*InvoiceLineItemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InvoiceLineItemClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InvoiceLineItemClient) Use

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

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

type InvoiceLineItemCreate

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

InvoiceLineItemCreate is the builder for creating a InvoiceLineItem entity.

func (*InvoiceLineItemCreate) Exec

func (ilic *InvoiceLineItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceLineItemCreate) ExecX

func (ilic *InvoiceLineItemCreate) ExecX(ctx context.Context)

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

func (*InvoiceLineItemCreate) Mutation

Mutation returns the InvoiceLineItemMutation object of the builder.

func (*InvoiceLineItemCreate) Save

Save creates the InvoiceLineItem in the database.

func (*InvoiceLineItemCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InvoiceLineItemCreate) SetCreatedAt

func (ilic *InvoiceLineItemCreate) SetCreatedAt(t time.Time) *InvoiceLineItemCreate

SetCreatedAt sets the "created_at" field.

func (*InvoiceLineItemCreate) SetID

SetID sets the "id" field.

func (*InvoiceLineItemCreate) SetInvoice

func (ilic *InvoiceLineItemCreate) SetInvoice(i *Invoice) *InvoiceLineItemCreate

SetInvoice sets the "invoice" edge to the Invoice entity.

func (*InvoiceLineItemCreate) SetInvoiceID

func (ilic *InvoiceLineItemCreate) SetInvoiceID(u uuid.UUID) *InvoiceLineItemCreate

SetInvoiceID sets the "invoice_id" field.

func (*InvoiceLineItemCreate) SetNillableCreatedAt

func (ilic *InvoiceLineItemCreate) SetNillableCreatedAt(t *time.Time) *InvoiceLineItemCreate

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

func (*InvoiceLineItemCreate) SetNillableID

func (ilic *InvoiceLineItemCreate) SetNillableID(u *uuid.UUID) *InvoiceLineItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*InvoiceLineItemCreate) SetOrderLineItem

func (ilic *InvoiceLineItemCreate) SetOrderLineItem(o *OrderLineItem) *InvoiceLineItemCreate

SetOrderLineItem sets the "order_line_item" edge to the OrderLineItem entity.

func (*InvoiceLineItemCreate) SetOrderLineItemID

func (ilic *InvoiceLineItemCreate) SetOrderLineItemID(u uuid.UUID) *InvoiceLineItemCreate

SetOrderLineItemID sets the "order_line_item_id" field.

func (*InvoiceLineItemCreate) SetQty

SetQty sets the "qty" field.

func (*InvoiceLineItemCreate) SetTotal

SetTotal sets the "total" field.

type InvoiceLineItemCreateBulk

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

InvoiceLineItemCreateBulk is the builder for creating many InvoiceLineItem entities in bulk.

func (*InvoiceLineItemCreateBulk) Exec

Exec executes the query.

func (*InvoiceLineItemCreateBulk) ExecX

func (ilicb *InvoiceLineItemCreateBulk) ExecX(ctx context.Context)

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

func (*InvoiceLineItemCreateBulk) Save

Save creates the InvoiceLineItem entities in the database.

func (*InvoiceLineItemCreateBulk) SaveX

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

type InvoiceLineItemDelete

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

InvoiceLineItemDelete is the builder for deleting a InvoiceLineItem entity.

func (*InvoiceLineItemDelete) Exec

func (ilid *InvoiceLineItemDelete) Exec(ctx context.Context) (int, error)

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

func (*InvoiceLineItemDelete) ExecX

func (ilid *InvoiceLineItemDelete) ExecX(ctx context.Context) int

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

func (*InvoiceLineItemDelete) Where

Where appends a list predicates to the InvoiceLineItemDelete builder.

type InvoiceLineItemDeleteOne

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

InvoiceLineItemDeleteOne is the builder for deleting a single InvoiceLineItem entity.

func (*InvoiceLineItemDeleteOne) Exec

func (ilido *InvoiceLineItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InvoiceLineItemDeleteOne) ExecX

func (ilido *InvoiceLineItemDeleteOne) ExecX(ctx context.Context)

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

func (*InvoiceLineItemDeleteOne) Where

Where appends a list predicates to the InvoiceLineItemDelete builder.

type InvoiceLineItemEdges

type InvoiceLineItemEdges struct {
	// Invoice holds the value of the invoice edge.
	Invoice *Invoice `json:"invoice,omitempty"`
	// OrderLineItem holds the value of the order_line_item edge.
	OrderLineItem *OrderLineItem `json:"order_line_item,omitempty"`
	// contains filtered or unexported fields
}

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

func (InvoiceLineItemEdges) InvoiceOrErr

func (e InvoiceLineItemEdges) InvoiceOrErr() (*Invoice, error)

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

func (InvoiceLineItemEdges) OrderLineItemOrErr

func (e InvoiceLineItemEdges) OrderLineItemOrErr() (*OrderLineItem, error)

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

type InvoiceLineItemGroupBy

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

InvoiceLineItemGroupBy is the group-by builder for InvoiceLineItem entities.

func (*InvoiceLineItemGroupBy) Aggregate

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

func (*InvoiceLineItemGroupBy) Bool

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

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

func (*InvoiceLineItemGroupBy) BoolX

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

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

func (*InvoiceLineItemGroupBy) Bools

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

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

func (*InvoiceLineItemGroupBy) BoolsX

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

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

func (*InvoiceLineItemGroupBy) Float64

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

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

func (*InvoiceLineItemGroupBy) Float64X

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

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

func (*InvoiceLineItemGroupBy) Float64s

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

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

func (*InvoiceLineItemGroupBy) Float64sX

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

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

func (*InvoiceLineItemGroupBy) Int

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

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

func (*InvoiceLineItemGroupBy) IntX

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

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

func (*InvoiceLineItemGroupBy) Ints

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

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

func (*InvoiceLineItemGroupBy) IntsX

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

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

func (*InvoiceLineItemGroupBy) Scan

func (iligb *InvoiceLineItemGroupBy) Scan(ctx context.Context, v any) error

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

func (*InvoiceLineItemGroupBy) ScanX

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

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

func (*InvoiceLineItemGroupBy) String

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

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

func (*InvoiceLineItemGroupBy) StringX

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

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

func (*InvoiceLineItemGroupBy) Strings

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

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

func (*InvoiceLineItemGroupBy) StringsX

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

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

type InvoiceLineItemMutation

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

InvoiceLineItemMutation represents an operation that mutates the InvoiceLineItem nodes in the graph.

func (*InvoiceLineItemMutation) AddField

func (m *InvoiceLineItemMutation) 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 (*InvoiceLineItemMutation) AddQty

AddQty adds d to the "qty" field.

func (*InvoiceLineItemMutation) AddTotal

func (m *InvoiceLineItemMutation) AddTotal(d decimal.Decimal)

AddTotal adds d to the "total" field.

func (*InvoiceLineItemMutation) AddedEdges

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

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

func (*InvoiceLineItemMutation) AddedField

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

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

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

func (*InvoiceLineItemMutation) AddedIDs

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

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

func (*InvoiceLineItemMutation) AddedQty

func (m *InvoiceLineItemMutation) AddedQty() (r decimal.Decimal, exists bool)

AddedQty returns the value that was added to the "qty" field in this mutation.

func (*InvoiceLineItemMutation) AddedTotal

func (m *InvoiceLineItemMutation) AddedTotal() (r decimal.Decimal, exists bool)

AddedTotal returns the value that was added to the "total" field in this mutation.

func (*InvoiceLineItemMutation) ClearEdge

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

func (m *InvoiceLineItemMutation) 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 (*InvoiceLineItemMutation) ClearInvoice

func (m *InvoiceLineItemMutation) ClearInvoice()

ClearInvoice clears the "invoice" edge to the Invoice entity.

func (*InvoiceLineItemMutation) ClearOrderLineItem

func (m *InvoiceLineItemMutation) ClearOrderLineItem()

ClearOrderLineItem clears the "order_line_item" edge to the OrderLineItem entity.

func (*InvoiceLineItemMutation) ClearedEdges

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

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

func (*InvoiceLineItemMutation) ClearedFields

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

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

func (InvoiceLineItemMutation) Client

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

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

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

func (*InvoiceLineItemMutation) EdgeCleared

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

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

func (*InvoiceLineItemMutation) Field

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

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

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

func (*InvoiceLineItemMutation) Fields

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

func (m *InvoiceLineItemMutation) ID() (id uuid.UUID, 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 (*InvoiceLineItemMutation) 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 (*InvoiceLineItemMutation) InvoiceCleared

func (m *InvoiceLineItemMutation) InvoiceCleared() bool

InvoiceCleared reports if the "invoice" edge to the Invoice entity was cleared.

func (*InvoiceLineItemMutation) InvoiceID

func (m *InvoiceLineItemMutation) InvoiceID() (r uuid.UUID, exists bool)

InvoiceID returns the value of the "invoice_id" field in the mutation.

func (*InvoiceLineItemMutation) InvoiceIDs

func (m *InvoiceLineItemMutation) InvoiceIDs() (ids []uuid.UUID)

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

func (*InvoiceLineItemMutation) OldCreatedAt

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

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

func (m *InvoiceLineItemMutation) 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 (*InvoiceLineItemMutation) OldInvoiceID

func (m *InvoiceLineItemMutation) OldInvoiceID(ctx context.Context) (v uuid.UUID, err error)

OldInvoiceID returns the old "invoice_id" field's value of the InvoiceLineItem entity. If the InvoiceLineItem 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 (*InvoiceLineItemMutation) OldOrderLineItemID

func (m *InvoiceLineItemMutation) OldOrderLineItemID(ctx context.Context) (v uuid.UUID, err error)

OldOrderLineItemID returns the old "order_line_item_id" field's value of the InvoiceLineItem entity. If the InvoiceLineItem 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 (*InvoiceLineItemMutation) OldQty

func (m *InvoiceLineItemMutation) OldQty(ctx context.Context) (v decimal.Decimal, err error)

OldQty returns the old "qty" field's value of the InvoiceLineItem entity. If the InvoiceLineItem 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 (*InvoiceLineItemMutation) OldTotal

func (m *InvoiceLineItemMutation) OldTotal(ctx context.Context) (v decimal.Decimal, err error)

OldTotal returns the old "total" field's value of the InvoiceLineItem entity. If the InvoiceLineItem 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 (*InvoiceLineItemMutation) Op

func (m *InvoiceLineItemMutation) Op() Op

Op returns the operation name.

func (*InvoiceLineItemMutation) OrderLineItemCleared

func (m *InvoiceLineItemMutation) OrderLineItemCleared() bool

OrderLineItemCleared reports if the "order_line_item" edge to the OrderLineItem entity was cleared.

func (*InvoiceLineItemMutation) OrderLineItemID

func (m *InvoiceLineItemMutation) OrderLineItemID() (r uuid.UUID, exists bool)

OrderLineItemID returns the value of the "order_line_item_id" field in the mutation.

func (*InvoiceLineItemMutation) OrderLineItemIDs

func (m *InvoiceLineItemMutation) OrderLineItemIDs() (ids []uuid.UUID)

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

func (*InvoiceLineItemMutation) Qty

func (m *InvoiceLineItemMutation) Qty() (r decimal.Decimal, exists bool)

Qty returns the value of the "qty" field in the mutation.

func (*InvoiceLineItemMutation) RemovedEdges

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

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

func (*InvoiceLineItemMutation) RemovedIDs

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

func (m *InvoiceLineItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InvoiceLineItemMutation) ResetEdge

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

func (m *InvoiceLineItemMutation) 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 (*InvoiceLineItemMutation) ResetInvoice

func (m *InvoiceLineItemMutation) ResetInvoice()

ResetInvoice resets all changes to the "invoice" edge.

func (*InvoiceLineItemMutation) ResetInvoiceID

func (m *InvoiceLineItemMutation) ResetInvoiceID()

ResetInvoiceID resets all changes to the "invoice_id" field.

func (*InvoiceLineItemMutation) ResetOrderLineItem

func (m *InvoiceLineItemMutation) ResetOrderLineItem()

ResetOrderLineItem resets all changes to the "order_line_item" edge.

func (*InvoiceLineItemMutation) ResetOrderLineItemID

func (m *InvoiceLineItemMutation) ResetOrderLineItemID()

ResetOrderLineItemID resets all changes to the "order_line_item_id" field.

func (*InvoiceLineItemMutation) ResetQty

func (m *InvoiceLineItemMutation) ResetQty()

ResetQty resets all changes to the "qty" field.

func (*InvoiceLineItemMutation) ResetTotal

func (m *InvoiceLineItemMutation) ResetTotal()

ResetTotal resets all changes to the "total" field.

func (*InvoiceLineItemMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*InvoiceLineItemMutation) SetField

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

func (m *InvoiceLineItemMutation) SetID(id uuid.UUID)

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

func (*InvoiceLineItemMutation) SetInvoiceID

func (m *InvoiceLineItemMutation) SetInvoiceID(u uuid.UUID)

SetInvoiceID sets the "invoice_id" field.

func (*InvoiceLineItemMutation) SetOp

func (m *InvoiceLineItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceLineItemMutation) SetOrderLineItemID

func (m *InvoiceLineItemMutation) SetOrderLineItemID(u uuid.UUID)

SetOrderLineItemID sets the "order_line_item_id" field.

func (*InvoiceLineItemMutation) SetQty

SetQty sets the "qty" field.

func (*InvoiceLineItemMutation) SetTotal

func (m *InvoiceLineItemMutation) SetTotal(d decimal.Decimal)

SetTotal sets the "total" field.

func (*InvoiceLineItemMutation) Total

func (m *InvoiceLineItemMutation) Total() (r decimal.Decimal, exists bool)

Total returns the value of the "total" field in the mutation.

func (InvoiceLineItemMutation) Tx

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

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

func (*InvoiceLineItemMutation) Type

func (m *InvoiceLineItemMutation) Type() string

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

func (*InvoiceLineItemMutation) Where

Where appends a list predicates to the InvoiceLineItemMutation builder.

func (*InvoiceLineItemMutation) WhereP

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

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

type InvoiceLineItemQuery

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

InvoiceLineItemQuery is the builder for querying InvoiceLineItem entities.

func (*InvoiceLineItemQuery) Aggregate

func (iliq *InvoiceLineItemQuery) Aggregate(fns ...AggregateFunc) *InvoiceLineItemSelect

Aggregate returns a InvoiceLineItemSelect configured with the given aggregations.

func (*InvoiceLineItemQuery) All

All executes the query and returns a list of InvoiceLineItems.

func (*InvoiceLineItemQuery) AllX

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

func (*InvoiceLineItemQuery) Clone

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

func (*InvoiceLineItemQuery) Count

func (iliq *InvoiceLineItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InvoiceLineItemQuery) CountX

func (iliq *InvoiceLineItemQuery) CountX(ctx context.Context) int

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

func (*InvoiceLineItemQuery) Exist

func (iliq *InvoiceLineItemQuery) Exist(ctx context.Context) (bool, error)

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

func (*InvoiceLineItemQuery) ExistX

func (iliq *InvoiceLineItemQuery) ExistX(ctx context.Context) bool

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

func (*InvoiceLineItemQuery) First

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

func (*InvoiceLineItemQuery) FirstID

func (iliq *InvoiceLineItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceLineItemQuery) FirstIDX

func (iliq *InvoiceLineItemQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceLineItemQuery) FirstX

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

func (*InvoiceLineItemQuery) GroupBy

func (iliq *InvoiceLineItemQuery) GroupBy(field string, fields ...string) *InvoiceLineItemGroupBy

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 {
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.InvoiceLineItem.Query().
	GroupBy(invoicelineitem.FieldInvoiceID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceLineItemQuery) IDs

func (iliq *InvoiceLineItemQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*InvoiceLineItemQuery) IDsX

func (iliq *InvoiceLineItemQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*InvoiceLineItemQuery) Limit

func (iliq *InvoiceLineItemQuery) Limit(limit int) *InvoiceLineItemQuery

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

func (*InvoiceLineItemQuery) Offset

func (iliq *InvoiceLineItemQuery) Offset(offset int) *InvoiceLineItemQuery

Offset to start from.

func (*InvoiceLineItemQuery) Only

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

func (*InvoiceLineItemQuery) OnlyID

func (iliq *InvoiceLineItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceLineItemQuery) OnlyIDX

func (iliq *InvoiceLineItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceLineItemQuery) OnlyX

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

func (*InvoiceLineItemQuery) Order

Order specifies how the records should be ordered.

func (*InvoiceLineItemQuery) QueryInvoice

func (iliq *InvoiceLineItemQuery) QueryInvoice() *InvoiceQuery

QueryInvoice chains the current query on the "invoice" edge.

func (*InvoiceLineItemQuery) QueryOrderLineItem

func (iliq *InvoiceLineItemQuery) QueryOrderLineItem() *OrderLineItemQuery

QueryOrderLineItem chains the current query on the "order_line_item" edge.

func (*InvoiceLineItemQuery) Select

func (iliq *InvoiceLineItemQuery) Select(fields ...string) *InvoiceLineItemSelect

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 {
	InvoiceID uuid.UUID `json:"invoice_id,omitempty"`
}

client.InvoiceLineItem.Query().
	Select(invoicelineitem.FieldInvoiceID).
	Scan(ctx, &v)

func (*InvoiceLineItemQuery) Unique

func (iliq *InvoiceLineItemQuery) Unique(unique bool) *InvoiceLineItemQuery

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

Where adds a new predicate for the InvoiceLineItemQuery builder.

func (*InvoiceLineItemQuery) WithInvoice

func (iliq *InvoiceLineItemQuery) WithInvoice(opts ...func(*InvoiceQuery)) *InvoiceLineItemQuery

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

func (*InvoiceLineItemQuery) WithOrderLineItem

func (iliq *InvoiceLineItemQuery) WithOrderLineItem(opts ...func(*OrderLineItemQuery)) *InvoiceLineItemQuery

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

type InvoiceLineItemSelect

type InvoiceLineItemSelect struct {
	*InvoiceLineItemQuery
	// contains filtered or unexported fields
}

InvoiceLineItemSelect is the builder for selecting fields of InvoiceLineItem entities.

func (*InvoiceLineItemSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*InvoiceLineItemSelect) Bool

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

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

func (*InvoiceLineItemSelect) BoolX

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

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

func (*InvoiceLineItemSelect) Bools

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

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

func (*InvoiceLineItemSelect) BoolsX

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

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

func (*InvoiceLineItemSelect) Float64

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

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

func (*InvoiceLineItemSelect) Float64X

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

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

func (*InvoiceLineItemSelect) Float64s

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

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

func (*InvoiceLineItemSelect) Float64sX

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

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

func (*InvoiceLineItemSelect) Int

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

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

func (*InvoiceLineItemSelect) IntX

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

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

func (*InvoiceLineItemSelect) Ints

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

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

func (*InvoiceLineItemSelect) IntsX

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

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

func (*InvoiceLineItemSelect) Scan

func (ilis *InvoiceLineItemSelect) Scan(ctx context.Context, v any) error

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

func (*InvoiceLineItemSelect) ScanX

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

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

func (*InvoiceLineItemSelect) String

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

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

func (*InvoiceLineItemSelect) StringX

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

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

func (*InvoiceLineItemSelect) Strings

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

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

func (*InvoiceLineItemSelect) StringsX

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

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

type InvoiceLineItemUpdate

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

InvoiceLineItemUpdate is the builder for updating InvoiceLineItem entities.

func (*InvoiceLineItemUpdate) Exec

func (iliu *InvoiceLineItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InvoiceLineItemUpdate) ExecX

func (iliu *InvoiceLineItemUpdate) ExecX(ctx context.Context)

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

func (*InvoiceLineItemUpdate) Mutation

Mutation returns the InvoiceLineItemMutation object of the builder.

func (*InvoiceLineItemUpdate) Save

func (iliu *InvoiceLineItemUpdate) Save(ctx context.Context) (int, error)

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

func (*InvoiceLineItemUpdate) SaveX

func (iliu *InvoiceLineItemUpdate) SaveX(ctx context.Context) int

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

func (*InvoiceLineItemUpdate) Where

Where appends a list predicates to the InvoiceLineItemUpdate builder.

type InvoiceLineItemUpdateOne

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

InvoiceLineItemUpdateOne is the builder for updating a single InvoiceLineItem entity.

func (*InvoiceLineItemUpdateOne) Exec

func (iliuo *InvoiceLineItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InvoiceLineItemUpdateOne) ExecX

func (iliuo *InvoiceLineItemUpdateOne) ExecX(ctx context.Context)

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

func (*InvoiceLineItemUpdateOne) Mutation

Mutation returns the InvoiceLineItemMutation object of the builder.

func (*InvoiceLineItemUpdateOne) Save

Save executes the query and returns the updated InvoiceLineItem entity.

func (*InvoiceLineItemUpdateOne) SaveX

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

func (*InvoiceLineItemUpdateOne) Select

func (iliuo *InvoiceLineItemUpdateOne) Select(field string, fields ...string) *InvoiceLineItemUpdateOne

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

func (*InvoiceLineItemUpdateOne) Where

Where appends a list predicates to the InvoiceLineItemUpdate builder.

type InvoiceLineItems

type InvoiceLineItems []*InvoiceLineItem

InvoiceLineItems is a parsable slice of InvoiceLineItem.

type InvoiceMutation

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

InvoiceMutation represents an operation that mutates the Invoice nodes in the graph.

func (*InvoiceMutation) AddField

func (m *InvoiceMutation) 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 (*InvoiceMutation) AddTotal

func (m *InvoiceMutation) AddTotal(d decimal.Decimal)

AddTotal adds d to the "total" field.

func (*InvoiceMutation) AddedEdges

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

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

func (*InvoiceMutation) AddedField

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

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

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

func (*InvoiceMutation) AddedIDs

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

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

func (*InvoiceMutation) AddedTotal

func (m *InvoiceMutation) AddedTotal() (r decimal.Decimal, exists bool)

AddedTotal returns the value that was added to the "total" field in this mutation.

func (*InvoiceMutation) ClearComment

func (m *InvoiceMutation) ClearComment()

ClearComment clears the value of the "comment" field.

func (*InvoiceMutation) ClearEdge

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

func (m *InvoiceMutation) 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 (*InvoiceMutation) ClearNote

func (m *InvoiceMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*InvoiceMutation) ClearOrder

func (m *InvoiceMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

func (*InvoiceMutation) ClearedEdges

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

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

func (*InvoiceMutation) ClearedFields

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

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

func (InvoiceMutation) Client

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

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

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

func (*InvoiceMutation) CommentCleared

func (m *InvoiceMutation) CommentCleared() bool

CommentCleared returns if the "comment" field was cleared in this mutation.

func (*InvoiceMutation) CreatedAt

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

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

func (*InvoiceMutation) EdgeCleared

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

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

func (*InvoiceMutation) Field

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

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

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

func (*InvoiceMutation) Fields

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

func (m *InvoiceMutation) GetType() (r invoice.Type, exists bool)

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

func (*InvoiceMutation) ID

func (m *InvoiceMutation) ID() (id uuid.UUID, 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 (*InvoiceMutation) IDs

func (m *InvoiceMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*InvoiceMutation) Note

func (m *InvoiceMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*InvoiceMutation) NoteCleared

func (m *InvoiceMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*InvoiceMutation) OldComment

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

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

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

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

func (m *InvoiceMutation) 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 (*InvoiceMutation) OldNote

func (m *InvoiceMutation) OldNote(ctx context.Context) (v *string, err error)

OldNote returns the old "note" field's value of the Invoice entity. If the Invoice 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 (*InvoiceMutation) OldOrderID

func (m *InvoiceMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_id" field's value of the Invoice entity. If the Invoice 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 (*InvoiceMutation) OldStatus

func (m *InvoiceMutation) OldStatus(ctx context.Context) (v invoice.Status, err error)

OldStatus returns the old "status" field's value of the Invoice entity. If the Invoice 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 (*InvoiceMutation) OldTotal

func (m *InvoiceMutation) OldTotal(ctx context.Context) (v decimal.Decimal, err error)

OldTotal returns the old "total" field's value of the Invoice entity. If the Invoice 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 (*InvoiceMutation) OldType

func (m *InvoiceMutation) OldType(ctx context.Context) (v invoice.Type, err error)

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

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

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

func (m *InvoiceMutation) Op() Op

Op returns the operation name.

func (*InvoiceMutation) OrderCleared

func (m *InvoiceMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*InvoiceMutation) OrderID

func (m *InvoiceMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*InvoiceMutation) OrderIDs

func (m *InvoiceMutation) OrderIDs() (ids []uuid.UUID)

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

func (*InvoiceMutation) RemovedEdges

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

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

func (*InvoiceMutation) RemovedIDs

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

func (m *InvoiceMutation) ResetComment()

ResetComment resets all changes to the "comment" field.

func (*InvoiceMutation) ResetCreatedAt

func (m *InvoiceMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*InvoiceMutation) ResetEdge

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

func (m *InvoiceMutation) 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 (*InvoiceMutation) ResetNote

func (m *InvoiceMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*InvoiceMutation) ResetOrder

func (m *InvoiceMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*InvoiceMutation) ResetOrderID

func (m *InvoiceMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*InvoiceMutation) ResetStatus

func (m *InvoiceMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*InvoiceMutation) ResetTotal

func (m *InvoiceMutation) ResetTotal()

ResetTotal resets all changes to the "total" field.

func (*InvoiceMutation) ResetType

func (m *InvoiceMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*InvoiceMutation) ResetUpdatedAt

func (m *InvoiceMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*InvoiceMutation) SetComment

func (m *InvoiceMutation) SetComment(s string)

SetComment sets the "comment" field.

func (*InvoiceMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*InvoiceMutation) SetField

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

func (m *InvoiceMutation) SetID(id uuid.UUID)

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

func (*InvoiceMutation) SetNote

func (m *InvoiceMutation) SetNote(s string)

SetNote sets the "note" field.

func (*InvoiceMutation) SetOp

func (m *InvoiceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InvoiceMutation) SetOrderID

func (m *InvoiceMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*InvoiceMutation) SetStatus

func (m *InvoiceMutation) SetStatus(i invoice.Status)

SetStatus sets the "status" field.

func (*InvoiceMutation) SetTotal

func (m *InvoiceMutation) SetTotal(d decimal.Decimal)

SetTotal sets the "total" field.

func (*InvoiceMutation) SetType

func (m *InvoiceMutation) SetType(i invoice.Type)

SetType sets the "type" field.

func (*InvoiceMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceMutation) Status

func (m *InvoiceMutation) Status() (r invoice.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*InvoiceMutation) Total

func (m *InvoiceMutation) Total() (r decimal.Decimal, exists bool)

Total returns the value of the "total" field in the mutation.

func (InvoiceMutation) Tx

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

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

func (*InvoiceMutation) Type

func (m *InvoiceMutation) Type() string

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

func (*InvoiceMutation) UpdatedAt

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

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

func (*InvoiceMutation) Where

func (m *InvoiceMutation) Where(ps ...predicate.Invoice)

Where appends a list predicates to the InvoiceMutation builder.

func (*InvoiceMutation) WhereP

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

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

type InvoiceQuery

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

InvoiceQuery is the builder for querying Invoice entities.

func (*InvoiceQuery) Aggregate

func (iq *InvoiceQuery) Aggregate(fns ...AggregateFunc) *InvoiceSelect

Aggregate returns a InvoiceSelect configured with the given aggregations.

func (*InvoiceQuery) All

func (iq *InvoiceQuery) All(ctx context.Context) ([]*Invoice, error)

All executes the query and returns a list of Invoices.

func (*InvoiceQuery) AllX

func (iq *InvoiceQuery) AllX(ctx context.Context) []*Invoice

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

func (*InvoiceQuery) Clone

func (iq *InvoiceQuery) Clone() *InvoiceQuery

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

func (*InvoiceQuery) Count

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

Count returns the count of the given query.

func (*InvoiceQuery) CountX

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

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

func (*InvoiceQuery) Exist

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

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

func (*InvoiceQuery) ExistX

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

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

func (*InvoiceQuery) First

func (iq *InvoiceQuery) First(ctx context.Context) (*Invoice, error)

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

func (*InvoiceQuery) FirstID

func (iq *InvoiceQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceQuery) FirstIDX

func (iq *InvoiceQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceQuery) FirstX

func (iq *InvoiceQuery) FirstX(ctx context.Context) *Invoice

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

func (*InvoiceQuery) GroupBy

func (iq *InvoiceQuery) GroupBy(field string, fields ...string) *InvoiceGroupBy

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

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Invoice.Query().
	GroupBy(invoice.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InvoiceQuery) IDs

func (iq *InvoiceQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*InvoiceQuery) IDsX

func (iq *InvoiceQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*InvoiceQuery) Limit

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

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

func (*InvoiceQuery) Offset

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

Offset to start from.

func (*InvoiceQuery) Only

func (iq *InvoiceQuery) Only(ctx context.Context) (*Invoice, error)

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

func (*InvoiceQuery) OnlyID

func (iq *InvoiceQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*InvoiceQuery) OnlyIDX

func (iq *InvoiceQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*InvoiceQuery) OnlyX

func (iq *InvoiceQuery) OnlyX(ctx context.Context) *Invoice

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

func (*InvoiceQuery) Order

func (iq *InvoiceQuery) Order(o ...invoice.OrderOption) *InvoiceQuery

Order specifies how the records should be ordered.

func (*InvoiceQuery) QueryOrder

func (iq *InvoiceQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" edge.

func (*InvoiceQuery) Select

func (iq *InvoiceQuery) Select(fields ...string) *InvoiceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Invoice.Query().
	Select(invoice.FieldCreatedAt).
	Scan(ctx, &v)

func (*InvoiceQuery) Unique

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

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

func (iq *InvoiceQuery) Where(ps ...predicate.Invoice) *InvoiceQuery

Where adds a new predicate for the InvoiceQuery builder.

func (*InvoiceQuery) WithOrder

func (iq *InvoiceQuery) WithOrder(opts ...func(*OrderQuery)) *InvoiceQuery

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

type InvoiceSelect

type InvoiceSelect struct {
	*InvoiceQuery
	// contains filtered or unexported fields
}

InvoiceSelect is the builder for selecting fields of Invoice entities.

func (*InvoiceSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*InvoiceSelect) Bool

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

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

func (*InvoiceSelect) BoolX

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

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

func (*InvoiceSelect) Bools

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

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

func (*InvoiceSelect) BoolsX

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

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

func (*InvoiceSelect) Float64

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

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

func (*InvoiceSelect) Float64X

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

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

func (*InvoiceSelect) Float64s

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

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

func (*InvoiceSelect) Float64sX

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

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

func (*InvoiceSelect) Int

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

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

func (*InvoiceSelect) IntX

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

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

func (*InvoiceSelect) Ints

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

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

func (*InvoiceSelect) IntsX

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

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

func (*InvoiceSelect) Scan

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

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

func (*InvoiceSelect) ScanX

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

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

func (*InvoiceSelect) String

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

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

func (*InvoiceSelect) StringX

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

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

func (*InvoiceSelect) Strings

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

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

func (*InvoiceSelect) StringsX

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

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

type InvoiceUpdate

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

InvoiceUpdate is the builder for updating Invoice entities.

func (*InvoiceUpdate) ClearComment

func (iu *InvoiceUpdate) ClearComment() *InvoiceUpdate

ClearComment clears the value of the "comment" field.

func (*InvoiceUpdate) ClearNote

func (iu *InvoiceUpdate) ClearNote() *InvoiceUpdate

ClearNote clears the value of the "note" field.

func (*InvoiceUpdate) Exec

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

Exec executes the query.

func (*InvoiceUpdate) ExecX

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

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

func (*InvoiceUpdate) Mutation

func (iu *InvoiceUpdate) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

func (*InvoiceUpdate) Save

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

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

func (*InvoiceUpdate) SaveX

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

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

func (*InvoiceUpdate) SetComment

func (iu *InvoiceUpdate) SetComment(s string) *InvoiceUpdate

SetComment sets the "comment" field.

func (*InvoiceUpdate) SetNillableComment

func (iu *InvoiceUpdate) SetNillableComment(s *string) *InvoiceUpdate

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

func (*InvoiceUpdate) SetNillableNote

func (iu *InvoiceUpdate) SetNillableNote(s *string) *InvoiceUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*InvoiceUpdate) SetNillableStatus

func (iu *InvoiceUpdate) SetNillableStatus(i *invoice.Status) *InvoiceUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceUpdate) SetNote

func (iu *InvoiceUpdate) SetNote(s string) *InvoiceUpdate

SetNote sets the "note" field.

func (*InvoiceUpdate) SetStatus

func (iu *InvoiceUpdate) SetStatus(i invoice.Status) *InvoiceUpdate

SetStatus sets the "status" field.

func (*InvoiceUpdate) SetUpdatedAt

func (iu *InvoiceUpdate) SetUpdatedAt(t time.Time) *InvoiceUpdate

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceUpdate) Where

func (iu *InvoiceUpdate) Where(ps ...predicate.Invoice) *InvoiceUpdate

Where appends a list predicates to the InvoiceUpdate builder.

type InvoiceUpdateOne

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

InvoiceUpdateOne is the builder for updating a single Invoice entity.

func (*InvoiceUpdateOne) ClearComment

func (iuo *InvoiceUpdateOne) ClearComment() *InvoiceUpdateOne

ClearComment clears the value of the "comment" field.

func (*InvoiceUpdateOne) ClearNote

func (iuo *InvoiceUpdateOne) ClearNote() *InvoiceUpdateOne

ClearNote clears the value of the "note" field.

func (*InvoiceUpdateOne) Exec

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

Exec executes the query on the entity.

func (*InvoiceUpdateOne) ExecX

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

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

func (*InvoiceUpdateOne) Mutation

func (iuo *InvoiceUpdateOne) Mutation() *InvoiceMutation

Mutation returns the InvoiceMutation object of the builder.

func (*InvoiceUpdateOne) Save

func (iuo *InvoiceUpdateOne) Save(ctx context.Context) (*Invoice, error)

Save executes the query and returns the updated Invoice entity.

func (*InvoiceUpdateOne) SaveX

func (iuo *InvoiceUpdateOne) SaveX(ctx context.Context) *Invoice

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

func (*InvoiceUpdateOne) Select

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

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

func (*InvoiceUpdateOne) SetComment

func (iuo *InvoiceUpdateOne) SetComment(s string) *InvoiceUpdateOne

SetComment sets the "comment" field.

func (*InvoiceUpdateOne) SetNillableComment

func (iuo *InvoiceUpdateOne) SetNillableComment(s *string) *InvoiceUpdateOne

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

func (*InvoiceUpdateOne) SetNillableNote

func (iuo *InvoiceUpdateOne) SetNillableNote(s *string) *InvoiceUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNillableStatus

func (iuo *InvoiceUpdateOne) SetNillableStatus(i *invoice.Status) *InvoiceUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*InvoiceUpdateOne) SetNote

func (iuo *InvoiceUpdateOne) SetNote(s string) *InvoiceUpdateOne

SetNote sets the "note" field.

func (*InvoiceUpdateOne) SetStatus

func (iuo *InvoiceUpdateOne) SetStatus(i invoice.Status) *InvoiceUpdateOne

SetStatus sets the "status" field.

func (*InvoiceUpdateOne) SetUpdatedAt

func (iuo *InvoiceUpdateOne) SetUpdatedAt(t time.Time) *InvoiceUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*InvoiceUpdateOne) Where

Where appends a list predicates to the InvoiceUpdate builder.

type Invoices

type Invoices []*Invoice

Invoices is a parsable slice of Invoice.

type Message

type Message struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// ConversationID holds the value of the "conversation_id" field.
	ConversationID uuid.UUID `json:"conversation_id,omitempty"`
	// SenderID holds the value of the "sender_id" field.
	SenderID uuid.UUID `json:"sender_id,omitempty"`
	// Type holds the value of the "type" field.
	Type message.Type `json:"type,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// IsRead holds the value of the "is_read" field.
	IsRead bool `json:"is_read,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryConversation

func (m *Message) QueryConversation() *ConversationQuery

QueryConversation queries the "conversation" edge of the Message entity.

func (*Message) QuerySender

func (m *Message) QuerySender() *PersonQuery

QuerySender queries the "sender" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (m *Message) Unwrap() *Message

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

func (m *Message) Update() *MessageUpdateOne

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

func (*Message) Value

func (m *Message) Value(name string) (ent.Value, error)

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

type MessageClient

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

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

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

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne

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

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message

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

func (*MessageClient) Hooks

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

Hooks returns the client hooks.

func (*MessageClient) Intercept

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

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

func (*MessageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

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

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryConversation

func (c *MessageClient) QueryConversation(m *Message) *ConversationQuery

QueryConversation queries the conversation edge of a Message.

func (*MessageClient) QuerySender

func (c *MessageClient) QuerySender(m *Message) *PersonQuery

QuerySender queries the sender edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

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

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

type MessageCreate

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

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (mc *MessageCreate) ExecX(ctx context.Context)

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

func (*MessageCreate) Mutation

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetContent

func (mc *MessageCreate) SetContent(s string) *MessageCreate

SetContent sets the "content" field.

func (*MessageCreate) SetConversation

func (mc *MessageCreate) SetConversation(c *Conversation) *MessageCreate

SetConversation sets the "conversation" edge to the Conversation entity.

func (*MessageCreate) SetConversationID

func (mc *MessageCreate) SetConversationID(u uuid.UUID) *MessageCreate

SetConversationID sets the "conversation_id" field.

func (*MessageCreate) SetCreatedAt

func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate

SetCreatedAt sets the "created_at" field.

func (*MessageCreate) SetID

func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate

SetID sets the "id" field.

func (*MessageCreate) SetIsRead

func (mc *MessageCreate) SetIsRead(b bool) *MessageCreate

SetIsRead sets the "is_read" field.

func (*MessageCreate) SetNillableCreatedAt

func (mc *MessageCreate) SetNillableCreatedAt(t *time.Time) *MessageCreate

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

func (*MessageCreate) SetNillableID

func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MessageCreate) SetNillableIsRead

func (mc *MessageCreate) SetNillableIsRead(b *bool) *MessageCreate

SetNillableIsRead sets the "is_read" field if the given value is not nil.

func (*MessageCreate) SetNillableType

func (mc *MessageCreate) SetNillableType(m *message.Type) *MessageCreate

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

func (*MessageCreate) SetNillableUpdatedAt

func (mc *MessageCreate) SetNillableUpdatedAt(t *time.Time) *MessageCreate

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

func (*MessageCreate) SetSender

func (mc *MessageCreate) SetSender(p *Person) *MessageCreate

SetSender sets the "sender" edge to the Person entity.

func (*MessageCreate) SetSenderID

func (mc *MessageCreate) SetSenderID(u uuid.UUID) *MessageCreate

SetSenderID sets the "sender_id" field.

func (*MessageCreate) SetType

func (mc *MessageCreate) SetType(m message.Type) *MessageCreate

SetType sets the "type" field.

func (*MessageCreate) SetUpdatedAt

func (mc *MessageCreate) SetUpdatedAt(t time.Time) *MessageCreate

SetUpdatedAt sets the "updated_at" field.

type MessageCreateBulk

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

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

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

func (*MessageCreateBulk) Save

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

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

type MessageDelete

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

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

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

func (*MessageDelete) ExecX

func (md *MessageDelete) ExecX(ctx context.Context) int

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

func (*MessageDelete) Where

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

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

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

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

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Conversation holds the value of the conversation edge.
	Conversation *Conversation `json:"conversation,omitempty"`
	// Sender holds the value of the sender edge.
	Sender *Person `json:"sender,omitempty"`
	// contains filtered or unexported fields
}

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

func (MessageEdges) ConversationOrErr

func (e MessageEdges) ConversationOrErr() (*Conversation, error)

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

func (MessageEdges) SenderOrErr

func (e MessageEdges) SenderOrErr() (*Person, error)

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

type MessageGroupBy

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

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

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

func (*MessageGroupBy) Bool

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

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

func (*MessageGroupBy) BoolX

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

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

func (*MessageGroupBy) Bools

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

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

func (*MessageGroupBy) BoolsX

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

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

func (*MessageGroupBy) Float64

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

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

func (*MessageGroupBy) Float64X

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

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

func (*MessageGroupBy) Float64s

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

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

func (*MessageGroupBy) Float64sX

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

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

func (*MessageGroupBy) Int

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

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

func (*MessageGroupBy) IntX

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

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

func (*MessageGroupBy) Ints

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

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

func (*MessageGroupBy) IntsX

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

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

func (*MessageGroupBy) Scan

func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error

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

func (*MessageGroupBy) ScanX

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

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

func (*MessageGroupBy) String

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

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringX

func (s *MessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageGroupBy) Strings

func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringsX

func (s *MessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageMutation

type MessageMutation struct {
	// contains filtered or unexported fields
}

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) 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 (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) 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 (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) ClearConversation

func (m *MessageMutation) ClearConversation()

ClearConversation clears the "conversation" edge to the Conversation entity.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) 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 (*MessageMutation) ClearField

func (m *MessageMutation) 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 (*MessageMutation) ClearSender

func (m *MessageMutation) ClearSender()

ClearSender clears the "sender" edge to the Person entity.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) 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 (*MessageMutation) Content

func (m *MessageMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*MessageMutation) ConversationCleared

func (m *MessageMutation) ConversationCleared() bool

ConversationCleared reports if the "conversation" edge to the Conversation entity was cleared.

func (*MessageMutation) ConversationID

func (m *MessageMutation) ConversationID() (r uuid.UUID, exists bool)

ConversationID returns the value of the "conversation_id" field in the mutation.

func (*MessageMutation) ConversationIDs

func (m *MessageMutation) ConversationIDs() (ids []uuid.UUID)

ConversationIDs returns the "conversation" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ConversationID instead. It exists only for internal usage by the builders.

func (*MessageMutation) CreatedAt

func (m *MessageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Field

func (m *MessageMutation) 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 (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) 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 (*MessageMutation) GetType

func (m *MessageMutation) GetType() (r message.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*MessageMutation) ID

func (m *MessageMutation) ID() (id uuid.UUID, 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 (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*MessageMutation) IsRead

func (m *MessageMutation) IsRead() (r bool, exists bool)

IsRead returns the value of the "is_read" field in the mutation.

func (*MessageMutation) OldContent

func (m *MessageMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Message entity. If the Message 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 (*MessageMutation) OldConversationID

func (m *MessageMutation) OldConversationID(ctx context.Context) (v uuid.UUID, err error)

OldConversationID returns the old "conversation_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldCreatedAt

func (m *MessageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Message entity. If the Message 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 (*MessageMutation) OldField

func (m *MessageMutation) 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 (*MessageMutation) OldIsRead

func (m *MessageMutation) OldIsRead(ctx context.Context) (v bool, err error)

OldIsRead returns the old "is_read" field's value of the Message entity. If the Message 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 (*MessageMutation) OldSenderID

func (m *MessageMutation) OldSenderID(ctx context.Context) (v uuid.UUID, err error)

OldSenderID returns the old "sender_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldType

func (m *MessageMutation) OldType(ctx context.Context) (v message.Type, err error)

OldType returns the old "type" field's value of the Message entity. If the Message 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 (*MessageMutation) OldUpdatedAt

func (m *MessageMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Message entity. If the Message 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 (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) 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 (*MessageMutation) ResetContent

func (m *MessageMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*MessageMutation) ResetConversation

func (m *MessageMutation) ResetConversation()

ResetConversation resets all changes to the "conversation" edge.

func (*MessageMutation) ResetConversationID

func (m *MessageMutation) ResetConversationID()

ResetConversationID resets all changes to the "conversation_id" field.

func (*MessageMutation) ResetCreatedAt

func (m *MessageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) 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 (*MessageMutation) ResetField

func (m *MessageMutation) 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 (*MessageMutation) ResetIsRead

func (m *MessageMutation) ResetIsRead()

ResetIsRead resets all changes to the "is_read" field.

func (*MessageMutation) ResetSender

func (m *MessageMutation) ResetSender()

ResetSender resets all changes to the "sender" edge.

func (*MessageMutation) ResetSenderID

func (m *MessageMutation) ResetSenderID()

ResetSenderID resets all changes to the "sender_id" field.

func (*MessageMutation) ResetType

func (m *MessageMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*MessageMutation) ResetUpdatedAt

func (m *MessageMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MessageMutation) SenderCleared

func (m *MessageMutation) SenderCleared() bool

SenderCleared reports if the "sender" edge to the Person entity was cleared.

func (*MessageMutation) SenderID

func (m *MessageMutation) SenderID() (r uuid.UUID, exists bool)

SenderID returns the value of the "sender_id" field in the mutation.

func (*MessageMutation) SenderIDs

func (m *MessageMutation) SenderIDs() (ids []uuid.UUID)

SenderIDs returns the "sender" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SenderID instead. It exists only for internal usage by the builders.

func (*MessageMutation) SetContent

func (m *MessageMutation) SetContent(s string)

SetContent sets the "content" field.

func (*MessageMutation) SetConversationID

func (m *MessageMutation) SetConversationID(u uuid.UUID)

SetConversationID sets the "conversation_id" field.

func (*MessageMutation) SetCreatedAt

func (m *MessageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MessageMutation) SetField

func (m *MessageMutation) 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 (*MessageMutation) SetID

func (m *MessageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Message entities.

func (*MessageMutation) SetIsRead

func (m *MessageMutation) SetIsRead(b bool)

SetIsRead sets the "is_read" field.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetSenderID

func (m *MessageMutation) SetSenderID(u uuid.UUID)

SetSenderID sets the "sender_id" field.

func (*MessageMutation) SetType

func (m *MessageMutation) SetType(value message.Type)

SetType sets the "type" field.

func (*MessageMutation) SetUpdatedAt

func (m *MessageMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) UpdatedAt

func (m *MessageMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MessageQuery

type MessageQuery struct {
	// contains filtered or unexported fields
}

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

AllX is like All, but panics if an error occurs.

func (*MessageQuery) Clone

func (mq *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (mq *MessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageQuery) Exist

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageQuery) ExistX

func (mq *MessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageQuery) First

func (mq *MessageQuery) First(ctx context.Context) (*Message, error)

First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.

func (*MessageQuery) FirstID

func (mq *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.

func (*MessageQuery) FirstIDX

func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageQuery) FirstX

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

FirstX is like First, but panics if an error occurs.

func (*MessageQuery) GroupBy

func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (mq *MessageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Message IDs.

func (*MessageQuery) IDsX

func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*MessageQuery) Limit

func (mq *MessageQuery) Limit(limit int) *MessageQuery

Limit the number of records to be returned by this query.

func (*MessageQuery) Offset

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (mq *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageQuery) OnlyX

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

OnlyX is like Only, but panics if an error occurs.

func (*MessageQuery) Order

func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryConversation

func (mq *MessageQuery) QueryConversation() *ConversationQuery

QueryConversation chains the current query on the "conversation" edge.

func (*MessageQuery) QuerySender

func (mq *MessageQuery) QuerySender() *PersonQuery

QuerySender chains the current query on the "sender" edge.

func (*MessageQuery) Select

func (mq *MessageQuery) Select(fields ...string) *MessageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Message.Query().
	Select(message.FieldCreatedAt).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (mq *MessageQuery) Unique(unique bool) *MessageQuery

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 (*MessageQuery) Where

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithConversation

func (mq *MessageQuery) WithConversation(opts ...func(*ConversationQuery)) *MessageQuery

WithConversation tells the query-builder to eager-load the nodes that are connected to the "conversation" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithSender

func (mq *MessageQuery) WithSender(opts ...func(*PersonQuery)) *MessageQuery

WithSender tells the query-builder to eager-load the nodes that are connected to the "sender" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolX

func (s *MessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageSelect) Bools

func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolsX

func (s *MessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageSelect) Float64

func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64X

func (s *MessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageSelect) Float64s

func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64sX

func (s *MessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageSelect) Int

func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntX

func (s *MessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageSelect) Ints

func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntsX

func (s *MessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageSelect) Scan

func (ms *MessageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageSelect) ScanX

func (s *MessageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageSelect) String

func (s *MessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (s *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (s *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) Exec

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (mu *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Mutation

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save

func (mu *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (mu *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetContent

func (mu *MessageUpdate) SetContent(s string) *MessageUpdate

SetContent sets the "content" field.

func (*MessageUpdate) SetIsRead

func (mu *MessageUpdate) SetIsRead(b bool) *MessageUpdate

SetIsRead sets the "is_read" field.

func (*MessageUpdate) SetNillableContent

func (mu *MessageUpdate) SetNillableContent(s *string) *MessageUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdate) SetNillableIsRead

func (mu *MessageUpdate) SetNillableIsRead(b *bool) *MessageUpdate

SetNillableIsRead sets the "is_read" field if the given value is not nil.

func (*MessageUpdate) SetUpdatedAt

func (mu *MessageUpdate) SetUpdatedAt(t time.Time) *MessageUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MessageUpdate) Where

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) Exec

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Mutation

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetContent

func (muo *MessageUpdateOne) SetContent(s string) *MessageUpdateOne

SetContent sets the "content" field.

func (*MessageUpdateOne) SetIsRead

func (muo *MessageUpdateOne) SetIsRead(b bool) *MessageUpdateOne

SetIsRead sets the "is_read" field.

func (*MessageUpdateOne) SetNillableContent

func (muo *MessageUpdateOne) SetNillableContent(s *string) *MessageUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableIsRead

func (muo *MessageUpdateOne) SetNillableIsRead(b *bool) *MessageUpdateOne

SetNillableIsRead sets the "is_read" field if the given value is not nil.

func (*MessageUpdateOne) SetUpdatedAt

func (muo *MessageUpdateOne) SetUpdatedAt(t time.Time) *MessageUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type Order

type Order struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CustomerID holds the value of the "customer_id" field.
	CustomerID uuid.UUID `json:"customer_id,omitempty"`
	// Note holds the value of the "note" field.
	Note *string `json:"note,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy uuid.UUID `json:"created_by,omitempty"`
	// ParentOrderID holds the value of the "parent_order_id" field.
	ParentOrderID uuid.UUID `json:"parent_order_id,omitempty"`
	// Priority holds the value of the "priority" field.
	Priority int `json:"priority,omitempty"`
	// Type holds the value of the "type" field.
	Type order.Type `json:"type,omitempty"`
	// StatusCode holds the value of the "status_code" field.
	StatusCode int `json:"status_code,omitempty"`
	// ManagementStaffID holds the value of the "management_staff_id" field.
	ManagementStaffID uuid.UUID `json:"management_staff_id,omitempty"`
	// WarehouseStaffID holds the value of the "warehouse_staff_id" field.
	WarehouseStaffID *uuid.UUID `json:"warehouse_staff_id,omitempty"`
	// DeliveryStaffID holds the value of the "delivery_staff_id" field.
	DeliveryStaffID *uuid.UUID `json:"delivery_staff_id,omitempty"`
	// InternalNote holds the value of the "internal_note" field.
	InternalNote *string `json:"internal_note,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrderQuery when eager-loading is set.
	Edges OrderEdges `json:"edges"`
	// contains filtered or unexported fields
}

Order is the model entity for the Order schema.

func (*Order) QueryCreator

func (o *Order) QueryCreator() *PersonQuery

QueryCreator queries the "creator" edge of the Order entity.

func (*Order) QueryCustomer

func (o *Order) QueryCustomer() *PersonQuery

QueryCustomer queries the "customer" edge of the Order entity.

func (*Order) QueryDeliveryStaff

func (o *Order) QueryDeliveryStaff() *PersonQuery

QueryDeliveryStaff queries the "delivery_staff" edge of the Order entity.

func (*Order) QueryManagementStaff

func (o *Order) QueryManagementStaff() *PersonQuery

QueryManagementStaff queries the "management_staff" edge of the Order entity.

func (*Order) QueryOrderStatus

func (o *Order) QueryOrderStatus() *OrderStatusCodeQuery

QueryOrderStatus queries the "order_status" edge of the Order entity.

func (*Order) QueryParentOrder

func (o *Order) QueryParentOrder() *OrderQuery

QueryParentOrder queries the "parent_order" edge of the Order entity.

func (*Order) QueryWarehouseStaff

func (o *Order) QueryWarehouseStaff() *PersonQuery

QueryWarehouseStaff queries the "warehouse_staff" edge of the Order entity.

func (*Order) String

func (o *Order) String() string

String implements the fmt.Stringer.

func (*Order) Unwrap

func (o *Order) Unwrap() *Order

Unwrap unwraps the Order 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 (*Order) Update

func (o *Order) Update() *OrderUpdateOne

Update returns a builder for updating this Order. Note that you need to call Order.Unwrap() before calling this method if this Order was returned from a transaction, and the transaction was committed or rolled back.

func (*Order) Value

func (o *Order) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Order. This includes values selected through modifiers, order, etc.

type OrderClient

type OrderClient struct {
	// contains filtered or unexported fields
}

OrderClient is a client for the Order schema.

func NewOrderClient

func NewOrderClient(c config) *OrderClient

NewOrderClient returns a client for the Order from the given config.

func (*OrderClient) Create

func (c *OrderClient) Create() *OrderCreate

Create returns a builder for creating a Order entity.

func (*OrderClient) CreateBulk

func (c *OrderClient) CreateBulk(builders ...*OrderCreate) *OrderCreateBulk

CreateBulk returns a builder for creating a bulk of Order entities.

func (*OrderClient) Delete

func (c *OrderClient) Delete() *OrderDelete

Delete returns a delete builder for Order.

func (*OrderClient) DeleteOne

func (c *OrderClient) DeleteOne(o *Order) *OrderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderClient) DeleteOneID

func (c *OrderClient) DeleteOneID(id uuid.UUID) *OrderDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderClient) Get

func (c *OrderClient) Get(ctx context.Context, id uuid.UUID) (*Order, error)

Get returns a Order entity by its id.

func (*OrderClient) GetX

func (c *OrderClient) GetX(ctx context.Context, id uuid.UUID) *Order

GetX is like Get, but panics if an error occurs.

func (*OrderClient) Hooks

func (c *OrderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderClient) Intercept

func (c *OrderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `order.Intercept(f(g(h())))`.

func (*OrderClient) Interceptors

func (c *OrderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderClient) MapCreateBulk

func (c *OrderClient) MapCreateBulk(slice any, setFunc func(*OrderCreate, int)) *OrderCreateBulk

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 (*OrderClient) Query

func (c *OrderClient) Query() *OrderQuery

Query returns a query builder for Order.

func (*OrderClient) QueryCreator

func (c *OrderClient) QueryCreator(o *Order) *PersonQuery

QueryCreator queries the creator edge of a Order.

func (*OrderClient) QueryCustomer

func (c *OrderClient) QueryCustomer(o *Order) *PersonQuery

QueryCustomer queries the customer edge of a Order.

func (*OrderClient) QueryDeliveryStaff

func (c *OrderClient) QueryDeliveryStaff(o *Order) *PersonQuery

QueryDeliveryStaff queries the delivery_staff edge of a Order.

func (*OrderClient) QueryManagementStaff

func (c *OrderClient) QueryManagementStaff(o *Order) *PersonQuery

QueryManagementStaff queries the management_staff edge of a Order.

func (*OrderClient) QueryOrderStatus

func (c *OrderClient) QueryOrderStatus(o *Order) *OrderStatusCodeQuery

QueryOrderStatus queries the order_status edge of a Order.

func (*OrderClient) QueryParentOrder

func (c *OrderClient) QueryParentOrder(o *Order) *OrderQuery

QueryParentOrder queries the parent_order edge of a Order.

func (*OrderClient) QueryWarehouseStaff

func (c *OrderClient) QueryWarehouseStaff(o *Order) *PersonQuery

QueryWarehouseStaff queries the warehouse_staff edge of a Order.

func (*OrderClient) Update

func (c *OrderClient) Update() *OrderUpdate

Update returns an update builder for Order.

func (*OrderClient) UpdateOne

func (c *OrderClient) UpdateOne(o *Order) *OrderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderClient) UpdateOneID

func (c *OrderClient) UpdateOneID(id uuid.UUID) *OrderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrderClient) Use

func (c *OrderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `order.Hooks(f(g(h())))`.

type OrderCreate

type OrderCreate struct {
	// contains filtered or unexported fields
}

OrderCreate is the builder for creating a Order entity.

func (*OrderCreate) Exec

func (oc *OrderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreate) ExecX

func (oc *OrderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderCreate) Mutation

func (oc *OrderCreate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderCreate) Save

func (oc *OrderCreate) Save(ctx context.Context) (*Order, error)

Save creates the Order in the database.

func (*OrderCreate) SaveX

func (oc *OrderCreate) SaveX(ctx context.Context) *Order

SaveX calls Save and panics if Save returns an error.

func (*OrderCreate) SetCreatedAt

func (oc *OrderCreate) SetCreatedAt(t time.Time) *OrderCreate

SetCreatedAt sets the "created_at" field.

func (*OrderCreate) SetCreatedBy

func (oc *OrderCreate) SetCreatedBy(u uuid.UUID) *OrderCreate

SetCreatedBy sets the "created_by" field.

func (*OrderCreate) SetCreator

func (oc *OrderCreate) SetCreator(p *Person) *OrderCreate

SetCreator sets the "creator" edge to the Person entity.

func (*OrderCreate) SetCreatorID

func (oc *OrderCreate) SetCreatorID(id uuid.UUID) *OrderCreate

SetCreatorID sets the "creator" edge to the Person entity by ID.

func (*OrderCreate) SetCustomer

func (oc *OrderCreate) SetCustomer(p *Person) *OrderCreate

SetCustomer sets the "customer" edge to the Person entity.

func (*OrderCreate) SetCustomerID

func (oc *OrderCreate) SetCustomerID(u uuid.UUID) *OrderCreate

SetCustomerID sets the "customer_id" field.

func (*OrderCreate) SetDeliveryStaff

func (oc *OrderCreate) SetDeliveryStaff(p *Person) *OrderCreate

SetDeliveryStaff sets the "delivery_staff" edge to the Person entity.

func (*OrderCreate) SetDeliveryStaffID

func (oc *OrderCreate) SetDeliveryStaffID(u uuid.UUID) *OrderCreate

SetDeliveryStaffID sets the "delivery_staff_id" field.

func (*OrderCreate) SetID

func (oc *OrderCreate) SetID(u uuid.UUID) *OrderCreate

SetID sets the "id" field.

func (*OrderCreate) SetInternalNote

func (oc *OrderCreate) SetInternalNote(s string) *OrderCreate

SetInternalNote sets the "internal_note" field.

func (*OrderCreate) SetManagementStaff

func (oc *OrderCreate) SetManagementStaff(p *Person) *OrderCreate

SetManagementStaff sets the "management_staff" edge to the Person entity.

func (*OrderCreate) SetManagementStaffID

func (oc *OrderCreate) SetManagementStaffID(u uuid.UUID) *OrderCreate

SetManagementStaffID sets the "management_staff_id" field.

func (*OrderCreate) SetNillableCreatedAt

func (oc *OrderCreate) SetNillableCreatedAt(t *time.Time) *OrderCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderCreate) SetNillableDeliveryStaffID

func (oc *OrderCreate) SetNillableDeliveryStaffID(u *uuid.UUID) *OrderCreate

SetNillableDeliveryStaffID sets the "delivery_staff_id" field if the given value is not nil.

func (*OrderCreate) SetNillableID

func (oc *OrderCreate) SetNillableID(u *uuid.UUID) *OrderCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OrderCreate) SetNillableInternalNote

func (oc *OrderCreate) SetNillableInternalNote(s *string) *OrderCreate

SetNillableInternalNote sets the "internal_note" field if the given value is not nil.

func (*OrderCreate) SetNillableNote

func (oc *OrderCreate) SetNillableNote(s *string) *OrderCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*OrderCreate) SetNillableParentOrderID

func (oc *OrderCreate) SetNillableParentOrderID(u *uuid.UUID) *OrderCreate

SetNillableParentOrderID sets the "parent_order_id" field if the given value is not nil.

func (*OrderCreate) SetNillablePriority

func (oc *OrderCreate) SetNillablePriority(i *int) *OrderCreate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*OrderCreate) SetNillableStatusCode

func (oc *OrderCreate) SetNillableStatusCode(i *int) *OrderCreate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*OrderCreate) SetNillableType

func (oc *OrderCreate) SetNillableType(o *order.Type) *OrderCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*OrderCreate) SetNillableUpdatedAt

func (oc *OrderCreate) SetNillableUpdatedAt(t *time.Time) *OrderCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrderCreate) SetNillableWarehouseStaffID

func (oc *OrderCreate) SetNillableWarehouseStaffID(u *uuid.UUID) *OrderCreate

SetNillableWarehouseStaffID sets the "warehouse_staff_id" field if the given value is not nil.

func (*OrderCreate) SetNote

func (oc *OrderCreate) SetNote(s string) *OrderCreate

SetNote sets the "note" field.

func (*OrderCreate) SetOrderStatus

func (oc *OrderCreate) SetOrderStatus(o *OrderStatusCode) *OrderCreate

SetOrderStatus sets the "order_status" edge to the OrderStatusCode entity.

func (*OrderCreate) SetOrderStatusID

func (oc *OrderCreate) SetOrderStatusID(id int) *OrderCreate

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by ID.

func (*OrderCreate) SetParentOrder

func (oc *OrderCreate) SetParentOrder(o *Order) *OrderCreate

SetParentOrder sets the "parent_order" edge to the Order entity.

func (*OrderCreate) SetParentOrderID

func (oc *OrderCreate) SetParentOrderID(u uuid.UUID) *OrderCreate

SetParentOrderID sets the "parent_order_id" field.

func (*OrderCreate) SetPriority

func (oc *OrderCreate) SetPriority(i int) *OrderCreate

SetPriority sets the "priority" field.

func (*OrderCreate) SetStatusCode

func (oc *OrderCreate) SetStatusCode(i int) *OrderCreate

SetStatusCode sets the "status_code" field.

func (*OrderCreate) SetType

func (oc *OrderCreate) SetType(o order.Type) *OrderCreate

SetType sets the "type" field.

func (*OrderCreate) SetUpdatedAt

func (oc *OrderCreate) SetUpdatedAt(t time.Time) *OrderCreate

SetUpdatedAt sets the "updated_at" field.

func (*OrderCreate) SetWarehouseStaff

func (oc *OrderCreate) SetWarehouseStaff(p *Person) *OrderCreate

SetWarehouseStaff sets the "warehouse_staff" edge to the Person entity.

func (*OrderCreate) SetWarehouseStaffID

func (oc *OrderCreate) SetWarehouseStaffID(u uuid.UUID) *OrderCreate

SetWarehouseStaffID sets the "warehouse_staff_id" field.

type OrderCreateBulk

type OrderCreateBulk struct {
	// contains filtered or unexported fields
}

OrderCreateBulk is the builder for creating many Order entities in bulk.

func (*OrderCreateBulk) Exec

func (ocb *OrderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreateBulk) ExecX

func (ocb *OrderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderCreateBulk) Save

func (ocb *OrderCreateBulk) Save(ctx context.Context) ([]*Order, error)

Save creates the Order entities in the database.

func (*OrderCreateBulk) SaveX

func (ocb *OrderCreateBulk) SaveX(ctx context.Context) []*Order

SaveX is like Save, but panics if an error occurs.

type OrderDelete

type OrderDelete struct {
	// contains filtered or unexported fields
}

OrderDelete is the builder for deleting a Order entity.

func (*OrderDelete) Exec

func (od *OrderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderDelete) ExecX

func (od *OrderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderDelete) Where

func (od *OrderDelete) Where(ps ...predicate.Order) *OrderDelete

Where appends a list predicates to the OrderDelete builder.

type OrderDeleteOne

type OrderDeleteOne struct {
	// contains filtered or unexported fields
}

OrderDeleteOne is the builder for deleting a single Order entity.

func (*OrderDeleteOne) Exec

func (odo *OrderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderDeleteOne) ExecX

func (odo *OrderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderDeleteOne) Where

func (odo *OrderDeleteOne) Where(ps ...predicate.Order) *OrderDeleteOne

Where appends a list predicates to the OrderDelete builder.

type OrderEdges

type OrderEdges struct {
	// Customer holds the value of the customer edge.
	Customer *Person `json:"customer,omitempty"`
	// Creator holds the value of the creator edge.
	Creator *Person `json:"creator,omitempty"`
	// ParentOrder holds the value of the parent_order edge.
	ParentOrder *Order `json:"parent_order,omitempty"`
	// OrderStatus holds the value of the order_status edge.
	OrderStatus *OrderStatusCode `json:"order_status,omitempty"`
	// ManagementStaff holds the value of the management_staff edge.
	ManagementStaff *Person `json:"management_staff,omitempty"`
	// WarehouseStaff holds the value of the warehouse_staff edge.
	WarehouseStaff *Person `json:"warehouse_staff,omitempty"`
	// DeliveryStaff holds the value of the delivery_staff edge.
	DeliveryStaff *Person `json:"delivery_staff,omitempty"`
	// contains filtered or unexported fields
}

OrderEdges holds the relations/edges for other nodes in the graph.

func (OrderEdges) CreatorOrErr

func (e OrderEdges) CreatorOrErr() (*Person, error)

CreatorOrErr returns the Creator value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) CustomerOrErr

func (e OrderEdges) CustomerOrErr() (*Person, error)

CustomerOrErr returns the Customer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) DeliveryStaffOrErr

func (e OrderEdges) DeliveryStaffOrErr() (*Person, error)

DeliveryStaffOrErr returns the DeliveryStaff value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) ManagementStaffOrErr

func (e OrderEdges) ManagementStaffOrErr() (*Person, error)

ManagementStaffOrErr returns the ManagementStaff value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) OrderStatusOrErr

func (e OrderEdges) OrderStatusOrErr() (*OrderStatusCode, error)

OrderStatusOrErr returns the OrderStatus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) ParentOrderOrErr

func (e OrderEdges) ParentOrderOrErr() (*Order, error)

ParentOrderOrErr returns the ParentOrder value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderEdges) WarehouseStaffOrErr

func (e OrderEdges) WarehouseStaffOrErr() (*Person, error)

WarehouseStaffOrErr returns the WarehouseStaff value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

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 OrderGroupBy

type OrderGroupBy struct {
	// contains filtered or unexported fields
}

OrderGroupBy is the group-by builder for Order entities.

func (*OrderGroupBy) Aggregate

func (ogb *OrderGroupBy) Aggregate(fns ...AggregateFunc) *OrderGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderGroupBy) Bool

func (s *OrderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) BoolX

func (s *OrderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderGroupBy) Bools

func (s *OrderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) BoolsX

func (s *OrderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderGroupBy) Float64

func (s *OrderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) Float64X

func (s *OrderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderGroupBy) Float64s

func (s *OrderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) Float64sX

func (s *OrderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderGroupBy) Int

func (s *OrderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) IntX

func (s *OrderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderGroupBy) Ints

func (s *OrderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) IntsX

func (s *OrderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderGroupBy) Scan

func (ogb *OrderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderGroupBy) ScanX

func (s *OrderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderGroupBy) String

func (s *OrderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) StringX

func (s *OrderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderGroupBy) Strings

func (s *OrderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderGroupBy) StringsX

func (s *OrderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderLineItem

type OrderLineItem struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// OrderID holds the value of the "order_id" field.
	OrderID uuid.UUID `json:"order_id,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// Qty holds the value of the "qty" field.
	Qty decimal.Decimal `json:"qty,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OrderLineItemQuery when eager-loading is set.
	Edges OrderLineItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

OrderLineItem is the model entity for the OrderLineItem schema.

func (*OrderLineItem) QueryOrder

func (oli *OrderLineItem) QueryOrder() *OrderQuery

QueryOrder queries the "order" edge of the OrderLineItem entity.

func (*OrderLineItem) QueryProduct

func (oli *OrderLineItem) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the OrderLineItem entity.

func (*OrderLineItem) String

func (oli *OrderLineItem) String() string

String implements the fmt.Stringer.

func (*OrderLineItem) Unwrap

func (oli *OrderLineItem) Unwrap() *OrderLineItem

Unwrap unwraps the OrderLineItem 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 (*OrderLineItem) Update

func (oli *OrderLineItem) Update() *OrderLineItemUpdateOne

Update returns a builder for updating this OrderLineItem. Note that you need to call OrderLineItem.Unwrap() before calling this method if this OrderLineItem was returned from a transaction, and the transaction was committed or rolled back.

func (*OrderLineItem) Value

func (oli *OrderLineItem) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OrderLineItem. This includes values selected through modifiers, order, etc.

type OrderLineItemClient

type OrderLineItemClient struct {
	// contains filtered or unexported fields
}

OrderLineItemClient is a client for the OrderLineItem schema.

func NewOrderLineItemClient

func NewOrderLineItemClient(c config) *OrderLineItemClient

NewOrderLineItemClient returns a client for the OrderLineItem from the given config.

func (*OrderLineItemClient) Create

Create returns a builder for creating a OrderLineItem entity.

func (*OrderLineItemClient) CreateBulk

CreateBulk returns a builder for creating a bulk of OrderLineItem entities.

func (*OrderLineItemClient) Delete

Delete returns a delete builder for OrderLineItem.

func (*OrderLineItemClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderLineItemClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderLineItemClient) Get

Get returns a OrderLineItem entity by its id.

func (*OrderLineItemClient) GetX

GetX is like Get, but panics if an error occurs.

func (*OrderLineItemClient) Hooks

func (c *OrderLineItemClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderLineItemClient) Intercept

func (c *OrderLineItemClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orderlineitem.Intercept(f(g(h())))`.

func (*OrderLineItemClient) Interceptors

func (c *OrderLineItemClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderLineItemClient) MapCreateBulk

func (c *OrderLineItemClient) MapCreateBulk(slice any, setFunc func(*OrderLineItemCreate, int)) *OrderLineItemCreateBulk

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 (*OrderLineItemClient) Query

Query returns a query builder for OrderLineItem.

func (*OrderLineItemClient) QueryOrder

func (c *OrderLineItemClient) QueryOrder(oli *OrderLineItem) *OrderQuery

QueryOrder queries the order edge of a OrderLineItem.

func (*OrderLineItemClient) QueryProduct

func (c *OrderLineItemClient) QueryProduct(oli *OrderLineItem) *ProductQuery

QueryProduct queries the product edge of a OrderLineItem.

func (*OrderLineItemClient) Update

Update returns an update builder for OrderLineItem.

func (*OrderLineItemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderLineItemClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OrderLineItemClient) Use

func (c *OrderLineItemClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orderlineitem.Hooks(f(g(h())))`.

type OrderLineItemCreate

type OrderLineItemCreate struct {
	// contains filtered or unexported fields
}

OrderLineItemCreate is the builder for creating a OrderLineItem entity.

func (*OrderLineItemCreate) Exec

func (olic *OrderLineItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderLineItemCreate) ExecX

func (olic *OrderLineItemCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderLineItemCreate) Mutation

func (olic *OrderLineItemCreate) Mutation() *OrderLineItemMutation

Mutation returns the OrderLineItemMutation object of the builder.

func (*OrderLineItemCreate) Save

Save creates the OrderLineItem in the database.

func (*OrderLineItemCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OrderLineItemCreate) SetCreatedAt

func (olic *OrderLineItemCreate) SetCreatedAt(t time.Time) *OrderLineItemCreate

SetCreatedAt sets the "created_at" field.

func (*OrderLineItemCreate) SetID

SetID sets the "id" field.

func (*OrderLineItemCreate) SetNillableCreatedAt

func (olic *OrderLineItemCreate) SetNillableCreatedAt(t *time.Time) *OrderLineItemCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderLineItemCreate) SetNillableID

func (olic *OrderLineItemCreate) SetNillableID(u *uuid.UUID) *OrderLineItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OrderLineItemCreate) SetNillableUpdatedAt

func (olic *OrderLineItemCreate) SetNillableUpdatedAt(t *time.Time) *OrderLineItemCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrderLineItemCreate) SetOrder

func (olic *OrderLineItemCreate) SetOrder(o *Order) *OrderLineItemCreate

SetOrder sets the "order" edge to the Order entity.

func (*OrderLineItemCreate) SetOrderID

func (olic *OrderLineItemCreate) SetOrderID(u uuid.UUID) *OrderLineItemCreate

SetOrderID sets the "order_id" field.

func (*OrderLineItemCreate) SetProduct

func (olic *OrderLineItemCreate) SetProduct(p *Product) *OrderLineItemCreate

SetProduct sets the "product" edge to the Product entity.

func (*OrderLineItemCreate) SetProductID

func (olic *OrderLineItemCreate) SetProductID(s string) *OrderLineItemCreate

SetProductID sets the "product_id" field.

func (*OrderLineItemCreate) SetQty

SetQty sets the "qty" field.

func (*OrderLineItemCreate) SetUpdatedAt

func (olic *OrderLineItemCreate) SetUpdatedAt(t time.Time) *OrderLineItemCreate

SetUpdatedAt sets the "updated_at" field.

type OrderLineItemCreateBulk

type OrderLineItemCreateBulk struct {
	// contains filtered or unexported fields
}

OrderLineItemCreateBulk is the builder for creating many OrderLineItem entities in bulk.

func (*OrderLineItemCreateBulk) Exec

func (olicb *OrderLineItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderLineItemCreateBulk) ExecX

func (olicb *OrderLineItemCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderLineItemCreateBulk) Save

Save creates the OrderLineItem entities in the database.

func (*OrderLineItemCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type OrderLineItemDelete

type OrderLineItemDelete struct {
	// contains filtered or unexported fields
}

OrderLineItemDelete is the builder for deleting a OrderLineItem entity.

func (*OrderLineItemDelete) Exec

func (olid *OrderLineItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderLineItemDelete) ExecX

func (olid *OrderLineItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderLineItemDelete) Where

Where appends a list predicates to the OrderLineItemDelete builder.

type OrderLineItemDeleteOne

type OrderLineItemDeleteOne struct {
	// contains filtered or unexported fields
}

OrderLineItemDeleteOne is the builder for deleting a single OrderLineItem entity.

func (*OrderLineItemDeleteOne) Exec

func (olido *OrderLineItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderLineItemDeleteOne) ExecX

func (olido *OrderLineItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderLineItemDeleteOne) Where

Where appends a list predicates to the OrderLineItemDelete builder.

type OrderLineItemEdges

type OrderLineItemEdges struct {
	// Order holds the value of the order edge.
	Order *Order `json:"order,omitempty"`
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// contains filtered or unexported fields
}

OrderLineItemEdges holds the relations/edges for other nodes in the graph.

func (OrderLineItemEdges) OrderOrErr

func (e OrderLineItemEdges) OrderOrErr() (*Order, error)

OrderOrErr returns the Order value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (OrderLineItemEdges) ProductOrErr

func (e OrderLineItemEdges) ProductOrErr() (*Product, error)

ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type OrderLineItemGroupBy

type OrderLineItemGroupBy struct {
	// contains filtered or unexported fields
}

OrderLineItemGroupBy is the group-by builder for OrderLineItem entities.

func (*OrderLineItemGroupBy) Aggregate

func (oligb *OrderLineItemGroupBy) Aggregate(fns ...AggregateFunc) *OrderLineItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderLineItemGroupBy) Bool

func (s *OrderLineItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) BoolX

func (s *OrderLineItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderLineItemGroupBy) Bools

func (s *OrderLineItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) BoolsX

func (s *OrderLineItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderLineItemGroupBy) Float64

func (s *OrderLineItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) Float64X

func (s *OrderLineItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderLineItemGroupBy) Float64s

func (s *OrderLineItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) Float64sX

func (s *OrderLineItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderLineItemGroupBy) Int

func (s *OrderLineItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) IntX

func (s *OrderLineItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderLineItemGroupBy) Ints

func (s *OrderLineItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) IntsX

func (s *OrderLineItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderLineItemGroupBy) Scan

func (oligb *OrderLineItemGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderLineItemGroupBy) ScanX

func (s *OrderLineItemGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderLineItemGroupBy) String

func (s *OrderLineItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) StringX

func (s *OrderLineItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderLineItemGroupBy) Strings

func (s *OrderLineItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderLineItemGroupBy) StringsX

func (s *OrderLineItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderLineItemMutation

type OrderLineItemMutation struct {
	// contains filtered or unexported fields
}

OrderLineItemMutation represents an operation that mutates the OrderLineItem nodes in the graph.

func (*OrderLineItemMutation) AddField

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) AddQty

func (m *OrderLineItemMutation) AddQty(d decimal.Decimal)

AddQty adds d to the "qty" field.

func (*OrderLineItemMutation) AddedEdges

func (m *OrderLineItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderLineItemMutation) AddedField

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) AddedFields

func (m *OrderLineItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderLineItemMutation) AddedIDs

func (m *OrderLineItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderLineItemMutation) AddedQty

func (m *OrderLineItemMutation) AddedQty() (r decimal.Decimal, exists bool)

AddedQty returns the value that was added to the "qty" field in this mutation.

func (*OrderLineItemMutation) ClearEdge

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) ClearField

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) ClearOrder

func (m *OrderLineItemMutation) ClearOrder()

ClearOrder clears the "order" edge to the Order entity.

func (*OrderLineItemMutation) ClearProduct

func (m *OrderLineItemMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*OrderLineItemMutation) ClearedEdges

func (m *OrderLineItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderLineItemMutation) ClearedFields

func (m *OrderLineItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderLineItemMutation) Client

func (m OrderLineItemMutation) 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 (*OrderLineItemMutation) CreatedAt

func (m *OrderLineItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderLineItemMutation) EdgeCleared

func (m *OrderLineItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderLineItemMutation) Field

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) FieldCleared

func (m *OrderLineItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderLineItemMutation) Fields

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) ID

func (m *OrderLineItemMutation) ID() (id uuid.UUID, 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 (*OrderLineItemMutation) 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 (*OrderLineItemMutation) OldCreatedAt

func (m *OrderLineItemMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OrderLineItem entity. If the OrderLineItem 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 (*OrderLineItemMutation) OldField

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) OldOrderID

func (m *OrderLineItemMutation) OldOrderID(ctx context.Context) (v uuid.UUID, err error)

OldOrderID returns the old "order_id" field's value of the OrderLineItem entity. If the OrderLineItem 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 (*OrderLineItemMutation) OldProductID

func (m *OrderLineItemMutation) OldProductID(ctx context.Context) (v string, err error)

OldProductID returns the old "product_id" field's value of the OrderLineItem entity. If the OrderLineItem 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 (*OrderLineItemMutation) OldQty

func (m *OrderLineItemMutation) OldQty(ctx context.Context) (v decimal.Decimal, err error)

OldQty returns the old "qty" field's value of the OrderLineItem entity. If the OrderLineItem 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 (*OrderLineItemMutation) OldUpdatedAt

func (m *OrderLineItemMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the OrderLineItem entity. If the OrderLineItem 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 (*OrderLineItemMutation) Op

func (m *OrderLineItemMutation) Op() Op

Op returns the operation name.

func (*OrderLineItemMutation) OrderCleared

func (m *OrderLineItemMutation) OrderCleared() bool

OrderCleared reports if the "order" edge to the Order entity was cleared.

func (*OrderLineItemMutation) OrderID

func (m *OrderLineItemMutation) OrderID() (r uuid.UUID, exists bool)

OrderID returns the value of the "order_id" field in the mutation.

func (*OrderLineItemMutation) OrderIDs

func (m *OrderLineItemMutation) OrderIDs() (ids []uuid.UUID)

OrderIDs returns the "order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderID instead. It exists only for internal usage by the builders.

func (*OrderLineItemMutation) ProductCleared

func (m *OrderLineItemMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*OrderLineItemMutation) ProductID

func (m *OrderLineItemMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*OrderLineItemMutation) ProductIDs

func (m *OrderLineItemMutation) ProductIDs() (ids []string)

ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.

func (*OrderLineItemMutation) Qty

func (m *OrderLineItemMutation) Qty() (r decimal.Decimal, exists bool)

Qty returns the value of the "qty" field in the mutation.

func (*OrderLineItemMutation) RemovedEdges

func (m *OrderLineItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderLineItemMutation) RemovedIDs

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) ResetCreatedAt

func (m *OrderLineItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderLineItemMutation) ResetEdge

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) ResetField

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) ResetOrder

func (m *OrderLineItemMutation) ResetOrder()

ResetOrder resets all changes to the "order" edge.

func (*OrderLineItemMutation) ResetOrderID

func (m *OrderLineItemMutation) ResetOrderID()

ResetOrderID resets all changes to the "order_id" field.

func (*OrderLineItemMutation) ResetProduct

func (m *OrderLineItemMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*OrderLineItemMutation) ResetProductID

func (m *OrderLineItemMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*OrderLineItemMutation) ResetQty

func (m *OrderLineItemMutation) ResetQty()

ResetQty resets all changes to the "qty" field.

func (*OrderLineItemMutation) ResetUpdatedAt

func (m *OrderLineItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderLineItemMutation) SetCreatedAt

func (m *OrderLineItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderLineItemMutation) SetField

func (m *OrderLineItemMutation) 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 (*OrderLineItemMutation) SetID

func (m *OrderLineItemMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of OrderLineItem entities.

func (*OrderLineItemMutation) SetOp

func (m *OrderLineItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderLineItemMutation) SetOrderID

func (m *OrderLineItemMutation) SetOrderID(u uuid.UUID)

SetOrderID sets the "order_id" field.

func (*OrderLineItemMutation) SetProductID

func (m *OrderLineItemMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*OrderLineItemMutation) SetQty

func (m *OrderLineItemMutation) SetQty(d decimal.Decimal)

SetQty sets the "qty" field.

func (*OrderLineItemMutation) SetUpdatedAt

func (m *OrderLineItemMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (OrderLineItemMutation) Tx

func (m OrderLineItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderLineItemMutation) Type

func (m *OrderLineItemMutation) Type() string

Type returns the node type of this mutation (OrderLineItem).

func (*OrderLineItemMutation) UpdatedAt

func (m *OrderLineItemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrderLineItemMutation) Where

Where appends a list predicates to the OrderLineItemMutation builder.

func (*OrderLineItemMutation) WhereP

func (m *OrderLineItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderLineItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderLineItemQuery

type OrderLineItemQuery struct {
	// contains filtered or unexported fields
}

OrderLineItemQuery is the builder for querying OrderLineItem entities.

func (*OrderLineItemQuery) Aggregate

func (oliq *OrderLineItemQuery) Aggregate(fns ...AggregateFunc) *OrderLineItemSelect

Aggregate returns a OrderLineItemSelect configured with the given aggregations.

func (*OrderLineItemQuery) All

func (oliq *OrderLineItemQuery) All(ctx context.Context) ([]*OrderLineItem, error)

All executes the query and returns a list of OrderLineItems.

func (*OrderLineItemQuery) AllX

func (oliq *OrderLineItemQuery) AllX(ctx context.Context) []*OrderLineItem

AllX is like All, but panics if an error occurs.

func (*OrderLineItemQuery) Clone

func (oliq *OrderLineItemQuery) Clone() *OrderLineItemQuery

Clone returns a duplicate of the OrderLineItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderLineItemQuery) Count

func (oliq *OrderLineItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderLineItemQuery) CountX

func (oliq *OrderLineItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderLineItemQuery) Exist

func (oliq *OrderLineItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderLineItemQuery) ExistX

func (oliq *OrderLineItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderLineItemQuery) First

func (oliq *OrderLineItemQuery) First(ctx context.Context) (*OrderLineItem, error)

First returns the first OrderLineItem entity from the query. Returns a *NotFoundError when no OrderLineItem was found.

func (*OrderLineItemQuery) FirstID

func (oliq *OrderLineItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first OrderLineItem ID from the query. Returns a *NotFoundError when no OrderLineItem ID was found.

func (*OrderLineItemQuery) FirstIDX

func (oliq *OrderLineItemQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderLineItemQuery) FirstX

func (oliq *OrderLineItemQuery) FirstX(ctx context.Context) *OrderLineItem

FirstX is like First, but panics if an error occurs.

func (*OrderLineItemQuery) GroupBy

func (oliq *OrderLineItemQuery) GroupBy(field string, fields ...string) *OrderLineItemGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.OrderLineItem.Query().
	GroupBy(orderlineitem.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderLineItemQuery) IDs

func (oliq *OrderLineItemQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of OrderLineItem IDs.

func (*OrderLineItemQuery) IDsX

func (oliq *OrderLineItemQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OrderLineItemQuery) Limit

func (oliq *OrderLineItemQuery) Limit(limit int) *OrderLineItemQuery

Limit the number of records to be returned by this query.

func (*OrderLineItemQuery) Offset

func (oliq *OrderLineItemQuery) Offset(offset int) *OrderLineItemQuery

Offset to start from.

func (*OrderLineItemQuery) Only

Only returns a single OrderLineItem entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrderLineItem entity is found. Returns a *NotFoundError when no OrderLineItem entities are found.

func (*OrderLineItemQuery) OnlyID

func (oliq *OrderLineItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only OrderLineItem ID in the query. Returns a *NotSingularError when more than one OrderLineItem ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderLineItemQuery) OnlyIDX

func (oliq *OrderLineItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderLineItemQuery) OnlyX

func (oliq *OrderLineItemQuery) OnlyX(ctx context.Context) *OrderLineItem

OnlyX is like Only, but panics if an error occurs.

func (*OrderLineItemQuery) Order

Order specifies how the records should be ordered.

func (*OrderLineItemQuery) QueryOrder

func (oliq *OrderLineItemQuery) QueryOrder() *OrderQuery

QueryOrder chains the current query on the "order" edge.

func (*OrderLineItemQuery) QueryProduct

func (oliq *OrderLineItemQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*OrderLineItemQuery) Select

func (oliq *OrderLineItemQuery) Select(fields ...string) *OrderLineItemSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.OrderLineItem.Query().
	Select(orderlineitem.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderLineItemQuery) Unique

func (oliq *OrderLineItemQuery) Unique(unique bool) *OrderLineItemQuery

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 (*OrderLineItemQuery) Where

Where adds a new predicate for the OrderLineItemQuery builder.

func (*OrderLineItemQuery) WithOrder

func (oliq *OrderLineItemQuery) WithOrder(opts ...func(*OrderQuery)) *OrderLineItemQuery

WithOrder tells the query-builder to eager-load the nodes that are connected to the "order" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderLineItemQuery) WithProduct

func (oliq *OrderLineItemQuery) WithProduct(opts ...func(*ProductQuery)) *OrderLineItemQuery

WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.

type OrderLineItemSelect

type OrderLineItemSelect struct {
	*OrderLineItemQuery
	// contains filtered or unexported fields
}

OrderLineItemSelect is the builder for selecting fields of OrderLineItem entities.

func (*OrderLineItemSelect) Aggregate

func (olis *OrderLineItemSelect) Aggregate(fns ...AggregateFunc) *OrderLineItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderLineItemSelect) Bool

func (s *OrderLineItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) BoolX

func (s *OrderLineItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderLineItemSelect) Bools

func (s *OrderLineItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) BoolsX

func (s *OrderLineItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderLineItemSelect) Float64

func (s *OrderLineItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) Float64X

func (s *OrderLineItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderLineItemSelect) Float64s

func (s *OrderLineItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) Float64sX

func (s *OrderLineItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderLineItemSelect) Int

func (s *OrderLineItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) IntX

func (s *OrderLineItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderLineItemSelect) Ints

func (s *OrderLineItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) IntsX

func (s *OrderLineItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderLineItemSelect) Scan

func (olis *OrderLineItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderLineItemSelect) ScanX

func (s *OrderLineItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderLineItemSelect) String

func (s *OrderLineItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) StringX

func (s *OrderLineItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderLineItemSelect) Strings

func (s *OrderLineItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderLineItemSelect) StringsX

func (s *OrderLineItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderLineItemUpdate

type OrderLineItemUpdate struct {
	// contains filtered or unexported fields
}

OrderLineItemUpdate is the builder for updating OrderLineItem entities.

func (*OrderLineItemUpdate) AddQty

AddQty adds d to the "qty" field.

func (*OrderLineItemUpdate) Exec

func (oliu *OrderLineItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderLineItemUpdate) ExecX

func (oliu *OrderLineItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderLineItemUpdate) Mutation

func (oliu *OrderLineItemUpdate) Mutation() *OrderLineItemMutation

Mutation returns the OrderLineItemMutation object of the builder.

func (*OrderLineItemUpdate) Save

func (oliu *OrderLineItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderLineItemUpdate) SaveX

func (oliu *OrderLineItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderLineItemUpdate) SetNillableQty

func (oliu *OrderLineItemUpdate) SetNillableQty(d *decimal.Decimal) *OrderLineItemUpdate

SetNillableQty sets the "qty" field if the given value is not nil.

func (*OrderLineItemUpdate) SetQty

SetQty sets the "qty" field.

func (*OrderLineItemUpdate) SetUpdatedAt

func (oliu *OrderLineItemUpdate) SetUpdatedAt(t time.Time) *OrderLineItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrderLineItemUpdate) Where

Where appends a list predicates to the OrderLineItemUpdate builder.

type OrderLineItemUpdateOne

type OrderLineItemUpdateOne struct {
	// contains filtered or unexported fields
}

OrderLineItemUpdateOne is the builder for updating a single OrderLineItem entity.

func (*OrderLineItemUpdateOne) AddQty

AddQty adds d to the "qty" field.

func (*OrderLineItemUpdateOne) Exec

func (oliuo *OrderLineItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderLineItemUpdateOne) ExecX

func (oliuo *OrderLineItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderLineItemUpdateOne) Mutation

func (oliuo *OrderLineItemUpdateOne) Mutation() *OrderLineItemMutation

Mutation returns the OrderLineItemMutation object of the builder.

func (*OrderLineItemUpdateOne) Save

Save executes the query and returns the updated OrderLineItem entity.

func (*OrderLineItemUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OrderLineItemUpdateOne) Select

func (oliuo *OrderLineItemUpdateOne) Select(field string, fields ...string) *OrderLineItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderLineItemUpdateOne) SetNillableQty

func (oliuo *OrderLineItemUpdateOne) SetNillableQty(d *decimal.Decimal) *OrderLineItemUpdateOne

SetNillableQty sets the "qty" field if the given value is not nil.

func (*OrderLineItemUpdateOne) SetQty

SetQty sets the "qty" field.

func (*OrderLineItemUpdateOne) SetUpdatedAt

func (oliuo *OrderLineItemUpdateOne) SetUpdatedAt(t time.Time) *OrderLineItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OrderLineItemUpdateOne) Where

Where appends a list predicates to the OrderLineItemUpdate builder.

type OrderLineItems

type OrderLineItems []*OrderLineItem

OrderLineItems is a parsable slice of OrderLineItem.

type OrderMutation

type OrderMutation struct {
	// contains filtered or unexported fields
}

OrderMutation represents an operation that mutates the Order nodes in the graph.

func (*OrderMutation) AddField

func (m *OrderMutation) 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 (*OrderMutation) AddPriority

func (m *OrderMutation) AddPriority(i int)

AddPriority adds i to the "priority" field.

func (*OrderMutation) AddedEdges

func (m *OrderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderMutation) AddedField

func (m *OrderMutation) 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 (*OrderMutation) AddedFields

func (m *OrderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderMutation) AddedIDs

func (m *OrderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderMutation) AddedPriority

func (m *OrderMutation) AddedPriority() (r int, exists bool)

AddedPriority returns the value that was added to the "priority" field in this mutation.

func (*OrderMutation) ClearCreator

func (m *OrderMutation) ClearCreator()

ClearCreator clears the "creator" edge to the Person entity.

func (*OrderMutation) ClearCustomer

func (m *OrderMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Person entity.

func (*OrderMutation) ClearDeliveryStaff

func (m *OrderMutation) ClearDeliveryStaff()

ClearDeliveryStaff clears the "delivery_staff" edge to the Person entity.

func (*OrderMutation) ClearDeliveryStaffID

func (m *OrderMutation) ClearDeliveryStaffID()

ClearDeliveryStaffID clears the value of the "delivery_staff_id" field.

func (*OrderMutation) ClearEdge

func (m *OrderMutation) 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 (*OrderMutation) ClearField

func (m *OrderMutation) 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 (*OrderMutation) ClearInternalNote

func (m *OrderMutation) ClearInternalNote()

ClearInternalNote clears the value of the "internal_note" field.

func (*OrderMutation) ClearManagementStaff

func (m *OrderMutation) ClearManagementStaff()

ClearManagementStaff clears the "management_staff" edge to the Person entity.

func (*OrderMutation) ClearNote

func (m *OrderMutation) ClearNote()

ClearNote clears the value of the "note" field.

func (*OrderMutation) ClearOrderStatus

func (m *OrderMutation) ClearOrderStatus()

ClearOrderStatus clears the "order_status" edge to the OrderStatusCode entity.

func (*OrderMutation) ClearParentOrder

func (m *OrderMutation) ClearParentOrder()

ClearParentOrder clears the "parent_order" edge to the Order entity.

func (*OrderMutation) ClearParentOrderID

func (m *OrderMutation) ClearParentOrderID()

ClearParentOrderID clears the value of the "parent_order_id" field.

func (*OrderMutation) ClearWarehouseStaff

func (m *OrderMutation) ClearWarehouseStaff()

ClearWarehouseStaff clears the "warehouse_staff" edge to the Person entity.

func (*OrderMutation) ClearWarehouseStaffID

func (m *OrderMutation) ClearWarehouseStaffID()

ClearWarehouseStaffID clears the value of the "warehouse_staff_id" field.

func (*OrderMutation) ClearedEdges

func (m *OrderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderMutation) ClearedFields

func (m *OrderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderMutation) Client

func (m OrderMutation) 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 (*OrderMutation) CreatedAt

func (m *OrderMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderMutation) CreatedBy

func (m *OrderMutation) CreatedBy() (r uuid.UUID, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*OrderMutation) CreatorCleared

func (m *OrderMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the Person entity was cleared.

func (*OrderMutation) CreatorID

func (m *OrderMutation) CreatorID() (id uuid.UUID, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*OrderMutation) CreatorIDs

func (m *OrderMutation) CreatorIDs() (ids []uuid.UUID)

CreatorIDs returns the "creator" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatorID instead. It exists only for internal usage by the builders.

func (*OrderMutation) CustomerCleared

func (m *OrderMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Person entity was cleared.

func (*OrderMutation) CustomerID

func (m *OrderMutation) CustomerID() (r uuid.UUID, exists bool)

CustomerID returns the value of the "customer_id" field in the mutation.

func (*OrderMutation) CustomerIDs

func (m *OrderMutation) CustomerIDs() (ids []uuid.UUID)

CustomerIDs returns the "customer" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CustomerID instead. It exists only for internal usage by the builders.

func (*OrderMutation) DeliveryStaffCleared

func (m *OrderMutation) DeliveryStaffCleared() bool

DeliveryStaffCleared reports if the "delivery_staff" edge to the Person entity was cleared.

func (*OrderMutation) DeliveryStaffID

func (m *OrderMutation) DeliveryStaffID() (r uuid.UUID, exists bool)

DeliveryStaffID returns the value of the "delivery_staff_id" field in the mutation.

func (*OrderMutation) DeliveryStaffIDCleared

func (m *OrderMutation) DeliveryStaffIDCleared() bool

DeliveryStaffIDCleared returns if the "delivery_staff_id" field was cleared in this mutation.

func (*OrderMutation) DeliveryStaffIDs

func (m *OrderMutation) DeliveryStaffIDs() (ids []uuid.UUID)

DeliveryStaffIDs returns the "delivery_staff" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DeliveryStaffID instead. It exists only for internal usage by the builders.

func (*OrderMutation) EdgeCleared

func (m *OrderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderMutation) Field

func (m *OrderMutation) 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 (*OrderMutation) FieldCleared

func (m *OrderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderMutation) Fields

func (m *OrderMutation) 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 (*OrderMutation) GetType

func (m *OrderMutation) GetType() (r order.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*OrderMutation) ID

func (m *OrderMutation) ID() (id uuid.UUID, 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 (*OrderMutation) IDs

func (m *OrderMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*OrderMutation) InternalNote

func (m *OrderMutation) InternalNote() (r string, exists bool)

InternalNote returns the value of the "internal_note" field in the mutation.

func (*OrderMutation) InternalNoteCleared

func (m *OrderMutation) InternalNoteCleared() bool

InternalNoteCleared returns if the "internal_note" field was cleared in this mutation.

func (*OrderMutation) ManagementStaffCleared

func (m *OrderMutation) ManagementStaffCleared() bool

ManagementStaffCleared reports if the "management_staff" edge to the Person entity was cleared.

func (*OrderMutation) ManagementStaffID

func (m *OrderMutation) ManagementStaffID() (r uuid.UUID, exists bool)

ManagementStaffID returns the value of the "management_staff_id" field in the mutation.

func (*OrderMutation) ManagementStaffIDs

func (m *OrderMutation) ManagementStaffIDs() (ids []uuid.UUID)

ManagementStaffIDs returns the "management_staff" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ManagementStaffID instead. It exists only for internal usage by the builders.

func (*OrderMutation) Note

func (m *OrderMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*OrderMutation) NoteCleared

func (m *OrderMutation) NoteCleared() bool

NoteCleared returns if the "note" field was cleared in this mutation.

func (*OrderMutation) OldCreatedAt

func (m *OrderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Order entity. If the Order 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 (*OrderMutation) OldCreatedBy

func (m *OrderMutation) OldCreatedBy(ctx context.Context) (v uuid.UUID, err error)

OldCreatedBy returns the old "created_by" field's value of the Order entity. If the Order 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 (*OrderMutation) OldCustomerID

func (m *OrderMutation) OldCustomerID(ctx context.Context) (v uuid.UUID, err error)

OldCustomerID returns the old "customer_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldDeliveryStaffID

func (m *OrderMutation) OldDeliveryStaffID(ctx context.Context) (v *uuid.UUID, err error)

OldDeliveryStaffID returns the old "delivery_staff_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldField

func (m *OrderMutation) 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 (*OrderMutation) OldInternalNote

func (m *OrderMutation) OldInternalNote(ctx context.Context) (v *string, err error)

OldInternalNote returns the old "internal_note" field's value of the Order entity. If the Order 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 (*OrderMutation) OldManagementStaffID

func (m *OrderMutation) OldManagementStaffID(ctx context.Context) (v uuid.UUID, err error)

OldManagementStaffID returns the old "management_staff_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldNote

func (m *OrderMutation) OldNote(ctx context.Context) (v *string, err error)

OldNote returns the old "note" field's value of the Order entity. If the Order 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 (*OrderMutation) OldParentOrderID

func (m *OrderMutation) OldParentOrderID(ctx context.Context) (v uuid.UUID, err error)

OldParentOrderID returns the old "parent_order_id" field's value of the Order entity. If the Order 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 (*OrderMutation) OldPriority

func (m *OrderMutation) OldPriority(ctx context.Context) (v int, err error)

OldPriority returns the old "priority" field's value of the Order entity. If the Order 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 (*OrderMutation) OldStatusCode

func (m *OrderMutation) OldStatusCode(ctx context.Context) (v int, err error)

OldStatusCode returns the old "status_code" field's value of the Order entity. If the Order 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 (*OrderMutation) OldType

func (m *OrderMutation) OldType(ctx context.Context) (v order.Type, err error)

OldType returns the old "type" field's value of the Order entity. If the Order 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 (*OrderMutation) OldUpdatedAt

func (m *OrderMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Order entity. If the Order 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 (*OrderMutation) OldWarehouseStaffID

func (m *OrderMutation) OldWarehouseStaffID(ctx context.Context) (v *uuid.UUID, err error)

OldWarehouseStaffID returns the old "warehouse_staff_id" field's value of the Order entity. If the Order 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 (*OrderMutation) Op

func (m *OrderMutation) Op() Op

Op returns the operation name.

func (*OrderMutation) OrderStatusCleared

func (m *OrderMutation) OrderStatusCleared() bool

OrderStatusCleared reports if the "order_status" edge to the OrderStatusCode entity was cleared.

func (*OrderMutation) OrderStatusID

func (m *OrderMutation) OrderStatusID() (id int, exists bool)

OrderStatusID returns the "order_status" edge ID in the mutation.

func (*OrderMutation) OrderStatusIDs

func (m *OrderMutation) OrderStatusIDs() (ids []int)

OrderStatusIDs returns the "order_status" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrderStatusID instead. It exists only for internal usage by the builders.

func (*OrderMutation) ParentOrderCleared

func (m *OrderMutation) ParentOrderCleared() bool

ParentOrderCleared reports if the "parent_order" edge to the Order entity was cleared.

func (*OrderMutation) ParentOrderID

func (m *OrderMutation) ParentOrderID() (r uuid.UUID, exists bool)

ParentOrderID returns the value of the "parent_order_id" field in the mutation.

func (*OrderMutation) ParentOrderIDCleared

func (m *OrderMutation) ParentOrderIDCleared() bool

ParentOrderIDCleared returns if the "parent_order_id" field was cleared in this mutation.

func (*OrderMutation) ParentOrderIDs

func (m *OrderMutation) ParentOrderIDs() (ids []uuid.UUID)

ParentOrderIDs returns the "parent_order" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentOrderID instead. It exists only for internal usage by the builders.

func (*OrderMutation) Priority

func (m *OrderMutation) Priority() (r int, exists bool)

Priority returns the value of the "priority" field in the mutation.

func (*OrderMutation) RemovedEdges

func (m *OrderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderMutation) RemovedIDs

func (m *OrderMutation) 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 (*OrderMutation) ResetCreatedAt

func (m *OrderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderMutation) ResetCreatedBy

func (m *OrderMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*OrderMutation) ResetCreator

func (m *OrderMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*OrderMutation) ResetCustomer

func (m *OrderMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*OrderMutation) ResetCustomerID

func (m *OrderMutation) ResetCustomerID()

ResetCustomerID resets all changes to the "customer_id" field.

func (*OrderMutation) ResetDeliveryStaff

func (m *OrderMutation) ResetDeliveryStaff()

ResetDeliveryStaff resets all changes to the "delivery_staff" edge.

func (*OrderMutation) ResetDeliveryStaffID

func (m *OrderMutation) ResetDeliveryStaffID()

ResetDeliveryStaffID resets all changes to the "delivery_staff_id" field.

func (*OrderMutation) ResetEdge

func (m *OrderMutation) 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 (*OrderMutation) ResetField

func (m *OrderMutation) 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 (*OrderMutation) ResetInternalNote

func (m *OrderMutation) ResetInternalNote()

ResetInternalNote resets all changes to the "internal_note" field.

func (*OrderMutation) ResetManagementStaff

func (m *OrderMutation) ResetManagementStaff()

ResetManagementStaff resets all changes to the "management_staff" edge.

func (*OrderMutation) ResetManagementStaffID

func (m *OrderMutation) ResetManagementStaffID()

ResetManagementStaffID resets all changes to the "management_staff_id" field.

func (*OrderMutation) ResetNote

func (m *OrderMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*OrderMutation) ResetOrderStatus

func (m *OrderMutation) ResetOrderStatus()

ResetOrderStatus resets all changes to the "order_status" edge.

func (*OrderMutation) ResetParentOrder

func (m *OrderMutation) ResetParentOrder()

ResetParentOrder resets all changes to the "parent_order" edge.

func (*OrderMutation) ResetParentOrderID

func (m *OrderMutation) ResetParentOrderID()

ResetParentOrderID resets all changes to the "parent_order_id" field.

func (*OrderMutation) ResetPriority

func (m *OrderMutation) ResetPriority()

ResetPriority resets all changes to the "priority" field.

func (*OrderMutation) ResetStatusCode

func (m *OrderMutation) ResetStatusCode()

ResetStatusCode resets all changes to the "status_code" field.

func (*OrderMutation) ResetType

func (m *OrderMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*OrderMutation) ResetUpdatedAt

func (m *OrderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderMutation) ResetWarehouseStaff

func (m *OrderMutation) ResetWarehouseStaff()

ResetWarehouseStaff resets all changes to the "warehouse_staff" edge.

func (*OrderMutation) ResetWarehouseStaffID

func (m *OrderMutation) ResetWarehouseStaffID()

ResetWarehouseStaffID resets all changes to the "warehouse_staff_id" field.

func (*OrderMutation) SetCreatedAt

func (m *OrderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderMutation) SetCreatedBy

func (m *OrderMutation) SetCreatedBy(u uuid.UUID)

SetCreatedBy sets the "created_by" field.

func (*OrderMutation) SetCreatorID

func (m *OrderMutation) SetCreatorID(id uuid.UUID)

SetCreatorID sets the "creator" edge to the Person entity by id.

func (*OrderMutation) SetCustomerID

func (m *OrderMutation) SetCustomerID(u uuid.UUID)

SetCustomerID sets the "customer_id" field.

func (*OrderMutation) SetDeliveryStaffID

func (m *OrderMutation) SetDeliveryStaffID(u uuid.UUID)

SetDeliveryStaffID sets the "delivery_staff_id" field.

func (*OrderMutation) SetField

func (m *OrderMutation) 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 (*OrderMutation) SetID

func (m *OrderMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Order entities.

func (*OrderMutation) SetInternalNote

func (m *OrderMutation) SetInternalNote(s string)

SetInternalNote sets the "internal_note" field.

func (*OrderMutation) SetManagementStaffID

func (m *OrderMutation) SetManagementStaffID(u uuid.UUID)

SetManagementStaffID sets the "management_staff_id" field.

func (*OrderMutation) SetNote

func (m *OrderMutation) SetNote(s string)

SetNote sets the "note" field.

func (*OrderMutation) SetOp

func (m *OrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderMutation) SetOrderStatusID

func (m *OrderMutation) SetOrderStatusID(id int)

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by id.

func (*OrderMutation) SetParentOrderID

func (m *OrderMutation) SetParentOrderID(u uuid.UUID)

SetParentOrderID sets the "parent_order_id" field.

func (*OrderMutation) SetPriority

func (m *OrderMutation) SetPriority(i int)

SetPriority sets the "priority" field.

func (*OrderMutation) SetStatusCode

func (m *OrderMutation) SetStatusCode(i int)

SetStatusCode sets the "status_code" field.

func (*OrderMutation) SetType

func (m *OrderMutation) SetType(o order.Type)

SetType sets the "type" field.

func (*OrderMutation) SetUpdatedAt

func (m *OrderMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OrderMutation) SetWarehouseStaffID

func (m *OrderMutation) SetWarehouseStaffID(u uuid.UUID)

SetWarehouseStaffID sets the "warehouse_staff_id" field.

func (*OrderMutation) StatusCode

func (m *OrderMutation) StatusCode() (r int, exists bool)

StatusCode returns the value of the "status_code" field in the mutation.

func (OrderMutation) Tx

func (m OrderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderMutation) Type

func (m *OrderMutation) Type() string

Type returns the node type of this mutation (Order).

func (*OrderMutation) UpdatedAt

func (m *OrderMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrderMutation) WarehouseStaffCleared

func (m *OrderMutation) WarehouseStaffCleared() bool

WarehouseStaffCleared reports if the "warehouse_staff" edge to the Person entity was cleared.

func (*OrderMutation) WarehouseStaffID

func (m *OrderMutation) WarehouseStaffID() (r uuid.UUID, exists bool)

WarehouseStaffID returns the value of the "warehouse_staff_id" field in the mutation.

func (*OrderMutation) WarehouseStaffIDCleared

func (m *OrderMutation) WarehouseStaffIDCleared() bool

WarehouseStaffIDCleared returns if the "warehouse_staff_id" field was cleared in this mutation.

func (*OrderMutation) WarehouseStaffIDs

func (m *OrderMutation) WarehouseStaffIDs() (ids []uuid.UUID)

WarehouseStaffIDs returns the "warehouse_staff" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use WarehouseStaffID instead. It exists only for internal usage by the builders.

func (*OrderMutation) Where

func (m *OrderMutation) Where(ps ...predicate.Order)

Where appends a list predicates to the OrderMutation builder.

func (*OrderMutation) WhereP

func (m *OrderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderQuery

type OrderQuery struct {
	// contains filtered or unexported fields
}

OrderQuery is the builder for querying Order entities.

func (*OrderQuery) Aggregate

func (oq *OrderQuery) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate returns a OrderSelect configured with the given aggregations.

func (*OrderQuery) All

func (oq *OrderQuery) All(ctx context.Context) ([]*Order, error)

All executes the query and returns a list of Orders.

func (*OrderQuery) AllX

func (oq *OrderQuery) AllX(ctx context.Context) []*Order

AllX is like All, but panics if an error occurs.

func (*OrderQuery) Clone

func (oq *OrderQuery) Clone() *OrderQuery

Clone returns a duplicate of the OrderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderQuery) Count

func (oq *OrderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderQuery) CountX

func (oq *OrderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderQuery) Exist

func (oq *OrderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderQuery) ExistX

func (oq *OrderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderQuery) First

func (oq *OrderQuery) First(ctx context.Context) (*Order, error)

First returns the first Order entity from the query. Returns a *NotFoundError when no Order was found.

func (*OrderQuery) FirstID

func (oq *OrderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Order ID from the query. Returns a *NotFoundError when no Order ID was found.

func (*OrderQuery) FirstIDX

func (oq *OrderQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderQuery) FirstX

func (oq *OrderQuery) FirstX(ctx context.Context) *Order

FirstX is like First, but panics if an error occurs.

func (*OrderQuery) GroupBy

func (oq *OrderQuery) GroupBy(field string, fields ...string) *OrderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Order.Query().
	GroupBy(order.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderQuery) IDs

func (oq *OrderQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Order IDs.

func (*OrderQuery) IDsX

func (oq *OrderQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OrderQuery) Limit

func (oq *OrderQuery) Limit(limit int) *OrderQuery

Limit the number of records to be returned by this query.

func (*OrderQuery) Offset

func (oq *OrderQuery) Offset(offset int) *OrderQuery

Offset to start from.

func (*OrderQuery) Only

func (oq *OrderQuery) Only(ctx context.Context) (*Order, error)

Only returns a single Order entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Order entity is found. Returns a *NotFoundError when no Order entities are found.

func (*OrderQuery) OnlyID

func (oq *OrderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Order ID in the query. Returns a *NotSingularError when more than one Order ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderQuery) OnlyIDX

func (oq *OrderQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderQuery) OnlyX

func (oq *OrderQuery) OnlyX(ctx context.Context) *Order

OnlyX is like Only, but panics if an error occurs.

func (*OrderQuery) Order

func (oq *OrderQuery) Order(o ...order.OrderOption) *OrderQuery

Order specifies how the records should be ordered.

func (*OrderQuery) QueryCreator

func (oq *OrderQuery) QueryCreator() *PersonQuery

QueryCreator chains the current query on the "creator" edge.

func (*OrderQuery) QueryCustomer

func (oq *OrderQuery) QueryCustomer() *PersonQuery

QueryCustomer chains the current query on the "customer" edge.

func (*OrderQuery) QueryDeliveryStaff

func (oq *OrderQuery) QueryDeliveryStaff() *PersonQuery

QueryDeliveryStaff chains the current query on the "delivery_staff" edge.

func (*OrderQuery) QueryManagementStaff

func (oq *OrderQuery) QueryManagementStaff() *PersonQuery

QueryManagementStaff chains the current query on the "management_staff" edge.

func (*OrderQuery) QueryOrderStatus

func (oq *OrderQuery) QueryOrderStatus() *OrderStatusCodeQuery

QueryOrderStatus chains the current query on the "order_status" edge.

func (*OrderQuery) QueryParentOrder

func (oq *OrderQuery) QueryParentOrder() *OrderQuery

QueryParentOrder chains the current query on the "parent_order" edge.

func (*OrderQuery) QueryWarehouseStaff

func (oq *OrderQuery) QueryWarehouseStaff() *PersonQuery

QueryWarehouseStaff chains the current query on the "warehouse_staff" edge.

func (*OrderQuery) Select

func (oq *OrderQuery) Select(fields ...string) *OrderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Order.Query().
	Select(order.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderQuery) Unique

func (oq *OrderQuery) Unique(unique bool) *OrderQuery

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 (*OrderQuery) Where

func (oq *OrderQuery) Where(ps ...predicate.Order) *OrderQuery

Where adds a new predicate for the OrderQuery builder.

func (*OrderQuery) WithCreator

func (oq *OrderQuery) WithCreator(opts ...func(*PersonQuery)) *OrderQuery

WithCreator tells the query-builder to eager-load the nodes that are connected to the "creator" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithCustomer

func (oq *OrderQuery) WithCustomer(opts ...func(*PersonQuery)) *OrderQuery

WithCustomer tells the query-builder to eager-load the nodes that are connected to the "customer" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithDeliveryStaff

func (oq *OrderQuery) WithDeliveryStaff(opts ...func(*PersonQuery)) *OrderQuery

WithDeliveryStaff tells the query-builder to eager-load the nodes that are connected to the "delivery_staff" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithManagementStaff

func (oq *OrderQuery) WithManagementStaff(opts ...func(*PersonQuery)) *OrderQuery

WithManagementStaff tells the query-builder to eager-load the nodes that are connected to the "management_staff" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithOrderStatus

func (oq *OrderQuery) WithOrderStatus(opts ...func(*OrderStatusCodeQuery)) *OrderQuery

WithOrderStatus tells the query-builder to eager-load the nodes that are connected to the "order_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithParentOrder

func (oq *OrderQuery) WithParentOrder(opts ...func(*OrderQuery)) *OrderQuery

WithParentOrder tells the query-builder to eager-load the nodes that are connected to the "parent_order" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithWarehouseStaff

func (oq *OrderQuery) WithWarehouseStaff(opts ...func(*PersonQuery)) *OrderQuery

WithWarehouseStaff tells the query-builder to eager-load the nodes that are connected to the "warehouse_staff" edge. The optional arguments are used to configure the query builder of the edge.

type OrderSelect

type OrderSelect struct {
	*OrderQuery
	// contains filtered or unexported fields
}

OrderSelect is the builder for selecting fields of Order entities.

func (*OrderSelect) Aggregate

func (os *OrderSelect) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderSelect) Bool

func (s *OrderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderSelect) BoolX

func (s *OrderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderSelect) Bools

func (s *OrderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderSelect) BoolsX

func (s *OrderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderSelect) Float64

func (s *OrderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderSelect) Float64X

func (s *OrderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderSelect) Float64s

func (s *OrderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderSelect) Float64sX

func (s *OrderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderSelect) Int

func (s *OrderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderSelect) IntX

func (s *OrderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderSelect) Ints

func (s *OrderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderSelect) IntsX

func (s *OrderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderSelect) Scan

func (os *OrderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderSelect) ScanX

func (s *OrderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderSelect) String

func (s *OrderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderSelect) StringX

func (s *OrderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderSelect) Strings

func (s *OrderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderSelect) StringsX

func (s *OrderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderStatusCode

type OrderStatusCode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// OrderStatus holds the value of the "order_status" field.
	OrderStatus string `json:"order_status,omitempty"`
	// contains filtered or unexported fields
}

OrderStatusCode is the model entity for the OrderStatusCode schema.

func (*OrderStatusCode) String

func (osc *OrderStatusCode) String() string

String implements the fmt.Stringer.

func (*OrderStatusCode) Unwrap

func (osc *OrderStatusCode) Unwrap() *OrderStatusCode

Unwrap unwraps the OrderStatusCode 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 (*OrderStatusCode) Update

Update returns a builder for updating this OrderStatusCode. Note that you need to call OrderStatusCode.Unwrap() before calling this method if this OrderStatusCode was returned from a transaction, and the transaction was committed or rolled back.

func (*OrderStatusCode) Value

func (osc *OrderStatusCode) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OrderStatusCode. This includes values selected through modifiers, order, etc.

type OrderStatusCodeClient

type OrderStatusCodeClient struct {
	// contains filtered or unexported fields
}

OrderStatusCodeClient is a client for the OrderStatusCode schema.

func NewOrderStatusCodeClient

func NewOrderStatusCodeClient(c config) *OrderStatusCodeClient

NewOrderStatusCodeClient returns a client for the OrderStatusCode from the given config.

func (*OrderStatusCodeClient) Create

Create returns a builder for creating a OrderStatusCode entity.

func (*OrderStatusCodeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of OrderStatusCode entities.

func (*OrderStatusCodeClient) Delete

Delete returns a delete builder for OrderStatusCode.

func (*OrderStatusCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderStatusCodeClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderStatusCodeClient) Get

Get returns a OrderStatusCode entity by its id.

func (*OrderStatusCodeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*OrderStatusCodeClient) Hooks

func (c *OrderStatusCodeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OrderStatusCodeClient) Intercept

func (c *OrderStatusCodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `orderstatuscode.Intercept(f(g(h())))`.

func (*OrderStatusCodeClient) Interceptors

func (c *OrderStatusCodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OrderStatusCodeClient) MapCreateBulk

func (c *OrderStatusCodeClient) MapCreateBulk(slice any, setFunc func(*OrderStatusCodeCreate, int)) *OrderStatusCodeCreateBulk

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 (*OrderStatusCodeClient) Query

Query returns a query builder for OrderStatusCode.

func (*OrderStatusCodeClient) Update

Update returns an update builder for OrderStatusCode.

func (*OrderStatusCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderStatusCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OrderStatusCodeClient) Use

func (c *OrderStatusCodeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `orderstatuscode.Hooks(f(g(h())))`.

type OrderStatusCodeCreate

type OrderStatusCodeCreate struct {
	// contains filtered or unexported fields
}

OrderStatusCodeCreate is the builder for creating a OrderStatusCode entity.

func (*OrderStatusCodeCreate) Exec

func (oscc *OrderStatusCodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderStatusCodeCreate) ExecX

func (oscc *OrderStatusCodeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeCreate) Mutation

Mutation returns the OrderStatusCodeMutation object of the builder.

func (*OrderStatusCodeCreate) Save

Save creates the OrderStatusCode in the database.

func (*OrderStatusCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OrderStatusCodeCreate) SetCreatedAt

func (oscc *OrderStatusCodeCreate) SetCreatedAt(t time.Time) *OrderStatusCodeCreate

SetCreatedAt sets the "created_at" field.

func (*OrderStatusCodeCreate) SetID

SetID sets the "id" field.

func (*OrderStatusCodeCreate) SetNillableCreatedAt

func (oscc *OrderStatusCodeCreate) SetNillableCreatedAt(t *time.Time) *OrderStatusCodeCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OrderStatusCodeCreate) SetNillableUpdatedAt

func (oscc *OrderStatusCodeCreate) SetNillableUpdatedAt(t *time.Time) *OrderStatusCodeCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OrderStatusCodeCreate) SetOrderStatus

func (oscc *OrderStatusCodeCreate) SetOrderStatus(s string) *OrderStatusCodeCreate

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeCreate) SetUpdatedAt

func (oscc *OrderStatusCodeCreate) SetUpdatedAt(t time.Time) *OrderStatusCodeCreate

SetUpdatedAt sets the "updated_at" field.

type OrderStatusCodeCreateBulk

type OrderStatusCodeCreateBulk struct {
	// contains filtered or unexported fields
}

OrderStatusCodeCreateBulk is the builder for creating many OrderStatusCode entities in bulk.

func (*OrderStatusCodeCreateBulk) Exec

Exec executes the query.

func (*OrderStatusCodeCreateBulk) ExecX

func (osccb *OrderStatusCodeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeCreateBulk) Save

Save creates the OrderStatusCode entities in the database.

func (*OrderStatusCodeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type OrderStatusCodeDelete

type OrderStatusCodeDelete struct {
	// contains filtered or unexported fields
}

OrderStatusCodeDelete is the builder for deleting a OrderStatusCode entity.

func (*OrderStatusCodeDelete) Exec

func (oscd *OrderStatusCodeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OrderStatusCodeDelete) ExecX

func (oscd *OrderStatusCodeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeDelete) Where

Where appends a list predicates to the OrderStatusCodeDelete builder.

type OrderStatusCodeDeleteOne

type OrderStatusCodeDeleteOne struct {
	// contains filtered or unexported fields
}

OrderStatusCodeDeleteOne is the builder for deleting a single OrderStatusCode entity.

func (*OrderStatusCodeDeleteOne) Exec

func (oscdo *OrderStatusCodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderStatusCodeDeleteOne) ExecX

func (oscdo *OrderStatusCodeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeDeleteOne) Where

Where appends a list predicates to the OrderStatusCodeDelete builder.

type OrderStatusCodeGroupBy

type OrderStatusCodeGroupBy struct {
	// contains filtered or unexported fields
}

OrderStatusCodeGroupBy is the group-by builder for OrderStatusCode entities.

func (*OrderStatusCodeGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*OrderStatusCodeGroupBy) Bool

func (s *OrderStatusCodeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) BoolX

func (s *OrderStatusCodeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Bools

func (s *OrderStatusCodeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) BoolsX

func (s *OrderStatusCodeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Float64

func (s *OrderStatusCodeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) Float64X

func (s *OrderStatusCodeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Float64s

func (s *OrderStatusCodeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) Float64sX

func (s *OrderStatusCodeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Int

func (s *OrderStatusCodeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) IntX

func (s *OrderStatusCodeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Ints

func (s *OrderStatusCodeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) IntsX

func (s *OrderStatusCodeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Scan

func (oscgb *OrderStatusCodeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderStatusCodeGroupBy) ScanX

func (s *OrderStatusCodeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) String

func (s *OrderStatusCodeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) StringX

func (s *OrderStatusCodeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderStatusCodeGroupBy) Strings

func (s *OrderStatusCodeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeGroupBy) StringsX

func (s *OrderStatusCodeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderStatusCodeMutation

type OrderStatusCodeMutation struct {
	// contains filtered or unexported fields
}

OrderStatusCodeMutation represents an operation that mutates the OrderStatusCode nodes in the graph.

func (*OrderStatusCodeMutation) AddField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) AddedEdges

func (m *OrderStatusCodeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OrderStatusCodeMutation) AddedField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) AddedFields

func (m *OrderStatusCodeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OrderStatusCodeMutation) AddedIDs

func (m *OrderStatusCodeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OrderStatusCodeMutation) ClearEdge

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ClearField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ClearedEdges

func (m *OrderStatusCodeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OrderStatusCodeMutation) ClearedFields

func (m *OrderStatusCodeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OrderStatusCodeMutation) Client

func (m OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) CreatedAt

func (m *OrderStatusCodeMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OrderStatusCodeMutation) EdgeCleared

func (m *OrderStatusCodeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OrderStatusCodeMutation) Field

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) FieldCleared

func (m *OrderStatusCodeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OrderStatusCodeMutation) Fields

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ID

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) IDs

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) OldCreatedAt

func (m *OrderStatusCodeMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OrderStatusCode entity. If the OrderStatusCode 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 (*OrderStatusCodeMutation) OldField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) OldOrderStatus

func (m *OrderStatusCodeMutation) OldOrderStatus(ctx context.Context) (v string, err error)

OldOrderStatus returns the old "order_status" field's value of the OrderStatusCode entity. If the OrderStatusCode 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 (*OrderStatusCodeMutation) OldUpdatedAt

func (m *OrderStatusCodeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the OrderStatusCode entity. If the OrderStatusCode 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 (*OrderStatusCodeMutation) Op

func (m *OrderStatusCodeMutation) Op() Op

Op returns the operation name.

func (*OrderStatusCodeMutation) OrderStatus

func (m *OrderStatusCodeMutation) OrderStatus() (r string, exists bool)

OrderStatus returns the value of the "order_status" field in the mutation.

func (*OrderStatusCodeMutation) RemovedEdges

func (m *OrderStatusCodeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OrderStatusCodeMutation) RemovedIDs

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ResetCreatedAt

func (m *OrderStatusCodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderStatusCodeMutation) ResetEdge

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ResetField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) ResetOrderStatus

func (m *OrderStatusCodeMutation) ResetOrderStatus()

ResetOrderStatus resets all changes to the "order_status" field.

func (*OrderStatusCodeMutation) ResetUpdatedAt

func (m *OrderStatusCodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderStatusCodeMutation) SetCreatedAt

func (m *OrderStatusCodeMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderStatusCodeMutation) SetField

func (m *OrderStatusCodeMutation) 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 (*OrderStatusCodeMutation) SetID

func (m *OrderStatusCodeMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of OrderStatusCode entities.

func (*OrderStatusCodeMutation) SetOp

func (m *OrderStatusCodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderStatusCodeMutation) SetOrderStatus

func (m *OrderStatusCodeMutation) SetOrderStatus(s string)

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeMutation) SetUpdatedAt

func (m *OrderStatusCodeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (OrderStatusCodeMutation) Tx

func (m OrderStatusCodeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OrderStatusCodeMutation) Type

func (m *OrderStatusCodeMutation) Type() string

Type returns the node type of this mutation (OrderStatusCode).

func (*OrderStatusCodeMutation) UpdatedAt

func (m *OrderStatusCodeMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OrderStatusCodeMutation) Where

Where appends a list predicates to the OrderStatusCodeMutation builder.

func (*OrderStatusCodeMutation) WhereP

func (m *OrderStatusCodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OrderStatusCodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OrderStatusCodeQuery

type OrderStatusCodeQuery struct {
	// contains filtered or unexported fields
}

OrderStatusCodeQuery is the builder for querying OrderStatusCode entities.

func (*OrderStatusCodeQuery) Aggregate

func (oscq *OrderStatusCodeQuery) Aggregate(fns ...AggregateFunc) *OrderStatusCodeSelect

Aggregate returns a OrderStatusCodeSelect configured with the given aggregations.

func (*OrderStatusCodeQuery) All

All executes the query and returns a list of OrderStatusCodes.

func (*OrderStatusCodeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*OrderStatusCodeQuery) Clone

Clone returns a duplicate of the OrderStatusCodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OrderStatusCodeQuery) Count

func (oscq *OrderStatusCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderStatusCodeQuery) CountX

func (oscq *OrderStatusCodeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OrderStatusCodeQuery) Exist

func (oscq *OrderStatusCodeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OrderStatusCodeQuery) ExistX

func (oscq *OrderStatusCodeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OrderStatusCodeQuery) First

First returns the first OrderStatusCode entity from the query. Returns a *NotFoundError when no OrderStatusCode was found.

func (*OrderStatusCodeQuery) FirstID

func (oscq *OrderStatusCodeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first OrderStatusCode ID from the query. Returns a *NotFoundError when no OrderStatusCode ID was found.

func (*OrderStatusCodeQuery) FirstIDX

func (oscq *OrderStatusCodeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*OrderStatusCodeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*OrderStatusCodeQuery) GroupBy

func (oscq *OrderStatusCodeQuery) GroupBy(field string, fields ...string) *OrderStatusCodeGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.OrderStatusCode.Query().
	GroupBy(orderstatuscode.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderStatusCodeQuery) IDs

func (oscq *OrderStatusCodeQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of OrderStatusCode IDs.

func (*OrderStatusCodeQuery) IDsX

func (oscq *OrderStatusCodeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*OrderStatusCodeQuery) Limit

func (oscq *OrderStatusCodeQuery) Limit(limit int) *OrderStatusCodeQuery

Limit the number of records to be returned by this query.

func (*OrderStatusCodeQuery) Offset

func (oscq *OrderStatusCodeQuery) Offset(offset int) *OrderStatusCodeQuery

Offset to start from.

func (*OrderStatusCodeQuery) Only

Only returns a single OrderStatusCode entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OrderStatusCode entity is found. Returns a *NotFoundError when no OrderStatusCode entities are found.

func (*OrderStatusCodeQuery) OnlyID

func (oscq *OrderStatusCodeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only OrderStatusCode ID in the query. Returns a *NotSingularError when more than one OrderStatusCode ID is found. Returns a *NotFoundError when no entities are found.

func (*OrderStatusCodeQuery) OnlyIDX

func (oscq *OrderStatusCodeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OrderStatusCodeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*OrderStatusCodeQuery) Order

Order specifies how the records should be ordered.

func (*OrderStatusCodeQuery) Select

func (oscq *OrderStatusCodeQuery) Select(fields ...string) *OrderStatusCodeSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.OrderStatusCode.Query().
	Select(orderstatuscode.FieldCreatedAt).
	Scan(ctx, &v)

func (*OrderStatusCodeQuery) Unique

func (oscq *OrderStatusCodeQuery) Unique(unique bool) *OrderStatusCodeQuery

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 (*OrderStatusCodeQuery) Where

Where adds a new predicate for the OrderStatusCodeQuery builder.

type OrderStatusCodeSelect

type OrderStatusCodeSelect struct {
	*OrderStatusCodeQuery
	// contains filtered or unexported fields
}

OrderStatusCodeSelect is the builder for selecting fields of OrderStatusCode entities.

func (*OrderStatusCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*OrderStatusCodeSelect) Bool

func (s *OrderStatusCodeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) BoolX

func (s *OrderStatusCodeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OrderStatusCodeSelect) Bools

func (s *OrderStatusCodeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) BoolsX

func (s *OrderStatusCodeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OrderStatusCodeSelect) Float64

func (s *OrderStatusCodeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) Float64X

func (s *OrderStatusCodeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OrderStatusCodeSelect) Float64s

func (s *OrderStatusCodeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) Float64sX

func (s *OrderStatusCodeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OrderStatusCodeSelect) Int

func (s *OrderStatusCodeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) IntX

func (s *OrderStatusCodeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OrderStatusCodeSelect) Ints

func (s *OrderStatusCodeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) IntsX

func (s *OrderStatusCodeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OrderStatusCodeSelect) Scan

func (oscs *OrderStatusCodeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OrderStatusCodeSelect) ScanX

func (s *OrderStatusCodeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OrderStatusCodeSelect) String

func (s *OrderStatusCodeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) StringX

func (s *OrderStatusCodeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OrderStatusCodeSelect) Strings

func (s *OrderStatusCodeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OrderStatusCodeSelect) StringsX

func (s *OrderStatusCodeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OrderStatusCodeUpdate

type OrderStatusCodeUpdate struct {
	// contains filtered or unexported fields
}

OrderStatusCodeUpdate is the builder for updating OrderStatusCode entities.

func (*OrderStatusCodeUpdate) Exec

func (oscu *OrderStatusCodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderStatusCodeUpdate) ExecX

func (oscu *OrderStatusCodeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeUpdate) Mutation

Mutation returns the OrderStatusCodeMutation object of the builder.

func (*OrderStatusCodeUpdate) Save

func (oscu *OrderStatusCodeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderStatusCodeUpdate) SaveX

func (oscu *OrderStatusCodeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderStatusCodeUpdate) SetNillableOrderStatus

func (oscu *OrderStatusCodeUpdate) SetNillableOrderStatus(s *string) *OrderStatusCodeUpdate

SetNillableOrderStatus sets the "order_status" field if the given value is not nil.

func (*OrderStatusCodeUpdate) SetOrderStatus

func (oscu *OrderStatusCodeUpdate) SetOrderStatus(s string) *OrderStatusCodeUpdate

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeUpdate) SetUpdatedAt

func (oscu *OrderStatusCodeUpdate) SetUpdatedAt(t time.Time) *OrderStatusCodeUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrderStatusCodeUpdate) Where

Where appends a list predicates to the OrderStatusCodeUpdate builder.

type OrderStatusCodeUpdateOne

type OrderStatusCodeUpdateOne struct {
	// contains filtered or unexported fields
}

OrderStatusCodeUpdateOne is the builder for updating a single OrderStatusCode entity.

func (*OrderStatusCodeUpdateOne) Exec

func (oscuo *OrderStatusCodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderStatusCodeUpdateOne) ExecX

func (oscuo *OrderStatusCodeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderStatusCodeUpdateOne) Mutation

Mutation returns the OrderStatusCodeMutation object of the builder.

func (*OrderStatusCodeUpdateOne) Save

Save executes the query and returns the updated OrderStatusCode entity.

func (*OrderStatusCodeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OrderStatusCodeUpdateOne) Select

func (oscuo *OrderStatusCodeUpdateOne) Select(field string, fields ...string) *OrderStatusCodeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderStatusCodeUpdateOne) SetNillableOrderStatus

func (oscuo *OrderStatusCodeUpdateOne) SetNillableOrderStatus(s *string) *OrderStatusCodeUpdateOne

SetNillableOrderStatus sets the "order_status" field if the given value is not nil.

func (*OrderStatusCodeUpdateOne) SetOrderStatus

func (oscuo *OrderStatusCodeUpdateOne) SetOrderStatus(s string) *OrderStatusCodeUpdateOne

SetOrderStatus sets the "order_status" field.

func (*OrderStatusCodeUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*OrderStatusCodeUpdateOne) Where

Where appends a list predicates to the OrderStatusCodeUpdate builder.

type OrderStatusCodes

type OrderStatusCodes []*OrderStatusCode

OrderStatusCodes is a parsable slice of OrderStatusCode.

type OrderUpdate

type OrderUpdate struct {
	// contains filtered or unexported fields
}

OrderUpdate is the builder for updating Order entities.

func (*OrderUpdate) AddPriority

func (ou *OrderUpdate) AddPriority(i int) *OrderUpdate

AddPriority adds i to the "priority" field.

func (*OrderUpdate) ClearDeliveryStaff

func (ou *OrderUpdate) ClearDeliveryStaff() *OrderUpdate

ClearDeliveryStaff clears the "delivery_staff" edge to the Person entity.

func (*OrderUpdate) ClearDeliveryStaffID

func (ou *OrderUpdate) ClearDeliveryStaffID() *OrderUpdate

ClearDeliveryStaffID clears the value of the "delivery_staff_id" field.

func (*OrderUpdate) ClearInternalNote

func (ou *OrderUpdate) ClearInternalNote() *OrderUpdate

ClearInternalNote clears the value of the "internal_note" field.

func (*OrderUpdate) ClearManagementStaff

func (ou *OrderUpdate) ClearManagementStaff() *OrderUpdate

ClearManagementStaff clears the "management_staff" edge to the Person entity.

func (*OrderUpdate) ClearNote

func (ou *OrderUpdate) ClearNote() *OrderUpdate

ClearNote clears the value of the "note" field.

func (*OrderUpdate) ClearOrderStatus

func (ou *OrderUpdate) ClearOrderStatus() *OrderUpdate

ClearOrderStatus clears the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdate) ClearParentOrder

func (ou *OrderUpdate) ClearParentOrder() *OrderUpdate

ClearParentOrder clears the "parent_order" edge to the Order entity.

func (*OrderUpdate) ClearParentOrderID

func (ou *OrderUpdate) ClearParentOrderID() *OrderUpdate

ClearParentOrderID clears the value of the "parent_order_id" field.

func (*OrderUpdate) ClearWarehouseStaff

func (ou *OrderUpdate) ClearWarehouseStaff() *OrderUpdate

ClearWarehouseStaff clears the "warehouse_staff" edge to the Person entity.

func (*OrderUpdate) ClearWarehouseStaffID

func (ou *OrderUpdate) ClearWarehouseStaffID() *OrderUpdate

ClearWarehouseStaffID clears the value of the "warehouse_staff_id" field.

func (*OrderUpdate) Exec

func (ou *OrderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderUpdate) ExecX

func (ou *OrderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderUpdate) Mutation

func (ou *OrderUpdate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdate) Save

func (ou *OrderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OrderUpdate) SaveX

func (ou *OrderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OrderUpdate) SetDeliveryStaff

func (ou *OrderUpdate) SetDeliveryStaff(p *Person) *OrderUpdate

SetDeliveryStaff sets the "delivery_staff" edge to the Person entity.

func (*OrderUpdate) SetDeliveryStaffID

func (ou *OrderUpdate) SetDeliveryStaffID(u uuid.UUID) *OrderUpdate

SetDeliveryStaffID sets the "delivery_staff_id" field.

func (*OrderUpdate) SetInternalNote

func (ou *OrderUpdate) SetInternalNote(s string) *OrderUpdate

SetInternalNote sets the "internal_note" field.

func (*OrderUpdate) SetManagementStaff

func (ou *OrderUpdate) SetManagementStaff(p *Person) *OrderUpdate

SetManagementStaff sets the "management_staff" edge to the Person entity.

func (*OrderUpdate) SetManagementStaffID

func (ou *OrderUpdate) SetManagementStaffID(u uuid.UUID) *OrderUpdate

SetManagementStaffID sets the "management_staff_id" field.

func (*OrderUpdate) SetNillableDeliveryStaffID

func (ou *OrderUpdate) SetNillableDeliveryStaffID(u *uuid.UUID) *OrderUpdate

SetNillableDeliveryStaffID sets the "delivery_staff_id" field if the given value is not nil.

func (*OrderUpdate) SetNillableInternalNote

func (ou *OrderUpdate) SetNillableInternalNote(s *string) *OrderUpdate

SetNillableInternalNote sets the "internal_note" field if the given value is not nil.

func (*OrderUpdate) SetNillableManagementStaffID

func (ou *OrderUpdate) SetNillableManagementStaffID(u *uuid.UUID) *OrderUpdate

SetNillableManagementStaffID sets the "management_staff_id" field if the given value is not nil.

func (*OrderUpdate) SetNillableNote

func (ou *OrderUpdate) SetNillableNote(s *string) *OrderUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*OrderUpdate) SetNillableParentOrderID

func (ou *OrderUpdate) SetNillableParentOrderID(u *uuid.UUID) *OrderUpdate

SetNillableParentOrderID sets the "parent_order_id" field if the given value is not nil.

func (*OrderUpdate) SetNillablePriority

func (ou *OrderUpdate) SetNillablePriority(i *int) *OrderUpdate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*OrderUpdate) SetNillableStatusCode

func (ou *OrderUpdate) SetNillableStatusCode(i *int) *OrderUpdate

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*OrderUpdate) SetNillableWarehouseStaffID

func (ou *OrderUpdate) SetNillableWarehouseStaffID(u *uuid.UUID) *OrderUpdate

SetNillableWarehouseStaffID sets the "warehouse_staff_id" field if the given value is not nil.

func (*OrderUpdate) SetNote

func (ou *OrderUpdate) SetNote(s string) *OrderUpdate

SetNote sets the "note" field.

func (*OrderUpdate) SetOrderStatus

func (ou *OrderUpdate) SetOrderStatus(o *OrderStatusCode) *OrderUpdate

SetOrderStatus sets the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdate) SetOrderStatusID

func (ou *OrderUpdate) SetOrderStatusID(id int) *OrderUpdate

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by ID.

func (*OrderUpdate) SetParentOrder

func (ou *OrderUpdate) SetParentOrder(o *Order) *OrderUpdate

SetParentOrder sets the "parent_order" edge to the Order entity.

func (*OrderUpdate) SetParentOrderID

func (ou *OrderUpdate) SetParentOrderID(u uuid.UUID) *OrderUpdate

SetParentOrderID sets the "parent_order_id" field.

func (*OrderUpdate) SetPriority

func (ou *OrderUpdate) SetPriority(i int) *OrderUpdate

SetPriority sets the "priority" field.

func (*OrderUpdate) SetStatusCode

func (ou *OrderUpdate) SetStatusCode(i int) *OrderUpdate

SetStatusCode sets the "status_code" field.

func (*OrderUpdate) SetUpdatedAt

func (ou *OrderUpdate) SetUpdatedAt(t time.Time) *OrderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OrderUpdate) SetWarehouseStaff

func (ou *OrderUpdate) SetWarehouseStaff(p *Person) *OrderUpdate

SetWarehouseStaff sets the "warehouse_staff" edge to the Person entity.

func (*OrderUpdate) SetWarehouseStaffID

func (ou *OrderUpdate) SetWarehouseStaffID(u uuid.UUID) *OrderUpdate

SetWarehouseStaffID sets the "warehouse_staff_id" field.

func (*OrderUpdate) Where

func (ou *OrderUpdate) Where(ps ...predicate.Order) *OrderUpdate

Where appends a list predicates to the OrderUpdate builder.

type OrderUpdateOne

type OrderUpdateOne struct {
	// contains filtered or unexported fields
}

OrderUpdateOne is the builder for updating a single Order entity.

func (*OrderUpdateOne) AddPriority

func (ouo *OrderUpdateOne) AddPriority(i int) *OrderUpdateOne

AddPriority adds i to the "priority" field.

func (*OrderUpdateOne) ClearDeliveryStaff

func (ouo *OrderUpdateOne) ClearDeliveryStaff() *OrderUpdateOne

ClearDeliveryStaff clears the "delivery_staff" edge to the Person entity.

func (*OrderUpdateOne) ClearDeliveryStaffID

func (ouo *OrderUpdateOne) ClearDeliveryStaffID() *OrderUpdateOne

ClearDeliveryStaffID clears the value of the "delivery_staff_id" field.

func (*OrderUpdateOne) ClearInternalNote

func (ouo *OrderUpdateOne) ClearInternalNote() *OrderUpdateOne

ClearInternalNote clears the value of the "internal_note" field.

func (*OrderUpdateOne) ClearManagementStaff

func (ouo *OrderUpdateOne) ClearManagementStaff() *OrderUpdateOne

ClearManagementStaff clears the "management_staff" edge to the Person entity.

func (*OrderUpdateOne) ClearNote

func (ouo *OrderUpdateOne) ClearNote() *OrderUpdateOne

ClearNote clears the value of the "note" field.

func (*OrderUpdateOne) ClearOrderStatus

func (ouo *OrderUpdateOne) ClearOrderStatus() *OrderUpdateOne

ClearOrderStatus clears the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdateOne) ClearParentOrder

func (ouo *OrderUpdateOne) ClearParentOrder() *OrderUpdateOne

ClearParentOrder clears the "parent_order" edge to the Order entity.

func (*OrderUpdateOne) ClearParentOrderID

func (ouo *OrderUpdateOne) ClearParentOrderID() *OrderUpdateOne

ClearParentOrderID clears the value of the "parent_order_id" field.

func (*OrderUpdateOne) ClearWarehouseStaff

func (ouo *OrderUpdateOne) ClearWarehouseStaff() *OrderUpdateOne

ClearWarehouseStaff clears the "warehouse_staff" edge to the Person entity.

func (*OrderUpdateOne) ClearWarehouseStaffID

func (ouo *OrderUpdateOne) ClearWarehouseStaffID() *OrderUpdateOne

ClearWarehouseStaffID clears the value of the "warehouse_staff_id" field.

func (*OrderUpdateOne) Exec

func (ouo *OrderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderUpdateOne) ExecX

func (ouo *OrderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OrderUpdateOne) Mutation

func (ouo *OrderUpdateOne) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdateOne) Save

func (ouo *OrderUpdateOne) Save(ctx context.Context) (*Order, error)

Save executes the query and returns the updated Order entity.

func (*OrderUpdateOne) SaveX

func (ouo *OrderUpdateOne) SaveX(ctx context.Context) *Order

SaveX is like Save, but panics if an error occurs.

func (*OrderUpdateOne) Select

func (ouo *OrderUpdateOne) Select(field string, fields ...string) *OrderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OrderUpdateOne) SetDeliveryStaff

func (ouo *OrderUpdateOne) SetDeliveryStaff(p *Person) *OrderUpdateOne

SetDeliveryStaff sets the "delivery_staff" edge to the Person entity.

func (*OrderUpdateOne) SetDeliveryStaffID

func (ouo *OrderUpdateOne) SetDeliveryStaffID(u uuid.UUID) *OrderUpdateOne

SetDeliveryStaffID sets the "delivery_staff_id" field.

func (*OrderUpdateOne) SetInternalNote

func (ouo *OrderUpdateOne) SetInternalNote(s string) *OrderUpdateOne

SetInternalNote sets the "internal_note" field.

func (*OrderUpdateOne) SetManagementStaff

func (ouo *OrderUpdateOne) SetManagementStaff(p *Person) *OrderUpdateOne

SetManagementStaff sets the "management_staff" edge to the Person entity.

func (*OrderUpdateOne) SetManagementStaffID

func (ouo *OrderUpdateOne) SetManagementStaffID(u uuid.UUID) *OrderUpdateOne

SetManagementStaffID sets the "management_staff_id" field.

func (*OrderUpdateOne) SetNillableDeliveryStaffID

func (ouo *OrderUpdateOne) SetNillableDeliveryStaffID(u *uuid.UUID) *OrderUpdateOne

SetNillableDeliveryStaffID sets the "delivery_staff_id" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableInternalNote

func (ouo *OrderUpdateOne) SetNillableInternalNote(s *string) *OrderUpdateOne

SetNillableInternalNote sets the "internal_note" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableManagementStaffID

func (ouo *OrderUpdateOne) SetNillableManagementStaffID(u *uuid.UUID) *OrderUpdateOne

SetNillableManagementStaffID sets the "management_staff_id" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableNote

func (ouo *OrderUpdateOne) SetNillableNote(s *string) *OrderUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableParentOrderID

func (ouo *OrderUpdateOne) SetNillableParentOrderID(u *uuid.UUID) *OrderUpdateOne

SetNillableParentOrderID sets the "parent_order_id" field if the given value is not nil.

func (*OrderUpdateOne) SetNillablePriority

func (ouo *OrderUpdateOne) SetNillablePriority(i *int) *OrderUpdateOne

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableStatusCode

func (ouo *OrderUpdateOne) SetNillableStatusCode(i *int) *OrderUpdateOne

SetNillableStatusCode sets the "status_code" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableWarehouseStaffID

func (ouo *OrderUpdateOne) SetNillableWarehouseStaffID(u *uuid.UUID) *OrderUpdateOne

SetNillableWarehouseStaffID sets the "warehouse_staff_id" field if the given value is not nil.

func (*OrderUpdateOne) SetNote

func (ouo *OrderUpdateOne) SetNote(s string) *OrderUpdateOne

SetNote sets the "note" field.

func (*OrderUpdateOne) SetOrderStatus

func (ouo *OrderUpdateOne) SetOrderStatus(o *OrderStatusCode) *OrderUpdateOne

SetOrderStatus sets the "order_status" edge to the OrderStatusCode entity.

func (*OrderUpdateOne) SetOrderStatusID

func (ouo *OrderUpdateOne) SetOrderStatusID(id int) *OrderUpdateOne

SetOrderStatusID sets the "order_status" edge to the OrderStatusCode entity by ID.

func (*OrderUpdateOne) SetParentOrder

func (ouo *OrderUpdateOne) SetParentOrder(o *Order) *OrderUpdateOne

SetParentOrder sets the "parent_order" edge to the Order entity.

func (*OrderUpdateOne) SetParentOrderID

func (ouo *OrderUpdateOne) SetParentOrderID(u uuid.UUID) *OrderUpdateOne

SetParentOrderID sets the "parent_order_id" field.

func (*OrderUpdateOne) SetPriority

func (ouo *OrderUpdateOne) SetPriority(i int) *OrderUpdateOne

SetPriority sets the "priority" field.

func (*OrderUpdateOne) SetStatusCode

func (ouo *OrderUpdateOne) SetStatusCode(i int) *OrderUpdateOne

SetStatusCode sets the "status_code" field.

func (*OrderUpdateOne) SetUpdatedAt

func (ouo *OrderUpdateOne) SetUpdatedAt(t time.Time) *OrderUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OrderUpdateOne) SetWarehouseStaff

func (ouo *OrderUpdateOne) SetWarehouseStaff(p *Person) *OrderUpdateOne

SetWarehouseStaff sets the "warehouse_staff" edge to the Person entity.

func (*OrderUpdateOne) SetWarehouseStaffID

func (ouo *OrderUpdateOne) SetWarehouseStaffID(u uuid.UUID) *OrderUpdateOne

SetWarehouseStaffID sets the "warehouse_staff_id" field.

func (*OrderUpdateOne) Where

func (ouo *OrderUpdateOne) Where(ps ...predicate.Order) *OrderUpdateOne

Where appends a list predicates to the OrderUpdate builder.

type Orders

type Orders []*Order

Orders is a parsable slice of Order.

type Person

type Person struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// AvatarURL holds the value of the "avatar_url" field.
	AvatarURL string `json:"avatar_url,omitempty"`
	// Email holds the value of the "email" field.
	Email *string `json:"email,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// Role holds the value of the "role" field.
	Role person.Role `json:"role,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash *[]byte `json:"-"`
	// IsEmailVerified holds the value of the "is_email_verified" field.
	IsEmailVerified bool `json:"is_email_verified,omitempty"`
	// IsPhoneVerified holds the value of the "is_phone_verified" field.
	IsPhoneVerified bool `json:"is_phone_verified,omitempty"`
	// contains filtered or unexported fields
}

Person is the model entity for the Person schema.

func (*Person) String

func (pe *Person) String() string

String implements the fmt.Stringer.

func (*Person) Unwrap

func (pe *Person) Unwrap() *Person

Unwrap unwraps the Person 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 (*Person) Update

func (pe *Person) Update() *PersonUpdateOne

Update returns a builder for updating this Person. Note that you need to call Person.Unwrap() before calling this method if this Person was returned from a transaction, and the transaction was committed or rolled back.

func (*Person) Value

func (pe *Person) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Person. This includes values selected through modifiers, order, etc.

type PersonClient

type PersonClient struct {
	// contains filtered or unexported fields
}

PersonClient is a client for the Person schema.

func NewPersonClient

func NewPersonClient(c config) *PersonClient

NewPersonClient returns a client for the Person from the given config.

func (*PersonClient) Create

func (c *PersonClient) Create() *PersonCreate

Create returns a builder for creating a Person entity.

func (*PersonClient) CreateBulk

func (c *PersonClient) CreateBulk(builders ...*PersonCreate) *PersonCreateBulk

CreateBulk returns a builder for creating a bulk of Person entities.

func (*PersonClient) Delete

func (c *PersonClient) Delete() *PersonDelete

Delete returns a delete builder for Person.

func (*PersonClient) DeleteOne

func (c *PersonClient) DeleteOne(pe *Person) *PersonDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PersonClient) DeleteOneID

func (c *PersonClient) DeleteOneID(id uuid.UUID) *PersonDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PersonClient) Get

func (c *PersonClient) Get(ctx context.Context, id uuid.UUID) (*Person, error)

Get returns a Person entity by its id.

func (*PersonClient) GetX

func (c *PersonClient) GetX(ctx context.Context, id uuid.UUID) *Person

GetX is like Get, but panics if an error occurs.

func (*PersonClient) Hooks

func (c *PersonClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PersonClient) Intercept

func (c *PersonClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `person.Intercept(f(g(h())))`.

func (*PersonClient) Interceptors

func (c *PersonClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PersonClient) MapCreateBulk

func (c *PersonClient) MapCreateBulk(slice any, setFunc func(*PersonCreate, int)) *PersonCreateBulk

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 (*PersonClient) Query

func (c *PersonClient) Query() *PersonQuery

Query returns a query builder for Person.

func (*PersonClient) Update

func (c *PersonClient) Update() *PersonUpdate

Update returns an update builder for Person.

func (*PersonClient) UpdateOne

func (c *PersonClient) UpdateOne(pe *Person) *PersonUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PersonClient) UpdateOneID

func (c *PersonClient) UpdateOneID(id uuid.UUID) *PersonUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PersonClient) Use

func (c *PersonClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `person.Hooks(f(g(h())))`.

type PersonCreate

type PersonCreate struct {
	// contains filtered or unexported fields
}

PersonCreate is the builder for creating a Person entity.

func (*PersonCreate) Exec

func (pc *PersonCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreate) ExecX

func (pc *PersonCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonCreate) Mutation

func (pc *PersonCreate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonCreate) Save

func (pc *PersonCreate) Save(ctx context.Context) (*Person, error)

Save creates the Person in the database.

func (*PersonCreate) SaveX

func (pc *PersonCreate) SaveX(ctx context.Context) *Person

SaveX calls Save and panics if Save returns an error.

func (*PersonCreate) SetAvatarURL

func (pc *PersonCreate) SetAvatarURL(s string) *PersonCreate

SetAvatarURL sets the "avatar_url" field.

func (*PersonCreate) SetCreatedAt

func (pc *PersonCreate) SetCreatedAt(t time.Time) *PersonCreate

SetCreatedAt sets the "created_at" field.

func (*PersonCreate) SetEmail

func (pc *PersonCreate) SetEmail(s string) *PersonCreate

SetEmail sets the "email" field.

func (*PersonCreate) SetID

func (pc *PersonCreate) SetID(u uuid.UUID) *PersonCreate

SetID sets the "id" field.

func (*PersonCreate) SetIsEmailVerified

func (pc *PersonCreate) SetIsEmailVerified(b bool) *PersonCreate

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonCreate) SetIsPhoneVerified

func (pc *PersonCreate) SetIsPhoneVerified(b bool) *PersonCreate

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonCreate) SetName

func (pc *PersonCreate) SetName(s string) *PersonCreate

SetName sets the "name" field.

func (*PersonCreate) SetNillableAvatarURL

func (pc *PersonCreate) SetNillableAvatarURL(s *string) *PersonCreate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*PersonCreate) SetNillableCreatedAt

func (pc *PersonCreate) SetNillableCreatedAt(t *time.Time) *PersonCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PersonCreate) SetNillableEmail

func (pc *PersonCreate) SetNillableEmail(s *string) *PersonCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonCreate) SetNillableID

func (pc *PersonCreate) SetNillableID(u *uuid.UUID) *PersonCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PersonCreate) SetNillableIsEmailVerified

func (pc *PersonCreate) SetNillableIsEmailVerified(b *bool) *PersonCreate

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*PersonCreate) SetNillableIsPhoneVerified

func (pc *PersonCreate) SetNillableIsPhoneVerified(b *bool) *PersonCreate

SetNillableIsPhoneVerified sets the "is_phone_verified" field if the given value is not nil.

func (*PersonCreate) SetNillableRole

func (pc *PersonCreate) SetNillableRole(pe *person.Role) *PersonCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*PersonCreate) SetNillableUpdatedAt

func (pc *PersonCreate) SetNillableUpdatedAt(t *time.Time) *PersonCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PersonCreate) SetPasswordHash

func (pc *PersonCreate) SetPasswordHash(b []byte) *PersonCreate

SetPasswordHash sets the "password_hash" field.

func (*PersonCreate) SetPhone

func (pc *PersonCreate) SetPhone(s string) *PersonCreate

SetPhone sets the "phone" field.

func (*PersonCreate) SetRole

func (pc *PersonCreate) SetRole(pe person.Role) *PersonCreate

SetRole sets the "role" field.

func (*PersonCreate) SetUpdatedAt

func (pc *PersonCreate) SetUpdatedAt(t time.Time) *PersonCreate

SetUpdatedAt sets the "updated_at" field.

type PersonCreateBulk

type PersonCreateBulk struct {
	// contains filtered or unexported fields
}

PersonCreateBulk is the builder for creating many Person entities in bulk.

func (*PersonCreateBulk) Exec

func (pcb *PersonCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonCreateBulk) ExecX

func (pcb *PersonCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonCreateBulk) Save

func (pcb *PersonCreateBulk) Save(ctx context.Context) ([]*Person, error)

Save creates the Person entities in the database.

func (*PersonCreateBulk) SaveX

func (pcb *PersonCreateBulk) SaveX(ctx context.Context) []*Person

SaveX is like Save, but panics if an error occurs.

type PersonDelete

type PersonDelete struct {
	// contains filtered or unexported fields
}

PersonDelete is the builder for deleting a Person entity.

func (*PersonDelete) Exec

func (pd *PersonDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PersonDelete) ExecX

func (pd *PersonDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PersonDelete) Where

func (pd *PersonDelete) Where(ps ...predicate.Person) *PersonDelete

Where appends a list predicates to the PersonDelete builder.

type PersonDeleteOne

type PersonDeleteOne struct {
	// contains filtered or unexported fields
}

PersonDeleteOne is the builder for deleting a single Person entity.

func (*PersonDeleteOne) Exec

func (pdo *PersonDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PersonDeleteOne) ExecX

func (pdo *PersonDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonDeleteOne) Where

func (pdo *PersonDeleteOne) Where(ps ...predicate.Person) *PersonDeleteOne

Where appends a list predicates to the PersonDelete builder.

type PersonGroupBy

type PersonGroupBy struct {
	// contains filtered or unexported fields
}

PersonGroupBy is the group-by builder for Person entities.

func (*PersonGroupBy) Aggregate

func (pgb *PersonGroupBy) Aggregate(fns ...AggregateFunc) *PersonGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PersonGroupBy) Bool

func (s *PersonGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) BoolX

func (s *PersonGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonGroupBy) Bools

func (s *PersonGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) BoolsX

func (s *PersonGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonGroupBy) Float64

func (s *PersonGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) Float64X

func (s *PersonGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonGroupBy) Float64s

func (s *PersonGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) Float64sX

func (s *PersonGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonGroupBy) Int

func (s *PersonGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) IntX

func (s *PersonGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonGroupBy) Ints

func (s *PersonGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) IntsX

func (s *PersonGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonGroupBy) Scan

func (pgb *PersonGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonGroupBy) ScanX

func (s *PersonGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonGroupBy) String

func (s *PersonGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) StringX

func (s *PersonGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonGroupBy) Strings

func (s *PersonGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonGroupBy) StringsX

func (s *PersonGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonMutation

type PersonMutation struct {
	// contains filtered or unexported fields
}

PersonMutation represents an operation that mutates the Person nodes in the graph.

func (*PersonMutation) AddField

func (m *PersonMutation) 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 (*PersonMutation) AddedEdges

func (m *PersonMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PersonMutation) AddedField

func (m *PersonMutation) 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 (*PersonMutation) AddedFields

func (m *PersonMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PersonMutation) AddedIDs

func (m *PersonMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PersonMutation) AvatarURL

func (m *PersonMutation) AvatarURL() (r string, exists bool)

AvatarURL returns the value of the "avatar_url" field in the mutation.

func (*PersonMutation) AvatarURLCleared

func (m *PersonMutation) AvatarURLCleared() bool

AvatarURLCleared returns if the "avatar_url" field was cleared in this mutation.

func (*PersonMutation) ClearAvatarURL

func (m *PersonMutation) ClearAvatarURL()

ClearAvatarURL clears the value of the "avatar_url" field.

func (*PersonMutation) ClearEdge

func (m *PersonMutation) 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 (*PersonMutation) ClearEmail

func (m *PersonMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*PersonMutation) ClearField

func (m *PersonMutation) 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 (*PersonMutation) ClearPasswordHash

func (m *PersonMutation) ClearPasswordHash()

ClearPasswordHash clears the value of the "password_hash" field.

func (*PersonMutation) ClearedEdges

func (m *PersonMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PersonMutation) ClearedFields

func (m *PersonMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PersonMutation) Client

func (m PersonMutation) 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 (*PersonMutation) CreatedAt

func (m *PersonMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PersonMutation) EdgeCleared

func (m *PersonMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PersonMutation) Email

func (m *PersonMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*PersonMutation) EmailCleared

func (m *PersonMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*PersonMutation) Field

func (m *PersonMutation) 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 (*PersonMutation) FieldCleared

func (m *PersonMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PersonMutation) Fields

func (m *PersonMutation) 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 (*PersonMutation) ID

func (m *PersonMutation) ID() (id uuid.UUID, 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 (*PersonMutation) IDs

func (m *PersonMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*PersonMutation) IsEmailVerified

func (m *PersonMutation) IsEmailVerified() (r bool, exists bool)

IsEmailVerified returns the value of the "is_email_verified" field in the mutation.

func (*PersonMutation) IsPhoneVerified

func (m *PersonMutation) IsPhoneVerified() (r bool, exists bool)

IsPhoneVerified returns the value of the "is_phone_verified" field in the mutation.

func (*PersonMutation) Name

func (m *PersonMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PersonMutation) OldAvatarURL

func (m *PersonMutation) OldAvatarURL(ctx context.Context) (v string, err error)

OldAvatarURL returns the old "avatar_url" field's value of the Person entity. If the Person 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 (*PersonMutation) OldCreatedAt

func (m *PersonMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Person entity. If the Person 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 (*PersonMutation) OldEmail

func (m *PersonMutation) OldEmail(ctx context.Context) (v *string, err error)

OldEmail returns the old "email" field's value of the Person entity. If the Person 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 (*PersonMutation) OldField

func (m *PersonMutation) 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 (*PersonMutation) OldIsEmailVerified

func (m *PersonMutation) OldIsEmailVerified(ctx context.Context) (v bool, err error)

OldIsEmailVerified returns the old "is_email_verified" field's value of the Person entity. If the Person 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 (*PersonMutation) OldIsPhoneVerified

func (m *PersonMutation) OldIsPhoneVerified(ctx context.Context) (v bool, err error)

OldIsPhoneVerified returns the old "is_phone_verified" field's value of the Person entity. If the Person 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 (*PersonMutation) OldName

func (m *PersonMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPasswordHash

func (m *PersonMutation) OldPasswordHash(ctx context.Context) (v *[]byte, err error)

OldPasswordHash returns the old "password_hash" field's value of the Person entity. If the Person 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 (*PersonMutation) OldPhone

func (m *PersonMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Person entity. If the Person 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 (*PersonMutation) OldRole

func (m *PersonMutation) OldRole(ctx context.Context) (v person.Role, err error)

OldRole returns the old "role" field's value of the Person entity. If the Person 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 (*PersonMutation) OldUpdatedAt

func (m *PersonMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Person entity. If the Person 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 (*PersonMutation) Op

func (m *PersonMutation) Op() Op

Op returns the operation name.

func (*PersonMutation) PasswordHash

func (m *PersonMutation) PasswordHash() (r []byte, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*PersonMutation) PasswordHashCleared

func (m *PersonMutation) PasswordHashCleared() bool

PasswordHashCleared returns if the "password_hash" field was cleared in this mutation.

func (*PersonMutation) Phone

func (m *PersonMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*PersonMutation) RemovedEdges

func (m *PersonMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PersonMutation) RemovedIDs

func (m *PersonMutation) 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 (*PersonMutation) ResetAvatarURL

func (m *PersonMutation) ResetAvatarURL()

ResetAvatarURL resets all changes to the "avatar_url" field.

func (*PersonMutation) ResetCreatedAt

func (m *PersonMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PersonMutation) ResetEdge

func (m *PersonMutation) 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 (*PersonMutation) ResetEmail

func (m *PersonMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PersonMutation) ResetField

func (m *PersonMutation) 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 (*PersonMutation) ResetIsEmailVerified

func (m *PersonMutation) ResetIsEmailVerified()

ResetIsEmailVerified resets all changes to the "is_email_verified" field.

func (*PersonMutation) ResetIsPhoneVerified

func (m *PersonMutation) ResetIsPhoneVerified()

ResetIsPhoneVerified resets all changes to the "is_phone_verified" field.

func (*PersonMutation) ResetName

func (m *PersonMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PersonMutation) ResetPasswordHash

func (m *PersonMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*PersonMutation) ResetPhone

func (m *PersonMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*PersonMutation) ResetRole

func (m *PersonMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*PersonMutation) ResetUpdatedAt

func (m *PersonMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PersonMutation) Role

func (m *PersonMutation) Role() (r person.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*PersonMutation) SetAvatarURL

func (m *PersonMutation) SetAvatarURL(s string)

SetAvatarURL sets the "avatar_url" field.

func (*PersonMutation) SetCreatedAt

func (m *PersonMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PersonMutation) SetEmail

func (m *PersonMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PersonMutation) SetField

func (m *PersonMutation) 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 (*PersonMutation) SetID

func (m *PersonMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Person entities.

func (*PersonMutation) SetIsEmailVerified

func (m *PersonMutation) SetIsEmailVerified(b bool)

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonMutation) SetIsPhoneVerified

func (m *PersonMutation) SetIsPhoneVerified(b bool)

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonMutation) SetName

func (m *PersonMutation) SetName(s string)

SetName sets the "name" field.

func (*PersonMutation) SetOp

func (m *PersonMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PersonMutation) SetPasswordHash

func (m *PersonMutation) SetPasswordHash(b []byte)

SetPasswordHash sets the "password_hash" field.

func (*PersonMutation) SetPhone

func (m *PersonMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*PersonMutation) SetRole

func (m *PersonMutation) SetRole(pe person.Role)

SetRole sets the "role" field.

func (*PersonMutation) SetUpdatedAt

func (m *PersonMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (PersonMutation) Tx

func (m PersonMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PersonMutation) Type

func (m *PersonMutation) Type() string

Type returns the node type of this mutation (Person).

func (*PersonMutation) UpdatedAt

func (m *PersonMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PersonMutation) Where

func (m *PersonMutation) Where(ps ...predicate.Person)

Where appends a list predicates to the PersonMutation builder.

func (*PersonMutation) WhereP

func (m *PersonMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PersonMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PersonQuery

type PersonQuery struct {
	// contains filtered or unexported fields
}

PersonQuery is the builder for querying Person entities.

func (*PersonQuery) Aggregate

func (pq *PersonQuery) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate returns a PersonSelect configured with the given aggregations.

func (*PersonQuery) All

func (pq *PersonQuery) All(ctx context.Context) ([]*Person, error)

All executes the query and returns a list of Persons.

func (*PersonQuery) AllX

func (pq *PersonQuery) AllX(ctx context.Context) []*Person

AllX is like All, but panics if an error occurs.

func (*PersonQuery) Clone

func (pq *PersonQuery) Clone() *PersonQuery

Clone returns a duplicate of the PersonQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PersonQuery) Count

func (pq *PersonQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PersonQuery) CountX

func (pq *PersonQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PersonQuery) Exist

func (pq *PersonQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PersonQuery) ExistX

func (pq *PersonQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PersonQuery) First

func (pq *PersonQuery) First(ctx context.Context) (*Person, error)

First returns the first Person entity from the query. Returns a *NotFoundError when no Person was found.

func (*PersonQuery) FirstID

func (pq *PersonQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Person ID from the query. Returns a *NotFoundError when no Person ID was found.

func (*PersonQuery) FirstIDX

func (pq *PersonQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PersonQuery) FirstX

func (pq *PersonQuery) FirstX(ctx context.Context) *Person

FirstX is like First, but panics if an error occurs.

func (*PersonQuery) GroupBy

func (pq *PersonQuery) GroupBy(field string, fields ...string) *PersonGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Person.Query().
	GroupBy(person.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PersonQuery) IDs

func (pq *PersonQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Person IDs.

func (*PersonQuery) IDsX

func (pq *PersonQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PersonQuery) Limit

func (pq *PersonQuery) Limit(limit int) *PersonQuery

Limit the number of records to be returned by this query.

func (*PersonQuery) Offset

func (pq *PersonQuery) Offset(offset int) *PersonQuery

Offset to start from.

func (*PersonQuery) Only

func (pq *PersonQuery) Only(ctx context.Context) (*Person, error)

Only returns a single Person entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Person entity is found. Returns a *NotFoundError when no Person entities are found.

func (*PersonQuery) OnlyID

func (pq *PersonQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Person ID in the query. Returns a *NotSingularError when more than one Person ID is found. Returns a *NotFoundError when no entities are found.

func (*PersonQuery) OnlyIDX

func (pq *PersonQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PersonQuery) OnlyX

func (pq *PersonQuery) OnlyX(ctx context.Context) *Person

OnlyX is like Only, but panics if an error occurs.

func (*PersonQuery) Order

func (pq *PersonQuery) Order(o ...person.OrderOption) *PersonQuery

Order specifies how the records should be ordered.

func (*PersonQuery) Select

func (pq *PersonQuery) Select(fields ...string) *PersonSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Person.Query().
	Select(person.FieldCreatedAt).
	Scan(ctx, &v)

func (*PersonQuery) Unique

func (pq *PersonQuery) Unique(unique bool) *PersonQuery

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 (*PersonQuery) Where

func (pq *PersonQuery) Where(ps ...predicate.Person) *PersonQuery

Where adds a new predicate for the PersonQuery builder.

type PersonSelect

type PersonSelect struct {
	*PersonQuery
	// contains filtered or unexported fields
}

PersonSelect is the builder for selecting fields of Person entities.

func (*PersonSelect) Aggregate

func (ps *PersonSelect) Aggregate(fns ...AggregateFunc) *PersonSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PersonSelect) Bool

func (s *PersonSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PersonSelect) BoolX

func (s *PersonSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PersonSelect) Bools

func (s *PersonSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PersonSelect) BoolsX

func (s *PersonSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PersonSelect) Float64

func (s *PersonSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PersonSelect) Float64X

func (s *PersonSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PersonSelect) Float64s

func (s *PersonSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PersonSelect) Float64sX

func (s *PersonSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PersonSelect) Int

func (s *PersonSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PersonSelect) IntX

func (s *PersonSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PersonSelect) Ints

func (s *PersonSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PersonSelect) IntsX

func (s *PersonSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PersonSelect) Scan

func (ps *PersonSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PersonSelect) ScanX

func (s *PersonSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PersonSelect) String

func (s *PersonSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PersonSelect) StringX

func (s *PersonSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PersonSelect) Strings

func (s *PersonSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PersonSelect) StringsX

func (s *PersonSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PersonUpdate

type PersonUpdate struct {
	// contains filtered or unexported fields
}

PersonUpdate is the builder for updating Person entities.

func (*PersonUpdate) ClearAvatarURL

func (pu *PersonUpdate) ClearAvatarURL() *PersonUpdate

ClearAvatarURL clears the value of the "avatar_url" field.

func (*PersonUpdate) ClearEmail

func (pu *PersonUpdate) ClearEmail() *PersonUpdate

ClearEmail clears the value of the "email" field.

func (*PersonUpdate) ClearPasswordHash

func (pu *PersonUpdate) ClearPasswordHash() *PersonUpdate

ClearPasswordHash clears the value of the "password_hash" field.

func (*PersonUpdate) Exec

func (pu *PersonUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PersonUpdate) ExecX

func (pu *PersonUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpdate) Mutation

func (pu *PersonUpdate) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdate) Save

func (pu *PersonUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PersonUpdate) SaveX

func (pu *PersonUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PersonUpdate) SetAvatarURL

func (pu *PersonUpdate) SetAvatarURL(s string) *PersonUpdate

SetAvatarURL sets the "avatar_url" field.

func (*PersonUpdate) SetEmail

func (pu *PersonUpdate) SetEmail(s string) *PersonUpdate

SetEmail sets the "email" field.

func (*PersonUpdate) SetIsEmailVerified

func (pu *PersonUpdate) SetIsEmailVerified(b bool) *PersonUpdate

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonUpdate) SetIsPhoneVerified

func (pu *PersonUpdate) SetIsPhoneVerified(b bool) *PersonUpdate

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonUpdate) SetName

func (pu *PersonUpdate) SetName(s string) *PersonUpdate

SetName sets the "name" field.

func (*PersonUpdate) SetNillableAvatarURL

func (pu *PersonUpdate) SetNillableAvatarURL(s *string) *PersonUpdate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*PersonUpdate) SetNillableEmail

func (pu *PersonUpdate) SetNillableEmail(s *string) *PersonUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonUpdate) SetNillableIsEmailVerified

func (pu *PersonUpdate) SetNillableIsEmailVerified(b *bool) *PersonUpdate

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*PersonUpdate) SetNillableIsPhoneVerified

func (pu *PersonUpdate) SetNillableIsPhoneVerified(b *bool) *PersonUpdate

SetNillableIsPhoneVerified sets the "is_phone_verified" field if the given value is not nil.

func (*PersonUpdate) SetNillableName

func (pu *PersonUpdate) SetNillableName(s *string) *PersonUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonUpdate) SetNillablePhone

func (pu *PersonUpdate) SetNillablePhone(s *string) *PersonUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdate) SetNillableRole

func (pu *PersonUpdate) SetNillableRole(pe *person.Role) *PersonUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*PersonUpdate) SetPasswordHash

func (pu *PersonUpdate) SetPasswordHash(b []byte) *PersonUpdate

SetPasswordHash sets the "password_hash" field.

func (*PersonUpdate) SetPhone

func (pu *PersonUpdate) SetPhone(s string) *PersonUpdate

SetPhone sets the "phone" field.

func (*PersonUpdate) SetRole

func (pu *PersonUpdate) SetRole(pe person.Role) *PersonUpdate

SetRole sets the "role" field.

func (*PersonUpdate) SetUpdatedAt

func (pu *PersonUpdate) SetUpdatedAt(t time.Time) *PersonUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PersonUpdate) Where

func (pu *PersonUpdate) Where(ps ...predicate.Person) *PersonUpdate

Where appends a list predicates to the PersonUpdate builder.

type PersonUpdateOne

type PersonUpdateOne struct {
	// contains filtered or unexported fields
}

PersonUpdateOne is the builder for updating a single Person entity.

func (*PersonUpdateOne) ClearAvatarURL

func (puo *PersonUpdateOne) ClearAvatarURL() *PersonUpdateOne

ClearAvatarURL clears the value of the "avatar_url" field.

func (*PersonUpdateOne) ClearEmail

func (puo *PersonUpdateOne) ClearEmail() *PersonUpdateOne

ClearEmail clears the value of the "email" field.

func (*PersonUpdateOne) ClearPasswordHash

func (puo *PersonUpdateOne) ClearPasswordHash() *PersonUpdateOne

ClearPasswordHash clears the value of the "password_hash" field.

func (*PersonUpdateOne) Exec

func (puo *PersonUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PersonUpdateOne) ExecX

func (puo *PersonUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PersonUpdateOne) Mutation

func (puo *PersonUpdateOne) Mutation() *PersonMutation

Mutation returns the PersonMutation object of the builder.

func (*PersonUpdateOne) Save

func (puo *PersonUpdateOne) Save(ctx context.Context) (*Person, error)

Save executes the query and returns the updated Person entity.

func (*PersonUpdateOne) SaveX

func (puo *PersonUpdateOne) SaveX(ctx context.Context) *Person

SaveX is like Save, but panics if an error occurs.

func (*PersonUpdateOne) Select

func (puo *PersonUpdateOne) Select(field string, fields ...string) *PersonUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PersonUpdateOne) SetAvatarURL

func (puo *PersonUpdateOne) SetAvatarURL(s string) *PersonUpdateOne

SetAvatarURL sets the "avatar_url" field.

func (*PersonUpdateOne) SetEmail

func (puo *PersonUpdateOne) SetEmail(s string) *PersonUpdateOne

SetEmail sets the "email" field.

func (*PersonUpdateOne) SetIsEmailVerified

func (puo *PersonUpdateOne) SetIsEmailVerified(b bool) *PersonUpdateOne

SetIsEmailVerified sets the "is_email_verified" field.

func (*PersonUpdateOne) SetIsPhoneVerified

func (puo *PersonUpdateOne) SetIsPhoneVerified(b bool) *PersonUpdateOne

SetIsPhoneVerified sets the "is_phone_verified" field.

func (*PersonUpdateOne) SetName

func (puo *PersonUpdateOne) SetName(s string) *PersonUpdateOne

SetName sets the "name" field.

func (*PersonUpdateOne) SetNillableAvatarURL

func (puo *PersonUpdateOne) SetNillableAvatarURL(s *string) *PersonUpdateOne

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableEmail

func (puo *PersonUpdateOne) SetNillableEmail(s *string) *PersonUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableIsEmailVerified

func (puo *PersonUpdateOne) SetNillableIsEmailVerified(b *bool) *PersonUpdateOne

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableIsPhoneVerified

func (puo *PersonUpdateOne) SetNillableIsPhoneVerified(b *bool) *PersonUpdateOne

SetNillableIsPhoneVerified sets the "is_phone_verified" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableName

func (puo *PersonUpdateOne) SetNillableName(s *string) *PersonUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PersonUpdateOne) SetNillablePhone

func (puo *PersonUpdateOne) SetNillablePhone(s *string) *PersonUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PersonUpdateOne) SetNillableRole

func (puo *PersonUpdateOne) SetNillableRole(pe *person.Role) *PersonUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*PersonUpdateOne) SetPasswordHash

func (puo *PersonUpdateOne) SetPasswordHash(b []byte) *PersonUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*PersonUpdateOne) SetPhone

func (puo *PersonUpdateOne) SetPhone(s string) *PersonUpdateOne

SetPhone sets the "phone" field.

func (*PersonUpdateOne) SetRole

func (puo *PersonUpdateOne) SetRole(pe person.Role) *PersonUpdateOne

SetRole sets the "role" field.

func (*PersonUpdateOne) SetUpdatedAt

func (puo *PersonUpdateOne) SetUpdatedAt(t time.Time) *PersonUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PersonUpdateOne) Where

func (puo *PersonUpdateOne) Where(ps ...predicate.Person) *PersonUpdateOne

Where appends a list predicates to the PersonUpdate builder.

type Persons

type Persons []*Person

Persons is a parsable slice of Person.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Product

type Product struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Year holds the value of the "year" field.
	Year *int `json:"year,omitempty"`
	// Price holds the value of the "price" field.
	Price decimal.Decimal `json:"price,omitempty"`
	// Qty holds the value of the "qty" field.
	Qty decimal.Decimal `json:"qty,omitempty"`
	// Colors holds the value of the "colors" field.
	Colors []string `json:"colors,omitempty"`
	// Provider holds the value of the "provider" field.
	Provider *string `json:"provider,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductQuery when eager-loading is set.
	Edges ProductEdges `json:"edges"`
	// contains filtered or unexported fields
}

Product is the model entity for the Product schema.

func (*Product) QueryProductTags

func (pr *Product) QueryProductTags() *ProductTagQuery

QueryProductTags queries the "product_tags" edge of the Product entity.

func (*Product) QueryTags

func (pr *Product) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Product entity.

func (*Product) String

func (pr *Product) String() string

String implements the fmt.Stringer.

func (*Product) Unwrap

func (pr *Product) Unwrap() *Product

Unwrap unwraps the Product 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 (*Product) Update

func (pr *Product) Update() *ProductUpdateOne

Update returns a builder for updating this Product. Note that you need to call Product.Unwrap() before calling this method if this Product was returned from a transaction, and the transaction was committed or rolled back.

func (*Product) Value

func (pr *Product) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Product. This includes values selected through modifiers, order, etc.

type ProductClient

type ProductClient struct {
	// contains filtered or unexported fields
}

ProductClient is a client for the Product schema.

func NewProductClient

func NewProductClient(c config) *ProductClient

NewProductClient returns a client for the Product from the given config.

func (*ProductClient) Create

func (c *ProductClient) Create() *ProductCreate

Create returns a builder for creating a Product entity.

func (*ProductClient) CreateBulk

func (c *ProductClient) CreateBulk(builders ...*ProductCreate) *ProductCreateBulk

CreateBulk returns a builder for creating a bulk of Product entities.

func (*ProductClient) Delete

func (c *ProductClient) Delete() *ProductDelete

Delete returns a delete builder for Product.

func (*ProductClient) DeleteOne

func (c *ProductClient) DeleteOne(pr *Product) *ProductDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductClient) DeleteOneID

func (c *ProductClient) DeleteOneID(id string) *ProductDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductClient) Get

func (c *ProductClient) Get(ctx context.Context, id string) (*Product, error)

Get returns a Product entity by its id.

func (*ProductClient) GetX

func (c *ProductClient) GetX(ctx context.Context, id string) *Product

GetX is like Get, but panics if an error occurs.

func (*ProductClient) Hooks

func (c *ProductClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductClient) Intercept

func (c *ProductClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `product.Intercept(f(g(h())))`.

func (*ProductClient) Interceptors

func (c *ProductClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductClient) MapCreateBulk

func (c *ProductClient) MapCreateBulk(slice any, setFunc func(*ProductCreate, int)) *ProductCreateBulk

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 (*ProductClient) Query

func (c *ProductClient) Query() *ProductQuery

Query returns a query builder for Product.

func (*ProductClient) QueryProductTags

func (c *ProductClient) QueryProductTags(pr *Product) *ProductTagQuery

QueryProductTags queries the product_tags edge of a Product.

func (*ProductClient) QueryTags

func (c *ProductClient) QueryTags(pr *Product) *TagQuery

QueryTags queries the tags edge of a Product.

func (*ProductClient) Update

func (c *ProductClient) Update() *ProductUpdate

Update returns an update builder for Product.

func (*ProductClient) UpdateOne

func (c *ProductClient) UpdateOne(pr *Product) *ProductUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductClient) UpdateOneID

func (c *ProductClient) UpdateOneID(id string) *ProductUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductClient) Use

func (c *ProductClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `product.Hooks(f(g(h())))`.

type ProductCreate

type ProductCreate struct {
	// contains filtered or unexported fields
}

ProductCreate is the builder for creating a Product entity.

func (*ProductCreate) AddTagIDs

func (pc *ProductCreate) AddTagIDs(ids ...string) *ProductCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProductCreate) AddTags

func (pc *ProductCreate) AddTags(t ...*Tag) *ProductCreate

AddTags adds the "tags" edges to the Tag entity.

func (*ProductCreate) Exec

func (pc *ProductCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreate) ExecX

func (pc *ProductCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreate) Mutation

func (pc *ProductCreate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductCreate) Save

func (pc *ProductCreate) Save(ctx context.Context) (*Product, error)

Save creates the Product in the database.

func (*ProductCreate) SaveX

func (pc *ProductCreate) SaveX(ctx context.Context) *Product

SaveX calls Save and panics if Save returns an error.

func (*ProductCreate) SetColors

func (pc *ProductCreate) SetColors(s []string) *ProductCreate

SetColors sets the "colors" field.

func (*ProductCreate) SetCreatedAt

func (pc *ProductCreate) SetCreatedAt(t time.Time) *ProductCreate

SetCreatedAt sets the "created_at" field.

func (*ProductCreate) SetDescription

func (pc *ProductCreate) SetDescription(s string) *ProductCreate

SetDescription sets the "description" field.

func (*ProductCreate) SetID

func (pc *ProductCreate) SetID(s string) *ProductCreate

SetID sets the "id" field.

func (*ProductCreate) SetName

func (pc *ProductCreate) SetName(s string) *ProductCreate

SetName sets the "name" field.

func (*ProductCreate) SetNillableCreatedAt

func (pc *ProductCreate) SetNillableCreatedAt(t *time.Time) *ProductCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductCreate) SetNillableDescription

func (pc *ProductCreate) SetNillableDescription(s *string) *ProductCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductCreate) SetNillableProvider

func (pc *ProductCreate) SetNillableProvider(s *string) *ProductCreate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*ProductCreate) SetNillableUpdatedAt

func (pc *ProductCreate) SetNillableUpdatedAt(t *time.Time) *ProductCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductCreate) SetNillableYear

func (pc *ProductCreate) SetNillableYear(i *int) *ProductCreate

SetNillableYear sets the "year" field if the given value is not nil.

func (*ProductCreate) SetPrice

func (pc *ProductCreate) SetPrice(d decimal.Decimal) *ProductCreate

SetPrice sets the "price" field.

func (*ProductCreate) SetProvider

func (pc *ProductCreate) SetProvider(s string) *ProductCreate

SetProvider sets the "provider" field.

func (*ProductCreate) SetQty

func (pc *ProductCreate) SetQty(d decimal.Decimal) *ProductCreate

SetQty sets the "qty" field.

func (*ProductCreate) SetUpdatedAt

func (pc *ProductCreate) SetUpdatedAt(t time.Time) *ProductCreate

SetUpdatedAt sets the "updated_at" field.

func (*ProductCreate) SetYear

func (pc *ProductCreate) SetYear(i int) *ProductCreate

SetYear sets the "year" field.

type ProductCreateBulk

type ProductCreateBulk struct {
	// contains filtered or unexported fields
}

ProductCreateBulk is the builder for creating many Product entities in bulk.

func (*ProductCreateBulk) Exec

func (pcb *ProductCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductCreateBulk) ExecX

func (pcb *ProductCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductCreateBulk) Save

func (pcb *ProductCreateBulk) Save(ctx context.Context) ([]*Product, error)

Save creates the Product entities in the database.

func (*ProductCreateBulk) SaveX

func (pcb *ProductCreateBulk) SaveX(ctx context.Context) []*Product

SaveX is like Save, but panics if an error occurs.

type ProductDelete

type ProductDelete struct {
	// contains filtered or unexported fields
}

ProductDelete is the builder for deleting a Product entity.

func (*ProductDelete) Exec

func (pd *ProductDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductDelete) ExecX

func (pd *ProductDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductDelete) Where

func (pd *ProductDelete) Where(ps ...predicate.Product) *ProductDelete

Where appends a list predicates to the ProductDelete builder.

type ProductDeleteOne

type ProductDeleteOne struct {
	// contains filtered or unexported fields
}

ProductDeleteOne is the builder for deleting a single Product entity.

func (*ProductDeleteOne) Exec

func (pdo *ProductDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductDeleteOne) ExecX

func (pdo *ProductDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductDeleteOne) Where

Where appends a list predicates to the ProductDelete builder.

type ProductEdges

type ProductEdges struct {
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// ProductTags holds the value of the product_tags edge.
	ProductTags []*ProductTag `json:"product_tags,omitempty"`
	// contains filtered or unexported fields
}

ProductEdges holds the relations/edges for other nodes in the graph.

func (ProductEdges) ProductTagsOrErr

func (e ProductEdges) ProductTagsOrErr() ([]*ProductTag, error)

ProductTagsOrErr returns the ProductTags value or an error if the edge was not loaded in eager-loading.

func (ProductEdges) TagsOrErr

func (e ProductEdges) TagsOrErr() ([]*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

type ProductGroupBy

type ProductGroupBy struct {
	// contains filtered or unexported fields
}

ProductGroupBy is the group-by builder for Product entities.

func (*ProductGroupBy) Aggregate

func (pgb *ProductGroupBy) Aggregate(fns ...AggregateFunc) *ProductGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductGroupBy) Bool

func (s *ProductGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolX

func (s *ProductGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductGroupBy) Bools

func (s *ProductGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) BoolsX

func (s *ProductGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductGroupBy) Float64

func (s *ProductGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64X

func (s *ProductGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductGroupBy) Float64s

func (s *ProductGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) Float64sX

func (s *ProductGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductGroupBy) Int

func (s *ProductGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntX

func (s *ProductGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductGroupBy) Ints

func (s *ProductGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) IntsX

func (s *ProductGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductGroupBy) Scan

func (pgb *ProductGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductGroupBy) ScanX

func (s *ProductGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductGroupBy) String

func (s *ProductGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringX

func (s *ProductGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductGroupBy) Strings

func (s *ProductGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductGroupBy) StringsX

func (s *ProductGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductImage

type ProductImage struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// ImageURL holds the value of the "image_url" field.
	ImageURL string `json:"image_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductImageQuery when eager-loading is set.
	Edges ProductImageEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductImage is the model entity for the ProductImage schema.

func (*ProductImage) QueryProduct

func (pi *ProductImage) QueryProduct() *ProductQuery

QueryProduct queries the "product" edge of the ProductImage entity.

func (*ProductImage) String

func (pi *ProductImage) String() string

String implements the fmt.Stringer.

func (*ProductImage) Unwrap

func (pi *ProductImage) Unwrap() *ProductImage

Unwrap unwraps the ProductImage 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 (*ProductImage) Update

func (pi *ProductImage) Update() *ProductImageUpdateOne

Update returns a builder for updating this ProductImage. Note that you need to call ProductImage.Unwrap() before calling this method if this ProductImage was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductImage) Value

func (pi *ProductImage) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductImage. This includes values selected through modifiers, order, etc.

type ProductImageClient

type ProductImageClient struct {
	// contains filtered or unexported fields
}

ProductImageClient is a client for the ProductImage schema.

func NewProductImageClient

func NewProductImageClient(c config) *ProductImageClient

NewProductImageClient returns a client for the ProductImage from the given config.

func (*ProductImageClient) Create

Create returns a builder for creating a ProductImage entity.

func (*ProductImageClient) CreateBulk

func (c *ProductImageClient) CreateBulk(builders ...*ProductImageCreate) *ProductImageCreateBulk

CreateBulk returns a builder for creating a bulk of ProductImage entities.

func (*ProductImageClient) Delete

Delete returns a delete builder for ProductImage.

func (*ProductImageClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProductImageClient) DeleteOneID

func (c *ProductImageClient) DeleteOneID(id uuid.UUID) *ProductImageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProductImageClient) Get

Get returns a ProductImage entity by its id.

func (*ProductImageClient) GetX

GetX is like Get, but panics if an error occurs.

func (*ProductImageClient) Hooks

func (c *ProductImageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductImageClient) Intercept

func (c *ProductImageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `productimage.Intercept(f(g(h())))`.

func (*ProductImageClient) Interceptors

func (c *ProductImageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductImageClient) MapCreateBulk

func (c *ProductImageClient) MapCreateBulk(slice any, setFunc func(*ProductImageCreate, int)) *ProductImageCreateBulk

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 (*ProductImageClient) Query

Query returns a query builder for ProductImage.

func (*ProductImageClient) QueryProduct

func (c *ProductImageClient) QueryProduct(pi *ProductImage) *ProductQuery

QueryProduct queries the product edge of a ProductImage.

func (*ProductImageClient) Update

Update returns an update builder for ProductImage.

func (*ProductImageClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductImageClient) UpdateOneID

func (c *ProductImageClient) UpdateOneID(id uuid.UUID) *ProductImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProductImageClient) Use

func (c *ProductImageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `productimage.Hooks(f(g(h())))`.

type ProductImageCreate

type ProductImageCreate struct {
	// contains filtered or unexported fields
}

ProductImageCreate is the builder for creating a ProductImage entity.

func (*ProductImageCreate) Exec

func (pic *ProductImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductImageCreate) ExecX

func (pic *ProductImageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageCreate) Mutation

func (pic *ProductImageCreate) Mutation() *ProductImageMutation

Mutation returns the ProductImageMutation object of the builder.

func (*ProductImageCreate) Save

Save creates the ProductImage in the database.

func (*ProductImageCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ProductImageCreate) SetCreatedAt

func (pic *ProductImageCreate) SetCreatedAt(t time.Time) *ProductImageCreate

SetCreatedAt sets the "created_at" field.

func (*ProductImageCreate) SetID

SetID sets the "id" field.

func (*ProductImageCreate) SetImageURL

func (pic *ProductImageCreate) SetImageURL(s string) *ProductImageCreate

SetImageURL sets the "image_url" field.

func (*ProductImageCreate) SetNillableCreatedAt

func (pic *ProductImageCreate) SetNillableCreatedAt(t *time.Time) *ProductImageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProductImageCreate) SetNillableID

func (pic *ProductImageCreate) SetNillableID(u *uuid.UUID) *ProductImageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProductImageCreate) SetNillableUpdatedAt

func (pic *ProductImageCreate) SetNillableUpdatedAt(t *time.Time) *ProductImageCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProductImageCreate) SetProduct

func (pic *ProductImageCreate) SetProduct(p *Product) *ProductImageCreate

SetProduct sets the "product" edge to the Product entity.

func (*ProductImageCreate) SetProductID

func (pic *ProductImageCreate) SetProductID(s string) *ProductImageCreate

SetProductID sets the "product_id" field.

func (*ProductImageCreate) SetUpdatedAt

func (pic *ProductImageCreate) SetUpdatedAt(t time.Time) *ProductImageCreate

SetUpdatedAt sets the "updated_at" field.

type ProductImageCreateBulk

type ProductImageCreateBulk struct {
	// contains filtered or unexported fields
}

ProductImageCreateBulk is the builder for creating many ProductImage entities in bulk.

func (*ProductImageCreateBulk) Exec

func (picb *ProductImageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductImageCreateBulk) ExecX

func (picb *ProductImageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageCreateBulk) Save

Save creates the ProductImage entities in the database.

func (*ProductImageCreateBulk) SaveX

func (picb *ProductImageCreateBulk) SaveX(ctx context.Context) []*ProductImage

SaveX is like Save, but panics if an error occurs.

type ProductImageDelete

type ProductImageDelete struct {
	// contains filtered or unexported fields
}

ProductImageDelete is the builder for deleting a ProductImage entity.

func (*ProductImageDelete) Exec

func (pid *ProductImageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductImageDelete) ExecX

func (pid *ProductImageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageDelete) Where

Where appends a list predicates to the ProductImageDelete builder.

type ProductImageDeleteOne

type ProductImageDeleteOne struct {
	// contains filtered or unexported fields
}

ProductImageDeleteOne is the builder for deleting a single ProductImage entity.

func (*ProductImageDeleteOne) Exec

func (pido *ProductImageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductImageDeleteOne) ExecX

func (pido *ProductImageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageDeleteOne) Where

Where appends a list predicates to the ProductImageDelete builder.

type ProductImageEdges

type ProductImageEdges struct {
	// Product holds the value of the product edge.
	Product *Product `json:"product,omitempty"`
	// contains filtered or unexported fields
}

ProductImageEdges holds the relations/edges for other nodes in the graph.

func (ProductImageEdges) ProductOrErr

func (e ProductImageEdges) ProductOrErr() (*Product, error)

ProductOrErr returns the Product value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ProductImageGroupBy

type ProductImageGroupBy struct {
	// contains filtered or unexported fields
}

ProductImageGroupBy is the group-by builder for ProductImage entities.

func (*ProductImageGroupBy) Aggregate

func (pigb *ProductImageGroupBy) Aggregate(fns ...AggregateFunc) *ProductImageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductImageGroupBy) Bool

func (s *ProductImageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) BoolX

func (s *ProductImageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductImageGroupBy) Bools

func (s *ProductImageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) BoolsX

func (s *ProductImageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductImageGroupBy) Float64

func (s *ProductImageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) Float64X

func (s *ProductImageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductImageGroupBy) Float64s

func (s *ProductImageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) Float64sX

func (s *ProductImageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductImageGroupBy) Int

func (s *ProductImageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) IntX

func (s *ProductImageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductImageGroupBy) Ints

func (s *ProductImageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) IntsX

func (s *ProductImageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductImageGroupBy) Scan

func (pigb *ProductImageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductImageGroupBy) ScanX

func (s *ProductImageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductImageGroupBy) String

func (s *ProductImageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) StringX

func (s *ProductImageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductImageGroupBy) Strings

func (s *ProductImageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductImageGroupBy) StringsX

func (s *ProductImageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductImageMutation

type ProductImageMutation struct {
	// contains filtered or unexported fields
}

ProductImageMutation represents an operation that mutates the ProductImage nodes in the graph.

func (*ProductImageMutation) AddField

func (m *ProductImageMutation) 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 (*ProductImageMutation) AddedEdges

func (m *ProductImageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductImageMutation) AddedField

func (m *ProductImageMutation) 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 (*ProductImageMutation) AddedFields

func (m *ProductImageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductImageMutation) AddedIDs

func (m *ProductImageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductImageMutation) ClearEdge

func (m *ProductImageMutation) 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 (*ProductImageMutation) ClearField

func (m *ProductImageMutation) 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 (*ProductImageMutation) ClearProduct

func (m *ProductImageMutation) ClearProduct()

ClearProduct clears the "product" edge to the Product entity.

func (*ProductImageMutation) ClearedEdges

func (m *ProductImageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductImageMutation) ClearedFields

func (m *ProductImageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductImageMutation) Client

func (m ProductImageMutation) 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 (*ProductImageMutation) CreatedAt

func (m *ProductImageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductImageMutation) EdgeCleared

func (m *ProductImageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductImageMutation) Field

func (m *ProductImageMutation) 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 (*ProductImageMutation) FieldCleared

func (m *ProductImageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductImageMutation) Fields

func (m *ProductImageMutation) 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 (*ProductImageMutation) ID

func (m *ProductImageMutation) ID() (id uuid.UUID, 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 (*ProductImageMutation) 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 (*ProductImageMutation) ImageURL

func (m *ProductImageMutation) ImageURL() (r string, exists bool)

ImageURL returns the value of the "image_url" field in the mutation.

func (*ProductImageMutation) OldCreatedAt

func (m *ProductImageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldField

func (m *ProductImageMutation) 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 (*ProductImageMutation) OldImageURL

func (m *ProductImageMutation) OldImageURL(ctx context.Context) (v string, err error)

OldImageURL returns the old "image_url" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldProductID

func (m *ProductImageMutation) OldProductID(ctx context.Context) (v string, err error)

OldProductID returns the old "product_id" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) OldUpdatedAt

func (m *ProductImageMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ProductImage entity. If the ProductImage 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 (*ProductImageMutation) Op

func (m *ProductImageMutation) Op() Op

Op returns the operation name.

func (*ProductImageMutation) ProductCleared

func (m *ProductImageMutation) ProductCleared() bool

ProductCleared reports if the "product" edge to the Product entity was cleared.

func (*ProductImageMutation) ProductID

func (m *ProductImageMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*ProductImageMutation) ProductIDs

func (m *ProductImageMutation) ProductIDs() (ids []string)

ProductIDs returns the "product" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductID instead. It exists only for internal usage by the builders.

func (*ProductImageMutation) RemovedEdges

func (m *ProductImageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductImageMutation) RemovedIDs

func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetCreatedAt

func (m *ProductImageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductImageMutation) ResetEdge

func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetField

func (m *ProductImageMutation) 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 (*ProductImageMutation) ResetImageURL

func (m *ProductImageMutation) ResetImageURL()

ResetImageURL resets all changes to the "image_url" field.

func (*ProductImageMutation) ResetProduct

func (m *ProductImageMutation) ResetProduct()

ResetProduct resets all changes to the "product" edge.

func (*ProductImageMutation) ResetProductID

func (m *ProductImageMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*ProductImageMutation) ResetUpdatedAt

func (m *ProductImageMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductImageMutation) SetCreatedAt

func (m *ProductImageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductImageMutation) SetField

func (m *ProductImageMutation) 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 (*ProductImageMutation) SetID

func (m *ProductImageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ProductImage entities.

func (*ProductImageMutation) SetImageURL

func (m *ProductImageMutation) SetImageURL(s string)

SetImageURL sets the "image_url" field.

func (*ProductImageMutation) SetOp

func (m *ProductImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductImageMutation) SetProductID

func (m *ProductImageMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*ProductImageMutation) SetUpdatedAt

func (m *ProductImageMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (ProductImageMutation) Tx

func (m ProductImageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductImageMutation) Type

func (m *ProductImageMutation) Type() string

Type returns the node type of this mutation (ProductImage).

func (*ProductImageMutation) UpdatedAt

func (m *ProductImageMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductImageMutation) Where

Where appends a list predicates to the ProductImageMutation builder.

func (*ProductImageMutation) WhereP

func (m *ProductImageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductImageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductImageQuery

type ProductImageQuery struct {
	// contains filtered or unexported fields
}

ProductImageQuery is the builder for querying ProductImage entities.

func (*ProductImageQuery) Aggregate

func (piq *ProductImageQuery) Aggregate(fns ...AggregateFunc) *ProductImageSelect

Aggregate returns a ProductImageSelect configured with the given aggregations.

func (*ProductImageQuery) All

func (piq *ProductImageQuery) All(ctx context.Context) ([]*ProductImage, error)

All executes the query and returns a list of ProductImages.

func (*ProductImageQuery) AllX

func (piq *ProductImageQuery) AllX(ctx context.Context) []*ProductImage

AllX is like All, but panics if an error occurs.

func (*ProductImageQuery) Clone

func (piq *ProductImageQuery) Clone() *ProductImageQuery

Clone returns a duplicate of the ProductImageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductImageQuery) Count

func (piq *ProductImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductImageQuery) CountX

func (piq *ProductImageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductImageQuery) Exist

func (piq *ProductImageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductImageQuery) ExistX

func (piq *ProductImageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductImageQuery) First

func (piq *ProductImageQuery) First(ctx context.Context) (*ProductImage, error)

First returns the first ProductImage entity from the query. Returns a *NotFoundError when no ProductImage was found.

func (*ProductImageQuery) FirstID

func (piq *ProductImageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ProductImage ID from the query. Returns a *NotFoundError when no ProductImage ID was found.

func (*ProductImageQuery) FirstIDX

func (piq *ProductImageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductImageQuery) FirstX

func (piq *ProductImageQuery) FirstX(ctx context.Context) *ProductImage

FirstX is like First, but panics if an error occurs.

func (*ProductImageQuery) GroupBy

func (piq *ProductImageQuery) GroupBy(field string, fields ...string) *ProductImageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ProductImage.Query().
	GroupBy(productimage.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductImageQuery) IDs

func (piq *ProductImageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ProductImage IDs.

func (*ProductImageQuery) IDsX

func (piq *ProductImageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ProductImageQuery) Limit

func (piq *ProductImageQuery) Limit(limit int) *ProductImageQuery

Limit the number of records to be returned by this query.

func (*ProductImageQuery) Offset

func (piq *ProductImageQuery) Offset(offset int) *ProductImageQuery

Offset to start from.

func (*ProductImageQuery) Only

func (piq *ProductImageQuery) Only(ctx context.Context) (*ProductImage, error)

Only returns a single ProductImage entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductImage entity is found. Returns a *NotFoundError when no ProductImage entities are found.

func (*ProductImageQuery) OnlyID

func (piq *ProductImageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ProductImage ID in the query. Returns a *NotSingularError when more than one ProductImage ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductImageQuery) OnlyIDX

func (piq *ProductImageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductImageQuery) OnlyX

func (piq *ProductImageQuery) OnlyX(ctx context.Context) *ProductImage

OnlyX is like Only, but panics if an error occurs.

func (*ProductImageQuery) Order

Order specifies how the records should be ordered.

func (*ProductImageQuery) QueryProduct

func (piq *ProductImageQuery) QueryProduct() *ProductQuery

QueryProduct chains the current query on the "product" edge.

func (*ProductImageQuery) Select

func (piq *ProductImageQuery) Select(fields ...string) *ProductImageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.ProductImage.Query().
	Select(productimage.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductImageQuery) Unique

func (piq *ProductImageQuery) Unique(unique bool) *ProductImageQuery

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 (*ProductImageQuery) Where

Where adds a new predicate for the ProductImageQuery builder.

func (*ProductImageQuery) WithProduct

func (piq *ProductImageQuery) WithProduct(opts ...func(*ProductQuery)) *ProductImageQuery

WithProduct tells the query-builder to eager-load the nodes that are connected to the "product" edge. The optional arguments are used to configure the query builder of the edge.

type ProductImageSelect

type ProductImageSelect struct {
	*ProductImageQuery
	// contains filtered or unexported fields
}

ProductImageSelect is the builder for selecting fields of ProductImage entities.

func (*ProductImageSelect) Aggregate

func (pis *ProductImageSelect) Aggregate(fns ...AggregateFunc) *ProductImageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductImageSelect) Bool

func (s *ProductImageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) BoolX

func (s *ProductImageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductImageSelect) Bools

func (s *ProductImageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) BoolsX

func (s *ProductImageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductImageSelect) Float64

func (s *ProductImageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) Float64X

func (s *ProductImageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductImageSelect) Float64s

func (s *ProductImageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) Float64sX

func (s *ProductImageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductImageSelect) Int

func (s *ProductImageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) IntX

func (s *ProductImageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductImageSelect) Ints

func (s *ProductImageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) IntsX

func (s *ProductImageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductImageSelect) Scan

func (pis *ProductImageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductImageSelect) ScanX

func (s *ProductImageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductImageSelect) String

func (s *ProductImageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) StringX

func (s *ProductImageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductImageSelect) Strings

func (s *ProductImageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductImageSelect) StringsX

func (s *ProductImageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductImageUpdate

type ProductImageUpdate struct {
	// contains filtered or unexported fields
}

ProductImageUpdate is the builder for updating ProductImage entities.

func (*ProductImageUpdate) Exec

func (piu *ProductImageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductImageUpdate) ExecX

func (piu *ProductImageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageUpdate) Mutation

func (piu *ProductImageUpdate) Mutation() *ProductImageMutation

Mutation returns the ProductImageMutation object of the builder.

func (*ProductImageUpdate) Save

func (piu *ProductImageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductImageUpdate) SaveX

func (piu *ProductImageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductImageUpdate) SetUpdatedAt

func (piu *ProductImageUpdate) SetUpdatedAt(t time.Time) *ProductImageUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductImageUpdate) Where

Where appends a list predicates to the ProductImageUpdate builder.

type ProductImageUpdateOne

type ProductImageUpdateOne struct {
	// contains filtered or unexported fields
}

ProductImageUpdateOne is the builder for updating a single ProductImage entity.

func (*ProductImageUpdateOne) Exec

func (piuo *ProductImageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductImageUpdateOne) ExecX

func (piuo *ProductImageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductImageUpdateOne) Mutation

func (piuo *ProductImageUpdateOne) Mutation() *ProductImageMutation

Mutation returns the ProductImageMutation object of the builder.

func (*ProductImageUpdateOne) Save

Save executes the query and returns the updated ProductImage entity.

func (*ProductImageUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*ProductImageUpdateOne) Select

func (piuo *ProductImageUpdateOne) Select(field string, fields ...string) *ProductImageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductImageUpdateOne) SetUpdatedAt

func (piuo *ProductImageUpdateOne) SetUpdatedAt(t time.Time) *ProductImageUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductImageUpdateOne) Where

Where appends a list predicates to the ProductImageUpdate builder.

type ProductImages

type ProductImages []*ProductImage

ProductImages is a parsable slice of ProductImage.

type ProductMutation

type ProductMutation struct {
	// contains filtered or unexported fields
}

ProductMutation represents an operation that mutates the Product nodes in the graph.

func (*ProductMutation) AddField

func (m *ProductMutation) 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 (*ProductMutation) AddPrice

func (m *ProductMutation) AddPrice(d decimal.Decimal)

AddPrice adds d to the "price" field.

func (*ProductMutation) AddQty

func (m *ProductMutation) AddQty(d decimal.Decimal)

AddQty adds d to the "qty" field.

func (*ProductMutation) AddTagIDs

func (m *ProductMutation) AddTagIDs(ids ...string)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*ProductMutation) AddYear

func (m *ProductMutation) AddYear(i int)

AddYear adds i to the "year" field.

func (*ProductMutation) AddedEdges

func (m *ProductMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductMutation) AddedField

func (m *ProductMutation) 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 (*ProductMutation) AddedFields

func (m *ProductMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductMutation) AddedIDs

func (m *ProductMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductMutation) AddedPrice

func (m *ProductMutation) AddedPrice() (r decimal.Decimal, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*ProductMutation) AddedQty

func (m *ProductMutation) AddedQty() (r decimal.Decimal, exists bool)

AddedQty returns the value that was added to the "qty" field in this mutation.

func (*ProductMutation) AddedYear

func (m *ProductMutation) AddedYear() (r int, exists bool)

AddedYear returns the value that was added to the "year" field in this mutation.

func (*ProductMutation) AppendColors

func (m *ProductMutation) AppendColors(s []string)

AppendColors adds s to the "colors" field.

func (*ProductMutation) AppendedColors

func (m *ProductMutation) AppendedColors() ([]string, bool)

AppendedColors returns the list of values that were appended to the "colors" field in this mutation.

func (*ProductMutation) ClearColors

func (m *ProductMutation) ClearColors()

ClearColors clears the value of the "colors" field.

func (*ProductMutation) ClearDescription

func (m *ProductMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ProductMutation) ClearEdge

func (m *ProductMutation) 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 (*ProductMutation) ClearField

func (m *ProductMutation) 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 (*ProductMutation) ClearProvider

func (m *ProductMutation) ClearProvider()

ClearProvider clears the value of the "provider" field.

func (*ProductMutation) ClearTags

func (m *ProductMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*ProductMutation) ClearYear

func (m *ProductMutation) ClearYear()

ClearYear clears the value of the "year" field.

func (*ProductMutation) ClearedEdges

func (m *ProductMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductMutation) ClearedFields

func (m *ProductMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductMutation) Client

func (m ProductMutation) 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 (*ProductMutation) Colors

func (m *ProductMutation) Colors() (r []string, exists bool)

Colors returns the value of the "colors" field in the mutation.

func (*ProductMutation) ColorsCleared

func (m *ProductMutation) ColorsCleared() bool

ColorsCleared returns if the "colors" field was cleared in this mutation.

func (*ProductMutation) CreatedAt

func (m *ProductMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProductMutation) Description

func (m *ProductMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ProductMutation) DescriptionCleared

func (m *ProductMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ProductMutation) EdgeCleared

func (m *ProductMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductMutation) Field

func (m *ProductMutation) 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 (*ProductMutation) FieldCleared

func (m *ProductMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductMutation) Fields

func (m *ProductMutation) 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 (*ProductMutation) ID

func (m *ProductMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ProductMutation) IDs

func (m *ProductMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ProductMutation) Name

func (m *ProductMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProductMutation) OldColors

func (m *ProductMutation) OldColors(ctx context.Context) (v []string, err error)

OldColors returns the old "colors" field's value of the Product entity. If the Product 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 (*ProductMutation) OldCreatedAt

func (m *ProductMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Product entity. If the Product 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 (*ProductMutation) OldDescription

func (m *ProductMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the Product entity. If the Product 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 (*ProductMutation) OldField

func (m *ProductMutation) 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 (*ProductMutation) OldName

func (m *ProductMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Product entity. If the Product 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 (*ProductMutation) OldPrice

func (m *ProductMutation) OldPrice(ctx context.Context) (v decimal.Decimal, err error)

OldPrice returns the old "price" field's value of the Product entity. If the Product 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 (*ProductMutation) OldProvider

func (m *ProductMutation) OldProvider(ctx context.Context) (v *string, err error)

OldProvider returns the old "provider" field's value of the Product entity. If the Product 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 (*ProductMutation) OldQty

func (m *ProductMutation) OldQty(ctx context.Context) (v decimal.Decimal, err error)

OldQty returns the old "qty" field's value of the Product entity. If the Product 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 (*ProductMutation) OldUpdatedAt

func (m *ProductMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Product entity. If the Product 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 (*ProductMutation) OldYear

func (m *ProductMutation) OldYear(ctx context.Context) (v *int, err error)

OldYear returns the old "year" field's value of the Product entity. If the Product 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 (*ProductMutation) Op

func (m *ProductMutation) Op() Op

Op returns the operation name.

func (*ProductMutation) Price

func (m *ProductMutation) Price() (r decimal.Decimal, exists bool)

Price returns the value of the "price" field in the mutation.

func (*ProductMutation) Provider

func (m *ProductMutation) Provider() (r string, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*ProductMutation) ProviderCleared

func (m *ProductMutation) ProviderCleared() bool

ProviderCleared returns if the "provider" field was cleared in this mutation.

func (*ProductMutation) Qty

func (m *ProductMutation) Qty() (r decimal.Decimal, exists bool)

Qty returns the value of the "qty" field in the mutation.

func (*ProductMutation) RemoveTagIDs

func (m *ProductMutation) RemoveTagIDs(ids ...string)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*ProductMutation) RemovedEdges

func (m *ProductMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductMutation) RemovedIDs

func (m *ProductMutation) 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 (*ProductMutation) RemovedTagsIDs

func (m *ProductMutation) RemovedTagsIDs() (ids []string)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*ProductMutation) ResetColors

func (m *ProductMutation) ResetColors()

ResetColors resets all changes to the "colors" field.

func (*ProductMutation) ResetCreatedAt

func (m *ProductMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProductMutation) ResetDescription

func (m *ProductMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ProductMutation) ResetEdge

func (m *ProductMutation) 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 (*ProductMutation) ResetField

func (m *ProductMutation) 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 (*ProductMutation) ResetName

func (m *ProductMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProductMutation) ResetPrice

func (m *ProductMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*ProductMutation) ResetProvider

func (m *ProductMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*ProductMutation) ResetQty

func (m *ProductMutation) ResetQty()

ResetQty resets all changes to the "qty" field.

func (*ProductMutation) ResetTags

func (m *ProductMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*ProductMutation) ResetUpdatedAt

func (m *ProductMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProductMutation) ResetYear

func (m *ProductMutation) ResetYear()

ResetYear resets all changes to the "year" field.

func (*ProductMutation) SetColors

func (m *ProductMutation) SetColors(s []string)

SetColors sets the "colors" field.

func (*ProductMutation) SetCreatedAt

func (m *ProductMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProductMutation) SetDescription

func (m *ProductMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ProductMutation) SetField

func (m *ProductMutation) 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 (*ProductMutation) SetID

func (m *ProductMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Product entities.

func (*ProductMutation) SetName

func (m *ProductMutation) SetName(s string)

SetName sets the "name" field.

func (*ProductMutation) SetOp

func (m *ProductMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductMutation) SetPrice

func (m *ProductMutation) SetPrice(d decimal.Decimal)

SetPrice sets the "price" field.

func (*ProductMutation) SetProvider

func (m *ProductMutation) SetProvider(s string)

SetProvider sets the "provider" field.

func (*ProductMutation) SetQty

func (m *ProductMutation) SetQty(d decimal.Decimal)

SetQty sets the "qty" field.

func (*ProductMutation) SetUpdatedAt

func (m *ProductMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ProductMutation) SetYear

func (m *ProductMutation) SetYear(i int)

SetYear sets the "year" field.

func (*ProductMutation) TagsCleared

func (m *ProductMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*ProductMutation) TagsIDs

func (m *ProductMutation) TagsIDs() (ids []string)

TagsIDs returns the "tags" edge IDs in the mutation.

func (ProductMutation) Tx

func (m ProductMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductMutation) Type

func (m *ProductMutation) Type() string

Type returns the node type of this mutation (Product).

func (*ProductMutation) UpdatedAt

func (m *ProductMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProductMutation) Where

func (m *ProductMutation) Where(ps ...predicate.Product)

Where appends a list predicates to the ProductMutation builder.

func (*ProductMutation) WhereP

func (m *ProductMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*ProductMutation) Year

func (m *ProductMutation) Year() (r int, exists bool)

Year returns the value of the "year" field in the mutation.

func (*ProductMutation) YearCleared

func (m *ProductMutation) YearCleared() bool

YearCleared returns if the "year" field was cleared in this mutation.

type ProductQuery

type ProductQuery struct {
	// contains filtered or unexported fields
}

ProductQuery is the builder for querying Product entities.

func (*ProductQuery) Aggregate

func (pq *ProductQuery) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate returns a ProductSelect configured with the given aggregations.

func (*ProductQuery) All

func (pq *ProductQuery) All(ctx context.Context) ([]*Product, error)

All executes the query and returns a list of Products.

func (*ProductQuery) AllX

func (pq *ProductQuery) AllX(ctx context.Context) []*Product

AllX is like All, but panics if an error occurs.

func (*ProductQuery) Clone

func (pq *ProductQuery) Clone() *ProductQuery

Clone returns a duplicate of the ProductQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductQuery) Count

func (pq *ProductQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductQuery) CountX

func (pq *ProductQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductQuery) Exist

func (pq *ProductQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductQuery) ExistX

func (pq *ProductQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductQuery) First

func (pq *ProductQuery) First(ctx context.Context) (*Product, error)

First returns the first Product entity from the query. Returns a *NotFoundError when no Product was found.

func (*ProductQuery) FirstID

func (pq *ProductQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Product ID from the query. Returns a *NotFoundError when no Product ID was found.

func (*ProductQuery) FirstIDX

func (pq *ProductQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProductQuery) FirstX

func (pq *ProductQuery) FirstX(ctx context.Context) *Product

FirstX is like First, but panics if an error occurs.

func (*ProductQuery) GroupBy

func (pq *ProductQuery) GroupBy(field string, fields ...string) *ProductGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Product.Query().
	GroupBy(product.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductQuery) IDs

func (pq *ProductQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Product IDs.

func (*ProductQuery) IDsX

func (pq *ProductQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*ProductQuery) Limit

func (pq *ProductQuery) Limit(limit int) *ProductQuery

Limit the number of records to be returned by this query.

func (*ProductQuery) Offset

func (pq *ProductQuery) Offset(offset int) *ProductQuery

Offset to start from.

func (*ProductQuery) Only

func (pq *ProductQuery) Only(ctx context.Context) (*Product, error)

Only returns a single Product entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Product entity is found. Returns a *NotFoundError when no Product entities are found.

func (*ProductQuery) OnlyID

func (pq *ProductQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Product ID in the query. Returns a *NotSingularError when more than one Product ID is found. Returns a *NotFoundError when no entities are found.

func (*ProductQuery) OnlyIDX

func (pq *ProductQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProductQuery) OnlyX

func (pq *ProductQuery) OnlyX(ctx context.Context) *Product

OnlyX is like Only, but panics if an error occurs.

func (*ProductQuery) Order

func (pq *ProductQuery) Order(o ...product.OrderOption) *ProductQuery

Order specifies how the records should be ordered.

func (*ProductQuery) QueryProductTags

func (pq *ProductQuery) QueryProductTags() *ProductTagQuery

QueryProductTags chains the current query on the "product_tags" edge.

func (*ProductQuery) QueryTags

func (pq *ProductQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*ProductQuery) Select

func (pq *ProductQuery) Select(fields ...string) *ProductSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Product.Query().
	Select(product.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProductQuery) Unique

func (pq *ProductQuery) Unique(unique bool) *ProductQuery

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 (*ProductQuery) Where

func (pq *ProductQuery) Where(ps ...predicate.Product) *ProductQuery

Where adds a new predicate for the ProductQuery builder.

func (*ProductQuery) WithProductTags

func (pq *ProductQuery) WithProductTags(opts ...func(*ProductTagQuery)) *ProductQuery

WithProductTags tells the query-builder to eager-load the nodes that are connected to the "product_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductQuery) WithTags

func (pq *ProductQuery) WithTags(opts ...func(*TagQuery)) *ProductQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

type ProductSelect

type ProductSelect struct {
	*ProductQuery
	// contains filtered or unexported fields
}

ProductSelect is the builder for selecting fields of Product entities.

func (*ProductSelect) Aggregate

func (ps *ProductSelect) Aggregate(fns ...AggregateFunc) *ProductSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductSelect) Bool

func (s *ProductSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolX

func (s *ProductSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductSelect) Bools

func (s *ProductSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductSelect) BoolsX

func (s *ProductSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductSelect) Float64

func (s *ProductSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64X

func (s *ProductSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductSelect) Float64s

func (s *ProductSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductSelect) Float64sX

func (s *ProductSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductSelect) Int

func (s *ProductSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntX

func (s *ProductSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductSelect) Ints

func (s *ProductSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductSelect) IntsX

func (s *ProductSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductSelect) Scan

func (ps *ProductSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductSelect) ScanX

func (s *ProductSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductSelect) String

func (s *ProductSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringX

func (s *ProductSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductSelect) Strings

func (s *ProductSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductSelect) StringsX

func (s *ProductSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductTag

type ProductTag struct {

	// ProductID holds the value of the "product_id" field.
	ProductID string `json:"product_id,omitempty"`
	// TagID holds the value of the "tag_id" field.
	TagID string `json:"tag_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProductTagQuery when eager-loading is set.
	Edges ProductTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

ProductTag is the model entity for the ProductTag schema.

func (*ProductTag) QueryProducts

func (pt *ProductTag) QueryProducts() *ProductQuery

QueryProducts queries the "products" edge of the ProductTag entity.

func (*ProductTag) QueryTags

func (pt *ProductTag) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the ProductTag entity.

func (*ProductTag) String

func (pt *ProductTag) String() string

String implements the fmt.Stringer.

func (*ProductTag) Unwrap

func (pt *ProductTag) Unwrap() *ProductTag

Unwrap unwraps the ProductTag 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 (*ProductTag) Update

func (pt *ProductTag) Update() *ProductTagUpdateOne

Update returns a builder for updating this ProductTag. Note that you need to call ProductTag.Unwrap() before calling this method if this ProductTag was returned from a transaction, and the transaction was committed or rolled back.

func (*ProductTag) Value

func (pt *ProductTag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ProductTag. This includes values selected through modifiers, order, etc.

type ProductTagClient

type ProductTagClient struct {
	// contains filtered or unexported fields
}

ProductTagClient is a client for the ProductTag schema.

func NewProductTagClient

func NewProductTagClient(c config) *ProductTagClient

NewProductTagClient returns a client for the ProductTag from the given config.

func (*ProductTagClient) Create

func (c *ProductTagClient) Create() *ProductTagCreate

Create returns a builder for creating a ProductTag entity.

func (*ProductTagClient) CreateBulk

func (c *ProductTagClient) CreateBulk(builders ...*ProductTagCreate) *ProductTagCreateBulk

CreateBulk returns a builder for creating a bulk of ProductTag entities.

func (*ProductTagClient) Delete

func (c *ProductTagClient) Delete() *ProductTagDelete

Delete returns a delete builder for ProductTag.

func (*ProductTagClient) Hooks

func (c *ProductTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProductTagClient) Intercept

func (c *ProductTagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `producttag.Intercept(f(g(h())))`.

func (*ProductTagClient) Interceptors

func (c *ProductTagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProductTagClient) MapCreateBulk

func (c *ProductTagClient) MapCreateBulk(slice any, setFunc func(*ProductTagCreate, int)) *ProductTagCreateBulk

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 (*ProductTagClient) Query

func (c *ProductTagClient) Query() *ProductTagQuery

Query returns a query builder for ProductTag.

func (*ProductTagClient) QueryProducts

func (c *ProductTagClient) QueryProducts(pt *ProductTag) *ProductQuery

QueryProducts queries the products edge of a ProductTag.

func (*ProductTagClient) QueryTags

func (c *ProductTagClient) QueryTags(pt *ProductTag) *TagQuery

QueryTags queries the tags edge of a ProductTag.

func (*ProductTagClient) Update

func (c *ProductTagClient) Update() *ProductTagUpdate

Update returns an update builder for ProductTag.

func (*ProductTagClient) UpdateOne

func (c *ProductTagClient) UpdateOne(pt *ProductTag) *ProductTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProductTagClient) Use

func (c *ProductTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `producttag.Hooks(f(g(h())))`.

type ProductTagCreate

type ProductTagCreate struct {
	// contains filtered or unexported fields
}

ProductTagCreate is the builder for creating a ProductTag entity.

func (*ProductTagCreate) Exec

func (ptc *ProductTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductTagCreate) ExecX

func (ptc *ProductTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagCreate) Mutation

func (ptc *ProductTagCreate) Mutation() *ProductTagMutation

Mutation returns the ProductTagMutation object of the builder.

func (*ProductTagCreate) Save

func (ptc *ProductTagCreate) Save(ctx context.Context) (*ProductTag, error)

Save creates the ProductTag in the database.

func (*ProductTagCreate) SaveX

func (ptc *ProductTagCreate) SaveX(ctx context.Context) *ProductTag

SaveX calls Save and panics if Save returns an error.

func (*ProductTagCreate) SetProductID

func (ptc *ProductTagCreate) SetProductID(s string) *ProductTagCreate

SetProductID sets the "product_id" field.

func (*ProductTagCreate) SetProducts

func (ptc *ProductTagCreate) SetProducts(p *Product) *ProductTagCreate

SetProducts sets the "products" edge to the Product entity.

func (*ProductTagCreate) SetProductsID

func (ptc *ProductTagCreate) SetProductsID(id string) *ProductTagCreate

SetProductsID sets the "products" edge to the Product entity by ID.

func (*ProductTagCreate) SetTagID

func (ptc *ProductTagCreate) SetTagID(s string) *ProductTagCreate

SetTagID sets the "tag_id" field.

func (*ProductTagCreate) SetTags

func (ptc *ProductTagCreate) SetTags(t *Tag) *ProductTagCreate

SetTags sets the "tags" edge to the Tag entity.

func (*ProductTagCreate) SetTagsID

func (ptc *ProductTagCreate) SetTagsID(id string) *ProductTagCreate

SetTagsID sets the "tags" edge to the Tag entity by ID.

type ProductTagCreateBulk

type ProductTagCreateBulk struct {
	// contains filtered or unexported fields
}

ProductTagCreateBulk is the builder for creating many ProductTag entities in bulk.

func (*ProductTagCreateBulk) Exec

func (ptcb *ProductTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductTagCreateBulk) ExecX

func (ptcb *ProductTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagCreateBulk) Save

func (ptcb *ProductTagCreateBulk) Save(ctx context.Context) ([]*ProductTag, error)

Save creates the ProductTag entities in the database.

func (*ProductTagCreateBulk) SaveX

func (ptcb *ProductTagCreateBulk) SaveX(ctx context.Context) []*ProductTag

SaveX is like Save, but panics if an error occurs.

type ProductTagDelete

type ProductTagDelete struct {
	// contains filtered or unexported fields
}

ProductTagDelete is the builder for deleting a ProductTag entity.

func (*ProductTagDelete) Exec

func (ptd *ProductTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProductTagDelete) ExecX

func (ptd *ProductTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagDelete) Where

Where appends a list predicates to the ProductTagDelete builder.

type ProductTagDeleteOne

type ProductTagDeleteOne struct {
	// contains filtered or unexported fields
}

ProductTagDeleteOne is the builder for deleting a single ProductTag entity.

func (*ProductTagDeleteOne) Exec

func (ptdo *ProductTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProductTagDeleteOne) ExecX

func (ptdo *ProductTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagDeleteOne) Where

Where appends a list predicates to the ProductTagDelete builder.

type ProductTagEdges

type ProductTagEdges struct {
	// Products holds the value of the products edge.
	Products *Product `json:"products,omitempty"`
	// Tags holds the value of the tags edge.
	Tags *Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

ProductTagEdges holds the relations/edges for other nodes in the graph.

func (ProductTagEdges) ProductsOrErr

func (e ProductTagEdges) ProductsOrErr() (*Product, error)

ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ProductTagEdges) TagsOrErr

func (e ProductTagEdges) TagsOrErr() (*Tag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ProductTagGroupBy

type ProductTagGroupBy struct {
	// contains filtered or unexported fields
}

ProductTagGroupBy is the group-by builder for ProductTag entities.

func (*ProductTagGroupBy) Aggregate

func (ptgb *ProductTagGroupBy) Aggregate(fns ...AggregateFunc) *ProductTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProductTagGroupBy) Bool

func (s *ProductTagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) BoolX

func (s *ProductTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductTagGroupBy) Bools

func (s *ProductTagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) BoolsX

func (s *ProductTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductTagGroupBy) Float64

func (s *ProductTagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) Float64X

func (s *ProductTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductTagGroupBy) Float64s

func (s *ProductTagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) Float64sX

func (s *ProductTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductTagGroupBy) Int

func (s *ProductTagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) IntX

func (s *ProductTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductTagGroupBy) Ints

func (s *ProductTagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) IntsX

func (s *ProductTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductTagGroupBy) Scan

func (ptgb *ProductTagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductTagGroupBy) ScanX

func (s *ProductTagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductTagGroupBy) String

func (s *ProductTagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) StringX

func (s *ProductTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductTagGroupBy) Strings

func (s *ProductTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductTagGroupBy) StringsX

func (s *ProductTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductTagMutation

type ProductTagMutation struct {
	// contains filtered or unexported fields
}

ProductTagMutation represents an operation that mutates the ProductTag nodes in the graph.

func (*ProductTagMutation) AddField

func (m *ProductTagMutation) 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 (*ProductTagMutation) AddedEdges

func (m *ProductTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProductTagMutation) AddedField

func (m *ProductTagMutation) 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 (*ProductTagMutation) AddedFields

func (m *ProductTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProductTagMutation) AddedIDs

func (m *ProductTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProductTagMutation) ClearEdge

func (m *ProductTagMutation) 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 (*ProductTagMutation) ClearField

func (m *ProductTagMutation) 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 (*ProductTagMutation) ClearProducts

func (m *ProductTagMutation) ClearProducts()

ClearProducts clears the "products" edge to the Product entity.

func (*ProductTagMutation) ClearTags

func (m *ProductTagMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*ProductTagMutation) ClearedEdges

func (m *ProductTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProductTagMutation) ClearedFields

func (m *ProductTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProductTagMutation) Client

func (m ProductTagMutation) 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 (*ProductTagMutation) EdgeCleared

func (m *ProductTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProductTagMutation) Field

func (m *ProductTagMutation) 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 (*ProductTagMutation) FieldCleared

func (m *ProductTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProductTagMutation) Fields

func (m *ProductTagMutation) 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 (*ProductTagMutation) OldField

func (m *ProductTagMutation) 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 (*ProductTagMutation) Op

func (m *ProductTagMutation) Op() Op

Op returns the operation name.

func (*ProductTagMutation) ProductID

func (m *ProductTagMutation) ProductID() (r string, exists bool)

ProductID returns the value of the "product_id" field in the mutation.

func (*ProductTagMutation) ProductsCleared

func (m *ProductTagMutation) ProductsCleared() bool

ProductsCleared reports if the "products" edge to the Product entity was cleared.

func (*ProductTagMutation) ProductsID

func (m *ProductTagMutation) ProductsID() (id string, exists bool)

ProductsID returns the "products" edge ID in the mutation.

func (*ProductTagMutation) ProductsIDs

func (m *ProductTagMutation) ProductsIDs() (ids []string)

ProductsIDs returns the "products" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProductsID instead. It exists only for internal usage by the builders.

func (*ProductTagMutation) RemovedEdges

func (m *ProductTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProductTagMutation) RemovedIDs

func (m *ProductTagMutation) 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 (*ProductTagMutation) ResetEdge

func (m *ProductTagMutation) 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 (*ProductTagMutation) ResetField

func (m *ProductTagMutation) 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 (*ProductTagMutation) ResetProductID

func (m *ProductTagMutation) ResetProductID()

ResetProductID resets all changes to the "product_id" field.

func (*ProductTagMutation) ResetProducts

func (m *ProductTagMutation) ResetProducts()

ResetProducts resets all changes to the "products" edge.

func (*ProductTagMutation) ResetTagID

func (m *ProductTagMutation) ResetTagID()

ResetTagID resets all changes to the "tag_id" field.

func (*ProductTagMutation) ResetTags

func (m *ProductTagMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*ProductTagMutation) SetField

func (m *ProductTagMutation) 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 (*ProductTagMutation) SetOp

func (m *ProductTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProductTagMutation) SetProductID

func (m *ProductTagMutation) SetProductID(s string)

SetProductID sets the "product_id" field.

func (*ProductTagMutation) SetProductsID

func (m *ProductTagMutation) SetProductsID(id string)

SetProductsID sets the "products" edge to the Product entity by id.

func (*ProductTagMutation) SetTagID

func (m *ProductTagMutation) SetTagID(s string)

SetTagID sets the "tag_id" field.

func (*ProductTagMutation) SetTagsID

func (m *ProductTagMutation) SetTagsID(id string)

SetTagsID sets the "tags" edge to the Tag entity by id.

func (*ProductTagMutation) TagID

func (m *ProductTagMutation) TagID() (r string, exists bool)

TagID returns the value of the "tag_id" field in the mutation.

func (*ProductTagMutation) TagsCleared

func (m *ProductTagMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*ProductTagMutation) TagsID

func (m *ProductTagMutation) TagsID() (id string, exists bool)

TagsID returns the "tags" edge ID in the mutation.

func (*ProductTagMutation) TagsIDs

func (m *ProductTagMutation) TagsIDs() (ids []string)

TagsIDs returns the "tags" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TagsID instead. It exists only for internal usage by the builders.

func (ProductTagMutation) Tx

func (m ProductTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProductTagMutation) Type

func (m *ProductTagMutation) Type() string

Type returns the node type of this mutation (ProductTag).

func (*ProductTagMutation) Where

func (m *ProductTagMutation) Where(ps ...predicate.ProductTag)

Where appends a list predicates to the ProductTagMutation builder.

func (*ProductTagMutation) WhereP

func (m *ProductTagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProductTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProductTagQuery

type ProductTagQuery struct {
	// contains filtered or unexported fields
}

ProductTagQuery is the builder for querying ProductTag entities.

func (*ProductTagQuery) Aggregate

func (ptq *ProductTagQuery) Aggregate(fns ...AggregateFunc) *ProductTagSelect

Aggregate returns a ProductTagSelect configured with the given aggregations.

func (*ProductTagQuery) All

func (ptq *ProductTagQuery) All(ctx context.Context) ([]*ProductTag, error)

All executes the query and returns a list of ProductTags.

func (*ProductTagQuery) AllX

func (ptq *ProductTagQuery) AllX(ctx context.Context) []*ProductTag

AllX is like All, but panics if an error occurs.

func (*ProductTagQuery) Clone

func (ptq *ProductTagQuery) Clone() *ProductTagQuery

Clone returns a duplicate of the ProductTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProductTagQuery) Count

func (ptq *ProductTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProductTagQuery) CountX

func (ptq *ProductTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProductTagQuery) Exist

func (ptq *ProductTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProductTagQuery) ExistX

func (ptq *ProductTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProductTagQuery) First

func (ptq *ProductTagQuery) First(ctx context.Context) (*ProductTag, error)

First returns the first ProductTag entity from the query. Returns a *NotFoundError when no ProductTag was found.

func (*ProductTagQuery) FirstX

func (ptq *ProductTagQuery) FirstX(ctx context.Context) *ProductTag

FirstX is like First, but panics if an error occurs.

func (*ProductTagQuery) GroupBy

func (ptq *ProductTagQuery) GroupBy(field string, fields ...string) *ProductTagGroupBy

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 {
	ProductID string `json:"product_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ProductTag.Query().
	GroupBy(producttag.FieldProductID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProductTagQuery) Limit

func (ptq *ProductTagQuery) Limit(limit int) *ProductTagQuery

Limit the number of records to be returned by this query.

func (*ProductTagQuery) Offset

func (ptq *ProductTagQuery) Offset(offset int) *ProductTagQuery

Offset to start from.

func (*ProductTagQuery) Only

func (ptq *ProductTagQuery) Only(ctx context.Context) (*ProductTag, error)

Only returns a single ProductTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ProductTag entity is found. Returns a *NotFoundError when no ProductTag entities are found.

func (*ProductTagQuery) OnlyX

func (ptq *ProductTagQuery) OnlyX(ctx context.Context) *ProductTag

OnlyX is like Only, but panics if an error occurs.

func (*ProductTagQuery) Order

Order specifies how the records should be ordered.

func (*ProductTagQuery) QueryProducts

func (ptq *ProductTagQuery) QueryProducts() *ProductQuery

QueryProducts chains the current query on the "products" edge.

func (*ProductTagQuery) QueryTags

func (ptq *ProductTagQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*ProductTagQuery) Select

func (ptq *ProductTagQuery) Select(fields ...string) *ProductTagSelect

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 {
	ProductID string `json:"product_id,omitempty"`
}

client.ProductTag.Query().
	Select(producttag.FieldProductID).
	Scan(ctx, &v)

func (*ProductTagQuery) Unique

func (ptq *ProductTagQuery) Unique(unique bool) *ProductTagQuery

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 (*ProductTagQuery) Where

Where adds a new predicate for the ProductTagQuery builder.

func (*ProductTagQuery) WithProducts

func (ptq *ProductTagQuery) WithProducts(opts ...func(*ProductQuery)) *ProductTagQuery

WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProductTagQuery) WithTags

func (ptq *ProductTagQuery) WithTags(opts ...func(*TagQuery)) *ProductTagQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

type ProductTagSelect

type ProductTagSelect struct {
	*ProductTagQuery
	// contains filtered or unexported fields
}

ProductTagSelect is the builder for selecting fields of ProductTag entities.

func (*ProductTagSelect) Aggregate

func (pts *ProductTagSelect) Aggregate(fns ...AggregateFunc) *ProductTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProductTagSelect) Bool

func (s *ProductTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) BoolX

func (s *ProductTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProductTagSelect) Bools

func (s *ProductTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) BoolsX

func (s *ProductTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProductTagSelect) Float64

func (s *ProductTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) Float64X

func (s *ProductTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProductTagSelect) Float64s

func (s *ProductTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) Float64sX

func (s *ProductTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProductTagSelect) Int

func (s *ProductTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) IntX

func (s *ProductTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProductTagSelect) Ints

func (s *ProductTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) IntsX

func (s *ProductTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProductTagSelect) Scan

func (pts *ProductTagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProductTagSelect) ScanX

func (s *ProductTagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProductTagSelect) String

func (s *ProductTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) StringX

func (s *ProductTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProductTagSelect) Strings

func (s *ProductTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProductTagSelect) StringsX

func (s *ProductTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProductTagUpdate

type ProductTagUpdate struct {
	// contains filtered or unexported fields
}

ProductTagUpdate is the builder for updating ProductTag entities.

func (*ProductTagUpdate) Exec

func (ptu *ProductTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductTagUpdate) ExecX

func (ptu *ProductTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagUpdate) Mutation

func (ptu *ProductTagUpdate) Mutation() *ProductTagMutation

Mutation returns the ProductTagMutation object of the builder.

func (*ProductTagUpdate) Save

func (ptu *ProductTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductTagUpdate) SaveX

func (ptu *ProductTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductTagUpdate) Where

Where appends a list predicates to the ProductTagUpdate builder.

type ProductTagUpdateOne

type ProductTagUpdateOne struct {
	// contains filtered or unexported fields
}

ProductTagUpdateOne is the builder for updating a single ProductTag entity.

func (*ProductTagUpdateOne) Exec

func (ptuo *ProductTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductTagUpdateOne) ExecX

func (ptuo *ProductTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductTagUpdateOne) Mutation

func (ptuo *ProductTagUpdateOne) Mutation() *ProductTagMutation

Mutation returns the ProductTagMutation object of the builder.

func (*ProductTagUpdateOne) Save

func (ptuo *ProductTagUpdateOne) Save(ctx context.Context) (*ProductTag, error)

Save executes the query and returns the updated ProductTag entity.

func (*ProductTagUpdateOne) SaveX

func (ptuo *ProductTagUpdateOne) SaveX(ctx context.Context) *ProductTag

SaveX is like Save, but panics if an error occurs.

func (*ProductTagUpdateOne) Select

func (ptuo *ProductTagUpdateOne) Select(field string, fields ...string) *ProductTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductTagUpdateOne) Where

Where appends a list predicates to the ProductTagUpdate builder.

type ProductTags

type ProductTags []*ProductTag

ProductTags is a parsable slice of ProductTag.

type ProductUpdate

type ProductUpdate struct {
	// contains filtered or unexported fields
}

ProductUpdate is the builder for updating Product entities.

func (*ProductUpdate) AddPrice

func (pu *ProductUpdate) AddPrice(d decimal.Decimal) *ProductUpdate

AddPrice adds d to the "price" field.

func (*ProductUpdate) AddQty

func (pu *ProductUpdate) AddQty(d decimal.Decimal) *ProductUpdate

AddQty adds d to the "qty" field.

func (*ProductUpdate) AddTagIDs

func (pu *ProductUpdate) AddTagIDs(ids ...string) *ProductUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProductUpdate) AddTags

func (pu *ProductUpdate) AddTags(t ...*Tag) *ProductUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*ProductUpdate) AddYear

func (pu *ProductUpdate) AddYear(i int) *ProductUpdate

AddYear adds i to the "year" field.

func (*ProductUpdate) AppendColors

func (pu *ProductUpdate) AppendColors(s []string) *ProductUpdate

AppendColors appends s to the "colors" field.

func (*ProductUpdate) ClearColors

func (pu *ProductUpdate) ClearColors() *ProductUpdate

ClearColors clears the value of the "colors" field.

func (*ProductUpdate) ClearDescription

func (pu *ProductUpdate) ClearDescription() *ProductUpdate

ClearDescription clears the value of the "description" field.

func (*ProductUpdate) ClearProvider

func (pu *ProductUpdate) ClearProvider() *ProductUpdate

ClearProvider clears the value of the "provider" field.

func (*ProductUpdate) ClearTags

func (pu *ProductUpdate) ClearTags() *ProductUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*ProductUpdate) ClearYear

func (pu *ProductUpdate) ClearYear() *ProductUpdate

ClearYear clears the value of the "year" field.

func (*ProductUpdate) Exec

func (pu *ProductUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProductUpdate) ExecX

func (pu *ProductUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdate) Mutation

func (pu *ProductUpdate) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdate) RemoveTagIDs

func (pu *ProductUpdate) RemoveTagIDs(ids ...string) *ProductUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*ProductUpdate) RemoveTags

func (pu *ProductUpdate) RemoveTags(t ...*Tag) *ProductUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*ProductUpdate) Save

func (pu *ProductUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProductUpdate) SaveX

func (pu *ProductUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdate) SetColors

func (pu *ProductUpdate) SetColors(s []string) *ProductUpdate

SetColors sets the "colors" field.

func (*ProductUpdate) SetDescription

func (pu *ProductUpdate) SetDescription(s string) *ProductUpdate

SetDescription sets the "description" field.

func (*ProductUpdate) SetName

func (pu *ProductUpdate) SetName(s string) *ProductUpdate

SetName sets the "name" field.

func (*ProductUpdate) SetNillableDescription

func (pu *ProductUpdate) SetNillableDescription(s *string) *ProductUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductUpdate) SetNillableName

func (pu *ProductUpdate) SetNillableName(s *string) *ProductUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductUpdate) SetNillablePrice

func (pu *ProductUpdate) SetNillablePrice(d *decimal.Decimal) *ProductUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ProductUpdate) SetNillableProvider

func (pu *ProductUpdate) SetNillableProvider(s *string) *ProductUpdate

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*ProductUpdate) SetNillableQty

func (pu *ProductUpdate) SetNillableQty(d *decimal.Decimal) *ProductUpdate

SetNillableQty sets the "qty" field if the given value is not nil.

func (*ProductUpdate) SetNillableYear

func (pu *ProductUpdate) SetNillableYear(i *int) *ProductUpdate

SetNillableYear sets the "year" field if the given value is not nil.

func (*ProductUpdate) SetPrice

func (pu *ProductUpdate) SetPrice(d decimal.Decimal) *ProductUpdate

SetPrice sets the "price" field.

func (*ProductUpdate) SetProvider

func (pu *ProductUpdate) SetProvider(s string) *ProductUpdate

SetProvider sets the "provider" field.

func (*ProductUpdate) SetQty

func (pu *ProductUpdate) SetQty(d decimal.Decimal) *ProductUpdate

SetQty sets the "qty" field.

func (*ProductUpdate) SetUpdatedAt

func (pu *ProductUpdate) SetUpdatedAt(t time.Time) *ProductUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpdate) SetYear

func (pu *ProductUpdate) SetYear(i int) *ProductUpdate

SetYear sets the "year" field.

func (*ProductUpdate) Where

func (pu *ProductUpdate) Where(ps ...predicate.Product) *ProductUpdate

Where appends a list predicates to the ProductUpdate builder.

type ProductUpdateOne

type ProductUpdateOne struct {
	// contains filtered or unexported fields
}

ProductUpdateOne is the builder for updating a single Product entity.

func (*ProductUpdateOne) AddPrice

AddPrice adds d to the "price" field.

func (*ProductUpdateOne) AddQty

AddQty adds d to the "qty" field.

func (*ProductUpdateOne) AddTagIDs

func (puo *ProductUpdateOne) AddTagIDs(ids ...string) *ProductUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProductUpdateOne) AddTags

func (puo *ProductUpdateOne) AddTags(t ...*Tag) *ProductUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*ProductUpdateOne) AddYear

func (puo *ProductUpdateOne) AddYear(i int) *ProductUpdateOne

AddYear adds i to the "year" field.

func (*ProductUpdateOne) AppendColors

func (puo *ProductUpdateOne) AppendColors(s []string) *ProductUpdateOne

AppendColors appends s to the "colors" field.

func (*ProductUpdateOne) ClearColors

func (puo *ProductUpdateOne) ClearColors() *ProductUpdateOne

ClearColors clears the value of the "colors" field.

func (*ProductUpdateOne) ClearDescription

func (puo *ProductUpdateOne) ClearDescription() *ProductUpdateOne

ClearDescription clears the value of the "description" field.

func (*ProductUpdateOne) ClearProvider

func (puo *ProductUpdateOne) ClearProvider() *ProductUpdateOne

ClearProvider clears the value of the "provider" field.

func (*ProductUpdateOne) ClearTags

func (puo *ProductUpdateOne) ClearTags() *ProductUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*ProductUpdateOne) ClearYear

func (puo *ProductUpdateOne) ClearYear() *ProductUpdateOne

ClearYear clears the value of the "year" field.

func (*ProductUpdateOne) Exec

func (puo *ProductUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProductUpdateOne) ExecX

func (puo *ProductUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProductUpdateOne) Mutation

func (puo *ProductUpdateOne) Mutation() *ProductMutation

Mutation returns the ProductMutation object of the builder.

func (*ProductUpdateOne) RemoveTagIDs

func (puo *ProductUpdateOne) RemoveTagIDs(ids ...string) *ProductUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*ProductUpdateOne) RemoveTags

func (puo *ProductUpdateOne) RemoveTags(t ...*Tag) *ProductUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*ProductUpdateOne) Save

func (puo *ProductUpdateOne) Save(ctx context.Context) (*Product, error)

Save executes the query and returns the updated Product entity.

func (*ProductUpdateOne) SaveX

func (puo *ProductUpdateOne) SaveX(ctx context.Context) *Product

SaveX is like Save, but panics if an error occurs.

func (*ProductUpdateOne) Select

func (puo *ProductUpdateOne) Select(field string, fields ...string) *ProductUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProductUpdateOne) SetColors

func (puo *ProductUpdateOne) SetColors(s []string) *ProductUpdateOne

SetColors sets the "colors" field.

func (*ProductUpdateOne) SetDescription

func (puo *ProductUpdateOne) SetDescription(s string) *ProductUpdateOne

SetDescription sets the "description" field.

func (*ProductUpdateOne) SetName

func (puo *ProductUpdateOne) SetName(s string) *ProductUpdateOne

SetName sets the "name" field.

func (*ProductUpdateOne) SetNillableDescription

func (puo *ProductUpdateOne) SetNillableDescription(s *string) *ProductUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableName

func (puo *ProductUpdateOne) SetNillableName(s *string) *ProductUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProductUpdateOne) SetNillablePrice

func (puo *ProductUpdateOne) SetNillablePrice(d *decimal.Decimal) *ProductUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableProvider

func (puo *ProductUpdateOne) SetNillableProvider(s *string) *ProductUpdateOne

SetNillableProvider sets the "provider" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableQty

func (puo *ProductUpdateOne) SetNillableQty(d *decimal.Decimal) *ProductUpdateOne

SetNillableQty sets the "qty" field if the given value is not nil.

func (*ProductUpdateOne) SetNillableYear

func (puo *ProductUpdateOne) SetNillableYear(i *int) *ProductUpdateOne

SetNillableYear sets the "year" field if the given value is not nil.

func (*ProductUpdateOne) SetPrice

SetPrice sets the "price" field.

func (*ProductUpdateOne) SetProvider

func (puo *ProductUpdateOne) SetProvider(s string) *ProductUpdateOne

SetProvider sets the "provider" field.

func (*ProductUpdateOne) SetQty

SetQty sets the "qty" field.

func (*ProductUpdateOne) SetUpdatedAt

func (puo *ProductUpdateOne) SetUpdatedAt(t time.Time) *ProductUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProductUpdateOne) SetYear

func (puo *ProductUpdateOne) SetYear(i int) *ProductUpdateOne

SetYear sets the "year" field.

func (*ProductUpdateOne) Where

Where appends a list predicates to the ProductUpdate builder.

type Products

type Products []*Product

Products is a parsable slice of Product.

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 Tag

type Tag struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryProductTags

func (t *Tag) QueryProductTags() *ProductTagQuery

QueryProductTags queries the "product_tags" edge of the Tag entity.

func (*Tag) QueryProducts

func (t *Tag) QueryProducts() *ProductQuery

QueryProducts queries the "products" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

Unwrap unwraps the Tag 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 (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

Update returns a builder for updating this Tag. Note that you need to call Tag.Unwrap() before calling this method if this Tag was returned from a transaction, and the transaction was committed or rolled back.

func (*Tag) Value

func (t *Tag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tag. This includes values selected through modifiers, order, etc.

type TagClient

type TagClient struct {
	// contains filtered or unexported fields
}

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a builder for creating a Tag entity.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

CreateBulk returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id string) *TagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id string) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id string) *Tag

GetX is like Get, but panics if an error occurs.

func (*TagClient) Hooks

func (c *TagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TagClient) Intercept

func (c *TagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tag.Intercept(f(g(h())))`.

func (*TagClient) Interceptors

func (c *TagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TagClient) MapCreateBulk

func (c *TagClient) MapCreateBulk(slice any, setFunc func(*TagCreate, int)) *TagCreateBulk

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 (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryProductTags

func (c *TagClient) QueryProductTags(t *Tag) *ProductTagQuery

QueryProductTags queries the product_tags edge of a Tag.

func (*TagClient) QueryProducts

func (c *TagClient) QueryProducts(t *Tag) *ProductQuery

QueryProducts queries the products edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id string) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

func (c *TagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tag.Hooks(f(g(h())))`.

type TagCreate

type TagCreate struct {
	// contains filtered or unexported fields
}

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddProductIDs

func (tc *TagCreate) AddProductIDs(ids ...string) *TagCreate

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*TagCreate) AddProducts

func (tc *TagCreate) AddProducts(p ...*Product) *TagCreate

AddProducts adds the "products" edges to the Product entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetCreatedAt

func (tc *TagCreate) SetCreatedAt(t time.Time) *TagCreate

SetCreatedAt sets the "created_at" field.

func (*TagCreate) SetID

func (tc *TagCreate) SetID(s string) *TagCreate

SetID sets the "id" field.

func (*TagCreate) SetNillableCreatedAt

func (tc *TagCreate) SetNillableCreatedAt(t *time.Time) *TagCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TagCreate) SetNillableUpdatedAt

func (tc *TagCreate) SetNillableUpdatedAt(t *time.Time) *TagCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TagCreate) SetTitle

func (tc *TagCreate) SetTitle(s string) *TagCreate

SetTitle sets the "title" field.

func (*TagCreate) SetUpdatedAt

func (tc *TagCreate) SetUpdatedAt(t time.Time) *TagCreate

SetUpdatedAt sets the "updated_at" field.

type TagCreateBulk

type TagCreateBulk struct {
	// contains filtered or unexported fields
}

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX is like Save, but panics if an error occurs.

type TagDelete

type TagDelete struct {
	// contains filtered or unexported fields
}

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

type TagDeleteOne struct {
	// contains filtered or unexported fields
}

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagDeleteOne) Where

func (tdo *TagDeleteOne) Where(ps ...predicate.Tag) *TagDeleteOne

Where appends a list predicates to the TagDelete builder.

type TagEdges

type TagEdges struct {
	// Products holds the value of the products edge.
	Products []*Product `json:"products,omitempty"`
	// ProductTags holds the value of the product_tags edge.
	ProductTags []*ProductTag `json:"product_tags,omitempty"`
	// contains filtered or unexported fields
}

TagEdges holds the relations/edges for other nodes in the graph.

func (TagEdges) ProductTagsOrErr

func (e TagEdges) ProductTagsOrErr() ([]*ProductTag, error)

ProductTagsOrErr returns the ProductTags value or an error if the edge was not loaded in eager-loading.

func (TagEdges) ProductsOrErr

func (e TagEdges) ProductsOrErr() ([]*Product, error)

ProductsOrErr returns the Products value or an error if the edge was not loaded in eager-loading.

type TagGroupBy

type TagGroupBy struct {
	// contains filtered or unexported fields
}

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TagGroupBy) Bool

func (s *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolX

func (s *TagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagGroupBy) Bools

func (s *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) BoolsX

func (s *TagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagGroupBy) Float64

func (s *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64X

func (s *TagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagGroupBy) Float64s

func (s *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) Float64sX

func (s *TagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagGroupBy) Int

func (s *TagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntX

func (s *TagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagGroupBy) Ints

func (s *TagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) IntsX

func (s *TagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagGroupBy) ScanX

func (s *TagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagGroupBy) String

func (s *TagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringX

func (s *TagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagGroupBy) Strings

func (s *TagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagGroupBy) StringsX

func (s *TagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagMutation

type TagMutation struct {
	// contains filtered or unexported fields
}

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) 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 (*TagMutation) AddProductIDs

func (m *TagMutation) AddProductIDs(ids ...string)

AddProductIDs adds the "products" edge to the Product entity by ids.

func (*TagMutation) AddedEdges

func (m *TagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TagMutation) AddedField

func (m *TagMutation) 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 (*TagMutation) AddedFields

func (m *TagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TagMutation) AddedIDs

func (m *TagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TagMutation) ClearEdge

func (m *TagMutation) 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 (*TagMutation) ClearField

func (m *TagMutation) 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 (*TagMutation) ClearProducts

func (m *TagMutation) ClearProducts()

ClearProducts clears the "products" edge to the Product entity.

func (*TagMutation) ClearedEdges

func (m *TagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TagMutation) ClearedFields

func (m *TagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TagMutation) Client

func (m TagMutation) 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 (*TagMutation) CreatedAt

func (m *TagMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TagMutation) EdgeCleared

func (m *TagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TagMutation) Field

func (m *TagMutation) 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 (*TagMutation) FieldCleared

func (m *TagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TagMutation) Fields

func (m *TagMutation) 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 (*TagMutation) ID

func (m *TagMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TagMutation) IDs

func (m *TagMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TagMutation) OldCreatedAt

func (m *TagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldField

func (m *TagMutation) 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 (*TagMutation) OldTitle

func (m *TagMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Tag entity. If the Tag 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 (*TagMutation) OldUpdatedAt

func (m *TagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Tag entity. If the Tag 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 (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) ProductsCleared

func (m *TagMutation) ProductsCleared() bool

ProductsCleared reports if the "products" edge to the Product entity was cleared.

func (*TagMutation) ProductsIDs

func (m *TagMutation) ProductsIDs() (ids []string)

ProductsIDs returns the "products" edge IDs in the mutation.

func (*TagMutation) RemoveProductIDs

func (m *TagMutation) RemoveProductIDs(ids ...string)

RemoveProductIDs removes the "products" edge to the Product entity by IDs.

func (*TagMutation) RemovedEdges

func (m *TagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TagMutation) RemovedIDs

func (m *TagMutation) 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 (*TagMutation) RemovedProductsIDs

func (m *TagMutation) RemovedProductsIDs() (ids []string)

RemovedProducts returns the removed IDs of the "products" edge to the Product entity.

func (*TagMutation) ResetCreatedAt

func (m *TagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TagMutation) ResetEdge

func (m *TagMutation) 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 (*TagMutation) ResetField

func (m *TagMutation) 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 (*TagMutation) ResetProducts

func (m *TagMutation) ResetProducts()

ResetProducts resets all changes to the "products" edge.

func (*TagMutation) ResetTitle

func (m *TagMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TagMutation) ResetUpdatedAt

func (m *TagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TagMutation) SetCreatedAt

func (m *TagMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TagMutation) SetField

func (m *TagMutation) 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 (*TagMutation) SetID

func (m *TagMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Tag entities.

func (*TagMutation) SetOp

func (m *TagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TagMutation) SetTitle

func (m *TagMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TagMutation) SetUpdatedAt

func (m *TagMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TagMutation) Title

func (m *TagMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TagMutation) Tx

func (m TagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TagMutation) Type

func (m *TagMutation) Type() string

Type returns the node type of this mutation (Tag).

func (*TagMutation) UpdatedAt

func (m *TagMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

func (*TagMutation) WhereP

func (m *TagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TagQuery

type TagQuery struct {
	// contains filtered or unexported fields
}

TagQuery is the builder for querying Tag entities.

func (*TagQuery) Aggregate

func (tq *TagQuery) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate returns a TagSelect configured with the given aggregations.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

AllX is like All, but panics if an error occurs.

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

Clone returns a duplicate of the TagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity from the query. Returns a *NotFoundError when no Tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Tag ID from the query. Returns a *NotFoundError when no Tag ID was found.

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

FirstX is like First, but panics if an error occurs.

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tag.Query().
	GroupBy(tag.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of Tag IDs.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit the number of records to be returned by this query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset to start from.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

Only returns a single Tag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tag entity is found. Returns a *NotFoundError when no Tag entities are found.

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Tag ID in the query. Returns a *NotSingularError when more than one Tag ID is found. Returns a *NotFoundError when no entities are found.

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

OnlyX is like Only, but panics if an error occurs.

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...tag.OrderOption) *TagQuery

Order specifies how the records should be ordered.

func (*TagQuery) QueryProductTags

func (tq *TagQuery) QueryProductTags() *ProductTagQuery

QueryProductTags chains the current query on the "product_tags" edge.

func (*TagQuery) QueryProducts

func (tq *TagQuery) QueryProducts() *ProductQuery

QueryProducts chains the current query on the "products" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldCreatedAt).
	Scan(ctx, &v)

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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 (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithProductTags

func (tq *TagQuery) WithProductTags(opts ...func(*ProductTagQuery)) *TagQuery

WithProductTags tells the query-builder to eager-load the nodes that are connected to the "product_tags" edge. The optional arguments are used to configure the query builder of the edge.

func (*TagQuery) WithProducts

func (tq *TagQuery) WithProducts(opts ...func(*ProductQuery)) *TagQuery

WithProducts tells the query-builder to eager-load the nodes that are connected to the "products" edge. The optional arguments are used to configure the query builder of the edge.

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Aggregate

func (ts *TagSelect) Aggregate(fns ...AggregateFunc) *TagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TagSelect) Bool

func (s *TagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolX

func (s *TagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TagSelect) Bools

func (s *TagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TagSelect) BoolsX

func (s *TagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TagSelect) Float64

func (s *TagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64X

func (s *TagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TagSelect) Float64s

func (s *TagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TagSelect) Float64sX

func (s *TagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TagSelect) Int

func (s *TagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntX

func (s *TagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TagSelect) Ints

func (s *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (s *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TagSelect) ScanX

func (s *TagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (s *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (s *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (s *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (s *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddProductIDs

func (tu *TagUpdate) AddProductIDs(ids ...string) *TagUpdate

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*TagUpdate) AddProducts

func (tu *TagUpdate) AddProducts(p ...*Product) *TagUpdate

AddProducts adds the "products" edges to the Product entity.

func (*TagUpdate) ClearProducts

func (tu *TagUpdate) ClearProducts() *TagUpdate

ClearProducts clears all "products" edges to the Product entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveProductIDs

func (tu *TagUpdate) RemoveProductIDs(ids ...string) *TagUpdate

RemoveProductIDs removes the "products" edge to Product entities by IDs.

func (*TagUpdate) RemoveProducts

func (tu *TagUpdate) RemoveProducts(p ...*Product) *TagUpdate

RemoveProducts removes "products" edges to Product entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetNillableTitle

func (tu *TagUpdate) SetNillableTitle(s *string) *TagUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*TagUpdate) SetTitle

func (tu *TagUpdate) SetTitle(s string) *TagUpdate

SetTitle sets the "title" field.

func (*TagUpdate) SetUpdatedAt

func (tu *TagUpdate) SetUpdatedAt(t time.Time) *TagUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

type TagUpdateOne struct {
	// contains filtered or unexported fields
}

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddProductIDs

func (tuo *TagUpdateOne) AddProductIDs(ids ...string) *TagUpdateOne

AddProductIDs adds the "products" edge to the Product entity by IDs.

func (*TagUpdateOne) AddProducts

func (tuo *TagUpdateOne) AddProducts(p ...*Product) *TagUpdateOne

AddProducts adds the "products" edges to the Product entity.

func (*TagUpdateOne) ClearProducts

func (tuo *TagUpdateOne) ClearProducts() *TagUpdateOne

ClearProducts clears all "products" edges to the Product entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveProductIDs

func (tuo *TagUpdateOne) RemoveProductIDs(ids ...string) *TagUpdateOne

RemoveProductIDs removes the "products" edge to Product entities by IDs.

func (*TagUpdateOne) RemoveProducts

func (tuo *TagUpdateOne) RemoveProducts(p ...*Product) *TagUpdateOne

RemoveProducts removes "products" edges to Product entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

SaveX is like Save, but panics if an error occurs.

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TagUpdateOne) SetNillableTitle

func (tuo *TagUpdateOne) SetNillableTitle(s *string) *TagUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*TagUpdateOne) SetTitle

func (tuo *TagUpdateOne) SetTitle(s string) *TagUpdateOne

SetTitle sets the "title" field.

func (*TagUpdateOne) SetUpdatedAt

func (tuo *TagUpdateOne) SetUpdatedAt(t time.Time) *TagUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TagUpdateOne) Where

func (tuo *TagUpdateOne) Where(ps ...predicate.Tag) *TagUpdateOne

Where appends a list predicates to the TagUpdate builder.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

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 {

	// Conversation is the client for interacting with the Conversation builders.
	Conversation *ConversationClient
	// FinancialTransaction is the client for interacting with the FinancialTransaction builders.
	FinancialTransaction *FinancialTransactionClient
	// Invoice is the client for interacting with the Invoice builders.
	Invoice *InvoiceClient
	// InvoiceLineItem is the client for interacting with the InvoiceLineItem builders.
	InvoiceLineItem *InvoiceLineItemClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// OrderLineItem is the client for interacting with the OrderLineItem builders.
	OrderLineItem *OrderLineItemClient
	// OrderStatusCode is the client for interacting with the OrderStatusCode builders.
	OrderStatusCode *OrderStatusCodeClient
	// Person is the client for interacting with the Person builders.
	Person *PersonClient
	// Product is the client for interacting with the Product builders.
	Product *ProductClient
	// ProductImage is the client for interacting with the ProductImage builders.
	ProductImage *ProductImageClient
	// ProductTag is the client for interacting with the ProductTag builders.
	ProductTag *ProductTagClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL