ent

package
v1.0.1-a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeBillingAddress  = "BillingAddress"
	TypeCustomer        = "Customer"
	TypeDeliveryAddress = "DeliveryAddress"
	TypeLogin           = "Login"
	TypeNote            = "Note"
	TypeOrder           = "Order"
	TypePosition        = "Position"
	TypeRole            = "Role"
	TypeTel             = "Tel"
	TypeUser            = "User"
)

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 BillingAddress

type BillingAddress struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// City holds the value of the "city" field.
	City string `json:"city,omitempty"`
	// Street holds the value of the "street" field.
	Street string `json:"street,omitempty"`
	// Zip holds the value of the "zip" field.
	Zip string `json:"zip,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BillingAddressQuery when eager-loading is set.
	Edges BillingAddressEdges `json:"edges"`
	// contains filtered or unexported fields
}

BillingAddress is the model entity for the BillingAddress schema.

func (*BillingAddress) QueryCustomer

func (ba *BillingAddress) QueryCustomer() *CustomerQuery

QueryCustomer queries the "customer" edge of the BillingAddress entity.

func (*BillingAddress) QueryNotes

func (ba *BillingAddress) QueryNotes() *NoteQuery

QueryNotes queries the "notes" edge of the BillingAddress entity.

func (*BillingAddress) String

func (ba *BillingAddress) String() string

String implements the fmt.Stringer.

func (*BillingAddress) Unwrap

func (ba *BillingAddress) Unwrap() *BillingAddress

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

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

func (*BillingAddress) Value

func (ba *BillingAddress) Value(name string) (ent.Value, error)

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

type BillingAddressClient

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

BillingAddressClient is a client for the BillingAddress schema.

func NewBillingAddressClient

func NewBillingAddressClient(c config) *BillingAddressClient

NewBillingAddressClient returns a client for the BillingAddress from the given config.

func (*BillingAddressClient) Create

Create returns a builder for creating a BillingAddress entity.

func (*BillingAddressClient) CreateBulk

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

func (*BillingAddressClient) Delete

Delete returns a delete builder for BillingAddress.

func (*BillingAddressClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BillingAddressClient) DeleteOneID

func (c *BillingAddressClient) DeleteOneID(id int) *BillingAddressDeleteOne

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

func (*BillingAddressClient) Get

Get returns a BillingAddress entity by its id.

func (*BillingAddressClient) GetX

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

func (*BillingAddressClient) Hooks

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

Hooks returns the client hooks.

func (*BillingAddressClient) Intercept

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

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

func (*BillingAddressClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BillingAddressClient) MapCreateBulk

func (c *BillingAddressClient) MapCreateBulk(slice any, setFunc func(*BillingAddressCreate, int)) *BillingAddressCreateBulk

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

Query returns a query builder for BillingAddress.

func (*BillingAddressClient) QueryCustomer

func (c *BillingAddressClient) QueryCustomer(ba *BillingAddress) *CustomerQuery

QueryCustomer queries the customer edge of a BillingAddress.

func (*BillingAddressClient) QueryNotes

func (c *BillingAddressClient) QueryNotes(ba *BillingAddress) *NoteQuery

QueryNotes queries the notes edge of a BillingAddress.

func (*BillingAddressClient) Update

Update returns an update builder for BillingAddress.

func (*BillingAddressClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*BillingAddressClient) UpdateOneID

func (c *BillingAddressClient) UpdateOneID(id int) *BillingAddressUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BillingAddressClient) Use

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

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

type BillingAddressCreate

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

BillingAddressCreate is the builder for creating a BillingAddress entity.

func (*BillingAddressCreate) AddNoteIDs

func (bac *BillingAddressCreate) AddNoteIDs(ids ...int) *BillingAddressCreate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*BillingAddressCreate) AddNotes

func (bac *BillingAddressCreate) AddNotes(n ...*Note) *BillingAddressCreate

AddNotes adds the "notes" edges to the Note entity.

func (*BillingAddressCreate) Exec

func (bac *BillingAddressCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BillingAddressCreate) ExecX

func (bac *BillingAddressCreate) ExecX(ctx context.Context)

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

func (*BillingAddressCreate) Mutation

Mutation returns the BillingAddressMutation object of the builder.

func (*BillingAddressCreate) Save

Save creates the BillingAddress in the database.

func (*BillingAddressCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*BillingAddressCreate) SetCity

SetCity sets the "city" field.

func (*BillingAddressCreate) SetCreatedAt

func (bac *BillingAddressCreate) SetCreatedAt(t time.Time) *BillingAddressCreate

SetCreatedAt sets the "created_at" field.

func (*BillingAddressCreate) SetCustomer

func (bac *BillingAddressCreate) SetCustomer(c *Customer) *BillingAddressCreate

SetCustomer sets the "customer" edge to the Customer entity.

func (*BillingAddressCreate) SetCustomerID

func (bac *BillingAddressCreate) SetCustomerID(id int) *BillingAddressCreate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*BillingAddressCreate) SetNillableCreatedAt

func (bac *BillingAddressCreate) SetNillableCreatedAt(t *time.Time) *BillingAddressCreate

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

func (*BillingAddressCreate) SetNillableCustomerID

func (bac *BillingAddressCreate) SetNillableCustomerID(id *int) *BillingAddressCreate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*BillingAddressCreate) SetNillableUpdatedAt

func (bac *BillingAddressCreate) SetNillableUpdatedAt(t *time.Time) *BillingAddressCreate

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

func (*BillingAddressCreate) SetStreet

SetStreet sets the "street" field.

func (*BillingAddressCreate) SetUpdatedAt

func (bac *BillingAddressCreate) SetUpdatedAt(t time.Time) *BillingAddressCreate

SetUpdatedAt sets the "updated_at" field.

func (*BillingAddressCreate) SetZip

SetZip sets the "zip" field.

type BillingAddressCreateBulk

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

BillingAddressCreateBulk is the builder for creating many BillingAddress entities in bulk.

func (*BillingAddressCreateBulk) Exec

Exec executes the query.

func (*BillingAddressCreateBulk) ExecX

func (bacb *BillingAddressCreateBulk) ExecX(ctx context.Context)

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

func (*BillingAddressCreateBulk) Save

Save creates the BillingAddress entities in the database.

func (*BillingAddressCreateBulk) SaveX

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

type BillingAddressDelete

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

BillingAddressDelete is the builder for deleting a BillingAddress entity.

func (*BillingAddressDelete) Exec

func (bad *BillingAddressDelete) Exec(ctx context.Context) (int, error)

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

func (*BillingAddressDelete) ExecX

func (bad *BillingAddressDelete) ExecX(ctx context.Context) int

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

func (*BillingAddressDelete) Where

Where appends a list predicates to the BillingAddressDelete builder.

type BillingAddressDeleteOne

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

BillingAddressDeleteOne is the builder for deleting a single BillingAddress entity.

func (*BillingAddressDeleteOne) Exec

func (bado *BillingAddressDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BillingAddressDeleteOne) ExecX

func (bado *BillingAddressDeleteOne) ExecX(ctx context.Context)

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

func (*BillingAddressDeleteOne) Where

Where appends a list predicates to the BillingAddressDelete builder.

type BillingAddressEdges

type BillingAddressEdges struct {
	// Customer holds the value of the customer edge.
	Customer *Customer `json:"customer,omitempty"`
	// Notes holds the value of the notes edge.
	Notes []*Note `json:"notes,omitempty"`
	// contains filtered or unexported fields
}

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

func (BillingAddressEdges) CustomerOrErr

func (e BillingAddressEdges) CustomerOrErr() (*Customer, 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 (BillingAddressEdges) NotesOrErr

func (e BillingAddressEdges) NotesOrErr() ([]*Note, error)

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

type BillingAddressGroupBy

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

BillingAddressGroupBy is the group-by builder for BillingAddress entities.

func (*BillingAddressGroupBy) Aggregate

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

func (*BillingAddressGroupBy) Bool

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

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

func (*BillingAddressGroupBy) BoolX

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

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

func (*BillingAddressGroupBy) Bools

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

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

func (*BillingAddressGroupBy) BoolsX

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

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

func (*BillingAddressGroupBy) Float64

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

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

func (*BillingAddressGroupBy) Float64X

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

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

func (*BillingAddressGroupBy) Float64s

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

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

func (*BillingAddressGroupBy) Float64sX

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

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

func (*BillingAddressGroupBy) Int

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

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

func (*BillingAddressGroupBy) IntX

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

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

func (*BillingAddressGroupBy) Ints

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

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

func (*BillingAddressGroupBy) IntsX

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

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

func (*BillingAddressGroupBy) Scan

func (bagb *BillingAddressGroupBy) Scan(ctx context.Context, v any) error

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

func (*BillingAddressGroupBy) ScanX

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

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

func (*BillingAddressGroupBy) String

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

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

func (*BillingAddressGroupBy) StringX

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

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

func (*BillingAddressGroupBy) Strings

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

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

func (*BillingAddressGroupBy) StringsX

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

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

type BillingAddressMutation

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

BillingAddressMutation represents an operation that mutates the BillingAddress nodes in the graph.

func (*BillingAddressMutation) AddField

func (m *BillingAddressMutation) 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 (*BillingAddressMutation) AddNoteIDs

func (m *BillingAddressMutation) AddNoteIDs(ids ...int)

AddNoteIDs adds the "notes" edge to the Note entity by ids.

func (*BillingAddressMutation) AddedEdges

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

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

func (*BillingAddressMutation) AddedField

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

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

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

func (*BillingAddressMutation) AddedIDs

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

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

func (*BillingAddressMutation) City

func (m *BillingAddressMutation) City() (r string, exists bool)

City returns the value of the "city" field in the mutation.

func (*BillingAddressMutation) ClearCustomer

func (m *BillingAddressMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Customer entity.

func (*BillingAddressMutation) ClearEdge

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

func (m *BillingAddressMutation) 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 (*BillingAddressMutation) ClearNotes

func (m *BillingAddressMutation) ClearNotes()

ClearNotes clears the "notes" edge to the Note entity.

func (*BillingAddressMutation) ClearedEdges

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

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

func (*BillingAddressMutation) ClearedFields

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

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

func (BillingAddressMutation) Client

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

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

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

func (*BillingAddressMutation) CustomerCleared

func (m *BillingAddressMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Customer entity was cleared.

func (*BillingAddressMutation) CustomerID

func (m *BillingAddressMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*BillingAddressMutation) CustomerIDs

func (m *BillingAddressMutation) CustomerIDs() (ids []int)

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 (*BillingAddressMutation) EdgeCleared

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

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

func (*BillingAddressMutation) Field

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

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

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

func (*BillingAddressMutation) Fields

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

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

func (m *BillingAddressMutation) 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 (*BillingAddressMutation) NotesCleared

func (m *BillingAddressMutation) NotesCleared() bool

NotesCleared reports if the "notes" edge to the Note entity was cleared.

func (*BillingAddressMutation) NotesIDs

func (m *BillingAddressMutation) NotesIDs() (ids []int)

NotesIDs returns the "notes" edge IDs in the mutation.

func (*BillingAddressMutation) OldCity

func (m *BillingAddressMutation) OldCity(ctx context.Context) (v string, err error)

OldCity returns the old "city" field's value of the BillingAddress entity. If the BillingAddress 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 (*BillingAddressMutation) OldCreatedAt

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

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

func (m *BillingAddressMutation) 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 (*BillingAddressMutation) OldStreet

func (m *BillingAddressMutation) OldStreet(ctx context.Context) (v string, err error)

OldStreet returns the old "street" field's value of the BillingAddress entity. If the BillingAddress 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 (*BillingAddressMutation) OldUpdatedAt

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

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

func (m *BillingAddressMutation) OldZip(ctx context.Context) (v string, err error)

OldZip returns the old "zip" field's value of the BillingAddress entity. If the BillingAddress 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 (*BillingAddressMutation) Op

func (m *BillingAddressMutation) Op() Op

Op returns the operation name.

func (*BillingAddressMutation) RemoveNoteIDs

func (m *BillingAddressMutation) RemoveNoteIDs(ids ...int)

RemoveNoteIDs removes the "notes" edge to the Note entity by IDs.

func (*BillingAddressMutation) RemovedEdges

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

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

func (*BillingAddressMutation) RemovedIDs

func (m *BillingAddressMutation) 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 (*BillingAddressMutation) RemovedNotesIDs

func (m *BillingAddressMutation) RemovedNotesIDs() (ids []int)

RemovedNotes returns the removed IDs of the "notes" edge to the Note entity.

func (*BillingAddressMutation) ResetCity

func (m *BillingAddressMutation) ResetCity()

ResetCity resets all changes to the "city" field.

func (*BillingAddressMutation) ResetCreatedAt

func (m *BillingAddressMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BillingAddressMutation) ResetCustomer

func (m *BillingAddressMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*BillingAddressMutation) ResetEdge

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

func (m *BillingAddressMutation) 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 (*BillingAddressMutation) ResetNotes

func (m *BillingAddressMutation) ResetNotes()

ResetNotes resets all changes to the "notes" edge.

func (*BillingAddressMutation) ResetStreet

func (m *BillingAddressMutation) ResetStreet()

ResetStreet resets all changes to the "street" field.

func (*BillingAddressMutation) ResetUpdatedAt

func (m *BillingAddressMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BillingAddressMutation) ResetZip

func (m *BillingAddressMutation) ResetZip()

ResetZip resets all changes to the "zip" field.

func (*BillingAddressMutation) SetCity

func (m *BillingAddressMutation) SetCity(s string)

SetCity sets the "city" field.

func (*BillingAddressMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BillingAddressMutation) SetCustomerID

func (m *BillingAddressMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the Customer entity by id.

func (*BillingAddressMutation) SetField

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

func (m *BillingAddressMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BillingAddressMutation) SetStreet

func (m *BillingAddressMutation) SetStreet(s string)

SetStreet sets the "street" field.

func (*BillingAddressMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BillingAddressMutation) SetZip

func (m *BillingAddressMutation) SetZip(s string)

SetZip sets the "zip" field.

func (*BillingAddressMutation) Street

func (m *BillingAddressMutation) Street() (r string, exists bool)

Street returns the value of the "street" field in the mutation.

func (BillingAddressMutation) Tx

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

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

func (*BillingAddressMutation) Type

func (m *BillingAddressMutation) Type() string

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

func (*BillingAddressMutation) UpdatedAt

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

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

func (*BillingAddressMutation) Where

Where appends a list predicates to the BillingAddressMutation builder.

func (*BillingAddressMutation) WhereP

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

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

func (*BillingAddressMutation) Zip

func (m *BillingAddressMutation) Zip() (r string, exists bool)

Zip returns the value of the "zip" field in the mutation.

type BillingAddressQuery

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

BillingAddressQuery is the builder for querying BillingAddress entities.

func (*BillingAddressQuery) Aggregate

func (baq *BillingAddressQuery) Aggregate(fns ...AggregateFunc) *BillingAddressSelect

Aggregate returns a BillingAddressSelect configured with the given aggregations.

func (*BillingAddressQuery) All

All executes the query and returns a list of BillingAddresses.

func (*BillingAddressQuery) AllX

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

func (*BillingAddressQuery) Clone

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

func (*BillingAddressQuery) Count

func (baq *BillingAddressQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BillingAddressQuery) CountX

func (baq *BillingAddressQuery) CountX(ctx context.Context) int

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

func (*BillingAddressQuery) Exist

func (baq *BillingAddressQuery) Exist(ctx context.Context) (bool, error)

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

func (*BillingAddressQuery) ExistX

func (baq *BillingAddressQuery) ExistX(ctx context.Context) bool

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

func (*BillingAddressQuery) First

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

func (*BillingAddressQuery) FirstID

func (baq *BillingAddressQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BillingAddressQuery) FirstIDX

func (baq *BillingAddressQuery) FirstIDX(ctx context.Context) int

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

func (*BillingAddressQuery) FirstX

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

func (*BillingAddressQuery) GroupBy

func (baq *BillingAddressQuery) GroupBy(field string, fields ...string) *BillingAddressGroupBy

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

client.BillingAddress.Query().
	GroupBy(billingaddress.FieldCity).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BillingAddressQuery) IDs

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

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

func (*BillingAddressQuery) IDsX

func (baq *BillingAddressQuery) IDsX(ctx context.Context) []int

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

func (*BillingAddressQuery) Limit

func (baq *BillingAddressQuery) Limit(limit int) *BillingAddressQuery

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

func (*BillingAddressQuery) Offset

func (baq *BillingAddressQuery) Offset(offset int) *BillingAddressQuery

Offset to start from.

func (*BillingAddressQuery) Only

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

func (*BillingAddressQuery) OnlyID

func (baq *BillingAddressQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BillingAddressQuery) OnlyIDX

func (baq *BillingAddressQuery) OnlyIDX(ctx context.Context) int

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

func (*BillingAddressQuery) OnlyX

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

func (*BillingAddressQuery) Order

Order specifies how the records should be ordered.

func (*BillingAddressQuery) QueryCustomer

func (baq *BillingAddressQuery) QueryCustomer() *CustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*BillingAddressQuery) QueryNotes

func (baq *BillingAddressQuery) QueryNotes() *NoteQuery

QueryNotes chains the current query on the "notes" edge.

func (*BillingAddressQuery) Select

func (baq *BillingAddressQuery) Select(fields ...string) *BillingAddressSelect

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

client.BillingAddress.Query().
	Select(billingaddress.FieldCity).
	Scan(ctx, &v)

func (*BillingAddressQuery) Unique

func (baq *BillingAddressQuery) Unique(unique bool) *BillingAddressQuery

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

Where adds a new predicate for the BillingAddressQuery builder.

func (*BillingAddressQuery) WithCustomer

func (baq *BillingAddressQuery) WithCustomer(opts ...func(*CustomerQuery)) *BillingAddressQuery

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 (*BillingAddressQuery) WithNotes

func (baq *BillingAddressQuery) WithNotes(opts ...func(*NoteQuery)) *BillingAddressQuery

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

type BillingAddressSelect

type BillingAddressSelect struct {
	*BillingAddressQuery
	// contains filtered or unexported fields
}

BillingAddressSelect is the builder for selecting fields of BillingAddress entities.

func (*BillingAddressSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*BillingAddressSelect) Bool

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

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

func (*BillingAddressSelect) BoolX

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

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

func (*BillingAddressSelect) Bools

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

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

func (*BillingAddressSelect) BoolsX

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

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

func (*BillingAddressSelect) Float64

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

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

func (*BillingAddressSelect) Float64X

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

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

func (*BillingAddressSelect) Float64s

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

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

func (*BillingAddressSelect) Float64sX

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

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

func (*BillingAddressSelect) Int

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

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

func (*BillingAddressSelect) IntX

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

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

func (*BillingAddressSelect) Ints

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

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

func (*BillingAddressSelect) IntsX

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

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

func (*BillingAddressSelect) Scan

func (bas *BillingAddressSelect) Scan(ctx context.Context, v any) error

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

func (*BillingAddressSelect) ScanX

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

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

func (*BillingAddressSelect) String

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

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

func (*BillingAddressSelect) StringX

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

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

func (*BillingAddressSelect) Strings

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

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

func (*BillingAddressSelect) StringsX

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

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

type BillingAddressUpdate

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

BillingAddressUpdate is the builder for updating BillingAddress entities.

func (*BillingAddressUpdate) AddNoteIDs

func (bau *BillingAddressUpdate) AddNoteIDs(ids ...int) *BillingAddressUpdate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*BillingAddressUpdate) AddNotes

func (bau *BillingAddressUpdate) AddNotes(n ...*Note) *BillingAddressUpdate

AddNotes adds the "notes" edges to the Note entity.

func (*BillingAddressUpdate) ClearCustomer

func (bau *BillingAddressUpdate) ClearCustomer() *BillingAddressUpdate

ClearCustomer clears the "customer" edge to the Customer entity.

func (*BillingAddressUpdate) ClearNotes

func (bau *BillingAddressUpdate) ClearNotes() *BillingAddressUpdate

ClearNotes clears all "notes" edges to the Note entity.

func (*BillingAddressUpdate) Exec

func (bau *BillingAddressUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BillingAddressUpdate) ExecX

func (bau *BillingAddressUpdate) ExecX(ctx context.Context)

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

func (*BillingAddressUpdate) Mutation

Mutation returns the BillingAddressMutation object of the builder.

func (*BillingAddressUpdate) RemoveNoteIDs

func (bau *BillingAddressUpdate) RemoveNoteIDs(ids ...int) *BillingAddressUpdate

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*BillingAddressUpdate) RemoveNotes

func (bau *BillingAddressUpdate) RemoveNotes(n ...*Note) *BillingAddressUpdate

RemoveNotes removes "notes" edges to Note entities.

func (*BillingAddressUpdate) Save

func (bau *BillingAddressUpdate) Save(ctx context.Context) (int, error)

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

func (*BillingAddressUpdate) SaveX

func (bau *BillingAddressUpdate) SaveX(ctx context.Context) int

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

func (*BillingAddressUpdate) SetCity

SetCity sets the "city" field.

func (*BillingAddressUpdate) SetCustomer

func (bau *BillingAddressUpdate) SetCustomer(c *Customer) *BillingAddressUpdate

SetCustomer sets the "customer" edge to the Customer entity.

func (*BillingAddressUpdate) SetCustomerID

func (bau *BillingAddressUpdate) SetCustomerID(id int) *BillingAddressUpdate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*BillingAddressUpdate) SetNillableCity

func (bau *BillingAddressUpdate) SetNillableCity(s *string) *BillingAddressUpdate

SetNillableCity sets the "city" field if the given value is not nil.

func (*BillingAddressUpdate) SetNillableCustomerID

func (bau *BillingAddressUpdate) SetNillableCustomerID(id *int) *BillingAddressUpdate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*BillingAddressUpdate) SetNillableStreet

func (bau *BillingAddressUpdate) SetNillableStreet(s *string) *BillingAddressUpdate

SetNillableStreet sets the "street" field if the given value is not nil.

func (*BillingAddressUpdate) SetNillableZip

func (bau *BillingAddressUpdate) SetNillableZip(s *string) *BillingAddressUpdate

SetNillableZip sets the "zip" field if the given value is not nil.

func (*BillingAddressUpdate) SetStreet

SetStreet sets the "street" field.

func (*BillingAddressUpdate) SetUpdatedAt

func (bau *BillingAddressUpdate) SetUpdatedAt(t time.Time) *BillingAddressUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BillingAddressUpdate) SetZip

SetZip sets the "zip" field.

func (*BillingAddressUpdate) Where

Where appends a list predicates to the BillingAddressUpdate builder.

type BillingAddressUpdateOne

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

BillingAddressUpdateOne is the builder for updating a single BillingAddress entity.

func (*BillingAddressUpdateOne) AddNoteIDs

func (bauo *BillingAddressUpdateOne) AddNoteIDs(ids ...int) *BillingAddressUpdateOne

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*BillingAddressUpdateOne) AddNotes

func (bauo *BillingAddressUpdateOne) AddNotes(n ...*Note) *BillingAddressUpdateOne

AddNotes adds the "notes" edges to the Note entity.

func (*BillingAddressUpdateOne) ClearCustomer

func (bauo *BillingAddressUpdateOne) ClearCustomer() *BillingAddressUpdateOne

ClearCustomer clears the "customer" edge to the Customer entity.

func (*BillingAddressUpdateOne) ClearNotes

ClearNotes clears all "notes" edges to the Note entity.

func (*BillingAddressUpdateOne) Exec

func (bauo *BillingAddressUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BillingAddressUpdateOne) ExecX

func (bauo *BillingAddressUpdateOne) ExecX(ctx context.Context)

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

func (*BillingAddressUpdateOne) Mutation

Mutation returns the BillingAddressMutation object of the builder.

func (*BillingAddressUpdateOne) RemoveNoteIDs

func (bauo *BillingAddressUpdateOne) RemoveNoteIDs(ids ...int) *BillingAddressUpdateOne

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*BillingAddressUpdateOne) RemoveNotes

func (bauo *BillingAddressUpdateOne) RemoveNotes(n ...*Note) *BillingAddressUpdateOne

RemoveNotes removes "notes" edges to Note entities.

func (*BillingAddressUpdateOne) Save

Save executes the query and returns the updated BillingAddress entity.

func (*BillingAddressUpdateOne) SaveX

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

func (*BillingAddressUpdateOne) Select

func (bauo *BillingAddressUpdateOne) Select(field string, fields ...string) *BillingAddressUpdateOne

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

func (*BillingAddressUpdateOne) SetCity

SetCity sets the "city" field.

func (*BillingAddressUpdateOne) SetCustomer

SetCustomer sets the "customer" edge to the Customer entity.

func (*BillingAddressUpdateOne) SetCustomerID

func (bauo *BillingAddressUpdateOne) SetCustomerID(id int) *BillingAddressUpdateOne

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*BillingAddressUpdateOne) SetNillableCity

func (bauo *BillingAddressUpdateOne) SetNillableCity(s *string) *BillingAddressUpdateOne

SetNillableCity sets the "city" field if the given value is not nil.

func (*BillingAddressUpdateOne) SetNillableCustomerID

func (bauo *BillingAddressUpdateOne) SetNillableCustomerID(id *int) *BillingAddressUpdateOne

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*BillingAddressUpdateOne) SetNillableStreet

func (bauo *BillingAddressUpdateOne) SetNillableStreet(s *string) *BillingAddressUpdateOne

SetNillableStreet sets the "street" field if the given value is not nil.

func (*BillingAddressUpdateOne) SetNillableZip

func (bauo *BillingAddressUpdateOne) SetNillableZip(s *string) *BillingAddressUpdateOne

SetNillableZip sets the "zip" field if the given value is not nil.

func (*BillingAddressUpdateOne) SetStreet

SetStreet sets the "street" field.

func (*BillingAddressUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*BillingAddressUpdateOne) SetZip

SetZip sets the "zip" field.

func (*BillingAddressUpdateOne) Where

Where appends a list predicates to the BillingAddressUpdate builder.

type BillingAddresses

type BillingAddresses []*BillingAddress

BillingAddresses is a parsable slice of BillingAddress.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// BillingAddress is the client for interacting with the BillingAddress builders.
	BillingAddress *BillingAddressClient
	// Customer is the client for interacting with the Customer builders.
	Customer *CustomerClient
	// DeliveryAddress is the client for interacting with the DeliveryAddress builders.
	DeliveryAddress *DeliveryAddressClient
	// Login is the client for interacting with the Login builders.
	Login *LoginClient
	// Note is the client for interacting with the Note builders.
	Note *NoteClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// Position is the client for interacting with the Position builders.
	Position *PositionClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Tel is the client for interacting with the Tel builders.
	Tel *TelClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	BillingAddress.
	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 Customer

type Customer struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CustomerQuery when eager-loading is set.
	Edges CustomerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Customer is the model entity for the Customer schema.

func (*Customer) QueryBillingAddresses

func (c *Customer) QueryBillingAddresses() *BillingAddressQuery

QueryBillingAddresses queries the "billing_addresses" edge of the Customer entity.

func (*Customer) QueryCreatedBy

func (c *Customer) QueryCreatedBy() *UserQuery

QueryCreatedBy queries the "created_by" edge of the Customer entity.

func (*Customer) QueryDeliveryAddresses

func (c *Customer) QueryDeliveryAddresses() *DeliveryAddressQuery

QueryDeliveryAddresses queries the "delivery_addresses" edge of the Customer entity.

func (*Customer) QueryLogin

func (c *Customer) QueryLogin() *LoginQuery

QueryLogin queries the "login" edge of the Customer entity.

func (*Customer) QueryNotes

func (c *Customer) QueryNotes() *NoteQuery

QueryNotes queries the "notes" edge of the Customer entity.

func (*Customer) QueryOrders

func (c *Customer) QueryOrders() *OrderQuery

QueryOrders queries the "orders" edge of the Customer entity.

func (*Customer) QueryTels

func (c *Customer) QueryTels() *TelQuery

QueryTels queries the "tels" edge of the Customer entity.

func (*Customer) String

func (c *Customer) String() string

String implements the fmt.Stringer.

func (*Customer) Unwrap

func (c *Customer) Unwrap() *Customer

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

func (c *Customer) Update() *CustomerUpdateOne

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

func (*Customer) Value

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

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

type CustomerClient

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

CustomerClient is a client for the Customer schema.

func NewCustomerClient

func NewCustomerClient(c config) *CustomerClient

NewCustomerClient returns a client for the Customer from the given config.

func (*CustomerClient) Create

func (c *CustomerClient) Create() *CustomerCreate

Create returns a builder for creating a Customer entity.

func (*CustomerClient) CreateBulk

func (c *CustomerClient) CreateBulk(builders ...*CustomerCreate) *CustomerCreateBulk

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

func (*CustomerClient) Delete

func (c *CustomerClient) Delete() *CustomerDelete

Delete returns a delete builder for Customer.

func (*CustomerClient) DeleteOne

func (c *CustomerClient) DeleteOne(cu *Customer) *CustomerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CustomerClient) DeleteOneID

func (c *CustomerClient) DeleteOneID(id int) *CustomerDeleteOne

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

func (*CustomerClient) Get

func (c *CustomerClient) Get(ctx context.Context, id int) (*Customer, error)

Get returns a Customer entity by its id.

func (*CustomerClient) GetX

func (c *CustomerClient) GetX(ctx context.Context, id int) *Customer

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

func (*CustomerClient) Hooks

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

Hooks returns the client hooks.

func (*CustomerClient) Intercept

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

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

func (*CustomerClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CustomerClient) MapCreateBulk

func (c *CustomerClient) MapCreateBulk(slice any, setFunc func(*CustomerCreate, int)) *CustomerCreateBulk

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

func (c *CustomerClient) Query() *CustomerQuery

Query returns a query builder for Customer.

func (*CustomerClient) QueryBillingAddresses

func (c *CustomerClient) QueryBillingAddresses(cu *Customer) *BillingAddressQuery

QueryBillingAddresses queries the billing_addresses edge of a Customer.

func (*CustomerClient) QueryCreatedBy

func (c *CustomerClient) QueryCreatedBy(cu *Customer) *UserQuery

QueryCreatedBy queries the created_by edge of a Customer.

func (*CustomerClient) QueryDeliveryAddresses

func (c *CustomerClient) QueryDeliveryAddresses(cu *Customer) *DeliveryAddressQuery

QueryDeliveryAddresses queries the delivery_addresses edge of a Customer.

func (*CustomerClient) QueryLogin

func (c *CustomerClient) QueryLogin(cu *Customer) *LoginQuery

QueryLogin queries the login edge of a Customer.

func (*CustomerClient) QueryNotes

func (c *CustomerClient) QueryNotes(cu *Customer) *NoteQuery

QueryNotes queries the notes edge of a Customer.

func (*CustomerClient) QueryOrders

func (c *CustomerClient) QueryOrders(cu *Customer) *OrderQuery

QueryOrders queries the orders edge of a Customer.

func (*CustomerClient) QueryTels

func (c *CustomerClient) QueryTels(cu *Customer) *TelQuery

QueryTels queries the tels edge of a Customer.

func (*CustomerClient) Update

func (c *CustomerClient) Update() *CustomerUpdate

Update returns an update builder for Customer.

func (*CustomerClient) UpdateOne

func (c *CustomerClient) UpdateOne(cu *Customer) *CustomerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CustomerClient) UpdateOneID

func (c *CustomerClient) UpdateOneID(id int) *CustomerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CustomerClient) Use

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

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

type CustomerCreate

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

CustomerCreate is the builder for creating a Customer entity.

func (*CustomerCreate) AddBillingAddressIDs

func (cc *CustomerCreate) AddBillingAddressIDs(ids ...int) *CustomerCreate

AddBillingAddressIDs adds the "billing_addresses" edge to the BillingAddress entity by IDs.

func (*CustomerCreate) AddBillingAddresses

func (cc *CustomerCreate) AddBillingAddresses(b ...*BillingAddress) *CustomerCreate

AddBillingAddresses adds the "billing_addresses" edges to the BillingAddress entity.

func (*CustomerCreate) AddDeliveryAddressIDs

func (cc *CustomerCreate) AddDeliveryAddressIDs(ids ...int) *CustomerCreate

AddDeliveryAddressIDs adds the "delivery_addresses" edge to the DeliveryAddress entity by IDs.

func (*CustomerCreate) AddDeliveryAddresses

func (cc *CustomerCreate) AddDeliveryAddresses(d ...*DeliveryAddress) *CustomerCreate

AddDeliveryAddresses adds the "delivery_addresses" edges to the DeliveryAddress entity.

func (*CustomerCreate) AddNoteIDs

func (cc *CustomerCreate) AddNoteIDs(ids ...int) *CustomerCreate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*CustomerCreate) AddNotes

func (cc *CustomerCreate) AddNotes(n ...*Note) *CustomerCreate

AddNotes adds the "notes" edges to the Note entity.

func (*CustomerCreate) AddOrderIDs

func (cc *CustomerCreate) AddOrderIDs(ids ...int) *CustomerCreate

AddOrderIDs adds the "orders" edge to the Order entity by IDs.

func (*CustomerCreate) AddOrders

func (cc *CustomerCreate) AddOrders(o ...*Order) *CustomerCreate

AddOrders adds the "orders" edges to the Order entity.

func (*CustomerCreate) AddTelIDs

func (cc *CustomerCreate) AddTelIDs(ids ...int) *CustomerCreate

AddTelIDs adds the "tels" edge to the Tel entity by IDs.

func (*CustomerCreate) AddTels

func (cc *CustomerCreate) AddTels(t ...*Tel) *CustomerCreate

AddTels adds the "tels" edges to the Tel entity.

func (*CustomerCreate) Exec

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

Exec executes the query.

func (*CustomerCreate) ExecX

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

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

func (*CustomerCreate) Mutation

func (cc *CustomerCreate) Mutation() *CustomerMutation

Mutation returns the CustomerMutation object of the builder.

func (*CustomerCreate) Save

func (cc *CustomerCreate) Save(ctx context.Context) (*Customer, error)

Save creates the Customer in the database.

func (*CustomerCreate) SaveX

func (cc *CustomerCreate) SaveX(ctx context.Context) *Customer

SaveX calls Save and panics if Save returns an error.

func (*CustomerCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CustomerCreate) SetCreatedBy

func (cc *CustomerCreate) SetCreatedBy(u *User) *CustomerCreate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*CustomerCreate) SetCreatedByID

func (cc *CustomerCreate) SetCreatedByID(id int) *CustomerCreate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*CustomerCreate) SetEmail

func (cc *CustomerCreate) SetEmail(s string) *CustomerCreate

SetEmail sets the "email" field.

func (*CustomerCreate) SetLogin

func (cc *CustomerCreate) SetLogin(l *Login) *CustomerCreate

SetLogin sets the "login" edge to the Login entity.

func (*CustomerCreate) SetLoginID

func (cc *CustomerCreate) SetLoginID(id int) *CustomerCreate

SetLoginID sets the "login" edge to the Login entity by ID.

func (*CustomerCreate) SetName

func (cc *CustomerCreate) SetName(s string) *CustomerCreate

SetName sets the "name" field.

func (*CustomerCreate) SetNillableCreatedAt

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

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

func (*CustomerCreate) SetNillableCreatedByID

func (cc *CustomerCreate) SetNillableCreatedByID(id *int) *CustomerCreate

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*CustomerCreate) SetNillableLoginID

func (cc *CustomerCreate) SetNillableLoginID(id *int) *CustomerCreate

SetNillableLoginID sets the "login" edge to the Login entity by ID if the given value is not nil.

func (*CustomerCreate) SetNillableUpdatedAt

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

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

func (*CustomerCreate) SetPassword

func (cc *CustomerCreate) SetPassword(s string) *CustomerCreate

SetPassword sets the "password" field.

func (*CustomerCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type CustomerCreateBulk

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

CustomerCreateBulk is the builder for creating many Customer entities in bulk.

func (*CustomerCreateBulk) Exec

func (ccb *CustomerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CustomerCreateBulk) ExecX

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

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

func (*CustomerCreateBulk) Save

func (ccb *CustomerCreateBulk) Save(ctx context.Context) ([]*Customer, error)

Save creates the Customer entities in the database.

func (*CustomerCreateBulk) SaveX

func (ccb *CustomerCreateBulk) SaveX(ctx context.Context) []*Customer

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

type CustomerDelete

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

CustomerDelete is the builder for deleting a Customer entity.

func (*CustomerDelete) Exec

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

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

func (*CustomerDelete) ExecX

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

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

func (*CustomerDelete) Where

func (cd *CustomerDelete) Where(ps ...predicate.Customer) *CustomerDelete

Where appends a list predicates to the CustomerDelete builder.

type CustomerDeleteOne

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

CustomerDeleteOne is the builder for deleting a single Customer entity.

func (*CustomerDeleteOne) Exec

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

Exec executes the deletion query.

func (*CustomerDeleteOne) ExecX

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

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

func (*CustomerDeleteOne) Where

Where appends a list predicates to the CustomerDelete builder.

type CustomerEdges

type CustomerEdges struct {
	// Orders holds the value of the orders edge.
	Orders []*Order `json:"orders,omitempty"`
	// BillingAddresses holds the value of the billing_addresses edge.
	BillingAddresses []*BillingAddress `json:"billing_addresses,omitempty"`
	// DeliveryAddresses holds the value of the delivery_addresses edge.
	DeliveryAddresses []*DeliveryAddress `json:"delivery_addresses,omitempty"`
	// Tels holds the value of the tels edge.
	Tels []*Tel `json:"tels,omitempty"`
	// CreatedBy holds the value of the created_by edge.
	CreatedBy *User `json:"created_by,omitempty"`
	// Notes holds the value of the notes edge.
	Notes []*Note `json:"notes,omitempty"`
	// Login holds the value of the login edge.
	Login *Login `json:"login,omitempty"`
	// contains filtered or unexported fields
}

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

func (CustomerEdges) BillingAddressesOrErr

func (e CustomerEdges) BillingAddressesOrErr() ([]*BillingAddress, error)

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

func (CustomerEdges) CreatedByOrErr

func (e CustomerEdges) CreatedByOrErr() (*User, error)

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

func (CustomerEdges) DeliveryAddressesOrErr

func (e CustomerEdges) DeliveryAddressesOrErr() ([]*DeliveryAddress, error)

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

func (CustomerEdges) LoginOrErr

func (e CustomerEdges) LoginOrErr() (*Login, error)

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

func (CustomerEdges) NotesOrErr

func (e CustomerEdges) NotesOrErr() ([]*Note, error)

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

func (CustomerEdges) OrdersOrErr

func (e CustomerEdges) OrdersOrErr() ([]*Order, error)

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

func (CustomerEdges) TelsOrErr

func (e CustomerEdges) TelsOrErr() ([]*Tel, error)

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

type CustomerGroupBy

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

CustomerGroupBy is the group-by builder for Customer entities.

func (*CustomerGroupBy) Aggregate

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

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

func (*CustomerGroupBy) Bool

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

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

func (*CustomerGroupBy) BoolX

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

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

func (*CustomerGroupBy) Bools

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

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

func (*CustomerGroupBy) BoolsX

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

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

func (*CustomerGroupBy) Float64

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

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

func (*CustomerGroupBy) Float64X

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

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

func (*CustomerGroupBy) Float64s

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

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

func (*CustomerGroupBy) Float64sX

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

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

func (*CustomerGroupBy) Int

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

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

func (*CustomerGroupBy) IntX

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

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

func (*CustomerGroupBy) Ints

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

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

func (*CustomerGroupBy) IntsX

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

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

func (*CustomerGroupBy) Scan

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

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

func (*CustomerGroupBy) ScanX

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

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

func (*CustomerGroupBy) String

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

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

func (*CustomerGroupBy) StringX

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

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

func (*CustomerGroupBy) Strings

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

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

func (*CustomerGroupBy) StringsX

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

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

type CustomerMutation

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

CustomerMutation represents an operation that mutates the Customer nodes in the graph.

func (*CustomerMutation) AddBillingAddressIDs

func (m *CustomerMutation) AddBillingAddressIDs(ids ...int)

AddBillingAddressIDs adds the "billing_addresses" edge to the BillingAddress entity by ids.

func (*CustomerMutation) AddDeliveryAddressIDs

func (m *CustomerMutation) AddDeliveryAddressIDs(ids ...int)

AddDeliveryAddressIDs adds the "delivery_addresses" edge to the DeliveryAddress entity by ids.

func (*CustomerMutation) AddField

func (m *CustomerMutation) 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 (*CustomerMutation) AddNoteIDs

func (m *CustomerMutation) AddNoteIDs(ids ...int)

AddNoteIDs adds the "notes" edge to the Note entity by ids.

func (*CustomerMutation) AddOrderIDs

func (m *CustomerMutation) AddOrderIDs(ids ...int)

AddOrderIDs adds the "orders" edge to the Order entity by ids.

func (*CustomerMutation) AddTelIDs

func (m *CustomerMutation) AddTelIDs(ids ...int)

AddTelIDs adds the "tels" edge to the Tel entity by ids.

func (*CustomerMutation) AddedEdges

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

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

func (*CustomerMutation) AddedField

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

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

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

func (*CustomerMutation) AddedIDs

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

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

func (*CustomerMutation) BillingAddressesCleared

func (m *CustomerMutation) BillingAddressesCleared() bool

BillingAddressesCleared reports if the "billing_addresses" edge to the BillingAddress entity was cleared.

func (*CustomerMutation) BillingAddressesIDs

func (m *CustomerMutation) BillingAddressesIDs() (ids []int)

BillingAddressesIDs returns the "billing_addresses" edge IDs in the mutation.

func (*CustomerMutation) ClearBillingAddresses

func (m *CustomerMutation) ClearBillingAddresses()

ClearBillingAddresses clears the "billing_addresses" edge to the BillingAddress entity.

func (*CustomerMutation) ClearCreatedBy

func (m *CustomerMutation) ClearCreatedBy()

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*CustomerMutation) ClearDeliveryAddresses

func (m *CustomerMutation) ClearDeliveryAddresses()

ClearDeliveryAddresses clears the "delivery_addresses" edge to the DeliveryAddress entity.

func (*CustomerMutation) ClearEdge

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

func (m *CustomerMutation) 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 (*CustomerMutation) ClearLogin

func (m *CustomerMutation) ClearLogin()

ClearLogin clears the "login" edge to the Login entity.

func (*CustomerMutation) ClearNotes

func (m *CustomerMutation) ClearNotes()

ClearNotes clears the "notes" edge to the Note entity.

func (*CustomerMutation) ClearOrders

func (m *CustomerMutation) ClearOrders()

ClearOrders clears the "orders" edge to the Order entity.

func (*CustomerMutation) ClearTels

func (m *CustomerMutation) ClearTels()

ClearTels clears the "tels" edge to the Tel entity.

func (*CustomerMutation) ClearedEdges

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

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

func (*CustomerMutation) ClearedFields

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

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

func (CustomerMutation) Client

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

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

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

func (*CustomerMutation) CreatedByCleared

func (m *CustomerMutation) CreatedByCleared() bool

CreatedByCleared reports if the "created_by" edge to the User entity was cleared.

func (*CustomerMutation) CreatedByID

func (m *CustomerMutation) CreatedByID() (id int, exists bool)

CreatedByID returns the "created_by" edge ID in the mutation.

func (*CustomerMutation) CreatedByIDs

func (m *CustomerMutation) CreatedByIDs() (ids []int)

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

func (*CustomerMutation) DeliveryAddressesCleared

func (m *CustomerMutation) DeliveryAddressesCleared() bool

DeliveryAddressesCleared reports if the "delivery_addresses" edge to the DeliveryAddress entity was cleared.

func (*CustomerMutation) DeliveryAddressesIDs

func (m *CustomerMutation) DeliveryAddressesIDs() (ids []int)

DeliveryAddressesIDs returns the "delivery_addresses" edge IDs in the mutation.

func (*CustomerMutation) EdgeCleared

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

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

func (*CustomerMutation) Email

func (m *CustomerMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*CustomerMutation) Field

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

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

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

func (*CustomerMutation) Fields

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

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

func (m *CustomerMutation) 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 (*CustomerMutation) LoginCleared

func (m *CustomerMutation) LoginCleared() bool

LoginCleared reports if the "login" edge to the Login entity was cleared.

func (*CustomerMutation) LoginID

func (m *CustomerMutation) LoginID() (id int, exists bool)

LoginID returns the "login" edge ID in the mutation.

func (*CustomerMutation) LoginIDs

func (m *CustomerMutation) LoginIDs() (ids []int)

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

func (*CustomerMutation) Name

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

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

func (*CustomerMutation) NotesCleared

func (m *CustomerMutation) NotesCleared() bool

NotesCleared reports if the "notes" edge to the Note entity was cleared.

func (*CustomerMutation) NotesIDs

func (m *CustomerMutation) NotesIDs() (ids []int)

NotesIDs returns the "notes" edge IDs in the mutation.

func (*CustomerMutation) OldCreatedAt

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

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

func (m *CustomerMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Customer entity. If the Customer 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 (*CustomerMutation) OldField

func (m *CustomerMutation) 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 (*CustomerMutation) OldName

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

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

func (m *CustomerMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Customer entity. If the Customer 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 (*CustomerMutation) OldUpdatedAt

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

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

func (m *CustomerMutation) Op() Op

Op returns the operation name.

func (*CustomerMutation) OrdersCleared

func (m *CustomerMutation) OrdersCleared() bool

OrdersCleared reports if the "orders" edge to the Order entity was cleared.

func (*CustomerMutation) OrdersIDs

func (m *CustomerMutation) OrdersIDs() (ids []int)

OrdersIDs returns the "orders" edge IDs in the mutation.

func (*CustomerMutation) Password

func (m *CustomerMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*CustomerMutation) RemoveBillingAddressIDs

func (m *CustomerMutation) RemoveBillingAddressIDs(ids ...int)

RemoveBillingAddressIDs removes the "billing_addresses" edge to the BillingAddress entity by IDs.

func (*CustomerMutation) RemoveDeliveryAddressIDs

func (m *CustomerMutation) RemoveDeliveryAddressIDs(ids ...int)

RemoveDeliveryAddressIDs removes the "delivery_addresses" edge to the DeliveryAddress entity by IDs.

func (*CustomerMutation) RemoveNoteIDs

func (m *CustomerMutation) RemoveNoteIDs(ids ...int)

RemoveNoteIDs removes the "notes" edge to the Note entity by IDs.

func (*CustomerMutation) RemoveOrderIDs

func (m *CustomerMutation) RemoveOrderIDs(ids ...int)

RemoveOrderIDs removes the "orders" edge to the Order entity by IDs.

func (*CustomerMutation) RemoveTelIDs

func (m *CustomerMutation) RemoveTelIDs(ids ...int)

RemoveTelIDs removes the "tels" edge to the Tel entity by IDs.

func (*CustomerMutation) RemovedBillingAddressesIDs

func (m *CustomerMutation) RemovedBillingAddressesIDs() (ids []int)

RemovedBillingAddresses returns the removed IDs of the "billing_addresses" edge to the BillingAddress entity.

func (*CustomerMutation) RemovedDeliveryAddressesIDs

func (m *CustomerMutation) RemovedDeliveryAddressesIDs() (ids []int)

RemovedDeliveryAddresses returns the removed IDs of the "delivery_addresses" edge to the DeliveryAddress entity.

func (*CustomerMutation) RemovedEdges

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

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

func (*CustomerMutation) RemovedIDs

func (m *CustomerMutation) 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 (*CustomerMutation) RemovedNotesIDs

func (m *CustomerMutation) RemovedNotesIDs() (ids []int)

RemovedNotes returns the removed IDs of the "notes" edge to the Note entity.

func (*CustomerMutation) RemovedOrdersIDs

func (m *CustomerMutation) RemovedOrdersIDs() (ids []int)

RemovedOrders returns the removed IDs of the "orders" edge to the Order entity.

func (*CustomerMutation) RemovedTelsIDs

func (m *CustomerMutation) RemovedTelsIDs() (ids []int)

RemovedTels returns the removed IDs of the "tels" edge to the Tel entity.

func (*CustomerMutation) ResetBillingAddresses

func (m *CustomerMutation) ResetBillingAddresses()

ResetBillingAddresses resets all changes to the "billing_addresses" edge.

func (*CustomerMutation) ResetCreatedAt

func (m *CustomerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CustomerMutation) ResetCreatedBy

func (m *CustomerMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" edge.

func (*CustomerMutation) ResetDeliveryAddresses

func (m *CustomerMutation) ResetDeliveryAddresses()

ResetDeliveryAddresses resets all changes to the "delivery_addresses" edge.

func (*CustomerMutation) ResetEdge

func (m *CustomerMutation) 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 (*CustomerMutation) ResetEmail

func (m *CustomerMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*CustomerMutation) ResetField

func (m *CustomerMutation) 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 (*CustomerMutation) ResetLogin

func (m *CustomerMutation) ResetLogin()

ResetLogin resets all changes to the "login" edge.

func (*CustomerMutation) ResetName

func (m *CustomerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CustomerMutation) ResetNotes

func (m *CustomerMutation) ResetNotes()

ResetNotes resets all changes to the "notes" edge.

func (*CustomerMutation) ResetOrders

func (m *CustomerMutation) ResetOrders()

ResetOrders resets all changes to the "orders" edge.

func (*CustomerMutation) ResetPassword

func (m *CustomerMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*CustomerMutation) ResetTels

func (m *CustomerMutation) ResetTels()

ResetTels resets all changes to the "tels" edge.

func (*CustomerMutation) ResetUpdatedAt

func (m *CustomerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CustomerMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CustomerMutation) SetCreatedByID

func (m *CustomerMutation) SetCreatedByID(id int)

SetCreatedByID sets the "created_by" edge to the User entity by id.

func (*CustomerMutation) SetEmail

func (m *CustomerMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*CustomerMutation) SetField

func (m *CustomerMutation) 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 (*CustomerMutation) SetLoginID

func (m *CustomerMutation) SetLoginID(id int)

SetLoginID sets the "login" edge to the Login entity by id.

func (*CustomerMutation) SetName

func (m *CustomerMutation) SetName(s string)

SetName sets the "name" field.

func (*CustomerMutation) SetOp

func (m *CustomerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CustomerMutation) SetPassword

func (m *CustomerMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*CustomerMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CustomerMutation) TelsCleared

func (m *CustomerMutation) TelsCleared() bool

TelsCleared reports if the "tels" edge to the Tel entity was cleared.

func (*CustomerMutation) TelsIDs

func (m *CustomerMutation) TelsIDs() (ids []int)

TelsIDs returns the "tels" edge IDs in the mutation.

func (CustomerMutation) Tx

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

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

func (*CustomerMutation) Type

func (m *CustomerMutation) Type() string

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

func (*CustomerMutation) UpdatedAt

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

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

func (*CustomerMutation) Where

func (m *CustomerMutation) Where(ps ...predicate.Customer)

Where appends a list predicates to the CustomerMutation builder.

func (*CustomerMutation) WhereP

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

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

type CustomerQuery

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

CustomerQuery is the builder for querying Customer entities.

func (*CustomerQuery) Aggregate

func (cq *CustomerQuery) Aggregate(fns ...AggregateFunc) *CustomerSelect

Aggregate returns a CustomerSelect configured with the given aggregations.

func (*CustomerQuery) All

func (cq *CustomerQuery) All(ctx context.Context) ([]*Customer, error)

All executes the query and returns a list of Customers.

func (*CustomerQuery) AllX

func (cq *CustomerQuery) AllX(ctx context.Context) []*Customer

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

func (*CustomerQuery) Clone

func (cq *CustomerQuery) Clone() *CustomerQuery

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

func (*CustomerQuery) Count

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

Count returns the count of the given query.

func (*CustomerQuery) CountX

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

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

func (*CustomerQuery) Exist

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

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

func (*CustomerQuery) ExistX

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

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

func (*CustomerQuery) First

func (cq *CustomerQuery) First(ctx context.Context) (*Customer, error)

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

func (*CustomerQuery) FirstID

func (cq *CustomerQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CustomerQuery) FirstIDX

func (cq *CustomerQuery) FirstIDX(ctx context.Context) int

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

func (*CustomerQuery) FirstX

func (cq *CustomerQuery) FirstX(ctx context.Context) *Customer

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

func (*CustomerQuery) GroupBy

func (cq *CustomerQuery) GroupBy(field string, fields ...string) *CustomerGroupBy

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

client.Customer.Query().
	GroupBy(customer.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CustomerQuery) IDs

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

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

func (*CustomerQuery) IDsX

func (cq *CustomerQuery) IDsX(ctx context.Context) []int

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

func (*CustomerQuery) Limit

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

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

func (*CustomerQuery) Offset

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

Offset to start from.

func (*CustomerQuery) Only

func (cq *CustomerQuery) Only(ctx context.Context) (*Customer, error)

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

func (*CustomerQuery) OnlyID

func (cq *CustomerQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CustomerQuery) OnlyIDX

func (cq *CustomerQuery) OnlyIDX(ctx context.Context) int

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

func (*CustomerQuery) OnlyX

func (cq *CustomerQuery) OnlyX(ctx context.Context) *Customer

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

func (*CustomerQuery) Order

Order specifies how the records should be ordered.

func (*CustomerQuery) QueryBillingAddresses

func (cq *CustomerQuery) QueryBillingAddresses() *BillingAddressQuery

QueryBillingAddresses chains the current query on the "billing_addresses" edge.

func (*CustomerQuery) QueryCreatedBy

func (cq *CustomerQuery) QueryCreatedBy() *UserQuery

QueryCreatedBy chains the current query on the "created_by" edge.

func (*CustomerQuery) QueryDeliveryAddresses

func (cq *CustomerQuery) QueryDeliveryAddresses() *DeliveryAddressQuery

QueryDeliveryAddresses chains the current query on the "delivery_addresses" edge.

func (*CustomerQuery) QueryLogin

func (cq *CustomerQuery) QueryLogin() *LoginQuery

QueryLogin chains the current query on the "login" edge.

func (*CustomerQuery) QueryNotes

func (cq *CustomerQuery) QueryNotes() *NoteQuery

QueryNotes chains the current query on the "notes" edge.

func (*CustomerQuery) QueryOrders

func (cq *CustomerQuery) QueryOrders() *OrderQuery

QueryOrders chains the current query on the "orders" edge.

func (*CustomerQuery) QueryTels

func (cq *CustomerQuery) QueryTels() *TelQuery

QueryTels chains the current query on the "tels" edge.

func (*CustomerQuery) Select

func (cq *CustomerQuery) Select(fields ...string) *CustomerSelect

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

client.Customer.Query().
	Select(customer.FieldName).
	Scan(ctx, &v)

func (*CustomerQuery) Unique

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

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

func (cq *CustomerQuery) Where(ps ...predicate.Customer) *CustomerQuery

Where adds a new predicate for the CustomerQuery builder.

func (*CustomerQuery) WithBillingAddresses

func (cq *CustomerQuery) WithBillingAddresses(opts ...func(*BillingAddressQuery)) *CustomerQuery

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

func (*CustomerQuery) WithCreatedBy

func (cq *CustomerQuery) WithCreatedBy(opts ...func(*UserQuery)) *CustomerQuery

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

func (*CustomerQuery) WithDeliveryAddresses

func (cq *CustomerQuery) WithDeliveryAddresses(opts ...func(*DeliveryAddressQuery)) *CustomerQuery

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

func (*CustomerQuery) WithLogin

func (cq *CustomerQuery) WithLogin(opts ...func(*LoginQuery)) *CustomerQuery

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

func (*CustomerQuery) WithNotes

func (cq *CustomerQuery) WithNotes(opts ...func(*NoteQuery)) *CustomerQuery

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

func (*CustomerQuery) WithOrders

func (cq *CustomerQuery) WithOrders(opts ...func(*OrderQuery)) *CustomerQuery

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

func (*CustomerQuery) WithTels

func (cq *CustomerQuery) WithTels(opts ...func(*TelQuery)) *CustomerQuery

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

type CustomerSelect

type CustomerSelect struct {
	*CustomerQuery
	// contains filtered or unexported fields
}

CustomerSelect is the builder for selecting fields of Customer entities.

func (*CustomerSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CustomerSelect) Bool

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

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

func (*CustomerSelect) BoolX

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

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

func (*CustomerSelect) Bools

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

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

func (*CustomerSelect) BoolsX

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

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

func (*CustomerSelect) Float64

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

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

func (*CustomerSelect) Float64X

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

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

func (*CustomerSelect) Float64s

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

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

func (*CustomerSelect) Float64sX

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

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

func (*CustomerSelect) Int

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

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

func (*CustomerSelect) IntX

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

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

func (*CustomerSelect) Ints

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

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

func (*CustomerSelect) IntsX

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

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

func (*CustomerSelect) Scan

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

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

func (*CustomerSelect) ScanX

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

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

func (*CustomerSelect) String

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

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

func (*CustomerSelect) StringX

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

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

func (*CustomerSelect) Strings

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

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

func (*CustomerSelect) StringsX

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

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

type CustomerUpdate

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

CustomerUpdate is the builder for updating Customer entities.

func (*CustomerUpdate) AddBillingAddressIDs

func (cu *CustomerUpdate) AddBillingAddressIDs(ids ...int) *CustomerUpdate

AddBillingAddressIDs adds the "billing_addresses" edge to the BillingAddress entity by IDs.

func (*CustomerUpdate) AddBillingAddresses

func (cu *CustomerUpdate) AddBillingAddresses(b ...*BillingAddress) *CustomerUpdate

AddBillingAddresses adds the "billing_addresses" edges to the BillingAddress entity.

func (*CustomerUpdate) AddDeliveryAddressIDs

func (cu *CustomerUpdate) AddDeliveryAddressIDs(ids ...int) *CustomerUpdate

AddDeliveryAddressIDs adds the "delivery_addresses" edge to the DeliveryAddress entity by IDs.

func (*CustomerUpdate) AddDeliveryAddresses

func (cu *CustomerUpdate) AddDeliveryAddresses(d ...*DeliveryAddress) *CustomerUpdate

AddDeliveryAddresses adds the "delivery_addresses" edges to the DeliveryAddress entity.

func (*CustomerUpdate) AddNoteIDs

func (cu *CustomerUpdate) AddNoteIDs(ids ...int) *CustomerUpdate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*CustomerUpdate) AddNotes

func (cu *CustomerUpdate) AddNotes(n ...*Note) *CustomerUpdate

AddNotes adds the "notes" edges to the Note entity.

func (*CustomerUpdate) AddOrderIDs

func (cu *CustomerUpdate) AddOrderIDs(ids ...int) *CustomerUpdate

AddOrderIDs adds the "orders" edge to the Order entity by IDs.

func (*CustomerUpdate) AddOrders

func (cu *CustomerUpdate) AddOrders(o ...*Order) *CustomerUpdate

AddOrders adds the "orders" edges to the Order entity.

func (*CustomerUpdate) AddTelIDs

func (cu *CustomerUpdate) AddTelIDs(ids ...int) *CustomerUpdate

AddTelIDs adds the "tels" edge to the Tel entity by IDs.

func (*CustomerUpdate) AddTels

func (cu *CustomerUpdate) AddTels(t ...*Tel) *CustomerUpdate

AddTels adds the "tels" edges to the Tel entity.

func (*CustomerUpdate) ClearBillingAddresses

func (cu *CustomerUpdate) ClearBillingAddresses() *CustomerUpdate

ClearBillingAddresses clears all "billing_addresses" edges to the BillingAddress entity.

func (*CustomerUpdate) ClearCreatedBy

func (cu *CustomerUpdate) ClearCreatedBy() *CustomerUpdate

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*CustomerUpdate) ClearDeliveryAddresses

func (cu *CustomerUpdate) ClearDeliveryAddresses() *CustomerUpdate

ClearDeliveryAddresses clears all "delivery_addresses" edges to the DeliveryAddress entity.

func (*CustomerUpdate) ClearLogin

func (cu *CustomerUpdate) ClearLogin() *CustomerUpdate

ClearLogin clears the "login" edge to the Login entity.

func (*CustomerUpdate) ClearNotes

func (cu *CustomerUpdate) ClearNotes() *CustomerUpdate

ClearNotes clears all "notes" edges to the Note entity.

func (*CustomerUpdate) ClearOrders

func (cu *CustomerUpdate) ClearOrders() *CustomerUpdate

ClearOrders clears all "orders" edges to the Order entity.

func (*CustomerUpdate) ClearTels

func (cu *CustomerUpdate) ClearTels() *CustomerUpdate

ClearTels clears all "tels" edges to the Tel entity.

func (*CustomerUpdate) Exec

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

Exec executes the query.

func (*CustomerUpdate) ExecX

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

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

func (*CustomerUpdate) Mutation

func (cu *CustomerUpdate) Mutation() *CustomerMutation

Mutation returns the CustomerMutation object of the builder.

func (*CustomerUpdate) RemoveBillingAddressIDs

func (cu *CustomerUpdate) RemoveBillingAddressIDs(ids ...int) *CustomerUpdate

RemoveBillingAddressIDs removes the "billing_addresses" edge to BillingAddress entities by IDs.

func (*CustomerUpdate) RemoveBillingAddresses

func (cu *CustomerUpdate) RemoveBillingAddresses(b ...*BillingAddress) *CustomerUpdate

RemoveBillingAddresses removes "billing_addresses" edges to BillingAddress entities.

func (*CustomerUpdate) RemoveDeliveryAddressIDs

func (cu *CustomerUpdate) RemoveDeliveryAddressIDs(ids ...int) *CustomerUpdate

RemoveDeliveryAddressIDs removes the "delivery_addresses" edge to DeliveryAddress entities by IDs.

func (*CustomerUpdate) RemoveDeliveryAddresses

func (cu *CustomerUpdate) RemoveDeliveryAddresses(d ...*DeliveryAddress) *CustomerUpdate

RemoveDeliveryAddresses removes "delivery_addresses" edges to DeliveryAddress entities.

func (*CustomerUpdate) RemoveNoteIDs

func (cu *CustomerUpdate) RemoveNoteIDs(ids ...int) *CustomerUpdate

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*CustomerUpdate) RemoveNotes

func (cu *CustomerUpdate) RemoveNotes(n ...*Note) *CustomerUpdate

RemoveNotes removes "notes" edges to Note entities.

func (*CustomerUpdate) RemoveOrderIDs

func (cu *CustomerUpdate) RemoveOrderIDs(ids ...int) *CustomerUpdate

RemoveOrderIDs removes the "orders" edge to Order entities by IDs.

func (*CustomerUpdate) RemoveOrders

func (cu *CustomerUpdate) RemoveOrders(o ...*Order) *CustomerUpdate

RemoveOrders removes "orders" edges to Order entities.

func (*CustomerUpdate) RemoveTelIDs

func (cu *CustomerUpdate) RemoveTelIDs(ids ...int) *CustomerUpdate

RemoveTelIDs removes the "tels" edge to Tel entities by IDs.

func (*CustomerUpdate) RemoveTels

func (cu *CustomerUpdate) RemoveTels(t ...*Tel) *CustomerUpdate

RemoveTels removes "tels" edges to Tel entities.

func (*CustomerUpdate) Save

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

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

func (*CustomerUpdate) SaveX

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

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

func (*CustomerUpdate) SetCreatedBy

func (cu *CustomerUpdate) SetCreatedBy(u *User) *CustomerUpdate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*CustomerUpdate) SetCreatedByID

func (cu *CustomerUpdate) SetCreatedByID(id int) *CustomerUpdate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*CustomerUpdate) SetEmail

func (cu *CustomerUpdate) SetEmail(s string) *CustomerUpdate

SetEmail sets the "email" field.

func (*CustomerUpdate) SetLogin

func (cu *CustomerUpdate) SetLogin(l *Login) *CustomerUpdate

SetLogin sets the "login" edge to the Login entity.

func (*CustomerUpdate) SetLoginID

func (cu *CustomerUpdate) SetLoginID(id int) *CustomerUpdate

SetLoginID sets the "login" edge to the Login entity by ID.

func (*CustomerUpdate) SetName

func (cu *CustomerUpdate) SetName(s string) *CustomerUpdate

SetName sets the "name" field.

func (*CustomerUpdate) SetNillableCreatedByID

func (cu *CustomerUpdate) SetNillableCreatedByID(id *int) *CustomerUpdate

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*CustomerUpdate) SetNillableEmail

func (cu *CustomerUpdate) SetNillableEmail(s *string) *CustomerUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*CustomerUpdate) SetNillableLoginID

func (cu *CustomerUpdate) SetNillableLoginID(id *int) *CustomerUpdate

SetNillableLoginID sets the "login" edge to the Login entity by ID if the given value is not nil.

func (*CustomerUpdate) SetNillableName

func (cu *CustomerUpdate) SetNillableName(s *string) *CustomerUpdate

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

func (*CustomerUpdate) SetNillablePassword

func (cu *CustomerUpdate) SetNillablePassword(s *string) *CustomerUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*CustomerUpdate) SetPassword

func (cu *CustomerUpdate) SetPassword(s string) *CustomerUpdate

SetPassword sets the "password" field.

func (*CustomerUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CustomerUpdate) Where

func (cu *CustomerUpdate) Where(ps ...predicate.Customer) *CustomerUpdate

Where appends a list predicates to the CustomerUpdate builder.

type CustomerUpdateOne

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

CustomerUpdateOne is the builder for updating a single Customer entity.

func (*CustomerUpdateOne) AddBillingAddressIDs

func (cuo *CustomerUpdateOne) AddBillingAddressIDs(ids ...int) *CustomerUpdateOne

AddBillingAddressIDs adds the "billing_addresses" edge to the BillingAddress entity by IDs.

func (*CustomerUpdateOne) AddBillingAddresses

func (cuo *CustomerUpdateOne) AddBillingAddresses(b ...*BillingAddress) *CustomerUpdateOne

AddBillingAddresses adds the "billing_addresses" edges to the BillingAddress entity.

func (*CustomerUpdateOne) AddDeliveryAddressIDs

func (cuo *CustomerUpdateOne) AddDeliveryAddressIDs(ids ...int) *CustomerUpdateOne

AddDeliveryAddressIDs adds the "delivery_addresses" edge to the DeliveryAddress entity by IDs.

func (*CustomerUpdateOne) AddDeliveryAddresses

func (cuo *CustomerUpdateOne) AddDeliveryAddresses(d ...*DeliveryAddress) *CustomerUpdateOne

AddDeliveryAddresses adds the "delivery_addresses" edges to the DeliveryAddress entity.

func (*CustomerUpdateOne) AddNoteIDs

func (cuo *CustomerUpdateOne) AddNoteIDs(ids ...int) *CustomerUpdateOne

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*CustomerUpdateOne) AddNotes

func (cuo *CustomerUpdateOne) AddNotes(n ...*Note) *CustomerUpdateOne

AddNotes adds the "notes" edges to the Note entity.

func (*CustomerUpdateOne) AddOrderIDs

func (cuo *CustomerUpdateOne) AddOrderIDs(ids ...int) *CustomerUpdateOne

AddOrderIDs adds the "orders" edge to the Order entity by IDs.

func (*CustomerUpdateOne) AddOrders

func (cuo *CustomerUpdateOne) AddOrders(o ...*Order) *CustomerUpdateOne

AddOrders adds the "orders" edges to the Order entity.

func (*CustomerUpdateOne) AddTelIDs

func (cuo *CustomerUpdateOne) AddTelIDs(ids ...int) *CustomerUpdateOne

AddTelIDs adds the "tels" edge to the Tel entity by IDs.

func (*CustomerUpdateOne) AddTels

func (cuo *CustomerUpdateOne) AddTels(t ...*Tel) *CustomerUpdateOne

AddTels adds the "tels" edges to the Tel entity.

func (*CustomerUpdateOne) ClearBillingAddresses

func (cuo *CustomerUpdateOne) ClearBillingAddresses() *CustomerUpdateOne

ClearBillingAddresses clears all "billing_addresses" edges to the BillingAddress entity.

func (*CustomerUpdateOne) ClearCreatedBy

func (cuo *CustomerUpdateOne) ClearCreatedBy() *CustomerUpdateOne

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*CustomerUpdateOne) ClearDeliveryAddresses

func (cuo *CustomerUpdateOne) ClearDeliveryAddresses() *CustomerUpdateOne

ClearDeliveryAddresses clears all "delivery_addresses" edges to the DeliveryAddress entity.

func (*CustomerUpdateOne) ClearLogin

func (cuo *CustomerUpdateOne) ClearLogin() *CustomerUpdateOne

ClearLogin clears the "login" edge to the Login entity.

func (*CustomerUpdateOne) ClearNotes

func (cuo *CustomerUpdateOne) ClearNotes() *CustomerUpdateOne

ClearNotes clears all "notes" edges to the Note entity.

func (*CustomerUpdateOne) ClearOrders

func (cuo *CustomerUpdateOne) ClearOrders() *CustomerUpdateOne

ClearOrders clears all "orders" edges to the Order entity.

func (*CustomerUpdateOne) ClearTels

func (cuo *CustomerUpdateOne) ClearTels() *CustomerUpdateOne

ClearTels clears all "tels" edges to the Tel entity.

func (*CustomerUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CustomerUpdateOne) ExecX

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

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

func (*CustomerUpdateOne) Mutation

func (cuo *CustomerUpdateOne) Mutation() *CustomerMutation

Mutation returns the CustomerMutation object of the builder.

func (*CustomerUpdateOne) RemoveBillingAddressIDs

func (cuo *CustomerUpdateOne) RemoveBillingAddressIDs(ids ...int) *CustomerUpdateOne

RemoveBillingAddressIDs removes the "billing_addresses" edge to BillingAddress entities by IDs.

func (*CustomerUpdateOne) RemoveBillingAddresses

func (cuo *CustomerUpdateOne) RemoveBillingAddresses(b ...*BillingAddress) *CustomerUpdateOne

RemoveBillingAddresses removes "billing_addresses" edges to BillingAddress entities.

func (*CustomerUpdateOne) RemoveDeliveryAddressIDs

func (cuo *CustomerUpdateOne) RemoveDeliveryAddressIDs(ids ...int) *CustomerUpdateOne

RemoveDeliveryAddressIDs removes the "delivery_addresses" edge to DeliveryAddress entities by IDs.

func (*CustomerUpdateOne) RemoveDeliveryAddresses

func (cuo *CustomerUpdateOne) RemoveDeliveryAddresses(d ...*DeliveryAddress) *CustomerUpdateOne

RemoveDeliveryAddresses removes "delivery_addresses" edges to DeliveryAddress entities.

func (*CustomerUpdateOne) RemoveNoteIDs

func (cuo *CustomerUpdateOne) RemoveNoteIDs(ids ...int) *CustomerUpdateOne

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*CustomerUpdateOne) RemoveNotes

func (cuo *CustomerUpdateOne) RemoveNotes(n ...*Note) *CustomerUpdateOne

RemoveNotes removes "notes" edges to Note entities.

func (*CustomerUpdateOne) RemoveOrderIDs

func (cuo *CustomerUpdateOne) RemoveOrderIDs(ids ...int) *CustomerUpdateOne

RemoveOrderIDs removes the "orders" edge to Order entities by IDs.

func (*CustomerUpdateOne) RemoveOrders

func (cuo *CustomerUpdateOne) RemoveOrders(o ...*Order) *CustomerUpdateOne

RemoveOrders removes "orders" edges to Order entities.

func (*CustomerUpdateOne) RemoveTelIDs

func (cuo *CustomerUpdateOne) RemoveTelIDs(ids ...int) *CustomerUpdateOne

RemoveTelIDs removes the "tels" edge to Tel entities by IDs.

func (*CustomerUpdateOne) RemoveTels

func (cuo *CustomerUpdateOne) RemoveTels(t ...*Tel) *CustomerUpdateOne

RemoveTels removes "tels" edges to Tel entities.

func (*CustomerUpdateOne) Save

func (cuo *CustomerUpdateOne) Save(ctx context.Context) (*Customer, error)

Save executes the query and returns the updated Customer entity.

func (*CustomerUpdateOne) SaveX

func (cuo *CustomerUpdateOne) SaveX(ctx context.Context) *Customer

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

func (*CustomerUpdateOne) Select

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

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

func (*CustomerUpdateOne) SetCreatedBy

func (cuo *CustomerUpdateOne) SetCreatedBy(u *User) *CustomerUpdateOne

SetCreatedBy sets the "created_by" edge to the User entity.

func (*CustomerUpdateOne) SetCreatedByID

func (cuo *CustomerUpdateOne) SetCreatedByID(id int) *CustomerUpdateOne

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*CustomerUpdateOne) SetEmail

func (cuo *CustomerUpdateOne) SetEmail(s string) *CustomerUpdateOne

SetEmail sets the "email" field.

func (*CustomerUpdateOne) SetLogin

func (cuo *CustomerUpdateOne) SetLogin(l *Login) *CustomerUpdateOne

SetLogin sets the "login" edge to the Login entity.

func (*CustomerUpdateOne) SetLoginID

func (cuo *CustomerUpdateOne) SetLoginID(id int) *CustomerUpdateOne

SetLoginID sets the "login" edge to the Login entity by ID.

func (*CustomerUpdateOne) SetName

func (cuo *CustomerUpdateOne) SetName(s string) *CustomerUpdateOne

SetName sets the "name" field.

func (*CustomerUpdateOne) SetNillableCreatedByID

func (cuo *CustomerUpdateOne) SetNillableCreatedByID(id *int) *CustomerUpdateOne

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*CustomerUpdateOne) SetNillableEmail

func (cuo *CustomerUpdateOne) SetNillableEmail(s *string) *CustomerUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*CustomerUpdateOne) SetNillableLoginID

func (cuo *CustomerUpdateOne) SetNillableLoginID(id *int) *CustomerUpdateOne

SetNillableLoginID sets the "login" edge to the Login entity by ID if the given value is not nil.

func (*CustomerUpdateOne) SetNillableName

func (cuo *CustomerUpdateOne) SetNillableName(s *string) *CustomerUpdateOne

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

func (*CustomerUpdateOne) SetNillablePassword

func (cuo *CustomerUpdateOne) SetNillablePassword(s *string) *CustomerUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*CustomerUpdateOne) SetPassword

func (cuo *CustomerUpdateOne) SetPassword(s string) *CustomerUpdateOne

SetPassword sets the "password" field.

func (*CustomerUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CustomerUpdateOne) Where

Where appends a list predicates to the CustomerUpdate builder.

type Customers

type Customers []*Customer

Customers is a parsable slice of Customer.

type DeliveryAddress

type DeliveryAddress struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// City holds the value of the "city" field.
	City string `json:"city,omitempty"`
	// Street holds the value of the "street" field.
	Street string `json:"street,omitempty"`
	// Zip holds the value of the "zip" field.
	Zip string `json:"zip,omitempty"`
	// Number holds the value of the "number" field.
	Number string `json:"number,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeliveryAddressQuery when eager-loading is set.
	Edges DeliveryAddressEdges `json:"edges"`
	// contains filtered or unexported fields
}

DeliveryAddress is the model entity for the DeliveryAddress schema.

func (*DeliveryAddress) QueryCustomer

func (da *DeliveryAddress) QueryCustomer() *CustomerQuery

QueryCustomer queries the "customer" edge of the DeliveryAddress entity.

func (*DeliveryAddress) QueryNotes

func (da *DeliveryAddress) QueryNotes() *NoteQuery

QueryNotes queries the "notes" edge of the DeliveryAddress entity.

func (*DeliveryAddress) QueryTelephone

func (da *DeliveryAddress) QueryTelephone() *TelQuery

QueryTelephone queries the "telephone" edge of the DeliveryAddress entity.

func (*DeliveryAddress) String

func (da *DeliveryAddress) String() string

String implements the fmt.Stringer.

func (*DeliveryAddress) Unwrap

func (da *DeliveryAddress) Unwrap() *DeliveryAddress

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

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

func (*DeliveryAddress) Value

func (da *DeliveryAddress) Value(name string) (ent.Value, error)

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

type DeliveryAddressClient

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

DeliveryAddressClient is a client for the DeliveryAddress schema.

func NewDeliveryAddressClient

func NewDeliveryAddressClient(c config) *DeliveryAddressClient

NewDeliveryAddressClient returns a client for the DeliveryAddress from the given config.

func (*DeliveryAddressClient) Create

Create returns a builder for creating a DeliveryAddress entity.

func (*DeliveryAddressClient) CreateBulk

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

func (*DeliveryAddressClient) Delete

Delete returns a delete builder for DeliveryAddress.

func (*DeliveryAddressClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DeliveryAddressClient) DeleteOneID

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

func (*DeliveryAddressClient) Get

Get returns a DeliveryAddress entity by its id.

func (*DeliveryAddressClient) GetX

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

func (*DeliveryAddressClient) Hooks

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

Hooks returns the client hooks.

func (*DeliveryAddressClient) Intercept

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

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

func (*DeliveryAddressClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DeliveryAddressClient) MapCreateBulk

func (c *DeliveryAddressClient) MapCreateBulk(slice any, setFunc func(*DeliveryAddressCreate, int)) *DeliveryAddressCreateBulk

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

Query returns a query builder for DeliveryAddress.

func (*DeliveryAddressClient) QueryCustomer

func (c *DeliveryAddressClient) QueryCustomer(da *DeliveryAddress) *CustomerQuery

QueryCustomer queries the customer edge of a DeliveryAddress.

func (*DeliveryAddressClient) QueryNotes

func (c *DeliveryAddressClient) QueryNotes(da *DeliveryAddress) *NoteQuery

QueryNotes queries the notes edge of a DeliveryAddress.

func (*DeliveryAddressClient) QueryTelephone

func (c *DeliveryAddressClient) QueryTelephone(da *DeliveryAddress) *TelQuery

QueryTelephone queries the telephone edge of a DeliveryAddress.

func (*DeliveryAddressClient) Update

Update returns an update builder for DeliveryAddress.

func (*DeliveryAddressClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeliveryAddressClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DeliveryAddressClient) Use

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

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

type DeliveryAddressCreate

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

DeliveryAddressCreate is the builder for creating a DeliveryAddress entity.

func (*DeliveryAddressCreate) AddNoteIDs

func (dac *DeliveryAddressCreate) AddNoteIDs(ids ...int) *DeliveryAddressCreate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*DeliveryAddressCreate) AddNotes

func (dac *DeliveryAddressCreate) AddNotes(n ...*Note) *DeliveryAddressCreate

AddNotes adds the "notes" edges to the Note entity.

func (*DeliveryAddressCreate) Exec

func (dac *DeliveryAddressCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeliveryAddressCreate) ExecX

func (dac *DeliveryAddressCreate) ExecX(ctx context.Context)

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

func (*DeliveryAddressCreate) Mutation

Mutation returns the DeliveryAddressMutation object of the builder.

func (*DeliveryAddressCreate) Save

Save creates the DeliveryAddress in the database.

func (*DeliveryAddressCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DeliveryAddressCreate) SetCity

SetCity sets the "city" field.

func (*DeliveryAddressCreate) SetCreatedAt

func (dac *DeliveryAddressCreate) SetCreatedAt(t time.Time) *DeliveryAddressCreate

SetCreatedAt sets the "created_at" field.

func (*DeliveryAddressCreate) SetCustomer

SetCustomer sets the "customer" edge to the Customer entity.

func (*DeliveryAddressCreate) SetCustomerID

func (dac *DeliveryAddressCreate) SetCustomerID(id int) *DeliveryAddressCreate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*DeliveryAddressCreate) SetNillableCreatedAt

func (dac *DeliveryAddressCreate) SetNillableCreatedAt(t *time.Time) *DeliveryAddressCreate

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

func (*DeliveryAddressCreate) SetNillableCustomerID

func (dac *DeliveryAddressCreate) SetNillableCustomerID(id *int) *DeliveryAddressCreate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*DeliveryAddressCreate) SetNillableTelephoneID

func (dac *DeliveryAddressCreate) SetNillableTelephoneID(id *int) *DeliveryAddressCreate

SetNillableTelephoneID sets the "telephone" edge to the Tel entity by ID if the given value is not nil.

func (*DeliveryAddressCreate) SetNillableUpdatedAt

func (dac *DeliveryAddressCreate) SetNillableUpdatedAt(t *time.Time) *DeliveryAddressCreate

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

func (*DeliveryAddressCreate) SetNumber

SetNumber sets the "number" field.

func (*DeliveryAddressCreate) SetStreet

SetStreet sets the "street" field.

func (*DeliveryAddressCreate) SetTelephone

func (dac *DeliveryAddressCreate) SetTelephone(t *Tel) *DeliveryAddressCreate

SetTelephone sets the "telephone" edge to the Tel entity.

func (*DeliveryAddressCreate) SetTelephoneID

func (dac *DeliveryAddressCreate) SetTelephoneID(id int) *DeliveryAddressCreate

SetTelephoneID sets the "telephone" edge to the Tel entity by ID.

func (*DeliveryAddressCreate) SetUpdatedAt

func (dac *DeliveryAddressCreate) SetUpdatedAt(t time.Time) *DeliveryAddressCreate

SetUpdatedAt sets the "updated_at" field.

func (*DeliveryAddressCreate) SetZip

SetZip sets the "zip" field.

type DeliveryAddressCreateBulk

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

DeliveryAddressCreateBulk is the builder for creating many DeliveryAddress entities in bulk.

func (*DeliveryAddressCreateBulk) Exec

Exec executes the query.

func (*DeliveryAddressCreateBulk) ExecX

func (dacb *DeliveryAddressCreateBulk) ExecX(ctx context.Context)

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

func (*DeliveryAddressCreateBulk) Save

Save creates the DeliveryAddress entities in the database.

func (*DeliveryAddressCreateBulk) SaveX

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

type DeliveryAddressDelete

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

DeliveryAddressDelete is the builder for deleting a DeliveryAddress entity.

func (*DeliveryAddressDelete) Exec

func (dad *DeliveryAddressDelete) Exec(ctx context.Context) (int, error)

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

func (*DeliveryAddressDelete) ExecX

func (dad *DeliveryAddressDelete) ExecX(ctx context.Context) int

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

func (*DeliveryAddressDelete) Where

Where appends a list predicates to the DeliveryAddressDelete builder.

type DeliveryAddressDeleteOne

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

DeliveryAddressDeleteOne is the builder for deleting a single DeliveryAddress entity.

func (*DeliveryAddressDeleteOne) Exec

Exec executes the deletion query.

func (*DeliveryAddressDeleteOne) ExecX

func (dado *DeliveryAddressDeleteOne) ExecX(ctx context.Context)

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

func (*DeliveryAddressDeleteOne) Where

Where appends a list predicates to the DeliveryAddressDelete builder.

type DeliveryAddressEdges

type DeliveryAddressEdges struct {
	// Telephone holds the value of the telephone edge.
	Telephone *Tel `json:"telephone,omitempty"`
	// Notes holds the value of the notes edge.
	Notes []*Note `json:"notes,omitempty"`
	// Customer holds the value of the customer edge.
	Customer *Customer `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeliveryAddressEdges) CustomerOrErr

func (e DeliveryAddressEdges) CustomerOrErr() (*Customer, 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 (DeliveryAddressEdges) NotesOrErr

func (e DeliveryAddressEdges) NotesOrErr() ([]*Note, error)

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

func (DeliveryAddressEdges) TelephoneOrErr

func (e DeliveryAddressEdges) TelephoneOrErr() (*Tel, error)

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

type DeliveryAddressGroupBy

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

DeliveryAddressGroupBy is the group-by builder for DeliveryAddress entities.

func (*DeliveryAddressGroupBy) Aggregate

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

func (*DeliveryAddressGroupBy) Bool

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

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

func (*DeliveryAddressGroupBy) BoolX

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

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

func (*DeliveryAddressGroupBy) Bools

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

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

func (*DeliveryAddressGroupBy) BoolsX

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

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

func (*DeliveryAddressGroupBy) Float64

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

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

func (*DeliveryAddressGroupBy) Float64X

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

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

func (*DeliveryAddressGroupBy) Float64s

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

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

func (*DeliveryAddressGroupBy) Float64sX

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

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

func (*DeliveryAddressGroupBy) Int

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

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

func (*DeliveryAddressGroupBy) IntX

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

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

func (*DeliveryAddressGroupBy) Ints

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

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

func (*DeliveryAddressGroupBy) IntsX

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

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

func (*DeliveryAddressGroupBy) Scan

func (dagb *DeliveryAddressGroupBy) Scan(ctx context.Context, v any) error

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

func (*DeliveryAddressGroupBy) ScanX

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

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

func (*DeliveryAddressGroupBy) String

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

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

func (*DeliveryAddressGroupBy) StringX

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

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

func (*DeliveryAddressGroupBy) Strings

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

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

func (*DeliveryAddressGroupBy) StringsX

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

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

type DeliveryAddressMutation

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

DeliveryAddressMutation represents an operation that mutates the DeliveryAddress nodes in the graph.

func (*DeliveryAddressMutation) AddField

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) AddNoteIDs

func (m *DeliveryAddressMutation) AddNoteIDs(ids ...int)

AddNoteIDs adds the "notes" edge to the Note entity by ids.

func (*DeliveryAddressMutation) AddedEdges

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

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

func (*DeliveryAddressMutation) AddedField

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

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

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

func (*DeliveryAddressMutation) AddedIDs

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

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

func (*DeliveryAddressMutation) City

func (m *DeliveryAddressMutation) City() (r string, exists bool)

City returns the value of the "city" field in the mutation.

func (*DeliveryAddressMutation) ClearCustomer

func (m *DeliveryAddressMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Customer entity.

func (*DeliveryAddressMutation) ClearEdge

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

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) ClearNotes

func (m *DeliveryAddressMutation) ClearNotes()

ClearNotes clears the "notes" edge to the Note entity.

func (*DeliveryAddressMutation) ClearTelephone

func (m *DeliveryAddressMutation) ClearTelephone()

ClearTelephone clears the "telephone" edge to the Tel entity.

func (*DeliveryAddressMutation) ClearedEdges

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

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

func (*DeliveryAddressMutation) ClearedFields

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

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

func (DeliveryAddressMutation) Client

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

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

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

func (*DeliveryAddressMutation) CustomerCleared

func (m *DeliveryAddressMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Customer entity was cleared.

func (*DeliveryAddressMutation) CustomerID

func (m *DeliveryAddressMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*DeliveryAddressMutation) CustomerIDs

func (m *DeliveryAddressMutation) CustomerIDs() (ids []int)

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 (*DeliveryAddressMutation) EdgeCleared

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

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

func (*DeliveryAddressMutation) Field

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

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

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

func (*DeliveryAddressMutation) Fields

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

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

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) NotesCleared

func (m *DeliveryAddressMutation) NotesCleared() bool

NotesCleared reports if the "notes" edge to the Note entity was cleared.

func (*DeliveryAddressMutation) NotesIDs

func (m *DeliveryAddressMutation) NotesIDs() (ids []int)

NotesIDs returns the "notes" edge IDs in the mutation.

func (*DeliveryAddressMutation) Number

func (m *DeliveryAddressMutation) Number() (r string, exists bool)

Number returns the value of the "number" field in the mutation.

func (*DeliveryAddressMutation) OldCity

func (m *DeliveryAddressMutation) OldCity(ctx context.Context) (v string, err error)

OldCity returns the old "city" field's value of the DeliveryAddress entity. If the DeliveryAddress 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 (*DeliveryAddressMutation) OldCreatedAt

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

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

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) OldNumber

func (m *DeliveryAddressMutation) OldNumber(ctx context.Context) (v string, err error)

OldNumber returns the old "number" field's value of the DeliveryAddress entity. If the DeliveryAddress 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 (*DeliveryAddressMutation) OldStreet

func (m *DeliveryAddressMutation) OldStreet(ctx context.Context) (v string, err error)

OldStreet returns the old "street" field's value of the DeliveryAddress entity. If the DeliveryAddress 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 (*DeliveryAddressMutation) OldUpdatedAt

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

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

func (m *DeliveryAddressMutation) OldZip(ctx context.Context) (v string, err error)

OldZip returns the old "zip" field's value of the DeliveryAddress entity. If the DeliveryAddress 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 (*DeliveryAddressMutation) Op

func (m *DeliveryAddressMutation) Op() Op

Op returns the operation name.

func (*DeliveryAddressMutation) RemoveNoteIDs

func (m *DeliveryAddressMutation) RemoveNoteIDs(ids ...int)

RemoveNoteIDs removes the "notes" edge to the Note entity by IDs.

func (*DeliveryAddressMutation) RemovedEdges

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

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

func (*DeliveryAddressMutation) RemovedIDs

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) RemovedNotesIDs

func (m *DeliveryAddressMutation) RemovedNotesIDs() (ids []int)

RemovedNotes returns the removed IDs of the "notes" edge to the Note entity.

func (*DeliveryAddressMutation) ResetCity

func (m *DeliveryAddressMutation) ResetCity()

ResetCity resets all changes to the "city" field.

func (*DeliveryAddressMutation) ResetCreatedAt

func (m *DeliveryAddressMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DeliveryAddressMutation) ResetCustomer

func (m *DeliveryAddressMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*DeliveryAddressMutation) ResetEdge

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

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) ResetNotes

func (m *DeliveryAddressMutation) ResetNotes()

ResetNotes resets all changes to the "notes" edge.

func (*DeliveryAddressMutation) ResetNumber

func (m *DeliveryAddressMutation) ResetNumber()

ResetNumber resets all changes to the "number" field.

func (*DeliveryAddressMutation) ResetStreet

func (m *DeliveryAddressMutation) ResetStreet()

ResetStreet resets all changes to the "street" field.

func (*DeliveryAddressMutation) ResetTelephone

func (m *DeliveryAddressMutation) ResetTelephone()

ResetTelephone resets all changes to the "telephone" edge.

func (*DeliveryAddressMutation) ResetUpdatedAt

func (m *DeliveryAddressMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DeliveryAddressMutation) ResetZip

func (m *DeliveryAddressMutation) ResetZip()

ResetZip resets all changes to the "zip" field.

func (*DeliveryAddressMutation) SetCity

func (m *DeliveryAddressMutation) SetCity(s string)

SetCity sets the "city" field.

func (*DeliveryAddressMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DeliveryAddressMutation) SetCustomerID

func (m *DeliveryAddressMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the Customer entity by id.

func (*DeliveryAddressMutation) SetField

func (m *DeliveryAddressMutation) 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 (*DeliveryAddressMutation) SetNumber

func (m *DeliveryAddressMutation) SetNumber(s string)

SetNumber sets the "number" field.

func (*DeliveryAddressMutation) SetOp

func (m *DeliveryAddressMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DeliveryAddressMutation) SetStreet

func (m *DeliveryAddressMutation) SetStreet(s string)

SetStreet sets the "street" field.

func (*DeliveryAddressMutation) SetTelephoneID

func (m *DeliveryAddressMutation) SetTelephoneID(id int)

SetTelephoneID sets the "telephone" edge to the Tel entity by id.

func (*DeliveryAddressMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DeliveryAddressMutation) SetZip

func (m *DeliveryAddressMutation) SetZip(s string)

SetZip sets the "zip" field.

func (*DeliveryAddressMutation) Street

func (m *DeliveryAddressMutation) Street() (r string, exists bool)

Street returns the value of the "street" field in the mutation.

func (*DeliveryAddressMutation) TelephoneCleared

func (m *DeliveryAddressMutation) TelephoneCleared() bool

TelephoneCleared reports if the "telephone" edge to the Tel entity was cleared.

func (*DeliveryAddressMutation) TelephoneID

func (m *DeliveryAddressMutation) TelephoneID() (id int, exists bool)

TelephoneID returns the "telephone" edge ID in the mutation.

func (*DeliveryAddressMutation) TelephoneIDs

func (m *DeliveryAddressMutation) TelephoneIDs() (ids []int)

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

func (DeliveryAddressMutation) Tx

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

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

func (*DeliveryAddressMutation) Type

func (m *DeliveryAddressMutation) Type() string

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

func (*DeliveryAddressMutation) UpdatedAt

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

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

func (*DeliveryAddressMutation) Where

Where appends a list predicates to the DeliveryAddressMutation builder.

func (*DeliveryAddressMutation) WhereP

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

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

func (*DeliveryAddressMutation) Zip

func (m *DeliveryAddressMutation) Zip() (r string, exists bool)

Zip returns the value of the "zip" field in the mutation.

type DeliveryAddressQuery

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

DeliveryAddressQuery is the builder for querying DeliveryAddress entities.

func (*DeliveryAddressQuery) Aggregate

Aggregate returns a DeliveryAddressSelect configured with the given aggregations.

func (*DeliveryAddressQuery) All

All executes the query and returns a list of DeliveryAddresses.

func (*DeliveryAddressQuery) AllX

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

func (*DeliveryAddressQuery) Clone

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

func (*DeliveryAddressQuery) Count

func (daq *DeliveryAddressQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeliveryAddressQuery) CountX

func (daq *DeliveryAddressQuery) CountX(ctx context.Context) int

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

func (*DeliveryAddressQuery) Exist

func (daq *DeliveryAddressQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeliveryAddressQuery) ExistX

func (daq *DeliveryAddressQuery) ExistX(ctx context.Context) bool

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

func (*DeliveryAddressQuery) First

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

func (*DeliveryAddressQuery) FirstID

func (daq *DeliveryAddressQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DeliveryAddressQuery) FirstIDX

func (daq *DeliveryAddressQuery) FirstIDX(ctx context.Context) int

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

func (*DeliveryAddressQuery) FirstX

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

func (*DeliveryAddressQuery) GroupBy

func (daq *DeliveryAddressQuery) GroupBy(field string, fields ...string) *DeliveryAddressGroupBy

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

client.DeliveryAddress.Query().
	GroupBy(deliveryaddress.FieldCity).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeliveryAddressQuery) IDs

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

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

func (*DeliveryAddressQuery) IDsX

func (daq *DeliveryAddressQuery) IDsX(ctx context.Context) []int

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

func (*DeliveryAddressQuery) Limit

func (daq *DeliveryAddressQuery) Limit(limit int) *DeliveryAddressQuery

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

func (*DeliveryAddressQuery) Offset

func (daq *DeliveryAddressQuery) Offset(offset int) *DeliveryAddressQuery

Offset to start from.

func (*DeliveryAddressQuery) Only

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

func (*DeliveryAddressQuery) OnlyID

func (daq *DeliveryAddressQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DeliveryAddressQuery) OnlyIDX

func (daq *DeliveryAddressQuery) OnlyIDX(ctx context.Context) int

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

func (*DeliveryAddressQuery) OnlyX

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

func (*DeliveryAddressQuery) Order

Order specifies how the records should be ordered.

func (*DeliveryAddressQuery) QueryCustomer

func (daq *DeliveryAddressQuery) QueryCustomer() *CustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*DeliveryAddressQuery) QueryNotes

func (daq *DeliveryAddressQuery) QueryNotes() *NoteQuery

QueryNotes chains the current query on the "notes" edge.

func (*DeliveryAddressQuery) QueryTelephone

func (daq *DeliveryAddressQuery) QueryTelephone() *TelQuery

QueryTelephone chains the current query on the "telephone" edge.

func (*DeliveryAddressQuery) Select

func (daq *DeliveryAddressQuery) Select(fields ...string) *DeliveryAddressSelect

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

client.DeliveryAddress.Query().
	Select(deliveryaddress.FieldCity).
	Scan(ctx, &v)

func (*DeliveryAddressQuery) Unique

func (daq *DeliveryAddressQuery) Unique(unique bool) *DeliveryAddressQuery

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

Where adds a new predicate for the DeliveryAddressQuery builder.

func (*DeliveryAddressQuery) WithCustomer

func (daq *DeliveryAddressQuery) WithCustomer(opts ...func(*CustomerQuery)) *DeliveryAddressQuery

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 (*DeliveryAddressQuery) WithNotes

func (daq *DeliveryAddressQuery) WithNotes(opts ...func(*NoteQuery)) *DeliveryAddressQuery

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

func (*DeliveryAddressQuery) WithTelephone

func (daq *DeliveryAddressQuery) WithTelephone(opts ...func(*TelQuery)) *DeliveryAddressQuery

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

type DeliveryAddressSelect

type DeliveryAddressSelect struct {
	*DeliveryAddressQuery
	// contains filtered or unexported fields
}

DeliveryAddressSelect is the builder for selecting fields of DeliveryAddress entities.

func (*DeliveryAddressSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DeliveryAddressSelect) Bool

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

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

func (*DeliveryAddressSelect) BoolX

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

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

func (*DeliveryAddressSelect) Bools

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

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

func (*DeliveryAddressSelect) BoolsX

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

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

func (*DeliveryAddressSelect) Float64

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

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

func (*DeliveryAddressSelect) Float64X

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

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

func (*DeliveryAddressSelect) Float64s

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

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

func (*DeliveryAddressSelect) Float64sX

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

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

func (*DeliveryAddressSelect) Int

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

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

func (*DeliveryAddressSelect) IntX

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

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

func (*DeliveryAddressSelect) Ints

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

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

func (*DeliveryAddressSelect) IntsX

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

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

func (*DeliveryAddressSelect) Scan

func (das *DeliveryAddressSelect) Scan(ctx context.Context, v any) error

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

func (*DeliveryAddressSelect) ScanX

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

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

func (*DeliveryAddressSelect) String

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

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

func (*DeliveryAddressSelect) StringX

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

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

func (*DeliveryAddressSelect) Strings

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

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

func (*DeliveryAddressSelect) StringsX

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

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

type DeliveryAddressUpdate

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

DeliveryAddressUpdate is the builder for updating DeliveryAddress entities.

func (*DeliveryAddressUpdate) AddNoteIDs

func (dau *DeliveryAddressUpdate) AddNoteIDs(ids ...int) *DeliveryAddressUpdate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*DeliveryAddressUpdate) AddNotes

func (dau *DeliveryAddressUpdate) AddNotes(n ...*Note) *DeliveryAddressUpdate

AddNotes adds the "notes" edges to the Note entity.

func (*DeliveryAddressUpdate) ClearCustomer

func (dau *DeliveryAddressUpdate) ClearCustomer() *DeliveryAddressUpdate

ClearCustomer clears the "customer" edge to the Customer entity.

func (*DeliveryAddressUpdate) ClearNotes

func (dau *DeliveryAddressUpdate) ClearNotes() *DeliveryAddressUpdate

ClearNotes clears all "notes" edges to the Note entity.

func (*DeliveryAddressUpdate) ClearTelephone

func (dau *DeliveryAddressUpdate) ClearTelephone() *DeliveryAddressUpdate

ClearTelephone clears the "telephone" edge to the Tel entity.

func (*DeliveryAddressUpdate) Exec

func (dau *DeliveryAddressUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeliveryAddressUpdate) ExecX

func (dau *DeliveryAddressUpdate) ExecX(ctx context.Context)

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

func (*DeliveryAddressUpdate) Mutation

Mutation returns the DeliveryAddressMutation object of the builder.

func (*DeliveryAddressUpdate) RemoveNoteIDs

func (dau *DeliveryAddressUpdate) RemoveNoteIDs(ids ...int) *DeliveryAddressUpdate

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*DeliveryAddressUpdate) RemoveNotes

func (dau *DeliveryAddressUpdate) RemoveNotes(n ...*Note) *DeliveryAddressUpdate

RemoveNotes removes "notes" edges to Note entities.

func (*DeliveryAddressUpdate) Save

func (dau *DeliveryAddressUpdate) Save(ctx context.Context) (int, error)

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

func (*DeliveryAddressUpdate) SaveX

func (dau *DeliveryAddressUpdate) SaveX(ctx context.Context) int

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

func (*DeliveryAddressUpdate) SetCustomer

SetCustomer sets the "customer" edge to the Customer entity.

func (*DeliveryAddressUpdate) SetCustomerID

func (dau *DeliveryAddressUpdate) SetCustomerID(id int) *DeliveryAddressUpdate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*DeliveryAddressUpdate) SetNillableCustomerID

func (dau *DeliveryAddressUpdate) SetNillableCustomerID(id *int) *DeliveryAddressUpdate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*DeliveryAddressUpdate) SetNillableNumber

func (dau *DeliveryAddressUpdate) SetNillableNumber(s *string) *DeliveryAddressUpdate

SetNillableNumber sets the "number" field if the given value is not nil.

func (*DeliveryAddressUpdate) SetNillableTelephoneID

func (dau *DeliveryAddressUpdate) SetNillableTelephoneID(id *int) *DeliveryAddressUpdate

SetNillableTelephoneID sets the "telephone" edge to the Tel entity by ID if the given value is not nil.

func (*DeliveryAddressUpdate) SetNumber

SetNumber sets the "number" field.

func (*DeliveryAddressUpdate) SetTelephone

func (dau *DeliveryAddressUpdate) SetTelephone(t *Tel) *DeliveryAddressUpdate

SetTelephone sets the "telephone" edge to the Tel entity.

func (*DeliveryAddressUpdate) SetTelephoneID

func (dau *DeliveryAddressUpdate) SetTelephoneID(id int) *DeliveryAddressUpdate

SetTelephoneID sets the "telephone" edge to the Tel entity by ID.

func (*DeliveryAddressUpdate) SetUpdatedAt

func (dau *DeliveryAddressUpdate) SetUpdatedAt(t time.Time) *DeliveryAddressUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DeliveryAddressUpdate) Where

Where appends a list predicates to the DeliveryAddressUpdate builder.

type DeliveryAddressUpdateOne

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

DeliveryAddressUpdateOne is the builder for updating a single DeliveryAddress entity.

func (*DeliveryAddressUpdateOne) AddNoteIDs

func (dauo *DeliveryAddressUpdateOne) AddNoteIDs(ids ...int) *DeliveryAddressUpdateOne

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*DeliveryAddressUpdateOne) AddNotes

AddNotes adds the "notes" edges to the Note entity.

func (*DeliveryAddressUpdateOne) ClearCustomer

func (dauo *DeliveryAddressUpdateOne) ClearCustomer() *DeliveryAddressUpdateOne

ClearCustomer clears the "customer" edge to the Customer entity.

func (*DeliveryAddressUpdateOne) ClearNotes

ClearNotes clears all "notes" edges to the Note entity.

func (*DeliveryAddressUpdateOne) ClearTelephone

func (dauo *DeliveryAddressUpdateOne) ClearTelephone() *DeliveryAddressUpdateOne

ClearTelephone clears the "telephone" edge to the Tel entity.

func (*DeliveryAddressUpdateOne) Exec

Exec executes the query on the entity.

func (*DeliveryAddressUpdateOne) ExecX

func (dauo *DeliveryAddressUpdateOne) ExecX(ctx context.Context)

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

func (*DeliveryAddressUpdateOne) Mutation

Mutation returns the DeliveryAddressMutation object of the builder.

func (*DeliveryAddressUpdateOne) RemoveNoteIDs

func (dauo *DeliveryAddressUpdateOne) RemoveNoteIDs(ids ...int) *DeliveryAddressUpdateOne

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*DeliveryAddressUpdateOne) RemoveNotes

func (dauo *DeliveryAddressUpdateOne) RemoveNotes(n ...*Note) *DeliveryAddressUpdateOne

RemoveNotes removes "notes" edges to Note entities.

func (*DeliveryAddressUpdateOne) Save

Save executes the query and returns the updated DeliveryAddress entity.

func (*DeliveryAddressUpdateOne) SaveX

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

func (*DeliveryAddressUpdateOne) Select

func (dauo *DeliveryAddressUpdateOne) Select(field string, fields ...string) *DeliveryAddressUpdateOne

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

func (*DeliveryAddressUpdateOne) SetCustomer

SetCustomer sets the "customer" edge to the Customer entity.

func (*DeliveryAddressUpdateOne) SetCustomerID

func (dauo *DeliveryAddressUpdateOne) SetCustomerID(id int) *DeliveryAddressUpdateOne

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*DeliveryAddressUpdateOne) SetNillableCustomerID

func (dauo *DeliveryAddressUpdateOne) SetNillableCustomerID(id *int) *DeliveryAddressUpdateOne

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*DeliveryAddressUpdateOne) SetNillableNumber

func (dauo *DeliveryAddressUpdateOne) SetNillableNumber(s *string) *DeliveryAddressUpdateOne

SetNillableNumber sets the "number" field if the given value is not nil.

func (*DeliveryAddressUpdateOne) SetNillableTelephoneID

func (dauo *DeliveryAddressUpdateOne) SetNillableTelephoneID(id *int) *DeliveryAddressUpdateOne

SetNillableTelephoneID sets the "telephone" edge to the Tel entity by ID if the given value is not nil.

func (*DeliveryAddressUpdateOne) SetNumber

SetNumber sets the "number" field.

func (*DeliveryAddressUpdateOne) SetTelephone

func (dauo *DeliveryAddressUpdateOne) SetTelephone(t *Tel) *DeliveryAddressUpdateOne

SetTelephone sets the "telephone" edge to the Tel entity.

func (*DeliveryAddressUpdateOne) SetTelephoneID

func (dauo *DeliveryAddressUpdateOne) SetTelephoneID(id int) *DeliveryAddressUpdateOne

SetTelephoneID sets the "telephone" edge to the Tel entity by ID.

func (*DeliveryAddressUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DeliveryAddressUpdateOne) Where

Where appends a list predicates to the DeliveryAddressUpdate builder.

type DeliveryAddresses

type DeliveryAddresses []*DeliveryAddress

DeliveryAddresses is a parsable slice of DeliveryAddress.

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 Login

type Login struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// LastLogin holds the value of the "last_login" field.
	LastLogin time.Time `json:"last_login,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LoginQuery when eager-loading is set.
	Edges LoginEdges `json:"edges"`
	// contains filtered or unexported fields
}

Login is the model entity for the Login schema.

func (*Login) QueryCustomer

func (l *Login) QueryCustomer() *CustomerQuery

QueryCustomer queries the "customer" edge of the Login entity.

func (*Login) String

func (l *Login) String() string

String implements the fmt.Stringer.

func (*Login) Unwrap

func (l *Login) Unwrap() *Login

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

func (l *Login) Update() *LoginUpdateOne

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

func (*Login) Value

func (l *Login) Value(name string) (ent.Value, error)

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

type LoginClient

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

LoginClient is a client for the Login schema.

func NewLoginClient

func NewLoginClient(c config) *LoginClient

NewLoginClient returns a client for the Login from the given config.

func (*LoginClient) Create

func (c *LoginClient) Create() *LoginCreate

Create returns a builder for creating a Login entity.

func (*LoginClient) CreateBulk

func (c *LoginClient) CreateBulk(builders ...*LoginCreate) *LoginCreateBulk

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

func (*LoginClient) Delete

func (c *LoginClient) Delete() *LoginDelete

Delete returns a delete builder for Login.

func (*LoginClient) DeleteOne

func (c *LoginClient) DeleteOne(l *Login) *LoginDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LoginClient) DeleteOneID

func (c *LoginClient) DeleteOneID(id int) *LoginDeleteOne

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

func (*LoginClient) Get

func (c *LoginClient) Get(ctx context.Context, id int) (*Login, error)

Get returns a Login entity by its id.

func (*LoginClient) GetX

func (c *LoginClient) GetX(ctx context.Context, id int) *Login

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

func (*LoginClient) Hooks

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

Hooks returns the client hooks.

func (*LoginClient) Intercept

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

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

func (*LoginClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LoginClient) MapCreateBulk

func (c *LoginClient) MapCreateBulk(slice any, setFunc func(*LoginCreate, int)) *LoginCreateBulk

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

func (c *LoginClient) Query() *LoginQuery

Query returns a query builder for Login.

func (*LoginClient) QueryCustomer

func (c *LoginClient) QueryCustomer(l *Login) *CustomerQuery

QueryCustomer queries the customer edge of a Login.

func (*LoginClient) Update

func (c *LoginClient) Update() *LoginUpdate

Update returns an update builder for Login.

func (*LoginClient) UpdateOne

func (c *LoginClient) UpdateOne(l *Login) *LoginUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LoginClient) UpdateOneID

func (c *LoginClient) UpdateOneID(id int) *LoginUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LoginClient) Use

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

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

type LoginCreate

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

LoginCreate is the builder for creating a Login entity.

func (*LoginCreate) AddCustomer

func (lc *LoginCreate) AddCustomer(c ...*Customer) *LoginCreate

AddCustomer adds the "customer" edges to the Customer entity.

func (*LoginCreate) AddCustomerIDs

func (lc *LoginCreate) AddCustomerIDs(ids ...int) *LoginCreate

AddCustomerIDs adds the "customer" edge to the Customer entity by IDs.

func (*LoginCreate) Exec

func (lc *LoginCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LoginCreate) ExecX

func (lc *LoginCreate) ExecX(ctx context.Context)

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

func (*LoginCreate) Mutation

func (lc *LoginCreate) Mutation() *LoginMutation

Mutation returns the LoginMutation object of the builder.

func (*LoginCreate) Save

func (lc *LoginCreate) Save(ctx context.Context) (*Login, error)

Save creates the Login in the database.

func (*LoginCreate) SaveX

func (lc *LoginCreate) SaveX(ctx context.Context) *Login

SaveX calls Save and panics if Save returns an error.

func (*LoginCreate) SetCreatedAt

func (lc *LoginCreate) SetCreatedAt(t time.Time) *LoginCreate

SetCreatedAt sets the "created_at" field.

func (*LoginCreate) SetLastLogin

func (lc *LoginCreate) SetLastLogin(t time.Time) *LoginCreate

SetLastLogin sets the "last_login" field.

func (*LoginCreate) SetNillableCreatedAt

func (lc *LoginCreate) SetNillableCreatedAt(t *time.Time) *LoginCreate

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

func (*LoginCreate) SetNillableUpdatedAt

func (lc *LoginCreate) SetNillableUpdatedAt(t *time.Time) *LoginCreate

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

func (*LoginCreate) SetPassword

func (lc *LoginCreate) SetPassword(s string) *LoginCreate

SetPassword sets the "password" field.

func (*LoginCreate) SetUpdatedAt

func (lc *LoginCreate) SetUpdatedAt(t time.Time) *LoginCreate

SetUpdatedAt sets the "updated_at" field.

func (*LoginCreate) SetUsername

func (lc *LoginCreate) SetUsername(s string) *LoginCreate

SetUsername sets the "username" field.

type LoginCreateBulk

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

LoginCreateBulk is the builder for creating many Login entities in bulk.

func (*LoginCreateBulk) Exec

func (lcb *LoginCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LoginCreateBulk) ExecX

func (lcb *LoginCreateBulk) ExecX(ctx context.Context)

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

func (*LoginCreateBulk) Save

func (lcb *LoginCreateBulk) Save(ctx context.Context) ([]*Login, error)

Save creates the Login entities in the database.

func (*LoginCreateBulk) SaveX

func (lcb *LoginCreateBulk) SaveX(ctx context.Context) []*Login

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

type LoginDelete

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

LoginDelete is the builder for deleting a Login entity.

func (*LoginDelete) Exec

func (ld *LoginDelete) Exec(ctx context.Context) (int, error)

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

func (*LoginDelete) ExecX

func (ld *LoginDelete) ExecX(ctx context.Context) int

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

func (*LoginDelete) Where

func (ld *LoginDelete) Where(ps ...predicate.Login) *LoginDelete

Where appends a list predicates to the LoginDelete builder.

type LoginDeleteOne

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

LoginDeleteOne is the builder for deleting a single Login entity.

func (*LoginDeleteOne) Exec

func (ldo *LoginDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LoginDeleteOne) ExecX

func (ldo *LoginDeleteOne) ExecX(ctx context.Context)

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

func (*LoginDeleteOne) Where

func (ldo *LoginDeleteOne) Where(ps ...predicate.Login) *LoginDeleteOne

Where appends a list predicates to the LoginDelete builder.

type LoginEdges

type LoginEdges struct {
	// Customer holds the value of the customer edge.
	Customer []*Customer `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

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

func (LoginEdges) CustomerOrErr

func (e LoginEdges) CustomerOrErr() ([]*Customer, error)

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

type LoginGroupBy

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

LoginGroupBy is the group-by builder for Login entities.

func (*LoginGroupBy) Aggregate

func (lgb *LoginGroupBy) Aggregate(fns ...AggregateFunc) *LoginGroupBy

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

func (*LoginGroupBy) Bool

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

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

func (*LoginGroupBy) BoolX

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

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

func (*LoginGroupBy) Bools

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

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

func (*LoginGroupBy) BoolsX

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

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

func (*LoginGroupBy) Float64

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

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

func (*LoginGroupBy) Float64X

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

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

func (*LoginGroupBy) Float64s

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

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

func (*LoginGroupBy) Float64sX

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

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

func (*LoginGroupBy) Int

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

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

func (*LoginGroupBy) IntX

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

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

func (*LoginGroupBy) Ints

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

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

func (*LoginGroupBy) IntsX

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

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

func (*LoginGroupBy) Scan

func (lgb *LoginGroupBy) Scan(ctx context.Context, v any) error

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

func (*LoginGroupBy) ScanX

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

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

func (*LoginGroupBy) String

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

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

func (*LoginGroupBy) StringX

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

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

func (*LoginGroupBy) Strings

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

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

func (*LoginGroupBy) StringsX

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

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

type LoginMutation

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

LoginMutation represents an operation that mutates the Login nodes in the graph.

func (*LoginMutation) AddCustomerIDs

func (m *LoginMutation) AddCustomerIDs(ids ...int)

AddCustomerIDs adds the "customer" edge to the Customer entity by ids.

func (*LoginMutation) AddField

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

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

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

func (*LoginMutation) AddedField

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

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

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

func (*LoginMutation) AddedIDs

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

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

func (*LoginMutation) ClearCustomer

func (m *LoginMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Customer entity.

func (*LoginMutation) ClearEdge

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

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

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

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

func (*LoginMutation) ClearedFields

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

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

func (LoginMutation) Client

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

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

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

func (*LoginMutation) CustomerCleared

func (m *LoginMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Customer entity was cleared.

func (*LoginMutation) CustomerIDs

func (m *LoginMutation) CustomerIDs() (ids []int)

CustomerIDs returns the "customer" edge IDs in the mutation.

func (*LoginMutation) EdgeCleared

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

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

func (*LoginMutation) Field

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

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

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

func (*LoginMutation) Fields

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

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

func (m *LoginMutation) 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 (*LoginMutation) LastLogin

func (m *LoginMutation) LastLogin() (r time.Time, exists bool)

LastLogin returns the value of the "last_login" field in the mutation.

func (*LoginMutation) OldCreatedAt

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

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

func (m *LoginMutation) 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 (*LoginMutation) OldLastLogin

func (m *LoginMutation) OldLastLogin(ctx context.Context) (v time.Time, err error)

OldLastLogin returns the old "last_login" field's value of the Login entity. If the Login 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 (*LoginMutation) OldPassword

func (m *LoginMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Login entity. If the Login 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 (*LoginMutation) OldUpdatedAt

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

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

func (m *LoginMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Login entity. If the Login 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 (*LoginMutation) Op

func (m *LoginMutation) Op() Op

Op returns the operation name.

func (*LoginMutation) Password

func (m *LoginMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*LoginMutation) RemoveCustomerIDs

func (m *LoginMutation) RemoveCustomerIDs(ids ...int)

RemoveCustomerIDs removes the "customer" edge to the Customer entity by IDs.

func (*LoginMutation) RemovedCustomerIDs

func (m *LoginMutation) RemovedCustomerIDs() (ids []int)

RemovedCustomer returns the removed IDs of the "customer" edge to the Customer entity.

func (*LoginMutation) RemovedEdges

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

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

func (*LoginMutation) RemovedIDs

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

func (m *LoginMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LoginMutation) ResetCustomer

func (m *LoginMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*LoginMutation) ResetEdge

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

func (m *LoginMutation) 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 (*LoginMutation) ResetLastLogin

func (m *LoginMutation) ResetLastLogin()

ResetLastLogin resets all changes to the "last_login" field.

func (*LoginMutation) ResetPassword

func (m *LoginMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*LoginMutation) ResetUpdatedAt

func (m *LoginMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*LoginMutation) ResetUsername

func (m *LoginMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*LoginMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*LoginMutation) SetField

func (m *LoginMutation) 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 (*LoginMutation) SetLastLogin

func (m *LoginMutation) SetLastLogin(t time.Time)

SetLastLogin sets the "last_login" field.

func (*LoginMutation) SetOp

func (m *LoginMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LoginMutation) SetPassword

func (m *LoginMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*LoginMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*LoginMutation) SetUsername

func (m *LoginMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (LoginMutation) Tx

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

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

func (*LoginMutation) Type

func (m *LoginMutation) Type() string

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

func (*LoginMutation) UpdatedAt

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

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

func (*LoginMutation) Username

func (m *LoginMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*LoginMutation) Where

func (m *LoginMutation) Where(ps ...predicate.Login)

Where appends a list predicates to the LoginMutation builder.

func (*LoginMutation) WhereP

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

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

type LoginQuery

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

LoginQuery is the builder for querying Login entities.

func (*LoginQuery) Aggregate

func (lq *LoginQuery) Aggregate(fns ...AggregateFunc) *LoginSelect

Aggregate returns a LoginSelect configured with the given aggregations.

func (*LoginQuery) All

func (lq *LoginQuery) All(ctx context.Context) ([]*Login, error)

All executes the query and returns a list of Logins.

func (*LoginQuery) AllX

func (lq *LoginQuery) AllX(ctx context.Context) []*Login

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

func (*LoginQuery) Clone

func (lq *LoginQuery) Clone() *LoginQuery

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

func (*LoginQuery) Count

func (lq *LoginQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LoginQuery) CountX

func (lq *LoginQuery) CountX(ctx context.Context) int

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

func (*LoginQuery) Exist

func (lq *LoginQuery) Exist(ctx context.Context) (bool, error)

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

func (*LoginQuery) ExistX

func (lq *LoginQuery) ExistX(ctx context.Context) bool

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

func (*LoginQuery) First

func (lq *LoginQuery) First(ctx context.Context) (*Login, error)

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

func (*LoginQuery) FirstID

func (lq *LoginQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LoginQuery) FirstIDX

func (lq *LoginQuery) FirstIDX(ctx context.Context) int

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

func (*LoginQuery) FirstX

func (lq *LoginQuery) FirstX(ctx context.Context) *Login

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

func (*LoginQuery) GroupBy

func (lq *LoginQuery) GroupBy(field string, fields ...string) *LoginGroupBy

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

client.Login.Query().
	GroupBy(login.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LoginQuery) IDs

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

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

func (*LoginQuery) IDsX

func (lq *LoginQuery) IDsX(ctx context.Context) []int

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

func (*LoginQuery) Limit

func (lq *LoginQuery) Limit(limit int) *LoginQuery

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

func (*LoginQuery) Offset

func (lq *LoginQuery) Offset(offset int) *LoginQuery

Offset to start from.

func (*LoginQuery) Only

func (lq *LoginQuery) Only(ctx context.Context) (*Login, error)

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

func (*LoginQuery) OnlyID

func (lq *LoginQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LoginQuery) OnlyIDX

func (lq *LoginQuery) OnlyIDX(ctx context.Context) int

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

func (*LoginQuery) OnlyX

func (lq *LoginQuery) OnlyX(ctx context.Context) *Login

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

func (*LoginQuery) Order

func (lq *LoginQuery) Order(o ...login.OrderOption) *LoginQuery

Order specifies how the records should be ordered.

func (*LoginQuery) QueryCustomer

func (lq *LoginQuery) QueryCustomer() *CustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*LoginQuery) Select

func (lq *LoginQuery) Select(fields ...string) *LoginSelect

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

client.Login.Query().
	Select(login.FieldUsername).
	Scan(ctx, &v)

func (*LoginQuery) Unique

func (lq *LoginQuery) Unique(unique bool) *LoginQuery

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

func (lq *LoginQuery) Where(ps ...predicate.Login) *LoginQuery

Where adds a new predicate for the LoginQuery builder.

func (*LoginQuery) WithCustomer

func (lq *LoginQuery) WithCustomer(opts ...func(*CustomerQuery)) *LoginQuery

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.

type LoginSelect

type LoginSelect struct {
	*LoginQuery
	// contains filtered or unexported fields
}

LoginSelect is the builder for selecting fields of Login entities.

func (*LoginSelect) Aggregate

func (ls *LoginSelect) Aggregate(fns ...AggregateFunc) *LoginSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LoginSelect) Bool

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

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

func (*LoginSelect) BoolX

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

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

func (*LoginSelect) Bools

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

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

func (*LoginSelect) BoolsX

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

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

func (*LoginSelect) Float64

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

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

func (*LoginSelect) Float64X

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

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

func (*LoginSelect) Float64s

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

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

func (*LoginSelect) Float64sX

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

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

func (*LoginSelect) Int

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

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

func (*LoginSelect) IntX

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

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

func (*LoginSelect) Ints

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

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

func (*LoginSelect) IntsX

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

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

func (*LoginSelect) Scan

func (ls *LoginSelect) Scan(ctx context.Context, v any) error

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

func (*LoginSelect) ScanX

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

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

func (*LoginSelect) String

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

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

func (*LoginSelect) StringX

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

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

func (*LoginSelect) Strings

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

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

func (*LoginSelect) StringsX

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

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

type LoginUpdate

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

LoginUpdate is the builder for updating Login entities.

func (*LoginUpdate) AddCustomer

func (lu *LoginUpdate) AddCustomer(c ...*Customer) *LoginUpdate

AddCustomer adds the "customer" edges to the Customer entity.

func (*LoginUpdate) AddCustomerIDs

func (lu *LoginUpdate) AddCustomerIDs(ids ...int) *LoginUpdate

AddCustomerIDs adds the "customer" edge to the Customer entity by IDs.

func (*LoginUpdate) ClearCustomer

func (lu *LoginUpdate) ClearCustomer() *LoginUpdate

ClearCustomer clears all "customer" edges to the Customer entity.

func (*LoginUpdate) Exec

func (lu *LoginUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LoginUpdate) ExecX

func (lu *LoginUpdate) ExecX(ctx context.Context)

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

func (*LoginUpdate) Mutation

func (lu *LoginUpdate) Mutation() *LoginMutation

Mutation returns the LoginMutation object of the builder.

func (*LoginUpdate) RemoveCustomer

func (lu *LoginUpdate) RemoveCustomer(c ...*Customer) *LoginUpdate

RemoveCustomer removes "customer" edges to Customer entities.

func (*LoginUpdate) RemoveCustomerIDs

func (lu *LoginUpdate) RemoveCustomerIDs(ids ...int) *LoginUpdate

RemoveCustomerIDs removes the "customer" edge to Customer entities by IDs.

func (*LoginUpdate) Save

func (lu *LoginUpdate) Save(ctx context.Context) (int, error)

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

func (*LoginUpdate) SaveX

func (lu *LoginUpdate) SaveX(ctx context.Context) int

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

func (*LoginUpdate) SetLastLogin

func (lu *LoginUpdate) SetLastLogin(t time.Time) *LoginUpdate

SetLastLogin sets the "last_login" field.

func (*LoginUpdate) SetNillableLastLogin

func (lu *LoginUpdate) SetNillableLastLogin(t *time.Time) *LoginUpdate

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*LoginUpdate) SetNillablePassword

func (lu *LoginUpdate) SetNillablePassword(s *string) *LoginUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*LoginUpdate) SetNillableUsername

func (lu *LoginUpdate) SetNillableUsername(s *string) *LoginUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*LoginUpdate) SetPassword

func (lu *LoginUpdate) SetPassword(s string) *LoginUpdate

SetPassword sets the "password" field.

func (*LoginUpdate) SetUpdatedAt

func (lu *LoginUpdate) SetUpdatedAt(t time.Time) *LoginUpdate

SetUpdatedAt sets the "updated_at" field.

func (*LoginUpdate) SetUsername

func (lu *LoginUpdate) SetUsername(s string) *LoginUpdate

SetUsername sets the "username" field.

func (*LoginUpdate) Where

func (lu *LoginUpdate) Where(ps ...predicate.Login) *LoginUpdate

Where appends a list predicates to the LoginUpdate builder.

type LoginUpdateOne

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

LoginUpdateOne is the builder for updating a single Login entity.

func (*LoginUpdateOne) AddCustomer

func (luo *LoginUpdateOne) AddCustomer(c ...*Customer) *LoginUpdateOne

AddCustomer adds the "customer" edges to the Customer entity.

func (*LoginUpdateOne) AddCustomerIDs

func (luo *LoginUpdateOne) AddCustomerIDs(ids ...int) *LoginUpdateOne

AddCustomerIDs adds the "customer" edge to the Customer entity by IDs.

func (*LoginUpdateOne) ClearCustomer

func (luo *LoginUpdateOne) ClearCustomer() *LoginUpdateOne

ClearCustomer clears all "customer" edges to the Customer entity.

func (*LoginUpdateOne) Exec

func (luo *LoginUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LoginUpdateOne) ExecX

func (luo *LoginUpdateOne) ExecX(ctx context.Context)

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

func (*LoginUpdateOne) Mutation

func (luo *LoginUpdateOne) Mutation() *LoginMutation

Mutation returns the LoginMutation object of the builder.

func (*LoginUpdateOne) RemoveCustomer

func (luo *LoginUpdateOne) RemoveCustomer(c ...*Customer) *LoginUpdateOne

RemoveCustomer removes "customer" edges to Customer entities.

func (*LoginUpdateOne) RemoveCustomerIDs

func (luo *LoginUpdateOne) RemoveCustomerIDs(ids ...int) *LoginUpdateOne

RemoveCustomerIDs removes the "customer" edge to Customer entities by IDs.

func (*LoginUpdateOne) Save

func (luo *LoginUpdateOne) Save(ctx context.Context) (*Login, error)

Save executes the query and returns the updated Login entity.

func (*LoginUpdateOne) SaveX

func (luo *LoginUpdateOne) SaveX(ctx context.Context) *Login

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

func (*LoginUpdateOne) Select

func (luo *LoginUpdateOne) Select(field string, fields ...string) *LoginUpdateOne

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

func (*LoginUpdateOne) SetLastLogin

func (luo *LoginUpdateOne) SetLastLogin(t time.Time) *LoginUpdateOne

SetLastLogin sets the "last_login" field.

func (*LoginUpdateOne) SetNillableLastLogin

func (luo *LoginUpdateOne) SetNillableLastLogin(t *time.Time) *LoginUpdateOne

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*LoginUpdateOne) SetNillablePassword

func (luo *LoginUpdateOne) SetNillablePassword(s *string) *LoginUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*LoginUpdateOne) SetNillableUsername

func (luo *LoginUpdateOne) SetNillableUsername(s *string) *LoginUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*LoginUpdateOne) SetPassword

func (luo *LoginUpdateOne) SetPassword(s string) *LoginUpdateOne

SetPassword sets the "password" field.

func (*LoginUpdateOne) SetUpdatedAt

func (luo *LoginUpdateOne) SetUpdatedAt(t time.Time) *LoginUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*LoginUpdateOne) SetUsername

func (luo *LoginUpdateOne) SetUsername(s string) *LoginUpdateOne

SetUsername sets the "username" field.

func (*LoginUpdateOne) Where

func (luo *LoginUpdateOne) Where(ps ...predicate.Login) *LoginUpdateOne

Where appends a list predicates to the LoginUpdate builder.

type Logins

type Logins []*Login

Logins is a parsable slice of Login.

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 Note

type Note struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NoteQuery when eager-loading is set.
	Edges NoteEdges `json:"edges"`
	// contains filtered or unexported fields
}

Note is the model entity for the Note schema.

func (*Note) QueryBillingAddress

func (n *Note) QueryBillingAddress() *BillingAddressQuery

QueryBillingAddress queries the "billing_address" edge of the Note entity.

func (*Note) QueryCustomer

func (n *Note) QueryCustomer() *CustomerQuery

QueryCustomer queries the "customer" edge of the Note entity.

func (*Note) QueryDeliveryAddress

func (n *Note) QueryDeliveryAddress() *DeliveryAddressQuery

QueryDeliveryAddress queries the "delivery_address" edge of the Note entity.

func (*Note) QueryOrders

func (n *Note) QueryOrders() *OrderQuery

QueryOrders queries the "orders" edge of the Note entity.

func (*Note) QueryTel

func (n *Note) QueryTel() *TelQuery

QueryTel queries the "tel" edge of the Note entity.

func (*Note) String

func (n *Note) String() string

String implements the fmt.Stringer.

func (*Note) Unwrap

func (n *Note) Unwrap() *Note

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

func (n *Note) Update() *NoteUpdateOne

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

func (*Note) Value

func (n *Note) Value(name string) (ent.Value, error)

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

type NoteClient

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

NoteClient is a client for the Note schema.

func NewNoteClient

func NewNoteClient(c config) *NoteClient

NewNoteClient returns a client for the Note from the given config.

func (*NoteClient) Create

func (c *NoteClient) Create() *NoteCreate

Create returns a builder for creating a Note entity.

func (*NoteClient) CreateBulk

func (c *NoteClient) CreateBulk(builders ...*NoteCreate) *NoteCreateBulk

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

func (*NoteClient) Delete

func (c *NoteClient) Delete() *NoteDelete

Delete returns a delete builder for Note.

func (*NoteClient) DeleteOne

func (c *NoteClient) DeleteOne(n *Note) *NoteDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NoteClient) DeleteOneID

func (c *NoteClient) DeleteOneID(id int) *NoteDeleteOne

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

func (*NoteClient) Get

func (c *NoteClient) Get(ctx context.Context, id int) (*Note, error)

Get returns a Note entity by its id.

func (*NoteClient) GetX

func (c *NoteClient) GetX(ctx context.Context, id int) *Note

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

func (*NoteClient) Hooks

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

Hooks returns the client hooks.

func (*NoteClient) Intercept

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

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

func (*NoteClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NoteClient) MapCreateBulk

func (c *NoteClient) MapCreateBulk(slice any, setFunc func(*NoteCreate, int)) *NoteCreateBulk

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

func (c *NoteClient) Query() *NoteQuery

Query returns a query builder for Note.

func (*NoteClient) QueryBillingAddress

func (c *NoteClient) QueryBillingAddress(n *Note) *BillingAddressQuery

QueryBillingAddress queries the billing_address edge of a Note.

func (*NoteClient) QueryCustomer

func (c *NoteClient) QueryCustomer(n *Note) *CustomerQuery

QueryCustomer queries the customer edge of a Note.

func (*NoteClient) QueryDeliveryAddress

func (c *NoteClient) QueryDeliveryAddress(n *Note) *DeliveryAddressQuery

QueryDeliveryAddress queries the delivery_address edge of a Note.

func (*NoteClient) QueryOrders

func (c *NoteClient) QueryOrders(n *Note) *OrderQuery

QueryOrders queries the orders edge of a Note.

func (*NoteClient) QueryTel

func (c *NoteClient) QueryTel(n *Note) *TelQuery

QueryTel queries the tel edge of a Note.

func (*NoteClient) Update

func (c *NoteClient) Update() *NoteUpdate

Update returns an update builder for Note.

func (*NoteClient) UpdateOne

func (c *NoteClient) UpdateOne(n *Note) *NoteUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NoteClient) UpdateOneID

func (c *NoteClient) UpdateOneID(id int) *NoteUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NoteClient) Use

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

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

type NoteCreate

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

NoteCreate is the builder for creating a Note entity.

func (*NoteCreate) Exec

func (nc *NoteCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteCreate) ExecX

func (nc *NoteCreate) ExecX(ctx context.Context)

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

func (*NoteCreate) Mutation

func (nc *NoteCreate) Mutation() *NoteMutation

Mutation returns the NoteMutation object of the builder.

func (*NoteCreate) Save

func (nc *NoteCreate) Save(ctx context.Context) (*Note, error)

Save creates the Note in the database.

func (*NoteCreate) SaveX

func (nc *NoteCreate) SaveX(ctx context.Context) *Note

SaveX calls Save and panics if Save returns an error.

func (*NoteCreate) SetBillingAddress

func (nc *NoteCreate) SetBillingAddress(b *BillingAddress) *NoteCreate

SetBillingAddress sets the "billing_address" edge to the BillingAddress entity.

func (*NoteCreate) SetBillingAddressID

func (nc *NoteCreate) SetBillingAddressID(id int) *NoteCreate

SetBillingAddressID sets the "billing_address" edge to the BillingAddress entity by ID.

func (*NoteCreate) SetContent

func (nc *NoteCreate) SetContent(s string) *NoteCreate

SetContent sets the "content" field.

func (*NoteCreate) SetCreatedAt

func (nc *NoteCreate) SetCreatedAt(t time.Time) *NoteCreate

SetCreatedAt sets the "created_at" field.

func (*NoteCreate) SetCustomer

func (nc *NoteCreate) SetCustomer(c *Customer) *NoteCreate

SetCustomer sets the "customer" edge to the Customer entity.

func (*NoteCreate) SetCustomerID

func (nc *NoteCreate) SetCustomerID(id int) *NoteCreate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*NoteCreate) SetDeliveryAddress

func (nc *NoteCreate) SetDeliveryAddress(d *DeliveryAddress) *NoteCreate

SetDeliveryAddress sets the "delivery_address" edge to the DeliveryAddress entity.

func (*NoteCreate) SetDeliveryAddressID

func (nc *NoteCreate) SetDeliveryAddressID(id int) *NoteCreate

SetDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by ID.

func (*NoteCreate) SetNillableBillingAddressID

func (nc *NoteCreate) SetNillableBillingAddressID(id *int) *NoteCreate

SetNillableBillingAddressID sets the "billing_address" edge to the BillingAddress entity by ID if the given value is not nil.

func (*NoteCreate) SetNillableCreatedAt

func (nc *NoteCreate) SetNillableCreatedAt(t *time.Time) *NoteCreate

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

func (*NoteCreate) SetNillableCustomerID

func (nc *NoteCreate) SetNillableCustomerID(id *int) *NoteCreate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*NoteCreate) SetNillableDeliveryAddressID

func (nc *NoteCreate) SetNillableDeliveryAddressID(id *int) *NoteCreate

SetNillableDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by ID if the given value is not nil.

func (*NoteCreate) SetNillableOrdersID

func (nc *NoteCreate) SetNillableOrdersID(id *int) *NoteCreate

SetNillableOrdersID sets the "orders" edge to the Order entity by ID if the given value is not nil.

func (*NoteCreate) SetNillableTelID

func (nc *NoteCreate) SetNillableTelID(id *int) *NoteCreate

SetNillableTelID sets the "tel" edge to the Tel entity by ID if the given value is not nil.

func (*NoteCreate) SetNillableUpdatedAt

func (nc *NoteCreate) SetNillableUpdatedAt(t *time.Time) *NoteCreate

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

func (*NoteCreate) SetOrders

func (nc *NoteCreate) SetOrders(o *Order) *NoteCreate

SetOrders sets the "orders" edge to the Order entity.

func (*NoteCreate) SetOrdersID

func (nc *NoteCreate) SetOrdersID(id int) *NoteCreate

SetOrdersID sets the "orders" edge to the Order entity by ID.

func (*NoteCreate) SetTel

func (nc *NoteCreate) SetTel(t *Tel) *NoteCreate

SetTel sets the "tel" edge to the Tel entity.

func (*NoteCreate) SetTelID

func (nc *NoteCreate) SetTelID(id int) *NoteCreate

SetTelID sets the "tel" edge to the Tel entity by ID.

func (*NoteCreate) SetUpdatedAt

func (nc *NoteCreate) SetUpdatedAt(t time.Time) *NoteCreate

SetUpdatedAt sets the "updated_at" field.

type NoteCreateBulk

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

NoteCreateBulk is the builder for creating many Note entities in bulk.

func (*NoteCreateBulk) Exec

func (ncb *NoteCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteCreateBulk) ExecX

func (ncb *NoteCreateBulk) ExecX(ctx context.Context)

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

func (*NoteCreateBulk) Save

func (ncb *NoteCreateBulk) Save(ctx context.Context) ([]*Note, error)

Save creates the Note entities in the database.

func (*NoteCreateBulk) SaveX

func (ncb *NoteCreateBulk) SaveX(ctx context.Context) []*Note

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

type NoteDelete

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

NoteDelete is the builder for deleting a Note entity.

func (*NoteDelete) Exec

func (nd *NoteDelete) Exec(ctx context.Context) (int, error)

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

func (*NoteDelete) ExecX

func (nd *NoteDelete) ExecX(ctx context.Context) int

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

func (*NoteDelete) Where

func (nd *NoteDelete) Where(ps ...predicate.Note) *NoteDelete

Where appends a list predicates to the NoteDelete builder.

type NoteDeleteOne

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

NoteDeleteOne is the builder for deleting a single Note entity.

func (*NoteDeleteOne) Exec

func (ndo *NoteDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NoteDeleteOne) ExecX

func (ndo *NoteDeleteOne) ExecX(ctx context.Context)

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

func (*NoteDeleteOne) Where

func (ndo *NoteDeleteOne) Where(ps ...predicate.Note) *NoteDeleteOne

Where appends a list predicates to the NoteDelete builder.

type NoteEdges

type NoteEdges struct {
	// Customer holds the value of the customer edge.
	Customer *Customer `json:"customer,omitempty"`
	// Orders holds the value of the orders edge.
	Orders *Order `json:"orders,omitempty"`
	// BillingAddress holds the value of the billing_address edge.
	BillingAddress *BillingAddress `json:"billing_address,omitempty"`
	// DeliveryAddress holds the value of the delivery_address edge.
	DeliveryAddress *DeliveryAddress `json:"delivery_address,omitempty"`
	// Tel holds the value of the tel edge.
	Tel *Tel `json:"tel,omitempty"`
	// contains filtered or unexported fields
}

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

func (NoteEdges) BillingAddressOrErr

func (e NoteEdges) BillingAddressOrErr() (*BillingAddress, error)

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

func (NoteEdges) CustomerOrErr

func (e NoteEdges) CustomerOrErr() (*Customer, 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 (NoteEdges) DeliveryAddressOrErr

func (e NoteEdges) DeliveryAddressOrErr() (*DeliveryAddress, error)

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

func (NoteEdges) OrdersOrErr

func (e NoteEdges) OrdersOrErr() (*Order, error)

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

func (NoteEdges) TelOrErr

func (e NoteEdges) TelOrErr() (*Tel, error)

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

type NoteGroupBy

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

NoteGroupBy is the group-by builder for Note entities.

func (*NoteGroupBy) Aggregate

func (ngb *NoteGroupBy) Aggregate(fns ...AggregateFunc) *NoteGroupBy

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

func (*NoteGroupBy) Bool

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

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

func (*NoteGroupBy) BoolX

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

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

func (*NoteGroupBy) Bools

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

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

func (*NoteGroupBy) BoolsX

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

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

func (*NoteGroupBy) Float64

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

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

func (*NoteGroupBy) Float64X

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

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

func (*NoteGroupBy) Float64s

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

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

func (*NoteGroupBy) Float64sX

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

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

func (*NoteGroupBy) Int

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

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

func (*NoteGroupBy) IntX

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

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

func (*NoteGroupBy) Ints

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

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

func (*NoteGroupBy) IntsX

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

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

func (*NoteGroupBy) Scan

func (ngb *NoteGroupBy) Scan(ctx context.Context, v any) error

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

func (*NoteGroupBy) ScanX

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

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

func (*NoteGroupBy) String

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

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

func (*NoteGroupBy) StringX

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

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

func (*NoteGroupBy) Strings

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

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

func (*NoteGroupBy) StringsX

func (s *NoteGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NoteMutation

type NoteMutation struct {
	// contains filtered or unexported fields
}

NoteMutation represents an operation that mutates the Note nodes in the graph.

func (*NoteMutation) AddField

func (m *NoteMutation) 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 (*NoteMutation) AddedEdges

func (m *NoteMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NoteMutation) AddedField

func (m *NoteMutation) 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 (*NoteMutation) AddedFields

func (m *NoteMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NoteMutation) AddedIDs

func (m *NoteMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NoteMutation) BillingAddressCleared

func (m *NoteMutation) BillingAddressCleared() bool

BillingAddressCleared reports if the "billing_address" edge to the BillingAddress entity was cleared.

func (*NoteMutation) BillingAddressID

func (m *NoteMutation) BillingAddressID() (id int, exists bool)

BillingAddressID returns the "billing_address" edge ID in the mutation.

func (*NoteMutation) BillingAddressIDs

func (m *NoteMutation) BillingAddressIDs() (ids []int)

BillingAddressIDs returns the "billing_address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BillingAddressID instead. It exists only for internal usage by the builders.

func (*NoteMutation) ClearBillingAddress

func (m *NoteMutation) ClearBillingAddress()

ClearBillingAddress clears the "billing_address" edge to the BillingAddress entity.

func (*NoteMutation) ClearCustomer

func (m *NoteMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Customer entity.

func (*NoteMutation) ClearDeliveryAddress

func (m *NoteMutation) ClearDeliveryAddress()

ClearDeliveryAddress clears the "delivery_address" edge to the DeliveryAddress entity.

func (*NoteMutation) ClearEdge

func (m *NoteMutation) 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 (*NoteMutation) ClearField

func (m *NoteMutation) 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 (*NoteMutation) ClearOrders

func (m *NoteMutation) ClearOrders()

ClearOrders clears the "orders" edge to the Order entity.

func (*NoteMutation) ClearTel

func (m *NoteMutation) ClearTel()

ClearTel clears the "tel" edge to the Tel entity.

func (*NoteMutation) ClearedEdges

func (m *NoteMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NoteMutation) ClearedFields

func (m *NoteMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NoteMutation) Client

func (m NoteMutation) 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 (*NoteMutation) Content

func (m *NoteMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*NoteMutation) CreatedAt

func (m *NoteMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NoteMutation) CustomerCleared

func (m *NoteMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Customer entity was cleared.

func (*NoteMutation) CustomerID

func (m *NoteMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*NoteMutation) CustomerIDs

func (m *NoteMutation) CustomerIDs() (ids []int)

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 (*NoteMutation) DeliveryAddressCleared

func (m *NoteMutation) DeliveryAddressCleared() bool

DeliveryAddressCleared reports if the "delivery_address" edge to the DeliveryAddress entity was cleared.

func (*NoteMutation) DeliveryAddressID

func (m *NoteMutation) DeliveryAddressID() (id int, exists bool)

DeliveryAddressID returns the "delivery_address" edge ID in the mutation.

func (*NoteMutation) DeliveryAddressIDs

func (m *NoteMutation) DeliveryAddressIDs() (ids []int)

DeliveryAddressIDs returns the "delivery_address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DeliveryAddressID instead. It exists only for internal usage by the builders.

func (*NoteMutation) EdgeCleared

func (m *NoteMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NoteMutation) Field

func (m *NoteMutation) 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 (*NoteMutation) FieldCleared

func (m *NoteMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NoteMutation) Fields

func (m *NoteMutation) 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 (*NoteMutation) ID

func (m *NoteMutation) 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 (*NoteMutation) IDs

func (m *NoteMutation) 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 (*NoteMutation) OldContent

func (m *NoteMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Note entity. If the Note 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 (*NoteMutation) OldCreatedAt

func (m *NoteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Note entity. If the Note 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 (*NoteMutation) OldField

func (m *NoteMutation) 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 (*NoteMutation) OldUpdatedAt

func (m *NoteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Note entity. If the Note 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 (*NoteMutation) Op

func (m *NoteMutation) Op() Op

Op returns the operation name.

func (*NoteMutation) OrdersCleared

func (m *NoteMutation) OrdersCleared() bool

OrdersCleared reports if the "orders" edge to the Order entity was cleared.

func (*NoteMutation) OrdersID

func (m *NoteMutation) OrdersID() (id int, exists bool)

OrdersID returns the "orders" edge ID in the mutation.

func (*NoteMutation) OrdersIDs

func (m *NoteMutation) OrdersIDs() (ids []int)

OrdersIDs returns the "orders" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrdersID instead. It exists only for internal usage by the builders.

func (*NoteMutation) RemovedEdges

func (m *NoteMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NoteMutation) RemovedIDs

func (m *NoteMutation) 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 (*NoteMutation) ResetBillingAddress

func (m *NoteMutation) ResetBillingAddress()

ResetBillingAddress resets all changes to the "billing_address" edge.

func (*NoteMutation) ResetContent

func (m *NoteMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*NoteMutation) ResetCreatedAt

func (m *NoteMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NoteMutation) ResetCustomer

func (m *NoteMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*NoteMutation) ResetDeliveryAddress

func (m *NoteMutation) ResetDeliveryAddress()

ResetDeliveryAddress resets all changes to the "delivery_address" edge.

func (*NoteMutation) ResetEdge

func (m *NoteMutation) 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 (*NoteMutation) ResetField

func (m *NoteMutation) 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 (*NoteMutation) ResetOrders

func (m *NoteMutation) ResetOrders()

ResetOrders resets all changes to the "orders" edge.

func (*NoteMutation) ResetTel

func (m *NoteMutation) ResetTel()

ResetTel resets all changes to the "tel" edge.

func (*NoteMutation) ResetUpdatedAt

func (m *NoteMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NoteMutation) SetBillingAddressID

func (m *NoteMutation) SetBillingAddressID(id int)

SetBillingAddressID sets the "billing_address" edge to the BillingAddress entity by id.

func (*NoteMutation) SetContent

func (m *NoteMutation) SetContent(s string)

SetContent sets the "content" field.

func (*NoteMutation) SetCreatedAt

func (m *NoteMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*NoteMutation) SetCustomerID

func (m *NoteMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the Customer entity by id.

func (*NoteMutation) SetDeliveryAddressID

func (m *NoteMutation) SetDeliveryAddressID(id int)

SetDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by id.

func (*NoteMutation) SetField

func (m *NoteMutation) 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 (*NoteMutation) SetOp

func (m *NoteMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NoteMutation) SetOrdersID

func (m *NoteMutation) SetOrdersID(id int)

SetOrdersID sets the "orders" edge to the Order entity by id.

func (*NoteMutation) SetTelID

func (m *NoteMutation) SetTelID(id int)

SetTelID sets the "tel" edge to the Tel entity by id.

func (*NoteMutation) SetUpdatedAt

func (m *NoteMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*NoteMutation) TelCleared

func (m *NoteMutation) TelCleared() bool

TelCleared reports if the "tel" edge to the Tel entity was cleared.

func (*NoteMutation) TelID

func (m *NoteMutation) TelID() (id int, exists bool)

TelID returns the "tel" edge ID in the mutation.

func (*NoteMutation) TelIDs

func (m *NoteMutation) TelIDs() (ids []int)

TelIDs returns the "tel" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TelID instead. It exists only for internal usage by the builders.

func (NoteMutation) Tx

func (m NoteMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NoteMutation) Type

func (m *NoteMutation) Type() string

Type returns the node type of this mutation (Note).

func (*NoteMutation) UpdatedAt

func (m *NoteMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NoteMutation) Where

func (m *NoteMutation) Where(ps ...predicate.Note)

Where appends a list predicates to the NoteMutation builder.

func (*NoteMutation) WhereP

func (m *NoteMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NoteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NoteQuery

type NoteQuery struct {
	// contains filtered or unexported fields
}

NoteQuery is the builder for querying Note entities.

func (*NoteQuery) Aggregate

func (nq *NoteQuery) Aggregate(fns ...AggregateFunc) *NoteSelect

Aggregate returns a NoteSelect configured with the given aggregations.

func (*NoteQuery) All

func (nq *NoteQuery) All(ctx context.Context) ([]*Note, error)

All executes the query and returns a list of Notes.

func (*NoteQuery) AllX

func (nq *NoteQuery) AllX(ctx context.Context) []*Note

AllX is like All, but panics if an error occurs.

func (*NoteQuery) Clone

func (nq *NoteQuery) Clone() *NoteQuery

Clone returns a duplicate of the NoteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NoteQuery) Count

func (nq *NoteQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NoteQuery) CountX

func (nq *NoteQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NoteQuery) Exist

func (nq *NoteQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NoteQuery) ExistX

func (nq *NoteQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NoteQuery) First

func (nq *NoteQuery) First(ctx context.Context) (*Note, error)

First returns the first Note entity from the query. Returns a *NotFoundError when no Note was found.

func (*NoteQuery) FirstID

func (nq *NoteQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Note ID from the query. Returns a *NotFoundError when no Note ID was found.

func (*NoteQuery) FirstIDX

func (nq *NoteQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*NoteQuery) FirstX

func (nq *NoteQuery) FirstX(ctx context.Context) *Note

FirstX is like First, but panics if an error occurs.

func (*NoteQuery) GroupBy

func (nq *NoteQuery) GroupBy(field string, fields ...string) *NoteGroupBy

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 {
	Content string `json:"content,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Note.Query().
	GroupBy(note.FieldContent).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NoteQuery) IDs

func (nq *NoteQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Note IDs.

func (*NoteQuery) IDsX

func (nq *NoteQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NoteQuery) Limit

func (nq *NoteQuery) Limit(limit int) *NoteQuery

Limit the number of records to be returned by this query.

func (*NoteQuery) Offset

func (nq *NoteQuery) Offset(offset int) *NoteQuery

Offset to start from.

func (*NoteQuery) Only

func (nq *NoteQuery) Only(ctx context.Context) (*Note, error)

Only returns a single Note entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Note entity is found. Returns a *NotFoundError when no Note entities are found.

func (*NoteQuery) OnlyID

func (nq *NoteQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Note ID in the query. Returns a *NotSingularError when more than one Note ID is found. Returns a *NotFoundError when no entities are found.

func (*NoteQuery) OnlyIDX

func (nq *NoteQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NoteQuery) OnlyX

func (nq *NoteQuery) OnlyX(ctx context.Context) *Note

OnlyX is like Only, but panics if an error occurs.

func (*NoteQuery) Order

func (nq *NoteQuery) Order(o ...note.OrderOption) *NoteQuery

Order specifies how the records should be ordered.

func (*NoteQuery) QueryBillingAddress

func (nq *NoteQuery) QueryBillingAddress() *BillingAddressQuery

QueryBillingAddress chains the current query on the "billing_address" edge.

func (*NoteQuery) QueryCustomer

func (nq *NoteQuery) QueryCustomer() *CustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*NoteQuery) QueryDeliveryAddress

func (nq *NoteQuery) QueryDeliveryAddress() *DeliveryAddressQuery

QueryDeliveryAddress chains the current query on the "delivery_address" edge.

func (*NoteQuery) QueryOrders

func (nq *NoteQuery) QueryOrders() *OrderQuery

QueryOrders chains the current query on the "orders" edge.

func (*NoteQuery) QueryTel

func (nq *NoteQuery) QueryTel() *TelQuery

QueryTel chains the current query on the "tel" edge.

func (*NoteQuery) Select

func (nq *NoteQuery) Select(fields ...string) *NoteSelect

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 {
	Content string `json:"content,omitempty"`
}

client.Note.Query().
	Select(note.FieldContent).
	Scan(ctx, &v)

func (*NoteQuery) Unique

func (nq *NoteQuery) Unique(unique bool) *NoteQuery

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 (*NoteQuery) Where

func (nq *NoteQuery) Where(ps ...predicate.Note) *NoteQuery

Where adds a new predicate for the NoteQuery builder.

func (*NoteQuery) WithBillingAddress

func (nq *NoteQuery) WithBillingAddress(opts ...func(*BillingAddressQuery)) *NoteQuery

WithBillingAddress tells the query-builder to eager-load the nodes that are connected to the "billing_address" edge. The optional arguments are used to configure the query builder of the edge.

func (*NoteQuery) WithCustomer

func (nq *NoteQuery) WithCustomer(opts ...func(*CustomerQuery)) *NoteQuery

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 (*NoteQuery) WithDeliveryAddress

func (nq *NoteQuery) WithDeliveryAddress(opts ...func(*DeliveryAddressQuery)) *NoteQuery

WithDeliveryAddress tells the query-builder to eager-load the nodes that are connected to the "delivery_address" edge. The optional arguments are used to configure the query builder of the edge.

func (*NoteQuery) WithOrders

func (nq *NoteQuery) WithOrders(opts ...func(*OrderQuery)) *NoteQuery

WithOrders tells the query-builder to eager-load the nodes that are connected to the "orders" edge. The optional arguments are used to configure the query builder of the edge.

func (*NoteQuery) WithTel

func (nq *NoteQuery) WithTel(opts ...func(*TelQuery)) *NoteQuery

WithTel tells the query-builder to eager-load the nodes that are connected to the "tel" edge. The optional arguments are used to configure the query builder of the edge.

type NoteSelect

type NoteSelect struct {
	*NoteQuery
	// contains filtered or unexported fields
}

NoteSelect is the builder for selecting fields of Note entities.

func (*NoteSelect) Aggregate

func (ns *NoteSelect) Aggregate(fns ...AggregateFunc) *NoteSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NoteSelect) Bool

func (s *NoteSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NoteSelect) BoolX

func (s *NoteSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NoteSelect) Bools

func (s *NoteSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NoteSelect) BoolsX

func (s *NoteSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NoteSelect) Float64

func (s *NoteSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NoteSelect) Float64X

func (s *NoteSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NoteSelect) Float64s

func (s *NoteSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NoteSelect) Float64sX

func (s *NoteSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NoteSelect) Int

func (s *NoteSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NoteSelect) IntX

func (s *NoteSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NoteSelect) Ints

func (s *NoteSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NoteSelect) IntsX

func (s *NoteSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NoteSelect) Scan

func (ns *NoteSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NoteSelect) ScanX

func (s *NoteSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NoteSelect) String

func (s *NoteSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NoteSelect) StringX

func (s *NoteSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NoteSelect) Strings

func (s *NoteSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NoteSelect) StringsX

func (s *NoteSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NoteUpdate

type NoteUpdate struct {
	// contains filtered or unexported fields
}

NoteUpdate is the builder for updating Note entities.

func (*NoteUpdate) ClearBillingAddress

func (nu *NoteUpdate) ClearBillingAddress() *NoteUpdate

ClearBillingAddress clears the "billing_address" edge to the BillingAddress entity.

func (*NoteUpdate) ClearCustomer

func (nu *NoteUpdate) ClearCustomer() *NoteUpdate

ClearCustomer clears the "customer" edge to the Customer entity.

func (*NoteUpdate) ClearDeliveryAddress

func (nu *NoteUpdate) ClearDeliveryAddress() *NoteUpdate

ClearDeliveryAddress clears the "delivery_address" edge to the DeliveryAddress entity.

func (*NoteUpdate) ClearOrders

func (nu *NoteUpdate) ClearOrders() *NoteUpdate

ClearOrders clears the "orders" edge to the Order entity.

func (*NoteUpdate) ClearTel

func (nu *NoteUpdate) ClearTel() *NoteUpdate

ClearTel clears the "tel" edge to the Tel entity.

func (*NoteUpdate) Exec

func (nu *NoteUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteUpdate) ExecX

func (nu *NoteUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteUpdate) Mutation

func (nu *NoteUpdate) Mutation() *NoteMutation

Mutation returns the NoteMutation object of the builder.

func (*NoteUpdate) Save

func (nu *NoteUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NoteUpdate) SaveX

func (nu *NoteUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NoteUpdate) SetBillingAddress

func (nu *NoteUpdate) SetBillingAddress(b *BillingAddress) *NoteUpdate

SetBillingAddress sets the "billing_address" edge to the BillingAddress entity.

func (*NoteUpdate) SetBillingAddressID

func (nu *NoteUpdate) SetBillingAddressID(id int) *NoteUpdate

SetBillingAddressID sets the "billing_address" edge to the BillingAddress entity by ID.

func (*NoteUpdate) SetContent

func (nu *NoteUpdate) SetContent(s string) *NoteUpdate

SetContent sets the "content" field.

func (*NoteUpdate) SetCustomer

func (nu *NoteUpdate) SetCustomer(c *Customer) *NoteUpdate

SetCustomer sets the "customer" edge to the Customer entity.

func (*NoteUpdate) SetCustomerID

func (nu *NoteUpdate) SetCustomerID(id int) *NoteUpdate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*NoteUpdate) SetDeliveryAddress

func (nu *NoteUpdate) SetDeliveryAddress(d *DeliveryAddress) *NoteUpdate

SetDeliveryAddress sets the "delivery_address" edge to the DeliveryAddress entity.

func (*NoteUpdate) SetDeliveryAddressID

func (nu *NoteUpdate) SetDeliveryAddressID(id int) *NoteUpdate

SetDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by ID.

func (*NoteUpdate) SetNillableBillingAddressID

func (nu *NoteUpdate) SetNillableBillingAddressID(id *int) *NoteUpdate

SetNillableBillingAddressID sets the "billing_address" edge to the BillingAddress entity by ID if the given value is not nil.

func (*NoteUpdate) SetNillableContent

func (nu *NoteUpdate) SetNillableContent(s *string) *NoteUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*NoteUpdate) SetNillableCustomerID

func (nu *NoteUpdate) SetNillableCustomerID(id *int) *NoteUpdate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*NoteUpdate) SetNillableDeliveryAddressID

func (nu *NoteUpdate) SetNillableDeliveryAddressID(id *int) *NoteUpdate

SetNillableDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by ID if the given value is not nil.

func (*NoteUpdate) SetNillableOrdersID

func (nu *NoteUpdate) SetNillableOrdersID(id *int) *NoteUpdate

SetNillableOrdersID sets the "orders" edge to the Order entity by ID if the given value is not nil.

func (*NoteUpdate) SetNillableTelID

func (nu *NoteUpdate) SetNillableTelID(id *int) *NoteUpdate

SetNillableTelID sets the "tel" edge to the Tel entity by ID if the given value is not nil.

func (*NoteUpdate) SetOrders

func (nu *NoteUpdate) SetOrders(o *Order) *NoteUpdate

SetOrders sets the "orders" edge to the Order entity.

func (*NoteUpdate) SetOrdersID

func (nu *NoteUpdate) SetOrdersID(id int) *NoteUpdate

SetOrdersID sets the "orders" edge to the Order entity by ID.

func (*NoteUpdate) SetTel

func (nu *NoteUpdate) SetTel(t *Tel) *NoteUpdate

SetTel sets the "tel" edge to the Tel entity.

func (*NoteUpdate) SetTelID

func (nu *NoteUpdate) SetTelID(id int) *NoteUpdate

SetTelID sets the "tel" edge to the Tel entity by ID.

func (*NoteUpdate) SetUpdatedAt

func (nu *NoteUpdate) SetUpdatedAt(t time.Time) *NoteUpdate

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpdate) Where

func (nu *NoteUpdate) Where(ps ...predicate.Note) *NoteUpdate

Where appends a list predicates to the NoteUpdate builder.

type NoteUpdateOne

type NoteUpdateOne struct {
	// contains filtered or unexported fields
}

NoteUpdateOne is the builder for updating a single Note entity.

func (*NoteUpdateOne) ClearBillingAddress

func (nuo *NoteUpdateOne) ClearBillingAddress() *NoteUpdateOne

ClearBillingAddress clears the "billing_address" edge to the BillingAddress entity.

func (*NoteUpdateOne) ClearCustomer

func (nuo *NoteUpdateOne) ClearCustomer() *NoteUpdateOne

ClearCustomer clears the "customer" edge to the Customer entity.

func (*NoteUpdateOne) ClearDeliveryAddress

func (nuo *NoteUpdateOne) ClearDeliveryAddress() *NoteUpdateOne

ClearDeliveryAddress clears the "delivery_address" edge to the DeliveryAddress entity.

func (*NoteUpdateOne) ClearOrders

func (nuo *NoteUpdateOne) ClearOrders() *NoteUpdateOne

ClearOrders clears the "orders" edge to the Order entity.

func (*NoteUpdateOne) ClearTel

func (nuo *NoteUpdateOne) ClearTel() *NoteUpdateOne

ClearTel clears the "tel" edge to the Tel entity.

func (*NoteUpdateOne) Exec

func (nuo *NoteUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NoteUpdateOne) ExecX

func (nuo *NoteUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteUpdateOne) Mutation

func (nuo *NoteUpdateOne) Mutation() *NoteMutation

Mutation returns the NoteMutation object of the builder.

func (*NoteUpdateOne) Save

func (nuo *NoteUpdateOne) Save(ctx context.Context) (*Note, error)

Save executes the query and returns the updated Note entity.

func (*NoteUpdateOne) SaveX

func (nuo *NoteUpdateOne) SaveX(ctx context.Context) *Note

SaveX is like Save, but panics if an error occurs.

func (*NoteUpdateOne) Select

func (nuo *NoteUpdateOne) Select(field string, fields ...string) *NoteUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NoteUpdateOne) SetBillingAddress

func (nuo *NoteUpdateOne) SetBillingAddress(b *BillingAddress) *NoteUpdateOne

SetBillingAddress sets the "billing_address" edge to the BillingAddress entity.

func (*NoteUpdateOne) SetBillingAddressID

func (nuo *NoteUpdateOne) SetBillingAddressID(id int) *NoteUpdateOne

SetBillingAddressID sets the "billing_address" edge to the BillingAddress entity by ID.

func (*NoteUpdateOne) SetContent

func (nuo *NoteUpdateOne) SetContent(s string) *NoteUpdateOne

SetContent sets the "content" field.

func (*NoteUpdateOne) SetCustomer

func (nuo *NoteUpdateOne) SetCustomer(c *Customer) *NoteUpdateOne

SetCustomer sets the "customer" edge to the Customer entity.

func (*NoteUpdateOne) SetCustomerID

func (nuo *NoteUpdateOne) SetCustomerID(id int) *NoteUpdateOne

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*NoteUpdateOne) SetDeliveryAddress

func (nuo *NoteUpdateOne) SetDeliveryAddress(d *DeliveryAddress) *NoteUpdateOne

SetDeliveryAddress sets the "delivery_address" edge to the DeliveryAddress entity.

func (*NoteUpdateOne) SetDeliveryAddressID

func (nuo *NoteUpdateOne) SetDeliveryAddressID(id int) *NoteUpdateOne

SetDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by ID.

func (*NoteUpdateOne) SetNillableBillingAddressID

func (nuo *NoteUpdateOne) SetNillableBillingAddressID(id *int) *NoteUpdateOne

SetNillableBillingAddressID sets the "billing_address" edge to the BillingAddress entity by ID if the given value is not nil.

func (*NoteUpdateOne) SetNillableContent

func (nuo *NoteUpdateOne) SetNillableContent(s *string) *NoteUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*NoteUpdateOne) SetNillableCustomerID

func (nuo *NoteUpdateOne) SetNillableCustomerID(id *int) *NoteUpdateOne

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*NoteUpdateOne) SetNillableDeliveryAddressID

func (nuo *NoteUpdateOne) SetNillableDeliveryAddressID(id *int) *NoteUpdateOne

SetNillableDeliveryAddressID sets the "delivery_address" edge to the DeliveryAddress entity by ID if the given value is not nil.

func (*NoteUpdateOne) SetNillableOrdersID

func (nuo *NoteUpdateOne) SetNillableOrdersID(id *int) *NoteUpdateOne

SetNillableOrdersID sets the "orders" edge to the Order entity by ID if the given value is not nil.

func (*NoteUpdateOne) SetNillableTelID

func (nuo *NoteUpdateOne) SetNillableTelID(id *int) *NoteUpdateOne

SetNillableTelID sets the "tel" edge to the Tel entity by ID if the given value is not nil.

func (*NoteUpdateOne) SetOrders

func (nuo *NoteUpdateOne) SetOrders(o *Order) *NoteUpdateOne

SetOrders sets the "orders" edge to the Order entity.

func (*NoteUpdateOne) SetOrdersID

func (nuo *NoteUpdateOne) SetOrdersID(id int) *NoteUpdateOne

SetOrdersID sets the "orders" edge to the Order entity by ID.

func (*NoteUpdateOne) SetTel

func (nuo *NoteUpdateOne) SetTel(t *Tel) *NoteUpdateOne

SetTel sets the "tel" edge to the Tel entity.

func (*NoteUpdateOne) SetTelID

func (nuo *NoteUpdateOne) SetTelID(id int) *NoteUpdateOne

SetTelID sets the "tel" edge to the Tel entity by ID.

func (*NoteUpdateOne) SetUpdatedAt

func (nuo *NoteUpdateOne) SetUpdatedAt(t time.Time) *NoteUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*NoteUpdateOne) Where

func (nuo *NoteUpdateOne) Where(ps ...predicate.Note) *NoteUpdateOne

Where appends a list predicates to the NoteUpdate builder.

type Notes

type Notes []*Note

Notes is a parsable slice of Note.

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 int `json:"id,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,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"`
	// 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) QueryAddress

func (o *Order) QueryAddress() *BillingAddressQuery

QueryAddress queries the "address" edge of the Order entity.

func (*Order) QueryCustomer

func (o *Order) QueryCustomer() *CustomerQuery

QueryCustomer queries the "customer" edge of the Order entity.

func (*Order) QueryNotes

func (o *Order) QueryNotes() *NoteQuery

QueryNotes queries the "notes" 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 int) *OrderDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OrderClient) Get

func (c *OrderClient) Get(ctx context.Context, id int) (*Order, error)

Get returns a Order entity by its id.

func (*OrderClient) GetX

func (c *OrderClient) GetX(ctx context.Context, id int) *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) QueryAddress

func (c *OrderClient) QueryAddress(o *Order) *BillingAddressQuery

QueryAddress queries the address edge of a Order.

func (*OrderClient) QueryCustomer

func (c *OrderClient) QueryCustomer(o *Order) *CustomerQuery

QueryCustomer queries the customer edge of a Order.

func (*OrderClient) QueryNotes

func (c *OrderClient) QueryNotes(o *Order) *NoteQuery

QueryNotes queries the notes 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 int) *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) AddNoteIDs

func (oc *OrderCreate) AddNoteIDs(ids ...int) *OrderCreate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*OrderCreate) AddNotes

func (oc *OrderCreate) AddNotes(n ...*Note) *OrderCreate

AddNotes adds the "notes" edges to the Note 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) SetAddress

func (oc *OrderCreate) SetAddress(b *BillingAddress) *OrderCreate

SetAddress sets the "address" edge to the BillingAddress entity.

func (*OrderCreate) SetAddressID

func (oc *OrderCreate) SetAddressID(id int) *OrderCreate

SetAddressID sets the "address" edge to the BillingAddress entity by ID.

func (*OrderCreate) SetCreatedAt

func (oc *OrderCreate) SetCreatedAt(t time.Time) *OrderCreate

SetCreatedAt sets the "created_at" field.

func (*OrderCreate) SetCustomer

func (oc *OrderCreate) SetCustomer(c *Customer) *OrderCreate

SetCustomer sets the "customer" edge to the Customer entity.

func (*OrderCreate) SetCustomerID

func (oc *OrderCreate) SetCustomerID(id int) *OrderCreate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*OrderCreate) SetNillableAddressID

func (oc *OrderCreate) SetNillableAddressID(id *int) *OrderCreate

SetNillableAddressID sets the "address" edge to the BillingAddress entity by ID if the given value is not nil.

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) SetNillableCustomerID

func (oc *OrderCreate) SetNillableCustomerID(id *int) *OrderCreate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*OrderCreate) SetNillableStatus

func (oc *OrderCreate) SetNillableStatus(s *string) *OrderCreate

SetNillableStatus sets the "status" 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) SetStatus

func (oc *OrderCreate) SetStatus(s string) *OrderCreate

SetStatus sets the "status" field.

func (*OrderCreate) SetUpdatedAt

func (oc *OrderCreate) SetUpdatedAt(t time.Time) *OrderCreate

SetUpdatedAt sets the "updated_at" 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 *Customer `json:"customer,omitempty"`
	// Address holds the value of the address edge.
	Address *BillingAddress `json:"address,omitempty"`
	// Notes holds the value of the notes edge.
	Notes []*Note `json:"notes,omitempty"`
	// contains filtered or unexported fields
}

OrderEdges holds the relations/edges for other nodes in the graph.

func (OrderEdges) AddressOrErr

func (e OrderEdges) AddressOrErr() (*BillingAddress, error)

AddressOrErr returns the Address 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() (*Customer, 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) NotesOrErr

func (e OrderEdges) NotesOrErr() ([]*Note, error)

NotesOrErr returns the Notes value or an error if the edge was not loaded in eager-loading.

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 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) AddNoteIDs

func (m *OrderMutation) AddNoteIDs(ids ...int)

AddNoteIDs adds the "notes" edge to the Note entity by ids.

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) AddressCleared

func (m *OrderMutation) AddressCleared() bool

AddressCleared reports if the "address" edge to the BillingAddress entity was cleared.

func (*OrderMutation) AddressID

func (m *OrderMutation) AddressID() (id int, exists bool)

AddressID returns the "address" edge ID in the mutation.

func (*OrderMutation) AddressIDs

func (m *OrderMutation) AddressIDs() (ids []int)

AddressIDs returns the "address" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AddressID instead. It exists only for internal usage by the builders.

func (*OrderMutation) ClearAddress

func (m *OrderMutation) ClearAddress()

ClearAddress clears the "address" edge to the BillingAddress entity.

func (*OrderMutation) ClearCustomer

func (m *OrderMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Customer entity.

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) ClearNotes

func (m *OrderMutation) ClearNotes()

ClearNotes clears the "notes" edge to the Note entity.

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) CustomerCleared

func (m *OrderMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Customer entity was cleared.

func (*OrderMutation) CustomerID

func (m *OrderMutation) CustomerID() (id int, exists bool)

CustomerID returns the "customer" edge ID in the mutation.

func (*OrderMutation) CustomerIDs

func (m *OrderMutation) CustomerIDs() (ids []int)

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) 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) ID

func (m *OrderMutation) 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 (*OrderMutation) IDs

func (m *OrderMutation) 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 (*OrderMutation) NotesCleared

func (m *OrderMutation) NotesCleared() bool

NotesCleared reports if the "notes" edge to the Note entity was cleared.

func (*OrderMutation) NotesIDs

func (m *OrderMutation) NotesIDs() (ids []int)

NotesIDs returns the "notes" edge IDs in the 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) 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) OldStatus

func (m *OrderMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old "status" 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) Op

func (m *OrderMutation) Op() Op

Op returns the operation name.

func (*OrderMutation) RemoveNoteIDs

func (m *OrderMutation) RemoveNoteIDs(ids ...int)

RemoveNoteIDs removes the "notes" edge to the Note entity by IDs.

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) RemovedNotesIDs

func (m *OrderMutation) RemovedNotesIDs() (ids []int)

RemovedNotes returns the removed IDs of the "notes" edge to the Note entity.

func (*OrderMutation) ResetAddress

func (m *OrderMutation) ResetAddress()

ResetAddress resets all changes to the "address" edge.

func (*OrderMutation) ResetCreatedAt

func (m *OrderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OrderMutation) ResetCustomer

func (m *OrderMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

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) ResetNotes

func (m *OrderMutation) ResetNotes()

ResetNotes resets all changes to the "notes" edge.

func (*OrderMutation) ResetStatus

func (m *OrderMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*OrderMutation) ResetUpdatedAt

func (m *OrderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OrderMutation) SetAddressID

func (m *OrderMutation) SetAddressID(id int)

SetAddressID sets the "address" edge to the BillingAddress entity by id.

func (*OrderMutation) SetCreatedAt

func (m *OrderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OrderMutation) SetCustomerID

func (m *OrderMutation) SetCustomerID(id int)

SetCustomerID sets the "customer" edge to the Customer entity by id.

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) SetOp

func (m *OrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderMutation) SetStatus

func (m *OrderMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*OrderMutation) SetUpdatedAt

func (m *OrderMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OrderMutation) Status

func (m *OrderMutation) Status() (r string, exists bool)

Status returns the value of the "status" 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) 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 int, 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) int

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 {
	Status string `json:"status,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Order.Query().
	GroupBy(order.FieldStatus).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderQuery) IDs

func (oq *OrderQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Order IDs.

func (*OrderQuery) IDsX

func (oq *OrderQuery) IDsX(ctx context.Context) []int

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 int, 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) int

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) QueryAddress

func (oq *OrderQuery) QueryAddress() *BillingAddressQuery

QueryAddress chains the current query on the "address" edge.

func (*OrderQuery) QueryCustomer

func (oq *OrderQuery) QueryCustomer() *CustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*OrderQuery) QueryNotes

func (oq *OrderQuery) QueryNotes() *NoteQuery

QueryNotes chains the current query on the "notes" 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 {
	Status string `json:"status,omitempty"`
}

client.Order.Query().
	Select(order.FieldStatus).
	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) WithAddress

func (oq *OrderQuery) WithAddress(opts ...func(*BillingAddressQuery)) *OrderQuery

WithAddress tells the query-builder to eager-load the nodes that are connected to the "address" edge. The optional arguments are used to configure the query builder of the edge.

func (*OrderQuery) WithCustomer

func (oq *OrderQuery) WithCustomer(opts ...func(*CustomerQuery)) *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) WithNotes

func (oq *OrderQuery) WithNotes(opts ...func(*NoteQuery)) *OrderQuery

WithNotes tells the query-builder to eager-load the nodes that are connected to the "notes" 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 OrderUpdate

type OrderUpdate struct {
	// contains filtered or unexported fields
}

OrderUpdate is the builder for updating Order entities.

func (*OrderUpdate) AddNoteIDs

func (ou *OrderUpdate) AddNoteIDs(ids ...int) *OrderUpdate

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*OrderUpdate) AddNotes

func (ou *OrderUpdate) AddNotes(n ...*Note) *OrderUpdate

AddNotes adds the "notes" edges to the Note entity.

func (*OrderUpdate) ClearAddress

func (ou *OrderUpdate) ClearAddress() *OrderUpdate

ClearAddress clears the "address" edge to the BillingAddress entity.

func (*OrderUpdate) ClearCustomer

func (ou *OrderUpdate) ClearCustomer() *OrderUpdate

ClearCustomer clears the "customer" edge to the Customer entity.

func (*OrderUpdate) ClearNotes

func (ou *OrderUpdate) ClearNotes() *OrderUpdate

ClearNotes clears all "notes" edges to the Note entity.

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) RemoveNoteIDs

func (ou *OrderUpdate) RemoveNoteIDs(ids ...int) *OrderUpdate

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*OrderUpdate) RemoveNotes

func (ou *OrderUpdate) RemoveNotes(n ...*Note) *OrderUpdate

RemoveNotes removes "notes" edges to Note entities.

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) SetAddress

func (ou *OrderUpdate) SetAddress(b *BillingAddress) *OrderUpdate

SetAddress sets the "address" edge to the BillingAddress entity.

func (*OrderUpdate) SetAddressID

func (ou *OrderUpdate) SetAddressID(id int) *OrderUpdate

SetAddressID sets the "address" edge to the BillingAddress entity by ID.

func (*OrderUpdate) SetCustomer

func (ou *OrderUpdate) SetCustomer(c *Customer) *OrderUpdate

SetCustomer sets the "customer" edge to the Customer entity.

func (*OrderUpdate) SetCustomerID

func (ou *OrderUpdate) SetCustomerID(id int) *OrderUpdate

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*OrderUpdate) SetNillableAddressID

func (ou *OrderUpdate) SetNillableAddressID(id *int) *OrderUpdate

SetNillableAddressID sets the "address" edge to the BillingAddress entity by ID if the given value is not nil.

func (*OrderUpdate) SetNillableCustomerID

func (ou *OrderUpdate) SetNillableCustomerID(id *int) *OrderUpdate

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*OrderUpdate) SetNillableStatus

func (ou *OrderUpdate) SetNillableStatus(s *string) *OrderUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*OrderUpdate) SetStatus

func (ou *OrderUpdate) SetStatus(s string) *OrderUpdate

SetStatus sets the "status" field.

func (*OrderUpdate) SetUpdatedAt

func (ou *OrderUpdate) SetUpdatedAt(t time.Time) *OrderUpdate

SetUpdatedAt sets the "updated_at" 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) AddNoteIDs

func (ouo *OrderUpdateOne) AddNoteIDs(ids ...int) *OrderUpdateOne

AddNoteIDs adds the "notes" edge to the Note entity by IDs.

func (*OrderUpdateOne) AddNotes

func (ouo *OrderUpdateOne) AddNotes(n ...*Note) *OrderUpdateOne

AddNotes adds the "notes" edges to the Note entity.

func (*OrderUpdateOne) ClearAddress

func (ouo *OrderUpdateOne) ClearAddress() *OrderUpdateOne

ClearAddress clears the "address" edge to the BillingAddress entity.

func (*OrderUpdateOne) ClearCustomer

func (ouo *OrderUpdateOne) ClearCustomer() *OrderUpdateOne

ClearCustomer clears the "customer" edge to the Customer entity.

func (*OrderUpdateOne) ClearNotes

func (ouo *OrderUpdateOne) ClearNotes() *OrderUpdateOne

ClearNotes clears all "notes" edges to the Note entity.

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) RemoveNoteIDs

func (ouo *OrderUpdateOne) RemoveNoteIDs(ids ...int) *OrderUpdateOne

RemoveNoteIDs removes the "notes" edge to Note entities by IDs.

func (*OrderUpdateOne) RemoveNotes

func (ouo *OrderUpdateOne) RemoveNotes(n ...*Note) *OrderUpdateOne

RemoveNotes removes "notes" edges to Note entities.

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) SetAddress

func (ouo *OrderUpdateOne) SetAddress(b *BillingAddress) *OrderUpdateOne

SetAddress sets the "address" edge to the BillingAddress entity.

func (*OrderUpdateOne) SetAddressID

func (ouo *OrderUpdateOne) SetAddressID(id int) *OrderUpdateOne

SetAddressID sets the "address" edge to the BillingAddress entity by ID.

func (*OrderUpdateOne) SetCustomer

func (ouo *OrderUpdateOne) SetCustomer(c *Customer) *OrderUpdateOne

SetCustomer sets the "customer" edge to the Customer entity.

func (*OrderUpdateOne) SetCustomerID

func (ouo *OrderUpdateOne) SetCustomerID(id int) *OrderUpdateOne

SetCustomerID sets the "customer" edge to the Customer entity by ID.

func (*OrderUpdateOne) SetNillableAddressID

func (ouo *OrderUpdateOne) SetNillableAddressID(id *int) *OrderUpdateOne

SetNillableAddressID sets the "address" edge to the BillingAddress entity by ID if the given value is not nil.

func (*OrderUpdateOne) SetNillableCustomerID

func (ouo *OrderUpdateOne) SetNillableCustomerID(id *int) *OrderUpdateOne

SetNillableCustomerID sets the "customer" edge to the Customer entity by ID if the given value is not nil.

func (*OrderUpdateOne) SetNillableStatus

func (ouo *OrderUpdateOne) SetNillableStatus(s *string) *OrderUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*OrderUpdateOne) SetStatus

func (ouo *OrderUpdateOne) SetStatus(s string) *OrderUpdateOne

SetStatus sets the "status" field.

func (*OrderUpdateOne) SetUpdatedAt

func (ouo *OrderUpdateOne) SetUpdatedAt(t time.Time) *OrderUpdateOne

SetUpdatedAt sets the "updated_at" 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 Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Position

type Position struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Position is the model entity for the Position schema.

func (*Position) String

func (po *Position) String() string

String implements the fmt.Stringer.

func (*Position) Unwrap

func (po *Position) Unwrap() *Position

Unwrap unwraps the Position 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 (*Position) Update

func (po *Position) Update() *PositionUpdateOne

Update returns a builder for updating this Position. Note that you need to call Position.Unwrap() before calling this method if this Position was returned from a transaction, and the transaction was committed or rolled back.

func (*Position) Value

func (po *Position) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Position. This includes values selected through modifiers, order, etc.

type PositionClient

type PositionClient struct {
	// contains filtered or unexported fields
}

PositionClient is a client for the Position schema.

func NewPositionClient

func NewPositionClient(c config) *PositionClient

NewPositionClient returns a client for the Position from the given config.

func (*PositionClient) Create

func (c *PositionClient) Create() *PositionCreate

Create returns a builder for creating a Position entity.

func (*PositionClient) CreateBulk

func (c *PositionClient) CreateBulk(builders ...*PositionCreate) *PositionCreateBulk

CreateBulk returns a builder for creating a bulk of Position entities.

func (*PositionClient) Delete

func (c *PositionClient) Delete() *PositionDelete

Delete returns a delete builder for Position.

func (*PositionClient) DeleteOne

func (c *PositionClient) DeleteOne(po *Position) *PositionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PositionClient) DeleteOneID

func (c *PositionClient) DeleteOneID(id int) *PositionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PositionClient) Get

func (c *PositionClient) Get(ctx context.Context, id int) (*Position, error)

Get returns a Position entity by its id.

func (*PositionClient) GetX

func (c *PositionClient) GetX(ctx context.Context, id int) *Position

GetX is like Get, but panics if an error occurs.

func (*PositionClient) Hooks

func (c *PositionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PositionClient) Intercept

func (c *PositionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `position.Intercept(f(g(h())))`.

func (*PositionClient) Interceptors

func (c *PositionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PositionClient) MapCreateBulk

func (c *PositionClient) MapCreateBulk(slice any, setFunc func(*PositionCreate, int)) *PositionCreateBulk

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 (*PositionClient) Query

func (c *PositionClient) Query() *PositionQuery

Query returns a query builder for Position.

func (*PositionClient) Update

func (c *PositionClient) Update() *PositionUpdate

Update returns an update builder for Position.

func (*PositionClient) UpdateOne

func (c *PositionClient) UpdateOne(po *Position) *PositionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PositionClient) UpdateOneID

func (c *PositionClient) UpdateOneID(id int) *PositionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PositionClient) Use

func (c *PositionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `position.Hooks(f(g(h())))`.

type PositionCreate

type PositionCreate struct {
	// contains filtered or unexported fields
}

PositionCreate is the builder for creating a Position entity.

func (*PositionCreate) Exec

func (pc *PositionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PositionCreate) ExecX

func (pc *PositionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionCreate) Mutation

func (pc *PositionCreate) Mutation() *PositionMutation

Mutation returns the PositionMutation object of the builder.

func (*PositionCreate) Save

func (pc *PositionCreate) Save(ctx context.Context) (*Position, error)

Save creates the Position in the database.

func (*PositionCreate) SaveX

func (pc *PositionCreate) SaveX(ctx context.Context) *Position

SaveX calls Save and panics if Save returns an error.

type PositionCreateBulk

type PositionCreateBulk struct {
	// contains filtered or unexported fields
}

PositionCreateBulk is the builder for creating many Position entities in bulk.

func (*PositionCreateBulk) Exec

func (pcb *PositionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PositionCreateBulk) ExecX

func (pcb *PositionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionCreateBulk) Save

func (pcb *PositionCreateBulk) Save(ctx context.Context) ([]*Position, error)

Save creates the Position entities in the database.

func (*PositionCreateBulk) SaveX

func (pcb *PositionCreateBulk) SaveX(ctx context.Context) []*Position

SaveX is like Save, but panics if an error occurs.

type PositionDelete

type PositionDelete struct {
	// contains filtered or unexported fields
}

PositionDelete is the builder for deleting a Position entity.

func (*PositionDelete) Exec

func (pd *PositionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PositionDelete) ExecX

func (pd *PositionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PositionDelete) Where

func (pd *PositionDelete) Where(ps ...predicate.Position) *PositionDelete

Where appends a list predicates to the PositionDelete builder.

type PositionDeleteOne

type PositionDeleteOne struct {
	// contains filtered or unexported fields
}

PositionDeleteOne is the builder for deleting a single Position entity.

func (*PositionDeleteOne) Exec

func (pdo *PositionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PositionDeleteOne) ExecX

func (pdo *PositionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionDeleteOne) Where

Where appends a list predicates to the PositionDelete builder.

type PositionGroupBy

type PositionGroupBy struct {
	// contains filtered or unexported fields
}

PositionGroupBy is the group-by builder for Position entities.

func (*PositionGroupBy) Aggregate

func (pgb *PositionGroupBy) Aggregate(fns ...AggregateFunc) *PositionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PositionGroupBy) Bool

func (s *PositionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) BoolX

func (s *PositionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PositionGroupBy) Bools

func (s *PositionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) BoolsX

func (s *PositionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PositionGroupBy) Float64

func (s *PositionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) Float64X

func (s *PositionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PositionGroupBy) Float64s

func (s *PositionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) Float64sX

func (s *PositionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PositionGroupBy) Int

func (s *PositionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) IntX

func (s *PositionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PositionGroupBy) Ints

func (s *PositionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) IntsX

func (s *PositionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PositionGroupBy) Scan

func (pgb *PositionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PositionGroupBy) ScanX

func (s *PositionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PositionGroupBy) String

func (s *PositionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) StringX

func (s *PositionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PositionGroupBy) Strings

func (s *PositionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) StringsX

func (s *PositionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PositionMutation

type PositionMutation struct {
	// contains filtered or unexported fields
}

PositionMutation represents an operation that mutates the Position nodes in the graph.

func (*PositionMutation) AddField

func (m *PositionMutation) 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 (*PositionMutation) AddedEdges

func (m *PositionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PositionMutation) AddedField

func (m *PositionMutation) 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 (*PositionMutation) AddedFields

func (m *PositionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PositionMutation) AddedIDs

func (m *PositionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PositionMutation) ClearEdge

func (m *PositionMutation) 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 (*PositionMutation) ClearField

func (m *PositionMutation) 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 (*PositionMutation) ClearedEdges

func (m *PositionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PositionMutation) ClearedFields

func (m *PositionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PositionMutation) Client

func (m PositionMutation) 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 (*PositionMutation) EdgeCleared

func (m *PositionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PositionMutation) Field

func (m *PositionMutation) 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 (*PositionMutation) FieldCleared

func (m *PositionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PositionMutation) Fields

func (m *PositionMutation) 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 (*PositionMutation) ID

func (m *PositionMutation) 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 (*PositionMutation) IDs

func (m *PositionMutation) 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 (*PositionMutation) OldField

func (m *PositionMutation) 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 (*PositionMutation) Op

func (m *PositionMutation) Op() Op

Op returns the operation name.

func (*PositionMutation) RemovedEdges

func (m *PositionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PositionMutation) RemovedIDs

func (m *PositionMutation) 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 (*PositionMutation) ResetEdge

func (m *PositionMutation) 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 (*PositionMutation) ResetField

func (m *PositionMutation) 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 (*PositionMutation) SetField

func (m *PositionMutation) 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 (*PositionMutation) SetOp

func (m *PositionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (PositionMutation) Tx

func (m PositionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PositionMutation) Type

func (m *PositionMutation) Type() string

Type returns the node type of this mutation (Position).

func (*PositionMutation) Where

func (m *PositionMutation) Where(ps ...predicate.Position)

Where appends a list predicates to the PositionMutation builder.

func (*PositionMutation) WhereP

func (m *PositionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PositionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PositionQuery

type PositionQuery struct {
	// contains filtered or unexported fields
}

PositionQuery is the builder for querying Position entities.

func (*PositionQuery) Aggregate

func (pq *PositionQuery) Aggregate(fns ...AggregateFunc) *PositionSelect

Aggregate returns a PositionSelect configured with the given aggregations.

func (*PositionQuery) All

func (pq *PositionQuery) All(ctx context.Context) ([]*Position, error)

All executes the query and returns a list of Positions.

func (*PositionQuery) AllX

func (pq *PositionQuery) AllX(ctx context.Context) []*Position

AllX is like All, but panics if an error occurs.

func (*PositionQuery) Clone

func (pq *PositionQuery) Clone() *PositionQuery

Clone returns a duplicate of the PositionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PositionQuery) Count

func (pq *PositionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PositionQuery) CountX

func (pq *PositionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PositionQuery) Exist

func (pq *PositionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PositionQuery) ExistX

func (pq *PositionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PositionQuery) First

func (pq *PositionQuery) First(ctx context.Context) (*Position, error)

First returns the first Position entity from the query. Returns a *NotFoundError when no Position was found.

func (*PositionQuery) FirstID

func (pq *PositionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Position ID from the query. Returns a *NotFoundError when no Position ID was found.

func (*PositionQuery) FirstIDX

func (pq *PositionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PositionQuery) FirstX

func (pq *PositionQuery) FirstX(ctx context.Context) *Position

FirstX is like First, but panics if an error occurs.

func (*PositionQuery) GroupBy

func (pq *PositionQuery) GroupBy(field string, fields ...string) *PositionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*PositionQuery) IDs

func (pq *PositionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Position IDs.

func (*PositionQuery) IDsX

func (pq *PositionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PositionQuery) Limit

func (pq *PositionQuery) Limit(limit int) *PositionQuery

Limit the number of records to be returned by this query.

func (*PositionQuery) Offset

func (pq *PositionQuery) Offset(offset int) *PositionQuery

Offset to start from.

func (*PositionQuery) Only

func (pq *PositionQuery) Only(ctx context.Context) (*Position, error)

Only returns a single Position entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Position entity is found. Returns a *NotFoundError when no Position entities are found.

func (*PositionQuery) OnlyID

func (pq *PositionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Position ID in the query. Returns a *NotSingularError when more than one Position ID is found. Returns a *NotFoundError when no entities are found.

func (*PositionQuery) OnlyIDX

func (pq *PositionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PositionQuery) OnlyX

func (pq *PositionQuery) OnlyX(ctx context.Context) *Position

OnlyX is like Only, but panics if an error occurs.

func (*PositionQuery) Order

Order specifies how the records should be ordered.

func (*PositionQuery) Select

func (pq *PositionQuery) Select(fields ...string) *PositionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*PositionQuery) Unique

func (pq *PositionQuery) Unique(unique bool) *PositionQuery

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 (*PositionQuery) Where

func (pq *PositionQuery) Where(ps ...predicate.Position) *PositionQuery

Where adds a new predicate for the PositionQuery builder.

type PositionSelect

type PositionSelect struct {
	*PositionQuery
	// contains filtered or unexported fields
}

PositionSelect is the builder for selecting fields of Position entities.

func (*PositionSelect) Aggregate

func (ps *PositionSelect) Aggregate(fns ...AggregateFunc) *PositionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PositionSelect) Bool

func (s *PositionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PositionSelect) BoolX

func (s *PositionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PositionSelect) Bools

func (s *PositionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PositionSelect) BoolsX

func (s *PositionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PositionSelect) Float64

func (s *PositionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PositionSelect) Float64X

func (s *PositionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PositionSelect) Float64s

func (s *PositionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PositionSelect) Float64sX

func (s *PositionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PositionSelect) Int

func (s *PositionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PositionSelect) IntX

func (s *PositionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PositionSelect) Ints

func (s *PositionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PositionSelect) IntsX

func (s *PositionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PositionSelect) Scan

func (ps *PositionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PositionSelect) ScanX

func (s *PositionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PositionSelect) String

func (s *PositionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PositionSelect) StringX

func (s *PositionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PositionSelect) Strings

func (s *PositionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PositionSelect) StringsX

func (s *PositionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PositionUpdate

type PositionUpdate struct {
	// contains filtered or unexported fields
}

PositionUpdate is the builder for updating Position entities.

func (*PositionUpdate) Exec

func (pu *PositionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PositionUpdate) ExecX

func (pu *PositionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionUpdate) Mutation

func (pu *PositionUpdate) Mutation() *PositionMutation

Mutation returns the PositionMutation object of the builder.

func (*PositionUpdate) Save

func (pu *PositionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PositionUpdate) SaveX

func (pu *PositionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PositionUpdate) Where

func (pu *PositionUpdate) Where(ps ...predicate.Position) *PositionUpdate

Where appends a list predicates to the PositionUpdate builder.

type PositionUpdateOne

type PositionUpdateOne struct {
	// contains filtered or unexported fields
}

PositionUpdateOne is the builder for updating a single Position entity.

func (*PositionUpdateOne) Exec

func (puo *PositionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PositionUpdateOne) ExecX

func (puo *PositionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionUpdateOne) Mutation

func (puo *PositionUpdateOne) Mutation() *PositionMutation

Mutation returns the PositionMutation object of the builder.

func (*PositionUpdateOne) Save

func (puo *PositionUpdateOne) Save(ctx context.Context) (*Position, error)

Save executes the query and returns the updated Position entity.

func (*PositionUpdateOne) SaveX

func (puo *PositionUpdateOne) SaveX(ctx context.Context) *Position

SaveX is like Save, but panics if an error occurs.

func (*PositionUpdateOne) Select

func (puo *PositionUpdateOne) Select(field string, fields ...string) *PositionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PositionUpdateOne) Where

Where appends a list predicates to the PositionUpdate builder.

type Positions

type Positions []*Position

Positions is a parsable slice of Position.

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 Role

type Role struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) String

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) Unwrap

func (r *Role) Unwrap() *Role

Unwrap unwraps the Role 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 (*Role) Update

func (r *Role) Update() *RoleUpdateOne

Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.

func (*Role) Value

func (r *Role) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Role. This includes values selected through modifiers, order, etc.

type RoleClient

type RoleClient struct {
	// contains filtered or unexported fields
}

RoleClient is a client for the Role schema.

func NewRoleClient

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create

func (c *RoleClient) Create() *RoleCreate

Create returns a builder for creating a Role entity.

func (*RoleClient) CreateBulk

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

CreateBulk returns a builder for creating a bulk of Role entities.

func (*RoleClient) Delete

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleClient) DeleteOneID

func (c *RoleClient) DeleteOneID(id int) *RoleDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id int) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id int) *Role

GetX is like Get, but panics if an error occurs.

func (*RoleClient) Hooks

func (c *RoleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoleClient) Intercept

func (c *RoleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`.

func (*RoleClient) Interceptors

func (c *RoleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RoleClient) MapCreateBulk

func (c *RoleClient) MapCreateBulk(slice any, setFunc func(*RoleCreate, int)) *RoleCreateBulk

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 (*RoleClient) Query

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) Update

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID

func (c *RoleClient) UpdateOneID(id int) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use

func (c *RoleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`.

type RoleCreate

type RoleCreate struct {
	// contains filtered or unexported fields
}

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) Exec

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecX

func (rc *RoleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreate) Mutation

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) Save

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

type RoleCreateBulk

type RoleCreateBulk struct {
	// contains filtered or unexported fields
}

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreateBulk) Save

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

SaveX is like Save, but panics if an error occurs.

type RoleDelete

type RoleDelete struct {
	// contains filtered or unexported fields
}

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoleDelete) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoleDelete) Where

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne

type RoleDeleteOne struct {
	// contains filtered or unexported fields
}

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleDeleteOne) Where

func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne

Where appends a list predicates to the RoleDelete builder.

type RoleGroupBy

type RoleGroupBy struct {
	// contains filtered or unexported fields
}

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoleGroupBy) Bool

func (s *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolX

func (s *RoleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleGroupBy) Bools

func (s *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolsX

func (s *RoleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleGroupBy) Float64

func (s *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64X

func (s *RoleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleGroupBy) Float64s

func (s *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64sX

func (s *RoleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleGroupBy) Int

func (s *RoleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntX

func (s *RoleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleGroupBy) Ints

func (s *RoleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntsX

func (s *RoleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleGroupBy) Scan

func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleGroupBy) ScanX

func (s *RoleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleGroupBy) String

func (s *RoleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringX

func (s *RoleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleGroupBy) Strings

func (s *RoleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringsX

func (s *RoleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleMutation

type RoleMutation struct {
	// contains filtered or unexported fields
}

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddField

func (m *RoleMutation) 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 (*RoleMutation) AddedEdges

func (m *RoleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoleMutation) AddedField

func (m *RoleMutation) 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 (*RoleMutation) AddedFields

func (m *RoleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoleMutation) AddedIDs

func (m *RoleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoleMutation) ClearEdge

func (m *RoleMutation) 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 (*RoleMutation) ClearField

func (m *RoleMutation) 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 (*RoleMutation) ClearedEdges

func (m *RoleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoleMutation) ClearedFields

func (m *RoleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoleMutation) Client

func (m RoleMutation) 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 (*RoleMutation) EdgeCleared

func (m *RoleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoleMutation) Field

func (m *RoleMutation) 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 (*RoleMutation) FieldCleared

func (m *RoleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoleMutation) Fields

func (m *RoleMutation) 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 (*RoleMutation) ID

func (m *RoleMutation) 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 (*RoleMutation) IDs

func (m *RoleMutation) 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 (*RoleMutation) OldField

func (m *RoleMutation) 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 (*RoleMutation) Op

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) RemovedEdges

func (m *RoleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoleMutation) RemovedIDs

func (m *RoleMutation) 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 (*RoleMutation) ResetEdge

func (m *RoleMutation) 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 (*RoleMutation) ResetField

func (m *RoleMutation) 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 (*RoleMutation) SetField

func (m *RoleMutation) 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 (*RoleMutation) SetOp

func (m *RoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (RoleMutation) Tx

func (m RoleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoleMutation) Type

func (m *RoleMutation) Type() string

Type returns the node type of this mutation (Role).

func (*RoleMutation) Where

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

func (*RoleMutation) WhereP

func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RoleQuery

type RoleQuery struct {
	// contains filtered or unexported fields
}

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) Aggregate

func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate returns a RoleSelect configured with the given aggregations.

func (*RoleQuery) All

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

AllX is like All, but panics if an error occurs.

func (*RoleQuery) Clone

func (rq *RoleQuery) Clone() *RoleQuery

Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoleQuery) Count

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX

func (rq *RoleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoleQuery) Exist

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoleQuery) ExistX

func (rq *RoleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoleQuery) First

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.

func (*RoleQuery) FirstID

func (rq *RoleQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.

func (*RoleQuery) FirstIDX

func (rq *RoleQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoleQuery) FirstX

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

FirstX is like First, but panics if an error occurs.

func (*RoleQuery) GroupBy

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*RoleQuery) IDs

func (rq *RoleQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Role IDs.

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RoleQuery) Limit

func (rq *RoleQuery) Limit(limit int) *RoleQuery

Limit the number of records to be returned by this query.

func (*RoleQuery) Offset

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset to start from.

func (*RoleQuery) Only

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.

func (*RoleQuery) OnlyID

func (rq *RoleQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.

func (*RoleQuery) OnlyIDX

func (rq *RoleQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoleQuery) OnlyX

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

OnlyX is like Only, but panics if an error occurs.

func (*RoleQuery) Order

func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery

Order specifies how the records should be ordered.

func (*RoleQuery) Select

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*RoleQuery) Unique

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

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 (*RoleQuery) Where

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

type RoleSelect

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Aggregate

func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleSelect) Bool

func (s *RoleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolX

func (s *RoleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleSelect) Bools

func (s *RoleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolsX

func (s *RoleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleSelect) Float64

func (s *RoleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64X

func (s *RoleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleSelect) Float64s

func (s *RoleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64sX

func (s *RoleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleSelect) Int

func (s *RoleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntX

func (s *RoleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleSelect) Ints

func (s *RoleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntsX

func (s *RoleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleSelect) Scan

func (rs *RoleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleSelect) ScanX

func (s *RoleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleSelect) String

func (s *RoleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringX

func (s *RoleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleSelect) Strings

func (s *RoleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringsX

func (s *RoleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleUpdate

type RoleUpdate struct {
	// contains filtered or unexported fields
}

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) Exec

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) Save

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoleUpdate) SaveX

func (ru *RoleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdate) Where

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne

type RoleUpdateOne struct {
	// contains filtered or unexported fields
}

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) Exec

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) Save

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdateOne) Select

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoleUpdateOne) Where

func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne

Where appends a list predicates to the RoleUpdate builder.

type Roles

type Roles []*Role

Roles is a parsable slice of Role.

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 Tel

type Tel struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Tel holds the value of the "tel" field.
	Tel string `json:"tel,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TelQuery when eager-loading is set.
	Edges TelEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tel is the model entity for the Tel schema.

func (*Tel) QueryCustomer

func (t *Tel) QueryCustomer() *CustomerQuery

QueryCustomer queries the "customer" edge of the Tel entity.

func (*Tel) QueryNote

func (t *Tel) QueryNote() *NoteQuery

QueryNote queries the "note" edge of the Tel entity.

func (*Tel) String

func (t *Tel) String() string

String implements the fmt.Stringer.

func (*Tel) Unwrap

func (t *Tel) Unwrap() *Tel

Unwrap unwraps the Tel 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 (*Tel) Update

func (t *Tel) Update() *TelUpdateOne

Update returns a builder for updating this Tel. Note that you need to call Tel.Unwrap() before calling this method if this Tel was returned from a transaction, and the transaction was committed or rolled back.

func (*Tel) Value

func (t *Tel) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Tel. This includes values selected through modifiers, order, etc.

type TelClient

type TelClient struct {
	// contains filtered or unexported fields
}

TelClient is a client for the Tel schema.

func NewTelClient

func NewTelClient(c config) *TelClient

NewTelClient returns a client for the Tel from the given config.

func (*TelClient) Create

func (c *TelClient) Create() *TelCreate

Create returns a builder for creating a Tel entity.

func (*TelClient) CreateBulk

func (c *TelClient) CreateBulk(builders ...*TelCreate) *TelCreateBulk

CreateBulk returns a builder for creating a bulk of Tel entities.

func (*TelClient) Delete

func (c *TelClient) Delete() *TelDelete

Delete returns a delete builder for Tel.

func (*TelClient) DeleteOne

func (c *TelClient) DeleteOne(t *Tel) *TelDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TelClient) DeleteOneID

func (c *TelClient) DeleteOneID(id int) *TelDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TelClient) Get

func (c *TelClient) Get(ctx context.Context, id int) (*Tel, error)

Get returns a Tel entity by its id.

func (*TelClient) GetX

func (c *TelClient) GetX(ctx context.Context, id int) *Tel

GetX is like Get, but panics if an error occurs.

func (*TelClient) Hooks

func (c *TelClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TelClient) Intercept

func (c *TelClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tel.Intercept(f(g(h())))`.

func (*TelClient) Interceptors

func (c *TelClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TelClient) MapCreateBulk

func (c *TelClient) MapCreateBulk(slice any, setFunc func(*TelCreate, int)) *TelCreateBulk

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 (*TelClient) Query

func (c *TelClient) Query() *TelQuery

Query returns a query builder for Tel.

func (*TelClient) QueryCustomer

func (c *TelClient) QueryCustomer(t *Tel) *CustomerQuery

QueryCustomer queries the customer edge of a Tel.

func (*TelClient) QueryNote

func (c *TelClient) QueryNote(t *Tel) *NoteQuery

QueryNote queries the note edge of a Tel.

func (*TelClient) Update

func (c *TelClient) Update() *TelUpdate

Update returns an update builder for Tel.

func (*TelClient) UpdateOne

func (c *TelClient) UpdateOne(t *Tel) *TelUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TelClient) UpdateOneID

func (c *TelClient) UpdateOneID(id int) *TelUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TelClient) Use

func (c *TelClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tel.Hooks(f(g(h())))`.

type TelCreate

type TelCreate struct {
	// contains filtered or unexported fields
}

TelCreate is the builder for creating a Tel entity.

func (*TelCreate) AddCustomer

func (tc *TelCreate) AddCustomer(c ...*Customer) *TelCreate

AddCustomer adds the "customer" edges to the Customer entity.

func (*TelCreate) AddCustomerIDs

func (tc *TelCreate) AddCustomerIDs(ids ...int) *TelCreate

AddCustomerIDs adds the "customer" edge to the Customer entity by IDs.

func (*TelCreate) Exec

func (tc *TelCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TelCreate) ExecX

func (tc *TelCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TelCreate) Mutation

func (tc *TelCreate) Mutation() *TelMutation

Mutation returns the TelMutation object of the builder.

func (*TelCreate) Save

func (tc *TelCreate) Save(ctx context.Context) (*Tel, error)

Save creates the Tel in the database.

func (*TelCreate) SaveX

func (tc *TelCreate) SaveX(ctx context.Context) *Tel

SaveX calls Save and panics if Save returns an error.

func (*TelCreate) SetCreatedAt

func (tc *TelCreate) SetCreatedAt(t time.Time) *TelCreate

SetCreatedAt sets the "created_at" field.

func (*TelCreate) SetNillableCreatedAt

func (tc *TelCreate) SetNillableCreatedAt(t *time.Time) *TelCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TelCreate) SetNillableNoteID

func (tc *TelCreate) SetNillableNoteID(id *int) *TelCreate

SetNillableNoteID sets the "note" edge to the Note entity by ID if the given value is not nil.

func (*TelCreate) SetNillableUpdatedAt

func (tc *TelCreate) SetNillableUpdatedAt(t *time.Time) *TelCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TelCreate) SetNote

func (tc *TelCreate) SetNote(n *Note) *TelCreate

SetNote sets the "note" edge to the Note entity.

func (*TelCreate) SetNoteID

func (tc *TelCreate) SetNoteID(id int) *TelCreate

SetNoteID sets the "note" edge to the Note entity by ID.

func (*TelCreate) SetTel

func (tc *TelCreate) SetTel(s string) *TelCreate

SetTel sets the "tel" field.

func (*TelCreate) SetUpdatedAt

func (tc *TelCreate) SetUpdatedAt(t time.Time) *TelCreate

SetUpdatedAt sets the "updated_at" field.

type TelCreateBulk

type TelCreateBulk struct {
	// contains filtered or unexported fields
}

TelCreateBulk is the builder for creating many Tel entities in bulk.

func (*TelCreateBulk) Exec

func (tcb *TelCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TelCreateBulk) ExecX

func (tcb *TelCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TelCreateBulk) Save

func (tcb *TelCreateBulk) Save(ctx context.Context) ([]*Tel, error)

Save creates the Tel entities in the database.

func (*TelCreateBulk) SaveX

func (tcb *TelCreateBulk) SaveX(ctx context.Context) []*Tel

SaveX is like Save, but panics if an error occurs.

type TelDelete

type TelDelete struct {
	// contains filtered or unexported fields
}

TelDelete is the builder for deleting a Tel entity.

func (*TelDelete) Exec

func (td *TelDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TelDelete) ExecX

func (td *TelDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TelDelete) Where

func (td *TelDelete) Where(ps ...predicate.Tel) *TelDelete

Where appends a list predicates to the TelDelete builder.

type TelDeleteOne

type TelDeleteOne struct {
	// contains filtered or unexported fields
}

TelDeleteOne is the builder for deleting a single Tel entity.

func (*TelDeleteOne) Exec

func (tdo *TelDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TelDeleteOne) ExecX

func (tdo *TelDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TelDeleteOne) Where

func (tdo *TelDeleteOne) Where(ps ...predicate.Tel) *TelDeleteOne

Where appends a list predicates to the TelDelete builder.

type TelEdges

type TelEdges struct {
	// Note holds the value of the note edge.
	Note *Note `json:"note,omitempty"`
	// Customer holds the value of the customer edge.
	Customer []*Customer `json:"customer,omitempty"`
	// contains filtered or unexported fields
}

TelEdges holds the relations/edges for other nodes in the graph.

func (TelEdges) CustomerOrErr

func (e TelEdges) CustomerOrErr() ([]*Customer, error)

CustomerOrErr returns the Customer value or an error if the edge was not loaded in eager-loading.

func (TelEdges) NoteOrErr

func (e TelEdges) NoteOrErr() (*Note, error)

NoteOrErr returns the Note value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TelGroupBy

type TelGroupBy struct {
	// contains filtered or unexported fields
}

TelGroupBy is the group-by builder for Tel entities.

func (*TelGroupBy) Aggregate

func (tgb *TelGroupBy) Aggregate(fns ...AggregateFunc) *TelGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TelGroupBy) Bool

func (s *TelGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) BoolX

func (s *TelGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TelGroupBy) Bools

func (s *TelGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) BoolsX

func (s *TelGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TelGroupBy) Float64

func (s *TelGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) Float64X

func (s *TelGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TelGroupBy) Float64s

func (s *TelGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) Float64sX

func (s *TelGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TelGroupBy) Int

func (s *TelGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) IntX

func (s *TelGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TelGroupBy) Ints

func (s *TelGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) IntsX

func (s *TelGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TelGroupBy) Scan

func (tgb *TelGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TelGroupBy) ScanX

func (s *TelGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TelGroupBy) String

func (s *TelGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) StringX

func (s *TelGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TelGroupBy) Strings

func (s *TelGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TelGroupBy) StringsX

func (s *TelGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TelMutation

type TelMutation struct {
	// contains filtered or unexported fields
}

TelMutation represents an operation that mutates the Tel nodes in the graph.

func (*TelMutation) AddCustomerIDs

func (m *TelMutation) AddCustomerIDs(ids ...int)

AddCustomerIDs adds the "customer" edge to the Customer entity by ids.

func (*TelMutation) AddField

func (m *TelMutation) 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 (*TelMutation) AddedEdges

func (m *TelMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TelMutation) AddedField

func (m *TelMutation) 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 (*TelMutation) AddedFields

func (m *TelMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TelMutation) AddedIDs

func (m *TelMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TelMutation) ClearCustomer

func (m *TelMutation) ClearCustomer()

ClearCustomer clears the "customer" edge to the Customer entity.

func (*TelMutation) ClearEdge

func (m *TelMutation) 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 (*TelMutation) ClearField

func (m *TelMutation) 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 (*TelMutation) ClearNote

func (m *TelMutation) ClearNote()

ClearNote clears the "note" edge to the Note entity.

func (*TelMutation) ClearedEdges

func (m *TelMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TelMutation) ClearedFields

func (m *TelMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TelMutation) Client

func (m TelMutation) 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 (*TelMutation) CreatedAt

func (m *TelMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TelMutation) CustomerCleared

func (m *TelMutation) CustomerCleared() bool

CustomerCleared reports if the "customer" edge to the Customer entity was cleared.

func (*TelMutation) CustomerIDs

func (m *TelMutation) CustomerIDs() (ids []int)

CustomerIDs returns the "customer" edge IDs in the mutation.

func (*TelMutation) EdgeCleared

func (m *TelMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TelMutation) Field

func (m *TelMutation) 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 (*TelMutation) FieldCleared

func (m *TelMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TelMutation) Fields

func (m *TelMutation) 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 (*TelMutation) ID

func (m *TelMutation) 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 (*TelMutation) IDs

func (m *TelMutation) 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 (*TelMutation) NoteCleared

func (m *TelMutation) NoteCleared() bool

NoteCleared reports if the "note" edge to the Note entity was cleared.

func (*TelMutation) NoteID

func (m *TelMutation) NoteID() (id int, exists bool)

NoteID returns the "note" edge ID in the mutation.

func (*TelMutation) NoteIDs

func (m *TelMutation) NoteIDs() (ids []int)

NoteIDs returns the "note" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use NoteID instead. It exists only for internal usage by the builders.

func (*TelMutation) OldCreatedAt

func (m *TelMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Tel entity. If the Tel 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 (*TelMutation) OldField

func (m *TelMutation) 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 (*TelMutation) OldTel

func (m *TelMutation) OldTel(ctx context.Context) (v string, err error)

OldTel returns the old "tel" field's value of the Tel entity. If the Tel 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 (*TelMutation) OldUpdatedAt

func (m *TelMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Tel entity. If the Tel 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 (*TelMutation) Op

func (m *TelMutation) Op() Op

Op returns the operation name.

func (*TelMutation) RemoveCustomerIDs

func (m *TelMutation) RemoveCustomerIDs(ids ...int)

RemoveCustomerIDs removes the "customer" edge to the Customer entity by IDs.

func (*TelMutation) RemovedCustomerIDs

func (m *TelMutation) RemovedCustomerIDs() (ids []int)

RemovedCustomer returns the removed IDs of the "customer" edge to the Customer entity.

func (*TelMutation) RemovedEdges

func (m *TelMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TelMutation) RemovedIDs

func (m *TelMutation) 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 (*TelMutation) ResetCreatedAt

func (m *TelMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TelMutation) ResetCustomer

func (m *TelMutation) ResetCustomer()

ResetCustomer resets all changes to the "customer" edge.

func (*TelMutation) ResetEdge

func (m *TelMutation) 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 (*TelMutation) ResetField

func (m *TelMutation) 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 (*TelMutation) ResetNote

func (m *TelMutation) ResetNote()

ResetNote resets all changes to the "note" edge.

func (*TelMutation) ResetTel

func (m *TelMutation) ResetTel()

ResetTel resets all changes to the "tel" field.

func (*TelMutation) ResetUpdatedAt

func (m *TelMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TelMutation) SetCreatedAt

func (m *TelMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TelMutation) SetField

func (m *TelMutation) 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 (*TelMutation) SetNoteID

func (m *TelMutation) SetNoteID(id int)

SetNoteID sets the "note" edge to the Note entity by id.

func (*TelMutation) SetOp

func (m *TelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TelMutation) SetTel

func (m *TelMutation) SetTel(s string)

SetTel sets the "tel" field.

func (*TelMutation) SetUpdatedAt

func (m *TelMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TelMutation) Tel

func (m *TelMutation) Tel() (r string, exists bool)

Tel returns the value of the "tel" field in the mutation.

func (TelMutation) Tx

func (m TelMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TelMutation) Type

func (m *TelMutation) Type() string

Type returns the node type of this mutation (Tel).

func (*TelMutation) UpdatedAt

func (m *TelMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TelMutation) Where

func (m *TelMutation) Where(ps ...predicate.Tel)

Where appends a list predicates to the TelMutation builder.

func (*TelMutation) WhereP

func (m *TelMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TelQuery

type TelQuery struct {
	// contains filtered or unexported fields
}

TelQuery is the builder for querying Tel entities.

func (*TelQuery) Aggregate

func (tq *TelQuery) Aggregate(fns ...AggregateFunc) *TelSelect

Aggregate returns a TelSelect configured with the given aggregations.

func (*TelQuery) All

func (tq *TelQuery) All(ctx context.Context) ([]*Tel, error)

All executes the query and returns a list of Tels.

func (*TelQuery) AllX

func (tq *TelQuery) AllX(ctx context.Context) []*Tel

AllX is like All, but panics if an error occurs.

func (*TelQuery) Clone

func (tq *TelQuery) Clone() *TelQuery

Clone returns a duplicate of the TelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TelQuery) Count

func (tq *TelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TelQuery) CountX

func (tq *TelQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TelQuery) Exist

func (tq *TelQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TelQuery) ExistX

func (tq *TelQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TelQuery) First

func (tq *TelQuery) First(ctx context.Context) (*Tel, error)

First returns the first Tel entity from the query. Returns a *NotFoundError when no Tel was found.

func (*TelQuery) FirstID

func (tq *TelQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tel ID from the query. Returns a *NotFoundError when no Tel ID was found.

func (*TelQuery) FirstIDX

func (tq *TelQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TelQuery) FirstX

func (tq *TelQuery) FirstX(ctx context.Context) *Tel

FirstX is like First, but panics if an error occurs.

func (*TelQuery) GroupBy

func (tq *TelQuery) GroupBy(field string, fields ...string) *TelGroupBy

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 {
	Tel string `json:"tel,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Tel.Query().
	GroupBy(tel.FieldTel).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TelQuery) IDs

func (tq *TelQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tel IDs.

func (*TelQuery) IDsX

func (tq *TelQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TelQuery) Limit

func (tq *TelQuery) Limit(limit int) *TelQuery

Limit the number of records to be returned by this query.

func (*TelQuery) Offset

func (tq *TelQuery) Offset(offset int) *TelQuery

Offset to start from.

func (*TelQuery) Only

func (tq *TelQuery) Only(ctx context.Context) (*Tel, error)

Only returns a single Tel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tel entity is found. Returns a *NotFoundError when no Tel entities are found.

func (*TelQuery) OnlyID

func (tq *TelQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Tel ID in the query. Returns a *NotSingularError when more than one Tel ID is found. Returns a *NotFoundError when no entities are found.

func (*TelQuery) OnlyIDX

func (tq *TelQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TelQuery) OnlyX

func (tq *TelQuery) OnlyX(ctx context.Context) *Tel

OnlyX is like Only, but panics if an error occurs.

func (*TelQuery) Order

func (tq *TelQuery) Order(o ...tel.OrderOption) *TelQuery

Order specifies how the records should be ordered.

func (*TelQuery) QueryCustomer

func (tq *TelQuery) QueryCustomer() *CustomerQuery

QueryCustomer chains the current query on the "customer" edge.

func (*TelQuery) QueryNote

func (tq *TelQuery) QueryNote() *NoteQuery

QueryNote chains the current query on the "note" edge.

func (*TelQuery) Select

func (tq *TelQuery) Select(fields ...string) *TelSelect

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 {
	Tel string `json:"tel,omitempty"`
}

client.Tel.Query().
	Select(tel.FieldTel).
	Scan(ctx, &v)

func (*TelQuery) Unique

func (tq *TelQuery) Unique(unique bool) *TelQuery

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 (*TelQuery) Where

func (tq *TelQuery) Where(ps ...predicate.Tel) *TelQuery

Where adds a new predicate for the TelQuery builder.

func (*TelQuery) WithCustomer

func (tq *TelQuery) WithCustomer(opts ...func(*CustomerQuery)) *TelQuery

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 (*TelQuery) WithNote

func (tq *TelQuery) WithNote(opts ...func(*NoteQuery)) *TelQuery

WithNote tells the query-builder to eager-load the nodes that are connected to the "note" edge. The optional arguments are used to configure the query builder of the edge.

type TelSelect

type TelSelect struct {
	*TelQuery
	// contains filtered or unexported fields
}

TelSelect is the builder for selecting fields of Tel entities.

func (*TelSelect) Aggregate

func (ts *TelSelect) Aggregate(fns ...AggregateFunc) *TelSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TelSelect) Bool

func (s *TelSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TelSelect) BoolX

func (s *TelSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TelSelect) Bools

func (s *TelSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TelSelect) BoolsX

func (s *TelSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TelSelect) Float64

func (s *TelSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TelSelect) Float64X

func (s *TelSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TelSelect) Float64s

func (s *TelSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TelSelect) Float64sX

func (s *TelSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TelSelect) Int

func (s *TelSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TelSelect) IntX

func (s *TelSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TelSelect) Ints

func (s *TelSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TelSelect) IntsX

func (s *TelSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TelSelect) Scan

func (ts *TelSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TelSelect) ScanX

func (s *TelSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TelSelect) String

func (s *TelSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TelSelect) StringX

func (s *TelSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TelSelect) Strings

func (s *TelSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TelSelect) StringsX

func (s *TelSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TelUpdate

type TelUpdate struct {
	// contains filtered or unexported fields
}

TelUpdate is the builder for updating Tel entities.

func (*TelUpdate) AddCustomer

func (tu *TelUpdate) AddCustomer(c ...*Customer) *TelUpdate

AddCustomer adds the "customer" edges to the Customer entity.

func (*TelUpdate) AddCustomerIDs

func (tu *TelUpdate) AddCustomerIDs(ids ...int) *TelUpdate

AddCustomerIDs adds the "customer" edge to the Customer entity by IDs.

func (*TelUpdate) ClearCustomer

func (tu *TelUpdate) ClearCustomer() *TelUpdate

ClearCustomer clears all "customer" edges to the Customer entity.

func (*TelUpdate) ClearNote

func (tu *TelUpdate) ClearNote() *TelUpdate

ClearNote clears the "note" edge to the Note entity.

func (*TelUpdate) Exec

func (tu *TelUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TelUpdate) ExecX

func (tu *TelUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TelUpdate) Mutation

func (tu *TelUpdate) Mutation() *TelMutation

Mutation returns the TelMutation object of the builder.

func (*TelUpdate) RemoveCustomer

func (tu *TelUpdate) RemoveCustomer(c ...*Customer) *TelUpdate

RemoveCustomer removes "customer" edges to Customer entities.

func (*TelUpdate) RemoveCustomerIDs

func (tu *TelUpdate) RemoveCustomerIDs(ids ...int) *TelUpdate

RemoveCustomerIDs removes the "customer" edge to Customer entities by IDs.

func (*TelUpdate) Save

func (tu *TelUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TelUpdate) SaveX

func (tu *TelUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TelUpdate) SetNillableNoteID

func (tu *TelUpdate) SetNillableNoteID(id *int) *TelUpdate

SetNillableNoteID sets the "note" edge to the Note entity by ID if the given value is not nil.

func (*TelUpdate) SetNillableTel

func (tu *TelUpdate) SetNillableTel(s *string) *TelUpdate

SetNillableTel sets the "tel" field if the given value is not nil.

func (*TelUpdate) SetNote

func (tu *TelUpdate) SetNote(n *Note) *TelUpdate

SetNote sets the "note" edge to the Note entity.

func (*TelUpdate) SetNoteID

func (tu *TelUpdate) SetNoteID(id int) *TelUpdate

SetNoteID sets the "note" edge to the Note entity by ID.

func (*TelUpdate) SetTel

func (tu *TelUpdate) SetTel(s string) *TelUpdate

SetTel sets the "tel" field.

func (*TelUpdate) SetUpdatedAt

func (tu *TelUpdate) SetUpdatedAt(t time.Time) *TelUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TelUpdate) Where

func (tu *TelUpdate) Where(ps ...predicate.Tel) *TelUpdate

Where appends a list predicates to the TelUpdate builder.

type TelUpdateOne

type TelUpdateOne struct {
	// contains filtered or unexported fields
}

TelUpdateOne is the builder for updating a single Tel entity.

func (*TelUpdateOne) AddCustomer

func (tuo *TelUpdateOne) AddCustomer(c ...*Customer) *TelUpdateOne

AddCustomer adds the "customer" edges to the Customer entity.

func (*TelUpdateOne) AddCustomerIDs

func (tuo *TelUpdateOne) AddCustomerIDs(ids ...int) *TelUpdateOne

AddCustomerIDs adds the "customer" edge to the Customer entity by IDs.

func (*TelUpdateOne) ClearCustomer

func (tuo *TelUpdateOne) ClearCustomer() *TelUpdateOne

ClearCustomer clears all "customer" edges to the Customer entity.

func (*TelUpdateOne) ClearNote

func (tuo *TelUpdateOne) ClearNote() *TelUpdateOne

ClearNote clears the "note" edge to the Note entity.

func (*TelUpdateOne) Exec

func (tuo *TelUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TelUpdateOne) ExecX

func (tuo *TelUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TelUpdateOne) Mutation

func (tuo *TelUpdateOne) Mutation() *TelMutation

Mutation returns the TelMutation object of the builder.

func (*TelUpdateOne) RemoveCustomer

func (tuo *TelUpdateOne) RemoveCustomer(c ...*Customer) *TelUpdateOne

RemoveCustomer removes "customer" edges to Customer entities.

func (*TelUpdateOne) RemoveCustomerIDs

func (tuo *TelUpdateOne) RemoveCustomerIDs(ids ...int) *TelUpdateOne

RemoveCustomerIDs removes the "customer" edge to Customer entities by IDs.

func (*TelUpdateOne) Save

func (tuo *TelUpdateOne) Save(ctx context.Context) (*Tel, error)

Save executes the query and returns the updated Tel entity.

func (*TelUpdateOne) SaveX

func (tuo *TelUpdateOne) SaveX(ctx context.Context) *Tel

SaveX is like Save, but panics if an error occurs.

func (*TelUpdateOne) Select

func (tuo *TelUpdateOne) Select(field string, fields ...string) *TelUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TelUpdateOne) SetNillableNoteID

func (tuo *TelUpdateOne) SetNillableNoteID(id *int) *TelUpdateOne

SetNillableNoteID sets the "note" edge to the Note entity by ID if the given value is not nil.

func (*TelUpdateOne) SetNillableTel

func (tuo *TelUpdateOne) SetNillableTel(s *string) *TelUpdateOne

SetNillableTel sets the "tel" field if the given value is not nil.

func (*TelUpdateOne) SetNote

func (tuo *TelUpdateOne) SetNote(n *Note) *TelUpdateOne

SetNote sets the "note" edge to the Note entity.

func (*TelUpdateOne) SetNoteID

func (tuo *TelUpdateOne) SetNoteID(id int) *TelUpdateOne

SetNoteID sets the "note" edge to the Note entity by ID.

func (*TelUpdateOne) SetTel

func (tuo *TelUpdateOne) SetTel(s string) *TelUpdateOne

SetTel sets the "tel" field.

func (*TelUpdateOne) SetUpdatedAt

func (tuo *TelUpdateOne) SetUpdatedAt(t time.Time) *TelUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TelUpdateOne) Where

func (tuo *TelUpdateOne) Where(ps ...predicate.Tel) *TelUpdateOne

Where appends a list predicates to the TelUpdate builder.

type Tels

type Tels []*Tel

Tels is a parsable slice of Tel.

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 {

	// BillingAddress is the client for interacting with the BillingAddress builders.
	BillingAddress *BillingAddressClient
	// Customer is the client for interacting with the Customer builders.
	Customer *CustomerClient
	// DeliveryAddress is the client for interacting with the DeliveryAddress builders.
	DeliveryAddress *DeliveryAddressClient
	// Login is the client for interacting with the Login builders.
	Login *LoginClient
	// Note is the client for interacting with the Note builders.
	Note *NoteClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// Position is the client for interacting with the Position builders.
	Position *PositionClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Tel is the client for interacting with the Tel builders.
	Tel *TelClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// LastLogin holds the value of the "last_login" field.
	LastLogin time.Time `json:"last_login,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"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetLastLogin

func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate

SetLastLogin sets the "last_login" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) LastLogin

func (m *UserMutation) LastLogin() (r time.Time, exists bool)

LastLogin returns the value of the "last_login" field in the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldLastLogin

func (m *UserMutation) OldLastLogin(ctx context.Context) (v time.Time, err error)

OldLastLogin returns the old "last_login" field's value of the User entity. If the User 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 (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User 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 (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User 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 (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetLastLogin

func (m *UserMutation) ResetLastLogin()

ResetLastLogin resets all changes to the "last_login" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetLastLogin

func (m *UserMutation) SetLastLogin(t time.Time)

SetLastLogin sets the "last_login" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.User.Query().
	Select(user.FieldName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetLastLogin

func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate

SetLastLogin sets the "last_login" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableLastLogin

func (uu *UserUpdate) SetNillableLastLogin(t *time.Time) *UserUpdate

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetLastLogin

func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne

SetLastLogin sets the "last_login" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableLastLogin

func (uuo *UserUpdateOne) SetNillableLastLogin(t *time.Time) *UserUpdateOne

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL