ent

package
v0.0.0-...-116c032 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 23 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.
	TypeMerchant        = "Merchant"
	TypeMerchantAccount = "MerchantAccount"
	TypePlatformAccount = "PlatformAccount"
	TypeUser            = "User"
	TypeUserLoginMethod = "UserLoginMethod"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Merchant is the client for interacting with the Merchant builders.
	Merchant *MerchantClient
	// MerchantAccount is the client for interacting with the MerchantAccount builders.
	MerchantAccount *MerchantAccountClient
	// PlatformAccount is the client for interacting with the PlatformAccount builders.
	PlatformAccount *PlatformAccountClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserLoginMethod is the client for interacting with the UserLoginMethod builders.
	UserLoginMethod *UserLoginMethodClient
	// 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().
	Merchant.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type Merchant

type Merchant struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// MerchantName holds the value of the "merchant_name" field.
	MerchantName string `json:"merchant_name,omitempty"`
	// ContactPerson holds the value of the "contact_person" field.
	ContactPerson string `json:"contact_person,omitempty"`
	// ContactPhone holds the value of the "contact_phone" field.
	ContactPhone string `json:"contact_phone,omitempty"`
	// Country holds the value of the "country" field.
	Country string `json:"country,omitempty"`
	// Province holds the value of the "province" field.
	Province string `json:"province,omitempty"`
	// City holds the value of the "city" field.
	City string `json:"city,omitempty"`
	// District holds the value of the "district" field.
	District string `json:"district,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MerchantQuery when eager-loading is set.
	Edges MerchantEdges `json:"edges"`
	// contains filtered or unexported fields
}

Merchant is the model entity for the Merchant schema.

func (*Merchant) QueryAccounts

func (m *Merchant) QueryAccounts() *MerchantAccountQuery

QueryAccounts queries the "accounts" edge of the Merchant entity.

func (*Merchant) String

func (m *Merchant) String() string

String implements the fmt.Stringer.

func (*Merchant) Unwrap

func (m *Merchant) Unwrap() *Merchant

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

func (m *Merchant) Update() *MerchantUpdateOne

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

func (*Merchant) Value

func (m *Merchant) Value(name string) (ent.Value, error)

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

type MerchantAccount

type MerchantAccount struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,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"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// IsMainAccount holds the value of the "is_main_account" field.
	IsMainAccount bool `json:"is_main_account,omitempty"`
	// contains filtered or unexported fields
}

MerchantAccount is the model entity for the MerchantAccount schema.

func (*MerchantAccount) String

func (ma *MerchantAccount) String() string

String implements the fmt.Stringer.

func (*MerchantAccount) Unwrap

func (ma *MerchantAccount) Unwrap() *MerchantAccount

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

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

func (*MerchantAccount) Value

func (ma *MerchantAccount) Value(name string) (ent.Value, error)

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

type MerchantAccountClient

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

MerchantAccountClient is a client for the MerchantAccount schema.

func NewMerchantAccountClient

func NewMerchantAccountClient(c config) *MerchantAccountClient

NewMerchantAccountClient returns a client for the MerchantAccount from the given config.

func (*MerchantAccountClient) Create

Create returns a builder for creating a MerchantAccount entity.

func (*MerchantAccountClient) CreateBulk

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

func (*MerchantAccountClient) Delete

Delete returns a delete builder for MerchantAccount.

func (*MerchantAccountClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MerchantAccountClient) DeleteOneID

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

func (*MerchantAccountClient) Get

Get returns a MerchantAccount entity by its id.

func (*MerchantAccountClient) GetX

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

func (*MerchantAccountClient) Hooks

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

Hooks returns the client hooks.

func (*MerchantAccountClient) Intercept

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

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

func (*MerchantAccountClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MerchantAccountClient) MapCreateBulk

func (c *MerchantAccountClient) MapCreateBulk(slice any, setFunc func(*MerchantAccountCreate, int)) *MerchantAccountCreateBulk

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

Query returns a query builder for MerchantAccount.

func (*MerchantAccountClient) Update

Update returns an update builder for MerchantAccount.

func (*MerchantAccountClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MerchantAccountClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MerchantAccountClient) Use

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

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

type MerchantAccountCreate

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

MerchantAccountCreate is the builder for creating a MerchantAccount entity.

func (*MerchantAccountCreate) Exec

func (mac *MerchantAccountCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MerchantAccountCreate) ExecX

func (mac *MerchantAccountCreate) ExecX(ctx context.Context)

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

func (*MerchantAccountCreate) Mutation

Mutation returns the MerchantAccountMutation object of the builder.

func (*MerchantAccountCreate) Save

Save creates the MerchantAccount in the database.

func (*MerchantAccountCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MerchantAccountCreate) SetCreatedAt

func (mac *MerchantAccountCreate) SetCreatedAt(t time.Time) *MerchantAccountCreate

SetCreatedAt sets the "created_at" field.

func (*MerchantAccountCreate) SetDeletedAt

func (mac *MerchantAccountCreate) SetDeletedAt(t time.Time) *MerchantAccountCreate

SetDeletedAt sets the "deleted_at" field.

func (*MerchantAccountCreate) SetEmail

SetEmail sets the "email" field.

func (*MerchantAccountCreate) SetID

SetID sets the "id" field.

func (*MerchantAccountCreate) SetIsMainAccount

func (mac *MerchantAccountCreate) SetIsMainAccount(b bool) *MerchantAccountCreate

SetIsMainAccount sets the "is_main_account" field.

func (*MerchantAccountCreate) SetNillableCreatedAt

func (mac *MerchantAccountCreate) SetNillableCreatedAt(t *time.Time) *MerchantAccountCreate

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

func (*MerchantAccountCreate) SetNillableDeletedAt

func (mac *MerchantAccountCreate) SetNillableDeletedAt(t *time.Time) *MerchantAccountCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MerchantAccountCreate) SetNillableEmail

func (mac *MerchantAccountCreate) SetNillableEmail(s *string) *MerchantAccountCreate

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

func (*MerchantAccountCreate) SetNillableID

func (mac *MerchantAccountCreate) SetNillableID(u *uint64) *MerchantAccountCreate

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

func (*MerchantAccountCreate) SetNillableIsMainAccount

func (mac *MerchantAccountCreate) SetNillableIsMainAccount(b *bool) *MerchantAccountCreate

SetNillableIsMainAccount sets the "is_main_account" field if the given value is not nil.

func (*MerchantAccountCreate) SetNillablePhone

func (mac *MerchantAccountCreate) SetNillablePhone(s *string) *MerchantAccountCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*MerchantAccountCreate) SetNillableUpdatedAt

func (mac *MerchantAccountCreate) SetNillableUpdatedAt(t *time.Time) *MerchantAccountCreate

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

func (*MerchantAccountCreate) SetPassword

func (mac *MerchantAccountCreate) SetPassword(s string) *MerchantAccountCreate

SetPassword sets the "password" field.

func (*MerchantAccountCreate) SetPhone

SetPhone sets the "phone" field.

func (*MerchantAccountCreate) SetUpdatedAt

func (mac *MerchantAccountCreate) SetUpdatedAt(t time.Time) *MerchantAccountCreate

SetUpdatedAt sets the "updated_at" field.

func (*MerchantAccountCreate) SetUsername

func (mac *MerchantAccountCreate) SetUsername(s string) *MerchantAccountCreate

SetUsername sets the "username" field.

type MerchantAccountCreateBulk

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

MerchantAccountCreateBulk is the builder for creating many MerchantAccount entities in bulk.

func (*MerchantAccountCreateBulk) Exec

Exec executes the query.

func (*MerchantAccountCreateBulk) ExecX

func (macb *MerchantAccountCreateBulk) ExecX(ctx context.Context)

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

func (*MerchantAccountCreateBulk) Save

Save creates the MerchantAccount entities in the database.

func (*MerchantAccountCreateBulk) SaveX

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

type MerchantAccountDelete

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

MerchantAccountDelete is the builder for deleting a MerchantAccount entity.

func (*MerchantAccountDelete) Exec

func (mad *MerchantAccountDelete) Exec(ctx context.Context) (int, error)

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

func (*MerchantAccountDelete) ExecX

func (mad *MerchantAccountDelete) ExecX(ctx context.Context) int

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

func (*MerchantAccountDelete) Where

Where appends a list predicates to the MerchantAccountDelete builder.

type MerchantAccountDeleteOne

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

MerchantAccountDeleteOne is the builder for deleting a single MerchantAccount entity.

func (*MerchantAccountDeleteOne) Exec

Exec executes the deletion query.

func (*MerchantAccountDeleteOne) ExecX

func (mado *MerchantAccountDeleteOne) ExecX(ctx context.Context)

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

func (*MerchantAccountDeleteOne) Where

Where appends a list predicates to the MerchantAccountDelete builder.

type MerchantAccountGroupBy

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

MerchantAccountGroupBy is the group-by builder for MerchantAccount entities.

func (*MerchantAccountGroupBy) Aggregate

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

func (*MerchantAccountGroupBy) Bool

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

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

func (*MerchantAccountGroupBy) BoolX

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

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

func (*MerchantAccountGroupBy) Bools

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

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

func (*MerchantAccountGroupBy) BoolsX

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

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

func (*MerchantAccountGroupBy) Float64

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

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

func (*MerchantAccountGroupBy) Float64X

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

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

func (*MerchantAccountGroupBy) Float64s

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

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

func (*MerchantAccountGroupBy) Float64sX

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

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

func (*MerchantAccountGroupBy) Int

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

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

func (*MerchantAccountGroupBy) IntX

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

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

func (*MerchantAccountGroupBy) Ints

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

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

func (*MerchantAccountGroupBy) IntsX

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

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

func (*MerchantAccountGroupBy) Scan

func (magb *MerchantAccountGroupBy) Scan(ctx context.Context, v any) error

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

func (*MerchantAccountGroupBy) ScanX

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

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

func (*MerchantAccountGroupBy) String

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

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

func (*MerchantAccountGroupBy) StringX

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

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

func (*MerchantAccountGroupBy) Strings

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

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

func (*MerchantAccountGroupBy) StringsX

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

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

type MerchantAccountMutation

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

MerchantAccountMutation represents an operation that mutates the MerchantAccount nodes in the graph.

func (*MerchantAccountMutation) AddField

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

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

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

func (*MerchantAccountMutation) AddedField

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

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

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

func (*MerchantAccountMutation) AddedIDs

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

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

func (*MerchantAccountMutation) ClearDeletedAt

func (m *MerchantAccountMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MerchantAccountMutation) ClearEdge

func (m *MerchantAccountMutation) 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 (*MerchantAccountMutation) ClearEmail

func (m *MerchantAccountMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*MerchantAccountMutation) ClearField

func (m *MerchantAccountMutation) 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 (*MerchantAccountMutation) ClearPhone

func (m *MerchantAccountMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*MerchantAccountMutation) ClearedEdges

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

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

func (*MerchantAccountMutation) ClearedFields

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

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

func (MerchantAccountMutation) Client

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

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

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

func (*MerchantAccountMutation) DeletedAt

func (m *MerchantAccountMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*MerchantAccountMutation) DeletedAtCleared

func (m *MerchantAccountMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*MerchantAccountMutation) EdgeCleared

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

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

func (*MerchantAccountMutation) Email

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

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

func (*MerchantAccountMutation) EmailCleared

func (m *MerchantAccountMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*MerchantAccountMutation) Field

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

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

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

func (*MerchantAccountMutation) Fields

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

func (m *MerchantAccountMutation) ID() (id uint64, 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 (*MerchantAccountMutation) IDs

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

func (*MerchantAccountMutation) IsMainAccount

func (m *MerchantAccountMutation) IsMainAccount() (r bool, exists bool)

IsMainAccount returns the value of the "is_main_account" field in the mutation.

func (*MerchantAccountMutation) OldCreatedAt

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

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

func (m *MerchantAccountMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the MerchantAccount entity. If the MerchantAccount 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 (*MerchantAccountMutation) OldEmail

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

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

func (m *MerchantAccountMutation) 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 (*MerchantAccountMutation) OldIsMainAccount

func (m *MerchantAccountMutation) OldIsMainAccount(ctx context.Context) (v bool, err error)

OldIsMainAccount returns the old "is_main_account" field's value of the MerchantAccount entity. If the MerchantAccount 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 (*MerchantAccountMutation) OldPassword

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

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

func (m *MerchantAccountMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the MerchantAccount entity. If the MerchantAccount 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 (*MerchantAccountMutation) OldUpdatedAt

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

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

func (m *MerchantAccountMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the MerchantAccount entity. If the MerchantAccount 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 (*MerchantAccountMutation) Op

func (m *MerchantAccountMutation) Op() Op

Op returns the operation name.

func (*MerchantAccountMutation) Password

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

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

func (*MerchantAccountMutation) Phone

func (m *MerchantAccountMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*MerchantAccountMutation) PhoneCleared

func (m *MerchantAccountMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*MerchantAccountMutation) RemovedEdges

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

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

func (*MerchantAccountMutation) RemovedIDs

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

func (m *MerchantAccountMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MerchantAccountMutation) ResetDeletedAt

func (m *MerchantAccountMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*MerchantAccountMutation) ResetEdge

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

func (m *MerchantAccountMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*MerchantAccountMutation) ResetField

func (m *MerchantAccountMutation) 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 (*MerchantAccountMutation) ResetIsMainAccount

func (m *MerchantAccountMutation) ResetIsMainAccount()

ResetIsMainAccount resets all changes to the "is_main_account" field.

func (*MerchantAccountMutation) ResetPassword

func (m *MerchantAccountMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*MerchantAccountMutation) ResetPhone

func (m *MerchantAccountMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*MerchantAccountMutation) ResetUpdatedAt

func (m *MerchantAccountMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MerchantAccountMutation) ResetUsername

func (m *MerchantAccountMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*MerchantAccountMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MerchantAccountMutation) SetDeletedAt

func (m *MerchantAccountMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*MerchantAccountMutation) SetEmail

func (m *MerchantAccountMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*MerchantAccountMutation) SetField

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

func (m *MerchantAccountMutation) SetID(id uint64)

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

func (*MerchantAccountMutation) SetIsMainAccount

func (m *MerchantAccountMutation) SetIsMainAccount(b bool)

SetIsMainAccount sets the "is_main_account" field.

func (*MerchantAccountMutation) SetOp

func (m *MerchantAccountMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MerchantAccountMutation) SetPassword

func (m *MerchantAccountMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*MerchantAccountMutation) SetPhone

func (m *MerchantAccountMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*MerchantAccountMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*MerchantAccountMutation) SetUsername

func (m *MerchantAccountMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (MerchantAccountMutation) Tx

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

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

func (*MerchantAccountMutation) Type

func (m *MerchantAccountMutation) Type() string

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

func (*MerchantAccountMutation) UpdatedAt

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

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

func (*MerchantAccountMutation) Username

func (m *MerchantAccountMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*MerchantAccountMutation) Where

Where appends a list predicates to the MerchantAccountMutation builder.

func (*MerchantAccountMutation) WhereP

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

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

type MerchantAccountQuery

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

MerchantAccountQuery is the builder for querying MerchantAccount entities.

func (*MerchantAccountQuery) Aggregate

Aggregate returns a MerchantAccountSelect configured with the given aggregations.

func (*MerchantAccountQuery) All

All executes the query and returns a list of MerchantAccounts.

func (*MerchantAccountQuery) AllX

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

func (*MerchantAccountQuery) Clone

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

func (*MerchantAccountQuery) Count

func (maq *MerchantAccountQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MerchantAccountQuery) CountX

func (maq *MerchantAccountQuery) CountX(ctx context.Context) int

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

func (*MerchantAccountQuery) Exist

func (maq *MerchantAccountQuery) Exist(ctx context.Context) (bool, error)

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

func (*MerchantAccountQuery) ExistX

func (maq *MerchantAccountQuery) ExistX(ctx context.Context) bool

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

func (*MerchantAccountQuery) First

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

func (*MerchantAccountQuery) FirstID

func (maq *MerchantAccountQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*MerchantAccountQuery) FirstIDX

func (maq *MerchantAccountQuery) FirstIDX(ctx context.Context) uint64

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

func (*MerchantAccountQuery) FirstX

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

func (*MerchantAccountQuery) GroupBy

func (maq *MerchantAccountQuery) GroupBy(field string, fields ...string) *MerchantAccountGroupBy

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

Example:

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

client.MerchantAccount.Query().
	GroupBy(merchantaccount.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MerchantAccountQuery) IDs

func (maq *MerchantAccountQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*MerchantAccountQuery) IDsX

func (maq *MerchantAccountQuery) IDsX(ctx context.Context) []uint64

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

func (*MerchantAccountQuery) Limit

func (maq *MerchantAccountQuery) Limit(limit int) *MerchantAccountQuery

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

func (*MerchantAccountQuery) Offset

func (maq *MerchantAccountQuery) Offset(offset int) *MerchantAccountQuery

Offset to start from.

func (*MerchantAccountQuery) Only

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

func (*MerchantAccountQuery) OnlyID

func (maq *MerchantAccountQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*MerchantAccountQuery) OnlyIDX

func (maq *MerchantAccountQuery) OnlyIDX(ctx context.Context) uint64

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

func (*MerchantAccountQuery) OnlyX

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

func (*MerchantAccountQuery) Order

Order specifies how the records should be ordered.

func (*MerchantAccountQuery) Select

func (maq *MerchantAccountQuery) Select(fields ...string) *MerchantAccountSelect

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

Example:

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

client.MerchantAccount.Query().
	Select(merchantaccount.FieldCreatedAt).
	Scan(ctx, &v)

func (*MerchantAccountQuery) Unique

func (maq *MerchantAccountQuery) Unique(unique bool) *MerchantAccountQuery

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

Where adds a new predicate for the MerchantAccountQuery builder.

type MerchantAccountSelect

type MerchantAccountSelect struct {
	*MerchantAccountQuery
	// contains filtered or unexported fields
}

MerchantAccountSelect is the builder for selecting fields of MerchantAccount entities.

func (*MerchantAccountSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MerchantAccountSelect) Bool

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

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

func (*MerchantAccountSelect) BoolX

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

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

func (*MerchantAccountSelect) Bools

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

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

func (*MerchantAccountSelect) BoolsX

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

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

func (*MerchantAccountSelect) Float64

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

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

func (*MerchantAccountSelect) Float64X

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

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

func (*MerchantAccountSelect) Float64s

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

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

func (*MerchantAccountSelect) Float64sX

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

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

func (*MerchantAccountSelect) Int

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

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

func (*MerchantAccountSelect) IntX

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

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

func (*MerchantAccountSelect) Ints

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

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

func (*MerchantAccountSelect) IntsX

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

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

func (*MerchantAccountSelect) Scan

func (mas *MerchantAccountSelect) Scan(ctx context.Context, v any) error

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

func (*MerchantAccountSelect) ScanX

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

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

func (*MerchantAccountSelect) String

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

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

func (*MerchantAccountSelect) StringX

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

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

func (*MerchantAccountSelect) Strings

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

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

func (*MerchantAccountSelect) StringsX

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

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

type MerchantAccountUpdate

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

MerchantAccountUpdate is the builder for updating MerchantAccount entities.

func (*MerchantAccountUpdate) ClearDeletedAt

func (mau *MerchantAccountUpdate) ClearDeletedAt() *MerchantAccountUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MerchantAccountUpdate) ClearEmail

func (mau *MerchantAccountUpdate) ClearEmail() *MerchantAccountUpdate

ClearEmail clears the value of the "email" field.

func (*MerchantAccountUpdate) ClearPhone

func (mau *MerchantAccountUpdate) ClearPhone() *MerchantAccountUpdate

ClearPhone clears the value of the "phone" field.

func (*MerchantAccountUpdate) Exec

func (mau *MerchantAccountUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MerchantAccountUpdate) ExecX

func (mau *MerchantAccountUpdate) ExecX(ctx context.Context)

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

func (*MerchantAccountUpdate) Mutation

Mutation returns the MerchantAccountMutation object of the builder.

func (*MerchantAccountUpdate) Save

func (mau *MerchantAccountUpdate) Save(ctx context.Context) (int, error)

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

func (*MerchantAccountUpdate) SaveX

func (mau *MerchantAccountUpdate) SaveX(ctx context.Context) int

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

func (*MerchantAccountUpdate) SetDeletedAt

func (mau *MerchantAccountUpdate) SetDeletedAt(t time.Time) *MerchantAccountUpdate

SetDeletedAt sets the "deleted_at" field.

func (*MerchantAccountUpdate) SetEmail

SetEmail sets the "email" field.

func (*MerchantAccountUpdate) SetIsMainAccount

func (mau *MerchantAccountUpdate) SetIsMainAccount(b bool) *MerchantAccountUpdate

SetIsMainAccount sets the "is_main_account" field.

func (*MerchantAccountUpdate) SetNillableDeletedAt

func (mau *MerchantAccountUpdate) SetNillableDeletedAt(t *time.Time) *MerchantAccountUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MerchantAccountUpdate) SetNillableEmail

func (mau *MerchantAccountUpdate) SetNillableEmail(s *string) *MerchantAccountUpdate

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

func (*MerchantAccountUpdate) SetNillableIsMainAccount

func (mau *MerchantAccountUpdate) SetNillableIsMainAccount(b *bool) *MerchantAccountUpdate

SetNillableIsMainAccount sets the "is_main_account" field if the given value is not nil.

func (*MerchantAccountUpdate) SetNillablePassword

func (mau *MerchantAccountUpdate) SetNillablePassword(s *string) *MerchantAccountUpdate

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

func (*MerchantAccountUpdate) SetNillablePhone

func (mau *MerchantAccountUpdate) SetNillablePhone(s *string) *MerchantAccountUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*MerchantAccountUpdate) SetNillableUsername

func (mau *MerchantAccountUpdate) SetNillableUsername(s *string) *MerchantAccountUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*MerchantAccountUpdate) SetPassword

func (mau *MerchantAccountUpdate) SetPassword(s string) *MerchantAccountUpdate

SetPassword sets the "password" field.

func (*MerchantAccountUpdate) SetPhone

SetPhone sets the "phone" field.

func (*MerchantAccountUpdate) SetUpdatedAt

func (mau *MerchantAccountUpdate) SetUpdatedAt(t time.Time) *MerchantAccountUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MerchantAccountUpdate) SetUsername

func (mau *MerchantAccountUpdate) SetUsername(s string) *MerchantAccountUpdate

SetUsername sets the "username" field.

func (*MerchantAccountUpdate) Where

Where appends a list predicates to the MerchantAccountUpdate builder.

type MerchantAccountUpdateOne

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

MerchantAccountUpdateOne is the builder for updating a single MerchantAccount entity.

func (*MerchantAccountUpdateOne) ClearDeletedAt

func (mauo *MerchantAccountUpdateOne) ClearDeletedAt() *MerchantAccountUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MerchantAccountUpdateOne) ClearEmail

ClearEmail clears the value of the "email" field.

func (*MerchantAccountUpdateOne) ClearPhone

ClearPhone clears the value of the "phone" field.

func (*MerchantAccountUpdateOne) Exec

Exec executes the query on the entity.

func (*MerchantAccountUpdateOne) ExecX

func (mauo *MerchantAccountUpdateOne) ExecX(ctx context.Context)

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

func (*MerchantAccountUpdateOne) Mutation

Mutation returns the MerchantAccountMutation object of the builder.

func (*MerchantAccountUpdateOne) Save

Save executes the query and returns the updated MerchantAccount entity.

func (*MerchantAccountUpdateOne) SaveX

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

func (*MerchantAccountUpdateOne) Select

func (mauo *MerchantAccountUpdateOne) Select(field string, fields ...string) *MerchantAccountUpdateOne

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

func (*MerchantAccountUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*MerchantAccountUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*MerchantAccountUpdateOne) SetIsMainAccount

func (mauo *MerchantAccountUpdateOne) SetIsMainAccount(b bool) *MerchantAccountUpdateOne

SetIsMainAccount sets the "is_main_account" field.

func (*MerchantAccountUpdateOne) SetNillableDeletedAt

func (mauo *MerchantAccountUpdateOne) SetNillableDeletedAt(t *time.Time) *MerchantAccountUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MerchantAccountUpdateOne) SetNillableEmail

func (mauo *MerchantAccountUpdateOne) SetNillableEmail(s *string) *MerchantAccountUpdateOne

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

func (*MerchantAccountUpdateOne) SetNillableIsMainAccount

func (mauo *MerchantAccountUpdateOne) SetNillableIsMainAccount(b *bool) *MerchantAccountUpdateOne

SetNillableIsMainAccount sets the "is_main_account" field if the given value is not nil.

func (*MerchantAccountUpdateOne) SetNillablePassword

func (mauo *MerchantAccountUpdateOne) SetNillablePassword(s *string) *MerchantAccountUpdateOne

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

func (*MerchantAccountUpdateOne) SetNillablePhone

func (mauo *MerchantAccountUpdateOne) SetNillablePhone(s *string) *MerchantAccountUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*MerchantAccountUpdateOne) SetNillableUsername

func (mauo *MerchantAccountUpdateOne) SetNillableUsername(s *string) *MerchantAccountUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*MerchantAccountUpdateOne) SetPassword

SetPassword sets the "password" field.

func (*MerchantAccountUpdateOne) SetPhone

SetPhone sets the "phone" field.

func (*MerchantAccountUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*MerchantAccountUpdateOne) SetUsername

SetUsername sets the "username" field.

func (*MerchantAccountUpdateOne) Where

Where appends a list predicates to the MerchantAccountUpdate builder.

type MerchantAccounts

type MerchantAccounts []*MerchantAccount

MerchantAccounts is a parsable slice of MerchantAccount.

type MerchantClient

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

MerchantClient is a client for the Merchant schema.

func NewMerchantClient

func NewMerchantClient(c config) *MerchantClient

NewMerchantClient returns a client for the Merchant from the given config.

func (*MerchantClient) Create

func (c *MerchantClient) Create() *MerchantCreate

Create returns a builder for creating a Merchant entity.

func (*MerchantClient) CreateBulk

func (c *MerchantClient) CreateBulk(builders ...*MerchantCreate) *MerchantCreateBulk

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

func (*MerchantClient) Delete

func (c *MerchantClient) Delete() *MerchantDelete

Delete returns a delete builder for Merchant.

func (*MerchantClient) DeleteOne

func (c *MerchantClient) DeleteOne(m *Merchant) *MerchantDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MerchantClient) DeleteOneID

func (c *MerchantClient) DeleteOneID(id uint64) *MerchantDeleteOne

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

func (*MerchantClient) Get

func (c *MerchantClient) Get(ctx context.Context, id uint64) (*Merchant, error)

Get returns a Merchant entity by its id.

func (*MerchantClient) GetX

func (c *MerchantClient) GetX(ctx context.Context, id uint64) *Merchant

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

func (*MerchantClient) Hooks

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

Hooks returns the client hooks.

func (*MerchantClient) Intercept

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

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

func (*MerchantClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MerchantClient) MapCreateBulk

func (c *MerchantClient) MapCreateBulk(slice any, setFunc func(*MerchantCreate, int)) *MerchantCreateBulk

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

func (c *MerchantClient) Query() *MerchantQuery

Query returns a query builder for Merchant.

func (*MerchantClient) QueryAccounts

func (c *MerchantClient) QueryAccounts(m *Merchant) *MerchantAccountQuery

QueryAccounts queries the accounts edge of a Merchant.

func (*MerchantClient) Update

func (c *MerchantClient) Update() *MerchantUpdate

Update returns an update builder for Merchant.

func (*MerchantClient) UpdateOne

func (c *MerchantClient) UpdateOne(m *Merchant) *MerchantUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MerchantClient) UpdateOneID

func (c *MerchantClient) UpdateOneID(id uint64) *MerchantUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MerchantClient) Use

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

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

type MerchantCreate

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

MerchantCreate is the builder for creating a Merchant entity.

func (*MerchantCreate) AddAccountIDs

func (mc *MerchantCreate) AddAccountIDs(ids ...uint64) *MerchantCreate

AddAccountIDs adds the "accounts" edge to the MerchantAccount entity by IDs.

func (*MerchantCreate) AddAccounts

func (mc *MerchantCreate) AddAccounts(m ...*MerchantAccount) *MerchantCreate

AddAccounts adds the "accounts" edges to the MerchantAccount entity.

func (*MerchantCreate) Exec

func (mc *MerchantCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MerchantCreate) ExecX

func (mc *MerchantCreate) ExecX(ctx context.Context)

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

func (*MerchantCreate) Mutation

func (mc *MerchantCreate) Mutation() *MerchantMutation

Mutation returns the MerchantMutation object of the builder.

func (*MerchantCreate) Save

func (mc *MerchantCreate) Save(ctx context.Context) (*Merchant, error)

Save creates the Merchant in the database.

func (*MerchantCreate) SaveX

func (mc *MerchantCreate) SaveX(ctx context.Context) *Merchant

SaveX calls Save and panics if Save returns an error.

func (*MerchantCreate) SetAddress

func (mc *MerchantCreate) SetAddress(s string) *MerchantCreate

SetAddress sets the "address" field.

func (*MerchantCreate) SetCity

func (mc *MerchantCreate) SetCity(s string) *MerchantCreate

SetCity sets the "city" field.

func (*MerchantCreate) SetContactPerson

func (mc *MerchantCreate) SetContactPerson(s string) *MerchantCreate

SetContactPerson sets the "contact_person" field.

func (*MerchantCreate) SetContactPhone

func (mc *MerchantCreate) SetContactPhone(s string) *MerchantCreate

SetContactPhone sets the "contact_phone" field.

func (*MerchantCreate) SetCountry

func (mc *MerchantCreate) SetCountry(s string) *MerchantCreate

SetCountry sets the "country" field.

func (*MerchantCreate) SetCreatedAt

func (mc *MerchantCreate) SetCreatedAt(t time.Time) *MerchantCreate

SetCreatedAt sets the "created_at" field.

func (*MerchantCreate) SetDeletedAt

func (mc *MerchantCreate) SetDeletedAt(t time.Time) *MerchantCreate

SetDeletedAt sets the "deleted_at" field.

func (*MerchantCreate) SetDistrict

func (mc *MerchantCreate) SetDistrict(s string) *MerchantCreate

SetDistrict sets the "district" field.

func (*MerchantCreate) SetID

func (mc *MerchantCreate) SetID(u uint64) *MerchantCreate

SetID sets the "id" field.

func (*MerchantCreate) SetMerchantName

func (mc *MerchantCreate) SetMerchantName(s string) *MerchantCreate

SetMerchantName sets the "merchant_name" field.

func (*MerchantCreate) SetNillableAddress

func (mc *MerchantCreate) SetNillableAddress(s *string) *MerchantCreate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*MerchantCreate) SetNillableCity

func (mc *MerchantCreate) SetNillableCity(s *string) *MerchantCreate

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

func (*MerchantCreate) SetNillableContactPerson

func (mc *MerchantCreate) SetNillableContactPerson(s *string) *MerchantCreate

SetNillableContactPerson sets the "contact_person" field if the given value is not nil.

func (*MerchantCreate) SetNillableContactPhone

func (mc *MerchantCreate) SetNillableContactPhone(s *string) *MerchantCreate

SetNillableContactPhone sets the "contact_phone" field if the given value is not nil.

func (*MerchantCreate) SetNillableCountry

func (mc *MerchantCreate) SetNillableCountry(s *string) *MerchantCreate

SetNillableCountry sets the "country" field if the given value is not nil.

func (*MerchantCreate) SetNillableCreatedAt

func (mc *MerchantCreate) SetNillableCreatedAt(t *time.Time) *MerchantCreate

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

func (*MerchantCreate) SetNillableDeletedAt

func (mc *MerchantCreate) SetNillableDeletedAt(t *time.Time) *MerchantCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MerchantCreate) SetNillableDistrict

func (mc *MerchantCreate) SetNillableDistrict(s *string) *MerchantCreate

SetNillableDistrict sets the "district" field if the given value is not nil.

func (*MerchantCreate) SetNillableID

func (mc *MerchantCreate) SetNillableID(u *uint64) *MerchantCreate

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

func (*MerchantCreate) SetNillableProvince

func (mc *MerchantCreate) SetNillableProvince(s *string) *MerchantCreate

SetNillableProvince sets the "province" field if the given value is not nil.

func (*MerchantCreate) SetNillableUpdatedAt

func (mc *MerchantCreate) SetNillableUpdatedAt(t *time.Time) *MerchantCreate

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

func (*MerchantCreate) SetProvince

func (mc *MerchantCreate) SetProvince(s string) *MerchantCreate

SetProvince sets the "province" field.

func (*MerchantCreate) SetUpdatedAt

func (mc *MerchantCreate) SetUpdatedAt(t time.Time) *MerchantCreate

SetUpdatedAt sets the "updated_at" field.

type MerchantCreateBulk

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

MerchantCreateBulk is the builder for creating many Merchant entities in bulk.

func (*MerchantCreateBulk) Exec

func (mcb *MerchantCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MerchantCreateBulk) ExecX

func (mcb *MerchantCreateBulk) ExecX(ctx context.Context)

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

func (*MerchantCreateBulk) Save

func (mcb *MerchantCreateBulk) Save(ctx context.Context) ([]*Merchant, error)

Save creates the Merchant entities in the database.

func (*MerchantCreateBulk) SaveX

func (mcb *MerchantCreateBulk) SaveX(ctx context.Context) []*Merchant

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

type MerchantDelete

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

MerchantDelete is the builder for deleting a Merchant entity.

func (*MerchantDelete) Exec

func (md *MerchantDelete) Exec(ctx context.Context) (int, error)

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

func (*MerchantDelete) ExecX

func (md *MerchantDelete) ExecX(ctx context.Context) int

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

func (*MerchantDelete) Where

func (md *MerchantDelete) Where(ps ...predicate.Merchant) *MerchantDelete

Where appends a list predicates to the MerchantDelete builder.

type MerchantDeleteOne

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

MerchantDeleteOne is the builder for deleting a single Merchant entity.

func (*MerchantDeleteOne) Exec

func (mdo *MerchantDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MerchantDeleteOne) ExecX

func (mdo *MerchantDeleteOne) ExecX(ctx context.Context)

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

func (*MerchantDeleteOne) Where

Where appends a list predicates to the MerchantDelete builder.

type MerchantEdges

type MerchantEdges struct {
	// Accounts holds the value of the accounts edge.
	Accounts []*MerchantAccount `json:"accounts,omitempty"`
	// contains filtered or unexported fields
}

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

func (MerchantEdges) AccountsOrErr

func (e MerchantEdges) AccountsOrErr() ([]*MerchantAccount, error)

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

type MerchantGroupBy

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

MerchantGroupBy is the group-by builder for Merchant entities.

func (*MerchantGroupBy) Aggregate

func (mgb *MerchantGroupBy) Aggregate(fns ...AggregateFunc) *MerchantGroupBy

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

func (*MerchantGroupBy) Bool

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

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

func (*MerchantGroupBy) BoolX

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

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

func (*MerchantGroupBy) Bools

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

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

func (*MerchantGroupBy) BoolsX

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

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

func (*MerchantGroupBy) Float64

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

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

func (*MerchantGroupBy) Float64X

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

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

func (*MerchantGroupBy) Float64s

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

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

func (*MerchantGroupBy) Float64sX

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

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

func (*MerchantGroupBy) Int

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

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

func (*MerchantGroupBy) IntX

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

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

func (*MerchantGroupBy) Ints

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

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

func (*MerchantGroupBy) IntsX

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

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

func (*MerchantGroupBy) Scan

func (mgb *MerchantGroupBy) Scan(ctx context.Context, v any) error

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

func (*MerchantGroupBy) ScanX

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

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

func (*MerchantGroupBy) String

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

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

func (*MerchantGroupBy) StringX

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

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

func (*MerchantGroupBy) Strings

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

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

func (*MerchantGroupBy) StringsX

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

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

type MerchantMutation

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

MerchantMutation represents an operation that mutates the Merchant nodes in the graph.

func (*MerchantMutation) AccountsCleared

func (m *MerchantMutation) AccountsCleared() bool

AccountsCleared reports if the "accounts" edge to the MerchantAccount entity was cleared.

func (*MerchantMutation) AccountsIDs

func (m *MerchantMutation) AccountsIDs() (ids []uint64)

AccountsIDs returns the "accounts" edge IDs in the mutation.

func (*MerchantMutation) AddAccountIDs

func (m *MerchantMutation) AddAccountIDs(ids ...uint64)

AddAccountIDs adds the "accounts" edge to the MerchantAccount entity by ids.

func (*MerchantMutation) AddField

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

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

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

func (*MerchantMutation) AddedField

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

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

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

func (*MerchantMutation) AddedIDs

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

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

func (*MerchantMutation) Address

func (m *MerchantMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*MerchantMutation) AddressCleared

func (m *MerchantMutation) AddressCleared() bool

AddressCleared returns if the "address" field was cleared in this mutation.

func (*MerchantMutation) City

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

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

func (*MerchantMutation) CityCleared

func (m *MerchantMutation) CityCleared() bool

CityCleared returns if the "city" field was cleared in this mutation.

func (*MerchantMutation) ClearAccounts

func (m *MerchantMutation) ClearAccounts()

ClearAccounts clears the "accounts" edge to the MerchantAccount entity.

func (*MerchantMutation) ClearAddress

func (m *MerchantMutation) ClearAddress()

ClearAddress clears the value of the "address" field.

func (*MerchantMutation) ClearCity

func (m *MerchantMutation) ClearCity()

ClearCity clears the value of the "city" field.

func (*MerchantMutation) ClearContactPerson

func (m *MerchantMutation) ClearContactPerson()

ClearContactPerson clears the value of the "contact_person" field.

func (*MerchantMutation) ClearContactPhone

func (m *MerchantMutation) ClearContactPhone()

ClearContactPhone clears the value of the "contact_phone" field.

func (*MerchantMutation) ClearCountry

func (m *MerchantMutation) ClearCountry()

ClearCountry clears the value of the "country" field.

func (*MerchantMutation) ClearDeletedAt

func (m *MerchantMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MerchantMutation) ClearDistrict

func (m *MerchantMutation) ClearDistrict()

ClearDistrict clears the value of the "district" field.

func (*MerchantMutation) ClearEdge

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

func (m *MerchantMutation) 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 (*MerchantMutation) ClearProvince

func (m *MerchantMutation) ClearProvince()

ClearProvince clears the value of the "province" field.

func (*MerchantMutation) ClearedEdges

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

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

func (*MerchantMutation) ClearedFields

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

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

func (MerchantMutation) Client

func (m MerchantMutation) 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 (*MerchantMutation) ContactPerson

func (m *MerchantMutation) ContactPerson() (r string, exists bool)

ContactPerson returns the value of the "contact_person" field in the mutation.

func (*MerchantMutation) ContactPersonCleared

func (m *MerchantMutation) ContactPersonCleared() bool

ContactPersonCleared returns if the "contact_person" field was cleared in this mutation.

func (*MerchantMutation) ContactPhone

func (m *MerchantMutation) ContactPhone() (r string, exists bool)

ContactPhone returns the value of the "contact_phone" field in the mutation.

func (*MerchantMutation) ContactPhoneCleared

func (m *MerchantMutation) ContactPhoneCleared() bool

ContactPhoneCleared returns if the "contact_phone" field was cleared in this mutation.

func (*MerchantMutation) Country

func (m *MerchantMutation) Country() (r string, exists bool)

Country returns the value of the "country" field in the mutation.

func (*MerchantMutation) CountryCleared

func (m *MerchantMutation) CountryCleared() bool

CountryCleared returns if the "country" field was cleared in this mutation.

func (*MerchantMutation) CreatedAt

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

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

func (*MerchantMutation) DeletedAt

func (m *MerchantMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*MerchantMutation) DeletedAtCleared

func (m *MerchantMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*MerchantMutation) District

func (m *MerchantMutation) District() (r string, exists bool)

District returns the value of the "district" field in the mutation.

func (*MerchantMutation) DistrictCleared

func (m *MerchantMutation) DistrictCleared() bool

DistrictCleared returns if the "district" field was cleared in this mutation.

func (*MerchantMutation) EdgeCleared

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

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

func (*MerchantMutation) Field

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

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

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

func (*MerchantMutation) Fields

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

func (m *MerchantMutation) ID() (id uint64, 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 (*MerchantMutation) IDs

func (m *MerchantMutation) IDs(ctx context.Context) ([]uint64, 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 (*MerchantMutation) MerchantName

func (m *MerchantMutation) MerchantName() (r string, exists bool)

MerchantName returns the value of the "merchant_name" field in the mutation.

func (*MerchantMutation) OldAddress

func (m *MerchantMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldCity

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

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

func (m *MerchantMutation) OldContactPerson(ctx context.Context) (v string, err error)

OldContactPerson returns the old "contact_person" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldContactPhone

func (m *MerchantMutation) OldContactPhone(ctx context.Context) (v string, err error)

OldContactPhone returns the old "contact_phone" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldCountry

func (m *MerchantMutation) OldCountry(ctx context.Context) (v string, err error)

OldCountry returns the old "country" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldCreatedAt

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

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

func (m *MerchantMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldDistrict

func (m *MerchantMutation) OldDistrict(ctx context.Context) (v string, err error)

OldDistrict returns the old "district" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldField

func (m *MerchantMutation) 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 (*MerchantMutation) OldMerchantName

func (m *MerchantMutation) OldMerchantName(ctx context.Context) (v string, err error)

OldMerchantName returns the old "merchant_name" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldProvince

func (m *MerchantMutation) OldProvince(ctx context.Context) (v string, err error)

OldProvince returns the old "province" field's value of the Merchant entity. If the Merchant 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 (*MerchantMutation) OldUpdatedAt

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

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

func (m *MerchantMutation) Op() Op

Op returns the operation name.

func (*MerchantMutation) Province

func (m *MerchantMutation) Province() (r string, exists bool)

Province returns the value of the "province" field in the mutation.

func (*MerchantMutation) ProvinceCleared

func (m *MerchantMutation) ProvinceCleared() bool

ProvinceCleared returns if the "province" field was cleared in this mutation.

func (*MerchantMutation) RemoveAccountIDs

func (m *MerchantMutation) RemoveAccountIDs(ids ...uint64)

RemoveAccountIDs removes the "accounts" edge to the MerchantAccount entity by IDs.

func (*MerchantMutation) RemovedAccountsIDs

func (m *MerchantMutation) RemovedAccountsIDs() (ids []uint64)

RemovedAccounts returns the removed IDs of the "accounts" edge to the MerchantAccount entity.

func (*MerchantMutation) RemovedEdges

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

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

func (*MerchantMutation) RemovedIDs

func (m *MerchantMutation) 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 (*MerchantMutation) ResetAccounts

func (m *MerchantMutation) ResetAccounts()

ResetAccounts resets all changes to the "accounts" edge.

func (*MerchantMutation) ResetAddress

func (m *MerchantMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*MerchantMutation) ResetCity

func (m *MerchantMutation) ResetCity()

ResetCity resets all changes to the "city" field.

func (*MerchantMutation) ResetContactPerson

func (m *MerchantMutation) ResetContactPerson()

ResetContactPerson resets all changes to the "contact_person" field.

func (*MerchantMutation) ResetContactPhone

func (m *MerchantMutation) ResetContactPhone()

ResetContactPhone resets all changes to the "contact_phone" field.

func (*MerchantMutation) ResetCountry

func (m *MerchantMutation) ResetCountry()

ResetCountry resets all changes to the "country" field.

func (*MerchantMutation) ResetCreatedAt

func (m *MerchantMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MerchantMutation) ResetDeletedAt

func (m *MerchantMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*MerchantMutation) ResetDistrict

func (m *MerchantMutation) ResetDistrict()

ResetDistrict resets all changes to the "district" field.

func (*MerchantMutation) ResetEdge

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

func (m *MerchantMutation) 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 (*MerchantMutation) ResetMerchantName

func (m *MerchantMutation) ResetMerchantName()

ResetMerchantName resets all changes to the "merchant_name" field.

func (*MerchantMutation) ResetProvince

func (m *MerchantMutation) ResetProvince()

ResetProvince resets all changes to the "province" field.

func (*MerchantMutation) ResetUpdatedAt

func (m *MerchantMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MerchantMutation) SetAddress

func (m *MerchantMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*MerchantMutation) SetCity

func (m *MerchantMutation) SetCity(s string)

SetCity sets the "city" field.

func (*MerchantMutation) SetContactPerson

func (m *MerchantMutation) SetContactPerson(s string)

SetContactPerson sets the "contact_person" field.

func (*MerchantMutation) SetContactPhone

func (m *MerchantMutation) SetContactPhone(s string)

SetContactPhone sets the "contact_phone" field.

func (*MerchantMutation) SetCountry

func (m *MerchantMutation) SetCountry(s string)

SetCountry sets the "country" field.

func (*MerchantMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MerchantMutation) SetDeletedAt

func (m *MerchantMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*MerchantMutation) SetDistrict

func (m *MerchantMutation) SetDistrict(s string)

SetDistrict sets the "district" field.

func (*MerchantMutation) SetField

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

func (m *MerchantMutation) SetID(id uint64)

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

func (*MerchantMutation) SetMerchantName

func (m *MerchantMutation) SetMerchantName(s string)

SetMerchantName sets the "merchant_name" field.

func (*MerchantMutation) SetOp

func (m *MerchantMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MerchantMutation) SetProvince

func (m *MerchantMutation) SetProvince(s string)

SetProvince sets the "province" field.

func (*MerchantMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (MerchantMutation) Tx

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

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

func (*MerchantMutation) Type

func (m *MerchantMutation) Type() string

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

func (*MerchantMutation) UpdatedAt

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

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

func (*MerchantMutation) Where

func (m *MerchantMutation) Where(ps ...predicate.Merchant)

Where appends a list predicates to the MerchantMutation builder.

func (*MerchantMutation) WhereP

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

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

type MerchantQuery

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

MerchantQuery is the builder for querying Merchant entities.

func (*MerchantQuery) Aggregate

func (mq *MerchantQuery) Aggregate(fns ...AggregateFunc) *MerchantSelect

Aggregate returns a MerchantSelect configured with the given aggregations.

func (*MerchantQuery) All

func (mq *MerchantQuery) All(ctx context.Context) ([]*Merchant, error)

All executes the query and returns a list of Merchants.

func (*MerchantQuery) AllX

func (mq *MerchantQuery) AllX(ctx context.Context) []*Merchant

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

func (*MerchantQuery) Clone

func (mq *MerchantQuery) Clone() *MerchantQuery

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

func (*MerchantQuery) Count

func (mq *MerchantQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MerchantQuery) CountX

func (mq *MerchantQuery) CountX(ctx context.Context) int

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

func (*MerchantQuery) Exist

func (mq *MerchantQuery) Exist(ctx context.Context) (bool, error)

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

func (*MerchantQuery) ExistX

func (mq *MerchantQuery) ExistX(ctx context.Context) bool

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

func (*MerchantQuery) First

func (mq *MerchantQuery) First(ctx context.Context) (*Merchant, error)

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

func (*MerchantQuery) FirstID

func (mq *MerchantQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*MerchantQuery) FirstIDX

func (mq *MerchantQuery) FirstIDX(ctx context.Context) uint64

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

func (*MerchantQuery) FirstX

func (mq *MerchantQuery) FirstX(ctx context.Context) *Merchant

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

func (*MerchantQuery) GroupBy

func (mq *MerchantQuery) GroupBy(field string, fields ...string) *MerchantGroupBy

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

Example:

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

client.Merchant.Query().
	GroupBy(merchant.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MerchantQuery) IDs

func (mq *MerchantQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*MerchantQuery) IDsX

func (mq *MerchantQuery) IDsX(ctx context.Context) []uint64

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

func (*MerchantQuery) Limit

func (mq *MerchantQuery) Limit(limit int) *MerchantQuery

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

func (*MerchantQuery) Offset

func (mq *MerchantQuery) Offset(offset int) *MerchantQuery

Offset to start from.

func (*MerchantQuery) Only

func (mq *MerchantQuery) Only(ctx context.Context) (*Merchant, error)

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

func (*MerchantQuery) OnlyID

func (mq *MerchantQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*MerchantQuery) OnlyIDX

func (mq *MerchantQuery) OnlyIDX(ctx context.Context) uint64

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

func (*MerchantQuery) OnlyX

func (mq *MerchantQuery) OnlyX(ctx context.Context) *Merchant

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

func (*MerchantQuery) Order

Order specifies how the records should be ordered.

func (*MerchantQuery) QueryAccounts

func (mq *MerchantQuery) QueryAccounts() *MerchantAccountQuery

QueryAccounts chains the current query on the "accounts" edge.

func (*MerchantQuery) Select

func (mq *MerchantQuery) Select(fields ...string) *MerchantSelect

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

Example:

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

client.Merchant.Query().
	Select(merchant.FieldCreatedAt).
	Scan(ctx, &v)

func (*MerchantQuery) Unique

func (mq *MerchantQuery) Unique(unique bool) *MerchantQuery

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

func (mq *MerchantQuery) Where(ps ...predicate.Merchant) *MerchantQuery

Where adds a new predicate for the MerchantQuery builder.

func (*MerchantQuery) WithAccounts

func (mq *MerchantQuery) WithAccounts(opts ...func(*MerchantAccountQuery)) *MerchantQuery

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

type MerchantSelect

type MerchantSelect struct {
	*MerchantQuery
	// contains filtered or unexported fields
}

MerchantSelect is the builder for selecting fields of Merchant entities.

func (*MerchantSelect) Aggregate

func (ms *MerchantSelect) Aggregate(fns ...AggregateFunc) *MerchantSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MerchantSelect) Bool

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

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

func (*MerchantSelect) BoolX

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

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

func (*MerchantSelect) Bools

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

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

func (*MerchantSelect) BoolsX

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

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

func (*MerchantSelect) Float64

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

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

func (*MerchantSelect) Float64X

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

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

func (*MerchantSelect) Float64s

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

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

func (*MerchantSelect) Float64sX

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

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

func (*MerchantSelect) Int

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

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

func (*MerchantSelect) IntX

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

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

func (*MerchantSelect) Ints

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

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

func (*MerchantSelect) IntsX

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

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

func (*MerchantSelect) Scan

func (ms *MerchantSelect) Scan(ctx context.Context, v any) error

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

func (*MerchantSelect) ScanX

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

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

func (*MerchantSelect) String

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

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

func (*MerchantSelect) StringX

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

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

func (*MerchantSelect) Strings

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

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

func (*MerchantSelect) StringsX

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

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

type MerchantUpdate

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

MerchantUpdate is the builder for updating Merchant entities.

func (*MerchantUpdate) AddAccountIDs

func (mu *MerchantUpdate) AddAccountIDs(ids ...uint64) *MerchantUpdate

AddAccountIDs adds the "accounts" edge to the MerchantAccount entity by IDs.

func (*MerchantUpdate) AddAccounts

func (mu *MerchantUpdate) AddAccounts(m ...*MerchantAccount) *MerchantUpdate

AddAccounts adds the "accounts" edges to the MerchantAccount entity.

func (*MerchantUpdate) ClearAccounts

func (mu *MerchantUpdate) ClearAccounts() *MerchantUpdate

ClearAccounts clears all "accounts" edges to the MerchantAccount entity.

func (*MerchantUpdate) ClearAddress

func (mu *MerchantUpdate) ClearAddress() *MerchantUpdate

ClearAddress clears the value of the "address" field.

func (*MerchantUpdate) ClearCity

func (mu *MerchantUpdate) ClearCity() *MerchantUpdate

ClearCity clears the value of the "city" field.

func (*MerchantUpdate) ClearContactPerson

func (mu *MerchantUpdate) ClearContactPerson() *MerchantUpdate

ClearContactPerson clears the value of the "contact_person" field.

func (*MerchantUpdate) ClearContactPhone

func (mu *MerchantUpdate) ClearContactPhone() *MerchantUpdate

ClearContactPhone clears the value of the "contact_phone" field.

func (*MerchantUpdate) ClearCountry

func (mu *MerchantUpdate) ClearCountry() *MerchantUpdate

ClearCountry clears the value of the "country" field.

func (*MerchantUpdate) ClearDeletedAt

func (mu *MerchantUpdate) ClearDeletedAt() *MerchantUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MerchantUpdate) ClearDistrict

func (mu *MerchantUpdate) ClearDistrict() *MerchantUpdate

ClearDistrict clears the value of the "district" field.

func (*MerchantUpdate) ClearProvince

func (mu *MerchantUpdate) ClearProvince() *MerchantUpdate

ClearProvince clears the value of the "province" field.

func (*MerchantUpdate) Exec

func (mu *MerchantUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MerchantUpdate) ExecX

func (mu *MerchantUpdate) ExecX(ctx context.Context)

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

func (*MerchantUpdate) Mutation

func (mu *MerchantUpdate) Mutation() *MerchantMutation

Mutation returns the MerchantMutation object of the builder.

func (*MerchantUpdate) RemoveAccountIDs

func (mu *MerchantUpdate) RemoveAccountIDs(ids ...uint64) *MerchantUpdate

RemoveAccountIDs removes the "accounts" edge to MerchantAccount entities by IDs.

func (*MerchantUpdate) RemoveAccounts

func (mu *MerchantUpdate) RemoveAccounts(m ...*MerchantAccount) *MerchantUpdate

RemoveAccounts removes "accounts" edges to MerchantAccount entities.

func (*MerchantUpdate) Save

func (mu *MerchantUpdate) Save(ctx context.Context) (int, error)

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

func (*MerchantUpdate) SaveX

func (mu *MerchantUpdate) SaveX(ctx context.Context) int

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

func (*MerchantUpdate) SetAddress

func (mu *MerchantUpdate) SetAddress(s string) *MerchantUpdate

SetAddress sets the "address" field.

func (*MerchantUpdate) SetCity

func (mu *MerchantUpdate) SetCity(s string) *MerchantUpdate

SetCity sets the "city" field.

func (*MerchantUpdate) SetContactPerson

func (mu *MerchantUpdate) SetContactPerson(s string) *MerchantUpdate

SetContactPerson sets the "contact_person" field.

func (*MerchantUpdate) SetContactPhone

func (mu *MerchantUpdate) SetContactPhone(s string) *MerchantUpdate

SetContactPhone sets the "contact_phone" field.

func (*MerchantUpdate) SetCountry

func (mu *MerchantUpdate) SetCountry(s string) *MerchantUpdate

SetCountry sets the "country" field.

func (*MerchantUpdate) SetDeletedAt

func (mu *MerchantUpdate) SetDeletedAt(t time.Time) *MerchantUpdate

SetDeletedAt sets the "deleted_at" field.

func (*MerchantUpdate) SetDistrict

func (mu *MerchantUpdate) SetDistrict(s string) *MerchantUpdate

SetDistrict sets the "district" field.

func (*MerchantUpdate) SetMerchantName

func (mu *MerchantUpdate) SetMerchantName(s string) *MerchantUpdate

SetMerchantName sets the "merchant_name" field.

func (*MerchantUpdate) SetNillableAddress

func (mu *MerchantUpdate) SetNillableAddress(s *string) *MerchantUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*MerchantUpdate) SetNillableCity

func (mu *MerchantUpdate) SetNillableCity(s *string) *MerchantUpdate

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

func (*MerchantUpdate) SetNillableContactPerson

func (mu *MerchantUpdate) SetNillableContactPerson(s *string) *MerchantUpdate

SetNillableContactPerson sets the "contact_person" field if the given value is not nil.

func (*MerchantUpdate) SetNillableContactPhone

func (mu *MerchantUpdate) SetNillableContactPhone(s *string) *MerchantUpdate

SetNillableContactPhone sets the "contact_phone" field if the given value is not nil.

func (*MerchantUpdate) SetNillableCountry

func (mu *MerchantUpdate) SetNillableCountry(s *string) *MerchantUpdate

SetNillableCountry sets the "country" field if the given value is not nil.

func (*MerchantUpdate) SetNillableDeletedAt

func (mu *MerchantUpdate) SetNillableDeletedAt(t *time.Time) *MerchantUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MerchantUpdate) SetNillableDistrict

func (mu *MerchantUpdate) SetNillableDistrict(s *string) *MerchantUpdate

SetNillableDistrict sets the "district" field if the given value is not nil.

func (*MerchantUpdate) SetNillableMerchantName

func (mu *MerchantUpdate) SetNillableMerchantName(s *string) *MerchantUpdate

SetNillableMerchantName sets the "merchant_name" field if the given value is not nil.

func (*MerchantUpdate) SetNillableProvince

func (mu *MerchantUpdate) SetNillableProvince(s *string) *MerchantUpdate

SetNillableProvince sets the "province" field if the given value is not nil.

func (*MerchantUpdate) SetProvince

func (mu *MerchantUpdate) SetProvince(s string) *MerchantUpdate

SetProvince sets the "province" field.

func (*MerchantUpdate) SetUpdatedAt

func (mu *MerchantUpdate) SetUpdatedAt(t time.Time) *MerchantUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MerchantUpdate) Where

func (mu *MerchantUpdate) Where(ps ...predicate.Merchant) *MerchantUpdate

Where appends a list predicates to the MerchantUpdate builder.

type MerchantUpdateOne

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

MerchantUpdateOne is the builder for updating a single Merchant entity.

func (*MerchantUpdateOne) AddAccountIDs

func (muo *MerchantUpdateOne) AddAccountIDs(ids ...uint64) *MerchantUpdateOne

AddAccountIDs adds the "accounts" edge to the MerchantAccount entity by IDs.

func (*MerchantUpdateOne) AddAccounts

func (muo *MerchantUpdateOne) AddAccounts(m ...*MerchantAccount) *MerchantUpdateOne

AddAccounts adds the "accounts" edges to the MerchantAccount entity.

func (*MerchantUpdateOne) ClearAccounts

func (muo *MerchantUpdateOne) ClearAccounts() *MerchantUpdateOne

ClearAccounts clears all "accounts" edges to the MerchantAccount entity.

func (*MerchantUpdateOne) ClearAddress

func (muo *MerchantUpdateOne) ClearAddress() *MerchantUpdateOne

ClearAddress clears the value of the "address" field.

func (*MerchantUpdateOne) ClearCity

func (muo *MerchantUpdateOne) ClearCity() *MerchantUpdateOne

ClearCity clears the value of the "city" field.

func (*MerchantUpdateOne) ClearContactPerson

func (muo *MerchantUpdateOne) ClearContactPerson() *MerchantUpdateOne

ClearContactPerson clears the value of the "contact_person" field.

func (*MerchantUpdateOne) ClearContactPhone

func (muo *MerchantUpdateOne) ClearContactPhone() *MerchantUpdateOne

ClearContactPhone clears the value of the "contact_phone" field.

func (*MerchantUpdateOne) ClearCountry

func (muo *MerchantUpdateOne) ClearCountry() *MerchantUpdateOne

ClearCountry clears the value of the "country" field.

func (*MerchantUpdateOne) ClearDeletedAt

func (muo *MerchantUpdateOne) ClearDeletedAt() *MerchantUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MerchantUpdateOne) ClearDistrict

func (muo *MerchantUpdateOne) ClearDistrict() *MerchantUpdateOne

ClearDistrict clears the value of the "district" field.

func (*MerchantUpdateOne) ClearProvince

func (muo *MerchantUpdateOne) ClearProvince() *MerchantUpdateOne

ClearProvince clears the value of the "province" field.

func (*MerchantUpdateOne) Exec

func (muo *MerchantUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MerchantUpdateOne) ExecX

func (muo *MerchantUpdateOne) ExecX(ctx context.Context)

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

func (*MerchantUpdateOne) Mutation

func (muo *MerchantUpdateOne) Mutation() *MerchantMutation

Mutation returns the MerchantMutation object of the builder.

func (*MerchantUpdateOne) RemoveAccountIDs

func (muo *MerchantUpdateOne) RemoveAccountIDs(ids ...uint64) *MerchantUpdateOne

RemoveAccountIDs removes the "accounts" edge to MerchantAccount entities by IDs.

func (*MerchantUpdateOne) RemoveAccounts

func (muo *MerchantUpdateOne) RemoveAccounts(m ...*MerchantAccount) *MerchantUpdateOne

RemoveAccounts removes "accounts" edges to MerchantAccount entities.

func (*MerchantUpdateOne) Save

func (muo *MerchantUpdateOne) Save(ctx context.Context) (*Merchant, error)

Save executes the query and returns the updated Merchant entity.

func (*MerchantUpdateOne) SaveX

func (muo *MerchantUpdateOne) SaveX(ctx context.Context) *Merchant

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

func (*MerchantUpdateOne) Select

func (muo *MerchantUpdateOne) Select(field string, fields ...string) *MerchantUpdateOne

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

func (*MerchantUpdateOne) SetAddress

func (muo *MerchantUpdateOne) SetAddress(s string) *MerchantUpdateOne

SetAddress sets the "address" field.

func (*MerchantUpdateOne) SetCity

func (muo *MerchantUpdateOne) SetCity(s string) *MerchantUpdateOne

SetCity sets the "city" field.

func (*MerchantUpdateOne) SetContactPerson

func (muo *MerchantUpdateOne) SetContactPerson(s string) *MerchantUpdateOne

SetContactPerson sets the "contact_person" field.

func (*MerchantUpdateOne) SetContactPhone

func (muo *MerchantUpdateOne) SetContactPhone(s string) *MerchantUpdateOne

SetContactPhone sets the "contact_phone" field.

func (*MerchantUpdateOne) SetCountry

func (muo *MerchantUpdateOne) SetCountry(s string) *MerchantUpdateOne

SetCountry sets the "country" field.

func (*MerchantUpdateOne) SetDeletedAt

func (muo *MerchantUpdateOne) SetDeletedAt(t time.Time) *MerchantUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*MerchantUpdateOne) SetDistrict

func (muo *MerchantUpdateOne) SetDistrict(s string) *MerchantUpdateOne

SetDistrict sets the "district" field.

func (*MerchantUpdateOne) SetMerchantName

func (muo *MerchantUpdateOne) SetMerchantName(s string) *MerchantUpdateOne

SetMerchantName sets the "merchant_name" field.

func (*MerchantUpdateOne) SetNillableAddress

func (muo *MerchantUpdateOne) SetNillableAddress(s *string) *MerchantUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableCity

func (muo *MerchantUpdateOne) SetNillableCity(s *string) *MerchantUpdateOne

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

func (*MerchantUpdateOne) SetNillableContactPerson

func (muo *MerchantUpdateOne) SetNillableContactPerson(s *string) *MerchantUpdateOne

SetNillableContactPerson sets the "contact_person" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableContactPhone

func (muo *MerchantUpdateOne) SetNillableContactPhone(s *string) *MerchantUpdateOne

SetNillableContactPhone sets the "contact_phone" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableCountry

func (muo *MerchantUpdateOne) SetNillableCountry(s *string) *MerchantUpdateOne

SetNillableCountry sets the "country" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableDeletedAt

func (muo *MerchantUpdateOne) SetNillableDeletedAt(t *time.Time) *MerchantUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableDistrict

func (muo *MerchantUpdateOne) SetNillableDistrict(s *string) *MerchantUpdateOne

SetNillableDistrict sets the "district" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableMerchantName

func (muo *MerchantUpdateOne) SetNillableMerchantName(s *string) *MerchantUpdateOne

SetNillableMerchantName sets the "merchant_name" field if the given value is not nil.

func (*MerchantUpdateOne) SetNillableProvince

func (muo *MerchantUpdateOne) SetNillableProvince(s *string) *MerchantUpdateOne

SetNillableProvince sets the "province" field if the given value is not nil.

func (*MerchantUpdateOne) SetProvince

func (muo *MerchantUpdateOne) SetProvince(s string) *MerchantUpdateOne

SetProvince sets the "province" field.

func (*MerchantUpdateOne) SetUpdatedAt

func (muo *MerchantUpdateOne) SetUpdatedAt(t time.Time) *MerchantUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MerchantUpdateOne) Where

Where appends a list predicates to the MerchantUpdate builder.

type Merchants

type Merchants []*Merchant

Merchants is a parsable slice of Merchant.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type PlatformAccount

type PlatformAccount struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,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"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// contains filtered or unexported fields
}

PlatformAccount is the model entity for the PlatformAccount schema.

func (*PlatformAccount) String

func (pa *PlatformAccount) String() string

String implements the fmt.Stringer.

func (*PlatformAccount) Unwrap

func (pa *PlatformAccount) Unwrap() *PlatformAccount

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

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

func (*PlatformAccount) Value

func (pa *PlatformAccount) Value(name string) (ent.Value, error)

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

type PlatformAccountClient

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

PlatformAccountClient is a client for the PlatformAccount schema.

func NewPlatformAccountClient

func NewPlatformAccountClient(c config) *PlatformAccountClient

NewPlatformAccountClient returns a client for the PlatformAccount from the given config.

func (*PlatformAccountClient) Create

Create returns a builder for creating a PlatformAccount entity.

func (*PlatformAccountClient) CreateBulk

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

func (*PlatformAccountClient) Delete

Delete returns a delete builder for PlatformAccount.

func (*PlatformAccountClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PlatformAccountClient) DeleteOneID

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

func (*PlatformAccountClient) Get

Get returns a PlatformAccount entity by its id.

func (*PlatformAccountClient) GetX

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

func (*PlatformAccountClient) Hooks

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

Hooks returns the client hooks.

func (*PlatformAccountClient) Intercept

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

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

func (*PlatformAccountClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PlatformAccountClient) MapCreateBulk

func (c *PlatformAccountClient) MapCreateBulk(slice any, setFunc func(*PlatformAccountCreate, int)) *PlatformAccountCreateBulk

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

Query returns a query builder for PlatformAccount.

func (*PlatformAccountClient) Update

Update returns an update builder for PlatformAccount.

func (*PlatformAccountClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PlatformAccountClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PlatformAccountClient) Use

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

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

type PlatformAccountCreate

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

PlatformAccountCreate is the builder for creating a PlatformAccount entity.

func (*PlatformAccountCreate) Exec

func (pac *PlatformAccountCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformAccountCreate) ExecX

func (pac *PlatformAccountCreate) ExecX(ctx context.Context)

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

func (*PlatformAccountCreate) Mutation

Mutation returns the PlatformAccountMutation object of the builder.

func (*PlatformAccountCreate) Save

Save creates the PlatformAccount in the database.

func (*PlatformAccountCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PlatformAccountCreate) SetCreatedAt

func (pac *PlatformAccountCreate) SetCreatedAt(t time.Time) *PlatformAccountCreate

SetCreatedAt sets the "created_at" field.

func (*PlatformAccountCreate) SetDeletedAt

func (pac *PlatformAccountCreate) SetDeletedAt(t time.Time) *PlatformAccountCreate

SetDeletedAt sets the "deleted_at" field.

func (*PlatformAccountCreate) SetEmail

SetEmail sets the "email" field.

func (*PlatformAccountCreate) SetID

SetID sets the "id" field.

func (*PlatformAccountCreate) SetNillableCreatedAt

func (pac *PlatformAccountCreate) SetNillableCreatedAt(t *time.Time) *PlatformAccountCreate

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

func (*PlatformAccountCreate) SetNillableDeletedAt

func (pac *PlatformAccountCreate) SetNillableDeletedAt(t *time.Time) *PlatformAccountCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PlatformAccountCreate) SetNillableEmail

func (pac *PlatformAccountCreate) SetNillableEmail(s *string) *PlatformAccountCreate

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

func (*PlatformAccountCreate) SetNillableID

func (pac *PlatformAccountCreate) SetNillableID(u *uint64) *PlatformAccountCreate

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

func (*PlatformAccountCreate) SetNillableUpdatedAt

func (pac *PlatformAccountCreate) SetNillableUpdatedAt(t *time.Time) *PlatformAccountCreate

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

func (*PlatformAccountCreate) SetPassword

func (pac *PlatformAccountCreate) SetPassword(s string) *PlatformAccountCreate

SetPassword sets the "password" field.

func (*PlatformAccountCreate) SetUpdatedAt

func (pac *PlatformAccountCreate) SetUpdatedAt(t time.Time) *PlatformAccountCreate

SetUpdatedAt sets the "updated_at" field.

func (*PlatformAccountCreate) SetUsername

func (pac *PlatformAccountCreate) SetUsername(s string) *PlatformAccountCreate

SetUsername sets the "username" field.

type PlatformAccountCreateBulk

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

PlatformAccountCreateBulk is the builder for creating many PlatformAccount entities in bulk.

func (*PlatformAccountCreateBulk) Exec

Exec executes the query.

func (*PlatformAccountCreateBulk) ExecX

func (pacb *PlatformAccountCreateBulk) ExecX(ctx context.Context)

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

func (*PlatformAccountCreateBulk) Save

Save creates the PlatformAccount entities in the database.

func (*PlatformAccountCreateBulk) SaveX

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

type PlatformAccountDelete

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

PlatformAccountDelete is the builder for deleting a PlatformAccount entity.

func (*PlatformAccountDelete) Exec

func (pad *PlatformAccountDelete) Exec(ctx context.Context) (int, error)

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

func (*PlatformAccountDelete) ExecX

func (pad *PlatformAccountDelete) ExecX(ctx context.Context) int

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

func (*PlatformAccountDelete) Where

Where appends a list predicates to the PlatformAccountDelete builder.

type PlatformAccountDeleteOne

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

PlatformAccountDeleteOne is the builder for deleting a single PlatformAccount entity.

func (*PlatformAccountDeleteOne) Exec

Exec executes the deletion query.

func (*PlatformAccountDeleteOne) ExecX

func (pado *PlatformAccountDeleteOne) ExecX(ctx context.Context)

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

func (*PlatformAccountDeleteOne) Where

Where appends a list predicates to the PlatformAccountDelete builder.

type PlatformAccountGroupBy

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

PlatformAccountGroupBy is the group-by builder for PlatformAccount entities.

func (*PlatformAccountGroupBy) Aggregate

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

func (*PlatformAccountGroupBy) Bool

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

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

func (*PlatformAccountGroupBy) BoolX

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

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

func (*PlatformAccountGroupBy) Bools

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

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

func (*PlatformAccountGroupBy) BoolsX

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

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

func (*PlatformAccountGroupBy) Float64

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

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

func (*PlatformAccountGroupBy) Float64X

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

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

func (*PlatformAccountGroupBy) Float64s

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

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

func (*PlatformAccountGroupBy) Float64sX

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

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

func (*PlatformAccountGroupBy) Int

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

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

func (*PlatformAccountGroupBy) IntX

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

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

func (*PlatformAccountGroupBy) Ints

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

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

func (*PlatformAccountGroupBy) IntsX

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

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

func (*PlatformAccountGroupBy) Scan

func (pagb *PlatformAccountGroupBy) Scan(ctx context.Context, v any) error

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

func (*PlatformAccountGroupBy) ScanX

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

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

func (*PlatformAccountGroupBy) String

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

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

func (*PlatformAccountGroupBy) StringX

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

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

func (*PlatformAccountGroupBy) Strings

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

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

func (*PlatformAccountGroupBy) StringsX

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

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

type PlatformAccountMutation

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

PlatformAccountMutation represents an operation that mutates the PlatformAccount nodes in the graph.

func (*PlatformAccountMutation) AddField

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

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

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

func (*PlatformAccountMutation) AddedField

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

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

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

func (*PlatformAccountMutation) AddedIDs

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

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

func (*PlatformAccountMutation) ClearDeletedAt

func (m *PlatformAccountMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PlatformAccountMutation) ClearEdge

func (m *PlatformAccountMutation) 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 (*PlatformAccountMutation) ClearEmail

func (m *PlatformAccountMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*PlatformAccountMutation) ClearField

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

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

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

func (*PlatformAccountMutation) ClearedFields

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

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

func (PlatformAccountMutation) Client

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

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

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

func (*PlatformAccountMutation) DeletedAt

func (m *PlatformAccountMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PlatformAccountMutation) DeletedAtCleared

func (m *PlatformAccountMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PlatformAccountMutation) EdgeCleared

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

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

func (*PlatformAccountMutation) Email

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

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

func (*PlatformAccountMutation) EmailCleared

func (m *PlatformAccountMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*PlatformAccountMutation) Field

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

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

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

func (*PlatformAccountMutation) Fields

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

func (m *PlatformAccountMutation) ID() (id uint64, 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 (*PlatformAccountMutation) IDs

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

func (*PlatformAccountMutation) OldCreatedAt

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

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

func (m *PlatformAccountMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the PlatformAccount entity. If the PlatformAccount 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 (*PlatformAccountMutation) OldEmail

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

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

func (m *PlatformAccountMutation) 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 (*PlatformAccountMutation) OldPassword

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

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

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

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

func (m *PlatformAccountMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the PlatformAccount entity. If the PlatformAccount 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 (*PlatformAccountMutation) Op

func (m *PlatformAccountMutation) Op() Op

Op returns the operation name.

func (*PlatformAccountMutation) Password

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

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

func (*PlatformAccountMutation) RemovedEdges

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

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

func (*PlatformAccountMutation) RemovedIDs

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

func (m *PlatformAccountMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PlatformAccountMutation) ResetDeletedAt

func (m *PlatformAccountMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PlatformAccountMutation) ResetEdge

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

func (m *PlatformAccountMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*PlatformAccountMutation) ResetField

func (m *PlatformAccountMutation) 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 (*PlatformAccountMutation) ResetPassword

func (m *PlatformAccountMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*PlatformAccountMutation) ResetUpdatedAt

func (m *PlatformAccountMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PlatformAccountMutation) ResetUsername

func (m *PlatformAccountMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*PlatformAccountMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*PlatformAccountMutation) SetDeletedAt

func (m *PlatformAccountMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PlatformAccountMutation) SetEmail

func (m *PlatformAccountMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*PlatformAccountMutation) SetField

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

func (m *PlatformAccountMutation) SetID(id uint64)

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

func (*PlatformAccountMutation) SetOp

func (m *PlatformAccountMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PlatformAccountMutation) SetPassword

func (m *PlatformAccountMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*PlatformAccountMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*PlatformAccountMutation) SetUsername

func (m *PlatformAccountMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (PlatformAccountMutation) Tx

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

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

func (*PlatformAccountMutation) Type

func (m *PlatformAccountMutation) Type() string

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

func (*PlatformAccountMutation) UpdatedAt

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

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

func (*PlatformAccountMutation) Username

func (m *PlatformAccountMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*PlatformAccountMutation) Where

Where appends a list predicates to the PlatformAccountMutation builder.

func (*PlatformAccountMutation) WhereP

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

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

type PlatformAccountQuery

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

PlatformAccountQuery is the builder for querying PlatformAccount entities.

func (*PlatformAccountQuery) Aggregate

Aggregate returns a PlatformAccountSelect configured with the given aggregations.

func (*PlatformAccountQuery) All

All executes the query and returns a list of PlatformAccounts.

func (*PlatformAccountQuery) AllX

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

func (*PlatformAccountQuery) Clone

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

func (*PlatformAccountQuery) Count

func (paq *PlatformAccountQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PlatformAccountQuery) CountX

func (paq *PlatformAccountQuery) CountX(ctx context.Context) int

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

func (*PlatformAccountQuery) Exist

func (paq *PlatformAccountQuery) Exist(ctx context.Context) (bool, error)

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

func (*PlatformAccountQuery) ExistX

func (paq *PlatformAccountQuery) ExistX(ctx context.Context) bool

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

func (*PlatformAccountQuery) First

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

func (*PlatformAccountQuery) FirstID

func (paq *PlatformAccountQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*PlatformAccountQuery) FirstIDX

func (paq *PlatformAccountQuery) FirstIDX(ctx context.Context) uint64

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

func (*PlatformAccountQuery) FirstX

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

func (*PlatformAccountQuery) GroupBy

func (paq *PlatformAccountQuery) GroupBy(field string, fields ...string) *PlatformAccountGroupBy

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

Example:

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

client.PlatformAccount.Query().
	GroupBy(platformaccount.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PlatformAccountQuery) IDs

func (paq *PlatformAccountQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*PlatformAccountQuery) IDsX

func (paq *PlatformAccountQuery) IDsX(ctx context.Context) []uint64

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

func (*PlatformAccountQuery) Limit

func (paq *PlatformAccountQuery) Limit(limit int) *PlatformAccountQuery

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

func (*PlatformAccountQuery) Offset

func (paq *PlatformAccountQuery) Offset(offset int) *PlatformAccountQuery

Offset to start from.

func (*PlatformAccountQuery) Only

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

func (*PlatformAccountQuery) OnlyID

func (paq *PlatformAccountQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*PlatformAccountQuery) OnlyIDX

func (paq *PlatformAccountQuery) OnlyIDX(ctx context.Context) uint64

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

func (*PlatformAccountQuery) OnlyX

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

func (*PlatformAccountQuery) Order

Order specifies how the records should be ordered.

func (*PlatformAccountQuery) Select

func (paq *PlatformAccountQuery) Select(fields ...string) *PlatformAccountSelect

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

Example:

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

client.PlatformAccount.Query().
	Select(platformaccount.FieldCreatedAt).
	Scan(ctx, &v)

func (*PlatformAccountQuery) Unique

func (paq *PlatformAccountQuery) Unique(unique bool) *PlatformAccountQuery

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

Where adds a new predicate for the PlatformAccountQuery builder.

type PlatformAccountSelect

type PlatformAccountSelect struct {
	*PlatformAccountQuery
	// contains filtered or unexported fields
}

PlatformAccountSelect is the builder for selecting fields of PlatformAccount entities.

func (*PlatformAccountSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PlatformAccountSelect) Bool

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

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

func (*PlatformAccountSelect) BoolX

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

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

func (*PlatformAccountSelect) Bools

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

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

func (*PlatformAccountSelect) BoolsX

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

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

func (*PlatformAccountSelect) Float64

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

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

func (*PlatformAccountSelect) Float64X

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

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

func (*PlatformAccountSelect) Float64s

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

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

func (*PlatformAccountSelect) Float64sX

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

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

func (*PlatformAccountSelect) Int

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

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

func (*PlatformAccountSelect) IntX

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

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

func (*PlatformAccountSelect) Ints

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

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

func (*PlatformAccountSelect) IntsX

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

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

func (*PlatformAccountSelect) Scan

func (pas *PlatformAccountSelect) Scan(ctx context.Context, v any) error

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

func (*PlatformAccountSelect) ScanX

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

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

func (*PlatformAccountSelect) String

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

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

func (*PlatformAccountSelect) StringX

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

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

func (*PlatformAccountSelect) Strings

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

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

func (*PlatformAccountSelect) StringsX

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

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

type PlatformAccountUpdate

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

PlatformAccountUpdate is the builder for updating PlatformAccount entities.

func (*PlatformAccountUpdate) ClearDeletedAt

func (pau *PlatformAccountUpdate) ClearDeletedAt() *PlatformAccountUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PlatformAccountUpdate) ClearEmail

func (pau *PlatformAccountUpdate) ClearEmail() *PlatformAccountUpdate

ClearEmail clears the value of the "email" field.

func (*PlatformAccountUpdate) Exec

func (pau *PlatformAccountUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlatformAccountUpdate) ExecX

func (pau *PlatformAccountUpdate) ExecX(ctx context.Context)

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

func (*PlatformAccountUpdate) Mutation

Mutation returns the PlatformAccountMutation object of the builder.

func (*PlatformAccountUpdate) Save

func (pau *PlatformAccountUpdate) Save(ctx context.Context) (int, error)

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

func (*PlatformAccountUpdate) SaveX

func (pau *PlatformAccountUpdate) SaveX(ctx context.Context) int

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

func (*PlatformAccountUpdate) SetDeletedAt

func (pau *PlatformAccountUpdate) SetDeletedAt(t time.Time) *PlatformAccountUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PlatformAccountUpdate) SetEmail

SetEmail sets the "email" field.

func (*PlatformAccountUpdate) SetNillableDeletedAt

func (pau *PlatformAccountUpdate) SetNillableDeletedAt(t *time.Time) *PlatformAccountUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PlatformAccountUpdate) SetNillableEmail

func (pau *PlatformAccountUpdate) SetNillableEmail(s *string) *PlatformAccountUpdate

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

func (*PlatformAccountUpdate) SetNillablePassword

func (pau *PlatformAccountUpdate) SetNillablePassword(s *string) *PlatformAccountUpdate

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

func (*PlatformAccountUpdate) SetNillableUsername

func (pau *PlatformAccountUpdate) SetNillableUsername(s *string) *PlatformAccountUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*PlatformAccountUpdate) SetPassword

func (pau *PlatformAccountUpdate) SetPassword(s string) *PlatformAccountUpdate

SetPassword sets the "password" field.

func (*PlatformAccountUpdate) SetUpdatedAt

func (pau *PlatformAccountUpdate) SetUpdatedAt(t time.Time) *PlatformAccountUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PlatformAccountUpdate) SetUsername

func (pau *PlatformAccountUpdate) SetUsername(s string) *PlatformAccountUpdate

SetUsername sets the "username" field.

func (*PlatformAccountUpdate) Where

Where appends a list predicates to the PlatformAccountUpdate builder.

type PlatformAccountUpdateOne

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

PlatformAccountUpdateOne is the builder for updating a single PlatformAccount entity.

func (*PlatformAccountUpdateOne) ClearDeletedAt

func (pauo *PlatformAccountUpdateOne) ClearDeletedAt() *PlatformAccountUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PlatformAccountUpdateOne) ClearEmail

ClearEmail clears the value of the "email" field.

func (*PlatformAccountUpdateOne) Exec

Exec executes the query on the entity.

func (*PlatformAccountUpdateOne) ExecX

func (pauo *PlatformAccountUpdateOne) ExecX(ctx context.Context)

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

func (*PlatformAccountUpdateOne) Mutation

Mutation returns the PlatformAccountMutation object of the builder.

func (*PlatformAccountUpdateOne) Save

Save executes the query and returns the updated PlatformAccount entity.

func (*PlatformAccountUpdateOne) SaveX

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

func (*PlatformAccountUpdateOne) Select

func (pauo *PlatformAccountUpdateOne) Select(field string, fields ...string) *PlatformAccountUpdateOne

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

func (*PlatformAccountUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*PlatformAccountUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*PlatformAccountUpdateOne) SetNillableDeletedAt

func (pauo *PlatformAccountUpdateOne) SetNillableDeletedAt(t *time.Time) *PlatformAccountUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PlatformAccountUpdateOne) SetNillableEmail

func (pauo *PlatformAccountUpdateOne) SetNillableEmail(s *string) *PlatformAccountUpdateOne

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

func (*PlatformAccountUpdateOne) SetNillablePassword

func (pauo *PlatformAccountUpdateOne) SetNillablePassword(s *string) *PlatformAccountUpdateOne

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

func (*PlatformAccountUpdateOne) SetNillableUsername

func (pauo *PlatformAccountUpdateOne) SetNillableUsername(s *string) *PlatformAccountUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*PlatformAccountUpdateOne) SetPassword

SetPassword sets the "password" field.

func (*PlatformAccountUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PlatformAccountUpdateOne) SetUsername

SetUsername sets the "username" field.

func (*PlatformAccountUpdateOne) Where

Where appends a list predicates to the PlatformAccountUpdate builder.

type PlatformAccounts

type PlatformAccounts []*PlatformAccount

PlatformAccounts is a parsable slice of PlatformAccount.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Merchant is the client for interacting with the Merchant builders.
	Merchant *MerchantClient
	// MerchantAccount is the client for interacting with the MerchantAccount builders.
	MerchantAccount *MerchantAccountClient
	// PlatformAccount is the client for interacting with the PlatformAccount builders.
	PlatformAccount *PlatformAccountClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserLoginMethod is the client for interacting with the UserLoginMethod builders.
	UserLoginMethod *UserLoginMethodClient
	// 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 uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// user name
	Username string `json:"username,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryDefaultMerchant

func (u *User) QueryDefaultMerchant() *MerchantQuery

QueryDefaultMerchant queries the "default_merchant" edge of the User entity.

func (*User) QueryIntroducer

func (u *User) QueryIntroducer() *UserLoginMethodQuery

QueryIntroducer queries the "introducer" edge of the User entity.

func (*User) QueryLoginMethods

func (u *User) QueryLoginMethods() *UserLoginMethodQuery

QueryLoginMethods queries the "login_methods" edge of the User entity.

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 uint64) *UserDeleteOne

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

func (*UserClient) Get

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

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uint64) *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) QueryDefaultMerchant

func (c *UserClient) QueryDefaultMerchant(u *User) *MerchantQuery

QueryDefaultMerchant queries the default_merchant edge of a User.

func (*UserClient) QueryIntroducer

func (c *UserClient) QueryIntroducer(u *User) *UserLoginMethodQuery

QueryIntroducer queries the introducer edge of a User.

func (*UserClient) QueryLoginMethods

func (c *UserClient) QueryLoginMethods(u *User) *UserLoginMethodQuery

QueryLoginMethods queries the login_methods edge of a 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 uint64) *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) AddLoginMethodIDs

func (uc *UserCreate) AddLoginMethodIDs(ids ...uint64) *UserCreate

AddLoginMethodIDs adds the "login_methods" edge to the UserLoginMethod entity by IDs.

func (*UserCreate) AddLoginMethods

func (uc *UserCreate) AddLoginMethods(u ...*UserLoginMethod) *UserCreate

AddLoginMethods adds the "login_methods" edges to the UserLoginMethod 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) SetDefaultMerchant

func (uc *UserCreate) SetDefaultMerchant(m *Merchant) *UserCreate

SetDefaultMerchant sets the "default_merchant" edge to the Merchant entity.

func (*UserCreate) SetDefaultMerchantID

func (uc *UserCreate) SetDefaultMerchantID(id uint64) *UserCreate

SetDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by ID.

func (*UserCreate) SetDeletedAt

func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate

SetDeletedAt sets the "deleted_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uint64) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIntroducer

func (uc *UserCreate) SetIntroducer(u *UserLoginMethod) *UserCreate

SetIntroducer sets the "introducer" edge to the UserLoginMethod entity.

func (*UserCreate) SetIntroducerID

func (uc *UserCreate) SetIntroducerID(id uint64) *UserCreate

SetIntroducerID sets the "introducer" edge to the UserLoginMethod entity by ID.

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) SetNillableDefaultMerchantID

func (uc *UserCreate) SetNillableDefaultMerchantID(id *uint64) *UserCreate

SetNillableDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by ID if the given value is not nil.

func (*UserCreate) SetNillableDeletedAt

func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserCreate) SetNillableEmail

func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate

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

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uint64) *UserCreate

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

func (*UserCreate) SetNillableIntroducerID

func (uc *UserCreate) SetNillableIntroducerID(id *uint64) *UserCreate

SetNillableIntroducerID sets the "introducer" edge to the UserLoginMethod entity by ID if the given value is not nil.

func (*UserCreate) SetNillablePhone

func (uc *UserCreate) SetNillablePhone(s *string) *UserCreate

SetNillablePhone sets the "phone" 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) SetPhone

func (uc *UserCreate) SetPhone(s string) *UserCreate

SetPhone sets the "phone" 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 UserEdges

type UserEdges struct {
	// LoginMethods holds the value of the login_methods edge.
	LoginMethods []*UserLoginMethod `json:"login_methods,omitempty"`
	// Introducer holds the value of the introducer edge.
	Introducer *UserLoginMethod `json:"introducer,omitempty"`
	// DefaultMerchant holds the value of the default_merchant edge.
	DefaultMerchant *Merchant `json:"default_merchant,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) DefaultMerchantOrErr

func (e UserEdges) DefaultMerchantOrErr() (*Merchant, error)

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

func (UserEdges) IntroducerOrErr

func (e UserEdges) IntroducerOrErr() (*UserLoginMethod, error)

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

func (UserEdges) LoginMethodsOrErr

func (e UserEdges) LoginMethodsOrErr() ([]*UserLoginMethod, error)

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

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 UserLoginMethod

type UserLoginMethod struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// LoginType holds the value of the "login_type" field.
	LoginType string `json:"login_type,omitempty"`
	// Identifier holds the value of the "identifier" field.
	Identifier string `json:"identifier,omitempty"`
	// contains filtered or unexported fields
}

UserLoginMethod is the model entity for the UserLoginMethod schema.

func (*UserLoginMethod) String

func (ulm *UserLoginMethod) String() string

String implements the fmt.Stringer.

func (*UserLoginMethod) Unwrap

func (ulm *UserLoginMethod) Unwrap() *UserLoginMethod

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

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

func (*UserLoginMethod) Value

func (ulm *UserLoginMethod) Value(name string) (ent.Value, error)

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

type UserLoginMethodClient

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

UserLoginMethodClient is a client for the UserLoginMethod schema.

func NewUserLoginMethodClient

func NewUserLoginMethodClient(c config) *UserLoginMethodClient

NewUserLoginMethodClient returns a client for the UserLoginMethod from the given config.

func (*UserLoginMethodClient) Create

Create returns a builder for creating a UserLoginMethod entity.

func (*UserLoginMethodClient) CreateBulk

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

func (*UserLoginMethodClient) Delete

Delete returns a delete builder for UserLoginMethod.

func (*UserLoginMethodClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserLoginMethodClient) DeleteOneID

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

func (*UserLoginMethodClient) Get

Get returns a UserLoginMethod entity by its id.

func (*UserLoginMethodClient) GetX

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

func (*UserLoginMethodClient) Hooks

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

Hooks returns the client hooks.

func (*UserLoginMethodClient) Intercept

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

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

func (*UserLoginMethodClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserLoginMethodClient) MapCreateBulk

func (c *UserLoginMethodClient) MapCreateBulk(slice any, setFunc func(*UserLoginMethodCreate, int)) *UserLoginMethodCreateBulk

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

Query returns a query builder for UserLoginMethod.

func (*UserLoginMethodClient) Update

Update returns an update builder for UserLoginMethod.

func (*UserLoginMethodClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserLoginMethodClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*UserLoginMethodClient) Use

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

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

type UserLoginMethodCreate

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

UserLoginMethodCreate is the builder for creating a UserLoginMethod entity.

func (*UserLoginMethodCreate) Exec

func (ulmc *UserLoginMethodCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserLoginMethodCreate) ExecX

func (ulmc *UserLoginMethodCreate) ExecX(ctx context.Context)

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

func (*UserLoginMethodCreate) Mutation

Mutation returns the UserLoginMethodMutation object of the builder.

func (*UserLoginMethodCreate) Save

Save creates the UserLoginMethod in the database.

func (*UserLoginMethodCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserLoginMethodCreate) SetCreatedAt

func (ulmc *UserLoginMethodCreate) SetCreatedAt(t time.Time) *UserLoginMethodCreate

SetCreatedAt sets the "created_at" field.

func (*UserLoginMethodCreate) SetDeletedAt

func (ulmc *UserLoginMethodCreate) SetDeletedAt(t time.Time) *UserLoginMethodCreate

SetDeletedAt sets the "deleted_at" field.

func (*UserLoginMethodCreate) SetID

SetID sets the "id" field.

func (*UserLoginMethodCreate) SetIdentifier

func (ulmc *UserLoginMethodCreate) SetIdentifier(s string) *UserLoginMethodCreate

SetIdentifier sets the "identifier" field.

func (*UserLoginMethodCreate) SetLoginType

func (ulmc *UserLoginMethodCreate) SetLoginType(s string) *UserLoginMethodCreate

SetLoginType sets the "login_type" field.

func (*UserLoginMethodCreate) SetNillableCreatedAt

func (ulmc *UserLoginMethodCreate) SetNillableCreatedAt(t *time.Time) *UserLoginMethodCreate

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

func (*UserLoginMethodCreate) SetNillableDeletedAt

func (ulmc *UserLoginMethodCreate) SetNillableDeletedAt(t *time.Time) *UserLoginMethodCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserLoginMethodCreate) SetNillableID

func (ulmc *UserLoginMethodCreate) SetNillableID(u *uint64) *UserLoginMethodCreate

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

func (*UserLoginMethodCreate) SetNillableUpdatedAt

func (ulmc *UserLoginMethodCreate) SetNillableUpdatedAt(t *time.Time) *UserLoginMethodCreate

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

func (*UserLoginMethodCreate) SetUpdatedAt

func (ulmc *UserLoginMethodCreate) SetUpdatedAt(t time.Time) *UserLoginMethodCreate

SetUpdatedAt sets the "updated_at" field.

type UserLoginMethodCreateBulk

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

UserLoginMethodCreateBulk is the builder for creating many UserLoginMethod entities in bulk.

func (*UserLoginMethodCreateBulk) Exec

Exec executes the query.

func (*UserLoginMethodCreateBulk) ExecX

func (ulmcb *UserLoginMethodCreateBulk) ExecX(ctx context.Context)

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

func (*UserLoginMethodCreateBulk) Save

Save creates the UserLoginMethod entities in the database.

func (*UserLoginMethodCreateBulk) SaveX

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

type UserLoginMethodDelete

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

UserLoginMethodDelete is the builder for deleting a UserLoginMethod entity.

func (*UserLoginMethodDelete) Exec

func (ulmd *UserLoginMethodDelete) Exec(ctx context.Context) (int, error)

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

func (*UserLoginMethodDelete) ExecX

func (ulmd *UserLoginMethodDelete) ExecX(ctx context.Context) int

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

func (*UserLoginMethodDelete) Where

Where appends a list predicates to the UserLoginMethodDelete builder.

type UserLoginMethodDeleteOne

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

UserLoginMethodDeleteOne is the builder for deleting a single UserLoginMethod entity.

func (*UserLoginMethodDeleteOne) Exec

func (ulmdo *UserLoginMethodDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserLoginMethodDeleteOne) ExecX

func (ulmdo *UserLoginMethodDeleteOne) ExecX(ctx context.Context)

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

func (*UserLoginMethodDeleteOne) Where

Where appends a list predicates to the UserLoginMethodDelete builder.

type UserLoginMethodGroupBy

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

UserLoginMethodGroupBy is the group-by builder for UserLoginMethod entities.

func (*UserLoginMethodGroupBy) Aggregate

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

func (*UserLoginMethodGroupBy) Bool

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

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

func (*UserLoginMethodGroupBy) BoolX

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

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

func (*UserLoginMethodGroupBy) Bools

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

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

func (*UserLoginMethodGroupBy) BoolsX

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

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

func (*UserLoginMethodGroupBy) Float64

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

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

func (*UserLoginMethodGroupBy) Float64X

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

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

func (*UserLoginMethodGroupBy) Float64s

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

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

func (*UserLoginMethodGroupBy) Float64sX

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

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

func (*UserLoginMethodGroupBy) Int

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

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

func (*UserLoginMethodGroupBy) IntX

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

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

func (*UserLoginMethodGroupBy) Ints

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

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

func (*UserLoginMethodGroupBy) IntsX

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

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

func (*UserLoginMethodGroupBy) Scan

func (ulmgb *UserLoginMethodGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserLoginMethodGroupBy) ScanX

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

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

func (*UserLoginMethodGroupBy) String

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

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

func (*UserLoginMethodGroupBy) StringX

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

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

func (*UserLoginMethodGroupBy) Strings

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

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

func (*UserLoginMethodGroupBy) StringsX

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

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

type UserLoginMethodMutation

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

UserLoginMethodMutation represents an operation that mutates the UserLoginMethod nodes in the graph.

func (*UserLoginMethodMutation) AddField

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

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

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

func (*UserLoginMethodMutation) AddedField

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

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

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

func (*UserLoginMethodMutation) AddedIDs

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

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

func (*UserLoginMethodMutation) ClearDeletedAt

func (m *UserLoginMethodMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserLoginMethodMutation) ClearEdge

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

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

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

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

func (*UserLoginMethodMutation) ClearedFields

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

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

func (UserLoginMethodMutation) Client

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

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

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

func (*UserLoginMethodMutation) DeletedAt

func (m *UserLoginMethodMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UserLoginMethodMutation) DeletedAtCleared

func (m *UserLoginMethodMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UserLoginMethodMutation) EdgeCleared

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

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

func (*UserLoginMethodMutation) Field

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

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

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

func (*UserLoginMethodMutation) Fields

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

func (m *UserLoginMethodMutation) ID() (id uint64, 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 (*UserLoginMethodMutation) IDs

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

func (*UserLoginMethodMutation) Identifier

func (m *UserLoginMethodMutation) Identifier() (r string, exists bool)

Identifier returns the value of the "identifier" field in the mutation.

func (*UserLoginMethodMutation) LoginType

func (m *UserLoginMethodMutation) LoginType() (r string, exists bool)

LoginType returns the value of the "login_type" field in the mutation.

func (*UserLoginMethodMutation) OldCreatedAt

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

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

func (m *UserLoginMethodMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the UserLoginMethod entity. If the UserLoginMethod 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 (*UserLoginMethodMutation) OldField

func (m *UserLoginMethodMutation) 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 (*UserLoginMethodMutation) OldIdentifier

func (m *UserLoginMethodMutation) OldIdentifier(ctx context.Context) (v string, err error)

OldIdentifier returns the old "identifier" field's value of the UserLoginMethod entity. If the UserLoginMethod 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 (*UserLoginMethodMutation) OldLoginType

func (m *UserLoginMethodMutation) OldLoginType(ctx context.Context) (v string, err error)

OldLoginType returns the old "login_type" field's value of the UserLoginMethod entity. If the UserLoginMethod 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 (*UserLoginMethodMutation) OldUpdatedAt

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

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

func (m *UserLoginMethodMutation) Op() Op

Op returns the operation name.

func (*UserLoginMethodMutation) RemovedEdges

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

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

func (*UserLoginMethodMutation) RemovedIDs

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

func (m *UserLoginMethodMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserLoginMethodMutation) ResetDeletedAt

func (m *UserLoginMethodMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*UserLoginMethodMutation) ResetEdge

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

func (m *UserLoginMethodMutation) 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 (*UserLoginMethodMutation) ResetIdentifier

func (m *UserLoginMethodMutation) ResetIdentifier()

ResetIdentifier resets all changes to the "identifier" field.

func (*UserLoginMethodMutation) ResetLoginType

func (m *UserLoginMethodMutation) ResetLoginType()

ResetLoginType resets all changes to the "login_type" field.

func (*UserLoginMethodMutation) ResetUpdatedAt

func (m *UserLoginMethodMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserLoginMethodMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserLoginMethodMutation) SetDeletedAt

func (m *UserLoginMethodMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*UserLoginMethodMutation) SetField

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

func (m *UserLoginMethodMutation) SetID(id uint64)

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

func (*UserLoginMethodMutation) SetIdentifier

func (m *UserLoginMethodMutation) SetIdentifier(s string)

SetIdentifier sets the "identifier" field.

func (*UserLoginMethodMutation) SetLoginType

func (m *UserLoginMethodMutation) SetLoginType(s string)

SetLoginType sets the "login_type" field.

func (*UserLoginMethodMutation) SetOp

func (m *UserLoginMethodMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserLoginMethodMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (UserLoginMethodMutation) Tx

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

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

func (*UserLoginMethodMutation) Type

func (m *UserLoginMethodMutation) Type() string

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

func (*UserLoginMethodMutation) UpdatedAt

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

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

func (*UserLoginMethodMutation) Where

Where appends a list predicates to the UserLoginMethodMutation builder.

func (*UserLoginMethodMutation) WhereP

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

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

type UserLoginMethodQuery

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

UserLoginMethodQuery is the builder for querying UserLoginMethod entities.

func (*UserLoginMethodQuery) Aggregate

func (ulmq *UserLoginMethodQuery) Aggregate(fns ...AggregateFunc) *UserLoginMethodSelect

Aggregate returns a UserLoginMethodSelect configured with the given aggregations.

func (*UserLoginMethodQuery) All

All executes the query and returns a list of UserLoginMethods.

func (*UserLoginMethodQuery) AllX

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

func (*UserLoginMethodQuery) Clone

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

func (*UserLoginMethodQuery) Count

func (ulmq *UserLoginMethodQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserLoginMethodQuery) CountX

func (ulmq *UserLoginMethodQuery) CountX(ctx context.Context) int

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

func (*UserLoginMethodQuery) Exist

func (ulmq *UserLoginMethodQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserLoginMethodQuery) ExistX

func (ulmq *UserLoginMethodQuery) ExistX(ctx context.Context) bool

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

func (*UserLoginMethodQuery) First

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

func (*UserLoginMethodQuery) FirstID

func (ulmq *UserLoginMethodQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*UserLoginMethodQuery) FirstIDX

func (ulmq *UserLoginMethodQuery) FirstIDX(ctx context.Context) uint64

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

func (*UserLoginMethodQuery) FirstX

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

func (*UserLoginMethodQuery) GroupBy

func (ulmq *UserLoginMethodQuery) GroupBy(field string, fields ...string) *UserLoginMethodGroupBy

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

Example:

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

client.UserLoginMethod.Query().
	GroupBy(userloginmethod.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserLoginMethodQuery) IDs

func (ulmq *UserLoginMethodQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*UserLoginMethodQuery) IDsX

func (ulmq *UserLoginMethodQuery) IDsX(ctx context.Context) []uint64

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

func (*UserLoginMethodQuery) Limit

func (ulmq *UserLoginMethodQuery) Limit(limit int) *UserLoginMethodQuery

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

func (*UserLoginMethodQuery) Offset

func (ulmq *UserLoginMethodQuery) Offset(offset int) *UserLoginMethodQuery

Offset to start from.

func (*UserLoginMethodQuery) Only

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

func (*UserLoginMethodQuery) OnlyID

func (ulmq *UserLoginMethodQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*UserLoginMethodQuery) OnlyIDX

func (ulmq *UserLoginMethodQuery) OnlyIDX(ctx context.Context) uint64

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

func (*UserLoginMethodQuery) OnlyX

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

func (*UserLoginMethodQuery) Order

Order specifies how the records should be ordered.

func (*UserLoginMethodQuery) Select

func (ulmq *UserLoginMethodQuery) Select(fields ...string) *UserLoginMethodSelect

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

Example:

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

client.UserLoginMethod.Query().
	Select(userloginmethod.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserLoginMethodQuery) Unique

func (ulmq *UserLoginMethodQuery) Unique(unique bool) *UserLoginMethodQuery

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

Where adds a new predicate for the UserLoginMethodQuery builder.

type UserLoginMethodSelect

type UserLoginMethodSelect struct {
	*UserLoginMethodQuery
	// contains filtered or unexported fields
}

UserLoginMethodSelect is the builder for selecting fields of UserLoginMethod entities.

func (*UserLoginMethodSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*UserLoginMethodSelect) Bool

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

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

func (*UserLoginMethodSelect) BoolX

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

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

func (*UserLoginMethodSelect) Bools

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

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

func (*UserLoginMethodSelect) BoolsX

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

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

func (*UserLoginMethodSelect) Float64

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

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

func (*UserLoginMethodSelect) Float64X

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

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

func (*UserLoginMethodSelect) Float64s

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

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

func (*UserLoginMethodSelect) Float64sX

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

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

func (*UserLoginMethodSelect) Int

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

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

func (*UserLoginMethodSelect) IntX

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

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

func (*UserLoginMethodSelect) Ints

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

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

func (*UserLoginMethodSelect) IntsX

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

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

func (*UserLoginMethodSelect) Scan

func (ulms *UserLoginMethodSelect) Scan(ctx context.Context, v any) error

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

func (*UserLoginMethodSelect) ScanX

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

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

func (*UserLoginMethodSelect) String

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

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

func (*UserLoginMethodSelect) StringX

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

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

func (*UserLoginMethodSelect) Strings

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

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

func (*UserLoginMethodSelect) StringsX

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

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

type UserLoginMethodUpdate

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

UserLoginMethodUpdate is the builder for updating UserLoginMethod entities.

func (*UserLoginMethodUpdate) ClearDeletedAt

func (ulmu *UserLoginMethodUpdate) ClearDeletedAt() *UserLoginMethodUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserLoginMethodUpdate) Exec

func (ulmu *UserLoginMethodUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserLoginMethodUpdate) ExecX

func (ulmu *UserLoginMethodUpdate) ExecX(ctx context.Context)

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

func (*UserLoginMethodUpdate) Mutation

Mutation returns the UserLoginMethodMutation object of the builder.

func (*UserLoginMethodUpdate) Save

func (ulmu *UserLoginMethodUpdate) Save(ctx context.Context) (int, error)

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

func (*UserLoginMethodUpdate) SaveX

func (ulmu *UserLoginMethodUpdate) SaveX(ctx context.Context) int

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

func (*UserLoginMethodUpdate) SetDeletedAt

func (ulmu *UserLoginMethodUpdate) SetDeletedAt(t time.Time) *UserLoginMethodUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UserLoginMethodUpdate) SetIdentifier

func (ulmu *UserLoginMethodUpdate) SetIdentifier(s string) *UserLoginMethodUpdate

SetIdentifier sets the "identifier" field.

func (*UserLoginMethodUpdate) SetLoginType

func (ulmu *UserLoginMethodUpdate) SetLoginType(s string) *UserLoginMethodUpdate

SetLoginType sets the "login_type" field.

func (*UserLoginMethodUpdate) SetNillableDeletedAt

func (ulmu *UserLoginMethodUpdate) SetNillableDeletedAt(t *time.Time) *UserLoginMethodUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserLoginMethodUpdate) SetNillableIdentifier

func (ulmu *UserLoginMethodUpdate) SetNillableIdentifier(s *string) *UserLoginMethodUpdate

SetNillableIdentifier sets the "identifier" field if the given value is not nil.

func (*UserLoginMethodUpdate) SetNillableLoginType

func (ulmu *UserLoginMethodUpdate) SetNillableLoginType(s *string) *UserLoginMethodUpdate

SetNillableLoginType sets the "login_type" field if the given value is not nil.

func (*UserLoginMethodUpdate) SetUpdatedAt

func (ulmu *UserLoginMethodUpdate) SetUpdatedAt(t time.Time) *UserLoginMethodUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserLoginMethodUpdate) Where

Where appends a list predicates to the UserLoginMethodUpdate builder.

type UserLoginMethodUpdateOne

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

UserLoginMethodUpdateOne is the builder for updating a single UserLoginMethod entity.

func (*UserLoginMethodUpdateOne) ClearDeletedAt

func (ulmuo *UserLoginMethodUpdateOne) ClearDeletedAt() *UserLoginMethodUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserLoginMethodUpdateOne) Exec

func (ulmuo *UserLoginMethodUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserLoginMethodUpdateOne) ExecX

func (ulmuo *UserLoginMethodUpdateOne) ExecX(ctx context.Context)

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

func (*UserLoginMethodUpdateOne) Mutation

Mutation returns the UserLoginMethodMutation object of the builder.

func (*UserLoginMethodUpdateOne) Save

Save executes the query and returns the updated UserLoginMethod entity.

func (*UserLoginMethodUpdateOne) SaveX

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

func (*UserLoginMethodUpdateOne) Select

func (ulmuo *UserLoginMethodUpdateOne) Select(field string, fields ...string) *UserLoginMethodUpdateOne

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

func (*UserLoginMethodUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*UserLoginMethodUpdateOne) SetIdentifier

func (ulmuo *UserLoginMethodUpdateOne) SetIdentifier(s string) *UserLoginMethodUpdateOne

SetIdentifier sets the "identifier" field.

func (*UserLoginMethodUpdateOne) SetLoginType

SetLoginType sets the "login_type" field.

func (*UserLoginMethodUpdateOne) SetNillableDeletedAt

func (ulmuo *UserLoginMethodUpdateOne) SetNillableDeletedAt(t *time.Time) *UserLoginMethodUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserLoginMethodUpdateOne) SetNillableIdentifier

func (ulmuo *UserLoginMethodUpdateOne) SetNillableIdentifier(s *string) *UserLoginMethodUpdateOne

SetNillableIdentifier sets the "identifier" field if the given value is not nil.

func (*UserLoginMethodUpdateOne) SetNillableLoginType

func (ulmuo *UserLoginMethodUpdateOne) SetNillableLoginType(s *string) *UserLoginMethodUpdateOne

SetNillableLoginType sets the "login_type" field if the given value is not nil.

func (*UserLoginMethodUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserLoginMethodUpdateOne) Where

Where appends a list predicates to the UserLoginMethodUpdate builder.

type UserLoginMethods

type UserLoginMethods []*UserLoginMethod

UserLoginMethods is a parsable slice of UserLoginMethod.

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) AddLoginMethodIDs

func (m *UserMutation) AddLoginMethodIDs(ids ...uint64)

AddLoginMethodIDs adds the "login_methods" edge to the UserLoginMethod entity by ids.

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) ClearDefaultMerchant

func (m *UserMutation) ClearDefaultMerchant()

ClearDefaultMerchant clears the "default_merchant" edge to the Merchant entity.

func (*UserMutation) ClearDeletedAt

func (m *UserMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

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) ClearEmail

func (m *UserMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

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) ClearIntroducer

func (m *UserMutation) ClearIntroducer()

ClearIntroducer clears the "introducer" edge to the UserLoginMethod entity.

func (*UserMutation) ClearLoginMethods

func (m *UserMutation) ClearLoginMethods()

ClearLoginMethods clears the "login_methods" edge to the UserLoginMethod entity.

func (*UserMutation) ClearPhone

func (m *UserMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

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) DefaultMerchantCleared

func (m *UserMutation) DefaultMerchantCleared() bool

DefaultMerchantCleared reports if the "default_merchant" edge to the Merchant entity was cleared.

func (*UserMutation) DefaultMerchantID

func (m *UserMutation) DefaultMerchantID() (id uint64, exists bool)

DefaultMerchantID returns the "default_merchant" edge ID in the mutation.

func (*UserMutation) DefaultMerchantIDs

func (m *UserMutation) DefaultMerchantIDs() (ids []uint64)

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

func (*UserMutation) DeletedAt

func (m *UserMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UserMutation) DeletedAtCleared

func (m *UserMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this 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) Email

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

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

func (*UserMutation) EmailCleared

func (m *UserMutation) EmailCleared() bool

EmailCleared returns if the "email" field 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 uint64, 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) ([]uint64, 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) IntroducerCleared

func (m *UserMutation) IntroducerCleared() bool

IntroducerCleared reports if the "introducer" edge to the UserLoginMethod entity was cleared.

func (*UserMutation) IntroducerID

func (m *UserMutation) IntroducerID() (id uint64, exists bool)

IntroducerID returns the "introducer" edge ID in the mutation.

func (*UserMutation) IntroducerIDs

func (m *UserMutation) IntroducerIDs() (ids []uint64)

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

func (*UserMutation) LoginMethodsCleared

func (m *UserMutation) LoginMethodsCleared() bool

LoginMethodsCleared reports if the "login_methods" edge to the UserLoginMethod entity was cleared.

func (*UserMutation) LoginMethodsIDs

func (m *UserMutation) LoginMethodsIDs() (ids []uint64)

LoginMethodsIDs returns the "login_methods" edge IDs 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) OldDeletedAt

func (m *UserMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_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) OldEmail

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

OldEmail returns the old "email" 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) OldPhone

func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" 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) Phone

func (m *UserMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*UserMutation) PhoneCleared

func (m *UserMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*UserMutation) RemoveLoginMethodIDs

func (m *UserMutation) RemoveLoginMethodIDs(ids ...uint64)

RemoveLoginMethodIDs removes the "login_methods" edge to the UserLoginMethod entity by IDs.

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) RemovedLoginMethodsIDs

func (m *UserMutation) RemovedLoginMethodsIDs() (ids []uint64)

RemovedLoginMethods returns the removed IDs of the "login_methods" edge to the UserLoginMethod entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDefaultMerchant

func (m *UserMutation) ResetDefaultMerchant()

ResetDefaultMerchant resets all changes to the "default_merchant" edge.

func (*UserMutation) ResetDeletedAt

func (m *UserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_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) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

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) ResetIntroducer

func (m *UserMutation) ResetIntroducer()

ResetIntroducer resets all changes to the "introducer" edge.

func (*UserMutation) ResetLoginMethods

func (m *UserMutation) ResetLoginMethods()

ResetLoginMethods resets all changes to the "login_methods" edge.

func (*UserMutation) ResetPhone

func (m *UserMutation) ResetPhone()

ResetPhone resets all changes to the "phone" 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) SetDefaultMerchantID

func (m *UserMutation) SetDefaultMerchantID(id uint64)

SetDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by id.

func (*UserMutation) SetDeletedAt

func (m *UserMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" 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) SetID

func (m *UserMutation) SetID(id uint64)

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

func (*UserMutation) SetIntroducerID

func (m *UserMutation) SetIntroducerID(id uint64)

SetIntroducerID sets the "introducer" edge to the UserLoginMethod entity by id.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPhone

func (m *UserMutation) SetPhone(s string)

SetPhone sets the "phone" 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 uint64, 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) uint64

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

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uint64

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 uint64, 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) uint64

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) QueryDefaultMerchant

func (uq *UserQuery) QueryDefaultMerchant() *MerchantQuery

QueryDefaultMerchant chains the current query on the "default_merchant" edge.

func (*UserQuery) QueryIntroducer

func (uq *UserQuery) QueryIntroducer() *UserLoginMethodQuery

QueryIntroducer chains the current query on the "introducer" edge.

func (*UserQuery) QueryLoginMethods

func (uq *UserQuery) QueryLoginMethods() *UserLoginMethodQuery

QueryLoginMethods chains the current query on the "login_methods" edge.

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	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.

func (*UserQuery) WithDefaultMerchant

func (uq *UserQuery) WithDefaultMerchant(opts ...func(*MerchantQuery)) *UserQuery

WithDefaultMerchant tells the query-builder to eager-load the nodes that are connected to the "default_merchant" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithIntroducer

func (uq *UserQuery) WithIntroducer(opts ...func(*UserLoginMethodQuery)) *UserQuery

WithIntroducer tells the query-builder to eager-load the nodes that are connected to the "introducer" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithLoginMethods

func (uq *UserQuery) WithLoginMethods(opts ...func(*UserLoginMethodQuery)) *UserQuery

WithLoginMethods tells the query-builder to eager-load the nodes that are connected to the "login_methods" edge. The optional arguments are used to configure the query builder of the edge.

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) AddLoginMethodIDs

func (uu *UserUpdate) AddLoginMethodIDs(ids ...uint64) *UserUpdate

AddLoginMethodIDs adds the "login_methods" edge to the UserLoginMethod entity by IDs.

func (*UserUpdate) AddLoginMethods

func (uu *UserUpdate) AddLoginMethods(u ...*UserLoginMethod) *UserUpdate

AddLoginMethods adds the "login_methods" edges to the UserLoginMethod entity.

func (*UserUpdate) ClearDefaultMerchant

func (uu *UserUpdate) ClearDefaultMerchant() *UserUpdate

ClearDefaultMerchant clears the "default_merchant" edge to the Merchant entity.

func (*UserUpdate) ClearDeletedAt

func (uu *UserUpdate) ClearDeletedAt() *UserUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdate) ClearEmail

func (uu *UserUpdate) ClearEmail() *UserUpdate

ClearEmail clears the value of the "email" field.

func (*UserUpdate) ClearIntroducer

func (uu *UserUpdate) ClearIntroducer() *UserUpdate

ClearIntroducer clears the "introducer" edge to the UserLoginMethod entity.

func (*UserUpdate) ClearLoginMethods

func (uu *UserUpdate) ClearLoginMethods() *UserUpdate

ClearLoginMethods clears all "login_methods" edges to the UserLoginMethod entity.

func (*UserUpdate) ClearPhone

func (uu *UserUpdate) ClearPhone() *UserUpdate

ClearPhone clears the value of the "phone" field.

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) RemoveLoginMethodIDs

func (uu *UserUpdate) RemoveLoginMethodIDs(ids ...uint64) *UserUpdate

RemoveLoginMethodIDs removes the "login_methods" edge to UserLoginMethod entities by IDs.

func (*UserUpdate) RemoveLoginMethods

func (uu *UserUpdate) RemoveLoginMethods(u ...*UserLoginMethod) *UserUpdate

RemoveLoginMethods removes "login_methods" edges to UserLoginMethod entities.

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) SetDefaultMerchant

func (uu *UserUpdate) SetDefaultMerchant(m *Merchant) *UserUpdate

SetDefaultMerchant sets the "default_merchant" edge to the Merchant entity.

func (*UserUpdate) SetDefaultMerchantID

func (uu *UserUpdate) SetDefaultMerchantID(id uint64) *UserUpdate

SetDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by ID.

func (*UserUpdate) SetDeletedAt

func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetIntroducer

func (uu *UserUpdate) SetIntroducer(u *UserLoginMethod) *UserUpdate

SetIntroducer sets the "introducer" edge to the UserLoginMethod entity.

func (*UserUpdate) SetIntroducerID

func (uu *UserUpdate) SetIntroducerID(id uint64) *UserUpdate

SetIntroducerID sets the "introducer" edge to the UserLoginMethod entity by ID.

func (*UserUpdate) SetNillableDefaultMerchantID

func (uu *UserUpdate) SetNillableDefaultMerchantID(id *uint64) *UserUpdate

SetNillableDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableDeletedAt

func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableIntroducerID

func (uu *UserUpdate) SetNillableIntroducerID(id *uint64) *UserUpdate

SetNillableIntroducerID sets the "introducer" edge to the UserLoginMethod entity by ID if the given value is not nil.

func (*UserUpdate) SetNillablePhone

func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate

SetNillablePhone sets the "phone" 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) SetPhone

func (uu *UserUpdate) SetPhone(s string) *UserUpdate

SetPhone sets the "phone" 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) AddLoginMethodIDs

func (uuo *UserUpdateOne) AddLoginMethodIDs(ids ...uint64) *UserUpdateOne

AddLoginMethodIDs adds the "login_methods" edge to the UserLoginMethod entity by IDs.

func (*UserUpdateOne) AddLoginMethods

func (uuo *UserUpdateOne) AddLoginMethods(u ...*UserLoginMethod) *UserUpdateOne

AddLoginMethods adds the "login_methods" edges to the UserLoginMethod entity.

func (*UserUpdateOne) ClearDefaultMerchant

func (uuo *UserUpdateOne) ClearDefaultMerchant() *UserUpdateOne

ClearDefaultMerchant clears the "default_merchant" edge to the Merchant entity.

func (*UserUpdateOne) ClearDeletedAt

func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdateOne) ClearEmail

func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne

ClearEmail clears the value of the "email" field.

func (*UserUpdateOne) ClearIntroducer

func (uuo *UserUpdateOne) ClearIntroducer() *UserUpdateOne

ClearIntroducer clears the "introducer" edge to the UserLoginMethod entity.

func (*UserUpdateOne) ClearLoginMethods

func (uuo *UserUpdateOne) ClearLoginMethods() *UserUpdateOne

ClearLoginMethods clears all "login_methods" edges to the UserLoginMethod entity.

func (*UserUpdateOne) ClearPhone

func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne

ClearPhone clears the value of the "phone" field.

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) RemoveLoginMethodIDs

func (uuo *UserUpdateOne) RemoveLoginMethodIDs(ids ...uint64) *UserUpdateOne

RemoveLoginMethodIDs removes the "login_methods" edge to UserLoginMethod entities by IDs.

func (*UserUpdateOne) RemoveLoginMethods

func (uuo *UserUpdateOne) RemoveLoginMethods(u ...*UserLoginMethod) *UserUpdateOne

RemoveLoginMethods removes "login_methods" edges to UserLoginMethod entities.

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) SetDefaultMerchant

func (uuo *UserUpdateOne) SetDefaultMerchant(m *Merchant) *UserUpdateOne

SetDefaultMerchant sets the "default_merchant" edge to the Merchant entity.

func (*UserUpdateOne) SetDefaultMerchantID

func (uuo *UserUpdateOne) SetDefaultMerchantID(id uint64) *UserUpdateOne

SetDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by ID.

func (*UserUpdateOne) SetDeletedAt

func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetIntroducer

func (uuo *UserUpdateOne) SetIntroducer(u *UserLoginMethod) *UserUpdateOne

SetIntroducer sets the "introducer" edge to the UserLoginMethod entity.

func (*UserUpdateOne) SetIntroducerID

func (uuo *UserUpdateOne) SetIntroducerID(id uint64) *UserUpdateOne

SetIntroducerID sets the "introducer" edge to the UserLoginMethod entity by ID.

func (*UserUpdateOne) SetNillableDefaultMerchantID

func (uuo *UserUpdateOne) SetNillableDefaultMerchantID(id *uint64) *UserUpdateOne

SetNillableDefaultMerchantID sets the "default_merchant" edge to the Merchant entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableDeletedAt

func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIntroducerID

func (uuo *UserUpdateOne) SetNillableIntroducerID(id *uint64) *UserUpdateOne

SetNillableIntroducerID sets the "introducer" edge to the UserLoginMethod entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillablePhone

func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne

SetNillablePhone sets the "phone" 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) SetPhone

func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne

SetPhone sets the "phone" 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