ent

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 20 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.
	TypeUser       = "User"
	TypeUserConfig = "UserConfig"
	TypeUserTomato = "UserTomato"
)

Variables

This section is empty.

Functions

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
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserConfig is the client for interacting with the UserConfig builders.
	UserConfig *UserConfigClient
	// UserTomato is the client for interacting with the UserTomato builders.
	UserTomato *UserTomatoClient
	// 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().
	User.
	Query().
	Count(ctx)

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(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 Committer 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 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(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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 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(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 Rollbacker method.

type Tx

type Tx struct {

	// User is the client for interacting with the User builders.
	User *UserClient
	// UserConfig is the client for interacting with the UserConfig builders.
	UserConfig *UserConfigClient
	// UserTomato is the client for interacting with the UserTomato builders.
	UserTomato *UserTomatoClient
	// 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"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,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) QueryUserConfigs

func (u *User) QueryUserConfigs() *UserConfigQuery

QueryUserConfigs queries the "user_configs" edge of the User entity.

func (*User) QueryUserTomatoes

func (u *User) QueryUserTomatoes() *UserTomatoQuery

QueryUserTomatoes queries the "user_tomatoes" 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.

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 create builder for User.

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 delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given 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) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryUserConfigs

func (c *UserClient) QueryUserConfigs(u *User) *UserConfigQuery

QueryUserConfigs queries the user_configs edge of a User.

func (*UserClient) QueryUserTomatoes

func (c *UserClient) QueryUserTomatoes(u *User) *UserTomatoQuery

QueryUserTomatoes queries the user_tomatoes 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 UserConfig

type UserConfig struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// Rank holds the value of the "rank" field.
	Rank uint8 `json:"rank,omitempty"`
	// Working holds the value of the "working" field.
	Working uint `json:"working,omitempty"`
	// Break holds the value of the "break" field.
	Break uint `json:"break,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserConfigQuery when eager-loading is set.
	Edges UserConfigEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserConfig is the model entity for the UserConfig schema.

func (*UserConfig) QueryUsers

func (uc *UserConfig) QueryUsers() *UserQuery

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

func (*UserConfig) String

func (uc *UserConfig) String() string

String implements the fmt.Stringer.

func (*UserConfig) Unwrap

func (uc *UserConfig) Unwrap() *UserConfig

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

func (uc *UserConfig) Update() *UserConfigUpdateOne

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

type UserConfigClient

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

UserConfigClient is a client for the UserConfig schema.

func NewUserConfigClient

func NewUserConfigClient(c config) *UserConfigClient

NewUserConfigClient returns a client for the UserConfig from the given config.

func (*UserConfigClient) Create

func (c *UserConfigClient) Create() *UserConfigCreate

Create returns a create builder for UserConfig.

func (*UserConfigClient) CreateBulk

func (c *UserConfigClient) CreateBulk(builders ...*UserConfigCreate) *UserConfigCreateBulk

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

func (*UserConfigClient) Delete

func (c *UserConfigClient) Delete() *UserConfigDelete

Delete returns a delete builder for UserConfig.

func (*UserConfigClient) DeleteOne

func (c *UserConfigClient) DeleteOne(uc *UserConfig) *UserConfigDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserConfigClient) DeleteOneID

func (c *UserConfigClient) DeleteOneID(id int) *UserConfigDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserConfigClient) Get

func (c *UserConfigClient) Get(ctx context.Context, id int) (*UserConfig, error)

Get returns a UserConfig entity by its id.

func (*UserConfigClient) GetX

func (c *UserConfigClient) GetX(ctx context.Context, id int) *UserConfig

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

func (*UserConfigClient) Hooks

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

Hooks returns the client hooks.

func (*UserConfigClient) Query

func (c *UserConfigClient) Query() *UserConfigQuery

Query returns a query builder for UserConfig.

func (*UserConfigClient) QueryUsers

func (c *UserConfigClient) QueryUsers(uc *UserConfig) *UserQuery

QueryUsers queries the users edge of a UserConfig.

func (*UserConfigClient) Update

func (c *UserConfigClient) Update() *UserConfigUpdate

Update returns an update builder for UserConfig.

func (*UserConfigClient) UpdateOne

func (c *UserConfigClient) UpdateOne(uc *UserConfig) *UserConfigUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserConfigClient) UpdateOneID

func (c *UserConfigClient) UpdateOneID(id int) *UserConfigUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserConfigClient) Use

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

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

type UserConfigCreate

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

UserConfigCreate is the builder for creating a UserConfig entity.

func (*UserConfigCreate) Exec

func (ucc *UserConfigCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserConfigCreate) ExecX

func (ucc *UserConfigCreate) ExecX(ctx context.Context)

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

func (*UserConfigCreate) Mutation

func (ucc *UserConfigCreate) Mutation() *UserConfigMutation

Mutation returns the UserConfigMutation object of the builder.

func (*UserConfigCreate) Save

func (ucc *UserConfigCreate) Save(ctx context.Context) (*UserConfig, error)

Save creates the UserConfig in the database.

func (*UserConfigCreate) SaveX

func (ucc *UserConfigCreate) SaveX(ctx context.Context) *UserConfig

SaveX calls Save and panics if Save returns an error.

func (*UserConfigCreate) SetBreak

func (ucc *UserConfigCreate) SetBreak(u uint) *UserConfigCreate

SetBreak sets the "break" field.

func (*UserConfigCreate) SetRank

func (ucc *UserConfigCreate) SetRank(u uint8) *UserConfigCreate

SetRank sets the "rank" field.

func (*UserConfigCreate) SetUserID

func (ucc *UserConfigCreate) SetUserID(i int) *UserConfigCreate

SetUserID sets the "user_id" field.

func (*UserConfigCreate) SetUsers

func (ucc *UserConfigCreate) SetUsers(u *User) *UserConfigCreate

SetUsers sets the "users" edge to the User entity.

func (*UserConfigCreate) SetUsersID

func (ucc *UserConfigCreate) SetUsersID(id int) *UserConfigCreate

SetUsersID sets the "users" edge to the User entity by ID.

func (*UserConfigCreate) SetWorking

func (ucc *UserConfigCreate) SetWorking(u uint) *UserConfigCreate

SetWorking sets the "working" field.

type UserConfigCreateBulk

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

UserConfigCreateBulk is the builder for creating many UserConfig entities in bulk.

func (*UserConfigCreateBulk) Exec

func (uccb *UserConfigCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserConfigCreateBulk) ExecX

func (uccb *UserConfigCreateBulk) ExecX(ctx context.Context)

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

func (*UserConfigCreateBulk) Save

func (uccb *UserConfigCreateBulk) Save(ctx context.Context) ([]*UserConfig, error)

Save creates the UserConfig entities in the database.

func (*UserConfigCreateBulk) SaveX

func (uccb *UserConfigCreateBulk) SaveX(ctx context.Context) []*UserConfig

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

type UserConfigDelete

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

UserConfigDelete is the builder for deleting a UserConfig entity.

func (*UserConfigDelete) Exec

func (ucd *UserConfigDelete) Exec(ctx context.Context) (int, error)

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

func (*UserConfigDelete) ExecX

func (ucd *UserConfigDelete) ExecX(ctx context.Context) int

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

func (*UserConfigDelete) Where

Where appends a list predicates to the UserConfigDelete builder.

type UserConfigDeleteOne

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

UserConfigDeleteOne is the builder for deleting a single UserConfig entity.

func (*UserConfigDeleteOne) Exec

func (ucdo *UserConfigDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserConfigDeleteOne) ExecX

func (ucdo *UserConfigDeleteOne) ExecX(ctx context.Context)

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

type UserConfigEdges

type UserConfigEdges struct {
	// Users holds the value of the users edge.
	Users *User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserConfigEdges) UsersOrErr

func (e UserConfigEdges) UsersOrErr() (*User, error)

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

type UserConfigGroupBy

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

UserConfigGroupBy is the group-by builder for UserConfig entities.

func (*UserConfigGroupBy) Aggregate

func (ucgb *UserConfigGroupBy) Aggregate(fns ...AggregateFunc) *UserConfigGroupBy

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

func (*UserConfigGroupBy) Bool

func (ucgb *UserConfigGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) BoolX

func (ucgb *UserConfigGroupBy) BoolX(ctx context.Context) bool

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

func (*UserConfigGroupBy) Bools

func (ucgb *UserConfigGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) BoolsX

func (ucgb *UserConfigGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserConfigGroupBy) Float64

func (ucgb *UserConfigGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) Float64X

func (ucgb *UserConfigGroupBy) Float64X(ctx context.Context) float64

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

func (*UserConfigGroupBy) Float64s

func (ucgb *UserConfigGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) Float64sX

func (ucgb *UserConfigGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserConfigGroupBy) Int

func (ucgb *UserConfigGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) IntX

func (ucgb *UserConfigGroupBy) IntX(ctx context.Context) int

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

func (*UserConfigGroupBy) Ints

func (ucgb *UserConfigGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) IntsX

func (ucgb *UserConfigGroupBy) IntsX(ctx context.Context) []int

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

func (*UserConfigGroupBy) Scan

func (ucgb *UserConfigGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserConfigGroupBy) ScanX

func (ucgb *UserConfigGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserConfigGroupBy) String

func (ucgb *UserConfigGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) StringX

func (ucgb *UserConfigGroupBy) StringX(ctx context.Context) string

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

func (*UserConfigGroupBy) Strings

func (ucgb *UserConfigGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserConfigGroupBy) StringsX

func (ucgb *UserConfigGroupBy) StringsX(ctx context.Context) []string

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

type UserConfigMutation

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

UserConfigMutation represents an operation that mutates the UserConfig nodes in the graph.

func (*UserConfigMutation) AddBreak

func (m *UserConfigMutation) AddBreak(u uint)

AddBreak adds u to the "break" field.

func (*UserConfigMutation) AddField

func (m *UserConfigMutation) 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 (*UserConfigMutation) AddRank

func (m *UserConfigMutation) AddRank(u uint8)

AddRank adds u to the "rank" field.

func (*UserConfigMutation) AddWorking

func (m *UserConfigMutation) AddWorking(u uint)

AddWorking adds u to the "working" field.

func (*UserConfigMutation) AddedBreak

func (m *UserConfigMutation) AddedBreak() (r uint, exists bool)

AddedBreak returns the value that was added to the "break" field in this mutation.

func (*UserConfigMutation) AddedEdges

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

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

func (*UserConfigMutation) AddedField

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

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

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

func (*UserConfigMutation) AddedIDs

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

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

func (*UserConfigMutation) AddedRank

func (m *UserConfigMutation) AddedRank() (r uint8, exists bool)

AddedRank returns the value that was added to the "rank" field in this mutation.

func (*UserConfigMutation) AddedWorking

func (m *UserConfigMutation) AddedWorking() (r uint, exists bool)

AddedWorking returns the value that was added to the "working" field in this mutation.

func (*UserConfigMutation) Break

func (m *UserConfigMutation) Break() (r uint, exists bool)

Break returns the value of the "break" field in the mutation.

func (*UserConfigMutation) ClearEdge

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

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

func (m *UserConfigMutation) ClearUsers()

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

func (*UserConfigMutation) ClearedEdges

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

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

func (*UserConfigMutation) ClearedFields

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

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

func (UserConfigMutation) Client

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

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

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

func (*UserConfigMutation) Field

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

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

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

func (*UserConfigMutation) Fields

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

func (m *UserConfigMutation) 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 (*UserConfigMutation) OldBreak

func (m *UserConfigMutation) OldBreak(ctx context.Context) (v uint, err error)

OldBreak returns the old "break" field's value of the UserConfig entity. If the UserConfig 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 (*UserConfigMutation) OldField

func (m *UserConfigMutation) 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 (*UserConfigMutation) OldRank

func (m *UserConfigMutation) OldRank(ctx context.Context) (v uint8, err error)

OldRank returns the old "rank" field's value of the UserConfig entity. If the UserConfig 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 (*UserConfigMutation) OldUserID

func (m *UserConfigMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserConfig entity. If the UserConfig 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 (*UserConfigMutation) OldWorking

func (m *UserConfigMutation) OldWorking(ctx context.Context) (v uint, err error)

OldWorking returns the old "working" field's value of the UserConfig entity. If the UserConfig 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 (*UserConfigMutation) Op

func (m *UserConfigMutation) Op() Op

Op returns the operation name.

func (*UserConfigMutation) Rank

func (m *UserConfigMutation) Rank() (r uint8, exists bool)

Rank returns the value of the "rank" field in the mutation.

func (*UserConfigMutation) RemovedEdges

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

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

func (*UserConfigMutation) RemovedIDs

func (m *UserConfigMutation) 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 (*UserConfigMutation) ResetBreak

func (m *UserConfigMutation) ResetBreak()

ResetBreak resets all changes to the "break" field.

func (*UserConfigMutation) ResetEdge

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

func (m *UserConfigMutation) 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 (*UserConfigMutation) ResetRank

func (m *UserConfigMutation) ResetRank()

ResetRank resets all changes to the "rank" field.

func (*UserConfigMutation) ResetUserID

func (m *UserConfigMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserConfigMutation) ResetUsers

func (m *UserConfigMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*UserConfigMutation) ResetWorking

func (m *UserConfigMutation) ResetWorking()

ResetWorking resets all changes to the "working" field.

func (*UserConfigMutation) SetBreak

func (m *UserConfigMutation) SetBreak(u uint)

SetBreak sets the "break" field.

func (*UserConfigMutation) SetField

func (m *UserConfigMutation) 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 (*UserConfigMutation) SetRank

func (m *UserConfigMutation) SetRank(u uint8)

SetRank sets the "rank" field.

func (*UserConfigMutation) SetUserID

func (m *UserConfigMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*UserConfigMutation) SetUsersID

func (m *UserConfigMutation) SetUsersID(id int)

SetUsersID sets the "users" edge to the User entity by id.

func (*UserConfigMutation) SetWorking

func (m *UserConfigMutation) SetWorking(u uint)

SetWorking sets the "working" field.

func (UserConfigMutation) Tx

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

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

func (*UserConfigMutation) Type

func (m *UserConfigMutation) Type() string

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

func (*UserConfigMutation) UserID

func (m *UserConfigMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserConfigMutation) UsersCleared

func (m *UserConfigMutation) UsersCleared() bool

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

func (*UserConfigMutation) UsersID

func (m *UserConfigMutation) UsersID() (id int, exists bool)

UsersID returns the "users" edge ID in the mutation.

func (*UserConfigMutation) UsersIDs

func (m *UserConfigMutation) UsersIDs() (ids []int)

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

func (*UserConfigMutation) Where

func (m *UserConfigMutation) Where(ps ...predicate.UserConfig)

Where appends a list predicates to the UserConfigMutation builder.

func (*UserConfigMutation) Working

func (m *UserConfigMutation) Working() (r uint, exists bool)

Working returns the value of the "working" field in the mutation.

type UserConfigQuery

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

UserConfigQuery is the builder for querying UserConfig entities.

func (*UserConfigQuery) All

func (ucq *UserConfigQuery) All(ctx context.Context) ([]*UserConfig, error)

All executes the query and returns a list of UserConfigs.

func (*UserConfigQuery) AllX

func (ucq *UserConfigQuery) AllX(ctx context.Context) []*UserConfig

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

func (*UserConfigQuery) Clone

func (ucq *UserConfigQuery) Clone() *UserConfigQuery

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

func (*UserConfigQuery) Count

func (ucq *UserConfigQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserConfigQuery) CountX

func (ucq *UserConfigQuery) CountX(ctx context.Context) int

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

func (*UserConfigQuery) Exist

func (ucq *UserConfigQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserConfigQuery) ExistX

func (ucq *UserConfigQuery) ExistX(ctx context.Context) bool

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

func (*UserConfigQuery) First

func (ucq *UserConfigQuery) First(ctx context.Context) (*UserConfig, error)

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

func (*UserConfigQuery) FirstID

func (ucq *UserConfigQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserConfigQuery) FirstIDX

func (ucq *UserConfigQuery) FirstIDX(ctx context.Context) int

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

func (*UserConfigQuery) FirstX

func (ucq *UserConfigQuery) FirstX(ctx context.Context) *UserConfig

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

func (*UserConfigQuery) GroupBy

func (ucq *UserConfigQuery) GroupBy(field string, fields ...string) *UserConfigGroupBy

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 {
	UserID int `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserConfig.Query().
	GroupBy(userconfig.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserConfigQuery) IDs

func (ucq *UserConfigQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserConfigQuery) IDsX

func (ucq *UserConfigQuery) IDsX(ctx context.Context) []int

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

func (*UserConfigQuery) Limit

func (ucq *UserConfigQuery) Limit(limit int) *UserConfigQuery

Limit adds a limit step to the query.

func (*UserConfigQuery) Offset

func (ucq *UserConfigQuery) Offset(offset int) *UserConfigQuery

Offset adds an offset step to the query.

func (*UserConfigQuery) Only

func (ucq *UserConfigQuery) Only(ctx context.Context) (*UserConfig, error)

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

func (*UserConfigQuery) OnlyID

func (ucq *UserConfigQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserConfigQuery) OnlyIDX

func (ucq *UserConfigQuery) OnlyIDX(ctx context.Context) int

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

func (*UserConfigQuery) OnlyX

func (ucq *UserConfigQuery) OnlyX(ctx context.Context) *UserConfig

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

func (*UserConfigQuery) Order

func (ucq *UserConfigQuery) Order(o ...OrderFunc) *UserConfigQuery

Order adds an order step to the query.

func (*UserConfigQuery) QueryUsers

func (ucq *UserConfigQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*UserConfigQuery) Select

func (ucq *UserConfigQuery) Select(fields ...string) *UserConfigSelect

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 {
	UserID int `json:"user_id,omitempty"`
}

client.UserConfig.Query().
	Select(userconfig.FieldUserID).
	Scan(ctx, &v)

func (*UserConfigQuery) Unique

func (ucq *UserConfigQuery) Unique(unique bool) *UserConfigQuery

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

Where adds a new predicate for the UserConfigQuery builder.

func (*UserConfigQuery) WithUsers

func (ucq *UserConfigQuery) WithUsers(opts ...func(*UserQuery)) *UserConfigQuery

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

type UserConfigSelect

type UserConfigSelect struct {
	*UserConfigQuery
	// contains filtered or unexported fields
}

UserConfigSelect is the builder for selecting fields of UserConfig entities.

func (*UserConfigSelect) Bool

func (ucs *UserConfigSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserConfigSelect) BoolX

func (ucs *UserConfigSelect) BoolX(ctx context.Context) bool

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

func (*UserConfigSelect) Bools

func (ucs *UserConfigSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserConfigSelect) BoolsX

func (ucs *UserConfigSelect) BoolsX(ctx context.Context) []bool

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

func (*UserConfigSelect) Float64

func (ucs *UserConfigSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserConfigSelect) Float64X

func (ucs *UserConfigSelect) Float64X(ctx context.Context) float64

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

func (*UserConfigSelect) Float64s

func (ucs *UserConfigSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserConfigSelect) Float64sX

func (ucs *UserConfigSelect) Float64sX(ctx context.Context) []float64

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

func (*UserConfigSelect) Int

func (ucs *UserConfigSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserConfigSelect) IntX

func (ucs *UserConfigSelect) IntX(ctx context.Context) int

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

func (*UserConfigSelect) Ints

func (ucs *UserConfigSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserConfigSelect) IntsX

func (ucs *UserConfigSelect) IntsX(ctx context.Context) []int

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

func (*UserConfigSelect) Scan

func (ucs *UserConfigSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserConfigSelect) ScanX

func (ucs *UserConfigSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserConfigSelect) String

func (ucs *UserConfigSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserConfigSelect) StringX

func (ucs *UserConfigSelect) StringX(ctx context.Context) string

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

func (*UserConfigSelect) Strings

func (ucs *UserConfigSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserConfigSelect) StringsX

func (ucs *UserConfigSelect) StringsX(ctx context.Context) []string

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

type UserConfigUpdate

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

UserConfigUpdate is the builder for updating UserConfig entities.

func (*UserConfigUpdate) AddBreak

func (ucu *UserConfigUpdate) AddBreak(u uint) *UserConfigUpdate

AddBreak adds u to the "break" field.

func (*UserConfigUpdate) AddRank

func (ucu *UserConfigUpdate) AddRank(u uint8) *UserConfigUpdate

AddRank adds u to the "rank" field.

func (*UserConfigUpdate) AddWorking

func (ucu *UserConfigUpdate) AddWorking(u uint) *UserConfigUpdate

AddWorking adds u to the "working" field.

func (*UserConfigUpdate) ClearUsers

func (ucu *UserConfigUpdate) ClearUsers() *UserConfigUpdate

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

func (*UserConfigUpdate) Exec

func (ucu *UserConfigUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserConfigUpdate) ExecX

func (ucu *UserConfigUpdate) ExecX(ctx context.Context)

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

func (*UserConfigUpdate) Mutation

func (ucu *UserConfigUpdate) Mutation() *UserConfigMutation

Mutation returns the UserConfigMutation object of the builder.

func (*UserConfigUpdate) Save

func (ucu *UserConfigUpdate) Save(ctx context.Context) (int, error)

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

func (*UserConfigUpdate) SaveX

func (ucu *UserConfigUpdate) SaveX(ctx context.Context) int

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

func (*UserConfigUpdate) SetBreak

func (ucu *UserConfigUpdate) SetBreak(u uint) *UserConfigUpdate

SetBreak sets the "break" field.

func (*UserConfigUpdate) SetRank

func (ucu *UserConfigUpdate) SetRank(u uint8) *UserConfigUpdate

SetRank sets the "rank" field.

func (*UserConfigUpdate) SetUserID

func (ucu *UserConfigUpdate) SetUserID(i int) *UserConfigUpdate

SetUserID sets the "user_id" field.

func (*UserConfigUpdate) SetUsers

func (ucu *UserConfigUpdate) SetUsers(u *User) *UserConfigUpdate

SetUsers sets the "users" edge to the User entity.

func (*UserConfigUpdate) SetUsersID

func (ucu *UserConfigUpdate) SetUsersID(id int) *UserConfigUpdate

SetUsersID sets the "users" edge to the User entity by ID.

func (*UserConfigUpdate) SetWorking

func (ucu *UserConfigUpdate) SetWorking(u uint) *UserConfigUpdate

SetWorking sets the "working" field.

func (*UserConfigUpdate) Where

Where appends a list predicates to the UserConfigUpdate builder.

type UserConfigUpdateOne

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

UserConfigUpdateOne is the builder for updating a single UserConfig entity.

func (*UserConfigUpdateOne) AddBreak

func (ucuo *UserConfigUpdateOne) AddBreak(u uint) *UserConfigUpdateOne

AddBreak adds u to the "break" field.

func (*UserConfigUpdateOne) AddRank

func (ucuo *UserConfigUpdateOne) AddRank(u uint8) *UserConfigUpdateOne

AddRank adds u to the "rank" field.

func (*UserConfigUpdateOne) AddWorking

func (ucuo *UserConfigUpdateOne) AddWorking(u uint) *UserConfigUpdateOne

AddWorking adds u to the "working" field.

func (*UserConfigUpdateOne) ClearUsers

func (ucuo *UserConfigUpdateOne) ClearUsers() *UserConfigUpdateOne

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

func (*UserConfigUpdateOne) Exec

func (ucuo *UserConfigUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserConfigUpdateOne) ExecX

func (ucuo *UserConfigUpdateOne) ExecX(ctx context.Context)

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

func (*UserConfigUpdateOne) Mutation

func (ucuo *UserConfigUpdateOne) Mutation() *UserConfigMutation

Mutation returns the UserConfigMutation object of the builder.

func (*UserConfigUpdateOne) Save

func (ucuo *UserConfigUpdateOne) Save(ctx context.Context) (*UserConfig, error)

Save executes the query and returns the updated UserConfig entity.

func (*UserConfigUpdateOne) SaveX

func (ucuo *UserConfigUpdateOne) SaveX(ctx context.Context) *UserConfig

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

func (*UserConfigUpdateOne) Select

func (ucuo *UserConfigUpdateOne) Select(field string, fields ...string) *UserConfigUpdateOne

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

func (*UserConfigUpdateOne) SetBreak

func (ucuo *UserConfigUpdateOne) SetBreak(u uint) *UserConfigUpdateOne

SetBreak sets the "break" field.

func (*UserConfigUpdateOne) SetRank

func (ucuo *UserConfigUpdateOne) SetRank(u uint8) *UserConfigUpdateOne

SetRank sets the "rank" field.

func (*UserConfigUpdateOne) SetUserID

func (ucuo *UserConfigUpdateOne) SetUserID(i int) *UserConfigUpdateOne

SetUserID sets the "user_id" field.

func (*UserConfigUpdateOne) SetUsers

func (ucuo *UserConfigUpdateOne) SetUsers(u *User) *UserConfigUpdateOne

SetUsers sets the "users" edge to the User entity.

func (*UserConfigUpdateOne) SetUsersID

func (ucuo *UserConfigUpdateOne) SetUsersID(id int) *UserConfigUpdateOne

SetUsersID sets the "users" edge to the User entity by ID.

func (*UserConfigUpdateOne) SetWorking

func (ucuo *UserConfigUpdateOne) SetWorking(u uint) *UserConfigUpdateOne

SetWorking sets the "working" field.

type UserConfigs

type UserConfigs []*UserConfig

UserConfigs is a parsable slice of UserConfig.

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddUserConfigIDs

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

AddUserConfigIDs adds the "user_configs" edge to the UserConfig entity by IDs.

func (*UserCreate) AddUserConfigs

func (uc *UserCreate) AddUserConfigs(u ...*UserConfig) *UserCreate

AddUserConfigs adds the "user_configs" edges to the UserConfig entity.

func (*UserCreate) AddUserTomatoIDs

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

AddUserTomatoIDs adds the "user_tomatoes" edge to the UserTomato entity by IDs.

func (*UserCreate) AddUserTomatoes

func (uc *UserCreate) AddUserTomatoes(u ...*UserTomato) *UserCreate

AddUserTomatoes adds the "user_tomatoes" edges to the UserTomato entity.

func (*UserCreate) Exec

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

Exec executes the query.

func (*UserCreate) ExecX

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

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

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

Save creates the User in the database.

func (*UserCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEnabled

func (uc *UserCreate) SetEnabled(b bool) *UserCreate

SetEnabled sets the "enabled" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetPassword

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

SetPassword sets the "password" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

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

SetUsername sets the "username" field.

type UserCreateBulk

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

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

func (*UserCreateBulk) Exec

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

Exec executes the query.

func (*UserCreateBulk) ExecX

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

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

func (*UserCreateBulk) Save

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

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

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

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

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

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

func (*UserDelete) ExecX

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

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

func (*UserDelete) Where

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

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

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

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

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

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

type UserEdges

type UserEdges struct {
	// UserConfigs holds the value of the user_configs edge.
	UserConfigs []*UserConfig `json:"user_configs,omitempty"`
	// UserTomatoes holds the value of the user_tomatoes edge.
	UserTomatoes []*UserTomato `json:"user_tomatoes,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) UserConfigsOrErr

func (e UserEdges) UserConfigsOrErr() ([]*UserConfig, error)

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

func (UserEdges) UserTomatoesOrErr

func (e UserEdges) UserTomatoesOrErr() ([]*UserTomato, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntsX

func (ugb *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 interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

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

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddUserConfigIDs

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

AddUserConfigIDs adds the "user_configs" edge to the UserConfig entity by ids.

func (*UserMutation) AddUserTomatoIDs

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

AddUserTomatoIDs adds the "user_tomatoes" edge to the UserTomato entity by ids.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

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

func (m *UserMutation) ClearUserConfigs()

ClearUserConfigs clears the "user_configs" edge to the UserConfig entity.

func (*UserMutation) ClearUserTomatoes

func (m *UserMutation) ClearUserTomatoes()

ClearUserTomatoes clears the "user_tomatoes" edge to the UserTomato 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) CreatedAt

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

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

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Enabled

func (m *UserMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" 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) OldCreatedAt

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

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

func (*UserMutation) OldEnabled

func (m *UserMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" 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) OldUpdatedAt

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

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

func (*UserMutation) OldUsername

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

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

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

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

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

func (*UserMutation) RemoveUserConfigIDs

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

RemoveUserConfigIDs removes the "user_configs" edge to the UserConfig entity by IDs.

func (*UserMutation) RemoveUserTomatoIDs

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

RemoveUserTomatoIDs removes the "user_tomatoes" edge to the UserTomato entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedUserConfigsIDs

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

RemovedUserConfigs returns the removed IDs of the "user_configs" edge to the UserConfig entity.

func (*UserMutation) RemovedUserTomatoesIDs

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

RemovedUserTomatoes returns the removed IDs of the "user_tomatoes" edge to the UserTomato entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

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

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

func (*UserMutation) ResetEnabled

func (m *UserMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" 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) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUserConfigs

func (m *UserMutation) ResetUserConfigs()

ResetUserConfigs resets all changes to the "user_configs" edge.

func (*UserMutation) ResetUserTomatoes

func (m *UserMutation) ResetUserTomatoes()

ResetUserTomatoes resets all changes to the "user_tomatoes" edge.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEnabled

func (m *UserMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" 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) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UpdatedAt

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

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

func (*UserMutation) UserConfigsCleared

func (m *UserMutation) UserConfigsCleared() bool

UserConfigsCleared reports if the "user_configs" edge to the UserConfig entity was cleared.

func (*UserMutation) UserConfigsIDs

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

UserConfigsIDs returns the "user_configs" edge IDs in the mutation.

func (*UserMutation) UserTomatoesCleared

func (m *UserMutation) UserTomatoesCleared() bool

UserTomatoesCleared reports if the "user_tomatoes" edge to the UserTomato entity was cleared.

func (*UserMutation) UserTomatoesIDs

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

UserTomatoesIDs returns the "user_tomatoes" edge IDs in the mutation.

func (*UserMutation) Username

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

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

func (*UserMutation) Where

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

Where appends a list predicates to the UserMutation builder.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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

Example:

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

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, 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 adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

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 exactly one User entity is not 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 exactly one User ID is not 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 ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryUserConfigs

func (uq *UserQuery) QueryUserConfigs() *UserConfigQuery

QueryUserConfigs chains the current query on the "user_configs" edge.

func (*UserQuery) QueryUserTomatoes

func (uq *UserQuery) QueryUserTomatoes() *UserTomatoQuery

QueryUserTomatoes chains the current query on the "user_tomatoes" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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

Example:

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

client.User.Query().
	Select(user.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithUserConfigs

func (uq *UserQuery) WithUserConfigs(opts ...func(*UserConfigQuery)) *UserQuery

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

func (*UserQuery) WithUserTomatoes

func (uq *UserQuery) WithUserTomatoes(opts ...func(*UserTomatoQuery)) *UserQuery

WithUserTomatoes tells the query-builder to eager-load the nodes that are connected to the "user_tomatoes" 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) Bool

func (us *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 (us *UserSelect) BoolX(ctx context.Context) bool

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

func (*UserSelect) Bools

func (us *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 (us *UserSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSelect) Float64

func (us *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 (us *UserSelect) Float64X(ctx context.Context) float64

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

func (*UserSelect) Float64s

func (us *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 (us *UserSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSelect) Int

func (us *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 (us *UserSelect) IntX(ctx context.Context) int

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

func (*UserSelect) Ints

func (us *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 (us *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 interface{}) error

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

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSelect) String

func (us *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 (us *UserSelect) StringX(ctx context.Context) string

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

func (*UserSelect) Strings

func (us *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 (us *UserSelect) StringsX(ctx context.Context) []string

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

type UserTomato

type UserTomato struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime time.Time `json:"start_time,omitempty"`
	// Color holds the value of the "color" field.
	Color usertomato.Color `json:"color,omitempty"`
	// RemainTime holds the value of the "remain_time" field.
	RemainTime time.Time `json:"remain_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime *time.Time `json:"end_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserTomatoQuery when eager-loading is set.
	Edges UserTomatoEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserTomato is the model entity for the UserTomato schema.

func (*UserTomato) QueryUsers

func (ut *UserTomato) QueryUsers() *UserQuery

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

func (*UserTomato) String

func (ut *UserTomato) String() string

String implements the fmt.Stringer.

func (*UserTomato) Unwrap

func (ut *UserTomato) Unwrap() *UserTomato

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

func (ut *UserTomato) Update() *UserTomatoUpdateOne

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

type UserTomatoClient

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

UserTomatoClient is a client for the UserTomato schema.

func NewUserTomatoClient

func NewUserTomatoClient(c config) *UserTomatoClient

NewUserTomatoClient returns a client for the UserTomato from the given config.

func (*UserTomatoClient) Create

func (c *UserTomatoClient) Create() *UserTomatoCreate

Create returns a create builder for UserTomato.

func (*UserTomatoClient) CreateBulk

func (c *UserTomatoClient) CreateBulk(builders ...*UserTomatoCreate) *UserTomatoCreateBulk

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

func (*UserTomatoClient) Delete

func (c *UserTomatoClient) Delete() *UserTomatoDelete

Delete returns a delete builder for UserTomato.

func (*UserTomatoClient) DeleteOne

func (c *UserTomatoClient) DeleteOne(ut *UserTomato) *UserTomatoDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserTomatoClient) DeleteOneID

func (c *UserTomatoClient) DeleteOneID(id int) *UserTomatoDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserTomatoClient) Get

func (c *UserTomatoClient) Get(ctx context.Context, id int) (*UserTomato, error)

Get returns a UserTomato entity by its id.

func (*UserTomatoClient) GetX

func (c *UserTomatoClient) GetX(ctx context.Context, id int) *UserTomato

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

func (*UserTomatoClient) Hooks

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

Hooks returns the client hooks.

func (*UserTomatoClient) Query

func (c *UserTomatoClient) Query() *UserTomatoQuery

Query returns a query builder for UserTomato.

func (*UserTomatoClient) QueryUsers

func (c *UserTomatoClient) QueryUsers(ut *UserTomato) *UserQuery

QueryUsers queries the users edge of a UserTomato.

func (*UserTomatoClient) Update

func (c *UserTomatoClient) Update() *UserTomatoUpdate

Update returns an update builder for UserTomato.

func (*UserTomatoClient) UpdateOne

func (c *UserTomatoClient) UpdateOne(ut *UserTomato) *UserTomatoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserTomatoClient) UpdateOneID

func (c *UserTomatoClient) UpdateOneID(id int) *UserTomatoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserTomatoClient) Use

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

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

type UserTomatoCreate

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

UserTomatoCreate is the builder for creating a UserTomato entity.

func (*UserTomatoCreate) Exec

func (utc *UserTomatoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTomatoCreate) ExecX

func (utc *UserTomatoCreate) ExecX(ctx context.Context)

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

func (*UserTomatoCreate) Mutation

func (utc *UserTomatoCreate) Mutation() *UserTomatoMutation

Mutation returns the UserTomatoMutation object of the builder.

func (*UserTomatoCreate) Save

func (utc *UserTomatoCreate) Save(ctx context.Context) (*UserTomato, error)

Save creates the UserTomato in the database.

func (*UserTomatoCreate) SaveX

func (utc *UserTomatoCreate) SaveX(ctx context.Context) *UserTomato

SaveX calls Save and panics if Save returns an error.

func (*UserTomatoCreate) SetColor

SetColor sets the "color" field.

func (*UserTomatoCreate) SetCreatedAt

func (utc *UserTomatoCreate) SetCreatedAt(t time.Time) *UserTomatoCreate

SetCreatedAt sets the "created_at" field.

func (*UserTomatoCreate) SetEndTime

func (utc *UserTomatoCreate) SetEndTime(t time.Time) *UserTomatoCreate

SetEndTime sets the "end_time" field.

func (*UserTomatoCreate) SetNillableCreatedAt

func (utc *UserTomatoCreate) SetNillableCreatedAt(t *time.Time) *UserTomatoCreate

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

func (*UserTomatoCreate) SetNillableEndTime

func (utc *UserTomatoCreate) SetNillableEndTime(t *time.Time) *UserTomatoCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*UserTomatoCreate) SetNillableStartTime

func (utc *UserTomatoCreate) SetNillableStartTime(t *time.Time) *UserTomatoCreate

SetNillableStartTime sets the "start_time" field if the given value is not nil.

func (*UserTomatoCreate) SetNillableUpdatedAt

func (utc *UserTomatoCreate) SetNillableUpdatedAt(t *time.Time) *UserTomatoCreate

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

func (*UserTomatoCreate) SetRemainTime

func (utc *UserTomatoCreate) SetRemainTime(t time.Time) *UserTomatoCreate

SetRemainTime sets the "remain_time" field.

func (*UserTomatoCreate) SetStartTime

func (utc *UserTomatoCreate) SetStartTime(t time.Time) *UserTomatoCreate

SetStartTime sets the "start_time" field.

func (*UserTomatoCreate) SetUpdatedAt

func (utc *UserTomatoCreate) SetUpdatedAt(t time.Time) *UserTomatoCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserTomatoCreate) SetUserID

func (utc *UserTomatoCreate) SetUserID(i int) *UserTomatoCreate

SetUserID sets the "user_id" field.

func (*UserTomatoCreate) SetUsers

func (utc *UserTomatoCreate) SetUsers(u *User) *UserTomatoCreate

SetUsers sets the "users" edge to the User entity.

func (*UserTomatoCreate) SetUsersID

func (utc *UserTomatoCreate) SetUsersID(id int) *UserTomatoCreate

SetUsersID sets the "users" edge to the User entity by ID.

type UserTomatoCreateBulk

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

UserTomatoCreateBulk is the builder for creating many UserTomato entities in bulk.

func (*UserTomatoCreateBulk) Exec

func (utcb *UserTomatoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTomatoCreateBulk) ExecX

func (utcb *UserTomatoCreateBulk) ExecX(ctx context.Context)

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

func (*UserTomatoCreateBulk) Save

func (utcb *UserTomatoCreateBulk) Save(ctx context.Context) ([]*UserTomato, error)

Save creates the UserTomato entities in the database.

func (*UserTomatoCreateBulk) SaveX

func (utcb *UserTomatoCreateBulk) SaveX(ctx context.Context) []*UserTomato

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

type UserTomatoDelete

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

UserTomatoDelete is the builder for deleting a UserTomato entity.

func (*UserTomatoDelete) Exec

func (utd *UserTomatoDelete) Exec(ctx context.Context) (int, error)

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

func (*UserTomatoDelete) ExecX

func (utd *UserTomatoDelete) ExecX(ctx context.Context) int

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

func (*UserTomatoDelete) Where

Where appends a list predicates to the UserTomatoDelete builder.

type UserTomatoDeleteOne

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

UserTomatoDeleteOne is the builder for deleting a single UserTomato entity.

func (*UserTomatoDeleteOne) Exec

func (utdo *UserTomatoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserTomatoDeleteOne) ExecX

func (utdo *UserTomatoDeleteOne) ExecX(ctx context.Context)

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

type UserTomatoEdges

type UserTomatoEdges struct {
	// Users holds the value of the users edge.
	Users *User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserTomatoEdges) UsersOrErr

func (e UserTomatoEdges) UsersOrErr() (*User, error)

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

type UserTomatoGroupBy

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

UserTomatoGroupBy is the group-by builder for UserTomato entities.

func (*UserTomatoGroupBy) Aggregate

func (utgb *UserTomatoGroupBy) Aggregate(fns ...AggregateFunc) *UserTomatoGroupBy

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

func (*UserTomatoGroupBy) Bool

func (utgb *UserTomatoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) BoolX

func (utgb *UserTomatoGroupBy) BoolX(ctx context.Context) bool

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

func (*UserTomatoGroupBy) Bools

func (utgb *UserTomatoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) BoolsX

func (utgb *UserTomatoGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserTomatoGroupBy) Float64

func (utgb *UserTomatoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) Float64X

func (utgb *UserTomatoGroupBy) Float64X(ctx context.Context) float64

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

func (*UserTomatoGroupBy) Float64s

func (utgb *UserTomatoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) Float64sX

func (utgb *UserTomatoGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserTomatoGroupBy) Int

func (utgb *UserTomatoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) IntX

func (utgb *UserTomatoGroupBy) IntX(ctx context.Context) int

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

func (*UserTomatoGroupBy) Ints

func (utgb *UserTomatoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) IntsX

func (utgb *UserTomatoGroupBy) IntsX(ctx context.Context) []int

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

func (*UserTomatoGroupBy) Scan

func (utgb *UserTomatoGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserTomatoGroupBy) ScanX

func (utgb *UserTomatoGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserTomatoGroupBy) String

func (utgb *UserTomatoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) StringX

func (utgb *UserTomatoGroupBy) StringX(ctx context.Context) string

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

func (*UserTomatoGroupBy) Strings

func (utgb *UserTomatoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserTomatoGroupBy) StringsX

func (utgb *UserTomatoGroupBy) StringsX(ctx context.Context) []string

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

type UserTomatoMutation

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

UserTomatoMutation represents an operation that mutates the UserTomato nodes in the graph.

func (*UserTomatoMutation) AddField

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

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

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

func (*UserTomatoMutation) AddedField

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

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

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

func (*UserTomatoMutation) AddedIDs

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

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

func (*UserTomatoMutation) ClearEdge

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) ClearEndTime

func (m *UserTomatoMutation) ClearEndTime()

ClearEndTime clears the value of the "end_time" field.

func (*UserTomatoMutation) ClearField

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

func (m *UserTomatoMutation) ClearUsers()

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

func (*UserTomatoMutation) ClearedEdges

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

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

func (*UserTomatoMutation) ClearedFields

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

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

func (UserTomatoMutation) Client

func (m UserTomatoMutation) 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 (*UserTomatoMutation) Color

func (m *UserTomatoMutation) Color() (r usertomato.Color, exists bool)

Color returns the value of the "color" field in the mutation.

func (*UserTomatoMutation) CreatedAt

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

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

func (*UserTomatoMutation) EdgeCleared

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

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

func (*UserTomatoMutation) EndTime

func (m *UserTomatoMutation) EndTime() (r time.Time, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*UserTomatoMutation) EndTimeCleared

func (m *UserTomatoMutation) EndTimeCleared() bool

EndTimeCleared returns if the "end_time" field was cleared in this mutation.

func (*UserTomatoMutation) Field

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

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

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

func (*UserTomatoMutation) Fields

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

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) OldColor

func (m *UserTomatoMutation) OldColor(ctx context.Context) (v usertomato.Color, err error)

OldColor returns the old "color" field's value of the UserTomato entity. If the UserTomato 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 (*UserTomatoMutation) OldCreatedAt

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

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

func (m *UserTomatoMutation) OldEndTime(ctx context.Context) (v *time.Time, err error)

OldEndTime returns the old "end_time" field's value of the UserTomato entity. If the UserTomato 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 (*UserTomatoMutation) OldField

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) OldRemainTime

func (m *UserTomatoMutation) OldRemainTime(ctx context.Context) (v time.Time, err error)

OldRemainTime returns the old "remain_time" field's value of the UserTomato entity. If the UserTomato 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 (*UserTomatoMutation) OldStartTime

func (m *UserTomatoMutation) OldStartTime(ctx context.Context) (v time.Time, err error)

OldStartTime returns the old "start_time" field's value of the UserTomato entity. If the UserTomato 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 (*UserTomatoMutation) OldUpdatedAt

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

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

func (m *UserTomatoMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserTomato entity. If the UserTomato 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 (*UserTomatoMutation) Op

func (m *UserTomatoMutation) Op() Op

Op returns the operation name.

func (*UserTomatoMutation) RemainTime

func (m *UserTomatoMutation) RemainTime() (r time.Time, exists bool)

RemainTime returns the value of the "remain_time" field in the mutation.

func (*UserTomatoMutation) RemovedEdges

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

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

func (*UserTomatoMutation) RemovedIDs

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) ResetColor

func (m *UserTomatoMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*UserTomatoMutation) ResetCreatedAt

func (m *UserTomatoMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserTomatoMutation) ResetEdge

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) ResetEndTime

func (m *UserTomatoMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*UserTomatoMutation) ResetField

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) ResetRemainTime

func (m *UserTomatoMutation) ResetRemainTime()

ResetRemainTime resets all changes to the "remain_time" field.

func (*UserTomatoMutation) ResetStartTime

func (m *UserTomatoMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*UserTomatoMutation) ResetUpdatedAt

func (m *UserTomatoMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserTomatoMutation) ResetUserID

func (m *UserTomatoMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserTomatoMutation) ResetUsers

func (m *UserTomatoMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*UserTomatoMutation) SetColor

func (m *UserTomatoMutation) SetColor(u usertomato.Color)

SetColor sets the "color" field.

func (*UserTomatoMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserTomatoMutation) SetEndTime

func (m *UserTomatoMutation) SetEndTime(t time.Time)

SetEndTime sets the "end_time" field.

func (*UserTomatoMutation) SetField

func (m *UserTomatoMutation) 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 (*UserTomatoMutation) SetRemainTime

func (m *UserTomatoMutation) SetRemainTime(t time.Time)

SetRemainTime sets the "remain_time" field.

func (*UserTomatoMutation) SetStartTime

func (m *UserTomatoMutation) SetStartTime(t time.Time)

SetStartTime sets the "start_time" field.

func (*UserTomatoMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*UserTomatoMutation) SetUserID

func (m *UserTomatoMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*UserTomatoMutation) SetUsersID

func (m *UserTomatoMutation) SetUsersID(id int)

SetUsersID sets the "users" edge to the User entity by id.

func (*UserTomatoMutation) StartTime

func (m *UserTomatoMutation) StartTime() (r time.Time, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (UserTomatoMutation) Tx

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

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

func (*UserTomatoMutation) Type

func (m *UserTomatoMutation) Type() string

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

func (*UserTomatoMutation) UpdatedAt

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

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

func (*UserTomatoMutation) UserID

func (m *UserTomatoMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserTomatoMutation) UsersCleared

func (m *UserTomatoMutation) UsersCleared() bool

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

func (*UserTomatoMutation) UsersID

func (m *UserTomatoMutation) UsersID() (id int, exists bool)

UsersID returns the "users" edge ID in the mutation.

func (*UserTomatoMutation) UsersIDs

func (m *UserTomatoMutation) UsersIDs() (ids []int)

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

func (*UserTomatoMutation) Where

func (m *UserTomatoMutation) Where(ps ...predicate.UserTomato)

Where appends a list predicates to the UserTomatoMutation builder.

type UserTomatoQuery

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

UserTomatoQuery is the builder for querying UserTomato entities.

func (*UserTomatoQuery) All

func (utq *UserTomatoQuery) All(ctx context.Context) ([]*UserTomato, error)

All executes the query and returns a list of UserTomatos.

func (*UserTomatoQuery) AllX

func (utq *UserTomatoQuery) AllX(ctx context.Context) []*UserTomato

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

func (*UserTomatoQuery) Clone

func (utq *UserTomatoQuery) Clone() *UserTomatoQuery

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

func (*UserTomatoQuery) Count

func (utq *UserTomatoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserTomatoQuery) CountX

func (utq *UserTomatoQuery) CountX(ctx context.Context) int

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

func (*UserTomatoQuery) Exist

func (utq *UserTomatoQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserTomatoQuery) ExistX

func (utq *UserTomatoQuery) ExistX(ctx context.Context) bool

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

func (*UserTomatoQuery) First

func (utq *UserTomatoQuery) First(ctx context.Context) (*UserTomato, error)

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

func (*UserTomatoQuery) FirstID

func (utq *UserTomatoQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserTomatoQuery) FirstIDX

func (utq *UserTomatoQuery) FirstIDX(ctx context.Context) int

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

func (*UserTomatoQuery) FirstX

func (utq *UserTomatoQuery) FirstX(ctx context.Context) *UserTomato

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

func (*UserTomatoQuery) GroupBy

func (utq *UserTomatoQuery) GroupBy(field string, fields ...string) *UserTomatoGroupBy

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

Example:

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

client.UserTomato.Query().
	GroupBy(usertomato.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserTomatoQuery) IDs

func (utq *UserTomatoQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserTomatoQuery) IDsX

func (utq *UserTomatoQuery) IDsX(ctx context.Context) []int

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

func (*UserTomatoQuery) Limit

func (utq *UserTomatoQuery) Limit(limit int) *UserTomatoQuery

Limit adds a limit step to the query.

func (*UserTomatoQuery) Offset

func (utq *UserTomatoQuery) Offset(offset int) *UserTomatoQuery

Offset adds an offset step to the query.

func (*UserTomatoQuery) Only

func (utq *UserTomatoQuery) Only(ctx context.Context) (*UserTomato, error)

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

func (*UserTomatoQuery) OnlyID

func (utq *UserTomatoQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserTomatoQuery) OnlyIDX

func (utq *UserTomatoQuery) OnlyIDX(ctx context.Context) int

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

func (*UserTomatoQuery) OnlyX

func (utq *UserTomatoQuery) OnlyX(ctx context.Context) *UserTomato

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

func (*UserTomatoQuery) Order

func (utq *UserTomatoQuery) Order(o ...OrderFunc) *UserTomatoQuery

Order adds an order step to the query.

func (*UserTomatoQuery) QueryUsers

func (utq *UserTomatoQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*UserTomatoQuery) Select

func (utq *UserTomatoQuery) Select(fields ...string) *UserTomatoSelect

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

Example:

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

client.UserTomato.Query().
	Select(usertomato.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserTomatoQuery) Unique

func (utq *UserTomatoQuery) Unique(unique bool) *UserTomatoQuery

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

Where adds a new predicate for the UserTomatoQuery builder.

func (*UserTomatoQuery) WithUsers

func (utq *UserTomatoQuery) WithUsers(opts ...func(*UserQuery)) *UserTomatoQuery

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

type UserTomatoSelect

type UserTomatoSelect struct {
	*UserTomatoQuery
	// contains filtered or unexported fields
}

UserTomatoSelect is the builder for selecting fields of UserTomato entities.

func (*UserTomatoSelect) Bool

func (uts *UserTomatoSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserTomatoSelect) BoolX

func (uts *UserTomatoSelect) BoolX(ctx context.Context) bool

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

func (*UserTomatoSelect) Bools

func (uts *UserTomatoSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserTomatoSelect) BoolsX

func (uts *UserTomatoSelect) BoolsX(ctx context.Context) []bool

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

func (*UserTomatoSelect) Float64

func (uts *UserTomatoSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserTomatoSelect) Float64X

func (uts *UserTomatoSelect) Float64X(ctx context.Context) float64

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

func (*UserTomatoSelect) Float64s

func (uts *UserTomatoSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserTomatoSelect) Float64sX

func (uts *UserTomatoSelect) Float64sX(ctx context.Context) []float64

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

func (*UserTomatoSelect) Int

func (uts *UserTomatoSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserTomatoSelect) IntX

func (uts *UserTomatoSelect) IntX(ctx context.Context) int

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

func (*UserTomatoSelect) Ints

func (uts *UserTomatoSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserTomatoSelect) IntsX

func (uts *UserTomatoSelect) IntsX(ctx context.Context) []int

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

func (*UserTomatoSelect) Scan

func (uts *UserTomatoSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserTomatoSelect) ScanX

func (uts *UserTomatoSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserTomatoSelect) String

func (uts *UserTomatoSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserTomatoSelect) StringX

func (uts *UserTomatoSelect) StringX(ctx context.Context) string

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

func (*UserTomatoSelect) Strings

func (uts *UserTomatoSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserTomatoSelect) StringsX

func (uts *UserTomatoSelect) StringsX(ctx context.Context) []string

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

type UserTomatoUpdate

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

UserTomatoUpdate is the builder for updating UserTomato entities.

func (*UserTomatoUpdate) ClearEndTime

func (utu *UserTomatoUpdate) ClearEndTime() *UserTomatoUpdate

ClearEndTime clears the value of the "end_time" field.

func (*UserTomatoUpdate) ClearUsers

func (utu *UserTomatoUpdate) ClearUsers() *UserTomatoUpdate

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

func (*UserTomatoUpdate) Exec

func (utu *UserTomatoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserTomatoUpdate) ExecX

func (utu *UserTomatoUpdate) ExecX(ctx context.Context)

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

func (*UserTomatoUpdate) Mutation

func (utu *UserTomatoUpdate) Mutation() *UserTomatoMutation

Mutation returns the UserTomatoMutation object of the builder.

func (*UserTomatoUpdate) Save

func (utu *UserTomatoUpdate) Save(ctx context.Context) (int, error)

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

func (*UserTomatoUpdate) SaveX

func (utu *UserTomatoUpdate) SaveX(ctx context.Context) int

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

func (*UserTomatoUpdate) SetColor

SetColor sets the "color" field.

func (*UserTomatoUpdate) SetEndTime

func (utu *UserTomatoUpdate) SetEndTime(t time.Time) *UserTomatoUpdate

SetEndTime sets the "end_time" field.

func (*UserTomatoUpdate) SetNillableEndTime

func (utu *UserTomatoUpdate) SetNillableEndTime(t *time.Time) *UserTomatoUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*UserTomatoUpdate) SetRemainTime

func (utu *UserTomatoUpdate) SetRemainTime(t time.Time) *UserTomatoUpdate

SetRemainTime sets the "remain_time" field.

func (*UserTomatoUpdate) SetUpdatedAt

func (utu *UserTomatoUpdate) SetUpdatedAt(t time.Time) *UserTomatoUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserTomatoUpdate) SetUserID

func (utu *UserTomatoUpdate) SetUserID(i int) *UserTomatoUpdate

SetUserID sets the "user_id" field.

func (*UserTomatoUpdate) SetUsers

func (utu *UserTomatoUpdate) SetUsers(u *User) *UserTomatoUpdate

SetUsers sets the "users" edge to the User entity.

func (*UserTomatoUpdate) SetUsersID

func (utu *UserTomatoUpdate) SetUsersID(id int) *UserTomatoUpdate

SetUsersID sets the "users" edge to the User entity by ID.

func (*UserTomatoUpdate) Where

Where appends a list predicates to the UserTomatoUpdate builder.

type UserTomatoUpdateOne

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

UserTomatoUpdateOne is the builder for updating a single UserTomato entity.

func (*UserTomatoUpdateOne) ClearEndTime

func (utuo *UserTomatoUpdateOne) ClearEndTime() *UserTomatoUpdateOne

ClearEndTime clears the value of the "end_time" field.

func (*UserTomatoUpdateOne) ClearUsers

func (utuo *UserTomatoUpdateOne) ClearUsers() *UserTomatoUpdateOne

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

func (*UserTomatoUpdateOne) Exec

func (utuo *UserTomatoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserTomatoUpdateOne) ExecX

func (utuo *UserTomatoUpdateOne) ExecX(ctx context.Context)

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

func (*UserTomatoUpdateOne) Mutation

func (utuo *UserTomatoUpdateOne) Mutation() *UserTomatoMutation

Mutation returns the UserTomatoMutation object of the builder.

func (*UserTomatoUpdateOne) Save

func (utuo *UserTomatoUpdateOne) Save(ctx context.Context) (*UserTomato, error)

Save executes the query and returns the updated UserTomato entity.

func (*UserTomatoUpdateOne) SaveX

func (utuo *UserTomatoUpdateOne) SaveX(ctx context.Context) *UserTomato

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

func (*UserTomatoUpdateOne) Select

func (utuo *UserTomatoUpdateOne) Select(field string, fields ...string) *UserTomatoUpdateOne

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

func (*UserTomatoUpdateOne) SetColor

SetColor sets the "color" field.

func (*UserTomatoUpdateOne) SetEndTime

func (utuo *UserTomatoUpdateOne) SetEndTime(t time.Time) *UserTomatoUpdateOne

SetEndTime sets the "end_time" field.

func (*UserTomatoUpdateOne) SetNillableEndTime

func (utuo *UserTomatoUpdateOne) SetNillableEndTime(t *time.Time) *UserTomatoUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*UserTomatoUpdateOne) SetRemainTime

func (utuo *UserTomatoUpdateOne) SetRemainTime(t time.Time) *UserTomatoUpdateOne

SetRemainTime sets the "remain_time" field.

func (*UserTomatoUpdateOne) SetUpdatedAt

func (utuo *UserTomatoUpdateOne) SetUpdatedAt(t time.Time) *UserTomatoUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserTomatoUpdateOne) SetUserID

func (utuo *UserTomatoUpdateOne) SetUserID(i int) *UserTomatoUpdateOne

SetUserID sets the "user_id" field.

func (*UserTomatoUpdateOne) SetUsers

func (utuo *UserTomatoUpdateOne) SetUsers(u *User) *UserTomatoUpdateOne

SetUsers sets the "users" edge to the User entity.

func (*UserTomatoUpdateOne) SetUsersID

func (utuo *UserTomatoUpdateOne) SetUsersID(id int) *UserTomatoUpdateOne

SetUsersID sets the "users" edge to the User entity by ID.

type UserTomatos

type UserTomatos []*UserTomato

UserTomatos is a parsable slice of UserTomato.

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddUserConfigIDs

func (uu *UserUpdate) AddUserConfigIDs(ids ...int) *UserUpdate

AddUserConfigIDs adds the "user_configs" edge to the UserConfig entity by IDs.

func (*UserUpdate) AddUserConfigs

func (uu *UserUpdate) AddUserConfigs(u ...*UserConfig) *UserUpdate

AddUserConfigs adds the "user_configs" edges to the UserConfig entity.

func (*UserUpdate) AddUserTomatoIDs

func (uu *UserUpdate) AddUserTomatoIDs(ids ...int) *UserUpdate

AddUserTomatoIDs adds the "user_tomatoes" edge to the UserTomato entity by IDs.

func (*UserUpdate) AddUserTomatoes

func (uu *UserUpdate) AddUserTomatoes(u ...*UserTomato) *UserUpdate

AddUserTomatoes adds the "user_tomatoes" edges to the UserTomato entity.

func (*UserUpdate) ClearUserConfigs

func (uu *UserUpdate) ClearUserConfigs() *UserUpdate

ClearUserConfigs clears all "user_configs" edges to the UserConfig entity.

func (*UserUpdate) ClearUserTomatoes

func (uu *UserUpdate) ClearUserTomatoes() *UserUpdate

ClearUserTomatoes clears all "user_tomatoes" edges to the UserTomato 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) RemoveUserConfigIDs

func (uu *UserUpdate) RemoveUserConfigIDs(ids ...int) *UserUpdate

RemoveUserConfigIDs removes the "user_configs" edge to UserConfig entities by IDs.

func (*UserUpdate) RemoveUserConfigs

func (uu *UserUpdate) RemoveUserConfigs(u ...*UserConfig) *UserUpdate

RemoveUserConfigs removes "user_configs" edges to UserConfig entities.

func (*UserUpdate) RemoveUserTomatoIDs

func (uu *UserUpdate) RemoveUserTomatoIDs(ids ...int) *UserUpdate

RemoveUserTomatoIDs removes the "user_tomatoes" edge to UserTomato entities by IDs.

func (*UserUpdate) RemoveUserTomatoes

func (uu *UserUpdate) RemoveUserTomatoes(u ...*UserTomato) *UserUpdate

RemoveUserTomatoes removes "user_tomatoes" edges to UserTomato entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetEnabled

func (uu *UserUpdate) SetEnabled(b bool) *UserUpdate

SetEnabled sets the "enabled" field.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddUserConfigIDs

func (uuo *UserUpdateOne) AddUserConfigIDs(ids ...int) *UserUpdateOne

AddUserConfigIDs adds the "user_configs" edge to the UserConfig entity by IDs.

func (*UserUpdateOne) AddUserConfigs

func (uuo *UserUpdateOne) AddUserConfigs(u ...*UserConfig) *UserUpdateOne

AddUserConfigs adds the "user_configs" edges to the UserConfig entity.

func (*UserUpdateOne) AddUserTomatoIDs

func (uuo *UserUpdateOne) AddUserTomatoIDs(ids ...int) *UserUpdateOne

AddUserTomatoIDs adds the "user_tomatoes" edge to the UserTomato entity by IDs.

func (*UserUpdateOne) AddUserTomatoes

func (uuo *UserUpdateOne) AddUserTomatoes(u ...*UserTomato) *UserUpdateOne

AddUserTomatoes adds the "user_tomatoes" edges to the UserTomato entity.

func (*UserUpdateOne) ClearUserConfigs

func (uuo *UserUpdateOne) ClearUserConfigs() *UserUpdateOne

ClearUserConfigs clears all "user_configs" edges to the UserConfig entity.

func (*UserUpdateOne) ClearUserTomatoes

func (uuo *UserUpdateOne) ClearUserTomatoes() *UserUpdateOne

ClearUserTomatoes clears all "user_tomatoes" edges to the UserTomato 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) RemoveUserConfigIDs

func (uuo *UserUpdateOne) RemoveUserConfigIDs(ids ...int) *UserUpdateOne

RemoveUserConfigIDs removes the "user_configs" edge to UserConfig entities by IDs.

func (*UserUpdateOne) RemoveUserConfigs

func (uuo *UserUpdateOne) RemoveUserConfigs(u ...*UserConfig) *UserUpdateOne

RemoveUserConfigs removes "user_configs" edges to UserConfig entities.

func (*UserUpdateOne) RemoveUserTomatoIDs

func (uuo *UserUpdateOne) RemoveUserTomatoIDs(ids ...int) *UserUpdateOne

RemoveUserTomatoIDs removes the "user_tomatoes" edge to UserTomato entities by IDs.

func (*UserUpdateOne) RemoveUserTomatoes

func (uuo *UserUpdateOne) RemoveUserTomatoes(u ...*UserTomato) *UserUpdateOne

RemoveUserTomatoes removes "user_tomatoes" edges to UserTomato entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetEnabled

func (uuo *UserUpdateOne) SetEnabled(b bool) *UserUpdateOne

SetEnabled sets the "enabled" field.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

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