ent

package
v0.0.0-...-81e723e Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT 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.
	TypeAdmin           = "Admin"
	TypeBank            = "Bank"
	TypeCountry         = "Country"
	TypeCountryLocation = "CountryLocation"
	TypeUser            = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Admin

type Admin struct {

	// ID of the ent.
	// Primary key for the admin
	ID uint64 `json:"id,omitempty"`
	// Username of the admin
	Username string `json:"username,omitempty"`
	// Full name of the admin
	Name string `json:"name,omitempty"`
	// Email address of the admin
	Email string `json:"email,omitempty"`
	// Timestamp when email was verified
	EmailVerifiedAt *time.Time `json:"email_verified_at,omitempty"`
	// Password for the admin
	Password string `json:"password,omitempty"`
	// Second password for the admin
	Password2 string `json:"password2,omitempty"`
	// Preferred language of the admin
	Lang string `json:"lang,omitempty"`
	// Avatar of the admin
	Avatar *string `json:"avatar,omitempty"`
	// Type of the admin
	Type uint8 `json:"type,omitempty"`
	// Record creation timestamp
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Record update timestamp
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Record deleted timestamp
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// contains filtered or unexported fields
}

Admin is the model entity for the Admin schema.

func (*Admin) ExecContext

func (c *Admin) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Admin) QueryContext

func (c *Admin) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Admin) String

func (a *Admin) String() string

String implements the fmt.Stringer.

func (*Admin) Unwrap

func (a *Admin) Unwrap() *Admin

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

func (a *Admin) Update() *AdminUpdateOne

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

func (*Admin) Value

func (a *Admin) Value(name string) (ent.Value, error)

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

type AdminClient

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

AdminClient is a client for the Admin schema.

func NewAdminClient

func NewAdminClient(c config) *AdminClient

NewAdminClient returns a client for the Admin from the given config.

func (*AdminClient) Create

func (c *AdminClient) Create() *AdminCreate

Create returns a builder for creating a Admin entity.

func (*AdminClient) CreateBulk

func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk

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

func (*AdminClient) Delete

func (c *AdminClient) Delete() *AdminDelete

Delete returns a delete builder for Admin.

func (*AdminClient) DeleteOne

func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AdminClient) DeleteOneID

func (c *AdminClient) DeleteOneID(id uint64) *AdminDeleteOne

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

func (*AdminClient) ExecContext

func (c *AdminClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminClient) Get

func (c *AdminClient) Get(ctx context.Context, id uint64) (*Admin, error)

Get returns a Admin entity by its id.

func (*AdminClient) GetX

func (c *AdminClient) GetX(ctx context.Context, id uint64) *Admin

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

func (*AdminClient) Hooks

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

Hooks returns the client hooks.

func (*AdminClient) Intercept

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

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

func (*AdminClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AdminClient) MapCreateBulk

func (c *AdminClient) MapCreateBulk(slice any, setFunc func(*AdminCreate, int)) *AdminCreateBulk

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

func (c *AdminClient) Query() *AdminQuery

Query returns a query builder for Admin.

func (*AdminClient) QueryContext

func (c *AdminClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminClient) Update

func (c *AdminClient) Update() *AdminUpdate

Update returns an update builder for Admin.

func (*AdminClient) UpdateOne

func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AdminClient) UpdateOneID

func (c *AdminClient) UpdateOneID(id uint64) *AdminUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AdminClient) Use

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

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

type AdminCreate

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

AdminCreate is the builder for creating a Admin entity.

func (*AdminCreate) Exec

func (ac *AdminCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminCreate) ExecContext

func (c *AdminCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminCreate) ExecX

func (ac *AdminCreate) ExecX(ctx context.Context)

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

func (*AdminCreate) Mutation

func (ac *AdminCreate) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminCreate) OnConflict

func (ac *AdminCreate) OnConflict(opts ...sql.ConflictOption) *AdminUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Admin.Create().
	SetUsername(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AdminUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*AdminCreate) OnConflictColumns

func (ac *AdminCreate) OnConflictColumns(columns ...string) *AdminUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Admin.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*AdminCreate) QueryContext

func (c *AdminCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminCreate) Save

func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)

Save creates the Admin in the database.

func (*AdminCreate) SaveX

func (ac *AdminCreate) SaveX(ctx context.Context) *Admin

SaveX calls Save and panics if Save returns an error.

func (*AdminCreate) SetAvatar

func (ac *AdminCreate) SetAvatar(s string) *AdminCreate

SetAvatar sets the "avatar" field.

func (*AdminCreate) SetCreatedAt

func (ac *AdminCreate) SetCreatedAt(t time.Time) *AdminCreate

SetCreatedAt sets the "created_at" field.

func (*AdminCreate) SetDeletedAt

func (ac *AdminCreate) SetDeletedAt(t time.Time) *AdminCreate

SetDeletedAt sets the "deleted_at" field.

func (*AdminCreate) SetEmail

func (ac *AdminCreate) SetEmail(s string) *AdminCreate

SetEmail sets the "email" field.

func (*AdminCreate) SetEmailVerifiedAt

func (ac *AdminCreate) SetEmailVerifiedAt(t time.Time) *AdminCreate

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminCreate) SetID

func (ac *AdminCreate) SetID(u uint64) *AdminCreate

SetID sets the "id" field.

func (*AdminCreate) SetLang

func (ac *AdminCreate) SetLang(s string) *AdminCreate

SetLang sets the "lang" field.

func (*AdminCreate) SetName

func (ac *AdminCreate) SetName(s string) *AdminCreate

SetName sets the "name" field.

func (*AdminCreate) SetNillableAvatar

func (ac *AdminCreate) SetNillableAvatar(s *string) *AdminCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*AdminCreate) SetNillableCreatedAt

func (ac *AdminCreate) SetNillableCreatedAt(t *time.Time) *AdminCreate

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

func (*AdminCreate) SetNillableDeletedAt

func (ac *AdminCreate) SetNillableDeletedAt(t *time.Time) *AdminCreate

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

func (*AdminCreate) SetNillableEmail

func (ac *AdminCreate) SetNillableEmail(s *string) *AdminCreate

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

func (*AdminCreate) SetNillableEmailVerifiedAt

func (ac *AdminCreate) SetNillableEmailVerifiedAt(t *time.Time) *AdminCreate

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*AdminCreate) SetNillableLang

func (ac *AdminCreate) SetNillableLang(s *string) *AdminCreate

SetNillableLang sets the "lang" field if the given value is not nil.

func (*AdminCreate) SetNillableName

func (ac *AdminCreate) SetNillableName(s *string) *AdminCreate

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

func (*AdminCreate) SetNillableType

func (ac *AdminCreate) SetNillableType(u *uint8) *AdminCreate

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

func (*AdminCreate) SetNillableUpdatedAt

func (ac *AdminCreate) SetNillableUpdatedAt(t *time.Time) *AdminCreate

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

func (*AdminCreate) SetNillableUsername

func (ac *AdminCreate) SetNillableUsername(s *string) *AdminCreate

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

func (*AdminCreate) SetPassword

func (ac *AdminCreate) SetPassword(s string) *AdminCreate

SetPassword sets the "password" field.

func (*AdminCreate) SetPassword2

func (ac *AdminCreate) SetPassword2(s string) *AdminCreate

SetPassword2 sets the "password2" field.

func (*AdminCreate) SetType

func (ac *AdminCreate) SetType(u uint8) *AdminCreate

SetType sets the "type" field.

func (*AdminCreate) SetUpdatedAt

func (ac *AdminCreate) SetUpdatedAt(t time.Time) *AdminCreate

SetUpdatedAt sets the "updated_at" field.

func (*AdminCreate) SetUsername

func (ac *AdminCreate) SetUsername(s string) *AdminCreate

SetUsername sets the "username" field.

type AdminCreateBulk

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

AdminCreateBulk is the builder for creating many Admin entities in bulk.

func (*AdminCreateBulk) Exec

func (acb *AdminCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminCreateBulk) ExecContext

func (c *AdminCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminCreateBulk) ExecX

func (acb *AdminCreateBulk) ExecX(ctx context.Context)

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

func (*AdminCreateBulk) OnConflict

func (acb *AdminCreateBulk) OnConflict(opts ...sql.ConflictOption) *AdminUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Admin.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AdminUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*AdminCreateBulk) OnConflictColumns

func (acb *AdminCreateBulk) OnConflictColumns(columns ...string) *AdminUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Admin.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*AdminCreateBulk) QueryContext

func (c *AdminCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminCreateBulk) Save

func (acb *AdminCreateBulk) Save(ctx context.Context) ([]*Admin, error)

Save creates the Admin entities in the database.

func (*AdminCreateBulk) SaveX

func (acb *AdminCreateBulk) SaveX(ctx context.Context) []*Admin

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

type AdminDelete

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

AdminDelete is the builder for deleting a Admin entity.

func (*AdminDelete) Exec

func (ad *AdminDelete) Exec(ctx context.Context) (int, error)

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

func (*AdminDelete) ExecContext

func (c *AdminDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminDelete) ExecX

func (ad *AdminDelete) ExecX(ctx context.Context) int

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

func (*AdminDelete) QueryContext

func (c *AdminDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminDelete) Where

func (ad *AdminDelete) Where(ps ...predicate.Admin) *AdminDelete

Where appends a list predicates to the AdminDelete builder.

type AdminDeleteOne

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

AdminDeleteOne is the builder for deleting a single Admin entity.

func (*AdminDeleteOne) Exec

func (ado *AdminDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AdminDeleteOne) ExecX

func (ado *AdminDeleteOne) ExecX(ctx context.Context)

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

func (*AdminDeleteOne) Where

func (ado *AdminDeleteOne) Where(ps ...predicate.Admin) *AdminDeleteOne

Where appends a list predicates to the AdminDelete builder.

type AdminGroupBy

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

AdminGroupBy is the group-by builder for Admin entities.

func (*AdminGroupBy) Aggregate

func (agb *AdminGroupBy) Aggregate(fns ...AggregateFunc) *AdminGroupBy

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

func (*AdminGroupBy) Bool

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

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

func (*AdminGroupBy) BoolX

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

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

func (*AdminGroupBy) Bools

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

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

func (*AdminGroupBy) BoolsX

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

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

func (*AdminGroupBy) Float64

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

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

func (*AdminGroupBy) Float64X

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

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

func (*AdminGroupBy) Float64s

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

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

func (*AdminGroupBy) Float64sX

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

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

func (*AdminGroupBy) Int

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

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

func (*AdminGroupBy) IntX

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

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

func (*AdminGroupBy) Ints

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

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

func (*AdminGroupBy) IntsX

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

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

func (*AdminGroupBy) Scan

func (agb *AdminGroupBy) Scan(ctx context.Context, v any) error

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

func (*AdminGroupBy) ScanX

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

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

func (*AdminGroupBy) String

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

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

func (*AdminGroupBy) StringX

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

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

func (*AdminGroupBy) Strings

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

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

func (*AdminGroupBy) StringsX

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

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

type AdminMutation

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

AdminMutation represents an operation that mutates the Admin nodes in the graph.

func (*AdminMutation) AddField

func (m *AdminMutation) 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 (*AdminMutation) AddType

func (m *AdminMutation) AddType(u int8)

AddType adds u to the "type" field.

func (*AdminMutation) AddedEdges

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

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

func (*AdminMutation) AddedField

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

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

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

func (*AdminMutation) AddedIDs

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

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

func (*AdminMutation) AddedType

func (m *AdminMutation) AddedType() (r int8, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*AdminMutation) Avatar

func (m *AdminMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*AdminMutation) AvatarCleared

func (m *AdminMutation) AvatarCleared() bool

AvatarCleared returns if the "avatar" field was cleared in this mutation.

func (*AdminMutation) ClearAvatar

func (m *AdminMutation) ClearAvatar()

ClearAvatar clears the value of the "avatar" field.

func (*AdminMutation) ClearDeletedAt

func (m *AdminMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AdminMutation) ClearEdge

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

func (m *AdminMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*AdminMutation) ClearEmailVerifiedAt

func (m *AdminMutation) ClearEmailVerifiedAt()

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*AdminMutation) ClearField

func (m *AdminMutation) 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 (*AdminMutation) ClearName

func (m *AdminMutation) ClearName()

ClearName clears the value of the "name" field.

func (*AdminMutation) ClearUsername

func (m *AdminMutation) ClearUsername()

ClearUsername clears the value of the "username" field.

func (*AdminMutation) ClearedEdges

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

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

func (*AdminMutation) ClearedFields

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

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

func (AdminMutation) Client

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

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

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

func (*AdminMutation) DeletedAt

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

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

func (*AdminMutation) DeletedAtCleared

func (m *AdminMutation) DeletedAtCleared() bool

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

func (*AdminMutation) EdgeCleared

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

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

func (*AdminMutation) Email

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

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

func (*AdminMutation) EmailCleared

func (m *AdminMutation) EmailCleared() bool

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

func (*AdminMutation) EmailVerifiedAt

func (m *AdminMutation) EmailVerifiedAt() (r time.Time, exists bool)

EmailVerifiedAt returns the value of the "email_verified_at" field in the mutation.

func (*AdminMutation) EmailVerifiedAtCleared

func (m *AdminMutation) EmailVerifiedAtCleared() bool

EmailVerifiedAtCleared returns if the "email_verified_at" field was cleared in this mutation.

func (*AdminMutation) ExecContext

func (c *AdminMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminMutation) Field

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

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

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

func (*AdminMutation) Fields

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

func (m *AdminMutation) GetType() (r uint8, exists bool)

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

func (*AdminMutation) ID

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

func (m *AdminMutation) 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 (*AdminMutation) Lang

func (m *AdminMutation) Lang() (r string, exists bool)

Lang returns the value of the "lang" field in the mutation.

func (*AdminMutation) Name

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

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

func (*AdminMutation) NameCleared

func (m *AdminMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*AdminMutation) OldAvatar

func (m *AdminMutation) OldAvatar(ctx context.Context) (v *string, err error)

OldAvatar returns the old "avatar" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldCreatedAt

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

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

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

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

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

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

func (m *AdminMutation) OldEmailVerifiedAt(ctx context.Context) (v *time.Time, err error)

OldEmailVerifiedAt returns the old "email_verified_at" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldField

func (m *AdminMutation) 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 (*AdminMutation) OldLang

func (m *AdminMutation) OldLang(ctx context.Context) (v string, err error)

OldLang returns the old "lang" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldName

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

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

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

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

func (m *AdminMutation) OldPassword2(ctx context.Context) (v string, err error)

OldPassword2 returns the old "password2" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldType

func (m *AdminMutation) OldType(ctx context.Context) (v uint8, err error)

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

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

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

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

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

func (m *AdminMutation) Op() Op

Op returns the operation name.

func (*AdminMutation) Password

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

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

func (*AdminMutation) Password2

func (m *AdminMutation) Password2() (r string, exists bool)

Password2 returns the value of the "password2" field in the mutation.

func (*AdminMutation) QueryContext

func (c *AdminMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminMutation) RemovedEdges

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

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

func (*AdminMutation) RemovedIDs

func (m *AdminMutation) 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 (*AdminMutation) ResetAvatar

func (m *AdminMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*AdminMutation) ResetCreatedAt

func (m *AdminMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AdminMutation) ResetDeletedAt

func (m *AdminMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*AdminMutation) ResetEdge

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

func (m *AdminMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*AdminMutation) ResetEmailVerifiedAt

func (m *AdminMutation) ResetEmailVerifiedAt()

ResetEmailVerifiedAt resets all changes to the "email_verified_at" field.

func (*AdminMutation) ResetField

func (m *AdminMutation) 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 (*AdminMutation) ResetLang

func (m *AdminMutation) ResetLang()

ResetLang resets all changes to the "lang" field.

func (*AdminMutation) ResetName

func (m *AdminMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AdminMutation) ResetPassword

func (m *AdminMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*AdminMutation) ResetPassword2

func (m *AdminMutation) ResetPassword2()

ResetPassword2 resets all changes to the "password2" field.

func (*AdminMutation) ResetType

func (m *AdminMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*AdminMutation) ResetUpdatedAt

func (m *AdminMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AdminMutation) ResetUsername

func (m *AdminMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*AdminMutation) SetAvatar

func (m *AdminMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*AdminMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AdminMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AdminMutation) SetEmail

func (m *AdminMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*AdminMutation) SetEmailVerifiedAt

func (m *AdminMutation) SetEmailVerifiedAt(t time.Time)

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminMutation) SetField

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

func (m *AdminMutation) SetID(id uint64)

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

func (*AdminMutation) SetLang

func (m *AdminMutation) SetLang(s string)

SetLang sets the "lang" field.

func (*AdminMutation) SetName

func (m *AdminMutation) SetName(s string)

SetName sets the "name" field.

func (*AdminMutation) SetOp

func (m *AdminMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AdminMutation) SetPassword

func (m *AdminMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*AdminMutation) SetPassword2

func (m *AdminMutation) SetPassword2(s string)

SetPassword2 sets the "password2" field.

func (*AdminMutation) SetType

func (m *AdminMutation) SetType(u uint8)

SetType sets the "type" field.

func (*AdminMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AdminMutation) SetUsername

func (m *AdminMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (AdminMutation) Tx

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

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

func (*AdminMutation) Type

func (m *AdminMutation) Type() string

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

func (*AdminMutation) UpdatedAt

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

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

func (*AdminMutation) Username

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

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

func (*AdminMutation) UsernameCleared

func (m *AdminMutation) UsernameCleared() bool

UsernameCleared returns if the "username" field was cleared in this mutation.

func (*AdminMutation) Where

func (m *AdminMutation) Where(ps ...predicate.Admin)

Where appends a list predicates to the AdminMutation builder.

func (*AdminMutation) WhereP

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

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

type AdminQuery

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

AdminQuery is the builder for querying Admin entities.

func (*AdminQuery) Aggregate

func (aq *AdminQuery) Aggregate(fns ...AggregateFunc) *AdminSelect

Aggregate returns a AdminSelect configured with the given aggregations.

func (*AdminQuery) All

func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)

All executes the query and returns a list of Admins.

func (*AdminQuery) AllX

func (aq *AdminQuery) AllX(ctx context.Context) []*Admin

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

func (*AdminQuery) Clone

func (aq *AdminQuery) Clone() *AdminQuery

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

func (*AdminQuery) Count

func (aq *AdminQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AdminQuery) CountX

func (aq *AdminQuery) CountX(ctx context.Context) int

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

func (*AdminQuery) ExecContext

func (c *AdminQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminQuery) Exist

func (aq *AdminQuery) Exist(ctx context.Context) (bool, error)

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

func (*AdminQuery) ExistX

func (aq *AdminQuery) ExistX(ctx context.Context) bool

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

func (*AdminQuery) First

func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)

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

func (*AdminQuery) FirstID

func (aq *AdminQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*AdminQuery) FirstIDX

func (aq *AdminQuery) FirstIDX(ctx context.Context) uint64

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

func (*AdminQuery) FirstX

func (aq *AdminQuery) FirstX(ctx context.Context) *Admin

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

func (*AdminQuery) GroupBy

func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy

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

Example:

var v []struct {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Admin.Query().
	GroupBy(admin.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AdminQuery) IDs

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

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

func (*AdminQuery) IDsX

func (aq *AdminQuery) IDsX(ctx context.Context) []uint64

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

func (*AdminQuery) Limit

func (aq *AdminQuery) Limit(limit int) *AdminQuery

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

func (*AdminQuery) Offset

func (aq *AdminQuery) Offset(offset int) *AdminQuery

Offset to start from.

func (*AdminQuery) Only

func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)

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

func (*AdminQuery) OnlyID

func (aq *AdminQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*AdminQuery) OnlyIDX

func (aq *AdminQuery) OnlyIDX(ctx context.Context) uint64

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

func (*AdminQuery) OnlyX

func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin

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

func (*AdminQuery) Order

func (aq *AdminQuery) Order(o ...admin.OrderOption) *AdminQuery

Order specifies how the records should be ordered.

func (*AdminQuery) QueryContext

func (c *AdminQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminQuery) Select

func (aq *AdminQuery) Select(fields ...string) *AdminSelect

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

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.Admin.Query().
	Select(admin.FieldUsername).
	Scan(ctx, &v)

func (*AdminQuery) Unique

func (aq *AdminQuery) Unique(unique bool) *AdminQuery

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

func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery

Where adds a new predicate for the AdminQuery builder.

type AdminSelect

type AdminSelect struct {
	*AdminQuery
	// contains filtered or unexported fields
}

AdminSelect is the builder for selecting fields of Admin entities.

func (*AdminSelect) Aggregate

func (as *AdminSelect) Aggregate(fns ...AggregateFunc) *AdminSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AdminSelect) Bool

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

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

func (*AdminSelect) BoolX

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

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

func (*AdminSelect) Bools

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

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

func (*AdminSelect) BoolsX

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

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

func (AdminSelect) ExecContext

func (c AdminSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminSelect) Float64

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

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

func (*AdminSelect) Float64X

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

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

func (*AdminSelect) Float64s

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

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

func (*AdminSelect) Float64sX

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

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

func (*AdminSelect) Int

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

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

func (*AdminSelect) IntX

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

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

func (*AdminSelect) Ints

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

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

func (*AdminSelect) IntsX

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

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

func (AdminSelect) QueryContext

func (c AdminSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminSelect) Scan

func (as *AdminSelect) Scan(ctx context.Context, v any) error

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

func (*AdminSelect) ScanX

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

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

func (*AdminSelect) String

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

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

func (*AdminSelect) StringX

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

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

func (*AdminSelect) Strings

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

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

func (*AdminSelect) StringsX

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

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

type AdminUpdate

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

AdminUpdate is the builder for updating Admin entities.

func (*AdminUpdate) AddType

func (au *AdminUpdate) AddType(u int8) *AdminUpdate

AddType adds u to the "type" field.

func (*AdminUpdate) ClearAvatar

func (au *AdminUpdate) ClearAvatar() *AdminUpdate

ClearAvatar clears the value of the "avatar" field.

func (*AdminUpdate) ClearDeletedAt

func (au *AdminUpdate) ClearDeletedAt() *AdminUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AdminUpdate) ClearEmail

func (au *AdminUpdate) ClearEmail() *AdminUpdate

ClearEmail clears the value of the "email" field.

func (*AdminUpdate) ClearEmailVerifiedAt

func (au *AdminUpdate) ClearEmailVerifiedAt() *AdminUpdate

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*AdminUpdate) ClearName

func (au *AdminUpdate) ClearName() *AdminUpdate

ClearName clears the value of the "name" field.

func (*AdminUpdate) ClearUsername

func (au *AdminUpdate) ClearUsername() *AdminUpdate

ClearUsername clears the value of the "username" field.

func (*AdminUpdate) Exec

func (au *AdminUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUpdate) ExecContext

func (c *AdminUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUpdate) ExecX

func (au *AdminUpdate) ExecX(ctx context.Context)

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

func (*AdminUpdate) Mutation

func (au *AdminUpdate) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminUpdate) QueryContext

func (c *AdminUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUpdate) Save

func (au *AdminUpdate) Save(ctx context.Context) (int, error)

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

func (*AdminUpdate) SaveX

func (au *AdminUpdate) SaveX(ctx context.Context) int

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

func (*AdminUpdate) SetAvatar

func (au *AdminUpdate) SetAvatar(s string) *AdminUpdate

SetAvatar sets the "avatar" field.

func (*AdminUpdate) SetCreatedAt

func (au *AdminUpdate) SetCreatedAt(t time.Time) *AdminUpdate

SetCreatedAt sets the "created_at" field.

func (*AdminUpdate) SetDeletedAt

func (au *AdminUpdate) SetDeletedAt(t time.Time) *AdminUpdate

SetDeletedAt sets the "deleted_at" field.

func (*AdminUpdate) SetEmail

func (au *AdminUpdate) SetEmail(s string) *AdminUpdate

SetEmail sets the "email" field.

func (*AdminUpdate) SetEmailVerifiedAt

func (au *AdminUpdate) SetEmailVerifiedAt(t time.Time) *AdminUpdate

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminUpdate) SetLang

func (au *AdminUpdate) SetLang(s string) *AdminUpdate

SetLang sets the "lang" field.

func (*AdminUpdate) SetName

func (au *AdminUpdate) SetName(s string) *AdminUpdate

SetName sets the "name" field.

func (*AdminUpdate) SetNillableAvatar

func (au *AdminUpdate) SetNillableAvatar(s *string) *AdminUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*AdminUpdate) SetNillableCreatedAt

func (au *AdminUpdate) SetNillableCreatedAt(t *time.Time) *AdminUpdate

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

func (*AdminUpdate) SetNillableDeletedAt

func (au *AdminUpdate) SetNillableDeletedAt(t *time.Time) *AdminUpdate

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

func (*AdminUpdate) SetNillableEmail

func (au *AdminUpdate) SetNillableEmail(s *string) *AdminUpdate

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

func (*AdminUpdate) SetNillableEmailVerifiedAt

func (au *AdminUpdate) SetNillableEmailVerifiedAt(t *time.Time) *AdminUpdate

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*AdminUpdate) SetNillableLang

func (au *AdminUpdate) SetNillableLang(s *string) *AdminUpdate

SetNillableLang sets the "lang" field if the given value is not nil.

func (*AdminUpdate) SetNillableName

func (au *AdminUpdate) SetNillableName(s *string) *AdminUpdate

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

func (*AdminUpdate) SetNillablePassword

func (au *AdminUpdate) SetNillablePassword(s *string) *AdminUpdate

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

func (*AdminUpdate) SetNillablePassword2

func (au *AdminUpdate) SetNillablePassword2(s *string) *AdminUpdate

SetNillablePassword2 sets the "password2" field if the given value is not nil.

func (*AdminUpdate) SetNillableType

func (au *AdminUpdate) SetNillableType(u *uint8) *AdminUpdate

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

func (*AdminUpdate) SetNillableUsername

func (au *AdminUpdate) SetNillableUsername(s *string) *AdminUpdate

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

func (*AdminUpdate) SetPassword

func (au *AdminUpdate) SetPassword(s string) *AdminUpdate

SetPassword sets the "password" field.

func (*AdminUpdate) SetPassword2

func (au *AdminUpdate) SetPassword2(s string) *AdminUpdate

SetPassword2 sets the "password2" field.

func (*AdminUpdate) SetType

func (au *AdminUpdate) SetType(u uint8) *AdminUpdate

SetType sets the "type" field.

func (*AdminUpdate) SetUpdatedAt

func (au *AdminUpdate) SetUpdatedAt(t time.Time) *AdminUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AdminUpdate) SetUsername

func (au *AdminUpdate) SetUsername(s string) *AdminUpdate

SetUsername sets the "username" field.

func (*AdminUpdate) Where

func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate

Where appends a list predicates to the AdminUpdate builder.

type AdminUpdateOne

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

AdminUpdateOne is the builder for updating a single Admin entity.

func (*AdminUpdateOne) AddType

func (auo *AdminUpdateOne) AddType(u int8) *AdminUpdateOne

AddType adds u to the "type" field.

func (*AdminUpdateOne) ClearAvatar

func (auo *AdminUpdateOne) ClearAvatar() *AdminUpdateOne

ClearAvatar clears the value of the "avatar" field.

func (*AdminUpdateOne) ClearDeletedAt

func (auo *AdminUpdateOne) ClearDeletedAt() *AdminUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AdminUpdateOne) ClearEmail

func (auo *AdminUpdateOne) ClearEmail() *AdminUpdateOne

ClearEmail clears the value of the "email" field.

func (*AdminUpdateOne) ClearEmailVerifiedAt

func (auo *AdminUpdateOne) ClearEmailVerifiedAt() *AdminUpdateOne

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*AdminUpdateOne) ClearName

func (auo *AdminUpdateOne) ClearName() *AdminUpdateOne

ClearName clears the value of the "name" field.

func (*AdminUpdateOne) ClearUsername

func (auo *AdminUpdateOne) ClearUsername() *AdminUpdateOne

ClearUsername clears the value of the "username" field.

func (*AdminUpdateOne) Exec

func (auo *AdminUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AdminUpdateOne) ExecContext

func (c *AdminUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUpdateOne) ExecX

func (auo *AdminUpdateOne) ExecX(ctx context.Context)

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

func (*AdminUpdateOne) Mutation

func (auo *AdminUpdateOne) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminUpdateOne) QueryContext

func (c *AdminUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUpdateOne) Save

func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)

Save executes the query and returns the updated Admin entity.

func (*AdminUpdateOne) SaveX

func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin

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

func (*AdminUpdateOne) Select

func (auo *AdminUpdateOne) Select(field string, fields ...string) *AdminUpdateOne

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

func (*AdminUpdateOne) SetAvatar

func (auo *AdminUpdateOne) SetAvatar(s string) *AdminUpdateOne

SetAvatar sets the "avatar" field.

func (*AdminUpdateOne) SetCreatedAt

func (auo *AdminUpdateOne) SetCreatedAt(t time.Time) *AdminUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AdminUpdateOne) SetDeletedAt

func (auo *AdminUpdateOne) SetDeletedAt(t time.Time) *AdminUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*AdminUpdateOne) SetEmail

func (auo *AdminUpdateOne) SetEmail(s string) *AdminUpdateOne

SetEmail sets the "email" field.

func (*AdminUpdateOne) SetEmailVerifiedAt

func (auo *AdminUpdateOne) SetEmailVerifiedAt(t time.Time) *AdminUpdateOne

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminUpdateOne) SetLang

func (auo *AdminUpdateOne) SetLang(s string) *AdminUpdateOne

SetLang sets the "lang" field.

func (*AdminUpdateOne) SetName

func (auo *AdminUpdateOne) SetName(s string) *AdminUpdateOne

SetName sets the "name" field.

func (*AdminUpdateOne) SetNillableAvatar

func (auo *AdminUpdateOne) SetNillableAvatar(s *string) *AdminUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*AdminUpdateOne) SetNillableCreatedAt

func (auo *AdminUpdateOne) SetNillableCreatedAt(t *time.Time) *AdminUpdateOne

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

func (*AdminUpdateOne) SetNillableDeletedAt

func (auo *AdminUpdateOne) SetNillableDeletedAt(t *time.Time) *AdminUpdateOne

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

func (*AdminUpdateOne) SetNillableEmail

func (auo *AdminUpdateOne) SetNillableEmail(s *string) *AdminUpdateOne

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

func (*AdminUpdateOne) SetNillableEmailVerifiedAt

func (auo *AdminUpdateOne) SetNillableEmailVerifiedAt(t *time.Time) *AdminUpdateOne

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*AdminUpdateOne) SetNillableLang

func (auo *AdminUpdateOne) SetNillableLang(s *string) *AdminUpdateOne

SetNillableLang sets the "lang" field if the given value is not nil.

func (*AdminUpdateOne) SetNillableName

func (auo *AdminUpdateOne) SetNillableName(s *string) *AdminUpdateOne

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

func (*AdminUpdateOne) SetNillablePassword

func (auo *AdminUpdateOne) SetNillablePassword(s *string) *AdminUpdateOne

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

func (*AdminUpdateOne) SetNillablePassword2

func (auo *AdminUpdateOne) SetNillablePassword2(s *string) *AdminUpdateOne

SetNillablePassword2 sets the "password2" field if the given value is not nil.

func (*AdminUpdateOne) SetNillableType

func (auo *AdminUpdateOne) SetNillableType(u *uint8) *AdminUpdateOne

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

func (*AdminUpdateOne) SetNillableUsername

func (auo *AdminUpdateOne) SetNillableUsername(s *string) *AdminUpdateOne

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

func (*AdminUpdateOne) SetPassword

func (auo *AdminUpdateOne) SetPassword(s string) *AdminUpdateOne

SetPassword sets the "password" field.

func (*AdminUpdateOne) SetPassword2

func (auo *AdminUpdateOne) SetPassword2(s string) *AdminUpdateOne

SetPassword2 sets the "password2" field.

func (*AdminUpdateOne) SetType

func (auo *AdminUpdateOne) SetType(u uint8) *AdminUpdateOne

SetType sets the "type" field.

func (*AdminUpdateOne) SetUpdatedAt

func (auo *AdminUpdateOne) SetUpdatedAt(t time.Time) *AdminUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AdminUpdateOne) SetUsername

func (auo *AdminUpdateOne) SetUsername(s string) *AdminUpdateOne

SetUsername sets the "username" field.

func (*AdminUpdateOne) Where

func (auo *AdminUpdateOne) Where(ps ...predicate.Admin) *AdminUpdateOne

Where appends a list predicates to the AdminUpdate builder.

type AdminUpsert

type AdminUpsert struct {
	*sql.UpdateSet
}

AdminUpsert is the "OnConflict" setter.

func (*AdminUpsert) AddType

func (u *AdminUpsert) AddType(v uint8) *AdminUpsert

AddType adds v to the "type" field.

func (*AdminUpsert) ClearAvatar

func (u *AdminUpsert) ClearAvatar() *AdminUpsert

ClearAvatar clears the value of the "avatar" field.

func (*AdminUpsert) ClearDeletedAt

func (u *AdminUpsert) ClearDeletedAt() *AdminUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AdminUpsert) ClearEmail

func (u *AdminUpsert) ClearEmail() *AdminUpsert

ClearEmail clears the value of the "email" field.

func (*AdminUpsert) ClearEmailVerifiedAt

func (u *AdminUpsert) ClearEmailVerifiedAt() *AdminUpsert

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*AdminUpsert) ClearName

func (u *AdminUpsert) ClearName() *AdminUpsert

ClearName clears the value of the "name" field.

func (*AdminUpsert) ClearUsername

func (u *AdminUpsert) ClearUsername() *AdminUpsert

ClearUsername clears the value of the "username" field.

func (*AdminUpsert) SetAvatar

func (u *AdminUpsert) SetAvatar(v string) *AdminUpsert

SetAvatar sets the "avatar" field.

func (*AdminUpsert) SetCreatedAt

func (u *AdminUpsert) SetCreatedAt(v time.Time) *AdminUpsert

SetCreatedAt sets the "created_at" field.

func (*AdminUpsert) SetDeletedAt

func (u *AdminUpsert) SetDeletedAt(v time.Time) *AdminUpsert

SetDeletedAt sets the "deleted_at" field.

func (*AdminUpsert) SetEmail

func (u *AdminUpsert) SetEmail(v string) *AdminUpsert

SetEmail sets the "email" field.

func (*AdminUpsert) SetEmailVerifiedAt

func (u *AdminUpsert) SetEmailVerifiedAt(v time.Time) *AdminUpsert

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminUpsert) SetLang

func (u *AdminUpsert) SetLang(v string) *AdminUpsert

SetLang sets the "lang" field.

func (*AdminUpsert) SetName

func (u *AdminUpsert) SetName(v string) *AdminUpsert

SetName sets the "name" field.

func (*AdminUpsert) SetPassword

func (u *AdminUpsert) SetPassword(v string) *AdminUpsert

SetPassword sets the "password" field.

func (*AdminUpsert) SetPassword2

func (u *AdminUpsert) SetPassword2(v string) *AdminUpsert

SetPassword2 sets the "password2" field.

func (*AdminUpsert) SetType

func (u *AdminUpsert) SetType(v uint8) *AdminUpsert

SetType sets the "type" field.

func (*AdminUpsert) SetUpdatedAt

func (u *AdminUpsert) SetUpdatedAt(v time.Time) *AdminUpsert

SetUpdatedAt sets the "updated_at" field.

func (*AdminUpsert) SetUsername

func (u *AdminUpsert) SetUsername(v string) *AdminUpsert

SetUsername sets the "username" field.

func (*AdminUpsert) UpdateAvatar

func (u *AdminUpsert) UpdateAvatar() *AdminUpsert

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*AdminUpsert) UpdateCreatedAt

func (u *AdminUpsert) UpdateCreatedAt() *AdminUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*AdminUpsert) UpdateDeletedAt

func (u *AdminUpsert) UpdateDeletedAt() *AdminUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*AdminUpsert) UpdateEmail

func (u *AdminUpsert) UpdateEmail() *AdminUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AdminUpsert) UpdateEmailVerifiedAt

func (u *AdminUpsert) UpdateEmailVerifiedAt() *AdminUpsert

UpdateEmailVerifiedAt sets the "email_verified_at" field to the value that was provided on create.

func (*AdminUpsert) UpdateLang

func (u *AdminUpsert) UpdateLang() *AdminUpsert

UpdateLang sets the "lang" field to the value that was provided on create.

func (*AdminUpsert) UpdateName

func (u *AdminUpsert) UpdateName() *AdminUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*AdminUpsert) UpdatePassword

func (u *AdminUpsert) UpdatePassword() *AdminUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AdminUpsert) UpdatePassword2

func (u *AdminUpsert) UpdatePassword2() *AdminUpsert

UpdatePassword2 sets the "password2" field to the value that was provided on create.

func (*AdminUpsert) UpdateType

func (u *AdminUpsert) UpdateType() *AdminUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*AdminUpsert) UpdateUpdatedAt

func (u *AdminUpsert) UpdateUpdatedAt() *AdminUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*AdminUpsert) UpdateUsername

func (u *AdminUpsert) UpdateUsername() *AdminUpsert

UpdateUsername sets the "username" field to the value that was provided on create.

type AdminUpsertBulk

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

AdminUpsertBulk is the builder for "upsert"-ing a bulk of Admin nodes.

func (*AdminUpsertBulk) AddType

func (u *AdminUpsertBulk) AddType(v uint8) *AdminUpsertBulk

AddType adds v to the "type" field.

func (*AdminUpsertBulk) ClearAvatar

func (u *AdminUpsertBulk) ClearAvatar() *AdminUpsertBulk

ClearAvatar clears the value of the "avatar" field.

func (*AdminUpsertBulk) ClearDeletedAt

func (u *AdminUpsertBulk) ClearDeletedAt() *AdminUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AdminUpsertBulk) ClearEmail

func (u *AdminUpsertBulk) ClearEmail() *AdminUpsertBulk

ClearEmail clears the value of the "email" field.

func (*AdminUpsertBulk) ClearEmailVerifiedAt

func (u *AdminUpsertBulk) ClearEmailVerifiedAt() *AdminUpsertBulk

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*AdminUpsertBulk) ClearName

func (u *AdminUpsertBulk) ClearName() *AdminUpsertBulk

ClearName clears the value of the "name" field.

func (*AdminUpsertBulk) ClearUsername

func (u *AdminUpsertBulk) ClearUsername() *AdminUpsertBulk

ClearUsername clears the value of the "username" field.

func (*AdminUpsertBulk) DoNothing

func (u *AdminUpsertBulk) DoNothing() *AdminUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*AdminUpsertBulk) Exec

func (u *AdminUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUpsertBulk) ExecX

func (u *AdminUpsertBulk) ExecX(ctx context.Context)

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

func (*AdminUpsertBulk) Ignore

func (u *AdminUpsertBulk) Ignore() *AdminUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Admin.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*AdminUpsertBulk) SetAvatar

func (u *AdminUpsertBulk) SetAvatar(v string) *AdminUpsertBulk

SetAvatar sets the "avatar" field.

func (*AdminUpsertBulk) SetCreatedAt

func (u *AdminUpsertBulk) SetCreatedAt(v time.Time) *AdminUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*AdminUpsertBulk) SetDeletedAt

func (u *AdminUpsertBulk) SetDeletedAt(v time.Time) *AdminUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*AdminUpsertBulk) SetEmail

func (u *AdminUpsertBulk) SetEmail(v string) *AdminUpsertBulk

SetEmail sets the "email" field.

func (*AdminUpsertBulk) SetEmailVerifiedAt

func (u *AdminUpsertBulk) SetEmailVerifiedAt(v time.Time) *AdminUpsertBulk

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminUpsertBulk) SetLang

func (u *AdminUpsertBulk) SetLang(v string) *AdminUpsertBulk

SetLang sets the "lang" field.

func (*AdminUpsertBulk) SetName

func (u *AdminUpsertBulk) SetName(v string) *AdminUpsertBulk

SetName sets the "name" field.

func (*AdminUpsertBulk) SetPassword

func (u *AdminUpsertBulk) SetPassword(v string) *AdminUpsertBulk

SetPassword sets the "password" field.

func (*AdminUpsertBulk) SetPassword2

func (u *AdminUpsertBulk) SetPassword2(v string) *AdminUpsertBulk

SetPassword2 sets the "password2" field.

func (*AdminUpsertBulk) SetType

func (u *AdminUpsertBulk) SetType(v uint8) *AdminUpsertBulk

SetType sets the "type" field.

func (*AdminUpsertBulk) SetUpdatedAt

func (u *AdminUpsertBulk) SetUpdatedAt(v time.Time) *AdminUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*AdminUpsertBulk) SetUsername

func (u *AdminUpsertBulk) SetUsername(v string) *AdminUpsertBulk

SetUsername sets the "username" field.

func (*AdminUpsertBulk) Update

func (u *AdminUpsertBulk) Update(set func(*AdminUpsert)) *AdminUpsertBulk

Update allows overriding fields `UPDATE` values. See the AdminCreateBulk.OnConflict documentation for more info.

func (*AdminUpsertBulk) UpdateAvatar

func (u *AdminUpsertBulk) UpdateAvatar() *AdminUpsertBulk

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateCreatedAt

func (u *AdminUpsertBulk) UpdateCreatedAt() *AdminUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateDeletedAt

func (u *AdminUpsertBulk) UpdateDeletedAt() *AdminUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateEmail

func (u *AdminUpsertBulk) UpdateEmail() *AdminUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateEmailVerifiedAt

func (u *AdminUpsertBulk) UpdateEmailVerifiedAt() *AdminUpsertBulk

UpdateEmailVerifiedAt sets the "email_verified_at" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateLang

func (u *AdminUpsertBulk) UpdateLang() *AdminUpsertBulk

UpdateLang sets the "lang" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateName

func (u *AdminUpsertBulk) UpdateName() *AdminUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateNewValues

func (u *AdminUpsertBulk) UpdateNewValues() *AdminUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Admin.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(admin.FieldID)
		}),
	).
	Exec(ctx)

func (*AdminUpsertBulk) UpdatePassword

func (u *AdminUpsertBulk) UpdatePassword() *AdminUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdatePassword2

func (u *AdminUpsertBulk) UpdatePassword2() *AdminUpsertBulk

UpdatePassword2 sets the "password2" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateType

func (u *AdminUpsertBulk) UpdateType() *AdminUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateUpdatedAt

func (u *AdminUpsertBulk) UpdateUpdatedAt() *AdminUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*AdminUpsertBulk) UpdateUsername

func (u *AdminUpsertBulk) UpdateUsername() *AdminUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type AdminUpsertOne

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

AdminUpsertOne is the builder for "upsert"-ing

one Admin node.

func (*AdminUpsertOne) AddType

func (u *AdminUpsertOne) AddType(v uint8) *AdminUpsertOne

AddType adds v to the "type" field.

func (*AdminUpsertOne) ClearAvatar

func (u *AdminUpsertOne) ClearAvatar() *AdminUpsertOne

ClearAvatar clears the value of the "avatar" field.

func (*AdminUpsertOne) ClearDeletedAt

func (u *AdminUpsertOne) ClearDeletedAt() *AdminUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AdminUpsertOne) ClearEmail

func (u *AdminUpsertOne) ClearEmail() *AdminUpsertOne

ClearEmail clears the value of the "email" field.

func (*AdminUpsertOne) ClearEmailVerifiedAt

func (u *AdminUpsertOne) ClearEmailVerifiedAt() *AdminUpsertOne

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*AdminUpsertOne) ClearName

func (u *AdminUpsertOne) ClearName() *AdminUpsertOne

ClearName clears the value of the "name" field.

func (*AdminUpsertOne) ClearUsername

func (u *AdminUpsertOne) ClearUsername() *AdminUpsertOne

ClearUsername clears the value of the "username" field.

func (*AdminUpsertOne) DoNothing

func (u *AdminUpsertOne) DoNothing() *AdminUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*AdminUpsertOne) Exec

func (u *AdminUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUpsertOne) ExecX

func (u *AdminUpsertOne) ExecX(ctx context.Context)

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

func (*AdminUpsertOne) ID

func (u *AdminUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*AdminUpsertOne) IDX

func (u *AdminUpsertOne) IDX(ctx context.Context) uint64

IDX is like ID, but panics if an error occurs.

func (*AdminUpsertOne) Ignore

func (u *AdminUpsertOne) Ignore() *AdminUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Admin.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*AdminUpsertOne) SetAvatar

func (u *AdminUpsertOne) SetAvatar(v string) *AdminUpsertOne

SetAvatar sets the "avatar" field.

func (*AdminUpsertOne) SetCreatedAt

func (u *AdminUpsertOne) SetCreatedAt(v time.Time) *AdminUpsertOne

SetCreatedAt sets the "created_at" field.

func (*AdminUpsertOne) SetDeletedAt

func (u *AdminUpsertOne) SetDeletedAt(v time.Time) *AdminUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*AdminUpsertOne) SetEmail

func (u *AdminUpsertOne) SetEmail(v string) *AdminUpsertOne

SetEmail sets the "email" field.

func (*AdminUpsertOne) SetEmailVerifiedAt

func (u *AdminUpsertOne) SetEmailVerifiedAt(v time.Time) *AdminUpsertOne

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*AdminUpsertOne) SetLang

func (u *AdminUpsertOne) SetLang(v string) *AdminUpsertOne

SetLang sets the "lang" field.

func (*AdminUpsertOne) SetName

func (u *AdminUpsertOne) SetName(v string) *AdminUpsertOne

SetName sets the "name" field.

func (*AdminUpsertOne) SetPassword

func (u *AdminUpsertOne) SetPassword(v string) *AdminUpsertOne

SetPassword sets the "password" field.

func (*AdminUpsertOne) SetPassword2

func (u *AdminUpsertOne) SetPassword2(v string) *AdminUpsertOne

SetPassword2 sets the "password2" field.

func (*AdminUpsertOne) SetType

func (u *AdminUpsertOne) SetType(v uint8) *AdminUpsertOne

SetType sets the "type" field.

func (*AdminUpsertOne) SetUpdatedAt

func (u *AdminUpsertOne) SetUpdatedAt(v time.Time) *AdminUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*AdminUpsertOne) SetUsername

func (u *AdminUpsertOne) SetUsername(v string) *AdminUpsertOne

SetUsername sets the "username" field.

func (*AdminUpsertOne) Update

func (u *AdminUpsertOne) Update(set func(*AdminUpsert)) *AdminUpsertOne

Update allows overriding fields `UPDATE` values. See the AdminCreate.OnConflict documentation for more info.

func (*AdminUpsertOne) UpdateAvatar

func (u *AdminUpsertOne) UpdateAvatar() *AdminUpsertOne

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateCreatedAt

func (u *AdminUpsertOne) UpdateCreatedAt() *AdminUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateDeletedAt

func (u *AdminUpsertOne) UpdateDeletedAt() *AdminUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateEmail

func (u *AdminUpsertOne) UpdateEmail() *AdminUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateEmailVerifiedAt

func (u *AdminUpsertOne) UpdateEmailVerifiedAt() *AdminUpsertOne

UpdateEmailVerifiedAt sets the "email_verified_at" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateLang

func (u *AdminUpsertOne) UpdateLang() *AdminUpsertOne

UpdateLang sets the "lang" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateName

func (u *AdminUpsertOne) UpdateName() *AdminUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateNewValues

func (u *AdminUpsertOne) UpdateNewValues() *AdminUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Admin.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(admin.FieldID)
		}),
	).
	Exec(ctx)

func (*AdminUpsertOne) UpdatePassword

func (u *AdminUpsertOne) UpdatePassword() *AdminUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AdminUpsertOne) UpdatePassword2

func (u *AdminUpsertOne) UpdatePassword2() *AdminUpsertOne

UpdatePassword2 sets the "password2" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateType

func (u *AdminUpsertOne) UpdateType() *AdminUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateUpdatedAt

func (u *AdminUpsertOne) UpdateUpdatedAt() *AdminUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*AdminUpsertOne) UpdateUsername

func (u *AdminUpsertOne) UpdateUsername() *AdminUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

type Admins

type Admins []*Admin

Admins is a parsable slice of Admin.

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 Bank

type Bank struct {

	// ID of the ent.
	// Primary key for the bank
	ID uint64 `json:"id,omitempty"`
	// Bank name in English
	NameEn string `json:"name_en,omitempty"`
	// Bank name in Chinese
	NameZh string `json:"name_zh,omitempty"`
	// Country of the bank
	CountryID *uint64 `json:"country_id,omitempty"`
	// Record creation timestamp
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Record update timestamp
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Record deleted timestamp
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BankQuery when eager-loading is set.
	Edges BankEdges `json:"edges"`
	// contains filtered or unexported fields
}

Bank is the model entity for the Bank schema.

func (*Bank) ExecContext

func (c *Bank) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Bank) QueryContext

func (c *Bank) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Bank) QueryCountry

func (b *Bank) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the Bank entity.

func (*Bank) QueryUsers

func (b *Bank) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Bank entity.

func (*Bank) String

func (b *Bank) String() string

String implements the fmt.Stringer.

func (*Bank) Unwrap

func (b *Bank) Unwrap() *Bank

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

func (b *Bank) Update() *BankUpdateOne

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

func (*Bank) Value

func (b *Bank) Value(name string) (ent.Value, error)

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

type BankClient

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

BankClient is a client for the Bank schema.

func NewBankClient

func NewBankClient(c config) *BankClient

NewBankClient returns a client for the Bank from the given config.

func (*BankClient) Create

func (c *BankClient) Create() *BankCreate

Create returns a builder for creating a Bank entity.

func (*BankClient) CreateBulk

func (c *BankClient) CreateBulk(builders ...*BankCreate) *BankCreateBulk

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

func (*BankClient) Delete

func (c *BankClient) Delete() *BankDelete

Delete returns a delete builder for Bank.

func (*BankClient) DeleteOne

func (c *BankClient) DeleteOne(b *Bank) *BankDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BankClient) DeleteOneID

func (c *BankClient) DeleteOneID(id uint64) *BankDeleteOne

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

func (*BankClient) ExecContext

func (c *BankClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankClient) Get

func (c *BankClient) Get(ctx context.Context, id uint64) (*Bank, error)

Get returns a Bank entity by its id.

func (*BankClient) GetX

func (c *BankClient) GetX(ctx context.Context, id uint64) *Bank

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

func (*BankClient) Hooks

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

Hooks returns the client hooks.

func (*BankClient) Intercept

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

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

func (*BankClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BankClient) MapCreateBulk

func (c *BankClient) MapCreateBulk(slice any, setFunc func(*BankCreate, int)) *BankCreateBulk

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

func (c *BankClient) Query() *BankQuery

Query returns a query builder for Bank.

func (*BankClient) QueryContext

func (c *BankClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankClient) QueryCountry

func (c *BankClient) QueryCountry(b *Bank) *CountryQuery

QueryCountry queries the country edge of a Bank.

func (*BankClient) QueryUsers

func (c *BankClient) QueryUsers(b *Bank) *UserQuery

QueryUsers queries the users edge of a Bank.

func (*BankClient) Update

func (c *BankClient) Update() *BankUpdate

Update returns an update builder for Bank.

func (*BankClient) UpdateOne

func (c *BankClient) UpdateOne(b *Bank) *BankUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BankClient) UpdateOneID

func (c *BankClient) UpdateOneID(id uint64) *BankUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BankClient) Use

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

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

type BankCreate

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

BankCreate is the builder for creating a Bank entity.

func (*BankCreate) AddUserIDs

func (bc *BankCreate) AddUserIDs(ids ...uint64) *BankCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*BankCreate) AddUsers

func (bc *BankCreate) AddUsers(u ...*User) *BankCreate

AddUsers adds the "users" edges to the User entity.

func (*BankCreate) Exec

func (bc *BankCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BankCreate) ExecContext

func (c *BankCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankCreate) ExecX

func (bc *BankCreate) ExecX(ctx context.Context)

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

func (*BankCreate) Mutation

func (bc *BankCreate) Mutation() *BankMutation

Mutation returns the BankMutation object of the builder.

func (*BankCreate) OnConflict

func (bc *BankCreate) OnConflict(opts ...sql.ConflictOption) *BankUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Bank.Create().
	SetNameEn(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BankUpsert) {
		SetNameEn(v+v).
	}).
	Exec(ctx)

func (*BankCreate) OnConflictColumns

func (bc *BankCreate) OnConflictColumns(columns ...string) *BankUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Bank.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BankCreate) QueryContext

func (c *BankCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankCreate) Save

func (bc *BankCreate) Save(ctx context.Context) (*Bank, error)

Save creates the Bank in the database.

func (*BankCreate) SaveX

func (bc *BankCreate) SaveX(ctx context.Context) *Bank

SaveX calls Save and panics if Save returns an error.

func (*BankCreate) SetCountry

func (bc *BankCreate) SetCountry(c *Country) *BankCreate

SetCountry sets the "country" edge to the Country entity.

func (*BankCreate) SetCountryID

func (bc *BankCreate) SetCountryID(u uint64) *BankCreate

SetCountryID sets the "country_id" field.

func (*BankCreate) SetCreatedAt

func (bc *BankCreate) SetCreatedAt(t time.Time) *BankCreate

SetCreatedAt sets the "created_at" field.

func (*BankCreate) SetDeletedAt

func (bc *BankCreate) SetDeletedAt(t time.Time) *BankCreate

SetDeletedAt sets the "deleted_at" field.

func (*BankCreate) SetID

func (bc *BankCreate) SetID(u uint64) *BankCreate

SetID sets the "id" field.

func (*BankCreate) SetNameEn

func (bc *BankCreate) SetNameEn(s string) *BankCreate

SetNameEn sets the "name_en" field.

func (*BankCreate) SetNameZh

func (bc *BankCreate) SetNameZh(s string) *BankCreate

SetNameZh sets the "name_zh" field.

func (*BankCreate) SetNillableCountryID

func (bc *BankCreate) SetNillableCountryID(u *uint64) *BankCreate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*BankCreate) SetNillableCreatedAt

func (bc *BankCreate) SetNillableCreatedAt(t *time.Time) *BankCreate

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

func (*BankCreate) SetNillableDeletedAt

func (bc *BankCreate) SetNillableDeletedAt(t *time.Time) *BankCreate

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

func (*BankCreate) SetNillableUpdatedAt

func (bc *BankCreate) SetNillableUpdatedAt(t *time.Time) *BankCreate

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

func (*BankCreate) SetUpdatedAt

func (bc *BankCreate) SetUpdatedAt(t time.Time) *BankCreate

SetUpdatedAt sets the "updated_at" field.

type BankCreateBulk

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

BankCreateBulk is the builder for creating many Bank entities in bulk.

func (*BankCreateBulk) Exec

func (bcb *BankCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BankCreateBulk) ExecContext

func (c *BankCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankCreateBulk) ExecX

func (bcb *BankCreateBulk) ExecX(ctx context.Context)

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

func (*BankCreateBulk) OnConflict

func (bcb *BankCreateBulk) OnConflict(opts ...sql.ConflictOption) *BankUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Bank.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BankUpsert) {
		SetNameEn(v+v).
	}).
	Exec(ctx)

func (*BankCreateBulk) OnConflictColumns

func (bcb *BankCreateBulk) OnConflictColumns(columns ...string) *BankUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Bank.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BankCreateBulk) QueryContext

func (c *BankCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankCreateBulk) Save

func (bcb *BankCreateBulk) Save(ctx context.Context) ([]*Bank, error)

Save creates the Bank entities in the database.

func (*BankCreateBulk) SaveX

func (bcb *BankCreateBulk) SaveX(ctx context.Context) []*Bank

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

type BankDelete

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

BankDelete is the builder for deleting a Bank entity.

func (*BankDelete) Exec

func (bd *BankDelete) Exec(ctx context.Context) (int, error)

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

func (*BankDelete) ExecContext

func (c *BankDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankDelete) ExecX

func (bd *BankDelete) ExecX(ctx context.Context) int

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

func (*BankDelete) QueryContext

func (c *BankDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankDelete) Where

func (bd *BankDelete) Where(ps ...predicate.Bank) *BankDelete

Where appends a list predicates to the BankDelete builder.

type BankDeleteOne

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

BankDeleteOne is the builder for deleting a single Bank entity.

func (*BankDeleteOne) Exec

func (bdo *BankDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BankDeleteOne) ExecX

func (bdo *BankDeleteOne) ExecX(ctx context.Context)

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

func (*BankDeleteOne) Where

func (bdo *BankDeleteOne) Where(ps ...predicate.Bank) *BankDeleteOne

Where appends a list predicates to the BankDelete builder.

type BankEdges

type BankEdges struct {
	// Country to which the bank belongs
	Country *Country `json:"country,omitempty"`
	// User bind with this bank
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

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

func (BankEdges) CountryOrErr

func (e BankEdges) CountryOrErr() (*Country, error)

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

func (BankEdges) UsersOrErr

func (e BankEdges) UsersOrErr() ([]*User, error)

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

type BankGroupBy

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

BankGroupBy is the group-by builder for Bank entities.

func (*BankGroupBy) Aggregate

func (bgb *BankGroupBy) Aggregate(fns ...AggregateFunc) *BankGroupBy

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

func (*BankGroupBy) Bool

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

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

func (*BankGroupBy) BoolX

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

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

func (*BankGroupBy) Bools

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

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

func (*BankGroupBy) BoolsX

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

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

func (*BankGroupBy) Float64

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

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

func (*BankGroupBy) Float64X

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

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

func (*BankGroupBy) Float64s

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

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

func (*BankGroupBy) Float64sX

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

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

func (*BankGroupBy) Int

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

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

func (*BankGroupBy) IntX

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

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

func (*BankGroupBy) Ints

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

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

func (*BankGroupBy) IntsX

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

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

func (*BankGroupBy) Scan

func (bgb *BankGroupBy) Scan(ctx context.Context, v any) error

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

func (*BankGroupBy) ScanX

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

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

func (*BankGroupBy) String

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

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

func (*BankGroupBy) StringX

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

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

func (*BankGroupBy) Strings

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

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

func (*BankGroupBy) StringsX

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

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

type BankMutation

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

BankMutation represents an operation that mutates the Bank nodes in the graph.

func (*BankMutation) AddField

func (m *BankMutation) 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 (*BankMutation) AddUserIDs

func (m *BankMutation) AddUserIDs(ids ...uint64)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*BankMutation) AddedEdges

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

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

func (*BankMutation) AddedField

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

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

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

func (*BankMutation) AddedIDs

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

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

func (*BankMutation) ClearCountry

func (m *BankMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*BankMutation) ClearCountryID

func (m *BankMutation) ClearCountryID()

ClearCountryID clears the value of the "country_id" field.

func (*BankMutation) ClearDeletedAt

func (m *BankMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BankMutation) ClearEdge

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

func (m *BankMutation) 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 (*BankMutation) ClearUsers

func (m *BankMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*BankMutation) ClearedEdges

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

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

func (*BankMutation) ClearedFields

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

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

func (BankMutation) Client

func (m BankMutation) 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 (*BankMutation) CountryCleared

func (m *BankMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*BankMutation) CountryID

func (m *BankMutation) CountryID() (r uint64, exists bool)

CountryID returns the value of the "country_id" field in the mutation.

func (*BankMutation) CountryIDCleared

func (m *BankMutation) CountryIDCleared() bool

CountryIDCleared returns if the "country_id" field was cleared in this mutation.

func (*BankMutation) CountryIDs

func (m *BankMutation) CountryIDs() (ids []uint64)

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

func (*BankMutation) CreatedAt

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

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

func (*BankMutation) DeletedAt

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

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

func (*BankMutation) DeletedAtCleared

func (m *BankMutation) DeletedAtCleared() bool

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

func (*BankMutation) EdgeCleared

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

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

func (*BankMutation) ExecContext

func (c *BankMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankMutation) Field

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

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

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

func (*BankMutation) Fields

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

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

func (m *BankMutation) 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 (*BankMutation) NameEn

func (m *BankMutation) NameEn() (r string, exists bool)

NameEn returns the value of the "name_en" field in the mutation.

func (*BankMutation) NameZh

func (m *BankMutation) NameZh() (r string, exists bool)

NameZh returns the value of the "name_zh" field in the mutation.

func (*BankMutation) OldCountryID

func (m *BankMutation) OldCountryID(ctx context.Context) (v *uint64, err error)

OldCountryID returns the old "country_id" field's value of the Bank entity. If the Bank 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 (*BankMutation) OldCreatedAt

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

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

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

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

func (m *BankMutation) 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 (*BankMutation) OldNameEn

func (m *BankMutation) OldNameEn(ctx context.Context) (v string, err error)

OldNameEn returns the old "name_en" field's value of the Bank entity. If the Bank 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 (*BankMutation) OldNameZh

func (m *BankMutation) OldNameZh(ctx context.Context) (v string, err error)

OldNameZh returns the old "name_zh" field's value of the Bank entity. If the Bank 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 (*BankMutation) OldUpdatedAt

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

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

func (m *BankMutation) Op() Op

Op returns the operation name.

func (*BankMutation) QueryContext

func (c *BankMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankMutation) RemoveUserIDs

func (m *BankMutation) RemoveUserIDs(ids ...uint64)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*BankMutation) RemovedEdges

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

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

func (*BankMutation) RemovedIDs

func (m *BankMutation) 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 (*BankMutation) RemovedUsersIDs

func (m *BankMutation) RemovedUsersIDs() (ids []uint64)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*BankMutation) ResetCountry

func (m *BankMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*BankMutation) ResetCountryID

func (m *BankMutation) ResetCountryID()

ResetCountryID resets all changes to the "country_id" field.

func (*BankMutation) ResetCreatedAt

func (m *BankMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BankMutation) ResetDeletedAt

func (m *BankMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*BankMutation) ResetEdge

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

func (m *BankMutation) 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 (*BankMutation) ResetNameEn

func (m *BankMutation) ResetNameEn()

ResetNameEn resets all changes to the "name_en" field.

func (*BankMutation) ResetNameZh

func (m *BankMutation) ResetNameZh()

ResetNameZh resets all changes to the "name_zh" field.

func (*BankMutation) ResetUpdatedAt

func (m *BankMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BankMutation) ResetUsers

func (m *BankMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*BankMutation) SetCountryID

func (m *BankMutation) SetCountryID(u uint64)

SetCountryID sets the "country_id" field.

func (*BankMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BankMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*BankMutation) SetField

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

func (m *BankMutation) SetID(id uint64)

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

func (*BankMutation) SetNameEn

func (m *BankMutation) SetNameEn(s string)

SetNameEn sets the "name_en" field.

func (*BankMutation) SetNameZh

func (m *BankMutation) SetNameZh(s string)

SetNameZh sets the "name_zh" field.

func (*BankMutation) SetOp

func (m *BankMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BankMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (BankMutation) Tx

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

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

func (*BankMutation) Type

func (m *BankMutation) Type() string

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

func (*BankMutation) UpdatedAt

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

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

func (*BankMutation) UsersCleared

func (m *BankMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*BankMutation) UsersIDs

func (m *BankMutation) UsersIDs() (ids []uint64)

UsersIDs returns the "users" edge IDs in the mutation.

func (*BankMutation) Where

func (m *BankMutation) Where(ps ...predicate.Bank)

Where appends a list predicates to the BankMutation builder.

func (*BankMutation) WhereP

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

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

type BankQuery

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

BankQuery is the builder for querying Bank entities.

func (*BankQuery) Aggregate

func (bq *BankQuery) Aggregate(fns ...AggregateFunc) *BankSelect

Aggregate returns a BankSelect configured with the given aggregations.

func (*BankQuery) All

func (bq *BankQuery) All(ctx context.Context) ([]*Bank, error)

All executes the query and returns a list of Banks.

func (*BankQuery) AllX

func (bq *BankQuery) AllX(ctx context.Context) []*Bank

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

func (*BankQuery) Clone

func (bq *BankQuery) Clone() *BankQuery

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

func (*BankQuery) Count

func (bq *BankQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BankQuery) CountX

func (bq *BankQuery) CountX(ctx context.Context) int

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

func (*BankQuery) ExecContext

func (c *BankQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankQuery) Exist

func (bq *BankQuery) Exist(ctx context.Context) (bool, error)

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

func (*BankQuery) ExistX

func (bq *BankQuery) ExistX(ctx context.Context) bool

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

func (*BankQuery) First

func (bq *BankQuery) First(ctx context.Context) (*Bank, error)

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

func (*BankQuery) FirstID

func (bq *BankQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*BankQuery) FirstIDX

func (bq *BankQuery) FirstIDX(ctx context.Context) uint64

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

func (*BankQuery) FirstX

func (bq *BankQuery) FirstX(ctx context.Context) *Bank

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

func (*BankQuery) GroupBy

func (bq *BankQuery) GroupBy(field string, fields ...string) *BankGroupBy

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

client.Bank.Query().
	GroupBy(bank.FieldNameEn).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BankQuery) IDs

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

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

func (*BankQuery) IDsX

func (bq *BankQuery) IDsX(ctx context.Context) []uint64

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

func (*BankQuery) Limit

func (bq *BankQuery) Limit(limit int) *BankQuery

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

func (*BankQuery) Offset

func (bq *BankQuery) Offset(offset int) *BankQuery

Offset to start from.

func (*BankQuery) Only

func (bq *BankQuery) Only(ctx context.Context) (*Bank, error)

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

func (*BankQuery) OnlyID

func (bq *BankQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*BankQuery) OnlyIDX

func (bq *BankQuery) OnlyIDX(ctx context.Context) uint64

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

func (*BankQuery) OnlyX

func (bq *BankQuery) OnlyX(ctx context.Context) *Bank

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

func (*BankQuery) Order

func (bq *BankQuery) Order(o ...bank.OrderOption) *BankQuery

Order specifies how the records should be ordered.

func (*BankQuery) QueryContext

func (c *BankQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankQuery) QueryCountry

func (bq *BankQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*BankQuery) QueryUsers

func (bq *BankQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*BankQuery) Select

func (bq *BankQuery) Select(fields ...string) *BankSelect

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

client.Bank.Query().
	Select(bank.FieldNameEn).
	Scan(ctx, &v)

func (*BankQuery) Unique

func (bq *BankQuery) Unique(unique bool) *BankQuery

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

func (bq *BankQuery) Where(ps ...predicate.Bank) *BankQuery

Where adds a new predicate for the BankQuery builder.

func (*BankQuery) WithCountry

func (bq *BankQuery) WithCountry(opts ...func(*CountryQuery)) *BankQuery

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

func (*BankQuery) WithUsers

func (bq *BankQuery) WithUsers(opts ...func(*UserQuery)) *BankQuery

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

type BankSelect

type BankSelect struct {
	*BankQuery
	// contains filtered or unexported fields
}

BankSelect is the builder for selecting fields of Bank entities.

func (*BankSelect) Aggregate

func (bs *BankSelect) Aggregate(fns ...AggregateFunc) *BankSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BankSelect) Bool

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

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

func (*BankSelect) BoolX

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

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

func (*BankSelect) Bools

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

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

func (*BankSelect) BoolsX

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

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

func (BankSelect) ExecContext

func (c BankSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankSelect) Float64

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

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

func (*BankSelect) Float64X

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

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

func (*BankSelect) Float64s

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

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

func (*BankSelect) Float64sX

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

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

func (*BankSelect) Int

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

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

func (*BankSelect) IntX

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

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

func (*BankSelect) Ints

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

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

func (*BankSelect) IntsX

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

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

func (BankSelect) QueryContext

func (c BankSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankSelect) Scan

func (bs *BankSelect) Scan(ctx context.Context, v any) error

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

func (*BankSelect) ScanX

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

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

func (*BankSelect) String

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

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

func (*BankSelect) StringX

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

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

func (*BankSelect) Strings

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

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

func (*BankSelect) StringsX

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

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

type BankUpdate

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

BankUpdate is the builder for updating Bank entities.

func (*BankUpdate) AddUserIDs

func (bu *BankUpdate) AddUserIDs(ids ...uint64) *BankUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*BankUpdate) AddUsers

func (bu *BankUpdate) AddUsers(u ...*User) *BankUpdate

AddUsers adds the "users" edges to the User entity.

func (*BankUpdate) ClearCountry

func (bu *BankUpdate) ClearCountry() *BankUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*BankUpdate) ClearCountryID

func (bu *BankUpdate) ClearCountryID() *BankUpdate

ClearCountryID clears the value of the "country_id" field.

func (*BankUpdate) ClearDeletedAt

func (bu *BankUpdate) ClearDeletedAt() *BankUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BankUpdate) ClearUsers

func (bu *BankUpdate) ClearUsers() *BankUpdate

ClearUsers clears all "users" edges to the User entity.

func (*BankUpdate) Exec

func (bu *BankUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BankUpdate) ExecContext

func (c *BankUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankUpdate) ExecX

func (bu *BankUpdate) ExecX(ctx context.Context)

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

func (*BankUpdate) Mutation

func (bu *BankUpdate) Mutation() *BankMutation

Mutation returns the BankMutation object of the builder.

func (*BankUpdate) QueryContext

func (c *BankUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankUpdate) RemoveUserIDs

func (bu *BankUpdate) RemoveUserIDs(ids ...uint64) *BankUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*BankUpdate) RemoveUsers

func (bu *BankUpdate) RemoveUsers(u ...*User) *BankUpdate

RemoveUsers removes "users" edges to User entities.

func (*BankUpdate) Save

func (bu *BankUpdate) Save(ctx context.Context) (int, error)

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

func (*BankUpdate) SaveX

func (bu *BankUpdate) SaveX(ctx context.Context) int

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

func (*BankUpdate) SetCountry

func (bu *BankUpdate) SetCountry(c *Country) *BankUpdate

SetCountry sets the "country" edge to the Country entity.

func (*BankUpdate) SetCountryID

func (bu *BankUpdate) SetCountryID(u uint64) *BankUpdate

SetCountryID sets the "country_id" field.

func (*BankUpdate) SetCreatedAt

func (bu *BankUpdate) SetCreatedAt(t time.Time) *BankUpdate

SetCreatedAt sets the "created_at" field.

func (*BankUpdate) SetDeletedAt

func (bu *BankUpdate) SetDeletedAt(t time.Time) *BankUpdate

SetDeletedAt sets the "deleted_at" field.

func (*BankUpdate) SetNameEn

func (bu *BankUpdate) SetNameEn(s string) *BankUpdate

SetNameEn sets the "name_en" field.

func (*BankUpdate) SetNameZh

func (bu *BankUpdate) SetNameZh(s string) *BankUpdate

SetNameZh sets the "name_zh" field.

func (*BankUpdate) SetNillableCountryID

func (bu *BankUpdate) SetNillableCountryID(u *uint64) *BankUpdate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*BankUpdate) SetNillableCreatedAt

func (bu *BankUpdate) SetNillableCreatedAt(t *time.Time) *BankUpdate

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

func (*BankUpdate) SetNillableDeletedAt

func (bu *BankUpdate) SetNillableDeletedAt(t *time.Time) *BankUpdate

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

func (*BankUpdate) SetNillableNameEn

func (bu *BankUpdate) SetNillableNameEn(s *string) *BankUpdate

SetNillableNameEn sets the "name_en" field if the given value is not nil.

func (*BankUpdate) SetNillableNameZh

func (bu *BankUpdate) SetNillableNameZh(s *string) *BankUpdate

SetNillableNameZh sets the "name_zh" field if the given value is not nil.

func (*BankUpdate) SetUpdatedAt

func (bu *BankUpdate) SetUpdatedAt(t time.Time) *BankUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BankUpdate) Where

func (bu *BankUpdate) Where(ps ...predicate.Bank) *BankUpdate

Where appends a list predicates to the BankUpdate builder.

type BankUpdateOne

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

BankUpdateOne is the builder for updating a single Bank entity.

func (*BankUpdateOne) AddUserIDs

func (buo *BankUpdateOne) AddUserIDs(ids ...uint64) *BankUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*BankUpdateOne) AddUsers

func (buo *BankUpdateOne) AddUsers(u ...*User) *BankUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*BankUpdateOne) ClearCountry

func (buo *BankUpdateOne) ClearCountry() *BankUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*BankUpdateOne) ClearCountryID

func (buo *BankUpdateOne) ClearCountryID() *BankUpdateOne

ClearCountryID clears the value of the "country_id" field.

func (*BankUpdateOne) ClearDeletedAt

func (buo *BankUpdateOne) ClearDeletedAt() *BankUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BankUpdateOne) ClearUsers

func (buo *BankUpdateOne) ClearUsers() *BankUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*BankUpdateOne) Exec

func (buo *BankUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BankUpdateOne) ExecContext

func (c *BankUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*BankUpdateOne) ExecX

func (buo *BankUpdateOne) ExecX(ctx context.Context)

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

func (*BankUpdateOne) Mutation

func (buo *BankUpdateOne) Mutation() *BankMutation

Mutation returns the BankMutation object of the builder.

func (*BankUpdateOne) QueryContext

func (c *BankUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*BankUpdateOne) RemoveUserIDs

func (buo *BankUpdateOne) RemoveUserIDs(ids ...uint64) *BankUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*BankUpdateOne) RemoveUsers

func (buo *BankUpdateOne) RemoveUsers(u ...*User) *BankUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*BankUpdateOne) Save

func (buo *BankUpdateOne) Save(ctx context.Context) (*Bank, error)

Save executes the query and returns the updated Bank entity.

func (*BankUpdateOne) SaveX

func (buo *BankUpdateOne) SaveX(ctx context.Context) *Bank

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

func (*BankUpdateOne) Select

func (buo *BankUpdateOne) Select(field string, fields ...string) *BankUpdateOne

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

func (*BankUpdateOne) SetCountry

func (buo *BankUpdateOne) SetCountry(c *Country) *BankUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*BankUpdateOne) SetCountryID

func (buo *BankUpdateOne) SetCountryID(u uint64) *BankUpdateOne

SetCountryID sets the "country_id" field.

func (*BankUpdateOne) SetCreatedAt

func (buo *BankUpdateOne) SetCreatedAt(t time.Time) *BankUpdateOne

SetCreatedAt sets the "created_at" field.

func (*BankUpdateOne) SetDeletedAt

func (buo *BankUpdateOne) SetDeletedAt(t time.Time) *BankUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*BankUpdateOne) SetNameEn

func (buo *BankUpdateOne) SetNameEn(s string) *BankUpdateOne

SetNameEn sets the "name_en" field.

func (*BankUpdateOne) SetNameZh

func (buo *BankUpdateOne) SetNameZh(s string) *BankUpdateOne

SetNameZh sets the "name_zh" field.

func (*BankUpdateOne) SetNillableCountryID

func (buo *BankUpdateOne) SetNillableCountryID(u *uint64) *BankUpdateOne

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*BankUpdateOne) SetNillableCreatedAt

func (buo *BankUpdateOne) SetNillableCreatedAt(t *time.Time) *BankUpdateOne

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

func (*BankUpdateOne) SetNillableDeletedAt

func (buo *BankUpdateOne) SetNillableDeletedAt(t *time.Time) *BankUpdateOne

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

func (*BankUpdateOne) SetNillableNameEn

func (buo *BankUpdateOne) SetNillableNameEn(s *string) *BankUpdateOne

SetNillableNameEn sets the "name_en" field if the given value is not nil.

func (*BankUpdateOne) SetNillableNameZh

func (buo *BankUpdateOne) SetNillableNameZh(s *string) *BankUpdateOne

SetNillableNameZh sets the "name_zh" field if the given value is not nil.

func (*BankUpdateOne) SetUpdatedAt

func (buo *BankUpdateOne) SetUpdatedAt(t time.Time) *BankUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BankUpdateOne) Where

func (buo *BankUpdateOne) Where(ps ...predicate.Bank) *BankUpdateOne

Where appends a list predicates to the BankUpdate builder.

type BankUpsert

type BankUpsert struct {
	*sql.UpdateSet
}

BankUpsert is the "OnConflict" setter.

func (*BankUpsert) ClearCountryID

func (u *BankUpsert) ClearCountryID() *BankUpsert

ClearCountryID clears the value of the "country_id" field.

func (*BankUpsert) ClearDeletedAt

func (u *BankUpsert) ClearDeletedAt() *BankUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BankUpsert) SetCountryID

func (u *BankUpsert) SetCountryID(v uint64) *BankUpsert

SetCountryID sets the "country_id" field.

func (*BankUpsert) SetCreatedAt

func (u *BankUpsert) SetCreatedAt(v time.Time) *BankUpsert

SetCreatedAt sets the "created_at" field.

func (*BankUpsert) SetDeletedAt

func (u *BankUpsert) SetDeletedAt(v time.Time) *BankUpsert

SetDeletedAt sets the "deleted_at" field.

func (*BankUpsert) SetNameEn

func (u *BankUpsert) SetNameEn(v string) *BankUpsert

SetNameEn sets the "name_en" field.

func (*BankUpsert) SetNameZh

func (u *BankUpsert) SetNameZh(v string) *BankUpsert

SetNameZh sets the "name_zh" field.

func (*BankUpsert) SetUpdatedAt

func (u *BankUpsert) SetUpdatedAt(v time.Time) *BankUpsert

SetUpdatedAt sets the "updated_at" field.

func (*BankUpsert) UpdateCountryID

func (u *BankUpsert) UpdateCountryID() *BankUpsert

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*BankUpsert) UpdateCreatedAt

func (u *BankUpsert) UpdateCreatedAt() *BankUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*BankUpsert) UpdateDeletedAt

func (u *BankUpsert) UpdateDeletedAt() *BankUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BankUpsert) UpdateNameEn

func (u *BankUpsert) UpdateNameEn() *BankUpsert

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*BankUpsert) UpdateNameZh

func (u *BankUpsert) UpdateNameZh() *BankUpsert

UpdateNameZh sets the "name_zh" field to the value that was provided on create.

func (*BankUpsert) UpdateUpdatedAt

func (u *BankUpsert) UpdateUpdatedAt() *BankUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BankUpsertBulk

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

BankUpsertBulk is the builder for "upsert"-ing a bulk of Bank nodes.

func (*BankUpsertBulk) ClearCountryID

func (u *BankUpsertBulk) ClearCountryID() *BankUpsertBulk

ClearCountryID clears the value of the "country_id" field.

func (*BankUpsertBulk) ClearDeletedAt

func (u *BankUpsertBulk) ClearDeletedAt() *BankUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BankUpsertBulk) DoNothing

func (u *BankUpsertBulk) DoNothing() *BankUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BankUpsertBulk) Exec

func (u *BankUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BankUpsertBulk) ExecX

func (u *BankUpsertBulk) ExecX(ctx context.Context)

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

func (*BankUpsertBulk) Ignore

func (u *BankUpsertBulk) Ignore() *BankUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Bank.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*BankUpsertBulk) SetCountryID

func (u *BankUpsertBulk) SetCountryID(v uint64) *BankUpsertBulk

SetCountryID sets the "country_id" field.

func (*BankUpsertBulk) SetCreatedAt

func (u *BankUpsertBulk) SetCreatedAt(v time.Time) *BankUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*BankUpsertBulk) SetDeletedAt

func (u *BankUpsertBulk) SetDeletedAt(v time.Time) *BankUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*BankUpsertBulk) SetNameEn

func (u *BankUpsertBulk) SetNameEn(v string) *BankUpsertBulk

SetNameEn sets the "name_en" field.

func (*BankUpsertBulk) SetNameZh

func (u *BankUpsertBulk) SetNameZh(v string) *BankUpsertBulk

SetNameZh sets the "name_zh" field.

func (*BankUpsertBulk) SetUpdatedAt

func (u *BankUpsertBulk) SetUpdatedAt(v time.Time) *BankUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*BankUpsertBulk) Update

func (u *BankUpsertBulk) Update(set func(*BankUpsert)) *BankUpsertBulk

Update allows overriding fields `UPDATE` values. See the BankCreateBulk.OnConflict documentation for more info.

func (*BankUpsertBulk) UpdateCountryID

func (u *BankUpsertBulk) UpdateCountryID() *BankUpsertBulk

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*BankUpsertBulk) UpdateCreatedAt

func (u *BankUpsertBulk) UpdateCreatedAt() *BankUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*BankUpsertBulk) UpdateDeletedAt

func (u *BankUpsertBulk) UpdateDeletedAt() *BankUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BankUpsertBulk) UpdateNameEn

func (u *BankUpsertBulk) UpdateNameEn() *BankUpsertBulk

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*BankUpsertBulk) UpdateNameZh

func (u *BankUpsertBulk) UpdateNameZh() *BankUpsertBulk

UpdateNameZh sets the "name_zh" field to the value that was provided on create.

func (*BankUpsertBulk) UpdateNewValues

func (u *BankUpsertBulk) UpdateNewValues() *BankUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Bank.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(bank.FieldID)
		}),
	).
	Exec(ctx)

func (*BankUpsertBulk) UpdateUpdatedAt

func (u *BankUpsertBulk) UpdateUpdatedAt() *BankUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type BankUpsertOne

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

BankUpsertOne is the builder for "upsert"-ing

one Bank node.

func (*BankUpsertOne) ClearCountryID

func (u *BankUpsertOne) ClearCountryID() *BankUpsertOne

ClearCountryID clears the value of the "country_id" field.

func (*BankUpsertOne) ClearDeletedAt

func (u *BankUpsertOne) ClearDeletedAt() *BankUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*BankUpsertOne) DoNothing

func (u *BankUpsertOne) DoNothing() *BankUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BankUpsertOne) Exec

func (u *BankUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*BankUpsertOne) ExecX

func (u *BankUpsertOne) ExecX(ctx context.Context)

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

func (*BankUpsertOne) ID

func (u *BankUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*BankUpsertOne) IDX

func (u *BankUpsertOne) IDX(ctx context.Context) uint64

IDX is like ID, but panics if an error occurs.

func (*BankUpsertOne) Ignore

func (u *BankUpsertOne) Ignore() *BankUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Bank.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*BankUpsertOne) SetCountryID

func (u *BankUpsertOne) SetCountryID(v uint64) *BankUpsertOne

SetCountryID sets the "country_id" field.

func (*BankUpsertOne) SetCreatedAt

func (u *BankUpsertOne) SetCreatedAt(v time.Time) *BankUpsertOne

SetCreatedAt sets the "created_at" field.

func (*BankUpsertOne) SetDeletedAt

func (u *BankUpsertOne) SetDeletedAt(v time.Time) *BankUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*BankUpsertOne) SetNameEn

func (u *BankUpsertOne) SetNameEn(v string) *BankUpsertOne

SetNameEn sets the "name_en" field.

func (*BankUpsertOne) SetNameZh

func (u *BankUpsertOne) SetNameZh(v string) *BankUpsertOne

SetNameZh sets the "name_zh" field.

func (*BankUpsertOne) SetUpdatedAt

func (u *BankUpsertOne) SetUpdatedAt(v time.Time) *BankUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*BankUpsertOne) Update

func (u *BankUpsertOne) Update(set func(*BankUpsert)) *BankUpsertOne

Update allows overriding fields `UPDATE` values. See the BankCreate.OnConflict documentation for more info.

func (*BankUpsertOne) UpdateCountryID

func (u *BankUpsertOne) UpdateCountryID() *BankUpsertOne

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*BankUpsertOne) UpdateCreatedAt

func (u *BankUpsertOne) UpdateCreatedAt() *BankUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*BankUpsertOne) UpdateDeletedAt

func (u *BankUpsertOne) UpdateDeletedAt() *BankUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*BankUpsertOne) UpdateNameEn

func (u *BankUpsertOne) UpdateNameEn() *BankUpsertOne

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*BankUpsertOne) UpdateNameZh

func (u *BankUpsertOne) UpdateNameZh() *BankUpsertOne

UpdateNameZh sets the "name_zh" field to the value that was provided on create.

func (*BankUpsertOne) UpdateNewValues

func (u *BankUpsertOne) UpdateNewValues() *BankUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Bank.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(bank.FieldID)
		}),
	).
	Exec(ctx)

func (*BankUpsertOne) UpdateUpdatedAt

func (u *BankUpsertOne) UpdateUpdatedAt() *BankUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Banks

type Banks []*Bank

Banks is a parsable slice of Bank.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Admin is the client for interacting with the Admin builders.
	Admin *AdminClient
	// Bank is the client for interacting with the Bank builders.
	Bank *BankClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// CountryLocation is the client for interacting with the CountryLocation builders.
	CountryLocation *CountryLocationClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Admin.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 Countries

type Countries []*Country

Countries is a parsable slice of Country.

type Country

type Country struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// ISO 3166-1 alpha-2 country code
	Iso2 string `json:"iso2,omitempty"`
	// ISO 3166-1 alpha-3 country code
	Iso3 string `json:"iso3,omitempty"`
	// Country name
	Name string `json:"name,omitempty"`
	// Official country name
	OfficialName *string `json:"official_name,omitempty"`
	// ISO 3166-1 numeric code
	NumericCode *string `json:"numeric_code,omitempty"`
	// Country calling code, e.g., +1 for US
	PhoneCode *string `json:"phone_code,omitempty"`
	// Capital city of the country
	Capital *string `json:"capital,omitempty"`
	// Currency name
	CurrencyName *string `json:"currency_name,omitempty"`
	// ISO 4217 currency code
	CurrencyCode *string `json:"currency_code,omitempty"`
	// Currency symbol
	CurrencySymbol *string `json:"currency_symbol,omitempty"`
	// Conversion rate
	ConversionRate float64 `json:"conversion_rate,omitempty"`
	// Status
	Status uint8 `json:"status,omitempty"`
	// Record creation timestamp
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Record update timestamp
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CountryQuery when eager-loading is set.
	Edges CountryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Country is the model entity for the Country schema.

func (*Country) ExecContext

func (c *Country) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Country) QueryBanks

func (c *Country) QueryBanks() *BankQuery

QueryBanks queries the "banks" edge of the Country entity.

func (*Country) QueryContactUsers

func (c *Country) QueryContactUsers() *UserQuery

QueryContactUsers queries the "contact_users" edge of the Country entity.

func (*Country) QueryContext

func (c *Country) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Country) QueryLocations

func (c *Country) QueryLocations() *CountryLocationQuery

QueryLocations queries the "locations" edge of the Country entity.

func (*Country) QueryUsers

func (c *Country) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Country entity.

func (*Country) String

func (c *Country) String() string

String implements the fmt.Stringer.

func (*Country) Unwrap

func (c *Country) Unwrap() *Country

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

func (c *Country) Update() *CountryUpdateOne

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

func (*Country) Value

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

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

type CountryClient

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

CountryClient is a client for the Country schema.

func NewCountryClient

func NewCountryClient(c config) *CountryClient

NewCountryClient returns a client for the Country from the given config.

func (*CountryClient) Create

func (c *CountryClient) Create() *CountryCreate

Create returns a builder for creating a Country entity.

func (*CountryClient) CreateBulk

func (c *CountryClient) CreateBulk(builders ...*CountryCreate) *CountryCreateBulk

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

func (*CountryClient) Delete

func (c *CountryClient) Delete() *CountryDelete

Delete returns a delete builder for Country.

func (*CountryClient) DeleteOne

func (c *CountryClient) DeleteOne(co *Country) *CountryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CountryClient) DeleteOneID

func (c *CountryClient) DeleteOneID(id uint64) *CountryDeleteOne

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

func (*CountryClient) ExecContext

func (c *CountryClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryClient) Get

func (c *CountryClient) Get(ctx context.Context, id uint64) (*Country, error)

Get returns a Country entity by its id.

func (*CountryClient) GetX

func (c *CountryClient) GetX(ctx context.Context, id uint64) *Country

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

func (*CountryClient) Hooks

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

Hooks returns the client hooks.

func (*CountryClient) Intercept

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

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

func (*CountryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CountryClient) MapCreateBulk

func (c *CountryClient) MapCreateBulk(slice any, setFunc func(*CountryCreate, int)) *CountryCreateBulk

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

func (c *CountryClient) Query() *CountryQuery

Query returns a query builder for Country.

func (*CountryClient) QueryBanks

func (c *CountryClient) QueryBanks(co *Country) *BankQuery

QueryBanks queries the banks edge of a Country.

func (*CountryClient) QueryContactUsers

func (c *CountryClient) QueryContactUsers(co *Country) *UserQuery

QueryContactUsers queries the contact_users edge of a Country.

func (*CountryClient) QueryContext

func (c *CountryClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryClient) QueryLocations

func (c *CountryClient) QueryLocations(co *Country) *CountryLocationQuery

QueryLocations queries the locations edge of a Country.

func (*CountryClient) QueryUsers

func (c *CountryClient) QueryUsers(co *Country) *UserQuery

QueryUsers queries the users edge of a Country.

func (*CountryClient) Update

func (c *CountryClient) Update() *CountryUpdate

Update returns an update builder for Country.

func (*CountryClient) UpdateOne

func (c *CountryClient) UpdateOne(co *Country) *CountryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CountryClient) UpdateOneID

func (c *CountryClient) UpdateOneID(id uint64) *CountryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CountryClient) Use

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

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

type CountryCreate

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

CountryCreate is the builder for creating a Country entity.

func (*CountryCreate) AddBankIDs

func (cc *CountryCreate) AddBankIDs(ids ...uint64) *CountryCreate

AddBankIDs adds the "banks" edge to the Bank entity by IDs.

func (*CountryCreate) AddBanks

func (cc *CountryCreate) AddBanks(b ...*Bank) *CountryCreate

AddBanks adds the "banks" edges to the Bank entity.

func (*CountryCreate) AddContactUserIDs

func (cc *CountryCreate) AddContactUserIDs(ids ...uint64) *CountryCreate

AddContactUserIDs adds the "contact_users" edge to the User entity by IDs.

func (*CountryCreate) AddContactUsers

func (cc *CountryCreate) AddContactUsers(u ...*User) *CountryCreate

AddContactUsers adds the "contact_users" edges to the User entity.

func (*CountryCreate) AddLocationIDs

func (cc *CountryCreate) AddLocationIDs(ids ...uint64) *CountryCreate

AddLocationIDs adds the "locations" edge to the CountryLocation entity by IDs.

func (*CountryCreate) AddLocations

func (cc *CountryCreate) AddLocations(c ...*CountryLocation) *CountryCreate

AddLocations adds the "locations" edges to the CountryLocation entity.

func (*CountryCreate) AddUserIDs

func (cc *CountryCreate) AddUserIDs(ids ...uint64) *CountryCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*CountryCreate) AddUsers

func (cc *CountryCreate) AddUsers(u ...*User) *CountryCreate

AddUsers adds the "users" edges to the User entity.

func (*CountryCreate) Exec

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

Exec executes the query.

func (*CountryCreate) ExecContext

func (c *CountryCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryCreate) ExecX

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

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

func (*CountryCreate) Mutation

func (cc *CountryCreate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryCreate) OnConflict

func (cc *CountryCreate) OnConflict(opts ...sql.ConflictOption) *CountryUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Country.Create().
	SetIso2(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CountryUpsert) {
		SetIso2(v+v).
	}).
	Exec(ctx)

func (*CountryCreate) OnConflictColumns

func (cc *CountryCreate) OnConflictColumns(columns ...string) *CountryUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Country.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CountryCreate) QueryContext

func (c *CountryCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryCreate) Save

func (cc *CountryCreate) Save(ctx context.Context) (*Country, error)

Save creates the Country in the database.

func (*CountryCreate) SaveX

func (cc *CountryCreate) SaveX(ctx context.Context) *Country

SaveX calls Save and panics if Save returns an error.

func (*CountryCreate) SetCapital

func (cc *CountryCreate) SetCapital(s string) *CountryCreate

SetCapital sets the "capital" field.

func (*CountryCreate) SetConversionRate

func (cc *CountryCreate) SetConversionRate(f float64) *CountryCreate

SetConversionRate sets the "conversion_rate" field.

func (*CountryCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CountryCreate) SetCurrencyCode

func (cc *CountryCreate) SetCurrencyCode(s string) *CountryCreate

SetCurrencyCode sets the "currency_code" field.

func (*CountryCreate) SetCurrencyName

func (cc *CountryCreate) SetCurrencyName(s string) *CountryCreate

SetCurrencyName sets the "currency_name" field.

func (*CountryCreate) SetCurrencySymbol

func (cc *CountryCreate) SetCurrencySymbol(s string) *CountryCreate

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryCreate) SetID

func (cc *CountryCreate) SetID(u uint64) *CountryCreate

SetID sets the "id" field.

func (*CountryCreate) SetIso2

func (cc *CountryCreate) SetIso2(s string) *CountryCreate

SetIso2 sets the "iso2" field.

func (*CountryCreate) SetIso3

func (cc *CountryCreate) SetIso3(s string) *CountryCreate

SetIso3 sets the "iso3" field.

func (*CountryCreate) SetName

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

SetName sets the "name" field.

func (*CountryCreate) SetNillableCapital

func (cc *CountryCreate) SetNillableCapital(s *string) *CountryCreate

SetNillableCapital sets the "capital" field if the given value is not nil.

func (*CountryCreate) SetNillableConversionRate

func (cc *CountryCreate) SetNillableConversionRate(f *float64) *CountryCreate

SetNillableConversionRate sets the "conversion_rate" field if the given value is not nil.

func (*CountryCreate) SetNillableCreatedAt

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

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

func (*CountryCreate) SetNillableCurrencyCode

func (cc *CountryCreate) SetNillableCurrencyCode(s *string) *CountryCreate

SetNillableCurrencyCode sets the "currency_code" field if the given value is not nil.

func (*CountryCreate) SetNillableCurrencyName

func (cc *CountryCreate) SetNillableCurrencyName(s *string) *CountryCreate

SetNillableCurrencyName sets the "currency_name" field if the given value is not nil.

func (*CountryCreate) SetNillableCurrencySymbol

func (cc *CountryCreate) SetNillableCurrencySymbol(s *string) *CountryCreate

SetNillableCurrencySymbol sets the "currency_symbol" field if the given value is not nil.

func (*CountryCreate) SetNillableNumericCode

func (cc *CountryCreate) SetNillableNumericCode(s *string) *CountryCreate

SetNillableNumericCode sets the "numeric_code" field if the given value is not nil.

func (*CountryCreate) SetNillableOfficialName

func (cc *CountryCreate) SetNillableOfficialName(s *string) *CountryCreate

SetNillableOfficialName sets the "official_name" field if the given value is not nil.

func (*CountryCreate) SetNillablePhoneCode

func (cc *CountryCreate) SetNillablePhoneCode(s *string) *CountryCreate

SetNillablePhoneCode sets the "phone_code" field if the given value is not nil.

func (*CountryCreate) SetNillableStatus

func (cc *CountryCreate) SetNillableStatus(u *uint8) *CountryCreate

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

func (*CountryCreate) SetNillableUpdatedAt

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

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

func (*CountryCreate) SetNumericCode

func (cc *CountryCreate) SetNumericCode(s string) *CountryCreate

SetNumericCode sets the "numeric_code" field.

func (*CountryCreate) SetOfficialName

func (cc *CountryCreate) SetOfficialName(s string) *CountryCreate

SetOfficialName sets the "official_name" field.

func (*CountryCreate) SetPhoneCode

func (cc *CountryCreate) SetPhoneCode(s string) *CountryCreate

SetPhoneCode sets the "phone_code" field.

func (*CountryCreate) SetStatus

func (cc *CountryCreate) SetStatus(u uint8) *CountryCreate

SetStatus sets the "status" field.

func (*CountryCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type CountryCreateBulk

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

CountryCreateBulk is the builder for creating many Country entities in bulk.

func (*CountryCreateBulk) Exec

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

Exec executes the query.

func (*CountryCreateBulk) ExecContext

func (c *CountryCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryCreateBulk) ExecX

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

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

func (*CountryCreateBulk) OnConflict

func (ccb *CountryCreateBulk) OnConflict(opts ...sql.ConflictOption) *CountryUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Country.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CountryUpsert) {
		SetIso2(v+v).
	}).
	Exec(ctx)

func (*CountryCreateBulk) OnConflictColumns

func (ccb *CountryCreateBulk) OnConflictColumns(columns ...string) *CountryUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Country.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CountryCreateBulk) QueryContext

func (c *CountryCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryCreateBulk) Save

func (ccb *CountryCreateBulk) Save(ctx context.Context) ([]*Country, error)

Save creates the Country entities in the database.

func (*CountryCreateBulk) SaveX

func (ccb *CountryCreateBulk) SaveX(ctx context.Context) []*Country

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

type CountryDelete

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

CountryDelete is the builder for deleting a Country entity.

func (*CountryDelete) Exec

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

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

func (*CountryDelete) ExecContext

func (c *CountryDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryDelete) ExecX

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

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

func (*CountryDelete) QueryContext

func (c *CountryDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryDelete) Where

func (cd *CountryDelete) Where(ps ...predicate.Country) *CountryDelete

Where appends a list predicates to the CountryDelete builder.

type CountryDeleteOne

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

CountryDeleteOne is the builder for deleting a single Country entity.

func (*CountryDeleteOne) Exec

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

Exec executes the deletion query.

func (*CountryDeleteOne) ExecX

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

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

func (*CountryDeleteOne) Where

Where appends a list predicates to the CountryDelete builder.

type CountryEdges

type CountryEdges struct {
	// Locations belonging to the country
	Locations []*CountryLocation `json:"locations,omitempty"`
	// Banks belonging to the country
	Banks []*Bank `json:"banks,omitempty"`
	// Users belonging to the country
	Users []*User `json:"users,omitempty"`
	// Contact country Users belonging to the country
	ContactUsers []*User `json:"contact_users,omitempty"`
	// contains filtered or unexported fields
}

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

func (CountryEdges) BanksOrErr

func (e CountryEdges) BanksOrErr() ([]*Bank, error)

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

func (CountryEdges) ContactUsersOrErr

func (e CountryEdges) ContactUsersOrErr() ([]*User, error)

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

func (CountryEdges) LocationsOrErr

func (e CountryEdges) LocationsOrErr() ([]*CountryLocation, error)

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

func (CountryEdges) UsersOrErr

func (e CountryEdges) UsersOrErr() ([]*User, error)

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

type CountryGroupBy

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

CountryGroupBy is the group-by builder for Country entities.

func (*CountryGroupBy) Aggregate

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

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

func (*CountryGroupBy) Bool

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

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

func (*CountryGroupBy) BoolX

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

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

func (*CountryGroupBy) Bools

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

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

func (*CountryGroupBy) BoolsX

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

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

func (*CountryGroupBy) Float64

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

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

func (*CountryGroupBy) Float64X

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

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

func (*CountryGroupBy) Float64s

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

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

func (*CountryGroupBy) Float64sX

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

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

func (*CountryGroupBy) Int

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

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

func (*CountryGroupBy) IntX

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

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

func (*CountryGroupBy) Ints

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

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

func (*CountryGroupBy) IntsX

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

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

func (*CountryGroupBy) Scan

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

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

func (*CountryGroupBy) ScanX

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

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

func (*CountryGroupBy) String

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

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

func (*CountryGroupBy) StringX

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

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

func (*CountryGroupBy) Strings

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

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

func (*CountryGroupBy) StringsX

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

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

type CountryLocation

type CountryLocation struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Country of the location
	CountryID *uint64 `json:"country_id,omitempty"`
	// If present, it is area; this is state id
	ParentID *uint64 `json:"parent_id,omitempty"`
	// Sorting order
	Sorting uint64 `json:"sorting,omitempty"`
	// Location name in English
	NameEn string `json:"name_en,omitempty"`
	// Location name in Chinese
	NameZh string `json:"name_zh,omitempty"`
	// Record creation timestamp
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Record update timestamp
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Record deletion timestamp
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CountryLocationQuery when eager-loading is set.
	Edges CountryLocationEdges `json:"edges"`
	// contains filtered or unexported fields
}

CountryLocation is the model entity for the CountryLocation schema.

func (*CountryLocation) ExecContext

func (c *CountryLocation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocation) QueryChildLocations

func (cl *CountryLocation) QueryChildLocations() *CountryLocationQuery

QueryChildLocations queries the "child_locations" edge of the CountryLocation entity.

func (*CountryLocation) QueryContext

func (c *CountryLocation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocation) QueryCountry

func (cl *CountryLocation) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the CountryLocation entity.

func (*CountryLocation) QueryParent

func (cl *CountryLocation) QueryParent() *CountryLocationQuery

QueryParent queries the "parent" edge of the CountryLocation entity.

func (*CountryLocation) String

func (cl *CountryLocation) String() string

String implements the fmt.Stringer.

func (*CountryLocation) Unwrap

func (cl *CountryLocation) Unwrap() *CountryLocation

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

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

func (*CountryLocation) Value

func (cl *CountryLocation) Value(name string) (ent.Value, error)

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

type CountryLocationClient

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

CountryLocationClient is a client for the CountryLocation schema.

func NewCountryLocationClient

func NewCountryLocationClient(c config) *CountryLocationClient

NewCountryLocationClient returns a client for the CountryLocation from the given config.

func (*CountryLocationClient) Create

Create returns a builder for creating a CountryLocation entity.

func (*CountryLocationClient) CreateBulk

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

func (*CountryLocationClient) Delete

Delete returns a delete builder for CountryLocation.

func (*CountryLocationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CountryLocationClient) DeleteOneID

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

func (*CountryLocationClient) ExecContext

func (c *CountryLocationClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationClient) Get

Get returns a CountryLocation entity by its id.

func (*CountryLocationClient) GetX

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

func (*CountryLocationClient) Hooks

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

Hooks returns the client hooks.

func (*CountryLocationClient) Intercept

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

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

func (*CountryLocationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CountryLocationClient) MapCreateBulk

func (c *CountryLocationClient) MapCreateBulk(slice any, setFunc func(*CountryLocationCreate, int)) *CountryLocationCreateBulk

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

Query returns a query builder for CountryLocation.

func (*CountryLocationClient) QueryChildLocations

func (c *CountryLocationClient) QueryChildLocations(cl *CountryLocation) *CountryLocationQuery

QueryChildLocations queries the child_locations edge of a CountryLocation.

func (*CountryLocationClient) QueryContext

func (c *CountryLocationClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationClient) QueryCountry

func (c *CountryLocationClient) QueryCountry(cl *CountryLocation) *CountryQuery

QueryCountry queries the country edge of a CountryLocation.

func (*CountryLocationClient) QueryParent

QueryParent queries the parent edge of a CountryLocation.

func (*CountryLocationClient) Update

Update returns an update builder for CountryLocation.

func (*CountryLocationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CountryLocationClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*CountryLocationClient) Use

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

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

type CountryLocationCreate

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

CountryLocationCreate is the builder for creating a CountryLocation entity.

func (*CountryLocationCreate) AddChildLocationIDs

func (clc *CountryLocationCreate) AddChildLocationIDs(ids ...uint64) *CountryLocationCreate

AddChildLocationIDs adds the "child_locations" edge to the CountryLocation entity by IDs.

func (*CountryLocationCreate) AddChildLocations

func (clc *CountryLocationCreate) AddChildLocations(c ...*CountryLocation) *CountryLocationCreate

AddChildLocations adds the "child_locations" edges to the CountryLocation entity.

func (*CountryLocationCreate) Exec

func (clc *CountryLocationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryLocationCreate) ExecContext

func (c *CountryLocationCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationCreate) ExecX

func (clc *CountryLocationCreate) ExecX(ctx context.Context)

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

func (*CountryLocationCreate) Mutation

Mutation returns the CountryLocationMutation object of the builder.

func (*CountryLocationCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.CountryLocation.Create().
	SetCountryID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CountryLocationUpsert) {
		SetCountryID(v+v).
	}).
	Exec(ctx)

func (*CountryLocationCreate) OnConflictColumns

func (clc *CountryLocationCreate) OnConflictColumns(columns ...string) *CountryLocationUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.CountryLocation.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CountryLocationCreate) QueryContext

func (c *CountryLocationCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationCreate) Save

Save creates the CountryLocation in the database.

func (*CountryLocationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CountryLocationCreate) SetCountry

SetCountry sets the "country" edge to the Country entity.

func (*CountryLocationCreate) SetCountryID

func (clc *CountryLocationCreate) SetCountryID(u uint64) *CountryLocationCreate

SetCountryID sets the "country_id" field.

func (*CountryLocationCreate) SetCreatedAt

func (clc *CountryLocationCreate) SetCreatedAt(t time.Time) *CountryLocationCreate

SetCreatedAt sets the "created_at" field.

func (*CountryLocationCreate) SetDeletedAt

func (clc *CountryLocationCreate) SetDeletedAt(t time.Time) *CountryLocationCreate

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationCreate) SetID

SetID sets the "id" field.

func (*CountryLocationCreate) SetNameEn

SetNameEn sets the "name_en" field.

func (*CountryLocationCreate) SetNameZh

SetNameZh sets the "name_zh" field.

func (*CountryLocationCreate) SetNillableCountryID

func (clc *CountryLocationCreate) SetNillableCountryID(u *uint64) *CountryLocationCreate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*CountryLocationCreate) SetNillableCreatedAt

func (clc *CountryLocationCreate) SetNillableCreatedAt(t *time.Time) *CountryLocationCreate

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

func (*CountryLocationCreate) SetNillableDeletedAt

func (clc *CountryLocationCreate) SetNillableDeletedAt(t *time.Time) *CountryLocationCreate

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

func (*CountryLocationCreate) SetNillableParentID

func (clc *CountryLocationCreate) SetNillableParentID(u *uint64) *CountryLocationCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*CountryLocationCreate) SetNillableSorting

func (clc *CountryLocationCreate) SetNillableSorting(u *uint64) *CountryLocationCreate

SetNillableSorting sets the "sorting" field if the given value is not nil.

func (*CountryLocationCreate) SetNillableUpdatedAt

func (clc *CountryLocationCreate) SetNillableUpdatedAt(t *time.Time) *CountryLocationCreate

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

func (*CountryLocationCreate) SetParent

SetParent sets the "parent" edge to the CountryLocation entity.

func (*CountryLocationCreate) SetParentID

func (clc *CountryLocationCreate) SetParentID(u uint64) *CountryLocationCreate

SetParentID sets the "parent_id" field.

func (*CountryLocationCreate) SetSorting

SetSorting sets the "sorting" field.

func (*CountryLocationCreate) SetUpdatedAt

func (clc *CountryLocationCreate) SetUpdatedAt(t time.Time) *CountryLocationCreate

SetUpdatedAt sets the "updated_at" field.

type CountryLocationCreateBulk

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

CountryLocationCreateBulk is the builder for creating many CountryLocation entities in bulk.

func (*CountryLocationCreateBulk) Exec

Exec executes the query.

func (*CountryLocationCreateBulk) ExecContext

func (c *CountryLocationCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationCreateBulk) ExecX

func (clcb *CountryLocationCreateBulk) ExecX(ctx context.Context)

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

func (*CountryLocationCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.CountryLocation.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.CountryLocationUpsert) {
		SetCountryID(v+v).
	}).
	Exec(ctx)

func (*CountryLocationCreateBulk) OnConflictColumns

func (clcb *CountryLocationCreateBulk) OnConflictColumns(columns ...string) *CountryLocationUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.CountryLocation.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*CountryLocationCreateBulk) QueryContext

func (c *CountryLocationCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationCreateBulk) Save

Save creates the CountryLocation entities in the database.

func (*CountryLocationCreateBulk) SaveX

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

type CountryLocationDelete

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

CountryLocationDelete is the builder for deleting a CountryLocation entity.

func (*CountryLocationDelete) Exec

func (cld *CountryLocationDelete) Exec(ctx context.Context) (int, error)

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

func (*CountryLocationDelete) ExecContext

func (c *CountryLocationDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationDelete) ExecX

func (cld *CountryLocationDelete) ExecX(ctx context.Context) int

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

func (*CountryLocationDelete) QueryContext

func (c *CountryLocationDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationDelete) Where

Where appends a list predicates to the CountryLocationDelete builder.

type CountryLocationDeleteOne

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

CountryLocationDeleteOne is the builder for deleting a single CountryLocation entity.

func (*CountryLocationDeleteOne) Exec

Exec executes the deletion query.

func (*CountryLocationDeleteOne) ExecX

func (cldo *CountryLocationDeleteOne) ExecX(ctx context.Context)

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

func (*CountryLocationDeleteOne) Where

Where appends a list predicates to the CountryLocationDelete builder.

type CountryLocationEdges

type CountryLocationEdges struct {
	// Country of the location
	Country *Country `json:"country,omitempty"`
	// Parent location (e.g., state of an area)
	Parent *CountryLocation `json:"parent,omitempty"`
	// Child locations of this parent
	ChildLocations []*CountryLocation `json:"child_locations,omitempty"`
	// contains filtered or unexported fields
}

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

func (CountryLocationEdges) ChildLocationsOrErr

func (e CountryLocationEdges) ChildLocationsOrErr() ([]*CountryLocation, error)

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

func (CountryLocationEdges) CountryOrErr

func (e CountryLocationEdges) CountryOrErr() (*Country, error)

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

func (CountryLocationEdges) ParentOrErr

func (e CountryLocationEdges) ParentOrErr() (*CountryLocation, error)

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

type CountryLocationGroupBy

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

CountryLocationGroupBy is the group-by builder for CountryLocation entities.

func (*CountryLocationGroupBy) Aggregate

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

func (*CountryLocationGroupBy) Bool

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

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

func (*CountryLocationGroupBy) BoolX

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

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

func (*CountryLocationGroupBy) Bools

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

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

func (*CountryLocationGroupBy) BoolsX

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

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

func (*CountryLocationGroupBy) Float64

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

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

func (*CountryLocationGroupBy) Float64X

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

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

func (*CountryLocationGroupBy) Float64s

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

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

func (*CountryLocationGroupBy) Float64sX

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

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

func (*CountryLocationGroupBy) Int

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

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

func (*CountryLocationGroupBy) IntX

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

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

func (*CountryLocationGroupBy) Ints

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

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

func (*CountryLocationGroupBy) IntsX

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

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

func (*CountryLocationGroupBy) Scan

func (clgb *CountryLocationGroupBy) Scan(ctx context.Context, v any) error

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

func (*CountryLocationGroupBy) ScanX

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

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

func (*CountryLocationGroupBy) String

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

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

func (*CountryLocationGroupBy) StringX

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

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

func (*CountryLocationGroupBy) Strings

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

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

func (*CountryLocationGroupBy) StringsX

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

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

type CountryLocationMutation

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

CountryLocationMutation represents an operation that mutates the CountryLocation nodes in the graph.

func (*CountryLocationMutation) AddChildLocationIDs

func (m *CountryLocationMutation) AddChildLocationIDs(ids ...uint64)

AddChildLocationIDs adds the "child_locations" edge to the CountryLocation entity by ids.

func (*CountryLocationMutation) AddField

func (m *CountryLocationMutation) 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 (*CountryLocationMutation) AddSorting

func (m *CountryLocationMutation) AddSorting(u int64)

AddSorting adds u to the "sorting" field.

func (*CountryLocationMutation) AddedEdges

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

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

func (*CountryLocationMutation) AddedField

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

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

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

func (*CountryLocationMutation) AddedIDs

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

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

func (*CountryLocationMutation) AddedSorting

func (m *CountryLocationMutation) AddedSorting() (r int64, exists bool)

AddedSorting returns the value that was added to the "sorting" field in this mutation.

func (*CountryLocationMutation) ChildLocationsCleared

func (m *CountryLocationMutation) ChildLocationsCleared() bool

ChildLocationsCleared reports if the "child_locations" edge to the CountryLocation entity was cleared.

func (*CountryLocationMutation) ChildLocationsIDs

func (m *CountryLocationMutation) ChildLocationsIDs() (ids []uint64)

ChildLocationsIDs returns the "child_locations" edge IDs in the mutation.

func (*CountryLocationMutation) ClearChildLocations

func (m *CountryLocationMutation) ClearChildLocations()

ClearChildLocations clears the "child_locations" edge to the CountryLocation entity.

func (*CountryLocationMutation) ClearCountry

func (m *CountryLocationMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*CountryLocationMutation) ClearCountryID

func (m *CountryLocationMutation) ClearCountryID()

ClearCountryID clears the value of the "country_id" field.

func (*CountryLocationMutation) ClearDeletedAt

func (m *CountryLocationMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CountryLocationMutation) ClearEdge

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

func (m *CountryLocationMutation) 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 (*CountryLocationMutation) ClearParent

func (m *CountryLocationMutation) ClearParent()

ClearParent clears the "parent" edge to the CountryLocation entity.

func (*CountryLocationMutation) ClearParentID

func (m *CountryLocationMutation) ClearParentID()

ClearParentID clears the value of the "parent_id" field.

func (*CountryLocationMutation) ClearedEdges

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

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

func (*CountryLocationMutation) ClearedFields

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

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

func (CountryLocationMutation) Client

func (m CountryLocationMutation) 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 (*CountryLocationMutation) CountryCleared

func (m *CountryLocationMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*CountryLocationMutation) CountryID

func (m *CountryLocationMutation) CountryID() (r uint64, exists bool)

CountryID returns the value of the "country_id" field in the mutation.

func (*CountryLocationMutation) CountryIDCleared

func (m *CountryLocationMutation) CountryIDCleared() bool

CountryIDCleared returns if the "country_id" field was cleared in this mutation.

func (*CountryLocationMutation) CountryIDs

func (m *CountryLocationMutation) CountryIDs() (ids []uint64)

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

func (*CountryLocationMutation) CreatedAt

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

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

func (*CountryLocationMutation) DeletedAt

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

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

func (*CountryLocationMutation) DeletedAtCleared

func (m *CountryLocationMutation) DeletedAtCleared() bool

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

func (*CountryLocationMutation) EdgeCleared

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

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

func (*CountryLocationMutation) ExecContext

func (c *CountryLocationMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationMutation) Field

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

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

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

func (*CountryLocationMutation) Fields

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

func (m *CountryLocationMutation) 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 (*CountryLocationMutation) 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 (*CountryLocationMutation) NameEn

func (m *CountryLocationMutation) NameEn() (r string, exists bool)

NameEn returns the value of the "name_en" field in the mutation.

func (*CountryLocationMutation) NameZh

func (m *CountryLocationMutation) NameZh() (r string, exists bool)

NameZh returns the value of the "name_zh" field in the mutation.

func (*CountryLocationMutation) OldCountryID

func (m *CountryLocationMutation) OldCountryID(ctx context.Context) (v *uint64, err error)

OldCountryID returns the old "country_id" field's value of the CountryLocation entity. If the CountryLocation 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 (*CountryLocationMutation) OldCreatedAt

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

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

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

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

func (m *CountryLocationMutation) 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 (*CountryLocationMutation) OldNameEn

func (m *CountryLocationMutation) OldNameEn(ctx context.Context) (v string, err error)

OldNameEn returns the old "name_en" field's value of the CountryLocation entity. If the CountryLocation 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 (*CountryLocationMutation) OldNameZh

func (m *CountryLocationMutation) OldNameZh(ctx context.Context) (v string, err error)

OldNameZh returns the old "name_zh" field's value of the CountryLocation entity. If the CountryLocation 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 (*CountryLocationMutation) OldParentID

func (m *CountryLocationMutation) OldParentID(ctx context.Context) (v *uint64, err error)

OldParentID returns the old "parent_id" field's value of the CountryLocation entity. If the CountryLocation 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 (*CountryLocationMutation) OldSorting

func (m *CountryLocationMutation) OldSorting(ctx context.Context) (v uint64, err error)

OldSorting returns the old "sorting" field's value of the CountryLocation entity. If the CountryLocation 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 (*CountryLocationMutation) OldUpdatedAt

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

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

func (m *CountryLocationMutation) Op() Op

Op returns the operation name.

func (*CountryLocationMutation) ParentCleared

func (m *CountryLocationMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the CountryLocation entity was cleared.

func (*CountryLocationMutation) ParentID

func (m *CountryLocationMutation) ParentID() (r uint64, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*CountryLocationMutation) ParentIDCleared

func (m *CountryLocationMutation) ParentIDCleared() bool

ParentIDCleared returns if the "parent_id" field was cleared in this mutation.

func (*CountryLocationMutation) ParentIDs

func (m *CountryLocationMutation) ParentIDs() (ids []uint64)

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

func (*CountryLocationMutation) QueryContext

func (c *CountryLocationMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationMutation) RemoveChildLocationIDs

func (m *CountryLocationMutation) RemoveChildLocationIDs(ids ...uint64)

RemoveChildLocationIDs removes the "child_locations" edge to the CountryLocation entity by IDs.

func (*CountryLocationMutation) RemovedChildLocationsIDs

func (m *CountryLocationMutation) RemovedChildLocationsIDs() (ids []uint64)

RemovedChildLocations returns the removed IDs of the "child_locations" edge to the CountryLocation entity.

func (*CountryLocationMutation) RemovedEdges

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

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

func (*CountryLocationMutation) RemovedIDs

func (m *CountryLocationMutation) 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 (*CountryLocationMutation) ResetChildLocations

func (m *CountryLocationMutation) ResetChildLocations()

ResetChildLocations resets all changes to the "child_locations" edge.

func (*CountryLocationMutation) ResetCountry

func (m *CountryLocationMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*CountryLocationMutation) ResetCountryID

func (m *CountryLocationMutation) ResetCountryID()

ResetCountryID resets all changes to the "country_id" field.

func (*CountryLocationMutation) ResetCreatedAt

func (m *CountryLocationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CountryLocationMutation) ResetDeletedAt

func (m *CountryLocationMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CountryLocationMutation) ResetEdge

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

func (m *CountryLocationMutation) 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 (*CountryLocationMutation) ResetNameEn

func (m *CountryLocationMutation) ResetNameEn()

ResetNameEn resets all changes to the "name_en" field.

func (*CountryLocationMutation) ResetNameZh

func (m *CountryLocationMutation) ResetNameZh()

ResetNameZh resets all changes to the "name_zh" field.

func (*CountryLocationMutation) ResetParent

func (m *CountryLocationMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*CountryLocationMutation) ResetParentID

func (m *CountryLocationMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*CountryLocationMutation) ResetSorting

func (m *CountryLocationMutation) ResetSorting()

ResetSorting resets all changes to the "sorting" field.

func (*CountryLocationMutation) ResetUpdatedAt

func (m *CountryLocationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CountryLocationMutation) SetCountryID

func (m *CountryLocationMutation) SetCountryID(u uint64)

SetCountryID sets the "country_id" field.

func (*CountryLocationMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CountryLocationMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationMutation) SetField

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

func (m *CountryLocationMutation) SetID(id uint64)

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

func (*CountryLocationMutation) SetNameEn

func (m *CountryLocationMutation) SetNameEn(s string)

SetNameEn sets the "name_en" field.

func (*CountryLocationMutation) SetNameZh

func (m *CountryLocationMutation) SetNameZh(s string)

SetNameZh sets the "name_zh" field.

func (*CountryLocationMutation) SetOp

func (m *CountryLocationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CountryLocationMutation) SetParentID

func (m *CountryLocationMutation) SetParentID(u uint64)

SetParentID sets the "parent_id" field.

func (*CountryLocationMutation) SetSorting

func (m *CountryLocationMutation) SetSorting(u uint64)

SetSorting sets the "sorting" field.

func (*CountryLocationMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CountryLocationMutation) Sorting

func (m *CountryLocationMutation) Sorting() (r uint64, exists bool)

Sorting returns the value of the "sorting" field in the mutation.

func (CountryLocationMutation) Tx

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

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

func (*CountryLocationMutation) Type

func (m *CountryLocationMutation) Type() string

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

func (*CountryLocationMutation) UpdatedAt

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

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

func (*CountryLocationMutation) Where

Where appends a list predicates to the CountryLocationMutation builder.

func (*CountryLocationMutation) WhereP

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

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

type CountryLocationQuery

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

CountryLocationQuery is the builder for querying CountryLocation entities.

func (*CountryLocationQuery) Aggregate

Aggregate returns a CountryLocationSelect configured with the given aggregations.

func (*CountryLocationQuery) All

All executes the query and returns a list of CountryLocations.

func (*CountryLocationQuery) AllX

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

func (*CountryLocationQuery) Clone

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

func (*CountryLocationQuery) Count

func (clq *CountryLocationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CountryLocationQuery) CountX

func (clq *CountryLocationQuery) CountX(ctx context.Context) int

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

func (*CountryLocationQuery) ExecContext

func (c *CountryLocationQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationQuery) Exist

func (clq *CountryLocationQuery) Exist(ctx context.Context) (bool, error)

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

func (*CountryLocationQuery) ExistX

func (clq *CountryLocationQuery) ExistX(ctx context.Context) bool

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

func (*CountryLocationQuery) First

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

func (*CountryLocationQuery) FirstID

func (clq *CountryLocationQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*CountryLocationQuery) FirstIDX

func (clq *CountryLocationQuery) FirstIDX(ctx context.Context) uint64

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

func (*CountryLocationQuery) FirstX

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

func (*CountryLocationQuery) GroupBy

func (clq *CountryLocationQuery) GroupBy(field string, fields ...string) *CountryLocationGroupBy

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 {
	CountryID uint64 `json:"country_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CountryLocation.Query().
	GroupBy(countrylocation.FieldCountryID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CountryLocationQuery) IDs

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

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

func (*CountryLocationQuery) IDsX

func (clq *CountryLocationQuery) IDsX(ctx context.Context) []uint64

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

func (*CountryLocationQuery) Limit

func (clq *CountryLocationQuery) Limit(limit int) *CountryLocationQuery

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

func (*CountryLocationQuery) Offset

func (clq *CountryLocationQuery) Offset(offset int) *CountryLocationQuery

Offset to start from.

func (*CountryLocationQuery) Only

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

func (*CountryLocationQuery) OnlyID

func (clq *CountryLocationQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*CountryLocationQuery) OnlyIDX

func (clq *CountryLocationQuery) OnlyIDX(ctx context.Context) uint64

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

func (*CountryLocationQuery) OnlyX

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

func (*CountryLocationQuery) Order

Order specifies how the records should be ordered.

func (*CountryLocationQuery) QueryChildLocations

func (clq *CountryLocationQuery) QueryChildLocations() *CountryLocationQuery

QueryChildLocations chains the current query on the "child_locations" edge.

func (*CountryLocationQuery) QueryContext

func (c *CountryLocationQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationQuery) QueryCountry

func (clq *CountryLocationQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*CountryLocationQuery) QueryParent

func (clq *CountryLocationQuery) QueryParent() *CountryLocationQuery

QueryParent chains the current query on the "parent" edge.

func (*CountryLocationQuery) Select

func (clq *CountryLocationQuery) Select(fields ...string) *CountryLocationSelect

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 {
	CountryID uint64 `json:"country_id,omitempty"`
}

client.CountryLocation.Query().
	Select(countrylocation.FieldCountryID).
	Scan(ctx, &v)

func (*CountryLocationQuery) Unique

func (clq *CountryLocationQuery) Unique(unique bool) *CountryLocationQuery

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

Where adds a new predicate for the CountryLocationQuery builder.

func (*CountryLocationQuery) WithChildLocations

func (clq *CountryLocationQuery) WithChildLocations(opts ...func(*CountryLocationQuery)) *CountryLocationQuery

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

func (*CountryLocationQuery) WithCountry

func (clq *CountryLocationQuery) WithCountry(opts ...func(*CountryQuery)) *CountryLocationQuery

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

func (*CountryLocationQuery) WithParent

func (clq *CountryLocationQuery) WithParent(opts ...func(*CountryLocationQuery)) *CountryLocationQuery

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

type CountryLocationSelect

type CountryLocationSelect struct {
	*CountryLocationQuery
	// contains filtered or unexported fields
}

CountryLocationSelect is the builder for selecting fields of CountryLocation entities.

func (*CountryLocationSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*CountryLocationSelect) Bool

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

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

func (*CountryLocationSelect) BoolX

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

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

func (*CountryLocationSelect) Bools

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

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

func (*CountryLocationSelect) BoolsX

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

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

func (CountryLocationSelect) ExecContext

func (c CountryLocationSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationSelect) Float64

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

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

func (*CountryLocationSelect) Float64X

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

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

func (*CountryLocationSelect) Float64s

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

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

func (*CountryLocationSelect) Float64sX

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

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

func (*CountryLocationSelect) Int

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

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

func (*CountryLocationSelect) IntX

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

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

func (*CountryLocationSelect) Ints

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

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

func (*CountryLocationSelect) IntsX

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

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

func (CountryLocationSelect) QueryContext

func (c CountryLocationSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationSelect) Scan

func (cls *CountryLocationSelect) Scan(ctx context.Context, v any) error

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

func (*CountryLocationSelect) ScanX

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

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

func (*CountryLocationSelect) String

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

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

func (*CountryLocationSelect) StringX

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

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

func (*CountryLocationSelect) Strings

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

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

func (*CountryLocationSelect) StringsX

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

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

type CountryLocationUpdate

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

CountryLocationUpdate is the builder for updating CountryLocation entities.

func (*CountryLocationUpdate) AddChildLocationIDs

func (clu *CountryLocationUpdate) AddChildLocationIDs(ids ...uint64) *CountryLocationUpdate

AddChildLocationIDs adds the "child_locations" edge to the CountryLocation entity by IDs.

func (*CountryLocationUpdate) AddChildLocations

func (clu *CountryLocationUpdate) AddChildLocations(c ...*CountryLocation) *CountryLocationUpdate

AddChildLocations adds the "child_locations" edges to the CountryLocation entity.

func (*CountryLocationUpdate) AddSorting

AddSorting adds u to the "sorting" field.

func (*CountryLocationUpdate) ClearChildLocations

func (clu *CountryLocationUpdate) ClearChildLocations() *CountryLocationUpdate

ClearChildLocations clears all "child_locations" edges to the CountryLocation entity.

func (*CountryLocationUpdate) ClearCountry

func (clu *CountryLocationUpdate) ClearCountry() *CountryLocationUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*CountryLocationUpdate) ClearCountryID

func (clu *CountryLocationUpdate) ClearCountryID() *CountryLocationUpdate

ClearCountryID clears the value of the "country_id" field.

func (*CountryLocationUpdate) ClearDeletedAt

func (clu *CountryLocationUpdate) ClearDeletedAt() *CountryLocationUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CountryLocationUpdate) ClearParent

func (clu *CountryLocationUpdate) ClearParent() *CountryLocationUpdate

ClearParent clears the "parent" edge to the CountryLocation entity.

func (*CountryLocationUpdate) ClearParentID

func (clu *CountryLocationUpdate) ClearParentID() *CountryLocationUpdate

ClearParentID clears the value of the "parent_id" field.

func (*CountryLocationUpdate) Exec

func (clu *CountryLocationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryLocationUpdate) ExecContext

func (c *CountryLocationUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationUpdate) ExecX

func (clu *CountryLocationUpdate) ExecX(ctx context.Context)

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

func (*CountryLocationUpdate) Mutation

Mutation returns the CountryLocationMutation object of the builder.

func (*CountryLocationUpdate) QueryContext

func (c *CountryLocationUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationUpdate) RemoveChildLocationIDs

func (clu *CountryLocationUpdate) RemoveChildLocationIDs(ids ...uint64) *CountryLocationUpdate

RemoveChildLocationIDs removes the "child_locations" edge to CountryLocation entities by IDs.

func (*CountryLocationUpdate) RemoveChildLocations

func (clu *CountryLocationUpdate) RemoveChildLocations(c ...*CountryLocation) *CountryLocationUpdate

RemoveChildLocations removes "child_locations" edges to CountryLocation entities.

func (*CountryLocationUpdate) Save

func (clu *CountryLocationUpdate) Save(ctx context.Context) (int, error)

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

func (*CountryLocationUpdate) SaveX

func (clu *CountryLocationUpdate) SaveX(ctx context.Context) int

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

func (*CountryLocationUpdate) SetCountry

SetCountry sets the "country" edge to the Country entity.

func (*CountryLocationUpdate) SetCountryID

func (clu *CountryLocationUpdate) SetCountryID(u uint64) *CountryLocationUpdate

SetCountryID sets the "country_id" field.

func (*CountryLocationUpdate) SetCreatedAt

func (clu *CountryLocationUpdate) SetCreatedAt(t time.Time) *CountryLocationUpdate

SetCreatedAt sets the "created_at" field.

func (*CountryLocationUpdate) SetDeletedAt

func (clu *CountryLocationUpdate) SetDeletedAt(t time.Time) *CountryLocationUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationUpdate) SetNameEn

SetNameEn sets the "name_en" field.

func (*CountryLocationUpdate) SetNameZh

SetNameZh sets the "name_zh" field.

func (*CountryLocationUpdate) SetNillableCountryID

func (clu *CountryLocationUpdate) SetNillableCountryID(u *uint64) *CountryLocationUpdate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*CountryLocationUpdate) SetNillableCreatedAt

func (clu *CountryLocationUpdate) SetNillableCreatedAt(t *time.Time) *CountryLocationUpdate

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

func (*CountryLocationUpdate) SetNillableDeletedAt

func (clu *CountryLocationUpdate) SetNillableDeletedAt(t *time.Time) *CountryLocationUpdate

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

func (*CountryLocationUpdate) SetNillableNameEn

func (clu *CountryLocationUpdate) SetNillableNameEn(s *string) *CountryLocationUpdate

SetNillableNameEn sets the "name_en" field if the given value is not nil.

func (*CountryLocationUpdate) SetNillableNameZh

func (clu *CountryLocationUpdate) SetNillableNameZh(s *string) *CountryLocationUpdate

SetNillableNameZh sets the "name_zh" field if the given value is not nil.

func (*CountryLocationUpdate) SetNillableParentID

func (clu *CountryLocationUpdate) SetNillableParentID(u *uint64) *CountryLocationUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*CountryLocationUpdate) SetNillableSorting

func (clu *CountryLocationUpdate) SetNillableSorting(u *uint64) *CountryLocationUpdate

SetNillableSorting sets the "sorting" field if the given value is not nil.

func (*CountryLocationUpdate) SetParent

SetParent sets the "parent" edge to the CountryLocation entity.

func (*CountryLocationUpdate) SetParentID

func (clu *CountryLocationUpdate) SetParentID(u uint64) *CountryLocationUpdate

SetParentID sets the "parent_id" field.

func (*CountryLocationUpdate) SetSorting

SetSorting sets the "sorting" field.

func (*CountryLocationUpdate) SetUpdatedAt

func (clu *CountryLocationUpdate) SetUpdatedAt(t time.Time) *CountryLocationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CountryLocationUpdate) Where

Where appends a list predicates to the CountryLocationUpdate builder.

type CountryLocationUpdateOne

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

CountryLocationUpdateOne is the builder for updating a single CountryLocation entity.

func (*CountryLocationUpdateOne) AddChildLocationIDs

func (cluo *CountryLocationUpdateOne) AddChildLocationIDs(ids ...uint64) *CountryLocationUpdateOne

AddChildLocationIDs adds the "child_locations" edge to the CountryLocation entity by IDs.

func (*CountryLocationUpdateOne) AddChildLocations

func (cluo *CountryLocationUpdateOne) AddChildLocations(c ...*CountryLocation) *CountryLocationUpdateOne

AddChildLocations adds the "child_locations" edges to the CountryLocation entity.

func (*CountryLocationUpdateOne) AddSorting

AddSorting adds u to the "sorting" field.

func (*CountryLocationUpdateOne) ClearChildLocations

func (cluo *CountryLocationUpdateOne) ClearChildLocations() *CountryLocationUpdateOne

ClearChildLocations clears all "child_locations" edges to the CountryLocation entity.

func (*CountryLocationUpdateOne) ClearCountry

func (cluo *CountryLocationUpdateOne) ClearCountry() *CountryLocationUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*CountryLocationUpdateOne) ClearCountryID

func (cluo *CountryLocationUpdateOne) ClearCountryID() *CountryLocationUpdateOne

ClearCountryID clears the value of the "country_id" field.

func (*CountryLocationUpdateOne) ClearDeletedAt

func (cluo *CountryLocationUpdateOne) ClearDeletedAt() *CountryLocationUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CountryLocationUpdateOne) ClearParent

ClearParent clears the "parent" edge to the CountryLocation entity.

func (*CountryLocationUpdateOne) ClearParentID

func (cluo *CountryLocationUpdateOne) ClearParentID() *CountryLocationUpdateOne

ClearParentID clears the value of the "parent_id" field.

func (*CountryLocationUpdateOne) Exec

Exec executes the query on the entity.

func (*CountryLocationUpdateOne) ExecContext

func (c *CountryLocationUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryLocationUpdateOne) ExecX

func (cluo *CountryLocationUpdateOne) ExecX(ctx context.Context)

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

func (*CountryLocationUpdateOne) Mutation

Mutation returns the CountryLocationMutation object of the builder.

func (*CountryLocationUpdateOne) QueryContext

func (c *CountryLocationUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryLocationUpdateOne) RemoveChildLocationIDs

func (cluo *CountryLocationUpdateOne) RemoveChildLocationIDs(ids ...uint64) *CountryLocationUpdateOne

RemoveChildLocationIDs removes the "child_locations" edge to CountryLocation entities by IDs.

func (*CountryLocationUpdateOne) RemoveChildLocations

func (cluo *CountryLocationUpdateOne) RemoveChildLocations(c ...*CountryLocation) *CountryLocationUpdateOne

RemoveChildLocations removes "child_locations" edges to CountryLocation entities.

func (*CountryLocationUpdateOne) Save

Save executes the query and returns the updated CountryLocation entity.

func (*CountryLocationUpdateOne) SaveX

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

func (*CountryLocationUpdateOne) Select

func (cluo *CountryLocationUpdateOne) Select(field string, fields ...string) *CountryLocationUpdateOne

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

func (*CountryLocationUpdateOne) SetCountry

SetCountry sets the "country" edge to the Country entity.

func (*CountryLocationUpdateOne) SetCountryID

SetCountryID sets the "country_id" field.

func (*CountryLocationUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*CountryLocationUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationUpdateOne) SetNameEn

SetNameEn sets the "name_en" field.

func (*CountryLocationUpdateOne) SetNameZh

SetNameZh sets the "name_zh" field.

func (*CountryLocationUpdateOne) SetNillableCountryID

func (cluo *CountryLocationUpdateOne) SetNillableCountryID(u *uint64) *CountryLocationUpdateOne

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*CountryLocationUpdateOne) SetNillableCreatedAt

func (cluo *CountryLocationUpdateOne) SetNillableCreatedAt(t *time.Time) *CountryLocationUpdateOne

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

func (*CountryLocationUpdateOne) SetNillableDeletedAt

func (cluo *CountryLocationUpdateOne) SetNillableDeletedAt(t *time.Time) *CountryLocationUpdateOne

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

func (*CountryLocationUpdateOne) SetNillableNameEn

func (cluo *CountryLocationUpdateOne) SetNillableNameEn(s *string) *CountryLocationUpdateOne

SetNillableNameEn sets the "name_en" field if the given value is not nil.

func (*CountryLocationUpdateOne) SetNillableNameZh

func (cluo *CountryLocationUpdateOne) SetNillableNameZh(s *string) *CountryLocationUpdateOne

SetNillableNameZh sets the "name_zh" field if the given value is not nil.

func (*CountryLocationUpdateOne) SetNillableParentID

func (cluo *CountryLocationUpdateOne) SetNillableParentID(u *uint64) *CountryLocationUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*CountryLocationUpdateOne) SetNillableSorting

func (cluo *CountryLocationUpdateOne) SetNillableSorting(u *uint64) *CountryLocationUpdateOne

SetNillableSorting sets the "sorting" field if the given value is not nil.

func (*CountryLocationUpdateOne) SetParent

SetParent sets the "parent" edge to the CountryLocation entity.

func (*CountryLocationUpdateOne) SetParentID

SetParentID sets the "parent_id" field.

func (*CountryLocationUpdateOne) SetSorting

SetSorting sets the "sorting" field.

func (*CountryLocationUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*CountryLocationUpdateOne) Where

Where appends a list predicates to the CountryLocationUpdate builder.

type CountryLocationUpsert

type CountryLocationUpsert struct {
	*sql.UpdateSet
}

CountryLocationUpsert is the "OnConflict" setter.

func (*CountryLocationUpsert) AddSorting

AddSorting adds v to the "sorting" field.

func (*CountryLocationUpsert) ClearCountryID

func (u *CountryLocationUpsert) ClearCountryID() *CountryLocationUpsert

ClearCountryID clears the value of the "country_id" field.

func (*CountryLocationUpsert) ClearDeletedAt

func (u *CountryLocationUpsert) ClearDeletedAt() *CountryLocationUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CountryLocationUpsert) ClearParentID

func (u *CountryLocationUpsert) ClearParentID() *CountryLocationUpsert

ClearParentID clears the value of the "parent_id" field.

func (*CountryLocationUpsert) SetCountryID

SetCountryID sets the "country_id" field.

func (*CountryLocationUpsert) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*CountryLocationUpsert) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationUpsert) SetNameEn

SetNameEn sets the "name_en" field.

func (*CountryLocationUpsert) SetNameZh

SetNameZh sets the "name_zh" field.

func (*CountryLocationUpsert) SetParentID

SetParentID sets the "parent_id" field.

func (*CountryLocationUpsert) SetSorting

SetSorting sets the "sorting" field.

func (*CountryLocationUpsert) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*CountryLocationUpsert) UpdateCountryID

func (u *CountryLocationUpsert) UpdateCountryID() *CountryLocationUpsert

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateCreatedAt

func (u *CountryLocationUpsert) UpdateCreatedAt() *CountryLocationUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateDeletedAt

func (u *CountryLocationUpsert) UpdateDeletedAt() *CountryLocationUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateNameEn

func (u *CountryLocationUpsert) UpdateNameEn() *CountryLocationUpsert

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateNameZh

func (u *CountryLocationUpsert) UpdateNameZh() *CountryLocationUpsert

UpdateNameZh sets the "name_zh" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateParentID

func (u *CountryLocationUpsert) UpdateParentID() *CountryLocationUpsert

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateSorting

func (u *CountryLocationUpsert) UpdateSorting() *CountryLocationUpsert

UpdateSorting sets the "sorting" field to the value that was provided on create.

func (*CountryLocationUpsert) UpdateUpdatedAt

func (u *CountryLocationUpsert) UpdateUpdatedAt() *CountryLocationUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type CountryLocationUpsertBulk

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

CountryLocationUpsertBulk is the builder for "upsert"-ing a bulk of CountryLocation nodes.

func (*CountryLocationUpsertBulk) AddSorting

AddSorting adds v to the "sorting" field.

func (*CountryLocationUpsertBulk) ClearCountryID

ClearCountryID clears the value of the "country_id" field.

func (*CountryLocationUpsertBulk) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CountryLocationUpsertBulk) ClearParentID

ClearParentID clears the value of the "parent_id" field.

func (*CountryLocationUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CountryLocationUpsertBulk) Exec

Exec executes the query.

func (*CountryLocationUpsertBulk) ExecX

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

func (*CountryLocationUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.CountryLocation.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*CountryLocationUpsertBulk) SetCountryID

SetCountryID sets the "country_id" field.

func (*CountryLocationUpsertBulk) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*CountryLocationUpsertBulk) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationUpsertBulk) SetNameEn

SetNameEn sets the "name_en" field.

func (*CountryLocationUpsertBulk) SetNameZh

SetNameZh sets the "name_zh" field.

func (*CountryLocationUpsertBulk) SetParentID

SetParentID sets the "parent_id" field.

func (*CountryLocationUpsertBulk) SetSorting

SetSorting sets the "sorting" field.

func (*CountryLocationUpsertBulk) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*CountryLocationUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the CountryLocationCreateBulk.OnConflict documentation for more info.

func (*CountryLocationUpsertBulk) UpdateCountryID

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateCreatedAt

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateDeletedAt

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateNameEn

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateNameZh

UpdateNameZh sets the "name_zh" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.CountryLocation.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(countrylocation.FieldID)
		}),
	).
	Exec(ctx)

func (*CountryLocationUpsertBulk) UpdateParentID

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateSorting

UpdateSorting sets the "sorting" field to the value that was provided on create.

func (*CountryLocationUpsertBulk) UpdateUpdatedAt

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type CountryLocationUpsertOne

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

CountryLocationUpsertOne is the builder for "upsert"-ing

one CountryLocation node.

func (*CountryLocationUpsertOne) AddSorting

AddSorting adds v to the "sorting" field.

func (*CountryLocationUpsertOne) ClearCountryID

ClearCountryID clears the value of the "country_id" field.

func (*CountryLocationUpsertOne) ClearDeletedAt

ClearDeletedAt clears the value of the "deleted_at" field.

func (*CountryLocationUpsertOne) ClearParentID

ClearParentID clears the value of the "parent_id" field.

func (*CountryLocationUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CountryLocationUpsertOne) Exec

Exec executes the query.

func (*CountryLocationUpsertOne) ExecX

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

func (*CountryLocationUpsertOne) ID

func (u *CountryLocationUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*CountryLocationUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*CountryLocationUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.CountryLocation.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*CountryLocationUpsertOne) SetCountryID

SetCountryID sets the "country_id" field.

func (*CountryLocationUpsertOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*CountryLocationUpsertOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*CountryLocationUpsertOne) SetNameEn

SetNameEn sets the "name_en" field.

func (*CountryLocationUpsertOne) SetNameZh

SetNameZh sets the "name_zh" field.

func (*CountryLocationUpsertOne) SetParentID

SetParentID sets the "parent_id" field.

func (*CountryLocationUpsertOne) SetSorting

SetSorting sets the "sorting" field.

func (*CountryLocationUpsertOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*CountryLocationUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the CountryLocationCreate.OnConflict documentation for more info.

func (*CountryLocationUpsertOne) UpdateCountryID

func (u *CountryLocationUpsertOne) UpdateCountryID() *CountryLocationUpsertOne

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateCreatedAt

func (u *CountryLocationUpsertOne) UpdateCreatedAt() *CountryLocationUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateDeletedAt

func (u *CountryLocationUpsertOne) UpdateDeletedAt() *CountryLocationUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateNameEn

UpdateNameEn sets the "name_en" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateNameZh

UpdateNameZh sets the "name_zh" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateNewValues

func (u *CountryLocationUpsertOne) UpdateNewValues() *CountryLocationUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.CountryLocation.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(countrylocation.FieldID)
		}),
	).
	Exec(ctx)

func (*CountryLocationUpsertOne) UpdateParentID

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateSorting

UpdateSorting sets the "sorting" field to the value that was provided on create.

func (*CountryLocationUpsertOne) UpdateUpdatedAt

func (u *CountryLocationUpsertOne) UpdateUpdatedAt() *CountryLocationUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type CountryLocations

type CountryLocations []*CountryLocation

CountryLocations is a parsable slice of CountryLocation.

type CountryMutation

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

CountryMutation represents an operation that mutates the Country nodes in the graph.

func (*CountryMutation) AddBankIDs

func (m *CountryMutation) AddBankIDs(ids ...uint64)

AddBankIDs adds the "banks" edge to the Bank entity by ids.

func (*CountryMutation) AddContactUserIDs

func (m *CountryMutation) AddContactUserIDs(ids ...uint64)

AddContactUserIDs adds the "contact_users" edge to the User entity by ids.

func (*CountryMutation) AddConversionRate

func (m *CountryMutation) AddConversionRate(f float64)

AddConversionRate adds f to the "conversion_rate" field.

func (*CountryMutation) AddField

func (m *CountryMutation) 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 (*CountryMutation) AddLocationIDs

func (m *CountryMutation) AddLocationIDs(ids ...uint64)

AddLocationIDs adds the "locations" edge to the CountryLocation entity by ids.

func (*CountryMutation) AddStatus

func (m *CountryMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*CountryMutation) AddUserIDs

func (m *CountryMutation) AddUserIDs(ids ...uint64)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*CountryMutation) AddedConversionRate

func (m *CountryMutation) AddedConversionRate() (r float64, exists bool)

AddedConversionRate returns the value that was added to the "conversion_rate" field in this mutation.

func (*CountryMutation) AddedEdges

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

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

func (*CountryMutation) AddedField

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

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

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

func (*CountryMutation) AddedIDs

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

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

func (*CountryMutation) AddedStatus

func (m *CountryMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*CountryMutation) BanksCleared

func (m *CountryMutation) BanksCleared() bool

BanksCleared reports if the "banks" edge to the Bank entity was cleared.

func (*CountryMutation) BanksIDs

func (m *CountryMutation) BanksIDs() (ids []uint64)

BanksIDs returns the "banks" edge IDs in the mutation.

func (*CountryMutation) Capital

func (m *CountryMutation) Capital() (r string, exists bool)

Capital returns the value of the "capital" field in the mutation.

func (*CountryMutation) CapitalCleared

func (m *CountryMutation) CapitalCleared() bool

CapitalCleared returns if the "capital" field was cleared in this mutation.

func (*CountryMutation) ClearBanks

func (m *CountryMutation) ClearBanks()

ClearBanks clears the "banks" edge to the Bank entity.

func (*CountryMutation) ClearCapital

func (m *CountryMutation) ClearCapital()

ClearCapital clears the value of the "capital" field.

func (*CountryMutation) ClearContactUsers

func (m *CountryMutation) ClearContactUsers()

ClearContactUsers clears the "contact_users" edge to the User entity.

func (*CountryMutation) ClearCurrencyCode

func (m *CountryMutation) ClearCurrencyCode()

ClearCurrencyCode clears the value of the "currency_code" field.

func (*CountryMutation) ClearCurrencyName

func (m *CountryMutation) ClearCurrencyName()

ClearCurrencyName clears the value of the "currency_name" field.

func (*CountryMutation) ClearCurrencySymbol

func (m *CountryMutation) ClearCurrencySymbol()

ClearCurrencySymbol clears the value of the "currency_symbol" field.

func (*CountryMutation) ClearEdge

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

func (m *CountryMutation) 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 (*CountryMutation) ClearLocations

func (m *CountryMutation) ClearLocations()

ClearLocations clears the "locations" edge to the CountryLocation entity.

func (*CountryMutation) ClearNumericCode

func (m *CountryMutation) ClearNumericCode()

ClearNumericCode clears the value of the "numeric_code" field.

func (*CountryMutation) ClearOfficialName

func (m *CountryMutation) ClearOfficialName()

ClearOfficialName clears the value of the "official_name" field.

func (*CountryMutation) ClearPhoneCode

func (m *CountryMutation) ClearPhoneCode()

ClearPhoneCode clears the value of the "phone_code" field.

func (*CountryMutation) ClearUsers

func (m *CountryMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*CountryMutation) ClearedEdges

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

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

func (*CountryMutation) ClearedFields

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

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

func (CountryMutation) Client

func (m CountryMutation) 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 (*CountryMutation) ContactUsersCleared

func (m *CountryMutation) ContactUsersCleared() bool

ContactUsersCleared reports if the "contact_users" edge to the User entity was cleared.

func (*CountryMutation) ContactUsersIDs

func (m *CountryMutation) ContactUsersIDs() (ids []uint64)

ContactUsersIDs returns the "contact_users" edge IDs in the mutation.

func (*CountryMutation) ConversionRate

func (m *CountryMutation) ConversionRate() (r float64, exists bool)

ConversionRate returns the value of the "conversion_rate" field in the mutation.

func (*CountryMutation) CreatedAt

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

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

func (*CountryMutation) CurrencyCode

func (m *CountryMutation) CurrencyCode() (r string, exists bool)

CurrencyCode returns the value of the "currency_code" field in the mutation.

func (*CountryMutation) CurrencyCodeCleared

func (m *CountryMutation) CurrencyCodeCleared() bool

CurrencyCodeCleared returns if the "currency_code" field was cleared in this mutation.

func (*CountryMutation) CurrencyName

func (m *CountryMutation) CurrencyName() (r string, exists bool)

CurrencyName returns the value of the "currency_name" field in the mutation.

func (*CountryMutation) CurrencyNameCleared

func (m *CountryMutation) CurrencyNameCleared() bool

CurrencyNameCleared returns if the "currency_name" field was cleared in this mutation.

func (*CountryMutation) CurrencySymbol

func (m *CountryMutation) CurrencySymbol() (r string, exists bool)

CurrencySymbol returns the value of the "currency_symbol" field in the mutation.

func (*CountryMutation) CurrencySymbolCleared

func (m *CountryMutation) CurrencySymbolCleared() bool

CurrencySymbolCleared returns if the "currency_symbol" field was cleared in this mutation.

func (*CountryMutation) EdgeCleared

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

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

func (*CountryMutation) ExecContext

func (c *CountryMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryMutation) Field

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

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

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

func (*CountryMutation) Fields

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

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

func (m *CountryMutation) 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 (*CountryMutation) Iso2

func (m *CountryMutation) Iso2() (r string, exists bool)

Iso2 returns the value of the "iso2" field in the mutation.

func (*CountryMutation) Iso3

func (m *CountryMutation) Iso3() (r string, exists bool)

Iso3 returns the value of the "iso3" field in the mutation.

func (*CountryMutation) LocationsCleared

func (m *CountryMutation) LocationsCleared() bool

LocationsCleared reports if the "locations" edge to the CountryLocation entity was cleared.

func (*CountryMutation) LocationsIDs

func (m *CountryMutation) LocationsIDs() (ids []uint64)

LocationsIDs returns the "locations" edge IDs in the mutation.

func (*CountryMutation) Name

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

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

func (*CountryMutation) NumericCode

func (m *CountryMutation) NumericCode() (r string, exists bool)

NumericCode returns the value of the "numeric_code" field in the mutation.

func (*CountryMutation) NumericCodeCleared

func (m *CountryMutation) NumericCodeCleared() bool

NumericCodeCleared returns if the "numeric_code" field was cleared in this mutation.

func (*CountryMutation) OfficialName

func (m *CountryMutation) OfficialName() (r string, exists bool)

OfficialName returns the value of the "official_name" field in the mutation.

func (*CountryMutation) OfficialNameCleared

func (m *CountryMutation) OfficialNameCleared() bool

OfficialNameCleared returns if the "official_name" field was cleared in this mutation.

func (*CountryMutation) OldCapital

func (m *CountryMutation) OldCapital(ctx context.Context) (v *string, err error)

OldCapital returns the old "capital" field's value of the Country entity. If the Country 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 (*CountryMutation) OldConversionRate

func (m *CountryMutation) OldConversionRate(ctx context.Context) (v float64, err error)

OldConversionRate returns the old "conversion_rate" field's value of the Country entity. If the Country 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 (*CountryMutation) OldCreatedAt

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

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

func (m *CountryMutation) OldCurrencyCode(ctx context.Context) (v *string, err error)

OldCurrencyCode returns the old "currency_code" field's value of the Country entity. If the Country 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 (*CountryMutation) OldCurrencyName

func (m *CountryMutation) OldCurrencyName(ctx context.Context) (v *string, err error)

OldCurrencyName returns the old "currency_name" field's value of the Country entity. If the Country 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 (*CountryMutation) OldCurrencySymbol

func (m *CountryMutation) OldCurrencySymbol(ctx context.Context) (v *string, err error)

OldCurrencySymbol returns the old "currency_symbol" field's value of the Country entity. If the Country 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 (*CountryMutation) OldField

func (m *CountryMutation) 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 (*CountryMutation) OldIso2

func (m *CountryMutation) OldIso2(ctx context.Context) (v string, err error)

OldIso2 returns the old "iso2" field's value of the Country entity. If the Country 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 (*CountryMutation) OldIso3

func (m *CountryMutation) OldIso3(ctx context.Context) (v string, err error)

OldIso3 returns the old "iso3" field's value of the Country entity. If the Country 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 (*CountryMutation) OldName

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

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

func (m *CountryMutation) OldNumericCode(ctx context.Context) (v *string, err error)

OldNumericCode returns the old "numeric_code" field's value of the Country entity. If the Country 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 (*CountryMutation) OldOfficialName

func (m *CountryMutation) OldOfficialName(ctx context.Context) (v *string, err error)

OldOfficialName returns the old "official_name" field's value of the Country entity. If the Country 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 (*CountryMutation) OldPhoneCode

func (m *CountryMutation) OldPhoneCode(ctx context.Context) (v *string, err error)

OldPhoneCode returns the old "phone_code" field's value of the Country entity. If the Country 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 (*CountryMutation) OldStatus

func (m *CountryMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Country entity. If the Country 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 (*CountryMutation) OldUpdatedAt

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

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

func (m *CountryMutation) Op() Op

Op returns the operation name.

func (*CountryMutation) PhoneCode

func (m *CountryMutation) PhoneCode() (r string, exists bool)

PhoneCode returns the value of the "phone_code" field in the mutation.

func (*CountryMutation) PhoneCodeCleared

func (m *CountryMutation) PhoneCodeCleared() bool

PhoneCodeCleared returns if the "phone_code" field was cleared in this mutation.

func (*CountryMutation) QueryContext

func (c *CountryMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryMutation) RemoveBankIDs

func (m *CountryMutation) RemoveBankIDs(ids ...uint64)

RemoveBankIDs removes the "banks" edge to the Bank entity by IDs.

func (*CountryMutation) RemoveContactUserIDs

func (m *CountryMutation) RemoveContactUserIDs(ids ...uint64)

RemoveContactUserIDs removes the "contact_users" edge to the User entity by IDs.

func (*CountryMutation) RemoveLocationIDs

func (m *CountryMutation) RemoveLocationIDs(ids ...uint64)

RemoveLocationIDs removes the "locations" edge to the CountryLocation entity by IDs.

func (*CountryMutation) RemoveUserIDs

func (m *CountryMutation) RemoveUserIDs(ids ...uint64)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*CountryMutation) RemovedBanksIDs

func (m *CountryMutation) RemovedBanksIDs() (ids []uint64)

RemovedBanks returns the removed IDs of the "banks" edge to the Bank entity.

func (*CountryMutation) RemovedContactUsersIDs

func (m *CountryMutation) RemovedContactUsersIDs() (ids []uint64)

RemovedContactUsers returns the removed IDs of the "contact_users" edge to the User entity.

func (*CountryMutation) RemovedEdges

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

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

func (*CountryMutation) RemovedIDs

func (m *CountryMutation) 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 (*CountryMutation) RemovedLocationsIDs

func (m *CountryMutation) RemovedLocationsIDs() (ids []uint64)

RemovedLocations returns the removed IDs of the "locations" edge to the CountryLocation entity.

func (*CountryMutation) RemovedUsersIDs

func (m *CountryMutation) RemovedUsersIDs() (ids []uint64)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*CountryMutation) ResetBanks

func (m *CountryMutation) ResetBanks()

ResetBanks resets all changes to the "banks" edge.

func (*CountryMutation) ResetCapital

func (m *CountryMutation) ResetCapital()

ResetCapital resets all changes to the "capital" field.

func (*CountryMutation) ResetContactUsers

func (m *CountryMutation) ResetContactUsers()

ResetContactUsers resets all changes to the "contact_users" edge.

func (*CountryMutation) ResetConversionRate

func (m *CountryMutation) ResetConversionRate()

ResetConversionRate resets all changes to the "conversion_rate" field.

func (*CountryMutation) ResetCreatedAt

func (m *CountryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CountryMutation) ResetCurrencyCode

func (m *CountryMutation) ResetCurrencyCode()

ResetCurrencyCode resets all changes to the "currency_code" field.

func (*CountryMutation) ResetCurrencyName

func (m *CountryMutation) ResetCurrencyName()

ResetCurrencyName resets all changes to the "currency_name" field.

func (*CountryMutation) ResetCurrencySymbol

func (m *CountryMutation) ResetCurrencySymbol()

ResetCurrencySymbol resets all changes to the "currency_symbol" field.

func (*CountryMutation) ResetEdge

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

func (m *CountryMutation) 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 (*CountryMutation) ResetIso2

func (m *CountryMutation) ResetIso2()

ResetIso2 resets all changes to the "iso2" field.

func (*CountryMutation) ResetIso3

func (m *CountryMutation) ResetIso3()

ResetIso3 resets all changes to the "iso3" field.

func (*CountryMutation) ResetLocations

func (m *CountryMutation) ResetLocations()

ResetLocations resets all changes to the "locations" edge.

func (*CountryMutation) ResetName

func (m *CountryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CountryMutation) ResetNumericCode

func (m *CountryMutation) ResetNumericCode()

ResetNumericCode resets all changes to the "numeric_code" field.

func (*CountryMutation) ResetOfficialName

func (m *CountryMutation) ResetOfficialName()

ResetOfficialName resets all changes to the "official_name" field.

func (*CountryMutation) ResetPhoneCode

func (m *CountryMutation) ResetPhoneCode()

ResetPhoneCode resets all changes to the "phone_code" field.

func (*CountryMutation) ResetStatus

func (m *CountryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*CountryMutation) ResetUpdatedAt

func (m *CountryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CountryMutation) ResetUsers

func (m *CountryMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*CountryMutation) SetCapital

func (m *CountryMutation) SetCapital(s string)

SetCapital sets the "capital" field.

func (*CountryMutation) SetConversionRate

func (m *CountryMutation) SetConversionRate(f float64)

SetConversionRate sets the "conversion_rate" field.

func (*CountryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CountryMutation) SetCurrencyCode

func (m *CountryMutation) SetCurrencyCode(s string)

SetCurrencyCode sets the "currency_code" field.

func (*CountryMutation) SetCurrencyName

func (m *CountryMutation) SetCurrencyName(s string)

SetCurrencyName sets the "currency_name" field.

func (*CountryMutation) SetCurrencySymbol

func (m *CountryMutation) SetCurrencySymbol(s string)

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryMutation) SetField

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

func (m *CountryMutation) SetID(id uint64)

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

func (*CountryMutation) SetIso2

func (m *CountryMutation) SetIso2(s string)

SetIso2 sets the "iso2" field.

func (*CountryMutation) SetIso3

func (m *CountryMutation) SetIso3(s string)

SetIso3 sets the "iso3" field.

func (*CountryMutation) SetName

func (m *CountryMutation) SetName(s string)

SetName sets the "name" field.

func (*CountryMutation) SetNumericCode

func (m *CountryMutation) SetNumericCode(s string)

SetNumericCode sets the "numeric_code" field.

func (*CountryMutation) SetOfficialName

func (m *CountryMutation) SetOfficialName(s string)

SetOfficialName sets the "official_name" field.

func (*CountryMutation) SetOp

func (m *CountryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CountryMutation) SetPhoneCode

func (m *CountryMutation) SetPhoneCode(s string)

SetPhoneCode sets the "phone_code" field.

func (*CountryMutation) SetStatus

func (m *CountryMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*CountryMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CountryMutation) Status

func (m *CountryMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (CountryMutation) Tx

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

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

func (*CountryMutation) Type

func (m *CountryMutation) Type() string

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

func (*CountryMutation) UpdatedAt

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

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

func (*CountryMutation) UsersCleared

func (m *CountryMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*CountryMutation) UsersIDs

func (m *CountryMutation) UsersIDs() (ids []uint64)

UsersIDs returns the "users" edge IDs in the mutation.

func (*CountryMutation) Where

func (m *CountryMutation) Where(ps ...predicate.Country)

Where appends a list predicates to the CountryMutation builder.

func (*CountryMutation) WhereP

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

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

type CountryQuery

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

CountryQuery is the builder for querying Country entities.

func (*CountryQuery) Aggregate

func (cq *CountryQuery) Aggregate(fns ...AggregateFunc) *CountrySelect

Aggregate returns a CountrySelect configured with the given aggregations.

func (*CountryQuery) All

func (cq *CountryQuery) All(ctx context.Context) ([]*Country, error)

All executes the query and returns a list of Countries.

func (*CountryQuery) AllX

func (cq *CountryQuery) AllX(ctx context.Context) []*Country

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

func (*CountryQuery) Clone

func (cq *CountryQuery) Clone() *CountryQuery

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

func (*CountryQuery) Count

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

Count returns the count of the given query.

func (*CountryQuery) CountX

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

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

func (*CountryQuery) ExecContext

func (c *CountryQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryQuery) Exist

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

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

func (*CountryQuery) ExistX

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

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

func (*CountryQuery) First

func (cq *CountryQuery) First(ctx context.Context) (*Country, error)

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

func (*CountryQuery) FirstID

func (cq *CountryQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*CountryQuery) FirstIDX

func (cq *CountryQuery) FirstIDX(ctx context.Context) uint64

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

func (*CountryQuery) FirstX

func (cq *CountryQuery) FirstX(ctx context.Context) *Country

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

func (*CountryQuery) GroupBy

func (cq *CountryQuery) GroupBy(field string, fields ...string) *CountryGroupBy

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

client.Country.Query().
	GroupBy(country.FieldIso2).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CountryQuery) IDs

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

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

func (*CountryQuery) IDsX

func (cq *CountryQuery) IDsX(ctx context.Context) []uint64

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

func (*CountryQuery) Limit

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

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

func (*CountryQuery) Offset

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

Offset to start from.

func (*CountryQuery) Only

func (cq *CountryQuery) Only(ctx context.Context) (*Country, error)

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

func (*CountryQuery) OnlyID

func (cq *CountryQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*CountryQuery) OnlyIDX

func (cq *CountryQuery) OnlyIDX(ctx context.Context) uint64

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

func (*CountryQuery) OnlyX

func (cq *CountryQuery) OnlyX(ctx context.Context) *Country

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

func (*CountryQuery) Order

func (cq *CountryQuery) Order(o ...country.OrderOption) *CountryQuery

Order specifies how the records should be ordered.

func (*CountryQuery) QueryBanks

func (cq *CountryQuery) QueryBanks() *BankQuery

QueryBanks chains the current query on the "banks" edge.

func (*CountryQuery) QueryContactUsers

func (cq *CountryQuery) QueryContactUsers() *UserQuery

QueryContactUsers chains the current query on the "contact_users" edge.

func (*CountryQuery) QueryContext

func (c *CountryQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryQuery) QueryLocations

func (cq *CountryQuery) QueryLocations() *CountryLocationQuery

QueryLocations chains the current query on the "locations" edge.

func (*CountryQuery) QueryUsers

func (cq *CountryQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*CountryQuery) Select

func (cq *CountryQuery) Select(fields ...string) *CountrySelect

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

client.Country.Query().
	Select(country.FieldIso2).
	Scan(ctx, &v)

func (*CountryQuery) Unique

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

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

func (cq *CountryQuery) Where(ps ...predicate.Country) *CountryQuery

Where adds a new predicate for the CountryQuery builder.

func (*CountryQuery) WithBanks

func (cq *CountryQuery) WithBanks(opts ...func(*BankQuery)) *CountryQuery

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

func (*CountryQuery) WithContactUsers

func (cq *CountryQuery) WithContactUsers(opts ...func(*UserQuery)) *CountryQuery

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

func (*CountryQuery) WithLocations

func (cq *CountryQuery) WithLocations(opts ...func(*CountryLocationQuery)) *CountryQuery

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

func (*CountryQuery) WithUsers

func (cq *CountryQuery) WithUsers(opts ...func(*UserQuery)) *CountryQuery

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

type CountrySelect

type CountrySelect struct {
	*CountryQuery
	// contains filtered or unexported fields
}

CountrySelect is the builder for selecting fields of Country entities.

func (*CountrySelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CountrySelect) Bool

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

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

func (*CountrySelect) BoolX

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

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

func (*CountrySelect) Bools

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

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

func (*CountrySelect) BoolsX

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

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

func (CountrySelect) ExecContext

func (c CountrySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountrySelect) Float64

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

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

func (*CountrySelect) Float64X

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

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

func (*CountrySelect) Float64s

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

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

func (*CountrySelect) Float64sX

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

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

func (*CountrySelect) Int

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

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

func (*CountrySelect) IntX

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

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

func (*CountrySelect) Ints

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

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

func (*CountrySelect) IntsX

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

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

func (CountrySelect) QueryContext

func (c CountrySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountrySelect) Scan

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

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

func (*CountrySelect) ScanX

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

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

func (*CountrySelect) String

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

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

func (*CountrySelect) StringX

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

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

func (*CountrySelect) Strings

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

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

func (*CountrySelect) StringsX

func (s *CountrySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CountryUpdate

type CountryUpdate struct {
	// contains filtered or unexported fields
}

CountryUpdate is the builder for updating Country entities.

func (*CountryUpdate) AddBankIDs

func (cu *CountryUpdate) AddBankIDs(ids ...uint64) *CountryUpdate

AddBankIDs adds the "banks" edge to the Bank entity by IDs.

func (*CountryUpdate) AddBanks

func (cu *CountryUpdate) AddBanks(b ...*Bank) *CountryUpdate

AddBanks adds the "banks" edges to the Bank entity.

func (*CountryUpdate) AddContactUserIDs

func (cu *CountryUpdate) AddContactUserIDs(ids ...uint64) *CountryUpdate

AddContactUserIDs adds the "contact_users" edge to the User entity by IDs.

func (*CountryUpdate) AddContactUsers

func (cu *CountryUpdate) AddContactUsers(u ...*User) *CountryUpdate

AddContactUsers adds the "contact_users" edges to the User entity.

func (*CountryUpdate) AddConversionRate

func (cu *CountryUpdate) AddConversionRate(f float64) *CountryUpdate

AddConversionRate adds f to the "conversion_rate" field.

func (*CountryUpdate) AddLocationIDs

func (cu *CountryUpdate) AddLocationIDs(ids ...uint64) *CountryUpdate

AddLocationIDs adds the "locations" edge to the CountryLocation entity by IDs.

func (*CountryUpdate) AddLocations

func (cu *CountryUpdate) AddLocations(c ...*CountryLocation) *CountryUpdate

AddLocations adds the "locations" edges to the CountryLocation entity.

func (*CountryUpdate) AddStatus

func (cu *CountryUpdate) AddStatus(u int8) *CountryUpdate

AddStatus adds u to the "status" field.

func (*CountryUpdate) AddUserIDs

func (cu *CountryUpdate) AddUserIDs(ids ...uint64) *CountryUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*CountryUpdate) AddUsers

func (cu *CountryUpdate) AddUsers(u ...*User) *CountryUpdate

AddUsers adds the "users" edges to the User entity.

func (*CountryUpdate) ClearBanks

func (cu *CountryUpdate) ClearBanks() *CountryUpdate

ClearBanks clears all "banks" edges to the Bank entity.

func (*CountryUpdate) ClearCapital

func (cu *CountryUpdate) ClearCapital() *CountryUpdate

ClearCapital clears the value of the "capital" field.

func (*CountryUpdate) ClearContactUsers

func (cu *CountryUpdate) ClearContactUsers() *CountryUpdate

ClearContactUsers clears all "contact_users" edges to the User entity.

func (*CountryUpdate) ClearCurrencyCode

func (cu *CountryUpdate) ClearCurrencyCode() *CountryUpdate

ClearCurrencyCode clears the value of the "currency_code" field.

func (*CountryUpdate) ClearCurrencyName

func (cu *CountryUpdate) ClearCurrencyName() *CountryUpdate

ClearCurrencyName clears the value of the "currency_name" field.

func (*CountryUpdate) ClearCurrencySymbol

func (cu *CountryUpdate) ClearCurrencySymbol() *CountryUpdate

ClearCurrencySymbol clears the value of the "currency_symbol" field.

func (*CountryUpdate) ClearLocations

func (cu *CountryUpdate) ClearLocations() *CountryUpdate

ClearLocations clears all "locations" edges to the CountryLocation entity.

func (*CountryUpdate) ClearNumericCode

func (cu *CountryUpdate) ClearNumericCode() *CountryUpdate

ClearNumericCode clears the value of the "numeric_code" field.

func (*CountryUpdate) ClearOfficialName

func (cu *CountryUpdate) ClearOfficialName() *CountryUpdate

ClearOfficialName clears the value of the "official_name" field.

func (*CountryUpdate) ClearPhoneCode

func (cu *CountryUpdate) ClearPhoneCode() *CountryUpdate

ClearPhoneCode clears the value of the "phone_code" field.

func (*CountryUpdate) ClearUsers

func (cu *CountryUpdate) ClearUsers() *CountryUpdate

ClearUsers clears all "users" edges to the User entity.

func (*CountryUpdate) Exec

func (cu *CountryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryUpdate) ExecContext

func (c *CountryUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryUpdate) ExecX

func (cu *CountryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CountryUpdate) Mutation

func (cu *CountryUpdate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdate) QueryContext

func (c *CountryUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryUpdate) RemoveBankIDs

func (cu *CountryUpdate) RemoveBankIDs(ids ...uint64) *CountryUpdate

RemoveBankIDs removes the "banks" edge to Bank entities by IDs.

func (*CountryUpdate) RemoveBanks

func (cu *CountryUpdate) RemoveBanks(b ...*Bank) *CountryUpdate

RemoveBanks removes "banks" edges to Bank entities.

func (*CountryUpdate) RemoveContactUserIDs

func (cu *CountryUpdate) RemoveContactUserIDs(ids ...uint64) *CountryUpdate

RemoveContactUserIDs removes the "contact_users" edge to User entities by IDs.

func (*CountryUpdate) RemoveContactUsers

func (cu *CountryUpdate) RemoveContactUsers(u ...*User) *CountryUpdate

RemoveContactUsers removes "contact_users" edges to User entities.

func (*CountryUpdate) RemoveLocationIDs

func (cu *CountryUpdate) RemoveLocationIDs(ids ...uint64) *CountryUpdate

RemoveLocationIDs removes the "locations" edge to CountryLocation entities by IDs.

func (*CountryUpdate) RemoveLocations

func (cu *CountryUpdate) RemoveLocations(c ...*CountryLocation) *CountryUpdate

RemoveLocations removes "locations" edges to CountryLocation entities.

func (*CountryUpdate) RemoveUserIDs

func (cu *CountryUpdate) RemoveUserIDs(ids ...uint64) *CountryUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*CountryUpdate) RemoveUsers

func (cu *CountryUpdate) RemoveUsers(u ...*User) *CountryUpdate

RemoveUsers removes "users" edges to User entities.

func (*CountryUpdate) Save

func (cu *CountryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CountryUpdate) SaveX

func (cu *CountryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CountryUpdate) SetCapital

func (cu *CountryUpdate) SetCapital(s string) *CountryUpdate

SetCapital sets the "capital" field.

func (*CountryUpdate) SetConversionRate

func (cu *CountryUpdate) SetConversionRate(f float64) *CountryUpdate

SetConversionRate sets the "conversion_rate" field.

func (*CountryUpdate) SetCreatedAt

func (cu *CountryUpdate) SetCreatedAt(t time.Time) *CountryUpdate

SetCreatedAt sets the "created_at" field.

func (*CountryUpdate) SetCurrencyCode

func (cu *CountryUpdate) SetCurrencyCode(s string) *CountryUpdate

SetCurrencyCode sets the "currency_code" field.

func (*CountryUpdate) SetCurrencyName

func (cu *CountryUpdate) SetCurrencyName(s string) *CountryUpdate

SetCurrencyName sets the "currency_name" field.

func (*CountryUpdate) SetCurrencySymbol

func (cu *CountryUpdate) SetCurrencySymbol(s string) *CountryUpdate

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryUpdate) SetIso2

func (cu *CountryUpdate) SetIso2(s string) *CountryUpdate

SetIso2 sets the "iso2" field.

func (*CountryUpdate) SetIso3

func (cu *CountryUpdate) SetIso3(s string) *CountryUpdate

SetIso3 sets the "iso3" field.

func (*CountryUpdate) SetName

func (cu *CountryUpdate) SetName(s string) *CountryUpdate

SetName sets the "name" field.

func (*CountryUpdate) SetNillableCapital

func (cu *CountryUpdate) SetNillableCapital(s *string) *CountryUpdate

SetNillableCapital sets the "capital" field if the given value is not nil.

func (*CountryUpdate) SetNillableConversionRate

func (cu *CountryUpdate) SetNillableConversionRate(f *float64) *CountryUpdate

SetNillableConversionRate sets the "conversion_rate" field if the given value is not nil.

func (*CountryUpdate) SetNillableCreatedAt

func (cu *CountryUpdate) SetNillableCreatedAt(t *time.Time) *CountryUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CountryUpdate) SetNillableCurrencyCode

func (cu *CountryUpdate) SetNillableCurrencyCode(s *string) *CountryUpdate

SetNillableCurrencyCode sets the "currency_code" field if the given value is not nil.

func (*CountryUpdate) SetNillableCurrencyName

func (cu *CountryUpdate) SetNillableCurrencyName(s *string) *CountryUpdate

SetNillableCurrencyName sets the "currency_name" field if the given value is not nil.

func (*CountryUpdate) SetNillableCurrencySymbol

func (cu *CountryUpdate) SetNillableCurrencySymbol(s *string) *CountryUpdate

SetNillableCurrencySymbol sets the "currency_symbol" field if the given value is not nil.

func (*CountryUpdate) SetNillableIso2

func (cu *CountryUpdate) SetNillableIso2(s *string) *CountryUpdate

SetNillableIso2 sets the "iso2" field if the given value is not nil.

func (*CountryUpdate) SetNillableIso3

func (cu *CountryUpdate) SetNillableIso3(s *string) *CountryUpdate

SetNillableIso3 sets the "iso3" field if the given value is not nil.

func (*CountryUpdate) SetNillableName

func (cu *CountryUpdate) SetNillableName(s *string) *CountryUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CountryUpdate) SetNillableNumericCode

func (cu *CountryUpdate) SetNillableNumericCode(s *string) *CountryUpdate

SetNillableNumericCode sets the "numeric_code" field if the given value is not nil.

func (*CountryUpdate) SetNillableOfficialName

func (cu *CountryUpdate) SetNillableOfficialName(s *string) *CountryUpdate

SetNillableOfficialName sets the "official_name" field if the given value is not nil.

func (*CountryUpdate) SetNillablePhoneCode

func (cu *CountryUpdate) SetNillablePhoneCode(s *string) *CountryUpdate

SetNillablePhoneCode sets the "phone_code" field if the given value is not nil.

func (*CountryUpdate) SetNillableStatus

func (cu *CountryUpdate) SetNillableStatus(u *uint8) *CountryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CountryUpdate) SetNumericCode

func (cu *CountryUpdate) SetNumericCode(s string) *CountryUpdate

SetNumericCode sets the "numeric_code" field.

func (*CountryUpdate) SetOfficialName

func (cu *CountryUpdate) SetOfficialName(s string) *CountryUpdate

SetOfficialName sets the "official_name" field.

func (*CountryUpdate) SetPhoneCode

func (cu *CountryUpdate) SetPhoneCode(s string) *CountryUpdate

SetPhoneCode sets the "phone_code" field.

func (*CountryUpdate) SetStatus

func (cu *CountryUpdate) SetStatus(u uint8) *CountryUpdate

SetStatus sets the "status" field.

func (*CountryUpdate) SetUpdatedAt

func (cu *CountryUpdate) SetUpdatedAt(t time.Time) *CountryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpdate) Where

func (cu *CountryUpdate) Where(ps ...predicate.Country) *CountryUpdate

Where appends a list predicates to the CountryUpdate builder.

type CountryUpdateOne

type CountryUpdateOne struct {
	// contains filtered or unexported fields
}

CountryUpdateOne is the builder for updating a single Country entity.

func (*CountryUpdateOne) AddBankIDs

func (cuo *CountryUpdateOne) AddBankIDs(ids ...uint64) *CountryUpdateOne

AddBankIDs adds the "banks" edge to the Bank entity by IDs.

func (*CountryUpdateOne) AddBanks

func (cuo *CountryUpdateOne) AddBanks(b ...*Bank) *CountryUpdateOne

AddBanks adds the "banks" edges to the Bank entity.

func (*CountryUpdateOne) AddContactUserIDs

func (cuo *CountryUpdateOne) AddContactUserIDs(ids ...uint64) *CountryUpdateOne

AddContactUserIDs adds the "contact_users" edge to the User entity by IDs.

func (*CountryUpdateOne) AddContactUsers

func (cuo *CountryUpdateOne) AddContactUsers(u ...*User) *CountryUpdateOne

AddContactUsers adds the "contact_users" edges to the User entity.

func (*CountryUpdateOne) AddConversionRate

func (cuo *CountryUpdateOne) AddConversionRate(f float64) *CountryUpdateOne

AddConversionRate adds f to the "conversion_rate" field.

func (*CountryUpdateOne) AddLocationIDs

func (cuo *CountryUpdateOne) AddLocationIDs(ids ...uint64) *CountryUpdateOne

AddLocationIDs adds the "locations" edge to the CountryLocation entity by IDs.

func (*CountryUpdateOne) AddLocations

func (cuo *CountryUpdateOne) AddLocations(c ...*CountryLocation) *CountryUpdateOne

AddLocations adds the "locations" edges to the CountryLocation entity.

func (*CountryUpdateOne) AddStatus

func (cuo *CountryUpdateOne) AddStatus(u int8) *CountryUpdateOne

AddStatus adds u to the "status" field.

func (*CountryUpdateOne) AddUserIDs

func (cuo *CountryUpdateOne) AddUserIDs(ids ...uint64) *CountryUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*CountryUpdateOne) AddUsers

func (cuo *CountryUpdateOne) AddUsers(u ...*User) *CountryUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*CountryUpdateOne) ClearBanks

func (cuo *CountryUpdateOne) ClearBanks() *CountryUpdateOne

ClearBanks clears all "banks" edges to the Bank entity.

func (*CountryUpdateOne) ClearCapital

func (cuo *CountryUpdateOne) ClearCapital() *CountryUpdateOne

ClearCapital clears the value of the "capital" field.

func (*CountryUpdateOne) ClearContactUsers

func (cuo *CountryUpdateOne) ClearContactUsers() *CountryUpdateOne

ClearContactUsers clears all "contact_users" edges to the User entity.

func (*CountryUpdateOne) ClearCurrencyCode

func (cuo *CountryUpdateOne) ClearCurrencyCode() *CountryUpdateOne

ClearCurrencyCode clears the value of the "currency_code" field.

func (*CountryUpdateOne) ClearCurrencyName

func (cuo *CountryUpdateOne) ClearCurrencyName() *CountryUpdateOne

ClearCurrencyName clears the value of the "currency_name" field.

func (*CountryUpdateOne) ClearCurrencySymbol

func (cuo *CountryUpdateOne) ClearCurrencySymbol() *CountryUpdateOne

ClearCurrencySymbol clears the value of the "currency_symbol" field.

func (*CountryUpdateOne) ClearLocations

func (cuo *CountryUpdateOne) ClearLocations() *CountryUpdateOne

ClearLocations clears all "locations" edges to the CountryLocation entity.

func (*CountryUpdateOne) ClearNumericCode

func (cuo *CountryUpdateOne) ClearNumericCode() *CountryUpdateOne

ClearNumericCode clears the value of the "numeric_code" field.

func (*CountryUpdateOne) ClearOfficialName

func (cuo *CountryUpdateOne) ClearOfficialName() *CountryUpdateOne

ClearOfficialName clears the value of the "official_name" field.

func (*CountryUpdateOne) ClearPhoneCode

func (cuo *CountryUpdateOne) ClearPhoneCode() *CountryUpdateOne

ClearPhoneCode clears the value of the "phone_code" field.

func (*CountryUpdateOne) ClearUsers

func (cuo *CountryUpdateOne) ClearUsers() *CountryUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*CountryUpdateOne) Exec

func (cuo *CountryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CountryUpdateOne) ExecContext

func (c *CountryUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CountryUpdateOne) ExecX

func (cuo *CountryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CountryUpdateOne) Mutation

func (cuo *CountryUpdateOne) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdateOne) QueryContext

func (c *CountryUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CountryUpdateOne) RemoveBankIDs

func (cuo *CountryUpdateOne) RemoveBankIDs(ids ...uint64) *CountryUpdateOne

RemoveBankIDs removes the "banks" edge to Bank entities by IDs.

func (*CountryUpdateOne) RemoveBanks

func (cuo *CountryUpdateOne) RemoveBanks(b ...*Bank) *CountryUpdateOne

RemoveBanks removes "banks" edges to Bank entities.

func (*CountryUpdateOne) RemoveContactUserIDs

func (cuo *CountryUpdateOne) RemoveContactUserIDs(ids ...uint64) *CountryUpdateOne

RemoveContactUserIDs removes the "contact_users" edge to User entities by IDs.

func (*CountryUpdateOne) RemoveContactUsers

func (cuo *CountryUpdateOne) RemoveContactUsers(u ...*User) *CountryUpdateOne

RemoveContactUsers removes "contact_users" edges to User entities.

func (*CountryUpdateOne) RemoveLocationIDs

func (cuo *CountryUpdateOne) RemoveLocationIDs(ids ...uint64) *CountryUpdateOne

RemoveLocationIDs removes the "locations" edge to CountryLocation entities by IDs.

func (*CountryUpdateOne) RemoveLocations

func (cuo *CountryUpdateOne) RemoveLocations(c ...*CountryLocation) *CountryUpdateOne

RemoveLocations removes "locations" edges to CountryLocation entities.

func (*CountryUpdateOne) RemoveUserIDs

func (cuo *CountryUpdateOne) RemoveUserIDs(ids ...uint64) *CountryUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*CountryUpdateOne) RemoveUsers

func (cuo *CountryUpdateOne) RemoveUsers(u ...*User) *CountryUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*CountryUpdateOne) Save

func (cuo *CountryUpdateOne) Save(ctx context.Context) (*Country, error)

Save executes the query and returns the updated Country entity.

func (*CountryUpdateOne) SaveX

func (cuo *CountryUpdateOne) SaveX(ctx context.Context) *Country

SaveX is like Save, but panics if an error occurs.

func (*CountryUpdateOne) Select

func (cuo *CountryUpdateOne) Select(field string, fields ...string) *CountryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CountryUpdateOne) SetCapital

func (cuo *CountryUpdateOne) SetCapital(s string) *CountryUpdateOne

SetCapital sets the "capital" field.

func (*CountryUpdateOne) SetConversionRate

func (cuo *CountryUpdateOne) SetConversionRate(f float64) *CountryUpdateOne

SetConversionRate sets the "conversion_rate" field.

func (*CountryUpdateOne) SetCreatedAt

func (cuo *CountryUpdateOne) SetCreatedAt(t time.Time) *CountryUpdateOne

SetCreatedAt sets the "created_at" field.

func (*CountryUpdateOne) SetCurrencyCode

func (cuo *CountryUpdateOne) SetCurrencyCode(s string) *CountryUpdateOne

SetCurrencyCode sets the "currency_code" field.

func (*CountryUpdateOne) SetCurrencyName

func (cuo *CountryUpdateOne) SetCurrencyName(s string) *CountryUpdateOne

SetCurrencyName sets the "currency_name" field.

func (*CountryUpdateOne) SetCurrencySymbol

func (cuo *CountryUpdateOne) SetCurrencySymbol(s string) *CountryUpdateOne

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryUpdateOne) SetIso2

func (cuo *CountryUpdateOne) SetIso2(s string) *CountryUpdateOne

SetIso2 sets the "iso2" field.

func (*CountryUpdateOne) SetIso3

func (cuo *CountryUpdateOne) SetIso3(s string) *CountryUpdateOne

SetIso3 sets the "iso3" field.

func (*CountryUpdateOne) SetName

func (cuo *CountryUpdateOne) SetName(s string) *CountryUpdateOne

SetName sets the "name" field.

func (*CountryUpdateOne) SetNillableCapital

func (cuo *CountryUpdateOne) SetNillableCapital(s *string) *CountryUpdateOne

SetNillableCapital sets the "capital" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableConversionRate

func (cuo *CountryUpdateOne) SetNillableConversionRate(f *float64) *CountryUpdateOne

SetNillableConversionRate sets the "conversion_rate" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableCreatedAt

func (cuo *CountryUpdateOne) SetNillableCreatedAt(t *time.Time) *CountryUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableCurrencyCode

func (cuo *CountryUpdateOne) SetNillableCurrencyCode(s *string) *CountryUpdateOne

SetNillableCurrencyCode sets the "currency_code" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableCurrencyName

func (cuo *CountryUpdateOne) SetNillableCurrencyName(s *string) *CountryUpdateOne

SetNillableCurrencyName sets the "currency_name" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableCurrencySymbol

func (cuo *CountryUpdateOne) SetNillableCurrencySymbol(s *string) *CountryUpdateOne

SetNillableCurrencySymbol sets the "currency_symbol" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableIso2

func (cuo *CountryUpdateOne) SetNillableIso2(s *string) *CountryUpdateOne

SetNillableIso2 sets the "iso2" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableIso3

func (cuo *CountryUpdateOne) SetNillableIso3(s *string) *CountryUpdateOne

SetNillableIso3 sets the "iso3" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableName

func (cuo *CountryUpdateOne) SetNillableName(s *string) *CountryUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableNumericCode

func (cuo *CountryUpdateOne) SetNillableNumericCode(s *string) *CountryUpdateOne

SetNillableNumericCode sets the "numeric_code" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableOfficialName

func (cuo *CountryUpdateOne) SetNillableOfficialName(s *string) *CountryUpdateOne

SetNillableOfficialName sets the "official_name" field if the given value is not nil.

func (*CountryUpdateOne) SetNillablePhoneCode

func (cuo *CountryUpdateOne) SetNillablePhoneCode(s *string) *CountryUpdateOne

SetNillablePhoneCode sets the "phone_code" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableStatus

func (cuo *CountryUpdateOne) SetNillableStatus(u *uint8) *CountryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CountryUpdateOne) SetNumericCode

func (cuo *CountryUpdateOne) SetNumericCode(s string) *CountryUpdateOne

SetNumericCode sets the "numeric_code" field.

func (*CountryUpdateOne) SetOfficialName

func (cuo *CountryUpdateOne) SetOfficialName(s string) *CountryUpdateOne

SetOfficialName sets the "official_name" field.

func (*CountryUpdateOne) SetPhoneCode

func (cuo *CountryUpdateOne) SetPhoneCode(s string) *CountryUpdateOne

SetPhoneCode sets the "phone_code" field.

func (*CountryUpdateOne) SetStatus

func (cuo *CountryUpdateOne) SetStatus(u uint8) *CountryUpdateOne

SetStatus sets the "status" field.

func (*CountryUpdateOne) SetUpdatedAt

func (cuo *CountryUpdateOne) SetUpdatedAt(t time.Time) *CountryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpdateOne) Where

Where appends a list predicates to the CountryUpdate builder.

type CountryUpsert

type CountryUpsert struct {
	*sql.UpdateSet
}

CountryUpsert is the "OnConflict" setter.

func (*CountryUpsert) AddConversionRate

func (u *CountryUpsert) AddConversionRate(v float64) *CountryUpsert

AddConversionRate adds v to the "conversion_rate" field.

func (*CountryUpsert) AddStatus

func (u *CountryUpsert) AddStatus(v uint8) *CountryUpsert

AddStatus adds v to the "status" field.

func (*CountryUpsert) ClearCapital

func (u *CountryUpsert) ClearCapital() *CountryUpsert

ClearCapital clears the value of the "capital" field.

func (*CountryUpsert) ClearCurrencyCode

func (u *CountryUpsert) ClearCurrencyCode() *CountryUpsert

ClearCurrencyCode clears the value of the "currency_code" field.

func (*CountryUpsert) ClearCurrencyName

func (u *CountryUpsert) ClearCurrencyName() *CountryUpsert

ClearCurrencyName clears the value of the "currency_name" field.

func (*CountryUpsert) ClearCurrencySymbol

func (u *CountryUpsert) ClearCurrencySymbol() *CountryUpsert

ClearCurrencySymbol clears the value of the "currency_symbol" field.

func (*CountryUpsert) ClearNumericCode

func (u *CountryUpsert) ClearNumericCode() *CountryUpsert

ClearNumericCode clears the value of the "numeric_code" field.

func (*CountryUpsert) ClearOfficialName

func (u *CountryUpsert) ClearOfficialName() *CountryUpsert

ClearOfficialName clears the value of the "official_name" field.

func (*CountryUpsert) ClearPhoneCode

func (u *CountryUpsert) ClearPhoneCode() *CountryUpsert

ClearPhoneCode clears the value of the "phone_code" field.

func (*CountryUpsert) SetCapital

func (u *CountryUpsert) SetCapital(v string) *CountryUpsert

SetCapital sets the "capital" field.

func (*CountryUpsert) SetConversionRate

func (u *CountryUpsert) SetConversionRate(v float64) *CountryUpsert

SetConversionRate sets the "conversion_rate" field.

func (*CountryUpsert) SetCreatedAt

func (u *CountryUpsert) SetCreatedAt(v time.Time) *CountryUpsert

SetCreatedAt sets the "created_at" field.

func (*CountryUpsert) SetCurrencyCode

func (u *CountryUpsert) SetCurrencyCode(v string) *CountryUpsert

SetCurrencyCode sets the "currency_code" field.

func (*CountryUpsert) SetCurrencyName

func (u *CountryUpsert) SetCurrencyName(v string) *CountryUpsert

SetCurrencyName sets the "currency_name" field.

func (*CountryUpsert) SetCurrencySymbol

func (u *CountryUpsert) SetCurrencySymbol(v string) *CountryUpsert

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryUpsert) SetIso2

func (u *CountryUpsert) SetIso2(v string) *CountryUpsert

SetIso2 sets the "iso2" field.

func (*CountryUpsert) SetIso3

func (u *CountryUpsert) SetIso3(v string) *CountryUpsert

SetIso3 sets the "iso3" field.

func (*CountryUpsert) SetName

func (u *CountryUpsert) SetName(v string) *CountryUpsert

SetName sets the "name" field.

func (*CountryUpsert) SetNumericCode

func (u *CountryUpsert) SetNumericCode(v string) *CountryUpsert

SetNumericCode sets the "numeric_code" field.

func (*CountryUpsert) SetOfficialName

func (u *CountryUpsert) SetOfficialName(v string) *CountryUpsert

SetOfficialName sets the "official_name" field.

func (*CountryUpsert) SetPhoneCode

func (u *CountryUpsert) SetPhoneCode(v string) *CountryUpsert

SetPhoneCode sets the "phone_code" field.

func (*CountryUpsert) SetStatus

func (u *CountryUpsert) SetStatus(v uint8) *CountryUpsert

SetStatus sets the "status" field.

func (*CountryUpsert) SetUpdatedAt

func (u *CountryUpsert) SetUpdatedAt(v time.Time) *CountryUpsert

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpsert) UpdateCapital

func (u *CountryUpsert) UpdateCapital() *CountryUpsert

UpdateCapital sets the "capital" field to the value that was provided on create.

func (*CountryUpsert) UpdateConversionRate

func (u *CountryUpsert) UpdateConversionRate() *CountryUpsert

UpdateConversionRate sets the "conversion_rate" field to the value that was provided on create.

func (*CountryUpsert) UpdateCreatedAt

func (u *CountryUpsert) UpdateCreatedAt() *CountryUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*CountryUpsert) UpdateCurrencyCode

func (u *CountryUpsert) UpdateCurrencyCode() *CountryUpsert

UpdateCurrencyCode sets the "currency_code" field to the value that was provided on create.

func (*CountryUpsert) UpdateCurrencyName

func (u *CountryUpsert) UpdateCurrencyName() *CountryUpsert

UpdateCurrencyName sets the "currency_name" field to the value that was provided on create.

func (*CountryUpsert) UpdateCurrencySymbol

func (u *CountryUpsert) UpdateCurrencySymbol() *CountryUpsert

UpdateCurrencySymbol sets the "currency_symbol" field to the value that was provided on create.

func (*CountryUpsert) UpdateIso2

func (u *CountryUpsert) UpdateIso2() *CountryUpsert

UpdateIso2 sets the "iso2" field to the value that was provided on create.

func (*CountryUpsert) UpdateIso3

func (u *CountryUpsert) UpdateIso3() *CountryUpsert

UpdateIso3 sets the "iso3" field to the value that was provided on create.

func (*CountryUpsert) UpdateName

func (u *CountryUpsert) UpdateName() *CountryUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*CountryUpsert) UpdateNumericCode

func (u *CountryUpsert) UpdateNumericCode() *CountryUpsert

UpdateNumericCode sets the "numeric_code" field to the value that was provided on create.

func (*CountryUpsert) UpdateOfficialName

func (u *CountryUpsert) UpdateOfficialName() *CountryUpsert

UpdateOfficialName sets the "official_name" field to the value that was provided on create.

func (*CountryUpsert) UpdatePhoneCode

func (u *CountryUpsert) UpdatePhoneCode() *CountryUpsert

UpdatePhoneCode sets the "phone_code" field to the value that was provided on create.

func (*CountryUpsert) UpdateStatus

func (u *CountryUpsert) UpdateStatus() *CountryUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

func (*CountryUpsert) UpdateUpdatedAt

func (u *CountryUpsert) UpdateUpdatedAt() *CountryUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type CountryUpsertBulk

type CountryUpsertBulk struct {
	// contains filtered or unexported fields
}

CountryUpsertBulk is the builder for "upsert"-ing a bulk of Country nodes.

func (*CountryUpsertBulk) AddConversionRate

func (u *CountryUpsertBulk) AddConversionRate(v float64) *CountryUpsertBulk

AddConversionRate adds v to the "conversion_rate" field.

func (*CountryUpsertBulk) AddStatus

func (u *CountryUpsertBulk) AddStatus(v uint8) *CountryUpsertBulk

AddStatus adds v to the "status" field.

func (*CountryUpsertBulk) ClearCapital

func (u *CountryUpsertBulk) ClearCapital() *CountryUpsertBulk

ClearCapital clears the value of the "capital" field.

func (*CountryUpsertBulk) ClearCurrencyCode

func (u *CountryUpsertBulk) ClearCurrencyCode() *CountryUpsertBulk

ClearCurrencyCode clears the value of the "currency_code" field.

func (*CountryUpsertBulk) ClearCurrencyName

func (u *CountryUpsertBulk) ClearCurrencyName() *CountryUpsertBulk

ClearCurrencyName clears the value of the "currency_name" field.

func (*CountryUpsertBulk) ClearCurrencySymbol

func (u *CountryUpsertBulk) ClearCurrencySymbol() *CountryUpsertBulk

ClearCurrencySymbol clears the value of the "currency_symbol" field.

func (*CountryUpsertBulk) ClearNumericCode

func (u *CountryUpsertBulk) ClearNumericCode() *CountryUpsertBulk

ClearNumericCode clears the value of the "numeric_code" field.

func (*CountryUpsertBulk) ClearOfficialName

func (u *CountryUpsertBulk) ClearOfficialName() *CountryUpsertBulk

ClearOfficialName clears the value of the "official_name" field.

func (*CountryUpsertBulk) ClearPhoneCode

func (u *CountryUpsertBulk) ClearPhoneCode() *CountryUpsertBulk

ClearPhoneCode clears the value of the "phone_code" field.

func (*CountryUpsertBulk) DoNothing

func (u *CountryUpsertBulk) DoNothing() *CountryUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CountryUpsertBulk) Exec

func (u *CountryUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryUpsertBulk) ExecX

func (u *CountryUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CountryUpsertBulk) Ignore

func (u *CountryUpsertBulk) Ignore() *CountryUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Country.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*CountryUpsertBulk) SetCapital

func (u *CountryUpsertBulk) SetCapital(v string) *CountryUpsertBulk

SetCapital sets the "capital" field.

func (*CountryUpsertBulk) SetConversionRate

func (u *CountryUpsertBulk) SetConversionRate(v float64) *CountryUpsertBulk

SetConversionRate sets the "conversion_rate" field.

func (*CountryUpsertBulk) SetCreatedAt

func (u *CountryUpsertBulk) SetCreatedAt(v time.Time) *CountryUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*CountryUpsertBulk) SetCurrencyCode

func (u *CountryUpsertBulk) SetCurrencyCode(v string) *CountryUpsertBulk

SetCurrencyCode sets the "currency_code" field.

func (*CountryUpsertBulk) SetCurrencyName

func (u *CountryUpsertBulk) SetCurrencyName(v string) *CountryUpsertBulk

SetCurrencyName sets the "currency_name" field.

func (*CountryUpsertBulk) SetCurrencySymbol

func (u *CountryUpsertBulk) SetCurrencySymbol(v string) *CountryUpsertBulk

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryUpsertBulk) SetIso2

SetIso2 sets the "iso2" field.

func (*CountryUpsertBulk) SetIso3

SetIso3 sets the "iso3" field.

func (*CountryUpsertBulk) SetName

SetName sets the "name" field.

func (*CountryUpsertBulk) SetNumericCode

func (u *CountryUpsertBulk) SetNumericCode(v string) *CountryUpsertBulk

SetNumericCode sets the "numeric_code" field.

func (*CountryUpsertBulk) SetOfficialName

func (u *CountryUpsertBulk) SetOfficialName(v string) *CountryUpsertBulk

SetOfficialName sets the "official_name" field.

func (*CountryUpsertBulk) SetPhoneCode

func (u *CountryUpsertBulk) SetPhoneCode(v string) *CountryUpsertBulk

SetPhoneCode sets the "phone_code" field.

func (*CountryUpsertBulk) SetStatus

func (u *CountryUpsertBulk) SetStatus(v uint8) *CountryUpsertBulk

SetStatus sets the "status" field.

func (*CountryUpsertBulk) SetUpdatedAt

func (u *CountryUpsertBulk) SetUpdatedAt(v time.Time) *CountryUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpsertBulk) Update

func (u *CountryUpsertBulk) Update(set func(*CountryUpsert)) *CountryUpsertBulk

Update allows overriding fields `UPDATE` values. See the CountryCreateBulk.OnConflict documentation for more info.

func (*CountryUpsertBulk) UpdateCapital

func (u *CountryUpsertBulk) UpdateCapital() *CountryUpsertBulk

UpdateCapital sets the "capital" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateConversionRate

func (u *CountryUpsertBulk) UpdateConversionRate() *CountryUpsertBulk

UpdateConversionRate sets the "conversion_rate" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateCreatedAt

func (u *CountryUpsertBulk) UpdateCreatedAt() *CountryUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateCurrencyCode

func (u *CountryUpsertBulk) UpdateCurrencyCode() *CountryUpsertBulk

UpdateCurrencyCode sets the "currency_code" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateCurrencyName

func (u *CountryUpsertBulk) UpdateCurrencyName() *CountryUpsertBulk

UpdateCurrencyName sets the "currency_name" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateCurrencySymbol

func (u *CountryUpsertBulk) UpdateCurrencySymbol() *CountryUpsertBulk

UpdateCurrencySymbol sets the "currency_symbol" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateIso2

func (u *CountryUpsertBulk) UpdateIso2() *CountryUpsertBulk

UpdateIso2 sets the "iso2" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateIso3

func (u *CountryUpsertBulk) UpdateIso3() *CountryUpsertBulk

UpdateIso3 sets the "iso3" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateName

func (u *CountryUpsertBulk) UpdateName() *CountryUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateNewValues

func (u *CountryUpsertBulk) UpdateNewValues() *CountryUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Country.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(country.FieldID)
		}),
	).
	Exec(ctx)

func (*CountryUpsertBulk) UpdateNumericCode

func (u *CountryUpsertBulk) UpdateNumericCode() *CountryUpsertBulk

UpdateNumericCode sets the "numeric_code" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateOfficialName

func (u *CountryUpsertBulk) UpdateOfficialName() *CountryUpsertBulk

UpdateOfficialName sets the "official_name" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdatePhoneCode

func (u *CountryUpsertBulk) UpdatePhoneCode() *CountryUpsertBulk

UpdatePhoneCode sets the "phone_code" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateStatus

func (u *CountryUpsertBulk) UpdateStatus() *CountryUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

func (*CountryUpsertBulk) UpdateUpdatedAt

func (u *CountryUpsertBulk) UpdateUpdatedAt() *CountryUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type CountryUpsertOne

type CountryUpsertOne struct {
	// contains filtered or unexported fields
}

CountryUpsertOne is the builder for "upsert"-ing

one Country node.

func (*CountryUpsertOne) AddConversionRate

func (u *CountryUpsertOne) AddConversionRate(v float64) *CountryUpsertOne

AddConversionRate adds v to the "conversion_rate" field.

func (*CountryUpsertOne) AddStatus

func (u *CountryUpsertOne) AddStatus(v uint8) *CountryUpsertOne

AddStatus adds v to the "status" field.

func (*CountryUpsertOne) ClearCapital

func (u *CountryUpsertOne) ClearCapital() *CountryUpsertOne

ClearCapital clears the value of the "capital" field.

func (*CountryUpsertOne) ClearCurrencyCode

func (u *CountryUpsertOne) ClearCurrencyCode() *CountryUpsertOne

ClearCurrencyCode clears the value of the "currency_code" field.

func (*CountryUpsertOne) ClearCurrencyName

func (u *CountryUpsertOne) ClearCurrencyName() *CountryUpsertOne

ClearCurrencyName clears the value of the "currency_name" field.

func (*CountryUpsertOne) ClearCurrencySymbol

func (u *CountryUpsertOne) ClearCurrencySymbol() *CountryUpsertOne

ClearCurrencySymbol clears the value of the "currency_symbol" field.

func (*CountryUpsertOne) ClearNumericCode

func (u *CountryUpsertOne) ClearNumericCode() *CountryUpsertOne

ClearNumericCode clears the value of the "numeric_code" field.

func (*CountryUpsertOne) ClearOfficialName

func (u *CountryUpsertOne) ClearOfficialName() *CountryUpsertOne

ClearOfficialName clears the value of the "official_name" field.

func (*CountryUpsertOne) ClearPhoneCode

func (u *CountryUpsertOne) ClearPhoneCode() *CountryUpsertOne

ClearPhoneCode clears the value of the "phone_code" field.

func (*CountryUpsertOne) DoNothing

func (u *CountryUpsertOne) DoNothing() *CountryUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*CountryUpsertOne) Exec

func (u *CountryUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryUpsertOne) ExecX

func (u *CountryUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CountryUpsertOne) ID

func (u *CountryUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*CountryUpsertOne) IDX

func (u *CountryUpsertOne) IDX(ctx context.Context) uint64

IDX is like ID, but panics if an error occurs.

func (*CountryUpsertOne) Ignore

func (u *CountryUpsertOne) Ignore() *CountryUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Country.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*CountryUpsertOne) SetCapital

func (u *CountryUpsertOne) SetCapital(v string) *CountryUpsertOne

SetCapital sets the "capital" field.

func (*CountryUpsertOne) SetConversionRate

func (u *CountryUpsertOne) SetConversionRate(v float64) *CountryUpsertOne

SetConversionRate sets the "conversion_rate" field.

func (*CountryUpsertOne) SetCreatedAt

func (u *CountryUpsertOne) SetCreatedAt(v time.Time) *CountryUpsertOne

SetCreatedAt sets the "created_at" field.

func (*CountryUpsertOne) SetCurrencyCode

func (u *CountryUpsertOne) SetCurrencyCode(v string) *CountryUpsertOne

SetCurrencyCode sets the "currency_code" field.

func (*CountryUpsertOne) SetCurrencyName

func (u *CountryUpsertOne) SetCurrencyName(v string) *CountryUpsertOne

SetCurrencyName sets the "currency_name" field.

func (*CountryUpsertOne) SetCurrencySymbol

func (u *CountryUpsertOne) SetCurrencySymbol(v string) *CountryUpsertOne

SetCurrencySymbol sets the "currency_symbol" field.

func (*CountryUpsertOne) SetIso2

func (u *CountryUpsertOne) SetIso2(v string) *CountryUpsertOne

SetIso2 sets the "iso2" field.

func (*CountryUpsertOne) SetIso3

func (u *CountryUpsertOne) SetIso3(v string) *CountryUpsertOne

SetIso3 sets the "iso3" field.

func (*CountryUpsertOne) SetName

func (u *CountryUpsertOne) SetName(v string) *CountryUpsertOne

SetName sets the "name" field.

func (*CountryUpsertOne) SetNumericCode

func (u *CountryUpsertOne) SetNumericCode(v string) *CountryUpsertOne

SetNumericCode sets the "numeric_code" field.

func (*CountryUpsertOne) SetOfficialName

func (u *CountryUpsertOne) SetOfficialName(v string) *CountryUpsertOne

SetOfficialName sets the "official_name" field.

func (*CountryUpsertOne) SetPhoneCode

func (u *CountryUpsertOne) SetPhoneCode(v string) *CountryUpsertOne

SetPhoneCode sets the "phone_code" field.

func (*CountryUpsertOne) SetStatus

func (u *CountryUpsertOne) SetStatus(v uint8) *CountryUpsertOne

SetStatus sets the "status" field.

func (*CountryUpsertOne) SetUpdatedAt

func (u *CountryUpsertOne) SetUpdatedAt(v time.Time) *CountryUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpsertOne) Update

func (u *CountryUpsertOne) Update(set func(*CountryUpsert)) *CountryUpsertOne

Update allows overriding fields `UPDATE` values. See the CountryCreate.OnConflict documentation for more info.

func (*CountryUpsertOne) UpdateCapital

func (u *CountryUpsertOne) UpdateCapital() *CountryUpsertOne

UpdateCapital sets the "capital" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateConversionRate

func (u *CountryUpsertOne) UpdateConversionRate() *CountryUpsertOne

UpdateConversionRate sets the "conversion_rate" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateCreatedAt

func (u *CountryUpsertOne) UpdateCreatedAt() *CountryUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateCurrencyCode

func (u *CountryUpsertOne) UpdateCurrencyCode() *CountryUpsertOne

UpdateCurrencyCode sets the "currency_code" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateCurrencyName

func (u *CountryUpsertOne) UpdateCurrencyName() *CountryUpsertOne

UpdateCurrencyName sets the "currency_name" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateCurrencySymbol

func (u *CountryUpsertOne) UpdateCurrencySymbol() *CountryUpsertOne

UpdateCurrencySymbol sets the "currency_symbol" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateIso2

func (u *CountryUpsertOne) UpdateIso2() *CountryUpsertOne

UpdateIso2 sets the "iso2" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateIso3

func (u *CountryUpsertOne) UpdateIso3() *CountryUpsertOne

UpdateIso3 sets the "iso3" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateName

func (u *CountryUpsertOne) UpdateName() *CountryUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateNewValues

func (u *CountryUpsertOne) UpdateNewValues() *CountryUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Country.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(country.FieldID)
		}),
	).
	Exec(ctx)

func (*CountryUpsertOne) UpdateNumericCode

func (u *CountryUpsertOne) UpdateNumericCode() *CountryUpsertOne

UpdateNumericCode sets the "numeric_code" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateOfficialName

func (u *CountryUpsertOne) UpdateOfficialName() *CountryUpsertOne

UpdateOfficialName sets the "official_name" field to the value that was provided on create.

func (*CountryUpsertOne) UpdatePhoneCode

func (u *CountryUpsertOne) UpdatePhoneCode() *CountryUpsertOne

UpdatePhoneCode sets the "phone_code" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateStatus

func (u *CountryUpsertOne) UpdateStatus() *CountryUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

func (*CountryUpsertOne) UpdateUpdatedAt

func (u *CountryUpsertOne) UpdateUpdatedAt() *CountryUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Admin is the client for interacting with the Admin builders.
	Admin *AdminClient
	// Bank is the client for interacting with the Bank builders.
	Bank *BankClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// CountryLocation is the client for interacting with the CountryLocation builders.
	CountryLocation *CountryLocationClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	// Primary key for the user
	ID uint64 `json:"id,omitempty"`
	// Username of the user
	Username string `json:"username,omitempty"`
	// Full name of the user
	Name string `json:"name,omitempty"`
	// Email address of the user
	Email string `json:"email,omitempty"`
	// Timestamp when email was verified
	EmailVerifiedAt *time.Time `json:"email_verified_at,omitempty"`
	// Password for the user
	Password string `json:"-"`
	// Second password for the user
	Password2 string `json:"-"`
	// Country ID of the user
	CountryID *uint64 `json:"country_id,omitempty"`
	// Contact country ID of the user
	ContactCountryID *uint64 `json:"contact_country_id,omitempty"`
	// Contact number of the user
	ContactNumber *string `json:"contact_number,omitempty"`
	// Full contact number of the user
	FullContactNumber *string `json:"full_contact_number,omitempty"`
	// ID of the introducer user
	IntroducerUserID *uint64 `json:"introducer_user_id,omitempty"`
	// Preferred language of the user
	Lang string `json:"lang,omitempty"`
	// Avatar of the user
	Avatar *string `json:"avatar,omitempty"`
	// Credit 1 balance
	Credit1 float64 `json:"credit_1,omitempty"`
	// Credit 2 balance
	Credit2 float64 `json:"credit_2,omitempty"`
	// Credit 3 balance
	Credit3 float64 `json:"credit_3,omitempty"`
	// Credit 4 balance
	Credit4 float64 `json:"credit_4,omitempty"`
	// Credit 5 balance
	Credit5 float64 `json:"credit_5,omitempty"`
	// Bank ID of the user
	BankID *uint64 `json:"bank_id,omitempty"`
	// Bank account name of the user
	BankAccountName *string `json:"bank_account_name,omitempty"`
	// Bank account number of the user
	BankAccountNumber *string `json:"bank_account_number,omitempty"`
	// National ID of the user
	NationalID *string `json:"national_id,omitempty"`
	// Whether this is the user's first login
	FirstLogin bool `json:"first_login,omitempty"`
	// Timestamp until the user is banned
	BanUntil *time.Time `json:"ban_until,omitempty"`
	// Timestamp of the user's latest login
	NewLoginAt *time.Time `json:"new_login_at,omitempty"`
	// Timestamp of the user's last login
	LastLoginAt *time.Time `json:"last_login_at,omitempty"`
	// Unilevel of the user
	Unilevel *uint64 `json:"unilevel,omitempty"`
	// Record creation timestamp
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Record update timestamp
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Record deleted timestamp
	DeletedAt *time.Time `json:"deleted_at,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) ExecContext

func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*User) QueryBank

func (u *User) QueryBank() *BankQuery

QueryBank queries the "bank" edge of the User entity.

func (*User) QueryContactCountry

func (u *User) QueryContactCountry() *CountryQuery

QueryContactCountry queries the "contact_country" edge of the User entity.

func (*User) QueryContext

func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*User) QueryCountry

func (u *User) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the User entity.

func (*User) QueryIntroducedUsers

func (u *User) QueryIntroducedUsers() *UserQuery

QueryIntroducedUsers queries the "introduced_users" edge of the User entity.

func (*User) QueryIntroducer

func (u *User) QueryIntroducer() *UserQuery

QueryIntroducer queries the "introducer" 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) ExecContext

func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryBank

func (c *UserClient) QueryBank(u *User) *BankQuery

QueryBank queries the bank edge of a User.

func (*UserClient) QueryContactCountry

func (c *UserClient) QueryContactCountry(u *User) *CountryQuery

QueryContactCountry queries the contact_country edge of a User.

func (*UserClient) QueryContext

func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserClient) QueryCountry

func (c *UserClient) QueryCountry(u *User) *CountryQuery

QueryCountry queries the country edge of a User.

func (*UserClient) QueryIntroducedUsers

func (c *UserClient) QueryIntroducedUsers(u *User) *UserQuery

QueryIntroducedUsers queries the introduced_users edge of a User.

func (*UserClient) QueryIntroducer

func (c *UserClient) QueryIntroducer(u *User) *UserQuery

QueryIntroducer queries the introducer 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) AddIntroducedUserIDs

func (uc *UserCreate) AddIntroducedUserIDs(ids ...uint64) *UserCreate

AddIntroducedUserIDs adds the "introduced_users" edge to the User entity by IDs.

func (*UserCreate) AddIntroducedUsers

func (uc *UserCreate) AddIntroducedUsers(u ...*User) *UserCreate

AddIntroducedUsers adds the "introduced_users" edges to the User entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecContext

func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetUsername(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) QueryContext

func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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) SetAvatar

func (uc *UserCreate) SetAvatar(s string) *UserCreate

SetAvatar sets the "avatar" field.

func (*UserCreate) SetBanUntil

func (uc *UserCreate) SetBanUntil(t time.Time) *UserCreate

SetBanUntil sets the "ban_until" field.

func (*UserCreate) SetBank

func (uc *UserCreate) SetBank(b *Bank) *UserCreate

SetBank sets the "bank" edge to the Bank entity.

func (*UserCreate) SetBankAccountName

func (uc *UserCreate) SetBankAccountName(s string) *UserCreate

SetBankAccountName sets the "bank_account_name" field.

func (*UserCreate) SetBankAccountNumber

func (uc *UserCreate) SetBankAccountNumber(s string) *UserCreate

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserCreate) SetBankID

func (uc *UserCreate) SetBankID(u uint64) *UserCreate

SetBankID sets the "bank_id" field.

func (*UserCreate) SetContactCountry

func (uc *UserCreate) SetContactCountry(c *Country) *UserCreate

SetContactCountry sets the "contact_country" edge to the Country entity.

func (*UserCreate) SetContactCountryID

func (uc *UserCreate) SetContactCountryID(u uint64) *UserCreate

SetContactCountryID sets the "contact_country_id" field.

func (*UserCreate) SetContactNumber

func (uc *UserCreate) SetContactNumber(s string) *UserCreate

SetContactNumber sets the "contact_number" field.

func (*UserCreate) SetCountry

func (uc *UserCreate) SetCountry(c *Country) *UserCreate

SetCountry sets the "country" edge to the Country entity.

func (*UserCreate) SetCountryID

func (uc *UserCreate) SetCountryID(u uint64) *UserCreate

SetCountryID sets the "country_id" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetCredit1

func (uc *UserCreate) SetCredit1(f float64) *UserCreate

SetCredit1 sets the "credit_1" field.

func (*UserCreate) SetCredit2

func (uc *UserCreate) SetCredit2(f float64) *UserCreate

SetCredit2 sets the "credit_2" field.

func (*UserCreate) SetCredit3

func (uc *UserCreate) SetCredit3(f float64) *UserCreate

SetCredit3 sets the "credit_3" field.

func (*UserCreate) SetCredit4

func (uc *UserCreate) SetCredit4(f float64) *UserCreate

SetCredit4 sets the "credit_4" field.

func (*UserCreate) SetCredit5

func (uc *UserCreate) SetCredit5(f float64) *UserCreate

SetCredit5 sets the "credit_5" field.

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) SetEmailVerifiedAt

func (uc *UserCreate) SetEmailVerifiedAt(t time.Time) *UserCreate

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserCreate) SetFirstLogin

func (uc *UserCreate) SetFirstLogin(b bool) *UserCreate

SetFirstLogin sets the "first_login" field.

func (*UserCreate) SetFullContactNumber

func (uc *UserCreate) SetFullContactNumber(s string) *UserCreate

SetFullContactNumber sets the "full_contact_number" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uint64) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIntroducer

func (uc *UserCreate) SetIntroducer(u *User) *UserCreate

SetIntroducer sets the "introducer" edge to the User entity.

func (*UserCreate) SetIntroducerID

func (uc *UserCreate) SetIntroducerID(id uint64) *UserCreate

SetIntroducerID sets the "introducer" edge to the User entity by ID.

func (*UserCreate) SetIntroducerUserID

func (uc *UserCreate) SetIntroducerUserID(u uint64) *UserCreate

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserCreate) SetLang

func (uc *UserCreate) SetLang(s string) *UserCreate

SetLang sets the "lang" field.

func (*UserCreate) SetLastLoginAt

func (uc *UserCreate) SetLastLoginAt(t time.Time) *UserCreate

SetLastLoginAt sets the "last_login_at" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNationalID

func (uc *UserCreate) SetNationalID(s string) *UserCreate

SetNationalID sets the "national_id" field.

func (*UserCreate) SetNewLoginAt

func (uc *UserCreate) SetNewLoginAt(t time.Time) *UserCreate

SetNewLoginAt sets the "new_login_at" field.

func (*UserCreate) SetNillableAvatar

func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserCreate) SetNillableBanUntil

func (uc *UserCreate) SetNillableBanUntil(t *time.Time) *UserCreate

SetNillableBanUntil sets the "ban_until" field if the given value is not nil.

func (*UserCreate) SetNillableBankAccountName

func (uc *UserCreate) SetNillableBankAccountName(s *string) *UserCreate

SetNillableBankAccountName sets the "bank_account_name" field if the given value is not nil.

func (*UserCreate) SetNillableBankAccountNumber

func (uc *UserCreate) SetNillableBankAccountNumber(s *string) *UserCreate

SetNillableBankAccountNumber sets the "bank_account_number" field if the given value is not nil.

func (*UserCreate) SetNillableBankID

func (uc *UserCreate) SetNillableBankID(u *uint64) *UserCreate

SetNillableBankID sets the "bank_id" field if the given value is not nil.

func (*UserCreate) SetNillableContactCountryID

func (uc *UserCreate) SetNillableContactCountryID(u *uint64) *UserCreate

SetNillableContactCountryID sets the "contact_country_id" field if the given value is not nil.

func (*UserCreate) SetNillableContactNumber

func (uc *UserCreate) SetNillableContactNumber(s *string) *UserCreate

SetNillableContactNumber sets the "contact_number" field if the given value is not nil.

func (*UserCreate) SetNillableCountryID

func (uc *UserCreate) SetNillableCountryID(u *uint64) *UserCreate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

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) SetNillableCredit1

func (uc *UserCreate) SetNillableCredit1(f *float64) *UserCreate

SetNillableCredit1 sets the "credit_1" field if the given value is not nil.

func (*UserCreate) SetNillableCredit2

func (uc *UserCreate) SetNillableCredit2(f *float64) *UserCreate

SetNillableCredit2 sets the "credit_2" field if the given value is not nil.

func (*UserCreate) SetNillableCredit3

func (uc *UserCreate) SetNillableCredit3(f *float64) *UserCreate

SetNillableCredit3 sets the "credit_3" field if the given value is not nil.

func (*UserCreate) SetNillableCredit4

func (uc *UserCreate) SetNillableCredit4(f *float64) *UserCreate

SetNillableCredit4 sets the "credit_4" field if the given value is not nil.

func (*UserCreate) SetNillableCredit5

func (uc *UserCreate) SetNillableCredit5(f *float64) *UserCreate

SetNillableCredit5 sets the "credit_5" field 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) SetNillableEmailVerifiedAt

func (uc *UserCreate) SetNillableEmailVerifiedAt(t *time.Time) *UserCreate

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*UserCreate) SetNillableFirstLogin

func (uc *UserCreate) SetNillableFirstLogin(b *bool) *UserCreate

SetNillableFirstLogin sets the "first_login" field if the given value is not nil.

func (*UserCreate) SetNillableFullContactNumber

func (uc *UserCreate) SetNillableFullContactNumber(s *string) *UserCreate

SetNillableFullContactNumber sets the "full_contact_number" 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 User entity by ID if the given value is not nil.

func (*UserCreate) SetNillableIntroducerUserID

func (uc *UserCreate) SetNillableIntroducerUserID(u *uint64) *UserCreate

SetNillableIntroducerUserID sets the "introducer_user_id" field if the given value is not nil.

func (*UserCreate) SetNillableLang

func (uc *UserCreate) SetNillableLang(s *string) *UserCreate

SetNillableLang sets the "lang" field if the given value is not nil.

func (*UserCreate) SetNillableLastLoginAt

func (uc *UserCreate) SetNillableLastLoginAt(t *time.Time) *UserCreate

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*UserCreate) SetNillableName

func (uc *UserCreate) SetNillableName(s *string) *UserCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserCreate) SetNillableNationalID

func (uc *UserCreate) SetNillableNationalID(s *string) *UserCreate

SetNillableNationalID sets the "national_id" field if the given value is not nil.

func (*UserCreate) SetNillableNewLoginAt

func (uc *UserCreate) SetNillableNewLoginAt(t *time.Time) *UserCreate

SetNillableNewLoginAt sets the "new_login_at" field if the given value is not nil.

func (*UserCreate) SetNillableUnilevel

func (uc *UserCreate) SetNillableUnilevel(u *uint64) *UserCreate

SetNillableUnilevel sets the "unilevel" 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) SetNillableUsername

func (uc *UserCreate) SetNillableUsername(s *string) *UserCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetPassword2

func (uc *UserCreate) SetPassword2(s string) *UserCreate

SetPassword2 sets the "password2" field.

func (*UserCreate) SetUnilevel

func (uc *UserCreate) SetUnilevel(u uint64) *UserCreate

SetUnilevel sets the "unilevel" 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) ExecContext

func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) QueryContext

func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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) ExecContext

func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) QueryContext

func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 {
	// Country of the user
	Country *Country `json:"country,omitempty"`
	// Contact country of the user
	ContactCountry *Country `json:"contact_country,omitempty"`
	// Introducer user
	Introducer *User `json:"introducer,omitempty"`
	// Bank associated with the user
	Bank *Bank `json:"bank,omitempty"`
	// Users introduced by this user
	IntroducedUsers []*User `json:"introduced_users,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) BankOrErr

func (e UserEdges) BankOrErr() (*Bank, error)

BankOrErr returns the Bank value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) ContactCountryOrErr

func (e UserEdges) ContactCountryOrErr() (*Country, error)

ContactCountryOrErr returns the ContactCountry value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) CountryOrErr

func (e UserEdges) CountryOrErr() (*Country, error)

CountryOrErr returns the Country value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) IntroducedUsersOrErr

func (e UserEdges) IntroducedUsersOrErr() ([]*User, error)

IntroducedUsersOrErr returns the IntroducedUsers value or an error if the edge was not loaded in eager-loading.

func (UserEdges) IntroducerOrErr

func (e UserEdges) IntroducerOrErr() (*User, error)

IntroducerOrErr returns the Introducer value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddCredit1

func (m *UserMutation) AddCredit1(f float64)

AddCredit1 adds f to the "credit_1" field.

func (*UserMutation) AddCredit2

func (m *UserMutation) AddCredit2(f float64)

AddCredit2 adds f to the "credit_2" field.

func (*UserMutation) AddCredit3

func (m *UserMutation) AddCredit3(f float64)

AddCredit3 adds f to the "credit_3" field.

func (*UserMutation) AddCredit4

func (m *UserMutation) AddCredit4(f float64)

AddCredit4 adds f to the "credit_4" field.

func (*UserMutation) AddCredit5

func (m *UserMutation) AddCredit5(f float64)

AddCredit5 adds f to the "credit_5" field.

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) AddIntroducedUserIDs

func (m *UserMutation) AddIntroducedUserIDs(ids ...uint64)

AddIntroducedUserIDs adds the "introduced_users" edge to the User entity by ids.

func (*UserMutation) AddUnilevel

func (m *UserMutation) AddUnilevel(u int64)

AddUnilevel adds u to the "unilevel" field.

func (*UserMutation) AddedCredit1

func (m *UserMutation) AddedCredit1() (r float64, exists bool)

AddedCredit1 returns the value that was added to the "credit_1" field in this mutation.

func (*UserMutation) AddedCredit2

func (m *UserMutation) AddedCredit2() (r float64, exists bool)

AddedCredit2 returns the value that was added to the "credit_2" field in this mutation.

func (*UserMutation) AddedCredit3

func (m *UserMutation) AddedCredit3() (r float64, exists bool)

AddedCredit3 returns the value that was added to the "credit_3" field in this mutation.

func (*UserMutation) AddedCredit4

func (m *UserMutation) AddedCredit4() (r float64, exists bool)

AddedCredit4 returns the value that was added to the "credit_4" field in this mutation.

func (*UserMutation) AddedCredit5

func (m *UserMutation) AddedCredit5() (r float64, exists bool)

AddedCredit5 returns the value that was added to the "credit_5" field in this mutation.

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) AddedUnilevel

func (m *UserMutation) AddedUnilevel() (r int64, exists bool)

AddedUnilevel returns the value that was added to the "unilevel" field in this mutation.

func (*UserMutation) Avatar

func (m *UserMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*UserMutation) AvatarCleared

func (m *UserMutation) AvatarCleared() bool

AvatarCleared returns if the "avatar" field was cleared in this mutation.

func (*UserMutation) BanUntil

func (m *UserMutation) BanUntil() (r time.Time, exists bool)

BanUntil returns the value of the "ban_until" field in the mutation.

func (*UserMutation) BanUntilCleared

func (m *UserMutation) BanUntilCleared() bool

BanUntilCleared returns if the "ban_until" field was cleared in this mutation.

func (*UserMutation) BankAccountName

func (m *UserMutation) BankAccountName() (r string, exists bool)

BankAccountName returns the value of the "bank_account_name" field in the mutation.

func (*UserMutation) BankAccountNameCleared

func (m *UserMutation) BankAccountNameCleared() bool

BankAccountNameCleared returns if the "bank_account_name" field was cleared in this mutation.

func (*UserMutation) BankAccountNumber

func (m *UserMutation) BankAccountNumber() (r string, exists bool)

BankAccountNumber returns the value of the "bank_account_number" field in the mutation.

func (*UserMutation) BankAccountNumberCleared

func (m *UserMutation) BankAccountNumberCleared() bool

BankAccountNumberCleared returns if the "bank_account_number" field was cleared in this mutation.

func (*UserMutation) BankCleared

func (m *UserMutation) BankCleared() bool

BankCleared reports if the "bank" edge to the Bank entity was cleared.

func (*UserMutation) BankID

func (m *UserMutation) BankID() (r uint64, exists bool)

BankID returns the value of the "bank_id" field in the mutation.

func (*UserMutation) BankIDCleared

func (m *UserMutation) BankIDCleared() bool

BankIDCleared returns if the "bank_id" field was cleared in this mutation.

func (*UserMutation) BankIDs

func (m *UserMutation) BankIDs() (ids []uint64)

BankIDs returns the "bank" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BankID instead. It exists only for internal usage by the builders.

func (*UserMutation) ClearAvatar

func (m *UserMutation) ClearAvatar()

ClearAvatar clears the value of the "avatar" field.

func (*UserMutation) ClearBanUntil

func (m *UserMutation) ClearBanUntil()

ClearBanUntil clears the value of the "ban_until" field.

func (*UserMutation) ClearBank

func (m *UserMutation) ClearBank()

ClearBank clears the "bank" edge to the Bank entity.

func (*UserMutation) ClearBankAccountName

func (m *UserMutation) ClearBankAccountName()

ClearBankAccountName clears the value of the "bank_account_name" field.

func (*UserMutation) ClearBankAccountNumber

func (m *UserMutation) ClearBankAccountNumber()

ClearBankAccountNumber clears the value of the "bank_account_number" field.

func (*UserMutation) ClearBankID

func (m *UserMutation) ClearBankID()

ClearBankID clears the value of the "bank_id" field.

func (*UserMutation) ClearContactCountry

func (m *UserMutation) ClearContactCountry()

ClearContactCountry clears the "contact_country" edge to the Country entity.

func (*UserMutation) ClearContactCountryID

func (m *UserMutation) ClearContactCountryID()

ClearContactCountryID clears the value of the "contact_country_id" field.

func (*UserMutation) ClearContactNumber

func (m *UserMutation) ClearContactNumber()

ClearContactNumber clears the value of the "contact_number" field.

func (*UserMutation) ClearCountry

func (m *UserMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*UserMutation) ClearCountryID

func (m *UserMutation) ClearCountryID()

ClearCountryID clears the value of the "country_id" field.

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) ClearEmailVerifiedAt

func (m *UserMutation) ClearEmailVerifiedAt()

ClearEmailVerifiedAt clears the value of the "email_verified_at" 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) ClearFullContactNumber

func (m *UserMutation) ClearFullContactNumber()

ClearFullContactNumber clears the value of the "full_contact_number" field.

func (*UserMutation) ClearIntroducedUsers

func (m *UserMutation) ClearIntroducedUsers()

ClearIntroducedUsers clears the "introduced_users" edge to the User entity.

func (*UserMutation) ClearIntroducer

func (m *UserMutation) ClearIntroducer()

ClearIntroducer clears the "introducer" edge to the User entity.

func (*UserMutation) ClearIntroducerUserID

func (m *UserMutation) ClearIntroducerUserID()

ClearIntroducerUserID clears the value of the "introducer_user_id" field.

func (*UserMutation) ClearLastLoginAt

func (m *UserMutation) ClearLastLoginAt()

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserMutation) ClearName

func (m *UserMutation) ClearName()

ClearName clears the value of the "name" field.

func (*UserMutation) ClearNationalID

func (m *UserMutation) ClearNationalID()

ClearNationalID clears the value of the "national_id" field.

func (*UserMutation) ClearNewLoginAt

func (m *UserMutation) ClearNewLoginAt()

ClearNewLoginAt clears the value of the "new_login_at" field.

func (*UserMutation) ClearUnilevel

func (m *UserMutation) ClearUnilevel()

ClearUnilevel clears the value of the "unilevel" field.

func (*UserMutation) ClearUsername

func (m *UserMutation) ClearUsername()

ClearUsername clears the value of the "username" 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) ContactCountryCleared

func (m *UserMutation) ContactCountryCleared() bool

ContactCountryCleared reports if the "contact_country" edge to the Country entity was cleared.

func (*UserMutation) ContactCountryID

func (m *UserMutation) ContactCountryID() (r uint64, exists bool)

ContactCountryID returns the value of the "contact_country_id" field in the mutation.

func (*UserMutation) ContactCountryIDCleared

func (m *UserMutation) ContactCountryIDCleared() bool

ContactCountryIDCleared returns if the "contact_country_id" field was cleared in this mutation.

func (*UserMutation) ContactCountryIDs

func (m *UserMutation) ContactCountryIDs() (ids []uint64)

ContactCountryIDs returns the "contact_country" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ContactCountryID instead. It exists only for internal usage by the builders.

func (*UserMutation) ContactNumber

func (m *UserMutation) ContactNumber() (r string, exists bool)

ContactNumber returns the value of the "contact_number" field in the mutation.

func (*UserMutation) ContactNumberCleared

func (m *UserMutation) ContactNumberCleared() bool

ContactNumberCleared returns if the "contact_number" field was cleared in this mutation.

func (*UserMutation) CountryCleared

func (m *UserMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*UserMutation) CountryID

func (m *UserMutation) CountryID() (r uint64, exists bool)

CountryID returns the value of the "country_id" field in the mutation.

func (*UserMutation) CountryIDCleared

func (m *UserMutation) CountryIDCleared() bool

CountryIDCleared returns if the "country_id" field was cleared in this mutation.

func (*UserMutation) CountryIDs

func (m *UserMutation) CountryIDs() (ids []uint64)

CountryIDs returns the "country" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CountryID instead. It exists only for internal usage by the builders.

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) Credit1

func (m *UserMutation) Credit1() (r float64, exists bool)

Credit1 returns the value of the "credit_1" field in the mutation.

func (*UserMutation) Credit2

func (m *UserMutation) Credit2() (r float64, exists bool)

Credit2 returns the value of the "credit_2" field in the mutation.

func (*UserMutation) Credit3

func (m *UserMutation) Credit3() (r float64, exists bool)

Credit3 returns the value of the "credit_3" field in the mutation.

func (*UserMutation) Credit4

func (m *UserMutation) Credit4() (r float64, exists bool)

Credit4 returns the value of the "credit_4" field in the mutation.

func (*UserMutation) Credit5

func (m *UserMutation) Credit5() (r float64, exists bool)

Credit5 returns the value of the "credit_5" field in the mutation.

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) EmailVerifiedAt

func (m *UserMutation) EmailVerifiedAt() (r time.Time, exists bool)

EmailVerifiedAt returns the value of the "email_verified_at" field in the mutation.

func (*UserMutation) EmailVerifiedAtCleared

func (m *UserMutation) EmailVerifiedAtCleared() bool

EmailVerifiedAtCleared returns if the "email_verified_at" field was cleared in this mutation.

func (*UserMutation) ExecContext

func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) FirstLogin

func (m *UserMutation) FirstLogin() (r bool, exists bool)

FirstLogin returns the value of the "first_login" field in the mutation.

func (*UserMutation) FullContactNumber

func (m *UserMutation) FullContactNumber() (r string, exists bool)

FullContactNumber returns the value of the "full_contact_number" field in the mutation.

func (*UserMutation) FullContactNumberCleared

func (m *UserMutation) FullContactNumberCleared() bool

FullContactNumberCleared returns if the "full_contact_number" field was cleared in this mutation.

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) IntroducedUsersCleared

func (m *UserMutation) IntroducedUsersCleared() bool

IntroducedUsersCleared reports if the "introduced_users" edge to the User entity was cleared.

func (*UserMutation) IntroducedUsersIDs

func (m *UserMutation) IntroducedUsersIDs() (ids []uint64)

IntroducedUsersIDs returns the "introduced_users" edge IDs in the mutation.

func (*UserMutation) IntroducerCleared

func (m *UserMutation) IntroducerCleared() bool

IntroducerCleared reports if the "introducer" edge to the User 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) IntroducerUserID

func (m *UserMutation) IntroducerUserID() (r uint64, exists bool)

IntroducerUserID returns the value of the "introducer_user_id" field in the mutation.

func (*UserMutation) IntroducerUserIDCleared

func (m *UserMutation) IntroducerUserIDCleared() bool

IntroducerUserIDCleared returns if the "introducer_user_id" field was cleared in this mutation.

func (*UserMutation) Lang

func (m *UserMutation) Lang() (r string, exists bool)

Lang returns the value of the "lang" field in the mutation.

func (*UserMutation) LastLoginAt

func (m *UserMutation) LastLoginAt() (r time.Time, exists bool)

LastLoginAt returns the value of the "last_login_at" field in the mutation.

func (*UserMutation) LastLoginAtCleared

func (m *UserMutation) LastLoginAtCleared() bool

LastLoginAtCleared returns if the "last_login_at" field was cleared in this mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) NameCleared

func (m *UserMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*UserMutation) NationalID

func (m *UserMutation) NationalID() (r string, exists bool)

NationalID returns the value of the "national_id" field in the mutation.

func (*UserMutation) NationalIDCleared

func (m *UserMutation) NationalIDCleared() bool

NationalIDCleared returns if the "national_id" field was cleared in this mutation.

func (*UserMutation) NewLoginAt

func (m *UserMutation) NewLoginAt() (r time.Time, exists bool)

NewLoginAt returns the value of the "new_login_at" field in the mutation.

func (*UserMutation) NewLoginAtCleared

func (m *UserMutation) NewLoginAtCleared() bool

NewLoginAtCleared returns if the "new_login_at" field was cleared in this mutation.

func (*UserMutation) OldAvatar

func (m *UserMutation) OldAvatar(ctx context.Context) (v *string, err error)

OldAvatar returns the old "avatar" 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) OldBanUntil

func (m *UserMutation) OldBanUntil(ctx context.Context) (v *time.Time, err error)

OldBanUntil returns the old "ban_until" 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) OldBankAccountName

func (m *UserMutation) OldBankAccountName(ctx context.Context) (v *string, err error)

OldBankAccountName returns the old "bank_account_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldBankAccountNumber

func (m *UserMutation) OldBankAccountNumber(ctx context.Context) (v *string, err error)

OldBankAccountNumber returns the old "bank_account_number" 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) OldBankID

func (m *UserMutation) OldBankID(ctx context.Context) (v *uint64, err error)

OldBankID returns the old "bank_id" 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) OldContactCountryID

func (m *UserMutation) OldContactCountryID(ctx context.Context) (v *uint64, err error)

OldContactCountryID returns the old "contact_country_id" 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) OldContactNumber

func (m *UserMutation) OldContactNumber(ctx context.Context) (v *string, err error)

OldContactNumber returns the old "contact_number" 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) OldCountryID

func (m *UserMutation) OldCountryID(ctx context.Context) (v *uint64, err error)

OldCountryID returns the old "country_id" 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) 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) OldCredit1

func (m *UserMutation) OldCredit1(ctx context.Context) (v float64, err error)

OldCredit1 returns the old "credit_1" 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) OldCredit2

func (m *UserMutation) OldCredit2(ctx context.Context) (v float64, err error)

OldCredit2 returns the old "credit_2" 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) OldCredit3

func (m *UserMutation) OldCredit3(ctx context.Context) (v float64, err error)

OldCredit3 returns the old "credit_3" 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) OldCredit4

func (m *UserMutation) OldCredit4(ctx context.Context) (v float64, err error)

OldCredit4 returns the old "credit_4" 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) OldCredit5

func (m *UserMutation) OldCredit5(ctx context.Context) (v float64, err error)

OldCredit5 returns the old "credit_5" 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) OldEmailVerifiedAt

func (m *UserMutation) OldEmailVerifiedAt(ctx context.Context) (v *time.Time, err error)

OldEmailVerifiedAt returns the old "email_verified_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldFirstLogin

func (m *UserMutation) OldFirstLogin(ctx context.Context) (v bool, err error)

OldFirstLogin returns the old "first_login" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldFullContactNumber

func (m *UserMutation) OldFullContactNumber(ctx context.Context) (v *string, err error)

OldFullContactNumber returns the old "full_contact_number" 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) OldIntroducerUserID

func (m *UserMutation) OldIntroducerUserID(ctx context.Context) (v *uint64, err error)

OldIntroducerUserID returns the old "introducer_user_id" 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) OldLang

func (m *UserMutation) OldLang(ctx context.Context) (v string, err error)

OldLang returns the old "lang" 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) OldLastLoginAt

func (m *UserMutation) OldLastLoginAt(ctx context.Context) (v *time.Time, err error)

OldLastLoginAt returns the old "last_login_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) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldNationalID

func (m *UserMutation) OldNationalID(ctx context.Context) (v *string, err error)

OldNationalID returns the old "national_id" 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) OldNewLoginAt

func (m *UserMutation) OldNewLoginAt(ctx context.Context) (v *time.Time, err error)

OldNewLoginAt returns the old "new_login_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) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword2

func (m *UserMutation) OldPassword2(ctx context.Context) (v string, err error)

OldPassword2 returns the old "password2" 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) OldUnilevel

func (m *UserMutation) OldUnilevel(ctx context.Context) (v *uint64, err error)

OldUnilevel returns the old "unilevel" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) Password2

func (m *UserMutation) Password2() (r string, exists bool)

Password2 returns the value of the "password2" field in the mutation.

func (*UserMutation) QueryContext

func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserMutation) RemoveIntroducedUserIDs

func (m *UserMutation) RemoveIntroducedUserIDs(ids ...uint64)

RemoveIntroducedUserIDs removes the "introduced_users" edge to the User 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) RemovedIntroducedUsersIDs

func (m *UserMutation) RemovedIntroducedUsersIDs() (ids []uint64)

RemovedIntroducedUsers returns the removed IDs of the "introduced_users" edge to the User entity.

func (*UserMutation) ResetAvatar

func (m *UserMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*UserMutation) ResetBanUntil

func (m *UserMutation) ResetBanUntil()

ResetBanUntil resets all changes to the "ban_until" field.

func (*UserMutation) ResetBank

func (m *UserMutation) ResetBank()

ResetBank resets all changes to the "bank" edge.

func (*UserMutation) ResetBankAccountName

func (m *UserMutation) ResetBankAccountName()

ResetBankAccountName resets all changes to the "bank_account_name" field.

func (*UserMutation) ResetBankAccountNumber

func (m *UserMutation) ResetBankAccountNumber()

ResetBankAccountNumber resets all changes to the "bank_account_number" field.

func (*UserMutation) ResetBankID

func (m *UserMutation) ResetBankID()

ResetBankID resets all changes to the "bank_id" field.

func (*UserMutation) ResetContactCountry

func (m *UserMutation) ResetContactCountry()

ResetContactCountry resets all changes to the "contact_country" edge.

func (*UserMutation) ResetContactCountryID

func (m *UserMutation) ResetContactCountryID()

ResetContactCountryID resets all changes to the "contact_country_id" field.

func (*UserMutation) ResetContactNumber

func (m *UserMutation) ResetContactNumber()

ResetContactNumber resets all changes to the "contact_number" field.

func (*UserMutation) ResetCountry

func (m *UserMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*UserMutation) ResetCountryID

func (m *UserMutation) ResetCountryID()

ResetCountryID resets all changes to the "country_id" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetCredit1

func (m *UserMutation) ResetCredit1()

ResetCredit1 resets all changes to the "credit_1" field.

func (*UserMutation) ResetCredit2

func (m *UserMutation) ResetCredit2()

ResetCredit2 resets all changes to the "credit_2" field.

func (*UserMutation) ResetCredit3

func (m *UserMutation) ResetCredit3()

ResetCredit3 resets all changes to the "credit_3" field.

func (*UserMutation) ResetCredit4

func (m *UserMutation) ResetCredit4()

ResetCredit4 resets all changes to the "credit_4" field.

func (*UserMutation) ResetCredit5

func (m *UserMutation) ResetCredit5()

ResetCredit5 resets all changes to the "credit_5" field.

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) ResetEmailVerifiedAt

func (m *UserMutation) ResetEmailVerifiedAt()

ResetEmailVerifiedAt resets all changes to the "email_verified_at" 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) ResetFirstLogin

func (m *UserMutation) ResetFirstLogin()

ResetFirstLogin resets all changes to the "first_login" field.

func (*UserMutation) ResetFullContactNumber

func (m *UserMutation) ResetFullContactNumber()

ResetFullContactNumber resets all changes to the "full_contact_number" field.

func (*UserMutation) ResetIntroducedUsers

func (m *UserMutation) ResetIntroducedUsers()

ResetIntroducedUsers resets all changes to the "introduced_users" edge.

func (*UserMutation) ResetIntroducer

func (m *UserMutation) ResetIntroducer()

ResetIntroducer resets all changes to the "introducer" edge.

func (*UserMutation) ResetIntroducerUserID

func (m *UserMutation) ResetIntroducerUserID()

ResetIntroducerUserID resets all changes to the "introducer_user_id" field.

func (*UserMutation) ResetLang

func (m *UserMutation) ResetLang()

ResetLang resets all changes to the "lang" field.

func (*UserMutation) ResetLastLoginAt

func (m *UserMutation) ResetLastLoginAt()

ResetLastLoginAt resets all changes to the "last_login_at" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetNationalID

func (m *UserMutation) ResetNationalID()

ResetNationalID resets all changes to the "national_id" field.

func (*UserMutation) ResetNewLoginAt

func (m *UserMutation) ResetNewLoginAt()

ResetNewLoginAt resets all changes to the "new_login_at" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPassword2

func (m *UserMutation) ResetPassword2()

ResetPassword2 resets all changes to the "password2" field.

func (*UserMutation) ResetUnilevel

func (m *UserMutation) ResetUnilevel()

ResetUnilevel resets all changes to the "unilevel" 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) SetAvatar

func (m *UserMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*UserMutation) SetBanUntil

func (m *UserMutation) SetBanUntil(t time.Time)

SetBanUntil sets the "ban_until" field.

func (*UserMutation) SetBankAccountName

func (m *UserMutation) SetBankAccountName(s string)

SetBankAccountName sets the "bank_account_name" field.

func (*UserMutation) SetBankAccountNumber

func (m *UserMutation) SetBankAccountNumber(s string)

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserMutation) SetBankID

func (m *UserMutation) SetBankID(u uint64)

SetBankID sets the "bank_id" field.

func (*UserMutation) SetContactCountryID

func (m *UserMutation) SetContactCountryID(u uint64)

SetContactCountryID sets the "contact_country_id" field.

func (*UserMutation) SetContactNumber

func (m *UserMutation) SetContactNumber(s string)

SetContactNumber sets the "contact_number" field.

func (*UserMutation) SetCountryID

func (m *UserMutation) SetCountryID(u uint64)

SetCountryID sets the "country_id" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetCredit1

func (m *UserMutation) SetCredit1(f float64)

SetCredit1 sets the "credit_1" field.

func (*UserMutation) SetCredit2

func (m *UserMutation) SetCredit2(f float64)

SetCredit2 sets the "credit_2" field.

func (*UserMutation) SetCredit3

func (m *UserMutation) SetCredit3(f float64)

SetCredit3 sets the "credit_3" field.

func (*UserMutation) SetCredit4

func (m *UserMutation) SetCredit4(f float64)

SetCredit4 sets the "credit_4" field.

func (*UserMutation) SetCredit5

func (m *UserMutation) SetCredit5(f float64)

SetCredit5 sets the "credit_5" field.

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) SetEmailVerifiedAt

func (m *UserMutation) SetEmailVerifiedAt(t time.Time)

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetFirstLogin

func (m *UserMutation) SetFirstLogin(b bool)

SetFirstLogin sets the "first_login" field.

func (*UserMutation) SetFullContactNumber

func (m *UserMutation) SetFullContactNumber(s string)

SetFullContactNumber sets the "full_contact_number" field.

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 User entity by id.

func (*UserMutation) SetIntroducerUserID

func (m *UserMutation) SetIntroducerUserID(u uint64)

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserMutation) SetLang

func (m *UserMutation) SetLang(s string)

SetLang sets the "lang" field.

func (*UserMutation) SetLastLoginAt

func (m *UserMutation) SetLastLoginAt(t time.Time)

SetLastLoginAt sets the "last_login_at" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetNationalID

func (m *UserMutation) SetNationalID(s string)

SetNationalID sets the "national_id" field.

func (*UserMutation) SetNewLoginAt

func (m *UserMutation) SetNewLoginAt(t time.Time)

SetNewLoginAt sets the "new_login_at" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetPassword2

func (m *UserMutation) SetPassword2(s string)

SetPassword2 sets the "password2" field.

func (*UserMutation) SetUnilevel

func (m *UserMutation) SetUnilevel(u uint64)

SetUnilevel sets the "unilevel" 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) Unilevel

func (m *UserMutation) Unilevel() (r uint64, exists bool)

Unilevel returns the value of the "unilevel" field in the mutation.

func (*UserMutation) UnilevelCleared

func (m *UserMutation) UnilevelCleared() bool

UnilevelCleared returns if the "unilevel" field was cleared in this mutation.

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) UsernameCleared

func (m *UserMutation) UsernameCleared() bool

UsernameCleared returns if the "username" field was cleared in this 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) ExecContext

func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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 {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	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) QueryBank

func (uq *UserQuery) QueryBank() *BankQuery

QueryBank chains the current query on the "bank" edge.

func (*UserQuery) QueryContactCountry

func (uq *UserQuery) QueryContactCountry() *CountryQuery

QueryContactCountry chains the current query on the "contact_country" edge.

func (*UserQuery) QueryContext

func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserQuery) QueryCountry

func (uq *UserQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*UserQuery) QueryIntroducedUsers

func (uq *UserQuery) QueryIntroducedUsers() *UserQuery

QueryIntroducedUsers chains the current query on the "introduced_users" edge.

func (*UserQuery) QueryIntroducer

func (uq *UserQuery) QueryIntroducer() *UserQuery

QueryIntroducer chains the current query on the "introducer" 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 {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	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) WithBank

func (uq *UserQuery) WithBank(opts ...func(*BankQuery)) *UserQuery

WithBank tells the query-builder to eager-load the nodes that are connected to the "bank" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithContactCountry

func (uq *UserQuery) WithContactCountry(opts ...func(*CountryQuery)) *UserQuery

WithContactCountry tells the query-builder to eager-load the nodes that are connected to the "contact_country" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithCountry

func (uq *UserQuery) WithCountry(opts ...func(*CountryQuery)) *UserQuery

WithCountry tells the query-builder to eager-load the nodes that are connected to the "country" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithIntroducedUsers

func (uq *UserQuery) WithIntroducedUsers(opts ...func(*UserQuery)) *UserQuery

WithIntroducedUsers tells the query-builder to eager-load the nodes that are connected to the "introduced_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithIntroducer

func (uq *UserQuery) WithIntroducer(opts ...func(*UserQuery)) *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.

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) ExecContext

func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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) AddCredit1

func (uu *UserUpdate) AddCredit1(f float64) *UserUpdate

AddCredit1 adds f to the "credit_1" field.

func (*UserUpdate) AddCredit2

func (uu *UserUpdate) AddCredit2(f float64) *UserUpdate

AddCredit2 adds f to the "credit_2" field.

func (*UserUpdate) AddCredit3

func (uu *UserUpdate) AddCredit3(f float64) *UserUpdate

AddCredit3 adds f to the "credit_3" field.

func (*UserUpdate) AddCredit4

func (uu *UserUpdate) AddCredit4(f float64) *UserUpdate

AddCredit4 adds f to the "credit_4" field.

func (*UserUpdate) AddCredit5

func (uu *UserUpdate) AddCredit5(f float64) *UserUpdate

AddCredit5 adds f to the "credit_5" field.

func (*UserUpdate) AddIntroducedUserIDs

func (uu *UserUpdate) AddIntroducedUserIDs(ids ...uint64) *UserUpdate

AddIntroducedUserIDs adds the "introduced_users" edge to the User entity by IDs.

func (*UserUpdate) AddIntroducedUsers

func (uu *UserUpdate) AddIntroducedUsers(u ...*User) *UserUpdate

AddIntroducedUsers adds the "introduced_users" edges to the User entity.

func (*UserUpdate) AddUnilevel

func (uu *UserUpdate) AddUnilevel(u int64) *UserUpdate

AddUnilevel adds u to the "unilevel" field.

func (*UserUpdate) ClearAvatar

func (uu *UserUpdate) ClearAvatar() *UserUpdate

ClearAvatar clears the value of the "avatar" field.

func (*UserUpdate) ClearBanUntil

func (uu *UserUpdate) ClearBanUntil() *UserUpdate

ClearBanUntil clears the value of the "ban_until" field.

func (*UserUpdate) ClearBank

func (uu *UserUpdate) ClearBank() *UserUpdate

ClearBank clears the "bank" edge to the Bank entity.

func (*UserUpdate) ClearBankAccountName

func (uu *UserUpdate) ClearBankAccountName() *UserUpdate

ClearBankAccountName clears the value of the "bank_account_name" field.

func (*UserUpdate) ClearBankAccountNumber

func (uu *UserUpdate) ClearBankAccountNumber() *UserUpdate

ClearBankAccountNumber clears the value of the "bank_account_number" field.

func (*UserUpdate) ClearBankID

func (uu *UserUpdate) ClearBankID() *UserUpdate

ClearBankID clears the value of the "bank_id" field.

func (*UserUpdate) ClearContactCountry

func (uu *UserUpdate) ClearContactCountry() *UserUpdate

ClearContactCountry clears the "contact_country" edge to the Country entity.

func (*UserUpdate) ClearContactCountryID

func (uu *UserUpdate) ClearContactCountryID() *UserUpdate

ClearContactCountryID clears the value of the "contact_country_id" field.

func (*UserUpdate) ClearContactNumber

func (uu *UserUpdate) ClearContactNumber() *UserUpdate

ClearContactNumber clears the value of the "contact_number" field.

func (*UserUpdate) ClearCountry

func (uu *UserUpdate) ClearCountry() *UserUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*UserUpdate) ClearCountryID

func (uu *UserUpdate) ClearCountryID() *UserUpdate

ClearCountryID clears the value of the "country_id" field.

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) ClearEmailVerifiedAt

func (uu *UserUpdate) ClearEmailVerifiedAt() *UserUpdate

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*UserUpdate) ClearFullContactNumber

func (uu *UserUpdate) ClearFullContactNumber() *UserUpdate

ClearFullContactNumber clears the value of the "full_contact_number" field.

func (*UserUpdate) ClearIntroducedUsers

func (uu *UserUpdate) ClearIntroducedUsers() *UserUpdate

ClearIntroducedUsers clears all "introduced_users" edges to the User entity.

func (*UserUpdate) ClearIntroducer

func (uu *UserUpdate) ClearIntroducer() *UserUpdate

ClearIntroducer clears the "introducer" edge to the User entity.

func (*UserUpdate) ClearIntroducerUserID

func (uu *UserUpdate) ClearIntroducerUserID() *UserUpdate

ClearIntroducerUserID clears the value of the "introducer_user_id" field.

func (*UserUpdate) ClearLastLoginAt

func (uu *UserUpdate) ClearLastLoginAt() *UserUpdate

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserUpdate) ClearName

func (uu *UserUpdate) ClearName() *UserUpdate

ClearName clears the value of the "name" field.

func (*UserUpdate) ClearNationalID

func (uu *UserUpdate) ClearNationalID() *UserUpdate

ClearNationalID clears the value of the "national_id" field.

func (*UserUpdate) ClearNewLoginAt

func (uu *UserUpdate) ClearNewLoginAt() *UserUpdate

ClearNewLoginAt clears the value of the "new_login_at" field.

func (*UserUpdate) ClearUnilevel

func (uu *UserUpdate) ClearUnilevel() *UserUpdate

ClearUnilevel clears the value of the "unilevel" field.

func (*UserUpdate) ClearUsername

func (uu *UserUpdate) ClearUsername() *UserUpdate

ClearUsername clears the value of the "username" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecContext

func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdate) RemoveIntroducedUserIDs

func (uu *UserUpdate) RemoveIntroducedUserIDs(ids ...uint64) *UserUpdate

RemoveIntroducedUserIDs removes the "introduced_users" edge to User entities by IDs.

func (*UserUpdate) RemoveIntroducedUsers

func (uu *UserUpdate) RemoveIntroducedUsers(u ...*User) *UserUpdate

RemoveIntroducedUsers removes "introduced_users" edges to User 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) SetAvatar

func (uu *UserUpdate) SetAvatar(s string) *UserUpdate

SetAvatar sets the "avatar" field.

func (*UserUpdate) SetBanUntil

func (uu *UserUpdate) SetBanUntil(t time.Time) *UserUpdate

SetBanUntil sets the "ban_until" field.

func (*UserUpdate) SetBank

func (uu *UserUpdate) SetBank(b *Bank) *UserUpdate

SetBank sets the "bank" edge to the Bank entity.

func (*UserUpdate) SetBankAccountName

func (uu *UserUpdate) SetBankAccountName(s string) *UserUpdate

SetBankAccountName sets the "bank_account_name" field.

func (*UserUpdate) SetBankAccountNumber

func (uu *UserUpdate) SetBankAccountNumber(s string) *UserUpdate

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserUpdate) SetBankID

func (uu *UserUpdate) SetBankID(u uint64) *UserUpdate

SetBankID sets the "bank_id" field.

func (*UserUpdate) SetContactCountry

func (uu *UserUpdate) SetContactCountry(c *Country) *UserUpdate

SetContactCountry sets the "contact_country" edge to the Country entity.

func (*UserUpdate) SetContactCountryID

func (uu *UserUpdate) SetContactCountryID(u uint64) *UserUpdate

SetContactCountryID sets the "contact_country_id" field.

func (*UserUpdate) SetContactNumber

func (uu *UserUpdate) SetContactNumber(s string) *UserUpdate

SetContactNumber sets the "contact_number" field.

func (*UserUpdate) SetCountry

func (uu *UserUpdate) SetCountry(c *Country) *UserUpdate

SetCountry sets the "country" edge to the Country entity.

func (*UserUpdate) SetCountryID

func (uu *UserUpdate) SetCountryID(u uint64) *UserUpdate

SetCountryID sets the "country_id" field.

func (*UserUpdate) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetCredit1

func (uu *UserUpdate) SetCredit1(f float64) *UserUpdate

SetCredit1 sets the "credit_1" field.

func (*UserUpdate) SetCredit2

func (uu *UserUpdate) SetCredit2(f float64) *UserUpdate

SetCredit2 sets the "credit_2" field.

func (*UserUpdate) SetCredit3

func (uu *UserUpdate) SetCredit3(f float64) *UserUpdate

SetCredit3 sets the "credit_3" field.

func (*UserUpdate) SetCredit4

func (uu *UserUpdate) SetCredit4(f float64) *UserUpdate

SetCredit4 sets the "credit_4" field.

func (*UserUpdate) SetCredit5

func (uu *UserUpdate) SetCredit5(f float64) *UserUpdate

SetCredit5 sets the "credit_5" field.

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) SetEmailVerifiedAt

func (uu *UserUpdate) SetEmailVerifiedAt(t time.Time) *UserUpdate

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserUpdate) SetFirstLogin

func (uu *UserUpdate) SetFirstLogin(b bool) *UserUpdate

SetFirstLogin sets the "first_login" field.

func (*UserUpdate) SetFullContactNumber

func (uu *UserUpdate) SetFullContactNumber(s string) *UserUpdate

SetFullContactNumber sets the "full_contact_number" field.

func (*UserUpdate) SetIntroducer

func (uu *UserUpdate) SetIntroducer(u *User) *UserUpdate

SetIntroducer sets the "introducer" edge to the User entity.

func (*UserUpdate) SetIntroducerID

func (uu *UserUpdate) SetIntroducerID(id uint64) *UserUpdate

SetIntroducerID sets the "introducer" edge to the User entity by ID.

func (*UserUpdate) SetIntroducerUserID

func (uu *UserUpdate) SetIntroducerUserID(u uint64) *UserUpdate

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserUpdate) SetLang

func (uu *UserUpdate) SetLang(s string) *UserUpdate

SetLang sets the "lang" field.

func (*UserUpdate) SetLastLoginAt

func (uu *UserUpdate) SetLastLoginAt(t time.Time) *UserUpdate

SetLastLoginAt sets the "last_login_at" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNationalID

func (uu *UserUpdate) SetNationalID(s string) *UserUpdate

SetNationalID sets the "national_id" field.

func (*UserUpdate) SetNewLoginAt

func (uu *UserUpdate) SetNewLoginAt(t time.Time) *UserUpdate

SetNewLoginAt sets the "new_login_at" field.

func (*UserUpdate) SetNillableAvatar

func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdate) SetNillableBanUntil

func (uu *UserUpdate) SetNillableBanUntil(t *time.Time) *UserUpdate

SetNillableBanUntil sets the "ban_until" field if the given value is not nil.

func (*UserUpdate) SetNillableBankAccountName

func (uu *UserUpdate) SetNillableBankAccountName(s *string) *UserUpdate

SetNillableBankAccountName sets the "bank_account_name" field if the given value is not nil.

func (*UserUpdate) SetNillableBankAccountNumber

func (uu *UserUpdate) SetNillableBankAccountNumber(s *string) *UserUpdate

SetNillableBankAccountNumber sets the "bank_account_number" field if the given value is not nil.

func (*UserUpdate) SetNillableBankID

func (uu *UserUpdate) SetNillableBankID(u *uint64) *UserUpdate

SetNillableBankID sets the "bank_id" field if the given value is not nil.

func (*UserUpdate) SetNillableContactCountryID

func (uu *UserUpdate) SetNillableContactCountryID(u *uint64) *UserUpdate

SetNillableContactCountryID sets the "contact_country_id" field if the given value is not nil.

func (*UserUpdate) SetNillableContactNumber

func (uu *UserUpdate) SetNillableContactNumber(s *string) *UserUpdate

SetNillableContactNumber sets the "contact_number" field if the given value is not nil.

func (*UserUpdate) SetNillableCountryID

func (uu *UserUpdate) SetNillableCountryID(u *uint64) *UserUpdate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdate) SetNillableCredit1

func (uu *UserUpdate) SetNillableCredit1(f *float64) *UserUpdate

SetNillableCredit1 sets the "credit_1" field if the given value is not nil.

func (*UserUpdate) SetNillableCredit2

func (uu *UserUpdate) SetNillableCredit2(f *float64) *UserUpdate

SetNillableCredit2 sets the "credit_2" field if the given value is not nil.

func (*UserUpdate) SetNillableCredit3

func (uu *UserUpdate) SetNillableCredit3(f *float64) *UserUpdate

SetNillableCredit3 sets the "credit_3" field if the given value is not nil.

func (*UserUpdate) SetNillableCredit4

func (uu *UserUpdate) SetNillableCredit4(f *float64) *UserUpdate

SetNillableCredit4 sets the "credit_4" field if the given value is not nil.

func (*UserUpdate) SetNillableCredit5

func (uu *UserUpdate) SetNillableCredit5(f *float64) *UserUpdate

SetNillableCredit5 sets the "credit_5" field 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) SetNillableEmailVerifiedAt

func (uu *UserUpdate) SetNillableEmailVerifiedAt(t *time.Time) *UserUpdate

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*UserUpdate) SetNillableFirstLogin

func (uu *UserUpdate) SetNillableFirstLogin(b *bool) *UserUpdate

SetNillableFirstLogin sets the "first_login" field if the given value is not nil.

func (*UserUpdate) SetNillableFullContactNumber

func (uu *UserUpdate) SetNillableFullContactNumber(s *string) *UserUpdate

SetNillableFullContactNumber sets the "full_contact_number" 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 User entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableIntroducerUserID

func (uu *UserUpdate) SetNillableIntroducerUserID(u *uint64) *UserUpdate

SetNillableIntroducerUserID sets the "introducer_user_id" field if the given value is not nil.

func (*UserUpdate) SetNillableLang

func (uu *UserUpdate) SetNillableLang(s *string) *UserUpdate

SetNillableLang sets the "lang" field if the given value is not nil.

func (*UserUpdate) SetNillableLastLoginAt

func (uu *UserUpdate) SetNillableLastLoginAt(t *time.Time) *UserUpdate

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillableNationalID

func (uu *UserUpdate) SetNillableNationalID(s *string) *UserUpdate

SetNillableNationalID sets the "national_id" field if the given value is not nil.

func (*UserUpdate) SetNillableNewLoginAt

func (uu *UserUpdate) SetNillableNewLoginAt(t *time.Time) *UserUpdate

SetNillableNewLoginAt sets the "new_login_at" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword2

func (uu *UserUpdate) SetNillablePassword2(s *string) *UserUpdate

SetNillablePassword2 sets the "password2" field if the given value is not nil.

func (*UserUpdate) SetNillableUnilevel

func (uu *UserUpdate) SetNillableUnilevel(u *uint64) *UserUpdate

SetNillableUnilevel sets the "unilevel" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetPassword2

func (uu *UserUpdate) SetPassword2(s string) *UserUpdate

SetPassword2 sets the "password2" field.

func (*UserUpdate) SetUnilevel

func (uu *UserUpdate) SetUnilevel(u uint64) *UserUpdate

SetUnilevel sets the "unilevel" 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) AddCredit1

func (uuo *UserUpdateOne) AddCredit1(f float64) *UserUpdateOne

AddCredit1 adds f to the "credit_1" field.

func (*UserUpdateOne) AddCredit2

func (uuo *UserUpdateOne) AddCredit2(f float64) *UserUpdateOne

AddCredit2 adds f to the "credit_2" field.

func (*UserUpdateOne) AddCredit3

func (uuo *UserUpdateOne) AddCredit3(f float64) *UserUpdateOne

AddCredit3 adds f to the "credit_3" field.

func (*UserUpdateOne) AddCredit4

func (uuo *UserUpdateOne) AddCredit4(f float64) *UserUpdateOne

AddCredit4 adds f to the "credit_4" field.

func (*UserUpdateOne) AddCredit5

func (uuo *UserUpdateOne) AddCredit5(f float64) *UserUpdateOne

AddCredit5 adds f to the "credit_5" field.

func (*UserUpdateOne) AddIntroducedUserIDs

func (uuo *UserUpdateOne) AddIntroducedUserIDs(ids ...uint64) *UserUpdateOne

AddIntroducedUserIDs adds the "introduced_users" edge to the User entity by IDs.

func (*UserUpdateOne) AddIntroducedUsers

func (uuo *UserUpdateOne) AddIntroducedUsers(u ...*User) *UserUpdateOne

AddIntroducedUsers adds the "introduced_users" edges to the User entity.

func (*UserUpdateOne) AddUnilevel

func (uuo *UserUpdateOne) AddUnilevel(u int64) *UserUpdateOne

AddUnilevel adds u to the "unilevel" field.

func (*UserUpdateOne) ClearAvatar

func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne

ClearAvatar clears the value of the "avatar" field.

func (*UserUpdateOne) ClearBanUntil

func (uuo *UserUpdateOne) ClearBanUntil() *UserUpdateOne

ClearBanUntil clears the value of the "ban_until" field.

func (*UserUpdateOne) ClearBank

func (uuo *UserUpdateOne) ClearBank() *UserUpdateOne

ClearBank clears the "bank" edge to the Bank entity.

func (*UserUpdateOne) ClearBankAccountName

func (uuo *UserUpdateOne) ClearBankAccountName() *UserUpdateOne

ClearBankAccountName clears the value of the "bank_account_name" field.

func (*UserUpdateOne) ClearBankAccountNumber

func (uuo *UserUpdateOne) ClearBankAccountNumber() *UserUpdateOne

ClearBankAccountNumber clears the value of the "bank_account_number" field.

func (*UserUpdateOne) ClearBankID

func (uuo *UserUpdateOne) ClearBankID() *UserUpdateOne

ClearBankID clears the value of the "bank_id" field.

func (*UserUpdateOne) ClearContactCountry

func (uuo *UserUpdateOne) ClearContactCountry() *UserUpdateOne

ClearContactCountry clears the "contact_country" edge to the Country entity.

func (*UserUpdateOne) ClearContactCountryID

func (uuo *UserUpdateOne) ClearContactCountryID() *UserUpdateOne

ClearContactCountryID clears the value of the "contact_country_id" field.

func (*UserUpdateOne) ClearContactNumber

func (uuo *UserUpdateOne) ClearContactNumber() *UserUpdateOne

ClearContactNumber clears the value of the "contact_number" field.

func (*UserUpdateOne) ClearCountry

func (uuo *UserUpdateOne) ClearCountry() *UserUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*UserUpdateOne) ClearCountryID

func (uuo *UserUpdateOne) ClearCountryID() *UserUpdateOne

ClearCountryID clears the value of the "country_id" field.

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) ClearEmailVerifiedAt

func (uuo *UserUpdateOne) ClearEmailVerifiedAt() *UserUpdateOne

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*UserUpdateOne) ClearFullContactNumber

func (uuo *UserUpdateOne) ClearFullContactNumber() *UserUpdateOne

ClearFullContactNumber clears the value of the "full_contact_number" field.

func (*UserUpdateOne) ClearIntroducedUsers

func (uuo *UserUpdateOne) ClearIntroducedUsers() *UserUpdateOne

ClearIntroducedUsers clears all "introduced_users" edges to the User entity.

func (*UserUpdateOne) ClearIntroducer

func (uuo *UserUpdateOne) ClearIntroducer() *UserUpdateOne

ClearIntroducer clears the "introducer" edge to the User entity.

func (*UserUpdateOne) ClearIntroducerUserID

func (uuo *UserUpdateOne) ClearIntroducerUserID() *UserUpdateOne

ClearIntroducerUserID clears the value of the "introducer_user_id" field.

func (*UserUpdateOne) ClearLastLoginAt

func (uuo *UserUpdateOne) ClearLastLoginAt() *UserUpdateOne

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserUpdateOne) ClearName

func (uuo *UserUpdateOne) ClearName() *UserUpdateOne

ClearName clears the value of the "name" field.

func (*UserUpdateOne) ClearNationalID

func (uuo *UserUpdateOne) ClearNationalID() *UserUpdateOne

ClearNationalID clears the value of the "national_id" field.

func (*UserUpdateOne) ClearNewLoginAt

func (uuo *UserUpdateOne) ClearNewLoginAt() *UserUpdateOne

ClearNewLoginAt clears the value of the "new_login_at" field.

func (*UserUpdateOne) ClearUnilevel

func (uuo *UserUpdateOne) ClearUnilevel() *UserUpdateOne

ClearUnilevel clears the value of the "unilevel" field.

func (*UserUpdateOne) ClearUsername

func (uuo *UserUpdateOne) ClearUsername() *UserUpdateOne

ClearUsername clears the value of the "username" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecContext

func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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) QueryContext

func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdateOne) RemoveIntroducedUserIDs

func (uuo *UserUpdateOne) RemoveIntroducedUserIDs(ids ...uint64) *UserUpdateOne

RemoveIntroducedUserIDs removes the "introduced_users" edge to User entities by IDs.

func (*UserUpdateOne) RemoveIntroducedUsers

func (uuo *UserUpdateOne) RemoveIntroducedUsers(u ...*User) *UserUpdateOne

RemoveIntroducedUsers removes "introduced_users" edges to User 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) SetAvatar

func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne

SetAvatar sets the "avatar" field.

func (*UserUpdateOne) SetBanUntil

func (uuo *UserUpdateOne) SetBanUntil(t time.Time) *UserUpdateOne

SetBanUntil sets the "ban_until" field.

func (*UserUpdateOne) SetBank

func (uuo *UserUpdateOne) SetBank(b *Bank) *UserUpdateOne

SetBank sets the "bank" edge to the Bank entity.

func (*UserUpdateOne) SetBankAccountName

func (uuo *UserUpdateOne) SetBankAccountName(s string) *UserUpdateOne

SetBankAccountName sets the "bank_account_name" field.

func (*UserUpdateOne) SetBankAccountNumber

func (uuo *UserUpdateOne) SetBankAccountNumber(s string) *UserUpdateOne

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserUpdateOne) SetBankID

func (uuo *UserUpdateOne) SetBankID(u uint64) *UserUpdateOne

SetBankID sets the "bank_id" field.

func (*UserUpdateOne) SetContactCountry

func (uuo *UserUpdateOne) SetContactCountry(c *Country) *UserUpdateOne

SetContactCountry sets the "contact_country" edge to the Country entity.

func (*UserUpdateOne) SetContactCountryID

func (uuo *UserUpdateOne) SetContactCountryID(u uint64) *UserUpdateOne

SetContactCountryID sets the "contact_country_id" field.

func (*UserUpdateOne) SetContactNumber

func (uuo *UserUpdateOne) SetContactNumber(s string) *UserUpdateOne

SetContactNumber sets the "contact_number" field.

func (*UserUpdateOne) SetCountry

func (uuo *UserUpdateOne) SetCountry(c *Country) *UserUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*UserUpdateOne) SetCountryID

func (uuo *UserUpdateOne) SetCountryID(u uint64) *UserUpdateOne

SetCountryID sets the "country_id" field.

func (*UserUpdateOne) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetCredit1

func (uuo *UserUpdateOne) SetCredit1(f float64) *UserUpdateOne

SetCredit1 sets the "credit_1" field.

func (*UserUpdateOne) SetCredit2

func (uuo *UserUpdateOne) SetCredit2(f float64) *UserUpdateOne

SetCredit2 sets the "credit_2" field.

func (*UserUpdateOne) SetCredit3

func (uuo *UserUpdateOne) SetCredit3(f float64) *UserUpdateOne

SetCredit3 sets the "credit_3" field.

func (*UserUpdateOne) SetCredit4

func (uuo *UserUpdateOne) SetCredit4(f float64) *UserUpdateOne

SetCredit4 sets the "credit_4" field.

func (*UserUpdateOne) SetCredit5

func (uuo *UserUpdateOne) SetCredit5(f float64) *UserUpdateOne

SetCredit5 sets the "credit_5" field.

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) SetEmailVerifiedAt

func (uuo *UserUpdateOne) SetEmailVerifiedAt(t time.Time) *UserUpdateOne

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserUpdateOne) SetFirstLogin

func (uuo *UserUpdateOne) SetFirstLogin(b bool) *UserUpdateOne

SetFirstLogin sets the "first_login" field.

func (*UserUpdateOne) SetFullContactNumber

func (uuo *UserUpdateOne) SetFullContactNumber(s string) *UserUpdateOne

SetFullContactNumber sets the "full_contact_number" field.

func (*UserUpdateOne) SetIntroducer

func (uuo *UserUpdateOne) SetIntroducer(u *User) *UserUpdateOne

SetIntroducer sets the "introducer" edge to the User entity.

func (*UserUpdateOne) SetIntroducerID

func (uuo *UserUpdateOne) SetIntroducerID(id uint64) *UserUpdateOne

SetIntroducerID sets the "introducer" edge to the User entity by ID.

func (*UserUpdateOne) SetIntroducerUserID

func (uuo *UserUpdateOne) SetIntroducerUserID(u uint64) *UserUpdateOne

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserUpdateOne) SetLang

func (uuo *UserUpdateOne) SetLang(s string) *UserUpdateOne

SetLang sets the "lang" field.

func (*UserUpdateOne) SetLastLoginAt

func (uuo *UserUpdateOne) SetLastLoginAt(t time.Time) *UserUpdateOne

SetLastLoginAt sets the "last_login_at" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNationalID

func (uuo *UserUpdateOne) SetNationalID(s string) *UserUpdateOne

SetNationalID sets the "national_id" field.

func (*UserUpdateOne) SetNewLoginAt

func (uuo *UserUpdateOne) SetNewLoginAt(t time.Time) *UserUpdateOne

SetNewLoginAt sets the "new_login_at" field.

func (*UserUpdateOne) SetNillableAvatar

func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBanUntil

func (uuo *UserUpdateOne) SetNillableBanUntil(t *time.Time) *UserUpdateOne

SetNillableBanUntil sets the "ban_until" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBankAccountName

func (uuo *UserUpdateOne) SetNillableBankAccountName(s *string) *UserUpdateOne

SetNillableBankAccountName sets the "bank_account_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBankAccountNumber

func (uuo *UserUpdateOne) SetNillableBankAccountNumber(s *string) *UserUpdateOne

SetNillableBankAccountNumber sets the "bank_account_number" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBankID

func (uuo *UserUpdateOne) SetNillableBankID(u *uint64) *UserUpdateOne

SetNillableBankID sets the "bank_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableContactCountryID

func (uuo *UserUpdateOne) SetNillableContactCountryID(u *uint64) *UserUpdateOne

SetNillableContactCountryID sets the "contact_country_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableContactNumber

func (uuo *UserUpdateOne) SetNillableContactNumber(s *string) *UserUpdateOne

SetNillableContactNumber sets the "contact_number" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCountryID

func (uuo *UserUpdateOne) SetNillableCountryID(u *uint64) *UserUpdateOne

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCredit1

func (uuo *UserUpdateOne) SetNillableCredit1(f *float64) *UserUpdateOne

SetNillableCredit1 sets the "credit_1" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCredit2

func (uuo *UserUpdateOne) SetNillableCredit2(f *float64) *UserUpdateOne

SetNillableCredit2 sets the "credit_2" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCredit3

func (uuo *UserUpdateOne) SetNillableCredit3(f *float64) *UserUpdateOne

SetNillableCredit3 sets the "credit_3" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCredit4

func (uuo *UserUpdateOne) SetNillableCredit4(f *float64) *UserUpdateOne

SetNillableCredit4 sets the "credit_4" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCredit5

func (uuo *UserUpdateOne) SetNillableCredit5(f *float64) *UserUpdateOne

SetNillableCredit5 sets the "credit_5" field 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) SetNillableEmailVerifiedAt

func (uuo *UserUpdateOne) SetNillableEmailVerifiedAt(t *time.Time) *UserUpdateOne

SetNillableEmailVerifiedAt sets the "email_verified_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFirstLogin

func (uuo *UserUpdateOne) SetNillableFirstLogin(b *bool) *UserUpdateOne

SetNillableFirstLogin sets the "first_login" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFullContactNumber

func (uuo *UserUpdateOne) SetNillableFullContactNumber(s *string) *UserUpdateOne

SetNillableFullContactNumber sets the "full_contact_number" 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 User entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableIntroducerUserID

func (uuo *UserUpdateOne) SetNillableIntroducerUserID(u *uint64) *UserUpdateOne

SetNillableIntroducerUserID sets the "introducer_user_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLang

func (uuo *UserUpdateOne) SetNillableLang(s *string) *UserUpdateOne

SetNillableLang sets the "lang" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastLoginAt

func (uuo *UserUpdateOne) SetNillableLastLoginAt(t *time.Time) *UserUpdateOne

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNationalID

func (uuo *UserUpdateOne) SetNillableNationalID(s *string) *UserUpdateOne

SetNillableNationalID sets the "national_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNewLoginAt

func (uuo *UserUpdateOne) SetNillableNewLoginAt(t *time.Time) *UserUpdateOne

SetNillableNewLoginAt sets the "new_login_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword2

func (uuo *UserUpdateOne) SetNillablePassword2(s *string) *UserUpdateOne

SetNillablePassword2 sets the "password2" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUnilevel

func (uuo *UserUpdateOne) SetNillableUnilevel(u *uint64) *UserUpdateOne

SetNillableUnilevel sets the "unilevel" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetPassword2

func (uuo *UserUpdateOne) SetPassword2(s string) *UserUpdateOne

SetPassword2 sets the "password2" field.

func (*UserUpdateOne) SetUnilevel

func (uuo *UserUpdateOne) SetUnilevel(u uint64) *UserUpdateOne

SetUnilevel sets the "unilevel" 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 UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) AddCredit1

func (u *UserUpsert) AddCredit1(v float64) *UserUpsert

AddCredit1 adds v to the "credit_1" field.

func (*UserUpsert) AddCredit2

func (u *UserUpsert) AddCredit2(v float64) *UserUpsert

AddCredit2 adds v to the "credit_2" field.

func (*UserUpsert) AddCredit3

func (u *UserUpsert) AddCredit3(v float64) *UserUpsert

AddCredit3 adds v to the "credit_3" field.

func (*UserUpsert) AddCredit4

func (u *UserUpsert) AddCredit4(v float64) *UserUpsert

AddCredit4 adds v to the "credit_4" field.

func (*UserUpsert) AddCredit5

func (u *UserUpsert) AddCredit5(v float64) *UserUpsert

AddCredit5 adds v to the "credit_5" field.

func (*UserUpsert) AddUnilevel

func (u *UserUpsert) AddUnilevel(v uint64) *UserUpsert

AddUnilevel adds v to the "unilevel" field.

func (*UserUpsert) ClearAvatar

func (u *UserUpsert) ClearAvatar() *UserUpsert

ClearAvatar clears the value of the "avatar" field.

func (*UserUpsert) ClearBanUntil

func (u *UserUpsert) ClearBanUntil() *UserUpsert

ClearBanUntil clears the value of the "ban_until" field.

func (*UserUpsert) ClearBankAccountName

func (u *UserUpsert) ClearBankAccountName() *UserUpsert

ClearBankAccountName clears the value of the "bank_account_name" field.

func (*UserUpsert) ClearBankAccountNumber

func (u *UserUpsert) ClearBankAccountNumber() *UserUpsert

ClearBankAccountNumber clears the value of the "bank_account_number" field.

func (*UserUpsert) ClearBankID

func (u *UserUpsert) ClearBankID() *UserUpsert

ClearBankID clears the value of the "bank_id" field.

func (*UserUpsert) ClearContactCountryID

func (u *UserUpsert) ClearContactCountryID() *UserUpsert

ClearContactCountryID clears the value of the "contact_country_id" field.

func (*UserUpsert) ClearContactNumber

func (u *UserUpsert) ClearContactNumber() *UserUpsert

ClearContactNumber clears the value of the "contact_number" field.

func (*UserUpsert) ClearCountryID

func (u *UserUpsert) ClearCountryID() *UserUpsert

ClearCountryID clears the value of the "country_id" field.

func (*UserUpsert) ClearDeletedAt

func (u *UserUpsert) ClearDeletedAt() *UserUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsert) ClearEmail

func (u *UserUpsert) ClearEmail() *UserUpsert

ClearEmail clears the value of the "email" field.

func (*UserUpsert) ClearEmailVerifiedAt

func (u *UserUpsert) ClearEmailVerifiedAt() *UserUpsert

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*UserUpsert) ClearFullContactNumber

func (u *UserUpsert) ClearFullContactNumber() *UserUpsert

ClearFullContactNumber clears the value of the "full_contact_number" field.

func (*UserUpsert) ClearIntroducerUserID

func (u *UserUpsert) ClearIntroducerUserID() *UserUpsert

ClearIntroducerUserID clears the value of the "introducer_user_id" field.

func (*UserUpsert) ClearLastLoginAt

func (u *UserUpsert) ClearLastLoginAt() *UserUpsert

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserUpsert) ClearName

func (u *UserUpsert) ClearName() *UserUpsert

ClearName clears the value of the "name" field.

func (*UserUpsert) ClearNationalID

func (u *UserUpsert) ClearNationalID() *UserUpsert

ClearNationalID clears the value of the "national_id" field.

func (*UserUpsert) ClearNewLoginAt

func (u *UserUpsert) ClearNewLoginAt() *UserUpsert

ClearNewLoginAt clears the value of the "new_login_at" field.

func (*UserUpsert) ClearUnilevel

func (u *UserUpsert) ClearUnilevel() *UserUpsert

ClearUnilevel clears the value of the "unilevel" field.

func (*UserUpsert) ClearUsername

func (u *UserUpsert) ClearUsername() *UserUpsert

ClearUsername clears the value of the "username" field.

func (*UserUpsert) SetAvatar

func (u *UserUpsert) SetAvatar(v string) *UserUpsert

SetAvatar sets the "avatar" field.

func (*UserUpsert) SetBanUntil

func (u *UserUpsert) SetBanUntil(v time.Time) *UserUpsert

SetBanUntil sets the "ban_until" field.

func (*UserUpsert) SetBankAccountName

func (u *UserUpsert) SetBankAccountName(v string) *UserUpsert

SetBankAccountName sets the "bank_account_name" field.

func (*UserUpsert) SetBankAccountNumber

func (u *UserUpsert) SetBankAccountNumber(v string) *UserUpsert

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserUpsert) SetBankID

func (u *UserUpsert) SetBankID(v uint64) *UserUpsert

SetBankID sets the "bank_id" field.

func (*UserUpsert) SetContactCountryID

func (u *UserUpsert) SetContactCountryID(v uint64) *UserUpsert

SetContactCountryID sets the "contact_country_id" field.

func (*UserUpsert) SetContactNumber

func (u *UserUpsert) SetContactNumber(v string) *UserUpsert

SetContactNumber sets the "contact_number" field.

func (*UserUpsert) SetCountryID

func (u *UserUpsert) SetCountryID(v uint64) *UserUpsert

SetCountryID sets the "country_id" field.

func (*UserUpsert) SetCreatedAt

func (u *UserUpsert) SetCreatedAt(v time.Time) *UserUpsert

SetCreatedAt sets the "created_at" field.

func (*UserUpsert) SetCredit1

func (u *UserUpsert) SetCredit1(v float64) *UserUpsert

SetCredit1 sets the "credit_1" field.

func (*UserUpsert) SetCredit2

func (u *UserUpsert) SetCredit2(v float64) *UserUpsert

SetCredit2 sets the "credit_2" field.

func (*UserUpsert) SetCredit3

func (u *UserUpsert) SetCredit3(v float64) *UserUpsert

SetCredit3 sets the "credit_3" field.

func (*UserUpsert) SetCredit4

func (u *UserUpsert) SetCredit4(v float64) *UserUpsert

SetCredit4 sets the "credit_4" field.

func (*UserUpsert) SetCredit5

func (u *UserUpsert) SetCredit5(v float64) *UserUpsert

SetCredit5 sets the "credit_5" field.

func (*UserUpsert) SetDeletedAt

func (u *UserUpsert) SetDeletedAt(v time.Time) *UserUpsert

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetEmailVerifiedAt

func (u *UserUpsert) SetEmailVerifiedAt(v time.Time) *UserUpsert

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserUpsert) SetFirstLogin

func (u *UserUpsert) SetFirstLogin(v bool) *UserUpsert

SetFirstLogin sets the "first_login" field.

func (*UserUpsert) SetFullContactNumber

func (u *UserUpsert) SetFullContactNumber(v string) *UserUpsert

SetFullContactNumber sets the "full_contact_number" field.

func (*UserUpsert) SetIntroducerUserID

func (u *UserUpsert) SetIntroducerUserID(v uint64) *UserUpsert

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserUpsert) SetLang

func (u *UserUpsert) SetLang(v string) *UserUpsert

SetLang sets the "lang" field.

func (*UserUpsert) SetLastLoginAt

func (u *UserUpsert) SetLastLoginAt(v time.Time) *UserUpsert

SetLastLoginAt sets the "last_login_at" field.

func (*UserUpsert) SetName

func (u *UserUpsert) SetName(v string) *UserUpsert

SetName sets the "name" field.

func (*UserUpsert) SetNationalID

func (u *UserUpsert) SetNationalID(v string) *UserUpsert

SetNationalID sets the "national_id" field.

func (*UserUpsert) SetNewLoginAt

func (u *UserUpsert) SetNewLoginAt(v time.Time) *UserUpsert

SetNewLoginAt sets the "new_login_at" field.

func (*UserUpsert) SetPassword

func (u *UserUpsert) SetPassword(v string) *UserUpsert

SetPassword sets the "password" field.

func (*UserUpsert) SetPassword2

func (u *UserUpsert) SetPassword2(v string) *UserUpsert

SetPassword2 sets the "password2" field.

func (*UserUpsert) SetUnilevel

func (u *UserUpsert) SetUnilevel(v uint64) *UserUpsert

SetUnilevel sets the "unilevel" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) SetUsername

func (u *UserUpsert) SetUsername(v string) *UserUpsert

SetUsername sets the "username" field.

func (*UserUpsert) UpdateAvatar

func (u *UserUpsert) UpdateAvatar() *UserUpsert

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*UserUpsert) UpdateBanUntil

func (u *UserUpsert) UpdateBanUntil() *UserUpsert

UpdateBanUntil sets the "ban_until" field to the value that was provided on create.

func (*UserUpsert) UpdateBankAccountName

func (u *UserUpsert) UpdateBankAccountName() *UserUpsert

UpdateBankAccountName sets the "bank_account_name" field to the value that was provided on create.

func (*UserUpsert) UpdateBankAccountNumber

func (u *UserUpsert) UpdateBankAccountNumber() *UserUpsert

UpdateBankAccountNumber sets the "bank_account_number" field to the value that was provided on create.

func (*UserUpsert) UpdateBankID

func (u *UserUpsert) UpdateBankID() *UserUpsert

UpdateBankID sets the "bank_id" field to the value that was provided on create.

func (*UserUpsert) UpdateContactCountryID

func (u *UserUpsert) UpdateContactCountryID() *UserUpsert

UpdateContactCountryID sets the "contact_country_id" field to the value that was provided on create.

func (*UserUpsert) UpdateContactNumber

func (u *UserUpsert) UpdateContactNumber() *UserUpsert

UpdateContactNumber sets the "contact_number" field to the value that was provided on create.

func (*UserUpsert) UpdateCountryID

func (u *UserUpsert) UpdateCountryID() *UserUpsert

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*UserUpsert) UpdateCreatedAt

func (u *UserUpsert) UpdateCreatedAt() *UserUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsert) UpdateCredit1

func (u *UserUpsert) UpdateCredit1() *UserUpsert

UpdateCredit1 sets the "credit_1" field to the value that was provided on create.

func (*UserUpsert) UpdateCredit2

func (u *UserUpsert) UpdateCredit2() *UserUpsert

UpdateCredit2 sets the "credit_2" field to the value that was provided on create.

func (*UserUpsert) UpdateCredit3

func (u *UserUpsert) UpdateCredit3() *UserUpsert

UpdateCredit3 sets the "credit_3" field to the value that was provided on create.

func (*UserUpsert) UpdateCredit4

func (u *UserUpsert) UpdateCredit4() *UserUpsert

UpdateCredit4 sets the "credit_4" field to the value that was provided on create.

func (*UserUpsert) UpdateCredit5

func (u *UserUpsert) UpdateCredit5() *UserUpsert

UpdateCredit5 sets the "credit_5" field to the value that was provided on create.

func (*UserUpsert) UpdateDeletedAt

func (u *UserUpsert) UpdateDeletedAt() *UserUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdateEmailVerifiedAt

func (u *UserUpsert) UpdateEmailVerifiedAt() *UserUpsert

UpdateEmailVerifiedAt sets the "email_verified_at" field to the value that was provided on create.

func (*UserUpsert) UpdateFirstLogin

func (u *UserUpsert) UpdateFirstLogin() *UserUpsert

UpdateFirstLogin sets the "first_login" field to the value that was provided on create.

func (*UserUpsert) UpdateFullContactNumber

func (u *UserUpsert) UpdateFullContactNumber() *UserUpsert

UpdateFullContactNumber sets the "full_contact_number" field to the value that was provided on create.

func (*UserUpsert) UpdateIntroducerUserID

func (u *UserUpsert) UpdateIntroducerUserID() *UserUpsert

UpdateIntroducerUserID sets the "introducer_user_id" field to the value that was provided on create.

func (*UserUpsert) UpdateLang

func (u *UserUpsert) UpdateLang() *UserUpsert

UpdateLang sets the "lang" field to the value that was provided on create.

func (*UserUpsert) UpdateLastLoginAt

func (u *UserUpsert) UpdateLastLoginAt() *UserUpsert

UpdateLastLoginAt sets the "last_login_at" field to the value that was provided on create.

func (*UserUpsert) UpdateName

func (u *UserUpsert) UpdateName() *UserUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsert) UpdateNationalID

func (u *UserUpsert) UpdateNationalID() *UserUpsert

UpdateNationalID sets the "national_id" field to the value that was provided on create.

func (*UserUpsert) UpdateNewLoginAt

func (u *UserUpsert) UpdateNewLoginAt() *UserUpsert

UpdateNewLoginAt sets the "new_login_at" field to the value that was provided on create.

func (*UserUpsert) UpdatePassword

func (u *UserUpsert) UpdatePassword() *UserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsert) UpdatePassword2

func (u *UserUpsert) UpdatePassword2() *UserUpsert

UpdatePassword2 sets the "password2" field to the value that was provided on create.

func (*UserUpsert) UpdateUnilevel

func (u *UserUpsert) UpdateUnilevel() *UserUpsert

UpdateUnilevel sets the "unilevel" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsert) UpdateUsername

func (u *UserUpsert) UpdateUsername() *UserUpsert

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) AddCredit1

func (u *UserUpsertBulk) AddCredit1(v float64) *UserUpsertBulk

AddCredit1 adds v to the "credit_1" field.

func (*UserUpsertBulk) AddCredit2

func (u *UserUpsertBulk) AddCredit2(v float64) *UserUpsertBulk

AddCredit2 adds v to the "credit_2" field.

func (*UserUpsertBulk) AddCredit3

func (u *UserUpsertBulk) AddCredit3(v float64) *UserUpsertBulk

AddCredit3 adds v to the "credit_3" field.

func (*UserUpsertBulk) AddCredit4

func (u *UserUpsertBulk) AddCredit4(v float64) *UserUpsertBulk

AddCredit4 adds v to the "credit_4" field.

func (*UserUpsertBulk) AddCredit5

func (u *UserUpsertBulk) AddCredit5(v float64) *UserUpsertBulk

AddCredit5 adds v to the "credit_5" field.

func (*UserUpsertBulk) AddUnilevel

func (u *UserUpsertBulk) AddUnilevel(v uint64) *UserUpsertBulk

AddUnilevel adds v to the "unilevel" field.

func (*UserUpsertBulk) ClearAvatar

func (u *UserUpsertBulk) ClearAvatar() *UserUpsertBulk

ClearAvatar clears the value of the "avatar" field.

func (*UserUpsertBulk) ClearBanUntil

func (u *UserUpsertBulk) ClearBanUntil() *UserUpsertBulk

ClearBanUntil clears the value of the "ban_until" field.

func (*UserUpsertBulk) ClearBankAccountName

func (u *UserUpsertBulk) ClearBankAccountName() *UserUpsertBulk

ClearBankAccountName clears the value of the "bank_account_name" field.

func (*UserUpsertBulk) ClearBankAccountNumber

func (u *UserUpsertBulk) ClearBankAccountNumber() *UserUpsertBulk

ClearBankAccountNumber clears the value of the "bank_account_number" field.

func (*UserUpsertBulk) ClearBankID

func (u *UserUpsertBulk) ClearBankID() *UserUpsertBulk

ClearBankID clears the value of the "bank_id" field.

func (*UserUpsertBulk) ClearContactCountryID

func (u *UserUpsertBulk) ClearContactCountryID() *UserUpsertBulk

ClearContactCountryID clears the value of the "contact_country_id" field.

func (*UserUpsertBulk) ClearContactNumber

func (u *UserUpsertBulk) ClearContactNumber() *UserUpsertBulk

ClearContactNumber clears the value of the "contact_number" field.

func (*UserUpsertBulk) ClearCountryID

func (u *UserUpsertBulk) ClearCountryID() *UserUpsertBulk

ClearCountryID clears the value of the "country_id" field.

func (*UserUpsertBulk) ClearDeletedAt

func (u *UserUpsertBulk) ClearDeletedAt() *UserUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsertBulk) ClearEmail

func (u *UserUpsertBulk) ClearEmail() *UserUpsertBulk

ClearEmail clears the value of the "email" field.

func (*UserUpsertBulk) ClearEmailVerifiedAt

func (u *UserUpsertBulk) ClearEmailVerifiedAt() *UserUpsertBulk

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*UserUpsertBulk) ClearFullContactNumber

func (u *UserUpsertBulk) ClearFullContactNumber() *UserUpsertBulk

ClearFullContactNumber clears the value of the "full_contact_number" field.

func (*UserUpsertBulk) ClearIntroducerUserID

func (u *UserUpsertBulk) ClearIntroducerUserID() *UserUpsertBulk

ClearIntroducerUserID clears the value of the "introducer_user_id" field.

func (*UserUpsertBulk) ClearLastLoginAt

func (u *UserUpsertBulk) ClearLastLoginAt() *UserUpsertBulk

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserUpsertBulk) ClearName

func (u *UserUpsertBulk) ClearName() *UserUpsertBulk

ClearName clears the value of the "name" field.

func (*UserUpsertBulk) ClearNationalID

func (u *UserUpsertBulk) ClearNationalID() *UserUpsertBulk

ClearNationalID clears the value of the "national_id" field.

func (*UserUpsertBulk) ClearNewLoginAt

func (u *UserUpsertBulk) ClearNewLoginAt() *UserUpsertBulk

ClearNewLoginAt clears the value of the "new_login_at" field.

func (*UserUpsertBulk) ClearUnilevel

func (u *UserUpsertBulk) ClearUnilevel() *UserUpsertBulk

ClearUnilevel clears the value of the "unilevel" field.

func (*UserUpsertBulk) ClearUsername

func (u *UserUpsertBulk) ClearUsername() *UserUpsertBulk

ClearUsername clears the value of the "username" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetAvatar

func (u *UserUpsertBulk) SetAvatar(v string) *UserUpsertBulk

SetAvatar sets the "avatar" field.

func (*UserUpsertBulk) SetBanUntil

func (u *UserUpsertBulk) SetBanUntil(v time.Time) *UserUpsertBulk

SetBanUntil sets the "ban_until" field.

func (*UserUpsertBulk) SetBankAccountName

func (u *UserUpsertBulk) SetBankAccountName(v string) *UserUpsertBulk

SetBankAccountName sets the "bank_account_name" field.

func (*UserUpsertBulk) SetBankAccountNumber

func (u *UserUpsertBulk) SetBankAccountNumber(v string) *UserUpsertBulk

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserUpsertBulk) SetBankID

func (u *UserUpsertBulk) SetBankID(v uint64) *UserUpsertBulk

SetBankID sets the "bank_id" field.

func (*UserUpsertBulk) SetContactCountryID

func (u *UserUpsertBulk) SetContactCountryID(v uint64) *UserUpsertBulk

SetContactCountryID sets the "contact_country_id" field.

func (*UserUpsertBulk) SetContactNumber

func (u *UserUpsertBulk) SetContactNumber(v string) *UserUpsertBulk

SetContactNumber sets the "contact_number" field.

func (*UserUpsertBulk) SetCountryID

func (u *UserUpsertBulk) SetCountryID(v uint64) *UserUpsertBulk

SetCountryID sets the "country_id" field.

func (*UserUpsertBulk) SetCreatedAt

func (u *UserUpsertBulk) SetCreatedAt(v time.Time) *UserUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*UserUpsertBulk) SetCredit1

func (u *UserUpsertBulk) SetCredit1(v float64) *UserUpsertBulk

SetCredit1 sets the "credit_1" field.

func (*UserUpsertBulk) SetCredit2

func (u *UserUpsertBulk) SetCredit2(v float64) *UserUpsertBulk

SetCredit2 sets the "credit_2" field.

func (*UserUpsertBulk) SetCredit3

func (u *UserUpsertBulk) SetCredit3(v float64) *UserUpsertBulk

SetCredit3 sets the "credit_3" field.

func (*UserUpsertBulk) SetCredit4

func (u *UserUpsertBulk) SetCredit4(v float64) *UserUpsertBulk

SetCredit4 sets the "credit_4" field.

func (*UserUpsertBulk) SetCredit5

func (u *UserUpsertBulk) SetCredit5(v float64) *UserUpsertBulk

SetCredit5 sets the "credit_5" field.

func (*UserUpsertBulk) SetDeletedAt

func (u *UserUpsertBulk) SetDeletedAt(v time.Time) *UserUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsertBulk) SetEmail

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetEmailVerifiedAt

func (u *UserUpsertBulk) SetEmailVerifiedAt(v time.Time) *UserUpsertBulk

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserUpsertBulk) SetFirstLogin

func (u *UserUpsertBulk) SetFirstLogin(v bool) *UserUpsertBulk

SetFirstLogin sets the "first_login" field.

func (*UserUpsertBulk) SetFullContactNumber

func (u *UserUpsertBulk) SetFullContactNumber(v string) *UserUpsertBulk

SetFullContactNumber sets the "full_contact_number" field.

func (*UserUpsertBulk) SetIntroducerUserID

func (u *UserUpsertBulk) SetIntroducerUserID(v uint64) *UserUpsertBulk

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserUpsertBulk) SetLang

func (u *UserUpsertBulk) SetLang(v string) *UserUpsertBulk

SetLang sets the "lang" field.

func (*UserUpsertBulk) SetLastLoginAt

func (u *UserUpsertBulk) SetLastLoginAt(v time.Time) *UserUpsertBulk

SetLastLoginAt sets the "last_login_at" field.

func (*UserUpsertBulk) SetName

func (u *UserUpsertBulk) SetName(v string) *UserUpsertBulk

SetName sets the "name" field.

func (*UserUpsertBulk) SetNationalID

func (u *UserUpsertBulk) SetNationalID(v string) *UserUpsertBulk

SetNationalID sets the "national_id" field.

func (*UserUpsertBulk) SetNewLoginAt

func (u *UserUpsertBulk) SetNewLoginAt(v time.Time) *UserUpsertBulk

SetNewLoginAt sets the "new_login_at" field.

func (*UserUpsertBulk) SetPassword

func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk

SetPassword sets the "password" field.

func (*UserUpsertBulk) SetPassword2

func (u *UserUpsertBulk) SetPassword2(v string) *UserUpsertBulk

SetPassword2 sets the "password2" field.

func (*UserUpsertBulk) SetUnilevel

func (u *UserUpsertBulk) SetUnilevel(v uint64) *UserUpsertBulk

SetUnilevel sets the "unilevel" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) SetUsername

func (u *UserUpsertBulk) SetUsername(v string) *UserUpsertBulk

SetUsername sets the "username" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateAvatar

func (u *UserUpsertBulk) UpdateAvatar() *UserUpsertBulk

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateBanUntil

func (u *UserUpsertBulk) UpdateBanUntil() *UserUpsertBulk

UpdateBanUntil sets the "ban_until" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateBankAccountName

func (u *UserUpsertBulk) UpdateBankAccountName() *UserUpsertBulk

UpdateBankAccountName sets the "bank_account_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateBankAccountNumber

func (u *UserUpsertBulk) UpdateBankAccountNumber() *UserUpsertBulk

UpdateBankAccountNumber sets the "bank_account_number" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateBankID

func (u *UserUpsertBulk) UpdateBankID() *UserUpsertBulk

UpdateBankID sets the "bank_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateContactCountryID

func (u *UserUpsertBulk) UpdateContactCountryID() *UserUpsertBulk

UpdateContactCountryID sets the "contact_country_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateContactNumber

func (u *UserUpsertBulk) UpdateContactNumber() *UserUpsertBulk

UpdateContactNumber sets the "contact_number" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCountryID

func (u *UserUpsertBulk) UpdateCountryID() *UserUpsertBulk

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCreatedAt

func (u *UserUpsertBulk) UpdateCreatedAt() *UserUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCredit1

func (u *UserUpsertBulk) UpdateCredit1() *UserUpsertBulk

UpdateCredit1 sets the "credit_1" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCredit2

func (u *UserUpsertBulk) UpdateCredit2() *UserUpsertBulk

UpdateCredit2 sets the "credit_2" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCredit3

func (u *UserUpsertBulk) UpdateCredit3() *UserUpsertBulk

UpdateCredit3 sets the "credit_3" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCredit4

func (u *UserUpsertBulk) UpdateCredit4() *UserUpsertBulk

UpdateCredit4 sets the "credit_4" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateCredit5

func (u *UserUpsertBulk) UpdateCredit5() *UserUpsertBulk

UpdateCredit5 sets the "credit_5" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateDeletedAt

func (u *UserUpsertBulk) UpdateDeletedAt() *UserUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateEmailVerifiedAt

func (u *UserUpsertBulk) UpdateEmailVerifiedAt() *UserUpsertBulk

UpdateEmailVerifiedAt sets the "email_verified_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFirstLogin

func (u *UserUpsertBulk) UpdateFirstLogin() *UserUpsertBulk

UpdateFirstLogin sets the "first_login" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFullContactNumber

func (u *UserUpsertBulk) UpdateFullContactNumber() *UserUpsertBulk

UpdateFullContactNumber sets the "full_contact_number" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIntroducerUserID

func (u *UserUpsertBulk) UpdateIntroducerUserID() *UserUpsertBulk

UpdateIntroducerUserID sets the "introducer_user_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateLang

func (u *UserUpsertBulk) UpdateLang() *UserUpsertBulk

UpdateLang sets the "lang" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateLastLoginAt

func (u *UserUpsertBulk) UpdateLastLoginAt() *UserUpsertBulk

UpdateLastLoginAt sets the "last_login_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateName

func (u *UserUpsertBulk) UpdateName() *UserUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNationalID

func (u *UserUpsertBulk) UpdateNationalID() *UserUpsertBulk

UpdateNationalID sets the "national_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewLoginAt

func (u *UserUpsertBulk) UpdateNewLoginAt() *UserUpsertBulk

UpdateNewLoginAt sets the "new_login_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdatePassword

func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePassword2

func (u *UserUpsertBulk) UpdatePassword2() *UserUpsertBulk

UpdatePassword2 sets the "password2" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUnilevel

func (u *UserUpsertBulk) UpdateUnilevel() *UserUpsertBulk

UpdateUnilevel sets the "unilevel" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUsername

func (u *UserUpsertBulk) UpdateUsername() *UserUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) AddCredit1

func (u *UserUpsertOne) AddCredit1(v float64) *UserUpsertOne

AddCredit1 adds v to the "credit_1" field.

func (*UserUpsertOne) AddCredit2

func (u *UserUpsertOne) AddCredit2(v float64) *UserUpsertOne

AddCredit2 adds v to the "credit_2" field.

func (*UserUpsertOne) AddCredit3

func (u *UserUpsertOne) AddCredit3(v float64) *UserUpsertOne

AddCredit3 adds v to the "credit_3" field.

func (*UserUpsertOne) AddCredit4

func (u *UserUpsertOne) AddCredit4(v float64) *UserUpsertOne

AddCredit4 adds v to the "credit_4" field.

func (*UserUpsertOne) AddCredit5

func (u *UserUpsertOne) AddCredit5(v float64) *UserUpsertOne

AddCredit5 adds v to the "credit_5" field.

func (*UserUpsertOne) AddUnilevel

func (u *UserUpsertOne) AddUnilevel(v uint64) *UserUpsertOne

AddUnilevel adds v to the "unilevel" field.

func (*UserUpsertOne) ClearAvatar

func (u *UserUpsertOne) ClearAvatar() *UserUpsertOne

ClearAvatar clears the value of the "avatar" field.

func (*UserUpsertOne) ClearBanUntil

func (u *UserUpsertOne) ClearBanUntil() *UserUpsertOne

ClearBanUntil clears the value of the "ban_until" field.

func (*UserUpsertOne) ClearBankAccountName

func (u *UserUpsertOne) ClearBankAccountName() *UserUpsertOne

ClearBankAccountName clears the value of the "bank_account_name" field.

func (*UserUpsertOne) ClearBankAccountNumber

func (u *UserUpsertOne) ClearBankAccountNumber() *UserUpsertOne

ClearBankAccountNumber clears the value of the "bank_account_number" field.

func (*UserUpsertOne) ClearBankID

func (u *UserUpsertOne) ClearBankID() *UserUpsertOne

ClearBankID clears the value of the "bank_id" field.

func (*UserUpsertOne) ClearContactCountryID

func (u *UserUpsertOne) ClearContactCountryID() *UserUpsertOne

ClearContactCountryID clears the value of the "contact_country_id" field.

func (*UserUpsertOne) ClearContactNumber

func (u *UserUpsertOne) ClearContactNumber() *UserUpsertOne

ClearContactNumber clears the value of the "contact_number" field.

func (*UserUpsertOne) ClearCountryID

func (u *UserUpsertOne) ClearCountryID() *UserUpsertOne

ClearCountryID clears the value of the "country_id" field.

func (*UserUpsertOne) ClearDeletedAt

func (u *UserUpsertOne) ClearDeletedAt() *UserUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsertOne) ClearEmail

func (u *UserUpsertOne) ClearEmail() *UserUpsertOne

ClearEmail clears the value of the "email" field.

func (*UserUpsertOne) ClearEmailVerifiedAt

func (u *UserUpsertOne) ClearEmailVerifiedAt() *UserUpsertOne

ClearEmailVerifiedAt clears the value of the "email_verified_at" field.

func (*UserUpsertOne) ClearFullContactNumber

func (u *UserUpsertOne) ClearFullContactNumber() *UserUpsertOne

ClearFullContactNumber clears the value of the "full_contact_number" field.

func (*UserUpsertOne) ClearIntroducerUserID

func (u *UserUpsertOne) ClearIntroducerUserID() *UserUpsertOne

ClearIntroducerUserID clears the value of the "introducer_user_id" field.

func (*UserUpsertOne) ClearLastLoginAt

func (u *UserUpsertOne) ClearLastLoginAt() *UserUpsertOne

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserUpsertOne) ClearName

func (u *UserUpsertOne) ClearName() *UserUpsertOne

ClearName clears the value of the "name" field.

func (*UserUpsertOne) ClearNationalID

func (u *UserUpsertOne) ClearNationalID() *UserUpsertOne

ClearNationalID clears the value of the "national_id" field.

func (*UserUpsertOne) ClearNewLoginAt

func (u *UserUpsertOne) ClearNewLoginAt() *UserUpsertOne

ClearNewLoginAt clears the value of the "new_login_at" field.

func (*UserUpsertOne) ClearUnilevel

func (u *UserUpsertOne) ClearUnilevel() *UserUpsertOne

ClearUnilevel clears the value of the "unilevel" field.

func (*UserUpsertOne) ClearUsername

func (u *UserUpsertOne) ClearUsername() *UserUpsertOne

ClearUsername clears the value of the "username" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uint64

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetAvatar

func (u *UserUpsertOne) SetAvatar(v string) *UserUpsertOne

SetAvatar sets the "avatar" field.

func (*UserUpsertOne) SetBanUntil

func (u *UserUpsertOne) SetBanUntil(v time.Time) *UserUpsertOne

SetBanUntil sets the "ban_until" field.

func (*UserUpsertOne) SetBankAccountName

func (u *UserUpsertOne) SetBankAccountName(v string) *UserUpsertOne

SetBankAccountName sets the "bank_account_name" field.

func (*UserUpsertOne) SetBankAccountNumber

func (u *UserUpsertOne) SetBankAccountNumber(v string) *UserUpsertOne

SetBankAccountNumber sets the "bank_account_number" field.

func (*UserUpsertOne) SetBankID

func (u *UserUpsertOne) SetBankID(v uint64) *UserUpsertOne

SetBankID sets the "bank_id" field.

func (*UserUpsertOne) SetContactCountryID

func (u *UserUpsertOne) SetContactCountryID(v uint64) *UserUpsertOne

SetContactCountryID sets the "contact_country_id" field.

func (*UserUpsertOne) SetContactNumber

func (u *UserUpsertOne) SetContactNumber(v string) *UserUpsertOne

SetContactNumber sets the "contact_number" field.

func (*UserUpsertOne) SetCountryID

func (u *UserUpsertOne) SetCountryID(v uint64) *UserUpsertOne

SetCountryID sets the "country_id" field.

func (*UserUpsertOne) SetCreatedAt

func (u *UserUpsertOne) SetCreatedAt(v time.Time) *UserUpsertOne

SetCreatedAt sets the "created_at" field.

func (*UserUpsertOne) SetCredit1

func (u *UserUpsertOne) SetCredit1(v float64) *UserUpsertOne

SetCredit1 sets the "credit_1" field.

func (*UserUpsertOne) SetCredit2

func (u *UserUpsertOne) SetCredit2(v float64) *UserUpsertOne

SetCredit2 sets the "credit_2" field.

func (*UserUpsertOne) SetCredit3

func (u *UserUpsertOne) SetCredit3(v float64) *UserUpsertOne

SetCredit3 sets the "credit_3" field.

func (*UserUpsertOne) SetCredit4

func (u *UserUpsertOne) SetCredit4(v float64) *UserUpsertOne

SetCredit4 sets the "credit_4" field.

func (*UserUpsertOne) SetCredit5

func (u *UserUpsertOne) SetCredit5(v float64) *UserUpsertOne

SetCredit5 sets the "credit_5" field.

func (*UserUpsertOne) SetDeletedAt

func (u *UserUpsertOne) SetDeletedAt(v time.Time) *UserUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsertOne) SetEmail

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetEmailVerifiedAt

func (u *UserUpsertOne) SetEmailVerifiedAt(v time.Time) *UserUpsertOne

SetEmailVerifiedAt sets the "email_verified_at" field.

func (*UserUpsertOne) SetFirstLogin

func (u *UserUpsertOne) SetFirstLogin(v bool) *UserUpsertOne

SetFirstLogin sets the "first_login" field.

func (*UserUpsertOne) SetFullContactNumber

func (u *UserUpsertOne) SetFullContactNumber(v string) *UserUpsertOne

SetFullContactNumber sets the "full_contact_number" field.

func (*UserUpsertOne) SetIntroducerUserID

func (u *UserUpsertOne) SetIntroducerUserID(v uint64) *UserUpsertOne

SetIntroducerUserID sets the "introducer_user_id" field.

func (*UserUpsertOne) SetLang

func (u *UserUpsertOne) SetLang(v string) *UserUpsertOne

SetLang sets the "lang" field.

func (*UserUpsertOne) SetLastLoginAt

func (u *UserUpsertOne) SetLastLoginAt(v time.Time) *UserUpsertOne

SetLastLoginAt sets the "last_login_at" field.

func (*UserUpsertOne) SetName

func (u *UserUpsertOne) SetName(v string) *UserUpsertOne

SetName sets the "name" field.

func (*UserUpsertOne) SetNationalID

func (u *UserUpsertOne) SetNationalID(v string) *UserUpsertOne

SetNationalID sets the "national_id" field.

func (*UserUpsertOne) SetNewLoginAt

func (u *UserUpsertOne) SetNewLoginAt(v time.Time) *UserUpsertOne

SetNewLoginAt sets the "new_login_at" field.

func (*UserUpsertOne) SetPassword

func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne

SetPassword sets the "password" field.

func (*UserUpsertOne) SetPassword2

func (u *UserUpsertOne) SetPassword2(v string) *UserUpsertOne

SetPassword2 sets the "password2" field.

func (*UserUpsertOne) SetUnilevel

func (u *UserUpsertOne) SetUnilevel(v uint64) *UserUpsertOne

SetUnilevel sets the "unilevel" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) SetUsername

func (u *UserUpsertOne) SetUsername(v string) *UserUpsertOne

SetUsername sets the "username" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateAvatar

func (u *UserUpsertOne) UpdateAvatar() *UserUpsertOne

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*UserUpsertOne) UpdateBanUntil

func (u *UserUpsertOne) UpdateBanUntil() *UserUpsertOne

UpdateBanUntil sets the "ban_until" field to the value that was provided on create.

func (*UserUpsertOne) UpdateBankAccountName

func (u *UserUpsertOne) UpdateBankAccountName() *UserUpsertOne

UpdateBankAccountName sets the "bank_account_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateBankAccountNumber

func (u *UserUpsertOne) UpdateBankAccountNumber() *UserUpsertOne

UpdateBankAccountNumber sets the "bank_account_number" field to the value that was provided on create.

func (*UserUpsertOne) UpdateBankID

func (u *UserUpsertOne) UpdateBankID() *UserUpsertOne

UpdateBankID sets the "bank_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateContactCountryID

func (u *UserUpsertOne) UpdateContactCountryID() *UserUpsertOne

UpdateContactCountryID sets the "contact_country_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateContactNumber

func (u *UserUpsertOne) UpdateContactNumber() *UserUpsertOne

UpdateContactNumber sets the "contact_number" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCountryID

func (u *UserUpsertOne) UpdateCountryID() *UserUpsertOne

UpdateCountryID sets the "country_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCreatedAt

func (u *UserUpsertOne) UpdateCreatedAt() *UserUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCredit1

func (u *UserUpsertOne) UpdateCredit1() *UserUpsertOne

UpdateCredit1 sets the "credit_1" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCredit2

func (u *UserUpsertOne) UpdateCredit2() *UserUpsertOne

UpdateCredit2 sets the "credit_2" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCredit3

func (u *UserUpsertOne) UpdateCredit3() *UserUpsertOne

UpdateCredit3 sets the "credit_3" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCredit4

func (u *UserUpsertOne) UpdateCredit4() *UserUpsertOne

UpdateCredit4 sets the "credit_4" field to the value that was provided on create.

func (*UserUpsertOne) UpdateCredit5

func (u *UserUpsertOne) UpdateCredit5() *UserUpsertOne

UpdateCredit5 sets the "credit_5" field to the value that was provided on create.

func (*UserUpsertOne) UpdateDeletedAt

func (u *UserUpsertOne) UpdateDeletedAt() *UserUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertOne) UpdateEmailVerifiedAt

func (u *UserUpsertOne) UpdateEmailVerifiedAt() *UserUpsertOne

UpdateEmailVerifiedAt sets the "email_verified_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFirstLogin

func (u *UserUpsertOne) UpdateFirstLogin() *UserUpsertOne

UpdateFirstLogin sets the "first_login" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFullContactNumber

func (u *UserUpsertOne) UpdateFullContactNumber() *UserUpsertOne

UpdateFullContactNumber sets the "full_contact_number" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIntroducerUserID

func (u *UserUpsertOne) UpdateIntroducerUserID() *UserUpsertOne

UpdateIntroducerUserID sets the "introducer_user_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateLang

func (u *UserUpsertOne) UpdateLang() *UserUpsertOne

UpdateLang sets the "lang" field to the value that was provided on create.

func (*UserUpsertOne) UpdateLastLoginAt

func (u *UserUpsertOne) UpdateLastLoginAt() *UserUpsertOne

UpdateLastLoginAt sets the "last_login_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateName

func (u *UserUpsertOne) UpdateName() *UserUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNationalID

func (u *UserUpsertOne) UpdateNationalID() *UserUpsertOne

UpdateNationalID sets the "national_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewLoginAt

func (u *UserUpsertOne) UpdateNewLoginAt() *UserUpsertOne

UpdateNewLoginAt sets the "new_login_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdatePassword

func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePassword2

func (u *UserUpsertOne) UpdatePassword2() *UserUpsertOne

UpdatePassword2 sets the "password2" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUnilevel

func (u *UserUpsertOne) UpdateUnilevel() *UserUpsertOne

UpdateUnilevel sets the "unilevel" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUsername

func (u *UserUpsertOne) UpdateUsername() *UserUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

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.

Directories

Path Synopsis
ent/schema/country.go
ent/schema/country.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL