ent

package
v0.0.1-bate.8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 21 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.
	TypeTexture     = "Texture"
	TypeUser        = "User"
	TypeUserProfile = "UserProfile"
	TypeUserTexture = "UserTexture"
	TypeUserToken   = "UserToken"
)

Variables

This section is empty.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Texture is the client for interacting with the Texture builders.
	Texture *TextureClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserProfile is the client for interacting with the UserProfile builders.
	UserProfile *UserProfileClient
	// UserTexture is the client for interacting with the UserTexture builders.
	UserTexture *UserTextureClient
	// UserToken is the client for interacting with the UserToken builders.
	UserToken *UserTokenClient
	// 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().
	Texture.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

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

type Texture struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TextureHash holds the value of the "texture_hash" field.
	TextureHash string `json:"texture_hash,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TextureQuery when eager-loading is set.
	Edges TextureEdges `json:"edges"`
	// contains filtered or unexported fields
}

Texture is the model entity for the Texture schema.

func (*Texture) QueryCreatedUser

func (t *Texture) QueryCreatedUser() *UserQuery

QueryCreatedUser queries the "created_user" edge of the Texture entity.

func (*Texture) QueryUserProfile

func (t *Texture) QueryUserProfile() *UserProfileQuery

QueryUserProfile queries the "user_profile" edge of the Texture entity.

func (*Texture) QueryUsertexture

func (t *Texture) QueryUsertexture() *UserTextureQuery

QueryUsertexture queries the "usertexture" edge of the Texture entity.

func (*Texture) String

func (t *Texture) String() string

String implements the fmt.Stringer.

func (*Texture) Unwrap

func (t *Texture) Unwrap() *Texture

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

func (t *Texture) Update() *TextureUpdateOne

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

func (*Texture) Value

func (t *Texture) Value(name string) (ent.Value, error)

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

type TextureClient

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

TextureClient is a client for the Texture schema.

func NewTextureClient

func NewTextureClient(c config) *TextureClient

NewTextureClient returns a client for the Texture from the given config.

func (*TextureClient) Create

func (c *TextureClient) Create() *TextureCreate

Create returns a builder for creating a Texture entity.

func (*TextureClient) CreateBulk

func (c *TextureClient) CreateBulk(builders ...*TextureCreate) *TextureCreateBulk

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

func (*TextureClient) Delete

func (c *TextureClient) Delete() *TextureDelete

Delete returns a delete builder for Texture.

func (*TextureClient) DeleteOne

func (c *TextureClient) DeleteOne(t *Texture) *TextureDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TextureClient) DeleteOneID

func (c *TextureClient) DeleteOneID(id int) *TextureDeleteOne

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

func (*TextureClient) Get

func (c *TextureClient) Get(ctx context.Context, id int) (*Texture, error)

Get returns a Texture entity by its id.

func (*TextureClient) GetX

func (c *TextureClient) GetX(ctx context.Context, id int) *Texture

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

func (*TextureClient) Hooks

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

Hooks returns the client hooks.

func (*TextureClient) Intercept

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

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

func (*TextureClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TextureClient) Query

func (c *TextureClient) Query() *TextureQuery

Query returns a query builder for Texture.

func (*TextureClient) QueryCreatedUser

func (c *TextureClient) QueryCreatedUser(t *Texture) *UserQuery

QueryCreatedUser queries the created_user edge of a Texture.

func (*TextureClient) QueryUserProfile

func (c *TextureClient) QueryUserProfile(t *Texture) *UserProfileQuery

QueryUserProfile queries the user_profile edge of a Texture.

func (*TextureClient) QueryUsertexture

func (c *TextureClient) QueryUsertexture(t *Texture) *UserTextureQuery

QueryUsertexture queries the usertexture edge of a Texture.

func (*TextureClient) Update

func (c *TextureClient) Update() *TextureUpdate

Update returns an update builder for Texture.

func (*TextureClient) UpdateOne

func (c *TextureClient) UpdateOne(t *Texture) *TextureUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TextureClient) UpdateOneID

func (c *TextureClient) UpdateOneID(id int) *TextureUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TextureClient) Use

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

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

type TextureCreate

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

TextureCreate is the builder for creating a Texture entity.

func (*TextureCreate) AddUserProfile

func (tc *TextureCreate) AddUserProfile(u ...*UserProfile) *TextureCreate

AddUserProfile adds the "user_profile" edges to the UserProfile entity.

func (*TextureCreate) AddUserProfileIDs

func (tc *TextureCreate) AddUserProfileIDs(ids ...int) *TextureCreate

AddUserProfileIDs adds the "user_profile" edge to the UserProfile entity by IDs.

func (*TextureCreate) AddUsertexture

func (tc *TextureCreate) AddUsertexture(u ...*UserTexture) *TextureCreate

AddUsertexture adds the "usertexture" edges to the UserTexture entity.

func (*TextureCreate) AddUsertextureIDs

func (tc *TextureCreate) AddUsertextureIDs(ids ...int) *TextureCreate

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by IDs.

func (*TextureCreate) Exec

func (tc *TextureCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TextureCreate) ExecX

func (tc *TextureCreate) ExecX(ctx context.Context)

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

func (*TextureCreate) Mutation

func (tc *TextureCreate) Mutation() *TextureMutation

Mutation returns the TextureMutation object of the builder.

func (*TextureCreate) Save

func (tc *TextureCreate) Save(ctx context.Context) (*Texture, error)

Save creates the Texture in the database.

func (*TextureCreate) SaveX

func (tc *TextureCreate) SaveX(ctx context.Context) *Texture

SaveX calls Save and panics if Save returns an error.

func (*TextureCreate) SetCreatedUser

func (tc *TextureCreate) SetCreatedUser(u *User) *TextureCreate

SetCreatedUser sets the "created_user" edge to the User entity.

func (*TextureCreate) SetCreatedUserID

func (tc *TextureCreate) SetCreatedUserID(id int) *TextureCreate

SetCreatedUserID sets the "created_user" edge to the User entity by ID.

func (*TextureCreate) SetTextureHash

func (tc *TextureCreate) SetTextureHash(s string) *TextureCreate

SetTextureHash sets the "texture_hash" field.

type TextureCreateBulk

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

TextureCreateBulk is the builder for creating many Texture entities in bulk.

func (*TextureCreateBulk) Exec

func (tcb *TextureCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TextureCreateBulk) ExecX

func (tcb *TextureCreateBulk) ExecX(ctx context.Context)

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

func (*TextureCreateBulk) Save

func (tcb *TextureCreateBulk) Save(ctx context.Context) ([]*Texture, error)

Save creates the Texture entities in the database.

func (*TextureCreateBulk) SaveX

func (tcb *TextureCreateBulk) SaveX(ctx context.Context) []*Texture

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

type TextureDelete

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

TextureDelete is the builder for deleting a Texture entity.

func (*TextureDelete) Exec

func (td *TextureDelete) Exec(ctx context.Context) (int, error)

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

func (*TextureDelete) ExecX

func (td *TextureDelete) ExecX(ctx context.Context) int

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

func (*TextureDelete) Where

func (td *TextureDelete) Where(ps ...predicate.Texture) *TextureDelete

Where appends a list predicates to the TextureDelete builder.

type TextureDeleteOne

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

TextureDeleteOne is the builder for deleting a single Texture entity.

func (*TextureDeleteOne) Exec

func (tdo *TextureDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TextureDeleteOne) ExecX

func (tdo *TextureDeleteOne) ExecX(ctx context.Context)

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

func (*TextureDeleteOne) Where

Where appends a list predicates to the TextureDelete builder.

type TextureEdges

type TextureEdges struct {
	// CreatedUser holds the value of the created_user edge.
	CreatedUser *User `json:"created_user,omitempty"`
	// UserProfile holds the value of the user_profile edge.
	UserProfile []*UserProfile `json:"user_profile,omitempty"`
	// Usertexture holds the value of the usertexture edge.
	Usertexture []*UserTexture `json:"usertexture,omitempty"`
	// contains filtered or unexported fields
}

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

func (TextureEdges) CreatedUserOrErr

func (e TextureEdges) CreatedUserOrErr() (*User, error)

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

func (TextureEdges) UserProfileOrErr

func (e TextureEdges) UserProfileOrErr() ([]*UserProfile, error)

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

func (TextureEdges) UsertextureOrErr

func (e TextureEdges) UsertextureOrErr() ([]*UserTexture, error)

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

type TextureGroupBy

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

TextureGroupBy is the group-by builder for Texture entities.

func (*TextureGroupBy) Aggregate

func (tgb *TextureGroupBy) Aggregate(fns ...AggregateFunc) *TextureGroupBy

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

func (*TextureGroupBy) Bool

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

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

func (*TextureGroupBy) BoolX

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

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

func (*TextureGroupBy) Bools

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

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

func (*TextureGroupBy) BoolsX

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

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

func (*TextureGroupBy) Float64

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

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

func (*TextureGroupBy) Float64X

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

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

func (*TextureGroupBy) Float64s

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

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

func (*TextureGroupBy) Float64sX

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

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

func (*TextureGroupBy) Int

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

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

func (*TextureGroupBy) IntX

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

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

func (*TextureGroupBy) Ints

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

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

func (*TextureGroupBy) IntsX

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

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

func (*TextureGroupBy) Scan

func (tgb *TextureGroupBy) Scan(ctx context.Context, v any) error

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

func (*TextureGroupBy) ScanX

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

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

func (*TextureGroupBy) String

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

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

func (*TextureGroupBy) StringX

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

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

func (*TextureGroupBy) Strings

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

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

func (*TextureGroupBy) StringsX

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

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

type TextureMutation

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

TextureMutation represents an operation that mutates the Texture nodes in the graph.

func (*TextureMutation) AddField

func (m *TextureMutation) 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 (*TextureMutation) AddUserProfileIDs

func (m *TextureMutation) AddUserProfileIDs(ids ...int)

AddUserProfileIDs adds the "user_profile" edge to the UserProfile entity by ids.

func (*TextureMutation) AddUsertextureIDs

func (m *TextureMutation) AddUsertextureIDs(ids ...int)

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by ids.

func (*TextureMutation) AddedEdges

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

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

func (*TextureMutation) AddedField

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

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

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

func (*TextureMutation) AddedIDs

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

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

func (*TextureMutation) ClearCreatedUser

func (m *TextureMutation) ClearCreatedUser()

ClearCreatedUser clears the "created_user" edge to the User entity.

func (*TextureMutation) ClearEdge

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

func (m *TextureMutation) 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 (*TextureMutation) ClearUserProfile

func (m *TextureMutation) ClearUserProfile()

ClearUserProfile clears the "user_profile" edge to the UserProfile entity.

func (*TextureMutation) ClearUsertexture

func (m *TextureMutation) ClearUsertexture()

ClearUsertexture clears the "usertexture" edge to the UserTexture entity.

func (*TextureMutation) ClearedEdges

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

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

func (*TextureMutation) ClearedFields

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

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

func (TextureMutation) Client

func (m TextureMutation) 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 (*TextureMutation) CreatedUserCleared

func (m *TextureMutation) CreatedUserCleared() bool

CreatedUserCleared reports if the "created_user" edge to the User entity was cleared.

func (*TextureMutation) CreatedUserID

func (m *TextureMutation) CreatedUserID() (id int, exists bool)

CreatedUserID returns the "created_user" edge ID in the mutation.

func (*TextureMutation) CreatedUserIDs

func (m *TextureMutation) CreatedUserIDs() (ids []int)

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

func (*TextureMutation) EdgeCleared

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

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

func (*TextureMutation) Field

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

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

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

func (*TextureMutation) Fields

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

func (m *TextureMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TextureMutation) IDs

func (m *TextureMutation) IDs(ctx context.Context) ([]int, error)

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

func (*TextureMutation) OldField

func (m *TextureMutation) 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 (*TextureMutation) OldTextureHash

func (m *TextureMutation) OldTextureHash(ctx context.Context) (v string, err error)

OldTextureHash returns the old "texture_hash" field's value of the Texture entity. If the Texture 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 (*TextureMutation) Op

func (m *TextureMutation) Op() Op

Op returns the operation name.

func (*TextureMutation) RemoveUserProfileIDs

func (m *TextureMutation) RemoveUserProfileIDs(ids ...int)

RemoveUserProfileIDs removes the "user_profile" edge to the UserProfile entity by IDs.

func (*TextureMutation) RemoveUsertextureIDs

func (m *TextureMutation) RemoveUsertextureIDs(ids ...int)

RemoveUsertextureIDs removes the "usertexture" edge to the UserTexture entity by IDs.

func (*TextureMutation) RemovedEdges

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

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

func (*TextureMutation) RemovedIDs

func (m *TextureMutation) 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 (*TextureMutation) RemovedUserProfileIDs

func (m *TextureMutation) RemovedUserProfileIDs() (ids []int)

RemovedUserProfile returns the removed IDs of the "user_profile" edge to the UserProfile entity.

func (*TextureMutation) RemovedUsertextureIDs

func (m *TextureMutation) RemovedUsertextureIDs() (ids []int)

RemovedUsertexture returns the removed IDs of the "usertexture" edge to the UserTexture entity.

func (*TextureMutation) ResetCreatedUser

func (m *TextureMutation) ResetCreatedUser()

ResetCreatedUser resets all changes to the "created_user" edge.

func (*TextureMutation) ResetEdge

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

func (m *TextureMutation) 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 (*TextureMutation) ResetTextureHash

func (m *TextureMutation) ResetTextureHash()

ResetTextureHash resets all changes to the "texture_hash" field.

func (*TextureMutation) ResetUserProfile

func (m *TextureMutation) ResetUserProfile()

ResetUserProfile resets all changes to the "user_profile" edge.

func (*TextureMutation) ResetUsertexture

func (m *TextureMutation) ResetUsertexture()

ResetUsertexture resets all changes to the "usertexture" edge.

func (*TextureMutation) SetCreatedUserID

func (m *TextureMutation) SetCreatedUserID(id int)

SetCreatedUserID sets the "created_user" edge to the User entity by id.

func (*TextureMutation) SetField

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

func (m *TextureMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TextureMutation) SetTextureHash

func (m *TextureMutation) SetTextureHash(s string)

SetTextureHash sets the "texture_hash" field.

func (*TextureMutation) TextureHash

func (m *TextureMutation) TextureHash() (r string, exists bool)

TextureHash returns the value of the "texture_hash" field in the mutation.

func (TextureMutation) Tx

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

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

func (*TextureMutation) Type

func (m *TextureMutation) Type() string

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

func (*TextureMutation) UserProfileCleared

func (m *TextureMutation) UserProfileCleared() bool

UserProfileCleared reports if the "user_profile" edge to the UserProfile entity was cleared.

func (*TextureMutation) UserProfileIDs

func (m *TextureMutation) UserProfileIDs() (ids []int)

UserProfileIDs returns the "user_profile" edge IDs in the mutation.

func (*TextureMutation) UsertextureCleared

func (m *TextureMutation) UsertextureCleared() bool

UsertextureCleared reports if the "usertexture" edge to the UserTexture entity was cleared.

func (*TextureMutation) UsertextureIDs

func (m *TextureMutation) UsertextureIDs() (ids []int)

UsertextureIDs returns the "usertexture" edge IDs in the mutation.

func (*TextureMutation) Where

func (m *TextureMutation) Where(ps ...predicate.Texture)

Where appends a list predicates to the TextureMutation builder.

func (*TextureMutation) WhereP

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

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

type TextureQuery

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

TextureQuery is the builder for querying Texture entities.

func (*TextureQuery) Aggregate

func (tq *TextureQuery) Aggregate(fns ...AggregateFunc) *TextureSelect

Aggregate returns a TextureSelect configured with the given aggregations.

func (*TextureQuery) All

func (tq *TextureQuery) All(ctx context.Context) ([]*Texture, error)

All executes the query and returns a list of Textures.

func (*TextureQuery) AllX

func (tq *TextureQuery) AllX(ctx context.Context) []*Texture

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

func (*TextureQuery) Clone

func (tq *TextureQuery) Clone() *TextureQuery

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

func (*TextureQuery) Count

func (tq *TextureQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TextureQuery) CountX

func (tq *TextureQuery) CountX(ctx context.Context) int

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

func (*TextureQuery) Exist

func (tq *TextureQuery) Exist(ctx context.Context) (bool, error)

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

func (*TextureQuery) ExistX

func (tq *TextureQuery) ExistX(ctx context.Context) bool

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

func (*TextureQuery) First

func (tq *TextureQuery) First(ctx context.Context) (*Texture, error)

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

func (*TextureQuery) FirstID

func (tq *TextureQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TextureQuery) FirstIDX

func (tq *TextureQuery) FirstIDX(ctx context.Context) int

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

func (*TextureQuery) FirstX

func (tq *TextureQuery) FirstX(ctx context.Context) *Texture

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

func (*TextureQuery) ForShare

func (tq *TextureQuery) ForShare(opts ...sql.LockOption) *TextureQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*TextureQuery) ForShareA

func (tq *TextureQuery) ForShareA(opts ...sql.LockOption) *TextureQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*TextureQuery) ForUpdate

func (tq *TextureQuery) ForUpdate(opts ...sql.LockOption) *TextureQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*TextureQuery) ForUpdateA

func (tq *TextureQuery) ForUpdateA(opts ...sql.LockOption) *TextureQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*TextureQuery) GroupBy

func (tq *TextureQuery) GroupBy(field string, fields ...string) *TextureGroupBy

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

client.Texture.Query().
	GroupBy(texture.FieldTextureHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TextureQuery) IDs

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

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

func (*TextureQuery) IDsX

func (tq *TextureQuery) IDsX(ctx context.Context) []int

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

func (*TextureQuery) Limit

func (tq *TextureQuery) Limit(limit int) *TextureQuery

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

func (*TextureQuery) Offset

func (tq *TextureQuery) Offset(offset int) *TextureQuery

Offset to start from.

func (*TextureQuery) Only

func (tq *TextureQuery) Only(ctx context.Context) (*Texture, error)

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

func (*TextureQuery) OnlyID

func (tq *TextureQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TextureQuery) OnlyIDX

func (tq *TextureQuery) OnlyIDX(ctx context.Context) int

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

func (*TextureQuery) OnlyX

func (tq *TextureQuery) OnlyX(ctx context.Context) *Texture

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

func (*TextureQuery) Order

func (tq *TextureQuery) Order(o ...texture.OrderOption) *TextureQuery

Order specifies how the records should be ordered.

func (*TextureQuery) QueryCreatedUser

func (tq *TextureQuery) QueryCreatedUser() *UserQuery

QueryCreatedUser chains the current query on the "created_user" edge.

func (*TextureQuery) QueryUserProfile

func (tq *TextureQuery) QueryUserProfile() *UserProfileQuery

QueryUserProfile chains the current query on the "user_profile" edge.

func (*TextureQuery) QueryUsertexture

func (tq *TextureQuery) QueryUsertexture() *UserTextureQuery

QueryUsertexture chains the current query on the "usertexture" edge.

func (*TextureQuery) Select

func (tq *TextureQuery) Select(fields ...string) *TextureSelect

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

client.Texture.Query().
	Select(texture.FieldTextureHash).
	Scan(ctx, &v)

func (*TextureQuery) Unique

func (tq *TextureQuery) Unique(unique bool) *TextureQuery

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

func (tq *TextureQuery) Where(ps ...predicate.Texture) *TextureQuery

Where adds a new predicate for the TextureQuery builder.

func (*TextureQuery) WithCreatedUser

func (tq *TextureQuery) WithCreatedUser(opts ...func(*UserQuery)) *TextureQuery

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

func (*TextureQuery) WithUserProfile

func (tq *TextureQuery) WithUserProfile(opts ...func(*UserProfileQuery)) *TextureQuery

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

func (*TextureQuery) WithUsertexture

func (tq *TextureQuery) WithUsertexture(opts ...func(*UserTextureQuery)) *TextureQuery

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

type TextureSelect

type TextureSelect struct {
	*TextureQuery
	// contains filtered or unexported fields
}

TextureSelect is the builder for selecting fields of Texture entities.

func (*TextureSelect) Aggregate

func (ts *TextureSelect) Aggregate(fns ...AggregateFunc) *TextureSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TextureSelect) Bool

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

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

func (*TextureSelect) BoolX

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

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

func (*TextureSelect) Bools

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

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

func (*TextureSelect) BoolsX

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

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

func (*TextureSelect) Float64

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

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

func (*TextureSelect) Float64X

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

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

func (*TextureSelect) Float64s

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

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

func (*TextureSelect) Float64sX

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

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

func (*TextureSelect) Int

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

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

func (*TextureSelect) IntX

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

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

func (*TextureSelect) Ints

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

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

func (*TextureSelect) IntsX

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

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

func (*TextureSelect) Scan

func (ts *TextureSelect) Scan(ctx context.Context, v any) error

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

func (*TextureSelect) ScanX

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

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

func (*TextureSelect) String

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

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

func (*TextureSelect) StringX

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

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

func (*TextureSelect) Strings

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

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

func (*TextureSelect) StringsX

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

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

type TextureUpdate

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

TextureUpdate is the builder for updating Texture entities.

func (*TextureUpdate) AddUserProfile

func (tu *TextureUpdate) AddUserProfile(u ...*UserProfile) *TextureUpdate

AddUserProfile adds the "user_profile" edges to the UserProfile entity.

func (*TextureUpdate) AddUserProfileIDs

func (tu *TextureUpdate) AddUserProfileIDs(ids ...int) *TextureUpdate

AddUserProfileIDs adds the "user_profile" edge to the UserProfile entity by IDs.

func (*TextureUpdate) AddUsertexture

func (tu *TextureUpdate) AddUsertexture(u ...*UserTexture) *TextureUpdate

AddUsertexture adds the "usertexture" edges to the UserTexture entity.

func (*TextureUpdate) AddUsertextureIDs

func (tu *TextureUpdate) AddUsertextureIDs(ids ...int) *TextureUpdate

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by IDs.

func (*TextureUpdate) ClearCreatedUser

func (tu *TextureUpdate) ClearCreatedUser() *TextureUpdate

ClearCreatedUser clears the "created_user" edge to the User entity.

func (*TextureUpdate) ClearUserProfile

func (tu *TextureUpdate) ClearUserProfile() *TextureUpdate

ClearUserProfile clears all "user_profile" edges to the UserProfile entity.

func (*TextureUpdate) ClearUsertexture

func (tu *TextureUpdate) ClearUsertexture() *TextureUpdate

ClearUsertexture clears all "usertexture" edges to the UserTexture entity.

func (*TextureUpdate) Exec

func (tu *TextureUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TextureUpdate) ExecX

func (tu *TextureUpdate) ExecX(ctx context.Context)

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

func (*TextureUpdate) Mutation

func (tu *TextureUpdate) Mutation() *TextureMutation

Mutation returns the TextureMutation object of the builder.

func (*TextureUpdate) RemoveUserProfile

func (tu *TextureUpdate) RemoveUserProfile(u ...*UserProfile) *TextureUpdate

RemoveUserProfile removes "user_profile" edges to UserProfile entities.

func (*TextureUpdate) RemoveUserProfileIDs

func (tu *TextureUpdate) RemoveUserProfileIDs(ids ...int) *TextureUpdate

RemoveUserProfileIDs removes the "user_profile" edge to UserProfile entities by IDs.

func (*TextureUpdate) RemoveUsertexture

func (tu *TextureUpdate) RemoveUsertexture(u ...*UserTexture) *TextureUpdate

RemoveUsertexture removes "usertexture" edges to UserTexture entities.

func (*TextureUpdate) RemoveUsertextureIDs

func (tu *TextureUpdate) RemoveUsertextureIDs(ids ...int) *TextureUpdate

RemoveUsertextureIDs removes the "usertexture" edge to UserTexture entities by IDs.

func (*TextureUpdate) Save

func (tu *TextureUpdate) Save(ctx context.Context) (int, error)

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

func (*TextureUpdate) SaveX

func (tu *TextureUpdate) SaveX(ctx context.Context) int

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

func (*TextureUpdate) SetCreatedUser

func (tu *TextureUpdate) SetCreatedUser(u *User) *TextureUpdate

SetCreatedUser sets the "created_user" edge to the User entity.

func (*TextureUpdate) SetCreatedUserID

func (tu *TextureUpdate) SetCreatedUserID(id int) *TextureUpdate

SetCreatedUserID sets the "created_user" edge to the User entity by ID.

func (*TextureUpdate) SetTextureHash

func (tu *TextureUpdate) SetTextureHash(s string) *TextureUpdate

SetTextureHash sets the "texture_hash" field.

func (*TextureUpdate) Where

func (tu *TextureUpdate) Where(ps ...predicate.Texture) *TextureUpdate

Where appends a list predicates to the TextureUpdate builder.

type TextureUpdateOne

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

TextureUpdateOne is the builder for updating a single Texture entity.

func (*TextureUpdateOne) AddUserProfile

func (tuo *TextureUpdateOne) AddUserProfile(u ...*UserProfile) *TextureUpdateOne

AddUserProfile adds the "user_profile" edges to the UserProfile entity.

func (*TextureUpdateOne) AddUserProfileIDs

func (tuo *TextureUpdateOne) AddUserProfileIDs(ids ...int) *TextureUpdateOne

AddUserProfileIDs adds the "user_profile" edge to the UserProfile entity by IDs.

func (*TextureUpdateOne) AddUsertexture

func (tuo *TextureUpdateOne) AddUsertexture(u ...*UserTexture) *TextureUpdateOne

AddUsertexture adds the "usertexture" edges to the UserTexture entity.

func (*TextureUpdateOne) AddUsertextureIDs

func (tuo *TextureUpdateOne) AddUsertextureIDs(ids ...int) *TextureUpdateOne

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by IDs.

func (*TextureUpdateOne) ClearCreatedUser

func (tuo *TextureUpdateOne) ClearCreatedUser() *TextureUpdateOne

ClearCreatedUser clears the "created_user" edge to the User entity.

func (*TextureUpdateOne) ClearUserProfile

func (tuo *TextureUpdateOne) ClearUserProfile() *TextureUpdateOne

ClearUserProfile clears all "user_profile" edges to the UserProfile entity.

func (*TextureUpdateOne) ClearUsertexture

func (tuo *TextureUpdateOne) ClearUsertexture() *TextureUpdateOne

ClearUsertexture clears all "usertexture" edges to the UserTexture entity.

func (*TextureUpdateOne) Exec

func (tuo *TextureUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TextureUpdateOne) ExecX

func (tuo *TextureUpdateOne) ExecX(ctx context.Context)

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

func (*TextureUpdateOne) Mutation

func (tuo *TextureUpdateOne) Mutation() *TextureMutation

Mutation returns the TextureMutation object of the builder.

func (*TextureUpdateOne) RemoveUserProfile

func (tuo *TextureUpdateOne) RemoveUserProfile(u ...*UserProfile) *TextureUpdateOne

RemoveUserProfile removes "user_profile" edges to UserProfile entities.

func (*TextureUpdateOne) RemoveUserProfileIDs

func (tuo *TextureUpdateOne) RemoveUserProfileIDs(ids ...int) *TextureUpdateOne

RemoveUserProfileIDs removes the "user_profile" edge to UserProfile entities by IDs.

func (*TextureUpdateOne) RemoveUsertexture

func (tuo *TextureUpdateOne) RemoveUsertexture(u ...*UserTexture) *TextureUpdateOne

RemoveUsertexture removes "usertexture" edges to UserTexture entities.

func (*TextureUpdateOne) RemoveUsertextureIDs

func (tuo *TextureUpdateOne) RemoveUsertextureIDs(ids ...int) *TextureUpdateOne

RemoveUsertextureIDs removes the "usertexture" edge to UserTexture entities by IDs.

func (*TextureUpdateOne) Save

func (tuo *TextureUpdateOne) Save(ctx context.Context) (*Texture, error)

Save executes the query and returns the updated Texture entity.

func (*TextureUpdateOne) SaveX

func (tuo *TextureUpdateOne) SaveX(ctx context.Context) *Texture

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

func (*TextureUpdateOne) Select

func (tuo *TextureUpdateOne) Select(field string, fields ...string) *TextureUpdateOne

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

func (*TextureUpdateOne) SetCreatedUser

func (tuo *TextureUpdateOne) SetCreatedUser(u *User) *TextureUpdateOne

SetCreatedUser sets the "created_user" edge to the User entity.

func (*TextureUpdateOne) SetCreatedUserID

func (tuo *TextureUpdateOne) SetCreatedUserID(id int) *TextureUpdateOne

SetCreatedUserID sets the "created_user" edge to the User entity by ID.

func (*TextureUpdateOne) SetTextureHash

func (tuo *TextureUpdateOne) SetTextureHash(s string) *TextureUpdateOne

SetTextureHash sets the "texture_hash" field.

func (*TextureUpdateOne) Where

Where appends a list predicates to the TextureUpdate builder.

type Textures

type Textures []*Texture

Textures is a parsable slice of Texture.

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 {

	// Texture is the client for interacting with the Texture builders.
	Texture *TextureClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserProfile is the client for interacting with the UserProfile builders.
	UserProfile *UserProfileClient
	// UserTexture is the client for interacting with the UserTexture builders.
	UserTexture *UserTextureClient
	// UserToken is the client for interacting with the UserToken builders.
	UserToken *UserTokenClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// Salt holds the value of the "salt" field.
	Salt string `json:"salt,omitempty"`
	// RegIP holds the value of the "reg_ip" field.
	RegIP string `json:"reg_ip,omitempty"`
	// State holds the value of the "state" field.
	State int `json:"state,omitempty"`
	// RegTime holds the value of the "reg_time" field.
	RegTime int64 `json:"reg_time,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) QueryCreatedTexture

func (u *User) QueryCreatedTexture() *TextureQuery

QueryCreatedTexture queries the "created_texture" edge of the User entity.

func (*User) QueryProfile

func (u *User) QueryProfile() *UserProfileQuery

QueryProfile queries the "profile" edge of the User entity.

func (*User) QueryToken

func (u *User) QueryToken() *UserTokenQuery

QueryToken queries the "token" 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 int) *UserDeleteOne

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

func (*UserClient) Get

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

Get returns a User entity by its id.

func (*UserClient) GetX

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

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryCreatedTexture

func (c *UserClient) QueryCreatedTexture(u *User) *TextureQuery

QueryCreatedTexture queries the created_texture edge of a User.

func (*UserClient) QueryProfile

func (c *UserClient) QueryProfile(u *User) *UserProfileQuery

QueryProfile queries the profile edge of a User.

func (*UserClient) QueryToken

func (c *UserClient) QueryToken(u *User) *UserTokenQuery

QueryToken queries the token 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 int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddCreatedTexture

func (uc *UserCreate) AddCreatedTexture(t ...*Texture) *UserCreate

AddCreatedTexture adds the "created_texture" edges to the Texture entity.

func (*UserCreate) AddCreatedTextureIDs

func (uc *UserCreate) AddCreatedTextureIDs(ids ...int) *UserCreate

AddCreatedTextureIDs adds the "created_texture" edge to the Texture entity by IDs.

func (*UserCreate) Exec

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

Exec executes the query.

func (*UserCreate) ExecX

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

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

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

Save creates the User in the database.

func (*UserCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetNillableProfileID

func (uc *UserCreate) SetNillableProfileID(id *int) *UserCreate

SetNillableProfileID sets the "profile" edge to the UserProfile entity by ID if the given value is not nil.

func (*UserCreate) SetNillableTokenID

func (uc *UserCreate) SetNillableTokenID(id *int) *UserCreate

SetNillableTokenID sets the "token" edge to the UserToken entity by ID if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetProfile

func (uc *UserCreate) SetProfile(u *UserProfile) *UserCreate

SetProfile sets the "profile" edge to the UserProfile entity.

func (*UserCreate) SetProfileID

func (uc *UserCreate) SetProfileID(id int) *UserCreate

SetProfileID sets the "profile" edge to the UserProfile entity by ID.

func (*UserCreate) SetRegIP

func (uc *UserCreate) SetRegIP(s string) *UserCreate

SetRegIP sets the "reg_ip" field.

func (*UserCreate) SetRegTime

func (uc *UserCreate) SetRegTime(i int64) *UserCreate

SetRegTime sets the "reg_time" field.

func (*UserCreate) SetSalt

func (uc *UserCreate) SetSalt(s string) *UserCreate

SetSalt sets the "salt" field.

func (*UserCreate) SetState

func (uc *UserCreate) SetState(i int) *UserCreate

SetState sets the "state" field.

func (*UserCreate) SetToken

func (uc *UserCreate) SetToken(u *UserToken) *UserCreate

SetToken sets the "token" edge to the UserToken entity.

func (*UserCreate) SetTokenID

func (uc *UserCreate) SetTokenID(id int) *UserCreate

SetTokenID sets the "token" edge to the UserToken entity by ID.

type UserCreateBulk

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

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

func (*UserCreateBulk) Exec

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

Exec executes the query.

func (*UserCreateBulk) ExecX

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

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

func (*UserCreateBulk) Save

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

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

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

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

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

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

func (*UserDelete) ExecX

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

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

func (*UserDelete) Where

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

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

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

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

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

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

func (*UserDeleteOne) Where

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

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// CreatedTexture holds the value of the created_texture edge.
	CreatedTexture []*Texture `json:"created_texture,omitempty"`
	// Profile holds the value of the profile edge.
	Profile *UserProfile `json:"profile,omitempty"`
	// Token holds the value of the token edge.
	Token *UserToken `json:"token,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) CreatedTextureOrErr

func (e UserEdges) CreatedTextureOrErr() ([]*Texture, error)

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

func (UserEdges) ProfileOrErr

func (e UserEdges) ProfileOrErr() (*UserProfile, error)

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

func (UserEdges) TokenOrErr

func (e UserEdges) TokenOrErr() (*UserToken, error)

TokenOrErr returns the Token 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) AddCreatedTextureIDs

func (m *UserMutation) AddCreatedTextureIDs(ids ...int)

AddCreatedTextureIDs adds the "created_texture" edge to the Texture entity by ids.

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) AddRegTime

func (m *UserMutation) AddRegTime(i int64)

AddRegTime adds i to the "reg_time" field.

func (*UserMutation) AddState

func (m *UserMutation) AddState(i int)

AddState adds i to the "state" field.

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) AddedRegTime

func (m *UserMutation) AddedRegTime() (r int64, exists bool)

AddedRegTime returns the value that was added to the "reg_time" field in this mutation.

func (*UserMutation) AddedState

func (m *UserMutation) AddedState() (r int, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*UserMutation) ClearCreatedTexture

func (m *UserMutation) ClearCreatedTexture()

ClearCreatedTexture clears the "created_texture" edge to the Texture entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearProfile

func (m *UserMutation) ClearProfile()

ClearProfile clears the "profile" edge to the UserProfile entity.

func (*UserMutation) ClearToken

func (m *UserMutation) ClearToken()

ClearToken clears the "token" edge to the UserToken entity.

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) CreatedTextureCleared

func (m *UserMutation) CreatedTextureCleared() bool

CreatedTextureCleared reports if the "created_texture" edge to the Texture entity was cleared.

func (*UserMutation) CreatedTextureIDs

func (m *UserMutation) CreatedTextureIDs() (ids []int)

CreatedTextureIDs returns the "created_texture" edge IDs in the mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Email

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

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

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

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

func (*UserMutation) OldEmail

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

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) 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) OldRegIP

func (m *UserMutation) OldRegIP(ctx context.Context) (v string, err error)

OldRegIP returns the old "reg_ip" 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) OldRegTime

func (m *UserMutation) OldRegTime(ctx context.Context) (v int64, err error)

OldRegTime returns the old "reg_time" 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) OldSalt

func (m *UserMutation) OldSalt(ctx context.Context) (v string, err error)

OldSalt returns the old "salt" 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) OldState

func (m *UserMutation) OldState(ctx context.Context) (v int, err error)

OldState returns the old "state" 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) ProfileCleared

func (m *UserMutation) ProfileCleared() bool

ProfileCleared reports if the "profile" edge to the UserProfile entity was cleared.

func (*UserMutation) ProfileID

func (m *UserMutation) ProfileID() (id int, exists bool)

ProfileID returns the "profile" edge ID in the mutation.

func (*UserMutation) ProfileIDs

func (m *UserMutation) ProfileIDs() (ids []int)

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

func (*UserMutation) RegIP

func (m *UserMutation) RegIP() (r string, exists bool)

RegIP returns the value of the "reg_ip" field in the mutation.

func (*UserMutation) RegTime

func (m *UserMutation) RegTime() (r int64, exists bool)

RegTime returns the value of the "reg_time" field in the mutation.

func (*UserMutation) RemoveCreatedTextureIDs

func (m *UserMutation) RemoveCreatedTextureIDs(ids ...int)

RemoveCreatedTextureIDs removes the "created_texture" edge to the Texture entity by IDs.

func (*UserMutation) RemovedCreatedTextureIDs

func (m *UserMutation) RemovedCreatedTextureIDs() (ids []int)

RemovedCreatedTexture returns the removed IDs of the "created_texture" edge to the Texture entity.

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) ResetCreatedTexture

func (m *UserMutation) ResetCreatedTexture()

ResetCreatedTexture resets all changes to the "created_texture" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetProfile

func (m *UserMutation) ResetProfile()

ResetProfile resets all changes to the "profile" edge.

func (*UserMutation) ResetRegIP

func (m *UserMutation) ResetRegIP()

ResetRegIP resets all changes to the "reg_ip" field.

func (*UserMutation) ResetRegTime

func (m *UserMutation) ResetRegTime()

ResetRegTime resets all changes to the "reg_time" field.

func (*UserMutation) ResetSalt

func (m *UserMutation) ResetSalt()

ResetSalt resets all changes to the "salt" field.

func (*UserMutation) ResetState

func (m *UserMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*UserMutation) ResetToken

func (m *UserMutation) ResetToken()

ResetToken resets all changes to the "token" edge.

func (*UserMutation) Salt

func (m *UserMutation) Salt() (r string, exists bool)

Salt returns the value of the "salt" field in the mutation.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) 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) SetProfileID

func (m *UserMutation) SetProfileID(id int)

SetProfileID sets the "profile" edge to the UserProfile entity by id.

func (*UserMutation) SetRegIP

func (m *UserMutation) SetRegIP(s string)

SetRegIP sets the "reg_ip" field.

func (*UserMutation) SetRegTime

func (m *UserMutation) SetRegTime(i int64)

SetRegTime sets the "reg_time" field.

func (*UserMutation) SetSalt

func (m *UserMutation) SetSalt(s string)

SetSalt sets the "salt" field.

func (*UserMutation) SetState

func (m *UserMutation) SetState(i int)

SetState sets the "state" field.

func (*UserMutation) SetTokenID

func (m *UserMutation) SetTokenID(id int)

SetTokenID sets the "token" edge to the UserToken entity by id.

func (*UserMutation) State

func (m *UserMutation) State() (r int, exists bool)

State returns the value of the "state" field in the mutation.

func (*UserMutation) TokenCleared

func (m *UserMutation) TokenCleared() bool

TokenCleared reports if the "token" edge to the UserToken entity was cleared.

func (*UserMutation) TokenID

func (m *UserMutation) TokenID() (id int, exists bool)

TokenID returns the "token" edge ID in the mutation.

func (*UserMutation) TokenIDs

func (m *UserMutation) TokenIDs() (ids []int)

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

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) Where

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

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

type UserProfile

type UserProfile struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// UUID holds the value of the "uuid" field.
	UUID string `json:"uuid,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserProfileQuery when eager-loading is set.
	Edges UserProfileEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserProfile is the model entity for the UserProfile schema.

func (*UserProfile) QueryTexture

func (up *UserProfile) QueryTexture() *TextureQuery

QueryTexture queries the "texture" edge of the UserProfile entity.

func (*UserProfile) QueryUser

func (up *UserProfile) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserProfile entity.

func (*UserProfile) QueryUsertexture

func (up *UserProfile) QueryUsertexture() *UserTextureQuery

QueryUsertexture queries the "usertexture" edge of the UserProfile entity.

func (*UserProfile) String

func (up *UserProfile) String() string

String implements the fmt.Stringer.

func (*UserProfile) Unwrap

func (up *UserProfile) Unwrap() *UserProfile

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

func (up *UserProfile) Update() *UserProfileUpdateOne

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

func (*UserProfile) Value

func (up *UserProfile) Value(name string) (ent.Value, error)

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

type UserProfileClient

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

UserProfileClient is a client for the UserProfile schema.

func NewUserProfileClient

func NewUserProfileClient(c config) *UserProfileClient

NewUserProfileClient returns a client for the UserProfile from the given config.

func (*UserProfileClient) Create

func (c *UserProfileClient) Create() *UserProfileCreate

Create returns a builder for creating a UserProfile entity.

func (*UserProfileClient) CreateBulk

func (c *UserProfileClient) CreateBulk(builders ...*UserProfileCreate) *UserProfileCreateBulk

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

func (*UserProfileClient) Delete

func (c *UserProfileClient) Delete() *UserProfileDelete

Delete returns a delete builder for UserProfile.

func (*UserProfileClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserProfileClient) DeleteOneID

func (c *UserProfileClient) DeleteOneID(id int) *UserProfileDeleteOne

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

func (*UserProfileClient) Get

func (c *UserProfileClient) Get(ctx context.Context, id int) (*UserProfile, error)

Get returns a UserProfile entity by its id.

func (*UserProfileClient) GetX

func (c *UserProfileClient) GetX(ctx context.Context, id int) *UserProfile

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

func (*UserProfileClient) Hooks

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

Hooks returns the client hooks.

func (*UserProfileClient) Intercept

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

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

func (*UserProfileClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserProfileClient) Query

func (c *UserProfileClient) Query() *UserProfileQuery

Query returns a query builder for UserProfile.

func (*UserProfileClient) QueryTexture

func (c *UserProfileClient) QueryTexture(up *UserProfile) *TextureQuery

QueryTexture queries the texture edge of a UserProfile.

func (*UserProfileClient) QueryUser

func (c *UserProfileClient) QueryUser(up *UserProfile) *UserQuery

QueryUser queries the user edge of a UserProfile.

func (*UserProfileClient) QueryUsertexture

func (c *UserProfileClient) QueryUsertexture(up *UserProfile) *UserTextureQuery

QueryUsertexture queries the usertexture edge of a UserProfile.

func (*UserProfileClient) Update

func (c *UserProfileClient) Update() *UserProfileUpdate

Update returns an update builder for UserProfile.

func (*UserProfileClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserProfileClient) UpdateOneID

func (c *UserProfileClient) UpdateOneID(id int) *UserProfileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserProfileClient) Use

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

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

type UserProfileCreate

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

UserProfileCreate is the builder for creating a UserProfile entity.

func (*UserProfileCreate) AddTexture

func (upc *UserProfileCreate) AddTexture(t ...*Texture) *UserProfileCreate

AddTexture adds the "texture" edges to the Texture entity.

func (*UserProfileCreate) AddTextureIDs

func (upc *UserProfileCreate) AddTextureIDs(ids ...int) *UserProfileCreate

AddTextureIDs adds the "texture" edge to the Texture entity by IDs.

func (*UserProfileCreate) AddUsertexture

func (upc *UserProfileCreate) AddUsertexture(u ...*UserTexture) *UserProfileCreate

AddUsertexture adds the "usertexture" edges to the UserTexture entity.

func (*UserProfileCreate) AddUsertextureIDs

func (upc *UserProfileCreate) AddUsertextureIDs(ids ...int) *UserProfileCreate

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by IDs.

func (*UserProfileCreate) Exec

func (upc *UserProfileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserProfileCreate) ExecX

func (upc *UserProfileCreate) ExecX(ctx context.Context)

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

func (*UserProfileCreate) Mutation

func (upc *UserProfileCreate) Mutation() *UserProfileMutation

Mutation returns the UserProfileMutation object of the builder.

func (*UserProfileCreate) Save

func (upc *UserProfileCreate) Save(ctx context.Context) (*UserProfile, error)

Save creates the UserProfile in the database.

func (*UserProfileCreate) SaveX

func (upc *UserProfileCreate) SaveX(ctx context.Context) *UserProfile

SaveX calls Save and panics if Save returns an error.

func (*UserProfileCreate) SetName

func (upc *UserProfileCreate) SetName(s string) *UserProfileCreate

SetName sets the "name" field.

func (*UserProfileCreate) SetUUID

func (upc *UserProfileCreate) SetUUID(s string) *UserProfileCreate

SetUUID sets the "uuid" field.

func (*UserProfileCreate) SetUser

func (upc *UserProfileCreate) SetUser(u *User) *UserProfileCreate

SetUser sets the "user" edge to the User entity.

func (*UserProfileCreate) SetUserID

func (upc *UserProfileCreate) SetUserID(id int) *UserProfileCreate

SetUserID sets the "user" edge to the User entity by ID.

type UserProfileCreateBulk

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

UserProfileCreateBulk is the builder for creating many UserProfile entities in bulk.

func (*UserProfileCreateBulk) Exec

func (upcb *UserProfileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserProfileCreateBulk) ExecX

func (upcb *UserProfileCreateBulk) ExecX(ctx context.Context)

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

func (*UserProfileCreateBulk) Save

func (upcb *UserProfileCreateBulk) Save(ctx context.Context) ([]*UserProfile, error)

Save creates the UserProfile entities in the database.

func (*UserProfileCreateBulk) SaveX

func (upcb *UserProfileCreateBulk) SaveX(ctx context.Context) []*UserProfile

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

type UserProfileDelete

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

UserProfileDelete is the builder for deleting a UserProfile entity.

func (*UserProfileDelete) Exec

func (upd *UserProfileDelete) Exec(ctx context.Context) (int, error)

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

func (*UserProfileDelete) ExecX

func (upd *UserProfileDelete) ExecX(ctx context.Context) int

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

func (*UserProfileDelete) Where

Where appends a list predicates to the UserProfileDelete builder.

type UserProfileDeleteOne

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

UserProfileDeleteOne is the builder for deleting a single UserProfile entity.

func (*UserProfileDeleteOne) Exec

func (updo *UserProfileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserProfileDeleteOne) ExecX

func (updo *UserProfileDeleteOne) ExecX(ctx context.Context)

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

func (*UserProfileDeleteOne) Where

Where appends a list predicates to the UserProfileDelete builder.

type UserProfileEdges

type UserProfileEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Texture holds the value of the texture edge.
	Texture []*Texture `json:"texture,omitempty"`
	// Usertexture holds the value of the usertexture edge.
	Usertexture []*UserTexture `json:"usertexture,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserProfileEdges) TextureOrErr

func (e UserProfileEdges) TextureOrErr() ([]*Texture, error)

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

func (UserProfileEdges) UserOrErr

func (e UserProfileEdges) UserOrErr() (*User, error)

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

func (UserProfileEdges) UsertextureOrErr

func (e UserProfileEdges) UsertextureOrErr() ([]*UserTexture, error)

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

type UserProfileGroupBy

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

UserProfileGroupBy is the group-by builder for UserProfile entities.

func (*UserProfileGroupBy) Aggregate

func (upgb *UserProfileGroupBy) Aggregate(fns ...AggregateFunc) *UserProfileGroupBy

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

func (*UserProfileGroupBy) Bool

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

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

func (*UserProfileGroupBy) BoolX

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

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

func (*UserProfileGroupBy) Bools

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

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

func (*UserProfileGroupBy) BoolsX

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

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

func (*UserProfileGroupBy) Float64

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

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

func (*UserProfileGroupBy) Float64X

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

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

func (*UserProfileGroupBy) Float64s

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

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

func (*UserProfileGroupBy) Float64sX

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

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

func (*UserProfileGroupBy) Int

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

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

func (*UserProfileGroupBy) IntX

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

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

func (*UserProfileGroupBy) Ints

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

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

func (*UserProfileGroupBy) IntsX

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

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

func (*UserProfileGroupBy) Scan

func (upgb *UserProfileGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserProfileGroupBy) ScanX

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

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

func (*UserProfileGroupBy) String

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

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

func (*UserProfileGroupBy) StringX

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

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

func (*UserProfileGroupBy) Strings

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

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

func (*UserProfileGroupBy) StringsX

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

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

type UserProfileMutation

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

UserProfileMutation represents an operation that mutates the UserProfile nodes in the graph.

func (*UserProfileMutation) AddField

func (m *UserProfileMutation) 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 (*UserProfileMutation) AddTextureIDs

func (m *UserProfileMutation) AddTextureIDs(ids ...int)

AddTextureIDs adds the "texture" edge to the Texture entity by ids.

func (*UserProfileMutation) AddUsertextureIDs

func (m *UserProfileMutation) AddUsertextureIDs(ids ...int)

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by ids.

func (*UserProfileMutation) AddedEdges

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

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

func (*UserProfileMutation) AddedField

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

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

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

func (*UserProfileMutation) AddedIDs

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

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

func (*UserProfileMutation) ClearEdge

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

func (m *UserProfileMutation) 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 (*UserProfileMutation) ClearTexture

func (m *UserProfileMutation) ClearTexture()

ClearTexture clears the "texture" edge to the Texture entity.

func (*UserProfileMutation) ClearUser

func (m *UserProfileMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserProfileMutation) ClearUsertexture

func (m *UserProfileMutation) ClearUsertexture()

ClearUsertexture clears the "usertexture" edge to the UserTexture entity.

func (*UserProfileMutation) ClearedEdges

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

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

func (*UserProfileMutation) ClearedFields

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

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

func (UserProfileMutation) Client

func (m UserProfileMutation) 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 (*UserProfileMutation) EdgeCleared

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

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

func (*UserProfileMutation) Field

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

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

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

func (*UserProfileMutation) Fields

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

func (m *UserProfileMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserProfileMutation) IDs

func (m *UserProfileMutation) IDs(ctx context.Context) ([]int, error)

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

func (*UserProfileMutation) Name

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

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

func (*UserProfileMutation) OldField

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

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

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

func (m *UserProfileMutation) OldUUID(ctx context.Context) (v string, err error)

OldUUID returns the old "uuid" field's value of the UserProfile entity. If the UserProfile 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 (*UserProfileMutation) Op

func (m *UserProfileMutation) Op() Op

Op returns the operation name.

func (*UserProfileMutation) RemoveTextureIDs

func (m *UserProfileMutation) RemoveTextureIDs(ids ...int)

RemoveTextureIDs removes the "texture" edge to the Texture entity by IDs.

func (*UserProfileMutation) RemoveUsertextureIDs

func (m *UserProfileMutation) RemoveUsertextureIDs(ids ...int)

RemoveUsertextureIDs removes the "usertexture" edge to the UserTexture entity by IDs.

func (*UserProfileMutation) RemovedEdges

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

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

func (*UserProfileMutation) RemovedIDs

func (m *UserProfileMutation) 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 (*UserProfileMutation) RemovedTextureIDs

func (m *UserProfileMutation) RemovedTextureIDs() (ids []int)

RemovedTexture returns the removed IDs of the "texture" edge to the Texture entity.

func (*UserProfileMutation) RemovedUsertextureIDs

func (m *UserProfileMutation) RemovedUsertextureIDs() (ids []int)

RemovedUsertexture returns the removed IDs of the "usertexture" edge to the UserTexture entity.

func (*UserProfileMutation) ResetEdge

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

func (m *UserProfileMutation) 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 (*UserProfileMutation) ResetName

func (m *UserProfileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserProfileMutation) ResetTexture

func (m *UserProfileMutation) ResetTexture()

ResetTexture resets all changes to the "texture" edge.

func (*UserProfileMutation) ResetUUID

func (m *UserProfileMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*UserProfileMutation) ResetUser

func (m *UserProfileMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserProfileMutation) ResetUsertexture

func (m *UserProfileMutation) ResetUsertexture()

ResetUsertexture resets all changes to the "usertexture" edge.

func (*UserProfileMutation) SetField

func (m *UserProfileMutation) 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 (*UserProfileMutation) SetName

func (m *UserProfileMutation) SetName(s string)

SetName sets the "name" field.

func (*UserProfileMutation) SetOp

func (m *UserProfileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserProfileMutation) SetUUID

func (m *UserProfileMutation) SetUUID(s string)

SetUUID sets the "uuid" field.

func (*UserProfileMutation) SetUserID

func (m *UserProfileMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*UserProfileMutation) TextureCleared

func (m *UserProfileMutation) TextureCleared() bool

TextureCleared reports if the "texture" edge to the Texture entity was cleared.

func (*UserProfileMutation) TextureIDs

func (m *UserProfileMutation) TextureIDs() (ids []int)

TextureIDs returns the "texture" edge IDs in the mutation.

func (UserProfileMutation) Tx

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

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

func (*UserProfileMutation) Type

func (m *UserProfileMutation) Type() string

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

func (*UserProfileMutation) UUID

func (m *UserProfileMutation) UUID() (r string, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*UserProfileMutation) UserCleared

func (m *UserProfileMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserProfileMutation) UserID

func (m *UserProfileMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*UserProfileMutation) UserIDs

func (m *UserProfileMutation) UserIDs() (ids []int)

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

func (*UserProfileMutation) UsertextureCleared

func (m *UserProfileMutation) UsertextureCleared() bool

UsertextureCleared reports if the "usertexture" edge to the UserTexture entity was cleared.

func (*UserProfileMutation) UsertextureIDs

func (m *UserProfileMutation) UsertextureIDs() (ids []int)

UsertextureIDs returns the "usertexture" edge IDs in the mutation.

func (*UserProfileMutation) Where

func (m *UserProfileMutation) Where(ps ...predicate.UserProfile)

Where appends a list predicates to the UserProfileMutation builder.

func (*UserProfileMutation) WhereP

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

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

type UserProfileQuery

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

UserProfileQuery is the builder for querying UserProfile entities.

func (*UserProfileQuery) Aggregate

func (upq *UserProfileQuery) Aggregate(fns ...AggregateFunc) *UserProfileSelect

Aggregate returns a UserProfileSelect configured with the given aggregations.

func (*UserProfileQuery) All

func (upq *UserProfileQuery) All(ctx context.Context) ([]*UserProfile, error)

All executes the query and returns a list of UserProfiles.

func (*UserProfileQuery) AllX

func (upq *UserProfileQuery) AllX(ctx context.Context) []*UserProfile

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

func (*UserProfileQuery) Clone

func (upq *UserProfileQuery) Clone() *UserProfileQuery

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

func (*UserProfileQuery) Count

func (upq *UserProfileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserProfileQuery) CountX

func (upq *UserProfileQuery) CountX(ctx context.Context) int

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

func (*UserProfileQuery) Exist

func (upq *UserProfileQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserProfileQuery) ExistX

func (upq *UserProfileQuery) ExistX(ctx context.Context) bool

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

func (*UserProfileQuery) First

func (upq *UserProfileQuery) First(ctx context.Context) (*UserProfile, error)

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

func (*UserProfileQuery) FirstID

func (upq *UserProfileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserProfileQuery) FirstIDX

func (upq *UserProfileQuery) FirstIDX(ctx context.Context) int

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

func (*UserProfileQuery) FirstX

func (upq *UserProfileQuery) FirstX(ctx context.Context) *UserProfile

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

func (*UserProfileQuery) ForShare

func (upq *UserProfileQuery) ForShare(opts ...sql.LockOption) *UserProfileQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserProfileQuery) ForShareA

func (upq *UserProfileQuery) ForShareA(opts ...sql.LockOption) *UserProfileQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserProfileQuery) ForUpdate

func (upq *UserProfileQuery) ForUpdate(opts ...sql.LockOption) *UserProfileQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserProfileQuery) ForUpdateA

func (upq *UserProfileQuery) ForUpdateA(opts ...sql.LockOption) *UserProfileQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserProfileQuery) GroupBy

func (upq *UserProfileQuery) GroupBy(field string, fields ...string) *UserProfileGroupBy

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

Example:

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

client.UserProfile.Query().
	GroupBy(userprofile.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserProfileQuery) IDs

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

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

func (*UserProfileQuery) IDsX

func (upq *UserProfileQuery) IDsX(ctx context.Context) []int

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

func (*UserProfileQuery) Limit

func (upq *UserProfileQuery) Limit(limit int) *UserProfileQuery

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

func (*UserProfileQuery) Offset

func (upq *UserProfileQuery) Offset(offset int) *UserProfileQuery

Offset to start from.

func (*UserProfileQuery) Only

func (upq *UserProfileQuery) Only(ctx context.Context) (*UserProfile, error)

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

func (*UserProfileQuery) OnlyID

func (upq *UserProfileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserProfileQuery) OnlyIDX

func (upq *UserProfileQuery) OnlyIDX(ctx context.Context) int

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

func (*UserProfileQuery) OnlyX

func (upq *UserProfileQuery) OnlyX(ctx context.Context) *UserProfile

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

func (*UserProfileQuery) Order

Order specifies how the records should be ordered.

func (*UserProfileQuery) QueryTexture

func (upq *UserProfileQuery) QueryTexture() *TextureQuery

QueryTexture chains the current query on the "texture" edge.

func (*UserProfileQuery) QueryUser

func (upq *UserProfileQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserProfileQuery) QueryUsertexture

func (upq *UserProfileQuery) QueryUsertexture() *UserTextureQuery

QueryUsertexture chains the current query on the "usertexture" edge.

func (*UserProfileQuery) Select

func (upq *UserProfileQuery) Select(fields ...string) *UserProfileSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.UserProfile.Query().
	Select(userprofile.FieldName).
	Scan(ctx, &v)

func (*UserProfileQuery) Unique

func (upq *UserProfileQuery) Unique(unique bool) *UserProfileQuery

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

Where adds a new predicate for the UserProfileQuery builder.

func (*UserProfileQuery) WithTexture

func (upq *UserProfileQuery) WithTexture(opts ...func(*TextureQuery)) *UserProfileQuery

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

func (*UserProfileQuery) WithUser

func (upq *UserProfileQuery) WithUser(opts ...func(*UserQuery)) *UserProfileQuery

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

func (*UserProfileQuery) WithUsertexture

func (upq *UserProfileQuery) WithUsertexture(opts ...func(*UserTextureQuery)) *UserProfileQuery

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

type UserProfileSelect

type UserProfileSelect struct {
	*UserProfileQuery
	// contains filtered or unexported fields
}

UserProfileSelect is the builder for selecting fields of UserProfile entities.

func (*UserProfileSelect) Aggregate

func (ups *UserProfileSelect) Aggregate(fns ...AggregateFunc) *UserProfileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserProfileSelect) Bool

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

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

func (*UserProfileSelect) BoolX

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

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

func (*UserProfileSelect) Bools

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

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

func (*UserProfileSelect) BoolsX

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

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

func (*UserProfileSelect) Float64

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

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

func (*UserProfileSelect) Float64X

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

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

func (*UserProfileSelect) Float64s

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

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

func (*UserProfileSelect) Float64sX

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

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

func (*UserProfileSelect) Int

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

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

func (*UserProfileSelect) IntX

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

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

func (*UserProfileSelect) Ints

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

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

func (*UserProfileSelect) IntsX

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

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

func (*UserProfileSelect) Scan

func (ups *UserProfileSelect) Scan(ctx context.Context, v any) error

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

func (*UserProfileSelect) ScanX

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

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

func (*UserProfileSelect) String

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

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

func (*UserProfileSelect) StringX

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

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

func (*UserProfileSelect) Strings

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

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

func (*UserProfileSelect) StringsX

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

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

type UserProfileUpdate

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

UserProfileUpdate is the builder for updating UserProfile entities.

func (*UserProfileUpdate) AddTexture

func (upu *UserProfileUpdate) AddTexture(t ...*Texture) *UserProfileUpdate

AddTexture adds the "texture" edges to the Texture entity.

func (*UserProfileUpdate) AddTextureIDs

func (upu *UserProfileUpdate) AddTextureIDs(ids ...int) *UserProfileUpdate

AddTextureIDs adds the "texture" edge to the Texture entity by IDs.

func (*UserProfileUpdate) AddUsertexture

func (upu *UserProfileUpdate) AddUsertexture(u ...*UserTexture) *UserProfileUpdate

AddUsertexture adds the "usertexture" edges to the UserTexture entity.

func (*UserProfileUpdate) AddUsertextureIDs

func (upu *UserProfileUpdate) AddUsertextureIDs(ids ...int) *UserProfileUpdate

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by IDs.

func (*UserProfileUpdate) ClearTexture

func (upu *UserProfileUpdate) ClearTexture() *UserProfileUpdate

ClearTexture clears all "texture" edges to the Texture entity.

func (*UserProfileUpdate) ClearUser

func (upu *UserProfileUpdate) ClearUser() *UserProfileUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserProfileUpdate) ClearUsertexture

func (upu *UserProfileUpdate) ClearUsertexture() *UserProfileUpdate

ClearUsertexture clears all "usertexture" edges to the UserTexture entity.

func (*UserProfileUpdate) Exec

func (upu *UserProfileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserProfileUpdate) ExecX

func (upu *UserProfileUpdate) ExecX(ctx context.Context)

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

func (*UserProfileUpdate) Mutation

func (upu *UserProfileUpdate) Mutation() *UserProfileMutation

Mutation returns the UserProfileMutation object of the builder.

func (*UserProfileUpdate) RemoveTexture

func (upu *UserProfileUpdate) RemoveTexture(t ...*Texture) *UserProfileUpdate

RemoveTexture removes "texture" edges to Texture entities.

func (*UserProfileUpdate) RemoveTextureIDs

func (upu *UserProfileUpdate) RemoveTextureIDs(ids ...int) *UserProfileUpdate

RemoveTextureIDs removes the "texture" edge to Texture entities by IDs.

func (*UserProfileUpdate) RemoveUsertexture

func (upu *UserProfileUpdate) RemoveUsertexture(u ...*UserTexture) *UserProfileUpdate

RemoveUsertexture removes "usertexture" edges to UserTexture entities.

func (*UserProfileUpdate) RemoveUsertextureIDs

func (upu *UserProfileUpdate) RemoveUsertextureIDs(ids ...int) *UserProfileUpdate

RemoveUsertextureIDs removes the "usertexture" edge to UserTexture entities by IDs.

func (*UserProfileUpdate) Save

func (upu *UserProfileUpdate) Save(ctx context.Context) (int, error)

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

func (*UserProfileUpdate) SaveX

func (upu *UserProfileUpdate) SaveX(ctx context.Context) int

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

func (*UserProfileUpdate) SetName

func (upu *UserProfileUpdate) SetName(s string) *UserProfileUpdate

SetName sets the "name" field.

func (*UserProfileUpdate) SetUUID

func (upu *UserProfileUpdate) SetUUID(s string) *UserProfileUpdate

SetUUID sets the "uuid" field.

func (*UserProfileUpdate) SetUser

func (upu *UserProfileUpdate) SetUser(u *User) *UserProfileUpdate

SetUser sets the "user" edge to the User entity.

func (*UserProfileUpdate) SetUserID

func (upu *UserProfileUpdate) SetUserID(id int) *UserProfileUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*UserProfileUpdate) Where

Where appends a list predicates to the UserProfileUpdate builder.

type UserProfileUpdateOne

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

UserProfileUpdateOne is the builder for updating a single UserProfile entity.

func (*UserProfileUpdateOne) AddTexture

func (upuo *UserProfileUpdateOne) AddTexture(t ...*Texture) *UserProfileUpdateOne

AddTexture adds the "texture" edges to the Texture entity.

func (*UserProfileUpdateOne) AddTextureIDs

func (upuo *UserProfileUpdateOne) AddTextureIDs(ids ...int) *UserProfileUpdateOne

AddTextureIDs adds the "texture" edge to the Texture entity by IDs.

func (*UserProfileUpdateOne) AddUsertexture

func (upuo *UserProfileUpdateOne) AddUsertexture(u ...*UserTexture) *UserProfileUpdateOne

AddUsertexture adds the "usertexture" edges to the UserTexture entity.

func (*UserProfileUpdateOne) AddUsertextureIDs

func (upuo *UserProfileUpdateOne) AddUsertextureIDs(ids ...int) *UserProfileUpdateOne

AddUsertextureIDs adds the "usertexture" edge to the UserTexture entity by IDs.

func (*UserProfileUpdateOne) ClearTexture

func (upuo *UserProfileUpdateOne) ClearTexture() *UserProfileUpdateOne

ClearTexture clears all "texture" edges to the Texture entity.

func (*UserProfileUpdateOne) ClearUser

func (upuo *UserProfileUpdateOne) ClearUser() *UserProfileUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*UserProfileUpdateOne) ClearUsertexture

func (upuo *UserProfileUpdateOne) ClearUsertexture() *UserProfileUpdateOne

ClearUsertexture clears all "usertexture" edges to the UserTexture entity.

func (*UserProfileUpdateOne) Exec

func (upuo *UserProfileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserProfileUpdateOne) ExecX

func (upuo *UserProfileUpdateOne) ExecX(ctx context.Context)

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

func (*UserProfileUpdateOne) Mutation

func (upuo *UserProfileUpdateOne) Mutation() *UserProfileMutation

Mutation returns the UserProfileMutation object of the builder.

func (*UserProfileUpdateOne) RemoveTexture

func (upuo *UserProfileUpdateOne) RemoveTexture(t ...*Texture) *UserProfileUpdateOne

RemoveTexture removes "texture" edges to Texture entities.

func (*UserProfileUpdateOne) RemoveTextureIDs

func (upuo *UserProfileUpdateOne) RemoveTextureIDs(ids ...int) *UserProfileUpdateOne

RemoveTextureIDs removes the "texture" edge to Texture entities by IDs.

func (*UserProfileUpdateOne) RemoveUsertexture

func (upuo *UserProfileUpdateOne) RemoveUsertexture(u ...*UserTexture) *UserProfileUpdateOne

RemoveUsertexture removes "usertexture" edges to UserTexture entities.

func (*UserProfileUpdateOne) RemoveUsertextureIDs

func (upuo *UserProfileUpdateOne) RemoveUsertextureIDs(ids ...int) *UserProfileUpdateOne

RemoveUsertextureIDs removes the "usertexture" edge to UserTexture entities by IDs.

func (*UserProfileUpdateOne) Save

Save executes the query and returns the updated UserProfile entity.

func (*UserProfileUpdateOne) SaveX

func (upuo *UserProfileUpdateOne) SaveX(ctx context.Context) *UserProfile

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

func (*UserProfileUpdateOne) Select

func (upuo *UserProfileUpdateOne) Select(field string, fields ...string) *UserProfileUpdateOne

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

func (*UserProfileUpdateOne) SetName

SetName sets the "name" field.

func (*UserProfileUpdateOne) SetUUID

SetUUID sets the "uuid" field.

func (*UserProfileUpdateOne) SetUser

func (upuo *UserProfileUpdateOne) SetUser(u *User) *UserProfileUpdateOne

SetUser sets the "user" edge to the User entity.

func (*UserProfileUpdateOne) SetUserID

func (upuo *UserProfileUpdateOne) SetUserID(id int) *UserProfileUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*UserProfileUpdateOne) Where

Where appends a list predicates to the UserProfileUpdate builder.

type UserProfiles

type UserProfiles []*UserProfile

UserProfiles is a parsable slice of UserProfile.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

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

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

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

All executes the query and returns a list of Users.

func (*UserQuery) AllX

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

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

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

Count returns the count of the given query.

func (*UserQuery) CountX

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

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

func (*UserQuery) Exist

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

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

func (*UserQuery) ExistX

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

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserQuery) FirstIDX

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

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

func (*UserQuery) FirstX

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

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

func (*UserQuery) ForShare

func (uq *UserQuery) ForShare(opts ...sql.LockOption) *UserQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserQuery) ForShareA

func (uq *UserQuery) ForShareA(opts ...sql.LockOption) *UserQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserQuery) ForUpdate

func (uq *UserQuery) ForUpdate(opts ...sql.LockOption) *UserQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserQuery) ForUpdateA

func (uq *UserQuery) ForUpdateA(opts ...sql.LockOption) *UserQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

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

client.User.Query().
	GroupBy(user.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

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

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

func (*UserQuery) IDsX

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

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

func (*UserQuery) Limit

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

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

func (*UserQuery) Offset

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

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserQuery) OnlyIDX

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

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

func (*UserQuery) OnlyX

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

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

func (*UserQuery) Order

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

Order specifies how the records should be ordered.

func (*UserQuery) QueryCreatedTexture

func (uq *UserQuery) QueryCreatedTexture() *TextureQuery

QueryCreatedTexture chains the current query on the "created_texture" edge.

func (*UserQuery) QueryProfile

func (uq *UserQuery) QueryProfile() *UserProfileQuery

QueryProfile chains the current query on the "profile" edge.

func (*UserQuery) QueryToken

func (uq *UserQuery) QueryToken() *UserTokenQuery

QueryToken chains the current query on the "token" 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 {
	Email string `json:"email,omitempty"`
}

client.User.Query().
	Select(user.FieldEmail).
	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) WithCreatedTexture

func (uq *UserQuery) WithCreatedTexture(opts ...func(*TextureQuery)) *UserQuery

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

func (*UserQuery) WithProfile

func (uq *UserQuery) WithProfile(opts ...func(*UserProfileQuery)) *UserQuery

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

func (*UserQuery) WithToken

func (uq *UserQuery) WithToken(opts ...func(*UserTokenQuery)) *UserQuery

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

type UserSelect

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

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserTexture

type UserTexture struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserProfileID holds the value of the "user_profile_id" field.
	UserProfileID int `json:"user_profile_id,omitempty"`
	// TextureID holds the value of the "texture_id" field.
	TextureID int `json:"texture_id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Variant holds the value of the "variant" field.
	Variant string `json:"variant,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserTextureQuery when eager-loading is set.
	Edges UserTextureEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserTexture is the model entity for the UserTexture schema.

func (*UserTexture) QueryTexture

func (ut *UserTexture) QueryTexture() *TextureQuery

QueryTexture queries the "texture" edge of the UserTexture entity.

func (*UserTexture) QueryUserProfile

func (ut *UserTexture) QueryUserProfile() *UserProfileQuery

QueryUserProfile queries the "user_profile" edge of the UserTexture entity.

func (*UserTexture) String

func (ut *UserTexture) String() string

String implements the fmt.Stringer.

func (*UserTexture) Unwrap

func (ut *UserTexture) Unwrap() *UserTexture

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

func (ut *UserTexture) Update() *UserTextureUpdateOne

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

func (*UserTexture) Value

func (ut *UserTexture) Value(name string) (ent.Value, error)

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

type UserTextureClient

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

UserTextureClient is a client for the UserTexture schema.

func NewUserTextureClient

func NewUserTextureClient(c config) *UserTextureClient

NewUserTextureClient returns a client for the UserTexture from the given config.

func (*UserTextureClient) Create

func (c *UserTextureClient) Create() *UserTextureCreate

Create returns a builder for creating a UserTexture entity.

func (*UserTextureClient) CreateBulk

func (c *UserTextureClient) CreateBulk(builders ...*UserTextureCreate) *UserTextureCreateBulk

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

func (*UserTextureClient) Delete

func (c *UserTextureClient) Delete() *UserTextureDelete

Delete returns a delete builder for UserTexture.

func (*UserTextureClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserTextureClient) DeleteOneID

func (c *UserTextureClient) DeleteOneID(id int) *UserTextureDeleteOne

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

func (*UserTextureClient) Get

func (c *UserTextureClient) Get(ctx context.Context, id int) (*UserTexture, error)

Get returns a UserTexture entity by its id.

func (*UserTextureClient) GetX

func (c *UserTextureClient) GetX(ctx context.Context, id int) *UserTexture

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

func (*UserTextureClient) Hooks

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

Hooks returns the client hooks.

func (*UserTextureClient) Intercept

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

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

func (*UserTextureClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserTextureClient) Query

func (c *UserTextureClient) Query() *UserTextureQuery

Query returns a query builder for UserTexture.

func (*UserTextureClient) QueryTexture

func (c *UserTextureClient) QueryTexture(ut *UserTexture) *TextureQuery

QueryTexture queries the texture edge of a UserTexture.

func (*UserTextureClient) QueryUserProfile

func (c *UserTextureClient) QueryUserProfile(ut *UserTexture) *UserProfileQuery

QueryUserProfile queries the user_profile edge of a UserTexture.

func (*UserTextureClient) Update

func (c *UserTextureClient) Update() *UserTextureUpdate

Update returns an update builder for UserTexture.

func (*UserTextureClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserTextureClient) UpdateOneID

func (c *UserTextureClient) UpdateOneID(id int) *UserTextureUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserTextureClient) Use

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

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

type UserTextureCreate

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

UserTextureCreate is the builder for creating a UserTexture entity.

func (*UserTextureCreate) Exec

func (utc *UserTextureCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTextureCreate) ExecX

func (utc *UserTextureCreate) ExecX(ctx context.Context)

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

func (*UserTextureCreate) Mutation

func (utc *UserTextureCreate) Mutation() *UserTextureMutation

Mutation returns the UserTextureMutation object of the builder.

func (*UserTextureCreate) Save

func (utc *UserTextureCreate) Save(ctx context.Context) (*UserTexture, error)

Save creates the UserTexture in the database.

func (*UserTextureCreate) SaveX

func (utc *UserTextureCreate) SaveX(ctx context.Context) *UserTexture

SaveX calls Save and panics if Save returns an error.

func (*UserTextureCreate) SetTexture

func (utc *UserTextureCreate) SetTexture(t *Texture) *UserTextureCreate

SetTexture sets the "texture" edge to the Texture entity.

func (*UserTextureCreate) SetTextureID

func (utc *UserTextureCreate) SetTextureID(i int) *UserTextureCreate

SetTextureID sets the "texture_id" field.

func (*UserTextureCreate) SetType

func (utc *UserTextureCreate) SetType(s string) *UserTextureCreate

SetType sets the "type" field.

func (*UserTextureCreate) SetUserProfile

func (utc *UserTextureCreate) SetUserProfile(u *UserProfile) *UserTextureCreate

SetUserProfile sets the "user_profile" edge to the UserProfile entity.

func (*UserTextureCreate) SetUserProfileID

func (utc *UserTextureCreate) SetUserProfileID(i int) *UserTextureCreate

SetUserProfileID sets the "user_profile_id" field.

func (*UserTextureCreate) SetVariant

func (utc *UserTextureCreate) SetVariant(s string) *UserTextureCreate

SetVariant sets the "variant" field.

type UserTextureCreateBulk

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

UserTextureCreateBulk is the builder for creating many UserTexture entities in bulk.

func (*UserTextureCreateBulk) Exec

func (utcb *UserTextureCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTextureCreateBulk) ExecX

func (utcb *UserTextureCreateBulk) ExecX(ctx context.Context)

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

func (*UserTextureCreateBulk) Save

func (utcb *UserTextureCreateBulk) Save(ctx context.Context) ([]*UserTexture, error)

Save creates the UserTexture entities in the database.

func (*UserTextureCreateBulk) SaveX

func (utcb *UserTextureCreateBulk) SaveX(ctx context.Context) []*UserTexture

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

type UserTextureDelete

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

UserTextureDelete is the builder for deleting a UserTexture entity.

func (*UserTextureDelete) Exec

func (utd *UserTextureDelete) Exec(ctx context.Context) (int, error)

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

func (*UserTextureDelete) ExecX

func (utd *UserTextureDelete) ExecX(ctx context.Context) int

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

func (*UserTextureDelete) Where

Where appends a list predicates to the UserTextureDelete builder.

type UserTextureDeleteOne

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

UserTextureDeleteOne is the builder for deleting a single UserTexture entity.

func (*UserTextureDeleteOne) Exec

func (utdo *UserTextureDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserTextureDeleteOne) ExecX

func (utdo *UserTextureDeleteOne) ExecX(ctx context.Context)

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

func (*UserTextureDeleteOne) Where

Where appends a list predicates to the UserTextureDelete builder.

type UserTextureEdges

type UserTextureEdges struct {
	// UserProfile holds the value of the user_profile edge.
	UserProfile *UserProfile `json:"user_profile,omitempty"`
	// Texture holds the value of the texture edge.
	Texture *Texture `json:"texture,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserTextureEdges) TextureOrErr

func (e UserTextureEdges) TextureOrErr() (*Texture, error)

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

func (UserTextureEdges) UserProfileOrErr

func (e UserTextureEdges) UserProfileOrErr() (*UserProfile, error)

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

type UserTextureGroupBy

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

UserTextureGroupBy is the group-by builder for UserTexture entities.

func (*UserTextureGroupBy) Aggregate

func (utgb *UserTextureGroupBy) Aggregate(fns ...AggregateFunc) *UserTextureGroupBy

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

func (*UserTextureGroupBy) Bool

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

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

func (*UserTextureGroupBy) BoolX

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

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

func (*UserTextureGroupBy) Bools

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

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

func (*UserTextureGroupBy) BoolsX

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

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

func (*UserTextureGroupBy) Float64

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

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

func (*UserTextureGroupBy) Float64X

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

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

func (*UserTextureGroupBy) Float64s

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

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

func (*UserTextureGroupBy) Float64sX

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

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

func (*UserTextureGroupBy) Int

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

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

func (*UserTextureGroupBy) IntX

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

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

func (*UserTextureGroupBy) Ints

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

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

func (*UserTextureGroupBy) IntsX

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

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

func (*UserTextureGroupBy) Scan

func (utgb *UserTextureGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserTextureGroupBy) ScanX

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

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

func (*UserTextureGroupBy) String

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

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

func (*UserTextureGroupBy) StringX

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

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

func (*UserTextureGroupBy) Strings

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

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

func (*UserTextureGroupBy) StringsX

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

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

type UserTextureMutation

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

UserTextureMutation represents an operation that mutates the UserTexture nodes in the graph.

func (*UserTextureMutation) AddField

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

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

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

func (*UserTextureMutation) AddedField

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

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

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

func (*UserTextureMutation) AddedIDs

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

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

func (*UserTextureMutation) ClearEdge

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

func (m *UserTextureMutation) 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 (*UserTextureMutation) ClearTexture

func (m *UserTextureMutation) ClearTexture()

ClearTexture clears the "texture" edge to the Texture entity.

func (*UserTextureMutation) ClearUserProfile

func (m *UserTextureMutation) ClearUserProfile()

ClearUserProfile clears the "user_profile" edge to the UserProfile entity.

func (*UserTextureMutation) ClearedEdges

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

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

func (*UserTextureMutation) ClearedFields

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

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

func (UserTextureMutation) Client

func (m UserTextureMutation) 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 (*UserTextureMutation) EdgeCleared

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

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

func (*UserTextureMutation) Field

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

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

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

func (*UserTextureMutation) Fields

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

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

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

func (*UserTextureMutation) ID

func (m *UserTextureMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserTextureMutation) IDs

func (m *UserTextureMutation) IDs(ctx context.Context) ([]int, error)

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

func (*UserTextureMutation) OldField

func (m *UserTextureMutation) 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 (*UserTextureMutation) OldTextureID

func (m *UserTextureMutation) OldTextureID(ctx context.Context) (v int, err error)

OldTextureID returns the old "texture_id" field's value of the UserTexture entity. If the UserTexture 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 (*UserTextureMutation) OldType

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

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

func (m *UserTextureMutation) OldUserProfileID(ctx context.Context) (v int, err error)

OldUserProfileID returns the old "user_profile_id" field's value of the UserTexture entity. If the UserTexture 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 (*UserTextureMutation) OldVariant

func (m *UserTextureMutation) OldVariant(ctx context.Context) (v string, err error)

OldVariant returns the old "variant" field's value of the UserTexture entity. If the UserTexture 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 (*UserTextureMutation) Op

func (m *UserTextureMutation) Op() Op

Op returns the operation name.

func (*UserTextureMutation) RemovedEdges

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

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

func (*UserTextureMutation) RemovedIDs

func (m *UserTextureMutation) 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 (*UserTextureMutation) ResetEdge

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

func (m *UserTextureMutation) 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 (*UserTextureMutation) ResetTexture

func (m *UserTextureMutation) ResetTexture()

ResetTexture resets all changes to the "texture" edge.

func (*UserTextureMutation) ResetTextureID

func (m *UserTextureMutation) ResetTextureID()

ResetTextureID resets all changes to the "texture_id" field.

func (*UserTextureMutation) ResetType

func (m *UserTextureMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*UserTextureMutation) ResetUserProfile

func (m *UserTextureMutation) ResetUserProfile()

ResetUserProfile resets all changes to the "user_profile" edge.

func (*UserTextureMutation) ResetUserProfileID

func (m *UserTextureMutation) ResetUserProfileID()

ResetUserProfileID resets all changes to the "user_profile_id" field.

func (*UserTextureMutation) ResetVariant

func (m *UserTextureMutation) ResetVariant()

ResetVariant resets all changes to the "variant" field.

func (*UserTextureMutation) SetField

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

func (m *UserTextureMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserTextureMutation) SetTextureID

func (m *UserTextureMutation) SetTextureID(i int)

SetTextureID sets the "texture_id" field.

func (*UserTextureMutation) SetType

func (m *UserTextureMutation) SetType(s string)

SetType sets the "type" field.

func (*UserTextureMutation) SetUserProfileID

func (m *UserTextureMutation) SetUserProfileID(i int)

SetUserProfileID sets the "user_profile_id" field.

func (*UserTextureMutation) SetVariant

func (m *UserTextureMutation) SetVariant(s string)

SetVariant sets the "variant" field.

func (*UserTextureMutation) TextureCleared

func (m *UserTextureMutation) TextureCleared() bool

TextureCleared reports if the "texture" edge to the Texture entity was cleared.

func (*UserTextureMutation) TextureID

func (m *UserTextureMutation) TextureID() (r int, exists bool)

TextureID returns the value of the "texture_id" field in the mutation.

func (*UserTextureMutation) TextureIDs

func (m *UserTextureMutation) TextureIDs() (ids []int)

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

func (UserTextureMutation) Tx

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

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

func (*UserTextureMutation) Type

func (m *UserTextureMutation) Type() string

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

func (*UserTextureMutation) UserProfileCleared

func (m *UserTextureMutation) UserProfileCleared() bool

UserProfileCleared reports if the "user_profile" edge to the UserProfile entity was cleared.

func (*UserTextureMutation) UserProfileID

func (m *UserTextureMutation) UserProfileID() (r int, exists bool)

UserProfileID returns the value of the "user_profile_id" field in the mutation.

func (*UserTextureMutation) UserProfileIDs

func (m *UserTextureMutation) UserProfileIDs() (ids []int)

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

func (*UserTextureMutation) Variant

func (m *UserTextureMutation) Variant() (r string, exists bool)

Variant returns the value of the "variant" field in the mutation.

func (*UserTextureMutation) Where

func (m *UserTextureMutation) Where(ps ...predicate.UserTexture)

Where appends a list predicates to the UserTextureMutation builder.

func (*UserTextureMutation) WhereP

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

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

type UserTextureQuery

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

UserTextureQuery is the builder for querying UserTexture entities.

func (*UserTextureQuery) Aggregate

func (utq *UserTextureQuery) Aggregate(fns ...AggregateFunc) *UserTextureSelect

Aggregate returns a UserTextureSelect configured with the given aggregations.

func (*UserTextureQuery) All

func (utq *UserTextureQuery) All(ctx context.Context) ([]*UserTexture, error)

All executes the query and returns a list of UserTextures.

func (*UserTextureQuery) AllX

func (utq *UserTextureQuery) AllX(ctx context.Context) []*UserTexture

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

func (*UserTextureQuery) Clone

func (utq *UserTextureQuery) Clone() *UserTextureQuery

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

func (*UserTextureQuery) Count

func (utq *UserTextureQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserTextureQuery) CountX

func (utq *UserTextureQuery) CountX(ctx context.Context) int

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

func (*UserTextureQuery) Exist

func (utq *UserTextureQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserTextureQuery) ExistX

func (utq *UserTextureQuery) ExistX(ctx context.Context) bool

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

func (*UserTextureQuery) First

func (utq *UserTextureQuery) First(ctx context.Context) (*UserTexture, error)

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

func (*UserTextureQuery) FirstID

func (utq *UserTextureQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserTextureQuery) FirstIDX

func (utq *UserTextureQuery) FirstIDX(ctx context.Context) int

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

func (*UserTextureQuery) FirstX

func (utq *UserTextureQuery) FirstX(ctx context.Context) *UserTexture

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

func (*UserTextureQuery) ForShare

func (utq *UserTextureQuery) ForShare(opts ...sql.LockOption) *UserTextureQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserTextureQuery) ForShareA

func (utq *UserTextureQuery) ForShareA(opts ...sql.LockOption) *UserTextureQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserTextureQuery) ForUpdate

func (utq *UserTextureQuery) ForUpdate(opts ...sql.LockOption) *UserTextureQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserTextureQuery) ForUpdateA

func (utq *UserTextureQuery) ForUpdateA(opts ...sql.LockOption) *UserTextureQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserTextureQuery) GroupBy

func (utq *UserTextureQuery) GroupBy(field string, fields ...string) *UserTextureGroupBy

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

client.UserTexture.Query().
	GroupBy(usertexture.FieldUserProfileID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserTextureQuery) IDs

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

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

func (*UserTextureQuery) IDsX

func (utq *UserTextureQuery) IDsX(ctx context.Context) []int

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

func (*UserTextureQuery) Limit

func (utq *UserTextureQuery) Limit(limit int) *UserTextureQuery

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

func (*UserTextureQuery) Offset

func (utq *UserTextureQuery) Offset(offset int) *UserTextureQuery

Offset to start from.

func (*UserTextureQuery) Only

func (utq *UserTextureQuery) Only(ctx context.Context) (*UserTexture, error)

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

func (*UserTextureQuery) OnlyID

func (utq *UserTextureQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserTextureQuery) OnlyIDX

func (utq *UserTextureQuery) OnlyIDX(ctx context.Context) int

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

func (*UserTextureQuery) OnlyX

func (utq *UserTextureQuery) OnlyX(ctx context.Context) *UserTexture

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

func (*UserTextureQuery) Order

Order specifies how the records should be ordered.

func (*UserTextureQuery) QueryTexture

func (utq *UserTextureQuery) QueryTexture() *TextureQuery

QueryTexture chains the current query on the "texture" edge.

func (*UserTextureQuery) QueryUserProfile

func (utq *UserTextureQuery) QueryUserProfile() *UserProfileQuery

QueryUserProfile chains the current query on the "user_profile" edge.

func (*UserTextureQuery) Select

func (utq *UserTextureQuery) Select(fields ...string) *UserTextureSelect

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

client.UserTexture.Query().
	Select(usertexture.FieldUserProfileID).
	Scan(ctx, &v)

func (*UserTextureQuery) Unique

func (utq *UserTextureQuery) Unique(unique bool) *UserTextureQuery

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

Where adds a new predicate for the UserTextureQuery builder.

func (*UserTextureQuery) WithTexture

func (utq *UserTextureQuery) WithTexture(opts ...func(*TextureQuery)) *UserTextureQuery

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

func (*UserTextureQuery) WithUserProfile

func (utq *UserTextureQuery) WithUserProfile(opts ...func(*UserProfileQuery)) *UserTextureQuery

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

type UserTextureSelect

type UserTextureSelect struct {
	*UserTextureQuery
	// contains filtered or unexported fields
}

UserTextureSelect is the builder for selecting fields of UserTexture entities.

func (*UserTextureSelect) Aggregate

func (uts *UserTextureSelect) Aggregate(fns ...AggregateFunc) *UserTextureSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserTextureSelect) Bool

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

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

func (*UserTextureSelect) BoolX

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

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

func (*UserTextureSelect) Bools

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

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

func (*UserTextureSelect) BoolsX

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

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

func (*UserTextureSelect) Float64

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

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

func (*UserTextureSelect) Float64X

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

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

func (*UserTextureSelect) Float64s

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

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

func (*UserTextureSelect) Float64sX

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

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

func (*UserTextureSelect) Int

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

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

func (*UserTextureSelect) IntX

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

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

func (*UserTextureSelect) Ints

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

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

func (*UserTextureSelect) IntsX

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

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

func (*UserTextureSelect) Scan

func (uts *UserTextureSelect) Scan(ctx context.Context, v any) error

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

func (*UserTextureSelect) ScanX

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

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

func (*UserTextureSelect) String

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

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

func (*UserTextureSelect) StringX

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

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

func (*UserTextureSelect) Strings

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

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

func (*UserTextureSelect) StringsX

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

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

type UserTextureUpdate

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

UserTextureUpdate is the builder for updating UserTexture entities.

func (*UserTextureUpdate) ClearTexture

func (utu *UserTextureUpdate) ClearTexture() *UserTextureUpdate

ClearTexture clears the "texture" edge to the Texture entity.

func (*UserTextureUpdate) ClearUserProfile

func (utu *UserTextureUpdate) ClearUserProfile() *UserTextureUpdate

ClearUserProfile clears the "user_profile" edge to the UserProfile entity.

func (*UserTextureUpdate) Exec

func (utu *UserTextureUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTextureUpdate) ExecX

func (utu *UserTextureUpdate) ExecX(ctx context.Context)

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

func (*UserTextureUpdate) Mutation

func (utu *UserTextureUpdate) Mutation() *UserTextureMutation

Mutation returns the UserTextureMutation object of the builder.

func (*UserTextureUpdate) Save

func (utu *UserTextureUpdate) Save(ctx context.Context) (int, error)

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

func (*UserTextureUpdate) SaveX

func (utu *UserTextureUpdate) SaveX(ctx context.Context) int

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

func (*UserTextureUpdate) SetTexture

func (utu *UserTextureUpdate) SetTexture(t *Texture) *UserTextureUpdate

SetTexture sets the "texture" edge to the Texture entity.

func (*UserTextureUpdate) SetTextureID

func (utu *UserTextureUpdate) SetTextureID(i int) *UserTextureUpdate

SetTextureID sets the "texture_id" field.

func (*UserTextureUpdate) SetType

func (utu *UserTextureUpdate) SetType(s string) *UserTextureUpdate

SetType sets the "type" field.

func (*UserTextureUpdate) SetUserProfile

func (utu *UserTextureUpdate) SetUserProfile(u *UserProfile) *UserTextureUpdate

SetUserProfile sets the "user_profile" edge to the UserProfile entity.

func (*UserTextureUpdate) SetUserProfileID

func (utu *UserTextureUpdate) SetUserProfileID(i int) *UserTextureUpdate

SetUserProfileID sets the "user_profile_id" field.

func (*UserTextureUpdate) SetVariant

func (utu *UserTextureUpdate) SetVariant(s string) *UserTextureUpdate

SetVariant sets the "variant" field.

func (*UserTextureUpdate) Where

Where appends a list predicates to the UserTextureUpdate builder.

type UserTextureUpdateOne

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

UserTextureUpdateOne is the builder for updating a single UserTexture entity.

func (*UserTextureUpdateOne) ClearTexture

func (utuo *UserTextureUpdateOne) ClearTexture() *UserTextureUpdateOne

ClearTexture clears the "texture" edge to the Texture entity.

func (*UserTextureUpdateOne) ClearUserProfile

func (utuo *UserTextureUpdateOne) ClearUserProfile() *UserTextureUpdateOne

ClearUserProfile clears the "user_profile" edge to the UserProfile entity.

func (*UserTextureUpdateOne) Exec

func (utuo *UserTextureUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserTextureUpdateOne) ExecX

func (utuo *UserTextureUpdateOne) ExecX(ctx context.Context)

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

func (*UserTextureUpdateOne) Mutation

func (utuo *UserTextureUpdateOne) Mutation() *UserTextureMutation

Mutation returns the UserTextureMutation object of the builder.

func (*UserTextureUpdateOne) Save

Save executes the query and returns the updated UserTexture entity.

func (*UserTextureUpdateOne) SaveX

func (utuo *UserTextureUpdateOne) SaveX(ctx context.Context) *UserTexture

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

func (*UserTextureUpdateOne) Select

func (utuo *UserTextureUpdateOne) Select(field string, fields ...string) *UserTextureUpdateOne

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

func (*UserTextureUpdateOne) SetTexture

func (utuo *UserTextureUpdateOne) SetTexture(t *Texture) *UserTextureUpdateOne

SetTexture sets the "texture" edge to the Texture entity.

func (*UserTextureUpdateOne) SetTextureID

func (utuo *UserTextureUpdateOne) SetTextureID(i int) *UserTextureUpdateOne

SetTextureID sets the "texture_id" field.

func (*UserTextureUpdateOne) SetType

SetType sets the "type" field.

func (*UserTextureUpdateOne) SetUserProfile

func (utuo *UserTextureUpdateOne) SetUserProfile(u *UserProfile) *UserTextureUpdateOne

SetUserProfile sets the "user_profile" edge to the UserProfile entity.

func (*UserTextureUpdateOne) SetUserProfileID

func (utuo *UserTextureUpdateOne) SetUserProfileID(i int) *UserTextureUpdateOne

SetUserProfileID sets the "user_profile_id" field.

func (*UserTextureUpdateOne) SetVariant

func (utuo *UserTextureUpdateOne) SetVariant(s string) *UserTextureUpdateOne

SetVariant sets the "variant" field.

func (*UserTextureUpdateOne) Where

Where appends a list predicates to the UserTextureUpdate builder.

type UserTextures

type UserTextures []*UserTexture

UserTextures is a parsable slice of UserTexture.

type UserToken

type UserToken struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// TokenID holds the value of the "token_id" field.
	TokenID uint64 `json:"token_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserTokenQuery when eager-loading is set.
	Edges UserTokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserToken is the model entity for the UserToken schema.

func (*UserToken) QueryUser

func (ut *UserToken) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserToken entity.

func (*UserToken) String

func (ut *UserToken) String() string

String implements the fmt.Stringer.

func (*UserToken) Unwrap

func (ut *UserToken) Unwrap() *UserToken

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

func (ut *UserToken) Update() *UserTokenUpdateOne

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

func (*UserToken) Value

func (ut *UserToken) Value(name string) (ent.Value, error)

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

type UserTokenClient

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

UserTokenClient is a client for the UserToken schema.

func NewUserTokenClient

func NewUserTokenClient(c config) *UserTokenClient

NewUserTokenClient returns a client for the UserToken from the given config.

func (*UserTokenClient) Create

func (c *UserTokenClient) Create() *UserTokenCreate

Create returns a builder for creating a UserToken entity.

func (*UserTokenClient) CreateBulk

func (c *UserTokenClient) CreateBulk(builders ...*UserTokenCreate) *UserTokenCreateBulk

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

func (*UserTokenClient) Delete

func (c *UserTokenClient) Delete() *UserTokenDelete

Delete returns a delete builder for UserToken.

func (*UserTokenClient) DeleteOne

func (c *UserTokenClient) DeleteOne(ut *UserToken) *UserTokenDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserTokenClient) DeleteOneID

func (c *UserTokenClient) DeleteOneID(id int) *UserTokenDeleteOne

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

func (*UserTokenClient) Get

func (c *UserTokenClient) Get(ctx context.Context, id int) (*UserToken, error)

Get returns a UserToken entity by its id.

func (*UserTokenClient) GetX

func (c *UserTokenClient) GetX(ctx context.Context, id int) *UserToken

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

func (*UserTokenClient) Hooks

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

Hooks returns the client hooks.

func (*UserTokenClient) Intercept

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

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

func (*UserTokenClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserTokenClient) Query

func (c *UserTokenClient) Query() *UserTokenQuery

Query returns a query builder for UserToken.

func (*UserTokenClient) QueryUser

func (c *UserTokenClient) QueryUser(ut *UserToken) *UserQuery

QueryUser queries the user edge of a UserToken.

func (*UserTokenClient) Update

func (c *UserTokenClient) Update() *UserTokenUpdate

Update returns an update builder for UserToken.

func (*UserTokenClient) UpdateOne

func (c *UserTokenClient) UpdateOne(ut *UserToken) *UserTokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserTokenClient) UpdateOneID

func (c *UserTokenClient) UpdateOneID(id int) *UserTokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserTokenClient) Use

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

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

type UserTokenCreate

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

UserTokenCreate is the builder for creating a UserToken entity.

func (*UserTokenCreate) Exec

func (utc *UserTokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTokenCreate) ExecX

func (utc *UserTokenCreate) ExecX(ctx context.Context)

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

func (*UserTokenCreate) Mutation

func (utc *UserTokenCreate) Mutation() *UserTokenMutation

Mutation returns the UserTokenMutation object of the builder.

func (*UserTokenCreate) Save

func (utc *UserTokenCreate) Save(ctx context.Context) (*UserToken, error)

Save creates the UserToken in the database.

func (*UserTokenCreate) SaveX

func (utc *UserTokenCreate) SaveX(ctx context.Context) *UserToken

SaveX calls Save and panics if Save returns an error.

func (*UserTokenCreate) SetNillableUserID

func (utc *UserTokenCreate) SetNillableUserID(id *int) *UserTokenCreate

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

func (*UserTokenCreate) SetTokenID

func (utc *UserTokenCreate) SetTokenID(u uint64) *UserTokenCreate

SetTokenID sets the "token_id" field.

func (*UserTokenCreate) SetUser

func (utc *UserTokenCreate) SetUser(u *User) *UserTokenCreate

SetUser sets the "user" edge to the User entity.

func (*UserTokenCreate) SetUserID

func (utc *UserTokenCreate) SetUserID(id int) *UserTokenCreate

SetUserID sets the "user" edge to the User entity by ID.

type UserTokenCreateBulk

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

UserTokenCreateBulk is the builder for creating many UserToken entities in bulk.

func (*UserTokenCreateBulk) Exec

func (utcb *UserTokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTokenCreateBulk) ExecX

func (utcb *UserTokenCreateBulk) ExecX(ctx context.Context)

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

func (*UserTokenCreateBulk) Save

func (utcb *UserTokenCreateBulk) Save(ctx context.Context) ([]*UserToken, error)

Save creates the UserToken entities in the database.

func (*UserTokenCreateBulk) SaveX

func (utcb *UserTokenCreateBulk) SaveX(ctx context.Context) []*UserToken

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

type UserTokenDelete

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

UserTokenDelete is the builder for deleting a UserToken entity.

func (*UserTokenDelete) Exec

func (utd *UserTokenDelete) Exec(ctx context.Context) (int, error)

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

func (*UserTokenDelete) ExecX

func (utd *UserTokenDelete) ExecX(ctx context.Context) int

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

func (*UserTokenDelete) Where

Where appends a list predicates to the UserTokenDelete builder.

type UserTokenDeleteOne

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

UserTokenDeleteOne is the builder for deleting a single UserToken entity.

func (*UserTokenDeleteOne) Exec

func (utdo *UserTokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserTokenDeleteOne) ExecX

func (utdo *UserTokenDeleteOne) ExecX(ctx context.Context)

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

func (*UserTokenDeleteOne) Where

Where appends a list predicates to the UserTokenDelete builder.

type UserTokenEdges

type UserTokenEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserTokenEdges) UserOrErr

func (e UserTokenEdges) UserOrErr() (*User, error)

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

type UserTokenGroupBy

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

UserTokenGroupBy is the group-by builder for UserToken entities.

func (*UserTokenGroupBy) Aggregate

func (utgb *UserTokenGroupBy) Aggregate(fns ...AggregateFunc) *UserTokenGroupBy

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

func (*UserTokenGroupBy) Bool

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

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

func (*UserTokenGroupBy) BoolX

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

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

func (*UserTokenGroupBy) Bools

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

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

func (*UserTokenGroupBy) BoolsX

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

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

func (*UserTokenGroupBy) Float64

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

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

func (*UserTokenGroupBy) Float64X

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

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

func (*UserTokenGroupBy) Float64s

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

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

func (*UserTokenGroupBy) Float64sX

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

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

func (*UserTokenGroupBy) Int

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

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

func (*UserTokenGroupBy) IntX

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

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

func (*UserTokenGroupBy) Ints

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

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

func (*UserTokenGroupBy) IntsX

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

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

func (*UserTokenGroupBy) Scan

func (utgb *UserTokenGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserTokenGroupBy) ScanX

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

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

func (*UserTokenGroupBy) String

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

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

func (*UserTokenGroupBy) StringX

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

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

func (*UserTokenGroupBy) Strings

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

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

func (*UserTokenGroupBy) StringsX

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

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

type UserTokenMutation

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

UserTokenMutation represents an operation that mutates the UserToken nodes in the graph.

func (*UserTokenMutation) AddField

func (m *UserTokenMutation) 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 (*UserTokenMutation) AddTokenID

func (m *UserTokenMutation) AddTokenID(u int64)

AddTokenID adds u to the "token_id" field.

func (*UserTokenMutation) AddedEdges

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

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

func (*UserTokenMutation) AddedField

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

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

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

func (*UserTokenMutation) AddedIDs

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

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

func (*UserTokenMutation) AddedTokenID

func (m *UserTokenMutation) AddedTokenID() (r int64, exists bool)

AddedTokenID returns the value that was added to the "token_id" field in this mutation.

func (*UserTokenMutation) ClearEdge

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

func (m *UserTokenMutation) 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 (*UserTokenMutation) ClearUser

func (m *UserTokenMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserTokenMutation) ClearedEdges

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

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

func (*UserTokenMutation) ClearedFields

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

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

func (UserTokenMutation) Client

func (m UserTokenMutation) 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 (*UserTokenMutation) EdgeCleared

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

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

func (*UserTokenMutation) Field

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

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

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

func (*UserTokenMutation) Fields

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

func (m *UserTokenMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserTokenMutation) IDs

func (m *UserTokenMutation) IDs(ctx context.Context) ([]int, error)

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

func (*UserTokenMutation) OldField

func (m *UserTokenMutation) 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 (*UserTokenMutation) OldTokenID

func (m *UserTokenMutation) OldTokenID(ctx context.Context) (v uint64, err error)

OldTokenID returns the old "token_id" field's value of the UserToken entity. If the UserToken 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 (*UserTokenMutation) Op

func (m *UserTokenMutation) Op() Op

Op returns the operation name.

func (*UserTokenMutation) RemovedEdges

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

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

func (*UserTokenMutation) RemovedIDs

func (m *UserTokenMutation) 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 (*UserTokenMutation) ResetEdge

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

func (m *UserTokenMutation) 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 (*UserTokenMutation) ResetTokenID

func (m *UserTokenMutation) ResetTokenID()

ResetTokenID resets all changes to the "token_id" field.

func (*UserTokenMutation) ResetUser

func (m *UserTokenMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserTokenMutation) SetField

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

func (m *UserTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserTokenMutation) SetTokenID

func (m *UserTokenMutation) SetTokenID(u uint64)

SetTokenID sets the "token_id" field.

func (*UserTokenMutation) SetUserID

func (m *UserTokenMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*UserTokenMutation) TokenID

func (m *UserTokenMutation) TokenID() (r uint64, exists bool)

TokenID returns the value of the "token_id" field in the mutation.

func (UserTokenMutation) Tx

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

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

func (*UserTokenMutation) Type

func (m *UserTokenMutation) Type() string

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

func (*UserTokenMutation) UserCleared

func (m *UserTokenMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserTokenMutation) UserID

func (m *UserTokenMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*UserTokenMutation) UserIDs

func (m *UserTokenMutation) UserIDs() (ids []int)

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

func (*UserTokenMutation) Where

func (m *UserTokenMutation) Where(ps ...predicate.UserToken)

Where appends a list predicates to the UserTokenMutation builder.

func (*UserTokenMutation) WhereP

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

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

type UserTokenQuery

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

UserTokenQuery is the builder for querying UserToken entities.

func (*UserTokenQuery) Aggregate

func (utq *UserTokenQuery) Aggregate(fns ...AggregateFunc) *UserTokenSelect

Aggregate returns a UserTokenSelect configured with the given aggregations.

func (*UserTokenQuery) All

func (utq *UserTokenQuery) All(ctx context.Context) ([]*UserToken, error)

All executes the query and returns a list of UserTokens.

func (*UserTokenQuery) AllX

func (utq *UserTokenQuery) AllX(ctx context.Context) []*UserToken

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

func (*UserTokenQuery) Clone

func (utq *UserTokenQuery) Clone() *UserTokenQuery

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

func (*UserTokenQuery) Count

func (utq *UserTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserTokenQuery) CountX

func (utq *UserTokenQuery) CountX(ctx context.Context) int

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

func (*UserTokenQuery) Exist

func (utq *UserTokenQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserTokenQuery) ExistX

func (utq *UserTokenQuery) ExistX(ctx context.Context) bool

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

func (*UserTokenQuery) First

func (utq *UserTokenQuery) First(ctx context.Context) (*UserToken, error)

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

func (*UserTokenQuery) FirstID

func (utq *UserTokenQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserTokenQuery) FirstIDX

func (utq *UserTokenQuery) FirstIDX(ctx context.Context) int

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

func (*UserTokenQuery) FirstX

func (utq *UserTokenQuery) FirstX(ctx context.Context) *UserToken

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

func (*UserTokenQuery) ForShare

func (utq *UserTokenQuery) ForShare(opts ...sql.LockOption) *UserTokenQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserTokenQuery) ForShareA

func (utq *UserTokenQuery) ForShareA(opts ...sql.LockOption) *UserTokenQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserTokenQuery) ForUpdate

func (utq *UserTokenQuery) ForUpdate(opts ...sql.LockOption) *UserTokenQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserTokenQuery) ForUpdateA

func (utq *UserTokenQuery) ForUpdateA(opts ...sql.LockOption) *UserTokenQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserTokenQuery) GroupBy

func (utq *UserTokenQuery) GroupBy(field string, fields ...string) *UserTokenGroupBy

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 {
	TokenID uint64 `json:"token_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserToken.Query().
	GroupBy(usertoken.FieldTokenID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserTokenQuery) IDs

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

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

func (*UserTokenQuery) IDsX

func (utq *UserTokenQuery) IDsX(ctx context.Context) []int

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

func (*UserTokenQuery) Limit

func (utq *UserTokenQuery) Limit(limit int) *UserTokenQuery

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

func (*UserTokenQuery) Offset

func (utq *UserTokenQuery) Offset(offset int) *UserTokenQuery

Offset to start from.

func (*UserTokenQuery) Only

func (utq *UserTokenQuery) Only(ctx context.Context) (*UserToken, error)

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

func (*UserTokenQuery) OnlyID

func (utq *UserTokenQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserTokenQuery) OnlyIDX

func (utq *UserTokenQuery) OnlyIDX(ctx context.Context) int

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

func (*UserTokenQuery) OnlyX

func (utq *UserTokenQuery) OnlyX(ctx context.Context) *UserToken

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

func (*UserTokenQuery) Order

Order specifies how the records should be ordered.

func (*UserTokenQuery) QueryUser

func (utq *UserTokenQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserTokenQuery) Select

func (utq *UserTokenQuery) Select(fields ...string) *UserTokenSelect

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 {
	TokenID uint64 `json:"token_id,omitempty"`
}

client.UserToken.Query().
	Select(usertoken.FieldTokenID).
	Scan(ctx, &v)

func (*UserTokenQuery) Unique

func (utq *UserTokenQuery) Unique(unique bool) *UserTokenQuery

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

func (utq *UserTokenQuery) Where(ps ...predicate.UserToken) *UserTokenQuery

Where adds a new predicate for the UserTokenQuery builder.

func (*UserTokenQuery) WithUser

func (utq *UserTokenQuery) WithUser(opts ...func(*UserQuery)) *UserTokenQuery

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

type UserTokenSelect

type UserTokenSelect struct {
	*UserTokenQuery
	// contains filtered or unexported fields
}

UserTokenSelect is the builder for selecting fields of UserToken entities.

func (*UserTokenSelect) Aggregate

func (uts *UserTokenSelect) Aggregate(fns ...AggregateFunc) *UserTokenSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserTokenSelect) Bool

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

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

func (*UserTokenSelect) BoolX

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

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

func (*UserTokenSelect) Bools

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

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

func (*UserTokenSelect) BoolsX

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

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

func (*UserTokenSelect) Float64

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

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

func (*UserTokenSelect) Float64X

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

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

func (*UserTokenSelect) Float64s

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

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

func (*UserTokenSelect) Float64sX

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

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

func (*UserTokenSelect) Int

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

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

func (*UserTokenSelect) IntX

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

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

func (*UserTokenSelect) Ints

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

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

func (*UserTokenSelect) IntsX

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

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

func (*UserTokenSelect) Scan

func (uts *UserTokenSelect) Scan(ctx context.Context, v any) error

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

func (*UserTokenSelect) ScanX

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

ScanX is like Scan, but panics if an error occurs.

func (*UserTokenSelect) String

func (s *UserTokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserTokenSelect) StringX

func (s *UserTokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserTokenSelect) Strings

func (s *UserTokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserTokenSelect) StringsX

func (s *UserTokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserTokenUpdate

type UserTokenUpdate struct {
	// contains filtered or unexported fields
}

UserTokenUpdate is the builder for updating UserToken entities.

func (*UserTokenUpdate) AddTokenID

func (utu *UserTokenUpdate) AddTokenID(u int64) *UserTokenUpdate

AddTokenID adds u to the "token_id" field.

func (*UserTokenUpdate) ClearUser

func (utu *UserTokenUpdate) ClearUser() *UserTokenUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserTokenUpdate) Exec

func (utu *UserTokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTokenUpdate) ExecX

func (utu *UserTokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTokenUpdate) Mutation

func (utu *UserTokenUpdate) Mutation() *UserTokenMutation

Mutation returns the UserTokenMutation object of the builder.

func (*UserTokenUpdate) Save

func (utu *UserTokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserTokenUpdate) SaveX

func (utu *UserTokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserTokenUpdate) SetNillableUserID

func (utu *UserTokenUpdate) SetNillableUserID(id *int) *UserTokenUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*UserTokenUpdate) SetTokenID

func (utu *UserTokenUpdate) SetTokenID(u uint64) *UserTokenUpdate

SetTokenID sets the "token_id" field.

func (*UserTokenUpdate) SetUser

func (utu *UserTokenUpdate) SetUser(u *User) *UserTokenUpdate

SetUser sets the "user" edge to the User entity.

func (*UserTokenUpdate) SetUserID

func (utu *UserTokenUpdate) SetUserID(id int) *UserTokenUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*UserTokenUpdate) Where

Where appends a list predicates to the UserTokenUpdate builder.

type UserTokenUpdateOne

type UserTokenUpdateOne struct {
	// contains filtered or unexported fields
}

UserTokenUpdateOne is the builder for updating a single UserToken entity.

func (*UserTokenUpdateOne) AddTokenID

func (utuo *UserTokenUpdateOne) AddTokenID(u int64) *UserTokenUpdateOne

AddTokenID adds u to the "token_id" field.

func (*UserTokenUpdateOne) ClearUser

func (utuo *UserTokenUpdateOne) ClearUser() *UserTokenUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*UserTokenUpdateOne) Exec

func (utuo *UserTokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserTokenUpdateOne) ExecX

func (utuo *UserTokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserTokenUpdateOne) Mutation

func (utuo *UserTokenUpdateOne) Mutation() *UserTokenMutation

Mutation returns the UserTokenMutation object of the builder.

func (*UserTokenUpdateOne) Save

func (utuo *UserTokenUpdateOne) Save(ctx context.Context) (*UserToken, error)

Save executes the query and returns the updated UserToken entity.

func (*UserTokenUpdateOne) SaveX

func (utuo *UserTokenUpdateOne) SaveX(ctx context.Context) *UserToken

SaveX is like Save, but panics if an error occurs.

func (*UserTokenUpdateOne) Select

func (utuo *UserTokenUpdateOne) Select(field string, fields ...string) *UserTokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserTokenUpdateOne) SetNillableUserID

func (utuo *UserTokenUpdateOne) SetNillableUserID(id *int) *UserTokenUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*UserTokenUpdateOne) SetTokenID

func (utuo *UserTokenUpdateOne) SetTokenID(u uint64) *UserTokenUpdateOne

SetTokenID sets the "token_id" field.

func (*UserTokenUpdateOne) SetUser

func (utuo *UserTokenUpdateOne) SetUser(u *User) *UserTokenUpdateOne

SetUser sets the "user" edge to the User entity.

func (*UserTokenUpdateOne) SetUserID

func (utuo *UserTokenUpdateOne) SetUserID(id int) *UserTokenUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*UserTokenUpdateOne) Where

Where appends a list predicates to the UserTokenUpdate builder.

type UserTokens

type UserTokens []*UserToken

UserTokens is a parsable slice of UserToken.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddCreatedTexture

func (uu *UserUpdate) AddCreatedTexture(t ...*Texture) *UserUpdate

AddCreatedTexture adds the "created_texture" edges to the Texture entity.

func (*UserUpdate) AddCreatedTextureIDs

func (uu *UserUpdate) AddCreatedTextureIDs(ids ...int) *UserUpdate

AddCreatedTextureIDs adds the "created_texture" edge to the Texture entity by IDs.

func (*UserUpdate) AddRegTime

func (uu *UserUpdate) AddRegTime(i int64) *UserUpdate

AddRegTime adds i to the "reg_time" field.

func (*UserUpdate) AddState

func (uu *UserUpdate) AddState(i int) *UserUpdate

AddState adds i to the "state" field.

func (*UserUpdate) ClearCreatedTexture

func (uu *UserUpdate) ClearCreatedTexture() *UserUpdate

ClearCreatedTexture clears all "created_texture" edges to the Texture entity.

func (*UserUpdate) ClearProfile

func (uu *UserUpdate) ClearProfile() *UserUpdate

ClearProfile clears the "profile" edge to the UserProfile entity.

func (*UserUpdate) ClearToken

func (uu *UserUpdate) ClearToken() *UserUpdate

ClearToken clears the "token" edge to the UserToken entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveCreatedTexture

func (uu *UserUpdate) RemoveCreatedTexture(t ...*Texture) *UserUpdate

RemoveCreatedTexture removes "created_texture" edges to Texture entities.

func (*UserUpdate) RemoveCreatedTextureIDs

func (uu *UserUpdate) RemoveCreatedTextureIDs(ids ...int) *UserUpdate

RemoveCreatedTextureIDs removes the "created_texture" edge to Texture entities by IDs.

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) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableProfileID

func (uu *UserUpdate) SetNillableProfileID(id *int) *UserUpdate

SetNillableProfileID sets the "profile" edge to the UserProfile entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableTokenID

func (uu *UserUpdate) SetNillableTokenID(id *int) *UserUpdate

SetNillableTokenID sets the "token" edge to the UserToken entity by ID if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetProfile

func (uu *UserUpdate) SetProfile(u *UserProfile) *UserUpdate

SetProfile sets the "profile" edge to the UserProfile entity.

func (*UserUpdate) SetProfileID

func (uu *UserUpdate) SetProfileID(id int) *UserUpdate

SetProfileID sets the "profile" edge to the UserProfile entity by ID.

func (*UserUpdate) SetRegIP

func (uu *UserUpdate) SetRegIP(s string) *UserUpdate

SetRegIP sets the "reg_ip" field.

func (*UserUpdate) SetRegTime

func (uu *UserUpdate) SetRegTime(i int64) *UserUpdate

SetRegTime sets the "reg_time" field.

func (*UserUpdate) SetSalt

func (uu *UserUpdate) SetSalt(s string) *UserUpdate

SetSalt sets the "salt" field.

func (*UserUpdate) SetState

func (uu *UserUpdate) SetState(i int) *UserUpdate

SetState sets the "state" field.

func (*UserUpdate) SetToken

func (uu *UserUpdate) SetToken(u *UserToken) *UserUpdate

SetToken sets the "token" edge to the UserToken entity.

func (*UserUpdate) SetTokenID

func (uu *UserUpdate) SetTokenID(id int) *UserUpdate

SetTokenID sets the "token" edge to the UserToken entity by ID.

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) AddCreatedTexture

func (uuo *UserUpdateOne) AddCreatedTexture(t ...*Texture) *UserUpdateOne

AddCreatedTexture adds the "created_texture" edges to the Texture entity.

func (*UserUpdateOne) AddCreatedTextureIDs

func (uuo *UserUpdateOne) AddCreatedTextureIDs(ids ...int) *UserUpdateOne

AddCreatedTextureIDs adds the "created_texture" edge to the Texture entity by IDs.

func (*UserUpdateOne) AddRegTime

func (uuo *UserUpdateOne) AddRegTime(i int64) *UserUpdateOne

AddRegTime adds i to the "reg_time" field.

func (*UserUpdateOne) AddState

func (uuo *UserUpdateOne) AddState(i int) *UserUpdateOne

AddState adds i to the "state" field.

func (*UserUpdateOne) ClearCreatedTexture

func (uuo *UserUpdateOne) ClearCreatedTexture() *UserUpdateOne

ClearCreatedTexture clears all "created_texture" edges to the Texture entity.

func (*UserUpdateOne) ClearProfile

func (uuo *UserUpdateOne) ClearProfile() *UserUpdateOne

ClearProfile clears the "profile" edge to the UserProfile entity.

func (*UserUpdateOne) ClearToken

func (uuo *UserUpdateOne) ClearToken() *UserUpdateOne

ClearToken clears the "token" edge to the UserToken entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveCreatedTexture

func (uuo *UserUpdateOne) RemoveCreatedTexture(t ...*Texture) *UserUpdateOne

RemoveCreatedTexture removes "created_texture" edges to Texture entities.

func (*UserUpdateOne) RemoveCreatedTextureIDs

func (uuo *UserUpdateOne) RemoveCreatedTextureIDs(ids ...int) *UserUpdateOne

RemoveCreatedTextureIDs removes the "created_texture" edge to Texture entities by IDs.

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) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableProfileID

func (uuo *UserUpdateOne) SetNillableProfileID(id *int) *UserUpdateOne

SetNillableProfileID sets the "profile" edge to the UserProfile entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableTokenID

func (uuo *UserUpdateOne) SetNillableTokenID(id *int) *UserUpdateOne

SetNillableTokenID sets the "token" edge to the UserToken entity by ID if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetProfile

func (uuo *UserUpdateOne) SetProfile(u *UserProfile) *UserUpdateOne

SetProfile sets the "profile" edge to the UserProfile entity.

func (*UserUpdateOne) SetProfileID

func (uuo *UserUpdateOne) SetProfileID(id int) *UserUpdateOne

SetProfileID sets the "profile" edge to the UserProfile entity by ID.

func (*UserUpdateOne) SetRegIP

func (uuo *UserUpdateOne) SetRegIP(s string) *UserUpdateOne

SetRegIP sets the "reg_ip" field.

func (*UserUpdateOne) SetRegTime

func (uuo *UserUpdateOne) SetRegTime(i int64) *UserUpdateOne

SetRegTime sets the "reg_time" field.

func (*UserUpdateOne) SetSalt

func (uuo *UserUpdateOne) SetSalt(s string) *UserUpdateOne

SetSalt sets the "salt" field.

func (*UserUpdateOne) SetState

func (uuo *UserUpdateOne) SetState(i int) *UserUpdateOne

SetState sets the "state" field.

func (*UserUpdateOne) SetToken

func (uuo *UserUpdateOne) SetToken(u *UserToken) *UserUpdateOne

SetToken sets the "token" edge to the UserToken entity.

func (*UserUpdateOne) SetTokenID

func (uuo *UserUpdateOne) SetTokenID(id int) *UserUpdateOne

SetTokenID sets the "token" edge to the UserToken entity by ID.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL