ent

package
v0.0.0-...-b3d1480 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 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.
	TypeJob       = "Job"
	TypeUser      = "User"
	TypeUser_info = "User_info"
	TypeUser_job  = "User_job"
)

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
	// Job is the client for interacting with the Job builders.
	Job *JobClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// User_info is the client for interacting with the User_info builders.
	User_info *User_infoClient
	// User_job is the client for interacting with the User_job builders.
	User_job *User_jobClient
	// 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().
	Job.
	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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type Job

type Job struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// job name
	JobName string `json:"job_name,omitempty"`
	// company name
	CompanyName string `json:"company_name,omitempty"`
	// delete or not
	IsExist bool `json:"is_exist,omitempty"`
	// job desc
	Description string `json:"description,omitempty"`
	// job is remote or not
	IsRemote bool `json:"is_remote,omitempty"`
	// job exp
	Exp int8 `json:"exp,omitempty"`
	// job area
	Area string `json:"area,omitempty"`
	// create_time
	CreateTime time.Time `json:"create_time,omitempty"`
	// update_time
	UpdateTime time.Time `json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

Job is the model entity for the Job schema.

func (*Job) String

func (j *Job) String() string

String implements the fmt.Stringer.

func (*Job) Unwrap

func (j *Job) Unwrap() *Job

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

func (j *Job) Update() *JobUpdateOne

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

type JobClient

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

JobClient is a client for the Job schema.

func NewJobClient

func NewJobClient(c config) *JobClient

NewJobClient returns a client for the Job from the given config.

func (*JobClient) Create

func (c *JobClient) Create() *JobCreate

Create returns a builder for creating a Job entity.

func (*JobClient) CreateBulk

func (c *JobClient) CreateBulk(builders ...*JobCreate) *JobCreateBulk

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

func (*JobClient) Delete

func (c *JobClient) Delete() *JobDelete

Delete returns a delete builder for Job.

func (*JobClient) DeleteOne

func (c *JobClient) DeleteOne(j *Job) *JobDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*JobClient) DeleteOneID

func (c *JobClient) DeleteOneID(id int) *JobDeleteOne

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

func (*JobClient) Get

func (c *JobClient) Get(ctx context.Context, id int) (*Job, error)

Get returns a Job entity by its id.

func (*JobClient) GetX

func (c *JobClient) GetX(ctx context.Context, id int) *Job

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

func (*JobClient) Hooks

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

Hooks returns the client hooks.

func (*JobClient) Query

func (c *JobClient) Query() *JobQuery

Query returns a query builder for Job.

func (*JobClient) Update

func (c *JobClient) Update() *JobUpdate

Update returns an update builder for Job.

func (*JobClient) UpdateOne

func (c *JobClient) UpdateOne(j *Job) *JobUpdateOne

UpdateOne returns an update builder for the given entity.

func (*JobClient) UpdateOneID

func (c *JobClient) UpdateOneID(id int) *JobUpdateOne

UpdateOneID returns an update builder for the given id.

func (*JobClient) Use

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

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

type JobCreate

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

JobCreate is the builder for creating a Job entity.

func (*JobCreate) Exec

func (jc *JobCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*JobCreate) ExecX

func (jc *JobCreate) ExecX(ctx context.Context)

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

func (*JobCreate) Mutation

func (jc *JobCreate) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobCreate) Save

func (jc *JobCreate) Save(ctx context.Context) (*Job, error)

Save creates the Job in the database.

func (*JobCreate) SaveX

func (jc *JobCreate) SaveX(ctx context.Context) *Job

SaveX calls Save and panics if Save returns an error.

func (*JobCreate) SetArea

func (jc *JobCreate) SetArea(s string) *JobCreate

SetArea sets the "area" field.

func (*JobCreate) SetCompanyName

func (jc *JobCreate) SetCompanyName(s string) *JobCreate

SetCompanyName sets the "company_name" field.

func (*JobCreate) SetCreateTime

func (jc *JobCreate) SetCreateTime(t time.Time) *JobCreate

SetCreateTime sets the "create_time" field.

func (*JobCreate) SetDescription

func (jc *JobCreate) SetDescription(s string) *JobCreate

SetDescription sets the "description" field.

func (*JobCreate) SetExp

func (jc *JobCreate) SetExp(i int8) *JobCreate

SetExp sets the "exp" field.

func (*JobCreate) SetIsExist

func (jc *JobCreate) SetIsExist(b bool) *JobCreate

SetIsExist sets the "is_exist" field.

func (*JobCreate) SetIsRemote

func (jc *JobCreate) SetIsRemote(b bool) *JobCreate

SetIsRemote sets the "is_remote" field.

func (*JobCreate) SetJobName

func (jc *JobCreate) SetJobName(s string) *JobCreate

SetJobName sets the "job_name" field.

func (*JobCreate) SetNillableCreateTime

func (jc *JobCreate) SetNillableCreateTime(t *time.Time) *JobCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*JobCreate) SetNillableIsExist

func (jc *JobCreate) SetNillableIsExist(b *bool) *JobCreate

SetNillableIsExist sets the "is_exist" field if the given value is not nil.

func (*JobCreate) SetNillableUpdateTime

func (jc *JobCreate) SetNillableUpdateTime(t *time.Time) *JobCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*JobCreate) SetUpdateTime

func (jc *JobCreate) SetUpdateTime(t time.Time) *JobCreate

SetUpdateTime sets the "update_time" field.

type JobCreateBulk

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

JobCreateBulk is the builder for creating many Job entities in bulk.

func (*JobCreateBulk) Exec

func (jcb *JobCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*JobCreateBulk) ExecX

func (jcb *JobCreateBulk) ExecX(ctx context.Context)

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

func (*JobCreateBulk) Save

func (jcb *JobCreateBulk) Save(ctx context.Context) ([]*Job, error)

Save creates the Job entities in the database.

func (*JobCreateBulk) SaveX

func (jcb *JobCreateBulk) SaveX(ctx context.Context) []*Job

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

type JobDelete

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

JobDelete is the builder for deleting a Job entity.

func (*JobDelete) Exec

func (jd *JobDelete) Exec(ctx context.Context) (int, error)

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

func (*JobDelete) ExecX

func (jd *JobDelete) ExecX(ctx context.Context) int

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

func (*JobDelete) Where

func (jd *JobDelete) Where(ps ...predicate.Job) *JobDelete

Where appends a list predicates to the JobDelete builder.

type JobDeleteOne

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

JobDeleteOne is the builder for deleting a single Job entity.

func (*JobDeleteOne) Exec

func (jdo *JobDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*JobDeleteOne) ExecX

func (jdo *JobDeleteOne) ExecX(ctx context.Context)

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

type JobGroupBy

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

JobGroupBy is the group-by builder for Job entities.

func (*JobGroupBy) Aggregate

func (jgb *JobGroupBy) Aggregate(fns ...AggregateFunc) *JobGroupBy

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

func (*JobGroupBy) Bool

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

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

func (*JobGroupBy) BoolX

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

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

func (*JobGroupBy) Bools

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

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

func (*JobGroupBy) BoolsX

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

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

func (*JobGroupBy) Float64

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

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

func (*JobGroupBy) Float64X

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

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

func (*JobGroupBy) Float64s

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

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

func (*JobGroupBy) Float64sX

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

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

func (*JobGroupBy) Int

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

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

func (*JobGroupBy) IntX

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

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

func (*JobGroupBy) Ints

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

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

func (*JobGroupBy) IntsX

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

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

func (*JobGroupBy) Scan

func (jgb *JobGroupBy) Scan(ctx context.Context, v any) error

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

func (*JobGroupBy) ScanX

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

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

func (*JobGroupBy) String

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

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

func (*JobGroupBy) StringX

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

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

func (*JobGroupBy) Strings

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

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

func (*JobGroupBy) StringsX

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

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

type JobMutation

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

JobMutation represents an operation that mutates the Job nodes in the graph.

func (*JobMutation) AddExp

func (m *JobMutation) AddExp(i int8)

AddExp adds i to the "exp" field.

func (*JobMutation) AddField

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

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

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

func (*JobMutation) AddedExp

func (m *JobMutation) AddedExp() (r int8, exists bool)

AddedExp returns the value that was added to the "exp" field in this mutation.

func (*JobMutation) AddedField

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

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

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

func (*JobMutation) AddedIDs

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

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

func (*JobMutation) Area

func (m *JobMutation) Area() (r string, exists bool)

Area returns the value of the "area" field in the mutation.

func (*JobMutation) ClearEdge

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

func (m *JobMutation) 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 (*JobMutation) ClearedEdges

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

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

func (*JobMutation) ClearedFields

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

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

func (JobMutation) Client

func (m JobMutation) 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 (*JobMutation) CompanyName

func (m *JobMutation) CompanyName() (r string, exists bool)

CompanyName returns the value of the "company_name" field in the mutation.

func (*JobMutation) CreateTime

func (m *JobMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*JobMutation) Description

func (m *JobMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*JobMutation) EdgeCleared

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

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

func (*JobMutation) Exp

func (m *JobMutation) Exp() (r int8, exists bool)

Exp returns the value of the "exp" field in the mutation.

func (*JobMutation) Field

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

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

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

func (*JobMutation) Fields

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

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

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

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

func (*JobMutation) IsExist

func (m *JobMutation) IsExist() (r bool, exists bool)

IsExist returns the value of the "is_exist" field in the mutation.

func (*JobMutation) IsRemote

func (m *JobMutation) IsRemote() (r bool, exists bool)

IsRemote returns the value of the "is_remote" field in the mutation.

func (*JobMutation) JobName

func (m *JobMutation) JobName() (r string, exists bool)

JobName returns the value of the "job_name" field in the mutation.

func (*JobMutation) OldArea

func (m *JobMutation) OldArea(ctx context.Context) (v string, err error)

OldArea returns the old "area" field's value of the Job entity. If the Job 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 (*JobMutation) OldCompanyName

func (m *JobMutation) OldCompanyName(ctx context.Context) (v string, err error)

OldCompanyName returns the old "company_name" field's value of the Job entity. If the Job 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 (*JobMutation) OldCreateTime

func (m *JobMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Job entity. If the Job 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 (*JobMutation) OldDescription

func (m *JobMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Job entity. If the Job 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 (*JobMutation) OldExp

func (m *JobMutation) OldExp(ctx context.Context) (v int8, err error)

OldExp returns the old "exp" field's value of the Job entity. If the Job 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 (*JobMutation) OldField

func (m *JobMutation) 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 (*JobMutation) OldIsExist

func (m *JobMutation) OldIsExist(ctx context.Context) (v bool, err error)

OldIsExist returns the old "is_exist" field's value of the Job entity. If the Job 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 (*JobMutation) OldIsRemote

func (m *JobMutation) OldIsRemote(ctx context.Context) (v bool, err error)

OldIsRemote returns the old "is_remote" field's value of the Job entity. If the Job 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 (*JobMutation) OldJobName

func (m *JobMutation) OldJobName(ctx context.Context) (v string, err error)

OldJobName returns the old "job_name" field's value of the Job entity. If the Job 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 (*JobMutation) OldUpdateTime

func (m *JobMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Job entity. If the Job 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 (*JobMutation) Op

func (m *JobMutation) Op() Op

Op returns the operation name.

func (*JobMutation) RemovedEdges

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

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

func (*JobMutation) RemovedIDs

func (m *JobMutation) 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 (*JobMutation) ResetArea

func (m *JobMutation) ResetArea()

ResetArea resets all changes to the "area" field.

func (*JobMutation) ResetCompanyName

func (m *JobMutation) ResetCompanyName()

ResetCompanyName resets all changes to the "company_name" field.

func (*JobMutation) ResetCreateTime

func (m *JobMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*JobMutation) ResetDescription

func (m *JobMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*JobMutation) ResetEdge

func (m *JobMutation) 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 (*JobMutation) ResetExp

func (m *JobMutation) ResetExp()

ResetExp resets all changes to the "exp" field.

func (*JobMutation) ResetField

func (m *JobMutation) 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 (*JobMutation) ResetIsExist

func (m *JobMutation) ResetIsExist()

ResetIsExist resets all changes to the "is_exist" field.

func (*JobMutation) ResetIsRemote

func (m *JobMutation) ResetIsRemote()

ResetIsRemote resets all changes to the "is_remote" field.

func (*JobMutation) ResetJobName

func (m *JobMutation) ResetJobName()

ResetJobName resets all changes to the "job_name" field.

func (*JobMutation) ResetUpdateTime

func (m *JobMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*JobMutation) SetArea

func (m *JobMutation) SetArea(s string)

SetArea sets the "area" field.

func (*JobMutation) SetCompanyName

func (m *JobMutation) SetCompanyName(s string)

SetCompanyName sets the "company_name" field.

func (*JobMutation) SetCreateTime

func (m *JobMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*JobMutation) SetDescription

func (m *JobMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*JobMutation) SetExp

func (m *JobMutation) SetExp(i int8)

SetExp sets the "exp" field.

func (*JobMutation) SetField

func (m *JobMutation) 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 (*JobMutation) SetIsExist

func (m *JobMutation) SetIsExist(b bool)

SetIsExist sets the "is_exist" field.

func (*JobMutation) SetIsRemote

func (m *JobMutation) SetIsRemote(b bool)

SetIsRemote sets the "is_remote" field.

func (*JobMutation) SetJobName

func (m *JobMutation) SetJobName(s string)

SetJobName sets the "job_name" field.

func (*JobMutation) SetUpdateTime

func (m *JobMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (JobMutation) Tx

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

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

func (*JobMutation) Type

func (m *JobMutation) Type() string

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

func (*JobMutation) UpdateTime

func (m *JobMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*JobMutation) Where

func (m *JobMutation) Where(ps ...predicate.Job)

Where appends a list predicates to the JobMutation builder.

type JobQuery

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

JobQuery is the builder for querying Job entities.

func (*JobQuery) All

func (jq *JobQuery) All(ctx context.Context) ([]*Job, error)

All executes the query and returns a list of Jobs.

func (*JobQuery) AllX

func (jq *JobQuery) AllX(ctx context.Context) []*Job

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

func (*JobQuery) Clone

func (jq *JobQuery) Clone() *JobQuery

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

func (*JobQuery) Count

func (jq *JobQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*JobQuery) CountX

func (jq *JobQuery) CountX(ctx context.Context) int

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

func (*JobQuery) Exist

func (jq *JobQuery) Exist(ctx context.Context) (bool, error)

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

func (*JobQuery) ExistX

func (jq *JobQuery) ExistX(ctx context.Context) bool

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

func (*JobQuery) First

func (jq *JobQuery) First(ctx context.Context) (*Job, error)

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

func (*JobQuery) FirstID

func (jq *JobQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*JobQuery) FirstIDX

func (jq *JobQuery) FirstIDX(ctx context.Context) int

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

func (*JobQuery) FirstX

func (jq *JobQuery) FirstX(ctx context.Context) *Job

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

func (*JobQuery) GroupBy

func (jq *JobQuery) GroupBy(field string, fields ...string) *JobGroupBy

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

client.Job.Query().
	GroupBy(job.FieldJobName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*JobQuery) IDs

func (jq *JobQuery) IDs(ctx context.Context) ([]int, error)

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

func (*JobQuery) IDsX

func (jq *JobQuery) IDsX(ctx context.Context) []int

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

func (*JobQuery) Limit

func (jq *JobQuery) Limit(limit int) *JobQuery

Limit adds a limit step to the query.

func (*JobQuery) Offset

func (jq *JobQuery) Offset(offset int) *JobQuery

Offset adds an offset step to the query.

func (*JobQuery) Only

func (jq *JobQuery) Only(ctx context.Context) (*Job, error)

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

func (*JobQuery) OnlyID

func (jq *JobQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*JobQuery) OnlyIDX

func (jq *JobQuery) OnlyIDX(ctx context.Context) int

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

func (*JobQuery) OnlyX

func (jq *JobQuery) OnlyX(ctx context.Context) *Job

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

func (*JobQuery) Order

func (jq *JobQuery) Order(o ...OrderFunc) *JobQuery

Order adds an order step to the query.

func (*JobQuery) Select

func (jq *JobQuery) Select(fields ...string) *JobSelect

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

client.Job.Query().
	Select(job.FieldJobName).
	Scan(ctx, &v)

func (*JobQuery) Unique

func (jq *JobQuery) Unique(unique bool) *JobQuery

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

func (jq *JobQuery) Where(ps ...predicate.Job) *JobQuery

Where adds a new predicate for the JobQuery builder.

type JobSelect

type JobSelect struct {
	*JobQuery
	// contains filtered or unexported fields
}

JobSelect is the builder for selecting fields of Job entities.

func (*JobSelect) Bool

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

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

func (*JobSelect) BoolX

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

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

func (*JobSelect) Bools

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

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

func (*JobSelect) BoolsX

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

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

func (*JobSelect) Float64

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

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

func (*JobSelect) Float64X

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

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

func (*JobSelect) Float64s

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

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

func (*JobSelect) Float64sX

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

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

func (*JobSelect) Int

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

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

func (*JobSelect) IntX

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

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

func (*JobSelect) Ints

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

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

func (*JobSelect) IntsX

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

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

func (*JobSelect) Scan

func (js *JobSelect) Scan(ctx context.Context, v any) error

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

func (*JobSelect) ScanX

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

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

func (*JobSelect) String

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

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

func (*JobSelect) StringX

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

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

func (*JobSelect) Strings

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

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

func (*JobSelect) StringsX

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

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

type JobUpdate

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

JobUpdate is the builder for updating Job entities.

func (*JobUpdate) AddExp

func (ju *JobUpdate) AddExp(i int8) *JobUpdate

AddExp adds i to the "exp" field.

func (*JobUpdate) Exec

func (ju *JobUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*JobUpdate) ExecX

func (ju *JobUpdate) ExecX(ctx context.Context)

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

func (*JobUpdate) Mutation

func (ju *JobUpdate) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobUpdate) Save

func (ju *JobUpdate) Save(ctx context.Context) (int, error)

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

func (*JobUpdate) SaveX

func (ju *JobUpdate) SaveX(ctx context.Context) int

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

func (*JobUpdate) SetArea

func (ju *JobUpdate) SetArea(s string) *JobUpdate

SetArea sets the "area" field.

func (*JobUpdate) SetCompanyName

func (ju *JobUpdate) SetCompanyName(s string) *JobUpdate

SetCompanyName sets the "company_name" field.

func (*JobUpdate) SetCreateTime

func (ju *JobUpdate) SetCreateTime(t time.Time) *JobUpdate

SetCreateTime sets the "create_time" field.

func (*JobUpdate) SetDescription

func (ju *JobUpdate) SetDescription(s string) *JobUpdate

SetDescription sets the "description" field.

func (*JobUpdate) SetExp

func (ju *JobUpdate) SetExp(i int8) *JobUpdate

SetExp sets the "exp" field.

func (*JobUpdate) SetIsExist

func (ju *JobUpdate) SetIsExist(b bool) *JobUpdate

SetIsExist sets the "is_exist" field.

func (*JobUpdate) SetIsRemote

func (ju *JobUpdate) SetIsRemote(b bool) *JobUpdate

SetIsRemote sets the "is_remote" field.

func (*JobUpdate) SetJobName

func (ju *JobUpdate) SetJobName(s string) *JobUpdate

SetJobName sets the "job_name" field.

func (*JobUpdate) SetNillableCreateTime

func (ju *JobUpdate) SetNillableCreateTime(t *time.Time) *JobUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*JobUpdate) SetNillableIsExist

func (ju *JobUpdate) SetNillableIsExist(b *bool) *JobUpdate

SetNillableIsExist sets the "is_exist" field if the given value is not nil.

func (*JobUpdate) SetUpdateTime

func (ju *JobUpdate) SetUpdateTime(t time.Time) *JobUpdate

SetUpdateTime sets the "update_time" field.

func (*JobUpdate) Where

func (ju *JobUpdate) Where(ps ...predicate.Job) *JobUpdate

Where appends a list predicates to the JobUpdate builder.

type JobUpdateOne

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

JobUpdateOne is the builder for updating a single Job entity.

func (*JobUpdateOne) AddExp

func (juo *JobUpdateOne) AddExp(i int8) *JobUpdateOne

AddExp adds i to the "exp" field.

func (*JobUpdateOne) Exec

func (juo *JobUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*JobUpdateOne) ExecX

func (juo *JobUpdateOne) ExecX(ctx context.Context)

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

func (*JobUpdateOne) Mutation

func (juo *JobUpdateOne) Mutation() *JobMutation

Mutation returns the JobMutation object of the builder.

func (*JobUpdateOne) Save

func (juo *JobUpdateOne) Save(ctx context.Context) (*Job, error)

Save executes the query and returns the updated Job entity.

func (*JobUpdateOne) SaveX

func (juo *JobUpdateOne) SaveX(ctx context.Context) *Job

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

func (*JobUpdateOne) Select

func (juo *JobUpdateOne) Select(field string, fields ...string) *JobUpdateOne

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

func (*JobUpdateOne) SetArea

func (juo *JobUpdateOne) SetArea(s string) *JobUpdateOne

SetArea sets the "area" field.

func (*JobUpdateOne) SetCompanyName

func (juo *JobUpdateOne) SetCompanyName(s string) *JobUpdateOne

SetCompanyName sets the "company_name" field.

func (*JobUpdateOne) SetCreateTime

func (juo *JobUpdateOne) SetCreateTime(t time.Time) *JobUpdateOne

SetCreateTime sets the "create_time" field.

func (*JobUpdateOne) SetDescription

func (juo *JobUpdateOne) SetDescription(s string) *JobUpdateOne

SetDescription sets the "description" field.

func (*JobUpdateOne) SetExp

func (juo *JobUpdateOne) SetExp(i int8) *JobUpdateOne

SetExp sets the "exp" field.

func (*JobUpdateOne) SetIsExist

func (juo *JobUpdateOne) SetIsExist(b bool) *JobUpdateOne

SetIsExist sets the "is_exist" field.

func (*JobUpdateOne) SetIsRemote

func (juo *JobUpdateOne) SetIsRemote(b bool) *JobUpdateOne

SetIsRemote sets the "is_remote" field.

func (*JobUpdateOne) SetJobName

func (juo *JobUpdateOne) SetJobName(s string) *JobUpdateOne

SetJobName sets the "job_name" field.

func (*JobUpdateOne) SetNillableCreateTime

func (juo *JobUpdateOne) SetNillableCreateTime(t *time.Time) *JobUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*JobUpdateOne) SetNillableIsExist

func (juo *JobUpdateOne) SetNillableIsExist(b *bool) *JobUpdateOne

SetNillableIsExist sets the "is_exist" field if the given value is not nil.

func (*JobUpdateOne) SetUpdateTime

func (juo *JobUpdateOne) SetUpdateTime(t time.Time) *JobUpdateOne

SetUpdateTime sets the "update_time" field.

type Jobs

type Jobs []*Job

Jobs is a parsable slice of Job.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Tx

type Tx struct {

	// Job is the client for interacting with the Job builders.
	Job *JobClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// User_info is the client for interacting with the User_info builders.
	User_info *User_infoClient
	// User_job is the client for interacting with the User_job builders.
	User_job *User_jobClient
	// 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"`
	// role of user 0-user,1-administer
	Role int8 `json:"role,omitempty"`
	// user name,unique and not empty
	UserName string `json:"user_name,omitempty"`
	// user delete or not
	IsExist bool `json:"is_exist,omitempty"`
	// create_time
	CreateTime time.Time `json:"create_time,omitempty"`
	// update_time
	UpdateTime time.Time `json:"update_time,omitempty"`
	// user title,like software engineer
	UserTitle string `json:"user_title,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

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

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

func (*UserClient) Get

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

Get returns a User entity by its id.

func (*UserClient) GetX

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

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

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

Exec executes the query.

func (*UserCreate) ExecX

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

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

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

Save creates the User in the database.

func (*UserCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetIsExist

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

SetIsExist sets the "is_exist" field.

func (*UserCreate) SetNillableCreateTime

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

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserCreate) SetNillableIsExist

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

SetNillableIsExist sets the "is_exist" field if the given value is not nil.

func (*UserCreate) SetNillableRole

func (uc *UserCreate) SetNillableRole(i *int8) *UserCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime

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

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserCreate) SetRole

func (uc *UserCreate) SetRole(i int8) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetUpdateTime

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

SetUpdateTime sets the "update_time" field.

func (*UserCreate) SetUserName

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

SetUserName sets the "user_name" field.

func (*UserCreate) SetUserTitle

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

SetUserTitle sets the "user_title" 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 UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

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

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

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserInfoCreate

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

UserInfoCreate is the builder for creating a User_info entity.

func (*UserInfoCreate) Exec

func (uic *UserInfoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserInfoCreate) ExecX

func (uic *UserInfoCreate) ExecX(ctx context.Context)

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

func (*UserInfoCreate) Mutation

func (uic *UserInfoCreate) Mutation() *UserInfoMutation

Mutation returns the UserInfoMutation object of the builder.

func (*UserInfoCreate) Save

func (uic *UserInfoCreate) Save(ctx context.Context) (*User_info, error)

Save creates the User_info in the database.

func (*UserInfoCreate) SaveX

func (uic *UserInfoCreate) SaveX(ctx context.Context) *User_info

SaveX calls Save and panics if Save returns an error.

func (*UserInfoCreate) SetPasswdHash

func (uic *UserInfoCreate) SetPasswdHash(s string) *UserInfoCreate

SetPasswdHash sets the "passwd_hash" field.

func (*UserInfoCreate) SetSalt

func (uic *UserInfoCreate) SetSalt(s string) *UserInfoCreate

SetSalt sets the "salt" field.

func (*UserInfoCreate) SetUserName

func (uic *UserInfoCreate) SetUserName(s string) *UserInfoCreate

SetUserName sets the "user_name" field.

type UserInfoCreateBulk

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

UserInfoCreateBulk is the builder for creating many User_info entities in bulk.

func (*UserInfoCreateBulk) Exec

func (uicb *UserInfoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserInfoCreateBulk) ExecX

func (uicb *UserInfoCreateBulk) ExecX(ctx context.Context)

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

func (*UserInfoCreateBulk) Save

func (uicb *UserInfoCreateBulk) Save(ctx context.Context) ([]*User_info, error)

Save creates the User_info entities in the database.

func (*UserInfoCreateBulk) SaveX

func (uicb *UserInfoCreateBulk) SaveX(ctx context.Context) []*User_info

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

type UserInfoDelete

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

UserInfoDelete is the builder for deleting a User_info entity.

func (*UserInfoDelete) Exec

func (uid *UserInfoDelete) Exec(ctx context.Context) (int, error)

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

func (*UserInfoDelete) ExecX

func (uid *UserInfoDelete) ExecX(ctx context.Context) int

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

func (*UserInfoDelete) Where

func (uid *UserInfoDelete) Where(ps ...predicate.User_info) *UserInfoDelete

Where appends a list predicates to the UserInfoDelete builder.

type UserInfoDeleteOne

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

UserInfoDeleteOne is the builder for deleting a single User_info entity.

func (*UserInfoDeleteOne) Exec

func (uido *UserInfoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserInfoDeleteOne) ExecX

func (uido *UserInfoDeleteOne) ExecX(ctx context.Context)

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

type UserInfoGroupBy

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

UserInfoGroupBy is the group-by builder for User_info entities.

func (*UserInfoGroupBy) Aggregate

func (uigb *UserInfoGroupBy) Aggregate(fns ...AggregateFunc) *UserInfoGroupBy

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

func (*UserInfoGroupBy) Bool

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

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

func (*UserInfoGroupBy) BoolX

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

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

func (*UserInfoGroupBy) Bools

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

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

func (*UserInfoGroupBy) BoolsX

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

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

func (*UserInfoGroupBy) Float64

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

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

func (*UserInfoGroupBy) Float64X

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

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

func (*UserInfoGroupBy) Float64s

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

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

func (*UserInfoGroupBy) Float64sX

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

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

func (*UserInfoGroupBy) Int

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

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

func (*UserInfoGroupBy) IntX

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

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

func (*UserInfoGroupBy) Ints

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

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

func (*UserInfoGroupBy) IntsX

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

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

func (*UserInfoGroupBy) Scan

func (uigb *UserInfoGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserInfoGroupBy) ScanX

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

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

func (*UserInfoGroupBy) String

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

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

func (*UserInfoGroupBy) StringX

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

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

func (*UserInfoGroupBy) Strings

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

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

func (*UserInfoGroupBy) StringsX

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

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

type UserInfoMutation

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

UserInfoMutation represents an operation that mutates the User_info nodes in the graph.

func (*UserInfoMutation) AddField

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

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

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

func (*UserInfoMutation) AddedField

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

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

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

func (*UserInfoMutation) AddedIDs

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

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

func (*UserInfoMutation) ClearEdge

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

func (m *UserInfoMutation) 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 (*UserInfoMutation) ClearedEdges

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

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

func (*UserInfoMutation) ClearedFields

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

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

func (UserInfoMutation) Client

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

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

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

func (*UserInfoMutation) Field

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

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

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

func (*UserInfoMutation) Fields

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

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

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

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

func (*UserInfoMutation) OldField

func (m *UserInfoMutation) 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 (*UserInfoMutation) OldPasswdHash

func (m *UserInfoMutation) OldPasswdHash(ctx context.Context) (v string, err error)

OldPasswdHash returns the old "passwd_hash" field's value of the User_info entity. If the User_info 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 (*UserInfoMutation) OldSalt

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

OldSalt returns the old "salt" field's value of the User_info entity. If the User_info 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 (*UserInfoMutation) OldUserName

func (m *UserInfoMutation) OldUserName(ctx context.Context) (v string, err error)

OldUserName returns the old "user_name" field's value of the User_info entity. If the User_info 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 (*UserInfoMutation) Op

func (m *UserInfoMutation) Op() Op

Op returns the operation name.

func (*UserInfoMutation) PasswdHash

func (m *UserInfoMutation) PasswdHash() (r string, exists bool)

PasswdHash returns the value of the "passwd_hash" field in the mutation.

func (*UserInfoMutation) RemovedEdges

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

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

func (*UserInfoMutation) RemovedIDs

func (m *UserInfoMutation) 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 (*UserInfoMutation) ResetEdge

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

func (m *UserInfoMutation) 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 (*UserInfoMutation) ResetPasswdHash

func (m *UserInfoMutation) ResetPasswdHash()

ResetPasswdHash resets all changes to the "passwd_hash" field.

func (*UserInfoMutation) ResetSalt

func (m *UserInfoMutation) ResetSalt()

ResetSalt resets all changes to the "salt" field.

func (*UserInfoMutation) ResetUserName

func (m *UserInfoMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*UserInfoMutation) Salt

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

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

func (*UserInfoMutation) SetField

func (m *UserInfoMutation) 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 (*UserInfoMutation) SetPasswdHash

func (m *UserInfoMutation) SetPasswdHash(s string)

SetPasswdHash sets the "passwd_hash" field.

func (*UserInfoMutation) SetSalt

func (m *UserInfoMutation) SetSalt(s string)

SetSalt sets the "salt" field.

func (*UserInfoMutation) SetUserName

func (m *UserInfoMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (UserInfoMutation) Tx

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

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

func (*UserInfoMutation) Type

func (m *UserInfoMutation) Type() string

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

func (*UserInfoMutation) UserName

func (m *UserInfoMutation) UserName() (r string, exists bool)

UserName returns the value of the "user_name" field in the mutation.

func (*UserInfoMutation) Where

func (m *UserInfoMutation) Where(ps ...predicate.User_info)

Where appends a list predicates to the UserInfoMutation builder.

type UserInfoQuery

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

UserInfoQuery is the builder for querying User_info entities.

func (*UserInfoQuery) All

func (uiq *UserInfoQuery) All(ctx context.Context) ([]*User_info, error)

All executes the query and returns a list of User_infos.

func (*UserInfoQuery) AllX

func (uiq *UserInfoQuery) AllX(ctx context.Context) []*User_info

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

func (*UserInfoQuery) Clone

func (uiq *UserInfoQuery) Clone() *UserInfoQuery

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

func (*UserInfoQuery) Count

func (uiq *UserInfoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserInfoQuery) CountX

func (uiq *UserInfoQuery) CountX(ctx context.Context) int

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

func (*UserInfoQuery) Exist

func (uiq *UserInfoQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserInfoQuery) ExistX

func (uiq *UserInfoQuery) ExistX(ctx context.Context) bool

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

func (*UserInfoQuery) First

func (uiq *UserInfoQuery) First(ctx context.Context) (*User_info, error)

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

func (*UserInfoQuery) FirstID

func (uiq *UserInfoQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserInfoQuery) FirstIDX

func (uiq *UserInfoQuery) FirstIDX(ctx context.Context) int

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

func (*UserInfoQuery) FirstX

func (uiq *UserInfoQuery) FirstX(ctx context.Context) *User_info

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

func (*UserInfoQuery) GroupBy

func (uiq *UserInfoQuery) GroupBy(field string, fields ...string) *UserInfoGroupBy

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

Example:

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

client.UserInfo.Query().
	GroupBy(user_info.FieldUserName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserInfoQuery) IDs

func (uiq *UserInfoQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserInfoQuery) IDsX

func (uiq *UserInfoQuery) IDsX(ctx context.Context) []int

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

func (*UserInfoQuery) Limit

func (uiq *UserInfoQuery) Limit(limit int) *UserInfoQuery

Limit adds a limit step to the query.

func (*UserInfoQuery) Offset

func (uiq *UserInfoQuery) Offset(offset int) *UserInfoQuery

Offset adds an offset step to the query.

func (*UserInfoQuery) Only

func (uiq *UserInfoQuery) Only(ctx context.Context) (*User_info, error)

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

func (*UserInfoQuery) OnlyID

func (uiq *UserInfoQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserInfoQuery) OnlyIDX

func (uiq *UserInfoQuery) OnlyIDX(ctx context.Context) int

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

func (*UserInfoQuery) OnlyX

func (uiq *UserInfoQuery) OnlyX(ctx context.Context) *User_info

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

func (*UserInfoQuery) Order

func (uiq *UserInfoQuery) Order(o ...OrderFunc) *UserInfoQuery

Order adds an order step to the query.

func (*UserInfoQuery) Select

func (uiq *UserInfoQuery) Select(fields ...string) *UserInfoSelect

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

Example:

var v []struct {
	UserName string `json:"user_name,omitempty"`
}

client.UserInfo.Query().
	Select(user_info.FieldUserName).
	Scan(ctx, &v)

func (*UserInfoQuery) Unique

func (uiq *UserInfoQuery) Unique(unique bool) *UserInfoQuery

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

func (uiq *UserInfoQuery) Where(ps ...predicate.User_info) *UserInfoQuery

Where adds a new predicate for the UserInfoQuery builder.

type UserInfoSelect

type UserInfoSelect struct {
	*UserInfoQuery
	// contains filtered or unexported fields
}

UserInfoSelect is the builder for selecting fields of UserInfo entities.

func (*UserInfoSelect) Bool

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

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

func (*UserInfoSelect) BoolX

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

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

func (*UserInfoSelect) Bools

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

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

func (*UserInfoSelect) BoolsX

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

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

func (*UserInfoSelect) Float64

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

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

func (*UserInfoSelect) Float64X

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

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

func (*UserInfoSelect) Float64s

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

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

func (*UserInfoSelect) Float64sX

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

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

func (*UserInfoSelect) Int

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

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

func (*UserInfoSelect) IntX

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

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

func (*UserInfoSelect) Ints

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

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

func (*UserInfoSelect) IntsX

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

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

func (*UserInfoSelect) Scan

func (uis *UserInfoSelect) Scan(ctx context.Context, v any) error

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

func (*UserInfoSelect) ScanX

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

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

func (*UserInfoSelect) String

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

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

func (*UserInfoSelect) StringX

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

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

func (*UserInfoSelect) Strings

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

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

func (*UserInfoSelect) StringsX

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

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

type UserInfoUpdate

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

UserInfoUpdate is the builder for updating User_info entities.

func (*UserInfoUpdate) Exec

func (uiu *UserInfoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserInfoUpdate) ExecX

func (uiu *UserInfoUpdate) ExecX(ctx context.Context)

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

func (*UserInfoUpdate) Mutation

func (uiu *UserInfoUpdate) Mutation() *UserInfoMutation

Mutation returns the UserInfoMutation object of the builder.

func (*UserInfoUpdate) Save

func (uiu *UserInfoUpdate) Save(ctx context.Context) (int, error)

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

func (*UserInfoUpdate) SaveX

func (uiu *UserInfoUpdate) SaveX(ctx context.Context) int

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

func (*UserInfoUpdate) SetPasswdHash

func (uiu *UserInfoUpdate) SetPasswdHash(s string) *UserInfoUpdate

SetPasswdHash sets the "passwd_hash" field.

func (*UserInfoUpdate) SetSalt

func (uiu *UserInfoUpdate) SetSalt(s string) *UserInfoUpdate

SetSalt sets the "salt" field.

func (*UserInfoUpdate) SetUserName

func (uiu *UserInfoUpdate) SetUserName(s string) *UserInfoUpdate

SetUserName sets the "user_name" field.

func (*UserInfoUpdate) Where

func (uiu *UserInfoUpdate) Where(ps ...predicate.User_info) *UserInfoUpdate

Where appends a list predicates to the UserInfoUpdate builder.

type UserInfoUpdateOne

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

UserInfoUpdateOne is the builder for updating a single User_info entity.

func (*UserInfoUpdateOne) Exec

func (uiuo *UserInfoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserInfoUpdateOne) ExecX

func (uiuo *UserInfoUpdateOne) ExecX(ctx context.Context)

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

func (*UserInfoUpdateOne) Mutation

func (uiuo *UserInfoUpdateOne) Mutation() *UserInfoMutation

Mutation returns the UserInfoMutation object of the builder.

func (*UserInfoUpdateOne) Save

func (uiuo *UserInfoUpdateOne) Save(ctx context.Context) (*User_info, error)

Save executes the query and returns the updated User_info entity.

func (*UserInfoUpdateOne) SaveX

func (uiuo *UserInfoUpdateOne) SaveX(ctx context.Context) *User_info

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

func (*UserInfoUpdateOne) Select

func (uiuo *UserInfoUpdateOne) Select(field string, fields ...string) *UserInfoUpdateOne

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

func (*UserInfoUpdateOne) SetPasswdHash

func (uiuo *UserInfoUpdateOne) SetPasswdHash(s string) *UserInfoUpdateOne

SetPasswdHash sets the "passwd_hash" field.

func (*UserInfoUpdateOne) SetSalt

func (uiuo *UserInfoUpdateOne) SetSalt(s string) *UserInfoUpdateOne

SetSalt sets the "salt" field.

func (*UserInfoUpdateOne) SetUserName

func (uiuo *UserInfoUpdateOne) SetUserName(s string) *UserInfoUpdateOne

SetUserName sets the "user_name" field.

type UserJobCreate

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

UserJobCreate is the builder for creating a User_job entity.

func (*UserJobCreate) Exec

func (ujc *UserJobCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserJobCreate) ExecX

func (ujc *UserJobCreate) ExecX(ctx context.Context)

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

func (*UserJobCreate) Mutation

func (ujc *UserJobCreate) Mutation() *UserJobMutation

Mutation returns the UserJobMutation object of the builder.

func (*UserJobCreate) Save

func (ujc *UserJobCreate) Save(ctx context.Context) (*User_job, error)

Save creates the User_job in the database.

func (*UserJobCreate) SaveX

func (ujc *UserJobCreate) SaveX(ctx context.Context) *User_job

SaveX calls Save and panics if Save returns an error.

func (*UserJobCreate) SetCreateTime

func (ujc *UserJobCreate) SetCreateTime(t time.Time) *UserJobCreate

SetCreateTime sets the "create_time" field.

func (*UserJobCreate) SetJobID

func (ujc *UserJobCreate) SetJobID(i int64) *UserJobCreate

SetJobID sets the "job_id" field.

func (*UserJobCreate) SetNillableCreateTime

func (ujc *UserJobCreate) SetNillableCreateTime(t *time.Time) *UserJobCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserJobCreate) SetNillableUpdateTime

func (ujc *UserJobCreate) SetNillableUpdateTime(t *time.Time) *UserJobCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserJobCreate) SetUpdateTime

func (ujc *UserJobCreate) SetUpdateTime(t time.Time) *UserJobCreate

SetUpdateTime sets the "update_time" field.

func (*UserJobCreate) SetUserID

func (ujc *UserJobCreate) SetUserID(i int64) *UserJobCreate

SetUserID sets the "user_id" field.

type UserJobCreateBulk

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

UserJobCreateBulk is the builder for creating many User_job entities in bulk.

func (*UserJobCreateBulk) Exec

func (ujcb *UserJobCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserJobCreateBulk) ExecX

func (ujcb *UserJobCreateBulk) ExecX(ctx context.Context)

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

func (*UserJobCreateBulk) Save

func (ujcb *UserJobCreateBulk) Save(ctx context.Context) ([]*User_job, error)

Save creates the User_job entities in the database.

func (*UserJobCreateBulk) SaveX

func (ujcb *UserJobCreateBulk) SaveX(ctx context.Context) []*User_job

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

type UserJobDelete

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

UserJobDelete is the builder for deleting a User_job entity.

func (*UserJobDelete) Exec

func (ujd *UserJobDelete) Exec(ctx context.Context) (int, error)

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

func (*UserJobDelete) ExecX

func (ujd *UserJobDelete) ExecX(ctx context.Context) int

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

func (*UserJobDelete) Where

func (ujd *UserJobDelete) Where(ps ...predicate.User_job) *UserJobDelete

Where appends a list predicates to the UserJobDelete builder.

type UserJobDeleteOne

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

UserJobDeleteOne is the builder for deleting a single User_job entity.

func (*UserJobDeleteOne) Exec

func (ujdo *UserJobDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserJobDeleteOne) ExecX

func (ujdo *UserJobDeleteOne) ExecX(ctx context.Context)

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

type UserJobGroupBy

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

UserJobGroupBy is the group-by builder for User_job entities.

func (*UserJobGroupBy) Aggregate

func (ujgb *UserJobGroupBy) Aggregate(fns ...AggregateFunc) *UserJobGroupBy

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

func (*UserJobGroupBy) Bool

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

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

func (*UserJobGroupBy) BoolX

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

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

func (*UserJobGroupBy) Bools

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

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

func (*UserJobGroupBy) BoolsX

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

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

func (*UserJobGroupBy) Float64

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

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

func (*UserJobGroupBy) Float64X

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

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

func (*UserJobGroupBy) Float64s

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

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

func (*UserJobGroupBy) Float64sX

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

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

func (*UserJobGroupBy) Int

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

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

func (*UserJobGroupBy) IntX

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

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

func (*UserJobGroupBy) Ints

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

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

func (*UserJobGroupBy) IntsX

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

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

func (*UserJobGroupBy) Scan

func (ujgb *UserJobGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserJobGroupBy) ScanX

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

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

func (*UserJobGroupBy) String

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

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

func (*UserJobGroupBy) StringX

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

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

func (*UserJobGroupBy) Strings

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

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

func (*UserJobGroupBy) StringsX

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

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

type UserJobMutation

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

UserJobMutation represents an operation that mutates the User_job nodes in the graph.

func (*UserJobMutation) AddField

func (m *UserJobMutation) 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 (*UserJobMutation) AddJobID

func (m *UserJobMutation) AddJobID(i int64)

AddJobID adds i to the "job_id" field.

func (*UserJobMutation) AddUserID

func (m *UserJobMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*UserJobMutation) AddedEdges

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

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

func (*UserJobMutation) AddedField

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

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

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

func (*UserJobMutation) AddedIDs

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

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

func (*UserJobMutation) AddedJobID

func (m *UserJobMutation) AddedJobID() (r int64, exists bool)

AddedJobID returns the value that was added to the "job_id" field in this mutation.

func (*UserJobMutation) AddedUserID

func (m *UserJobMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*UserJobMutation) ClearEdge

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

func (m *UserJobMutation) 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 (*UserJobMutation) ClearedEdges

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

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

func (*UserJobMutation) ClearedFields

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

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

func (UserJobMutation) Client

func (m UserJobMutation) 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 (*UserJobMutation) CreateTime

func (m *UserJobMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserJobMutation) EdgeCleared

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

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

func (*UserJobMutation) Field

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

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

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

func (*UserJobMutation) Fields

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

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

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

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

func (*UserJobMutation) JobID

func (m *UserJobMutation) JobID() (r int64, exists bool)

JobID returns the value of the "job_id" field in the mutation.

func (*UserJobMutation) OldCreateTime

func (m *UserJobMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the User_job entity. If the User_job 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 (*UserJobMutation) OldField

func (m *UserJobMutation) 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 (*UserJobMutation) OldJobID

func (m *UserJobMutation) OldJobID(ctx context.Context) (v int64, err error)

OldJobID returns the old "job_id" field's value of the User_job entity. If the User_job 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 (*UserJobMutation) OldUpdateTime

func (m *UserJobMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the User_job entity. If the User_job 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 (*UserJobMutation) OldUserID

func (m *UserJobMutation) OldUserID(ctx context.Context) (v int64, err error)

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

func (m *UserJobMutation) Op() Op

Op returns the operation name.

func (*UserJobMutation) RemovedEdges

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

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

func (*UserJobMutation) RemovedIDs

func (m *UserJobMutation) 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 (*UserJobMutation) ResetCreateTime

func (m *UserJobMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserJobMutation) ResetEdge

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

func (m *UserJobMutation) 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 (*UserJobMutation) ResetJobID

func (m *UserJobMutation) ResetJobID()

ResetJobID resets all changes to the "job_id" field.

func (*UserJobMutation) ResetUpdateTime

func (m *UserJobMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserJobMutation) ResetUserID

func (m *UserJobMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserJobMutation) SetCreateTime

func (m *UserJobMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*UserJobMutation) SetField

func (m *UserJobMutation) 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 (*UserJobMutation) SetJobID

func (m *UserJobMutation) SetJobID(i int64)

SetJobID sets the "job_id" field.

func (*UserJobMutation) SetUpdateTime

func (m *UserJobMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*UserJobMutation) SetUserID

func (m *UserJobMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (UserJobMutation) Tx

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

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

func (*UserJobMutation) Type

func (m *UserJobMutation) Type() string

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

func (*UserJobMutation) UpdateTime

func (m *UserJobMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserJobMutation) UserID

func (m *UserJobMutation) UserID() (r int64, exists bool)

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

func (*UserJobMutation) Where

func (m *UserJobMutation) Where(ps ...predicate.User_job)

Where appends a list predicates to the UserJobMutation builder.

type UserJobQuery

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

UserJobQuery is the builder for querying User_job entities.

func (*UserJobQuery) All

func (ujq *UserJobQuery) All(ctx context.Context) ([]*User_job, error)

All executes the query and returns a list of User_jobs.

func (*UserJobQuery) AllX

func (ujq *UserJobQuery) AllX(ctx context.Context) []*User_job

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

func (*UserJobQuery) Clone

func (ujq *UserJobQuery) Clone() *UserJobQuery

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

func (*UserJobQuery) Count

func (ujq *UserJobQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserJobQuery) CountX

func (ujq *UserJobQuery) CountX(ctx context.Context) int

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

func (*UserJobQuery) Exist

func (ujq *UserJobQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserJobQuery) ExistX

func (ujq *UserJobQuery) ExistX(ctx context.Context) bool

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

func (*UserJobQuery) First

func (ujq *UserJobQuery) First(ctx context.Context) (*User_job, error)

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

func (*UserJobQuery) FirstID

func (ujq *UserJobQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserJobQuery) FirstIDX

func (ujq *UserJobQuery) FirstIDX(ctx context.Context) int

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

func (*UserJobQuery) FirstX

func (ujq *UserJobQuery) FirstX(ctx context.Context) *User_job

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

func (*UserJobQuery) GroupBy

func (ujq *UserJobQuery) GroupBy(field string, fields ...string) *UserJobGroupBy

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 {
	JobID int64 `json:"job_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserJob.Query().
	GroupBy(user_job.FieldJobID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserJobQuery) IDs

func (ujq *UserJobQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserJobQuery) IDsX

func (ujq *UserJobQuery) IDsX(ctx context.Context) []int

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

func (*UserJobQuery) Limit

func (ujq *UserJobQuery) Limit(limit int) *UserJobQuery

Limit adds a limit step to the query.

func (*UserJobQuery) Offset

func (ujq *UserJobQuery) Offset(offset int) *UserJobQuery

Offset adds an offset step to the query.

func (*UserJobQuery) Only

func (ujq *UserJobQuery) Only(ctx context.Context) (*User_job, error)

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

func (*UserJobQuery) OnlyID

func (ujq *UserJobQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserJobQuery) OnlyIDX

func (ujq *UserJobQuery) OnlyIDX(ctx context.Context) int

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

func (*UserJobQuery) OnlyX

func (ujq *UserJobQuery) OnlyX(ctx context.Context) *User_job

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

func (*UserJobQuery) Order

func (ujq *UserJobQuery) Order(o ...OrderFunc) *UserJobQuery

Order adds an order step to the query.

func (*UserJobQuery) Select

func (ujq *UserJobQuery) Select(fields ...string) *UserJobSelect

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 {
	JobID int64 `json:"job_id,omitempty"`
}

client.UserJob.Query().
	Select(user_job.FieldJobID).
	Scan(ctx, &v)

func (*UserJobQuery) Unique

func (ujq *UserJobQuery) Unique(unique bool) *UserJobQuery

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

func (ujq *UserJobQuery) Where(ps ...predicate.User_job) *UserJobQuery

Where adds a new predicate for the UserJobQuery builder.

type UserJobSelect

type UserJobSelect struct {
	*UserJobQuery
	// contains filtered or unexported fields
}

UserJobSelect is the builder for selecting fields of UserJob entities.

func (*UserJobSelect) Bool

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

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

func (*UserJobSelect) BoolX

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

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

func (*UserJobSelect) Bools

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

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

func (*UserJobSelect) BoolsX

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

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

func (*UserJobSelect) Float64

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

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

func (*UserJobSelect) Float64X

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

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

func (*UserJobSelect) Float64s

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

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

func (*UserJobSelect) Float64sX

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

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

func (*UserJobSelect) Int

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

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

func (*UserJobSelect) IntX

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

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

func (*UserJobSelect) Ints

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

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

func (*UserJobSelect) IntsX

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

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

func (*UserJobSelect) Scan

func (ujs *UserJobSelect) Scan(ctx context.Context, v any) error

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

func (*UserJobSelect) ScanX

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

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

func (*UserJobSelect) String

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

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

func (*UserJobSelect) StringX

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

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

func (*UserJobSelect) Strings

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

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

func (*UserJobSelect) StringsX

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

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

type UserJobUpdate

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

UserJobUpdate is the builder for updating User_job entities.

func (*UserJobUpdate) AddJobID

func (uju *UserJobUpdate) AddJobID(i int64) *UserJobUpdate

AddJobID adds i to the "job_id" field.

func (*UserJobUpdate) AddUserID

func (uju *UserJobUpdate) AddUserID(i int64) *UserJobUpdate

AddUserID adds i to the "user_id" field.

func (*UserJobUpdate) Exec

func (uju *UserJobUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserJobUpdate) ExecX

func (uju *UserJobUpdate) ExecX(ctx context.Context)

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

func (*UserJobUpdate) Mutation

func (uju *UserJobUpdate) Mutation() *UserJobMutation

Mutation returns the UserJobMutation object of the builder.

func (*UserJobUpdate) Save

func (uju *UserJobUpdate) Save(ctx context.Context) (int, error)

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

func (*UserJobUpdate) SaveX

func (uju *UserJobUpdate) SaveX(ctx context.Context) int

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

func (*UserJobUpdate) SetCreateTime

func (uju *UserJobUpdate) SetCreateTime(t time.Time) *UserJobUpdate

SetCreateTime sets the "create_time" field.

func (*UserJobUpdate) SetJobID

func (uju *UserJobUpdate) SetJobID(i int64) *UserJobUpdate

SetJobID sets the "job_id" field.

func (*UserJobUpdate) SetNillableCreateTime

func (uju *UserJobUpdate) SetNillableCreateTime(t *time.Time) *UserJobUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserJobUpdate) SetUpdateTime

func (uju *UserJobUpdate) SetUpdateTime(t time.Time) *UserJobUpdate

SetUpdateTime sets the "update_time" field.

func (*UserJobUpdate) SetUserID

func (uju *UserJobUpdate) SetUserID(i int64) *UserJobUpdate

SetUserID sets the "user_id" field.

func (*UserJobUpdate) Where

func (uju *UserJobUpdate) Where(ps ...predicate.User_job) *UserJobUpdate

Where appends a list predicates to the UserJobUpdate builder.

type UserJobUpdateOne

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

UserJobUpdateOne is the builder for updating a single User_job entity.

func (*UserJobUpdateOne) AddJobID

func (ujuo *UserJobUpdateOne) AddJobID(i int64) *UserJobUpdateOne

AddJobID adds i to the "job_id" field.

func (*UserJobUpdateOne) AddUserID

func (ujuo *UserJobUpdateOne) AddUserID(i int64) *UserJobUpdateOne

AddUserID adds i to the "user_id" field.

func (*UserJobUpdateOne) Exec

func (ujuo *UserJobUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserJobUpdateOne) ExecX

func (ujuo *UserJobUpdateOne) ExecX(ctx context.Context)

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

func (*UserJobUpdateOne) Mutation

func (ujuo *UserJobUpdateOne) Mutation() *UserJobMutation

Mutation returns the UserJobMutation object of the builder.

func (*UserJobUpdateOne) Save

func (ujuo *UserJobUpdateOne) Save(ctx context.Context) (*User_job, error)

Save executes the query and returns the updated User_job entity.

func (*UserJobUpdateOne) SaveX

func (ujuo *UserJobUpdateOne) SaveX(ctx context.Context) *User_job

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

func (*UserJobUpdateOne) Select

func (ujuo *UserJobUpdateOne) Select(field string, fields ...string) *UserJobUpdateOne

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

func (*UserJobUpdateOne) SetCreateTime

func (ujuo *UserJobUpdateOne) SetCreateTime(t time.Time) *UserJobUpdateOne

SetCreateTime sets the "create_time" field.

func (*UserJobUpdateOne) SetJobID

func (ujuo *UserJobUpdateOne) SetJobID(i int64) *UserJobUpdateOne

SetJobID sets the "job_id" field.

func (*UserJobUpdateOne) SetNillableCreateTime

func (ujuo *UserJobUpdateOne) SetNillableCreateTime(t *time.Time) *UserJobUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserJobUpdateOne) SetUpdateTime

func (ujuo *UserJobUpdateOne) SetUpdateTime(t time.Time) *UserJobUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserJobUpdateOne) SetUserID

func (ujuo *UserJobUpdateOne) SetUserID(i int64) *UserJobUpdateOne

SetUserID sets the "user_id" field.

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

func (m *UserMutation) AddRole(i int8)

AddRole adds i to the "role" field.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

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

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

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) AddedRole

func (m *UserMutation) AddedRole() (r int8, exists bool)

AddedRole returns the value that was added to the "role" field in this mutation.

func (*UserMutation) ClearEdge

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

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

func (*UserMutation) ClearField

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

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

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreateTime

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

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Field

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

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

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

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

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

func (*UserMutation) ID

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

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

func (*UserMutation) IDs

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

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

func (*UserMutation) IsExist

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

IsExist returns the value of the "is_exist" field in the mutation.

func (*UserMutation) OldCreateTime

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

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

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

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

OldIsExist returns the old "is_exist" 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) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v int8, err error)

OldRole returns the old "role" 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) OldUpdateTime

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

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

func (*UserMutation) OldUserName

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

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

func (*UserMutation) OldUserTitle

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

OldUserTitle returns the old "user_title" 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) 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) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserMutation) ResetEdge

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

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

func (*UserMutation) ResetField

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

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

func (*UserMutation) ResetIsExist

func (m *UserMutation) ResetIsExist()

ResetIsExist resets all changes to the "is_exist" field.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetUpdateTime

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserMutation) ResetUserName

func (m *UserMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*UserMutation) ResetUserTitle

func (m *UserMutation) ResetUserTitle()

ResetUserTitle resets all changes to the "user_title" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r int8, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetCreateTime

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

SetCreateTime sets the "create_time" 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) SetIsExist

func (m *UserMutation) SetIsExist(b bool)

SetIsExist sets the "is_exist" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(i int8)

SetRole sets the "role" field.

func (*UserMutation) SetUpdateTime

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

SetUpdateTime sets the "update_time" field.

func (*UserMutation) SetUserName

func (m *UserMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (*UserMutation) SetUserTitle

func (m *UserMutation) SetUserTitle(s string)

SetUserTitle sets the "user_title" 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) UpdateTime

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

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserMutation) UserName

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

UserName returns the value of the "user_name" field in the mutation.

func (*UserMutation) UserTitle

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

UserTitle returns the value of the "user_title" 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 {
	Role int8 `json:"role,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldRole).
	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 more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

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

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

func (*UserQuery) OnlyIDX

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

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

func (*UserQuery) OnlyX

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

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

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 {
	Role int8 `json:"role,omitempty"`
}

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

func (*UserQuery) Unique

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

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

func (*UserQuery) Where

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

Where adds a new predicate for the UserQuery builder.

type UserSelect

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

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddRole

func (uu *UserUpdate) AddRole(i int8) *UserUpdate

AddRole adds i to the "role" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) 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) SetCreateTime

func (uu *UserUpdate) SetCreateTime(t time.Time) *UserUpdate

SetCreateTime sets the "create_time" field.

func (*UserUpdate) SetIsExist

func (uu *UserUpdate) SetIsExist(b bool) *UserUpdate

SetIsExist sets the "is_exist" field.

func (*UserUpdate) SetNillableCreateTime

func (uu *UserUpdate) SetNillableCreateTime(t *time.Time) *UserUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserUpdate) SetNillableIsExist

func (uu *UserUpdate) SetNillableIsExist(b *bool) *UserUpdate

SetNillableIsExist sets the "is_exist" field if the given value is not nil.

func (*UserUpdate) SetNillableRole

func (uu *UserUpdate) SetNillableRole(i *int8) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(i int8) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetUpdateTime

func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate

SetUpdateTime sets the "update_time" field.

func (*UserUpdate) SetUserName

func (uu *UserUpdate) SetUserName(s string) *UserUpdate

SetUserName sets the "user_name" field.

func (*UserUpdate) SetUserTitle

func (uu *UserUpdate) SetUserTitle(s string) *UserUpdate

SetUserTitle sets the "user_title" 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) AddRole

func (uuo *UserUpdateOne) AddRole(i int8) *UserUpdateOne

AddRole adds i to the "role" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) 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) SetCreateTime

func (uuo *UserUpdateOne) SetCreateTime(t time.Time) *UserUpdateOne

SetCreateTime sets the "create_time" field.

func (*UserUpdateOne) SetIsExist

func (uuo *UserUpdateOne) SetIsExist(b bool) *UserUpdateOne

SetIsExist sets the "is_exist" field.

func (*UserUpdateOne) SetNillableCreateTime

func (uuo *UserUpdateOne) SetNillableCreateTime(t *time.Time) *UserUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsExist

func (uuo *UserUpdateOne) SetNillableIsExist(b *bool) *UserUpdateOne

SetNillableIsExist sets the "is_exist" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRole

func (uuo *UserUpdateOne) SetNillableRole(i *int8) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(i int8) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetUpdateTime

func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserUpdateOne) SetUserName

func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne

SetUserName sets the "user_name" field.

func (*UserUpdateOne) SetUserTitle

func (uuo *UserUpdateOne) SetUserTitle(s string) *UserUpdateOne

SetUserTitle sets the "user_title" field.

type User_info

type User_info struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// user_name
	UserName string `json:"user_name,omitempty"`
	// salt will with passwd hash to result
	Salt string `json:"salt,omitempty"`
	// passwd hash res
	PasswdHash string `json:"passwd_hash,omitempty"`
	// contains filtered or unexported fields
}

User_info is the model entity for the User_info schema.

func (*User_info) String

func (ui *User_info) String() string

String implements the fmt.Stringer.

func (*User_info) Unwrap

func (ui *User_info) Unwrap() *User_info

Unwrap unwraps the User_info 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_info) Update

func (ui *User_info) Update() *UserInfoUpdateOne

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

type User_infoClient

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

User_infoClient is a client for the User_info schema.

func NewUser_infoClient

func NewUser_infoClient(c config) *User_infoClient

NewUser_infoClient returns a client for the User_info from the given config.

func (*User_infoClient) Create

func (c *User_infoClient) Create() *UserInfoCreate

Create returns a builder for creating a User_info entity.

func (*User_infoClient) CreateBulk

func (c *User_infoClient) CreateBulk(builders ...*UserInfoCreate) *UserInfoCreateBulk

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

func (*User_infoClient) Delete

func (c *User_infoClient) Delete() *UserInfoDelete

Delete returns a delete builder for User_info.

func (*User_infoClient) DeleteOne

func (c *User_infoClient) DeleteOne(ui *User_info) *UserInfoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*User_infoClient) DeleteOneID

func (c *User_infoClient) DeleteOneID(id int) *UserInfoDeleteOne

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

func (*User_infoClient) Get

func (c *User_infoClient) Get(ctx context.Context, id int) (*User_info, error)

Get returns a User_info entity by its id.

func (*User_infoClient) GetX

func (c *User_infoClient) GetX(ctx context.Context, id int) *User_info

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

func (*User_infoClient) Hooks

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

Hooks returns the client hooks.

func (*User_infoClient) Query

func (c *User_infoClient) Query() *UserInfoQuery

Query returns a query builder for User_info.

func (*User_infoClient) Update

func (c *User_infoClient) Update() *UserInfoUpdate

Update returns an update builder for User_info.

func (*User_infoClient) UpdateOne

func (c *User_infoClient) UpdateOne(ui *User_info) *UserInfoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*User_infoClient) UpdateOneID

func (c *User_infoClient) UpdateOneID(id int) *UserInfoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*User_infoClient) Use

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

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

type User_infos

type User_infos []*User_info

User_infos is a parsable slice of User_info.

type User_job

type User_job struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// job id,unique for same user id
	JobID int64 `json:"job_id,omitempty"`
	// user id
	UserID int64 `json:"user_id,omitempty"`
	// create_time
	CreateTime time.Time `json:"create_time,omitempty"`
	// update_time
	UpdateTime time.Time `json:"update_time,omitempty"`
	// contains filtered or unexported fields
}

User_job is the model entity for the User_job schema.

func (*User_job) String

func (uj *User_job) String() string

String implements the fmt.Stringer.

func (*User_job) Unwrap

func (uj *User_job) Unwrap() *User_job

Unwrap unwraps the User_job 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_job) Update

func (uj *User_job) Update() *UserJobUpdateOne

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

type User_jobClient

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

User_jobClient is a client for the User_job schema.

func NewUser_jobClient

func NewUser_jobClient(c config) *User_jobClient

NewUser_jobClient returns a client for the User_job from the given config.

func (*User_jobClient) Create

func (c *User_jobClient) Create() *UserJobCreate

Create returns a builder for creating a User_job entity.

func (*User_jobClient) CreateBulk

func (c *User_jobClient) CreateBulk(builders ...*UserJobCreate) *UserJobCreateBulk

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

func (*User_jobClient) Delete

func (c *User_jobClient) Delete() *UserJobDelete

Delete returns a delete builder for User_job.

func (*User_jobClient) DeleteOne

func (c *User_jobClient) DeleteOne(uj *User_job) *UserJobDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*User_jobClient) DeleteOneID

func (c *User_jobClient) DeleteOneID(id int) *UserJobDeleteOne

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

func (*User_jobClient) Get

func (c *User_jobClient) Get(ctx context.Context, id int) (*User_job, error)

Get returns a User_job entity by its id.

func (*User_jobClient) GetX

func (c *User_jobClient) GetX(ctx context.Context, id int) *User_job

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

func (*User_jobClient) Hooks

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

Hooks returns the client hooks.

func (*User_jobClient) Query

func (c *User_jobClient) Query() *UserJobQuery

Query returns a query builder for User_job.

func (*User_jobClient) Update

func (c *User_jobClient) Update() *UserJobUpdate

Update returns an update builder for User_job.

func (*User_jobClient) UpdateOne

func (c *User_jobClient) UpdateOne(uj *User_job) *UserJobUpdateOne

UpdateOne returns an update builder for the given entity.

func (*User_jobClient) UpdateOneID

func (c *User_jobClient) UpdateOneID(id int) *UserJobUpdateOne

UpdateOneID returns an update builder for the given id.

func (*User_jobClient) Use

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

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

type User_jobs

type User_jobs []*User_job

User_jobs is a parsable slice of User_job.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL