domain

package
v0.0.0-...-1cc1a95 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 36 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.
	TypeAuthorization       = "Authorization"
	TypeCampus              = "Campus"
	TypeCertificate         = "Certificate"
	TypeClass               = "Class"
	TypeClassLeader         = "ClassLeader"
	TypeDepartment          = "Department"
	TypeEducationLevel      = "EducationLevel"
	TypeEnrollmentStatus    = "EnrollmentStatus"
	TypeFamilyInfo          = "FamilyInfo"
	TypeMajor               = "Major"
	TypeMajorDirection      = "MajorDirection"
	TypePracticalExperience = "PracticalExperience"
	TypeResource            = "Resource"
	TypeRole                = "Role"
	TypeStudent             = "Student"
	TypeTutor               = "Tutor"
	TypeUser                = "User"
)

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(domain.As(domain.Sum(field1), "sum_field1"), (domain.As(domain.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 Authorization

type Authorization struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ClientID holds the value of the "client_id" field.
	ClientID string `json:"client_id,omitempty"`
	// ClientSecret holds the value of the "client_secret" field.
	ClientSecret string `json:"client_secret,omitempty"`
	// ClientName holds the value of the "client_name" field.
	ClientName string `json:"client_name,omitempty"`
	// GrantType holds the value of the "grant_type" field.
	GrantType []string `json:"grant_type,omitempty"`
	// Scope holds the value of the "scope" field.
	Scope []string `json:"scope,omitempty"`
	// RedirectURL holds the value of the "redirect_url" field.
	RedirectURL string `json:"redirect_url,omitempty"`
	// Domain holds the value of the "domain" field.
	Domain string `json:"domain,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthorizationQuery when eager-loading is set.
	Edges AuthorizationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Authorization is the model entity for the Authorization schema.

func (*Authorization) QueryResource

func (a *Authorization) QueryResource() *ResourceQuery

QueryResource queries the "resource" edge of the Authorization entity.

func (*Authorization) String

func (a *Authorization) String() string

String implements the fmt.Stringer.

func (*Authorization) Unwrap

func (a *Authorization) Unwrap() *Authorization

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

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

type AuthorizationClient

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

AuthorizationClient is a client for the Authorization schema.

func NewAuthorizationClient

func NewAuthorizationClient(c config) *AuthorizationClient

NewAuthorizationClient returns a client for the Authorization from the given config.

func (*AuthorizationClient) Create

Create returns a builder for creating a Authorization entity.

func (*AuthorizationClient) CreateBulk

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

func (*AuthorizationClient) Delete

Delete returns a delete builder for Authorization.

func (*AuthorizationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthorizationClient) DeleteOneID

func (c *AuthorizationClient) DeleteOneID(id int) *AuthorizationDeleteOne

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

func (*AuthorizationClient) Get

Get returns a Authorization entity by its id.

func (*AuthorizationClient) GetX

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

func (*AuthorizationClient) Hooks

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

Hooks returns the client hooks.

func (*AuthorizationClient) Intercept

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

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

func (*AuthorizationClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthorizationClient) Query

Query returns a query builder for Authorization.

func (*AuthorizationClient) QueryResource

func (c *AuthorizationClient) QueryResource(a *Authorization) *ResourceQuery

QueryResource queries the resource edge of a Authorization.

func (*AuthorizationClient) Update

Update returns an update builder for Authorization.

func (*AuthorizationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthorizationClient) UpdateOneID

func (c *AuthorizationClient) UpdateOneID(id int) *AuthorizationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuthorizationClient) Use

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

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

type AuthorizationCreate

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

AuthorizationCreate is the builder for creating a Authorization entity.

func (*AuthorizationCreate) AddResource

func (ac *AuthorizationCreate) AddResource(r ...*Resource) *AuthorizationCreate

AddResource adds the "resource" edges to the Resource entity.

func (*AuthorizationCreate) AddResourceIDs

func (ac *AuthorizationCreate) AddResourceIDs(ids ...int) *AuthorizationCreate

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*AuthorizationCreate) Exec

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

Exec executes the query.

func (*AuthorizationCreate) ExecX

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

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

func (*AuthorizationCreate) Mutation

Mutation returns the AuthorizationMutation object of the builder.

func (*AuthorizationCreate) Save

Save creates the Authorization in the database.

func (*AuthorizationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AuthorizationCreate) SetClientID

func (ac *AuthorizationCreate) SetClientID(s string) *AuthorizationCreate

SetClientID sets the "client_id" field.

func (*AuthorizationCreate) SetClientName

func (ac *AuthorizationCreate) SetClientName(s string) *AuthorizationCreate

SetClientName sets the "client_name" field.

func (*AuthorizationCreate) SetClientSecret

func (ac *AuthorizationCreate) SetClientSecret(s string) *AuthorizationCreate

SetClientSecret sets the "client_secret" field.

func (*AuthorizationCreate) SetDomain

SetDomain sets the "domain" field.

func (*AuthorizationCreate) SetGrantType

func (ac *AuthorizationCreate) SetGrantType(s []string) *AuthorizationCreate

SetGrantType sets the "grant_type" field.

func (*AuthorizationCreate) SetRedirectURL

func (ac *AuthorizationCreate) SetRedirectURL(s string) *AuthorizationCreate

SetRedirectURL sets the "redirect_url" field.

func (*AuthorizationCreate) SetScope

func (ac *AuthorizationCreate) SetScope(s []string) *AuthorizationCreate

SetScope sets the "scope" field.

type AuthorizationCreateBulk

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

AuthorizationCreateBulk is the builder for creating many Authorization entities in bulk.

func (*AuthorizationCreateBulk) Exec

Exec executes the query.

func (*AuthorizationCreateBulk) ExecX

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

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

func (*AuthorizationCreateBulk) Save

Save creates the Authorization entities in the database.

func (*AuthorizationCreateBulk) SaveX

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

type AuthorizationDelete

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

AuthorizationDelete is the builder for deleting a Authorization entity.

func (*AuthorizationDelete) Exec

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

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

func (*AuthorizationDelete) ExecX

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

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

func (*AuthorizationDelete) Where

Where appends a list predicates to the AuthorizationDelete builder.

type AuthorizationDeleteOne

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

AuthorizationDeleteOne is the builder for deleting a single Authorization entity.

func (*AuthorizationDeleteOne) Exec

Exec executes the deletion query.

func (*AuthorizationDeleteOne) ExecX

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

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

func (*AuthorizationDeleteOne) Where

Where appends a list predicates to the AuthorizationDelete builder.

type AuthorizationEdges

type AuthorizationEdges struct {
	// Resource holds the value of the resource edge.
	Resource []*Resource `json:"resource,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthorizationEdges) ResourceOrErr

func (e AuthorizationEdges) ResourceOrErr() ([]*Resource, error)

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

type AuthorizationGroupBy

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

AuthorizationGroupBy is the group-by builder for Authorization entities.

func (*AuthorizationGroupBy) Aggregate

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

func (*AuthorizationGroupBy) Bool

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

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

func (*AuthorizationGroupBy) BoolX

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

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

func (*AuthorizationGroupBy) Bools

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

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

func (*AuthorizationGroupBy) BoolsX

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

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

func (*AuthorizationGroupBy) Float64

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

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

func (*AuthorizationGroupBy) Float64X

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

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

func (*AuthorizationGroupBy) Float64s

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

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

func (*AuthorizationGroupBy) Float64sX

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

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

func (*AuthorizationGroupBy) Int

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

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

func (*AuthorizationGroupBy) IntX

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

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

func (*AuthorizationGroupBy) Ints

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

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

func (*AuthorizationGroupBy) IntsX

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

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

func (*AuthorizationGroupBy) Scan

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

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

func (*AuthorizationGroupBy) ScanX

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

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

func (*AuthorizationGroupBy) String

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

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

func (*AuthorizationGroupBy) StringX

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

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

func (*AuthorizationGroupBy) Strings

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

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

func (*AuthorizationGroupBy) StringsX

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

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

type AuthorizationMutation

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

AuthorizationMutation represents an operation that mutates the Authorization nodes in the graph.

func (*AuthorizationMutation) AddField

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) AddResourceIDs

func (m *AuthorizationMutation) AddResourceIDs(ids ...int)

AddResourceIDs adds the "resource" edge to the Resource entity by ids.

func (*AuthorizationMutation) AddedEdges

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

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

func (*AuthorizationMutation) AddedField

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

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

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

func (*AuthorizationMutation) AddedIDs

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

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

func (*AuthorizationMutation) AppendGrantType

func (m *AuthorizationMutation) AppendGrantType(s []string)

AppendGrantType adds s to the "grant_type" field.

func (*AuthorizationMutation) AppendScope

func (m *AuthorizationMutation) AppendScope(s []string)

AppendScope adds s to the "scope" field.

func (*AuthorizationMutation) AppendedGrantType

func (m *AuthorizationMutation) AppendedGrantType() ([]string, bool)

AppendedGrantType returns the list of values that were appended to the "grant_type" field in this mutation.

func (*AuthorizationMutation) AppendedScope

func (m *AuthorizationMutation) AppendedScope() ([]string, bool)

AppendedScope returns the list of values that were appended to the "scope" field in this mutation.

func (*AuthorizationMutation) ClearEdge

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

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ClearResource

func (m *AuthorizationMutation) ClearResource()

ClearResource clears the "resource" edge to the Resource entity.

func (*AuthorizationMutation) ClearedEdges

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

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

func (*AuthorizationMutation) ClearedFields

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

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

func (AuthorizationMutation) Client

func (m AuthorizationMutation) 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 (*AuthorizationMutation) ClientID

func (m *AuthorizationMutation) ClientID() (r string, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*AuthorizationMutation) ClientName

func (m *AuthorizationMutation) ClientName() (r string, exists bool)

ClientName returns the value of the "client_name" field in the mutation.

func (*AuthorizationMutation) ClientSecret

func (m *AuthorizationMutation) ClientSecret() (r string, exists bool)

ClientSecret returns the value of the "client_secret" field in the mutation.

func (*AuthorizationMutation) Domain

func (m *AuthorizationMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*AuthorizationMutation) EdgeCleared

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

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

func (*AuthorizationMutation) Field

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

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

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

func (*AuthorizationMutation) Fields

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) GrantType

func (m *AuthorizationMutation) GrantType() (r []string, exists bool)

GrantType returns the value of the "grant_type" field in the mutation.

func (*AuthorizationMutation) ID

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

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) OldClientID

func (m *AuthorizationMutation) OldClientID(ctx context.Context) (v string, err error)

OldClientID returns the old "client_id" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldClientName

func (m *AuthorizationMutation) OldClientName(ctx context.Context) (v string, err error)

OldClientName returns the old "client_name" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldClientSecret

func (m *AuthorizationMutation) OldClientSecret(ctx context.Context) (v string, err error)

OldClientSecret returns the old "client_secret" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldDomain

func (m *AuthorizationMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldField

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) OldGrantType

func (m *AuthorizationMutation) OldGrantType(ctx context.Context) (v []string, err error)

OldGrantType returns the old "grant_type" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldRedirectURL

func (m *AuthorizationMutation) OldRedirectURL(ctx context.Context) (v string, err error)

OldRedirectURL returns the old "redirect_url" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) OldScope

func (m *AuthorizationMutation) OldScope(ctx context.Context) (v []string, err error)

OldScope returns the old "scope" field's value of the Authorization entity. If the Authorization 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 (*AuthorizationMutation) Op

func (m *AuthorizationMutation) Op() Op

Op returns the operation name.

func (*AuthorizationMutation) RedirectURL

func (m *AuthorizationMutation) RedirectURL() (r string, exists bool)

RedirectURL returns the value of the "redirect_url" field in the mutation.

func (*AuthorizationMutation) RemoveResourceIDs

func (m *AuthorizationMutation) RemoveResourceIDs(ids ...int)

RemoveResourceIDs removes the "resource" edge to the Resource entity by IDs.

func (*AuthorizationMutation) RemovedEdges

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

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

func (*AuthorizationMutation) RemovedIDs

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) RemovedResourceIDs

func (m *AuthorizationMutation) RemovedResourceIDs() (ids []int)

RemovedResource returns the removed IDs of the "resource" edge to the Resource entity.

func (*AuthorizationMutation) ResetClientID

func (m *AuthorizationMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*AuthorizationMutation) ResetClientName

func (m *AuthorizationMutation) ResetClientName()

ResetClientName resets all changes to the "client_name" field.

func (*AuthorizationMutation) ResetClientSecret

func (m *AuthorizationMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*AuthorizationMutation) ResetDomain

func (m *AuthorizationMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*AuthorizationMutation) ResetEdge

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

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) ResetGrantType

func (m *AuthorizationMutation) ResetGrantType()

ResetGrantType resets all changes to the "grant_type" field.

func (*AuthorizationMutation) ResetRedirectURL

func (m *AuthorizationMutation) ResetRedirectURL()

ResetRedirectURL resets all changes to the "redirect_url" field.

func (*AuthorizationMutation) ResetResource

func (m *AuthorizationMutation) ResetResource()

ResetResource resets all changes to the "resource" edge.

func (*AuthorizationMutation) ResetScope

func (m *AuthorizationMutation) ResetScope()

ResetScope resets all changes to the "scope" field.

func (*AuthorizationMutation) ResourceCleared

func (m *AuthorizationMutation) ResourceCleared() bool

ResourceCleared reports if the "resource" edge to the Resource entity was cleared.

func (*AuthorizationMutation) ResourceIDs

func (m *AuthorizationMutation) ResourceIDs() (ids []int)

ResourceIDs returns the "resource" edge IDs in the mutation.

func (*AuthorizationMutation) Scope

func (m *AuthorizationMutation) Scope() (r []string, exists bool)

Scope returns the value of the "scope" field in the mutation.

func (*AuthorizationMutation) SetClientID

func (m *AuthorizationMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*AuthorizationMutation) SetClientName

func (m *AuthorizationMutation) SetClientName(s string)

SetClientName sets the "client_name" field.

func (*AuthorizationMutation) SetClientSecret

func (m *AuthorizationMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*AuthorizationMutation) SetDomain

func (m *AuthorizationMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*AuthorizationMutation) SetField

func (m *AuthorizationMutation) 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 (*AuthorizationMutation) SetGrantType

func (m *AuthorizationMutation) SetGrantType(s []string)

SetGrantType sets the "grant_type" field.

func (*AuthorizationMutation) SetOp

func (m *AuthorizationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthorizationMutation) SetRedirectURL

func (m *AuthorizationMutation) SetRedirectURL(s string)

SetRedirectURL sets the "redirect_url" field.

func (*AuthorizationMutation) SetScope

func (m *AuthorizationMutation) SetScope(s []string)

SetScope sets the "scope" field.

func (AuthorizationMutation) Tx

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

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

func (*AuthorizationMutation) Type

func (m *AuthorizationMutation) Type() string

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

func (*AuthorizationMutation) Where

Where appends a list predicates to the AuthorizationMutation builder.

func (*AuthorizationMutation) WhereP

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

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

type AuthorizationQuery

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

AuthorizationQuery is the builder for querying Authorization entities.

func (*AuthorizationQuery) Aggregate

func (aq *AuthorizationQuery) Aggregate(fns ...AggregateFunc) *AuthorizationSelect

Aggregate returns a AuthorizationSelect configured with the given aggregations.

func (*AuthorizationQuery) All

All executes the query and returns a list of Authorizations.

func (*AuthorizationQuery) AllX

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

func (*AuthorizationQuery) Clone

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

func (*AuthorizationQuery) Count

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

Count returns the count of the given query.

func (*AuthorizationQuery) CountX

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

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

func (*AuthorizationQuery) Exist

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

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

func (*AuthorizationQuery) ExistX

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

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

func (*AuthorizationQuery) First

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

func (*AuthorizationQuery) FirstID

func (aq *AuthorizationQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AuthorizationQuery) FirstIDX

func (aq *AuthorizationQuery) FirstIDX(ctx context.Context) int

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

func (*AuthorizationQuery) FirstX

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

func (*AuthorizationQuery) GroupBy

func (aq *AuthorizationQuery) GroupBy(field string, fields ...string) *AuthorizationGroupBy

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

client.Authorization.Query().
	GroupBy(authorization.FieldClientID).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*AuthorizationQuery) IDs

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

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

func (*AuthorizationQuery) IDsX

func (aq *AuthorizationQuery) IDsX(ctx context.Context) []int

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

func (*AuthorizationQuery) Limit

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

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

func (*AuthorizationQuery) Offset

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

Offset to start from.

func (*AuthorizationQuery) Only

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

func (*AuthorizationQuery) OnlyID

func (aq *AuthorizationQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AuthorizationQuery) OnlyIDX

func (aq *AuthorizationQuery) OnlyIDX(ctx context.Context) int

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

func (*AuthorizationQuery) OnlyX

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

func (*AuthorizationQuery) Order

Order specifies how the records should be ordered.

func (*AuthorizationQuery) QueryResource

func (aq *AuthorizationQuery) QueryResource() *ResourceQuery

QueryResource chains the current query on the "resource" edge.

func (*AuthorizationQuery) Select

func (aq *AuthorizationQuery) Select(fields ...string) *AuthorizationSelect

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

client.Authorization.Query().
	Select(authorization.FieldClientID).
	Scan(ctx, &v)

func (*AuthorizationQuery) Unique

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

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

Where adds a new predicate for the AuthorizationQuery builder.

func (*AuthorizationQuery) WithResource

func (aq *AuthorizationQuery) WithResource(opts ...func(*ResourceQuery)) *AuthorizationQuery

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

type AuthorizationSelect

type AuthorizationSelect struct {
	*AuthorizationQuery
	// contains filtered or unexported fields
}

AuthorizationSelect is the builder for selecting fields of Authorization entities.

func (*AuthorizationSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AuthorizationSelect) Bool

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

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

func (*AuthorizationSelect) BoolX

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

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

func (*AuthorizationSelect) Bools

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

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

func (*AuthorizationSelect) BoolsX

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

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

func (*AuthorizationSelect) Float64

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

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

func (*AuthorizationSelect) Float64X

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

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

func (*AuthorizationSelect) Float64s

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

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

func (*AuthorizationSelect) Float64sX

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

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

func (*AuthorizationSelect) Int

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

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

func (*AuthorizationSelect) IntX

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

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

func (*AuthorizationSelect) Ints

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

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

func (*AuthorizationSelect) IntsX

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

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

func (*AuthorizationSelect) Scan

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

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

func (*AuthorizationSelect) ScanX

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

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

func (*AuthorizationSelect) String

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

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

func (*AuthorizationSelect) StringX

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

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

func (*AuthorizationSelect) Strings

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

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

func (*AuthorizationSelect) StringsX

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

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

type AuthorizationUpdate

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

AuthorizationUpdate is the builder for updating Authorization entities.

func (*AuthorizationUpdate) AddResource

func (au *AuthorizationUpdate) AddResource(r ...*Resource) *AuthorizationUpdate

AddResource adds the "resource" edges to the Resource entity.

func (*AuthorizationUpdate) AddResourceIDs

func (au *AuthorizationUpdate) AddResourceIDs(ids ...int) *AuthorizationUpdate

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*AuthorizationUpdate) AppendGrantType

func (au *AuthorizationUpdate) AppendGrantType(s []string) *AuthorizationUpdate

AppendGrantType appends s to the "grant_type" field.

func (*AuthorizationUpdate) AppendScope

func (au *AuthorizationUpdate) AppendScope(s []string) *AuthorizationUpdate

AppendScope appends s to the "scope" field.

func (*AuthorizationUpdate) ClearResource

func (au *AuthorizationUpdate) ClearResource() *AuthorizationUpdate

ClearResource clears all "resource" edges to the Resource entity.

func (*AuthorizationUpdate) Exec

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

Exec executes the query.

func (*AuthorizationUpdate) ExecX

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

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

func (*AuthorizationUpdate) Mutation

Mutation returns the AuthorizationMutation object of the builder.

func (*AuthorizationUpdate) RemoveResource

func (au *AuthorizationUpdate) RemoveResource(r ...*Resource) *AuthorizationUpdate

RemoveResource removes "resource" edges to Resource entities.

func (*AuthorizationUpdate) RemoveResourceIDs

func (au *AuthorizationUpdate) RemoveResourceIDs(ids ...int) *AuthorizationUpdate

RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.

func (*AuthorizationUpdate) Save

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

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

func (*AuthorizationUpdate) SaveX

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

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

func (*AuthorizationUpdate) SetClientID

func (au *AuthorizationUpdate) SetClientID(s string) *AuthorizationUpdate

SetClientID sets the "client_id" field.

func (*AuthorizationUpdate) SetClientName

func (au *AuthorizationUpdate) SetClientName(s string) *AuthorizationUpdate

SetClientName sets the "client_name" field.

func (*AuthorizationUpdate) SetClientSecret

func (au *AuthorizationUpdate) SetClientSecret(s string) *AuthorizationUpdate

SetClientSecret sets the "client_secret" field.

func (*AuthorizationUpdate) SetDomain

SetDomain sets the "domain" field.

func (*AuthorizationUpdate) SetGrantType

func (au *AuthorizationUpdate) SetGrantType(s []string) *AuthorizationUpdate

SetGrantType sets the "grant_type" field.

func (*AuthorizationUpdate) SetRedirectURL

func (au *AuthorizationUpdate) SetRedirectURL(s string) *AuthorizationUpdate

SetRedirectURL sets the "redirect_url" field.

func (*AuthorizationUpdate) SetScope

func (au *AuthorizationUpdate) SetScope(s []string) *AuthorizationUpdate

SetScope sets the "scope" field.

func (*AuthorizationUpdate) Where

Where appends a list predicates to the AuthorizationUpdate builder.

type AuthorizationUpdateOne

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

AuthorizationUpdateOne is the builder for updating a single Authorization entity.

func (*AuthorizationUpdateOne) AddResource

func (auo *AuthorizationUpdateOne) AddResource(r ...*Resource) *AuthorizationUpdateOne

AddResource adds the "resource" edges to the Resource entity.

func (*AuthorizationUpdateOne) AddResourceIDs

func (auo *AuthorizationUpdateOne) AddResourceIDs(ids ...int) *AuthorizationUpdateOne

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*AuthorizationUpdateOne) AppendGrantType

func (auo *AuthorizationUpdateOne) AppendGrantType(s []string) *AuthorizationUpdateOne

AppendGrantType appends s to the "grant_type" field.

func (*AuthorizationUpdateOne) AppendScope

func (auo *AuthorizationUpdateOne) AppendScope(s []string) *AuthorizationUpdateOne

AppendScope appends s to the "scope" field.

func (*AuthorizationUpdateOne) ClearResource

func (auo *AuthorizationUpdateOne) ClearResource() *AuthorizationUpdateOne

ClearResource clears all "resource" edges to the Resource entity.

func (*AuthorizationUpdateOne) Exec

Exec executes the query on the entity.

func (*AuthorizationUpdateOne) ExecX

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

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

func (*AuthorizationUpdateOne) Mutation

Mutation returns the AuthorizationMutation object of the builder.

func (*AuthorizationUpdateOne) RemoveResource

func (auo *AuthorizationUpdateOne) RemoveResource(r ...*Resource) *AuthorizationUpdateOne

RemoveResource removes "resource" edges to Resource entities.

func (*AuthorizationUpdateOne) RemoveResourceIDs

func (auo *AuthorizationUpdateOne) RemoveResourceIDs(ids ...int) *AuthorizationUpdateOne

RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.

func (*AuthorizationUpdateOne) Save

Save executes the query and returns the updated Authorization entity.

func (*AuthorizationUpdateOne) SaveX

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

func (*AuthorizationUpdateOne) Select

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

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

func (*AuthorizationUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*AuthorizationUpdateOne) SetClientName

func (auo *AuthorizationUpdateOne) SetClientName(s string) *AuthorizationUpdateOne

SetClientName sets the "client_name" field.

func (*AuthorizationUpdateOne) SetClientSecret

func (auo *AuthorizationUpdateOne) SetClientSecret(s string) *AuthorizationUpdateOne

SetClientSecret sets the "client_secret" field.

func (*AuthorizationUpdateOne) SetDomain

SetDomain sets the "domain" field.

func (*AuthorizationUpdateOne) SetGrantType

func (auo *AuthorizationUpdateOne) SetGrantType(s []string) *AuthorizationUpdateOne

SetGrantType sets the "grant_type" field.

func (*AuthorizationUpdateOne) SetRedirectURL

func (auo *AuthorizationUpdateOne) SetRedirectURL(s string) *AuthorizationUpdateOne

SetRedirectURL sets the "redirect_url" field.

func (*AuthorizationUpdateOne) SetScope

SetScope sets the "scope" field.

func (*AuthorizationUpdateOne) Where

Where appends a list predicates to the AuthorizationUpdate builder.

type Authorizations

type Authorizations []*Authorization

Authorizations is a parsable slice of Authorization.

type Campus

type Campus struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 校区名称
	Name string `json:"name,omitempty"`
	// 校区地址
	Address string `json:"address,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CampusQuery when eager-loading is set.
	Edges CampusEdges `json:"edges"`
	// contains filtered or unexported fields
}

Campus is the model entity for the Campus schema.

func (*Campus) QueryClass

func (c *Campus) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the Campus entity.

func (*Campus) String

func (c *Campus) String() string

String implements the fmt.Stringer.

func (*Campus) Unwrap

func (c *Campus) Unwrap() *Campus

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

func (c *Campus) Update() *CampusUpdateOne

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

type CampusClient

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

CampusClient is a client for the Campus schema.

func NewCampusClient

func NewCampusClient(c config) *CampusClient

NewCampusClient returns a client for the Campus from the given config.

func (*CampusClient) Create

func (c *CampusClient) Create() *CampusCreate

Create returns a builder for creating a Campus entity.

func (*CampusClient) CreateBulk

func (c *CampusClient) CreateBulk(builders ...*CampusCreate) *CampusCreateBulk

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

func (*CampusClient) Delete

func (c *CampusClient) Delete() *CampusDelete

Delete returns a delete builder for Campus.

func (*CampusClient) DeleteOne

func (c *CampusClient) DeleteOne(ca *Campus) *CampusDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CampusClient) DeleteOneID

func (c *CampusClient) DeleteOneID(id int) *CampusDeleteOne

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

func (*CampusClient) Get

func (c *CampusClient) Get(ctx context.Context, id int) (*Campus, error)

Get returns a Campus entity by its id.

func (*CampusClient) GetX

func (c *CampusClient) GetX(ctx context.Context, id int) *Campus

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

func (*CampusClient) Hooks

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

Hooks returns the client hooks.

func (*CampusClient) Intercept

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

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

func (*CampusClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CampusClient) Query

func (c *CampusClient) Query() *CampusQuery

Query returns a query builder for Campus.

func (*CampusClient) QueryClass

func (c *CampusClient) QueryClass(ca *Campus) *ClassQuery

QueryClass queries the class edge of a Campus.

func (*CampusClient) Update

func (c *CampusClient) Update() *CampusUpdate

Update returns an update builder for Campus.

func (*CampusClient) UpdateOne

func (c *CampusClient) UpdateOne(ca *Campus) *CampusUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CampusClient) UpdateOneID

func (c *CampusClient) UpdateOneID(id int) *CampusUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CampusClient) Use

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

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

type CampusCreate

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

CampusCreate is the builder for creating a Campus entity.

func (*CampusCreate) Exec

func (cc *CampusCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CampusCreate) ExecX

func (cc *CampusCreate) ExecX(ctx context.Context)

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

func (*CampusCreate) Mutation

func (cc *CampusCreate) Mutation() *CampusMutation

Mutation returns the CampusMutation object of the builder.

func (*CampusCreate) Save

func (cc *CampusCreate) Save(ctx context.Context) (*Campus, error)

Save creates the Campus in the database.

func (*CampusCreate) SaveX

func (cc *CampusCreate) SaveX(ctx context.Context) *Campus

SaveX calls Save and panics if Save returns an error.

func (*CampusCreate) SetAddress

func (cc *CampusCreate) SetAddress(s string) *CampusCreate

SetAddress sets the "address" field.

func (*CampusCreate) SetClass

func (cc *CampusCreate) SetClass(c *Class) *CampusCreate

SetClass sets the "class" edge to the Class entity.

func (*CampusCreate) SetClassID

func (cc *CampusCreate) SetClassID(id int) *CampusCreate

SetClassID sets the "class" edge to the Class entity by ID.

func (*CampusCreate) SetName

func (cc *CampusCreate) SetName(s string) *CampusCreate

SetName sets the "name" field.

func (*CampusCreate) SetNillableClassID

func (cc *CampusCreate) SetNillableClassID(id *int) *CampusCreate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

type CampusCreateBulk

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

CampusCreateBulk is the builder for creating many Campus entities in bulk.

func (*CampusCreateBulk) Exec

func (ccb *CampusCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CampusCreateBulk) ExecX

func (ccb *CampusCreateBulk) ExecX(ctx context.Context)

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

func (*CampusCreateBulk) Save

func (ccb *CampusCreateBulk) Save(ctx context.Context) ([]*Campus, error)

Save creates the Campus entities in the database.

func (*CampusCreateBulk) SaveX

func (ccb *CampusCreateBulk) SaveX(ctx context.Context) []*Campus

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

type CampusDelete

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

CampusDelete is the builder for deleting a Campus entity.

func (*CampusDelete) Exec

func (cd *CampusDelete) Exec(ctx context.Context) (int, error)

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

func (*CampusDelete) ExecX

func (cd *CampusDelete) ExecX(ctx context.Context) int

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

func (*CampusDelete) Where

func (cd *CampusDelete) Where(ps ...predicate.Campus) *CampusDelete

Where appends a list predicates to the CampusDelete builder.

type CampusDeleteOne

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

CampusDeleteOne is the builder for deleting a single Campus entity.

func (*CampusDeleteOne) Exec

func (cdo *CampusDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CampusDeleteOne) ExecX

func (cdo *CampusDeleteOne) ExecX(ctx context.Context)

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

func (*CampusDeleteOne) Where

func (cdo *CampusDeleteOne) Where(ps ...predicate.Campus) *CampusDeleteOne

Where appends a list predicates to the CampusDelete builder.

type CampusEdges

type CampusEdges struct {
	// Class holds the value of the class edge.
	Class *Class `json:"class,omitempty"`
	// contains filtered or unexported fields
}

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

func (CampusEdges) ClassOrErr

func (e CampusEdges) ClassOrErr() (*Class, error)

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

type CampusGroupBy

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

CampusGroupBy is the group-by builder for Campus entities.

func (*CampusGroupBy) Aggregate

func (cgb *CampusGroupBy) Aggregate(fns ...AggregateFunc) *CampusGroupBy

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

func (*CampusGroupBy) Bool

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

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

func (*CampusGroupBy) BoolX

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

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

func (*CampusGroupBy) Bools

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

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

func (*CampusGroupBy) BoolsX

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

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

func (*CampusGroupBy) Float64

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

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

func (*CampusGroupBy) Float64X

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

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

func (*CampusGroupBy) Float64s

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

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

func (*CampusGroupBy) Float64sX

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

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

func (*CampusGroupBy) Int

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

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

func (*CampusGroupBy) IntX

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

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

func (*CampusGroupBy) Ints

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

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

func (*CampusGroupBy) IntsX

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

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

func (*CampusGroupBy) Scan

func (cgb *CampusGroupBy) Scan(ctx context.Context, v any) error

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

func (*CampusGroupBy) ScanX

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

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

func (*CampusGroupBy) String

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

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

func (*CampusGroupBy) StringX

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

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

func (*CampusGroupBy) Strings

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

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

func (*CampusGroupBy) StringsX

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

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

type CampusMutation

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

CampusMutation represents an operation that mutates the Campus nodes in the graph.

func (*CampusMutation) AddField

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

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

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

func (*CampusMutation) AddedField

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

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

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

func (*CampusMutation) AddedIDs

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

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

func (*CampusMutation) Address

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

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

func (*CampusMutation) ClassCleared

func (m *CampusMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*CampusMutation) ClassID

func (m *CampusMutation) ClassID() (id int, exists bool)

ClassID returns the "class" edge ID in the mutation.

func (*CampusMutation) ClassIDs

func (m *CampusMutation) ClassIDs() (ids []int)

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

func (*CampusMutation) ClearClass

func (m *CampusMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*CampusMutation) ClearEdge

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

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

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

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

func (*CampusMutation) ClearedFields

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

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

func (CampusMutation) Client

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

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

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

func (*CampusMutation) Field

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

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

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

func (*CampusMutation) Fields

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

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

func (m *CampusMutation) 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 (*CampusMutation) Name

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

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

func (*CampusMutation) OldAddress

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

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

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

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

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

func (m *CampusMutation) Op() Op

Op returns the operation name.

func (*CampusMutation) RemovedEdges

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

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

func (*CampusMutation) RemovedIDs

func (m *CampusMutation) 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 (*CampusMutation) ResetAddress

func (m *CampusMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*CampusMutation) ResetClass

func (m *CampusMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*CampusMutation) ResetEdge

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

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

func (m *CampusMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CampusMutation) SetAddress

func (m *CampusMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*CampusMutation) SetClassID

func (m *CampusMutation) SetClassID(id int)

SetClassID sets the "class" edge to the Class entity by id.

func (*CampusMutation) SetField

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

func (m *CampusMutation) SetName(s string)

SetName sets the "name" field.

func (*CampusMutation) SetOp

func (m *CampusMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CampusMutation) Tx

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

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

func (*CampusMutation) Type

func (m *CampusMutation) Type() string

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

func (*CampusMutation) Where

func (m *CampusMutation) Where(ps ...predicate.Campus)

Where appends a list predicates to the CampusMutation builder.

func (*CampusMutation) WhereP

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

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

type CampusQuery

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

CampusQuery is the builder for querying Campus entities.

func (*CampusQuery) Aggregate

func (cq *CampusQuery) Aggregate(fns ...AggregateFunc) *CampusSelect

Aggregate returns a CampusSelect configured with the given aggregations.

func (*CampusQuery) All

func (cq *CampusQuery) All(ctx context.Context) ([]*Campus, error)

All executes the query and returns a list of CampusSlice.

func (*CampusQuery) AllX

func (cq *CampusQuery) AllX(ctx context.Context) []*Campus

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

func (*CampusQuery) Clone

func (cq *CampusQuery) Clone() *CampusQuery

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

func (*CampusQuery) Count

func (cq *CampusQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CampusQuery) CountX

func (cq *CampusQuery) CountX(ctx context.Context) int

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

func (*CampusQuery) Exist

func (cq *CampusQuery) Exist(ctx context.Context) (bool, error)

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

func (*CampusQuery) ExistX

func (cq *CampusQuery) ExistX(ctx context.Context) bool

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

func (*CampusQuery) First

func (cq *CampusQuery) First(ctx context.Context) (*Campus, error)

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

func (*CampusQuery) FirstID

func (cq *CampusQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CampusQuery) FirstIDX

func (cq *CampusQuery) FirstIDX(ctx context.Context) int

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

func (*CampusQuery) FirstX

func (cq *CampusQuery) FirstX(ctx context.Context) *Campus

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

func (*CampusQuery) GroupBy

func (cq *CampusQuery) GroupBy(field string, fields ...string) *CampusGroupBy

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

Example:

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

client.Campus.Query().
	GroupBy(campus.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*CampusQuery) IDs

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

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

func (*CampusQuery) IDsX

func (cq *CampusQuery) IDsX(ctx context.Context) []int

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

func (*CampusQuery) Limit

func (cq *CampusQuery) Limit(limit int) *CampusQuery

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

func (*CampusQuery) Offset

func (cq *CampusQuery) Offset(offset int) *CampusQuery

Offset to start from.

func (*CampusQuery) Only

func (cq *CampusQuery) Only(ctx context.Context) (*Campus, error)

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

func (*CampusQuery) OnlyID

func (cq *CampusQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CampusQuery) OnlyIDX

func (cq *CampusQuery) OnlyIDX(ctx context.Context) int

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

func (*CampusQuery) OnlyX

func (cq *CampusQuery) OnlyX(ctx context.Context) *Campus

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

func (*CampusQuery) Order

func (cq *CampusQuery) Order(o ...OrderFunc) *CampusQuery

Order specifies how the records should be ordered.

func (*CampusQuery) QueryClass

func (cq *CampusQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*CampusQuery) Select

func (cq *CampusQuery) Select(fields ...string) *CampusSelect

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

Example:

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

client.Campus.Query().
	Select(campus.FieldName).
	Scan(ctx, &v)

func (*CampusQuery) Unique

func (cq *CampusQuery) Unique(unique bool) *CampusQuery

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

func (cq *CampusQuery) Where(ps ...predicate.Campus) *CampusQuery

Where adds a new predicate for the CampusQuery builder.

func (*CampusQuery) WithClass

func (cq *CampusQuery) WithClass(opts ...func(*ClassQuery)) *CampusQuery

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

type CampusSelect

type CampusSelect struct {
	*CampusQuery
	// contains filtered or unexported fields
}

CampusSelect is the builder for selecting fields of Campus entities.

func (*CampusSelect) Aggregate

func (cs *CampusSelect) Aggregate(fns ...AggregateFunc) *CampusSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CampusSelect) Bool

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

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

func (*CampusSelect) BoolX

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

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

func (*CampusSelect) Bools

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

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

func (*CampusSelect) BoolsX

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

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

func (*CampusSelect) Float64

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

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

func (*CampusSelect) Float64X

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

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

func (*CampusSelect) Float64s

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

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

func (*CampusSelect) Float64sX

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

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

func (*CampusSelect) Int

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

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

func (*CampusSelect) IntX

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

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

func (*CampusSelect) Ints

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

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

func (*CampusSelect) IntsX

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

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

func (*CampusSelect) Scan

func (cs *CampusSelect) Scan(ctx context.Context, v any) error

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

func (*CampusSelect) ScanX

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

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

func (*CampusSelect) String

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

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

func (*CampusSelect) StringX

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

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

func (*CampusSelect) Strings

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

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

func (*CampusSelect) StringsX

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

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

type CampusSlice

type CampusSlice []*Campus

CampusSlice is a parsable slice of Campus.

type CampusUpdate

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

CampusUpdate is the builder for updating Campus entities.

func (*CampusUpdate) ClearClass

func (cu *CampusUpdate) ClearClass() *CampusUpdate

ClearClass clears the "class" edge to the Class entity.

func (*CampusUpdate) Exec

func (cu *CampusUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CampusUpdate) ExecX

func (cu *CampusUpdate) ExecX(ctx context.Context)

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

func (*CampusUpdate) Mutation

func (cu *CampusUpdate) Mutation() *CampusMutation

Mutation returns the CampusMutation object of the builder.

func (*CampusUpdate) Save

func (cu *CampusUpdate) Save(ctx context.Context) (int, error)

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

func (*CampusUpdate) SaveX

func (cu *CampusUpdate) SaveX(ctx context.Context) int

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

func (*CampusUpdate) SetAddress

func (cu *CampusUpdate) SetAddress(s string) *CampusUpdate

SetAddress sets the "address" field.

func (*CampusUpdate) SetClass

func (cu *CampusUpdate) SetClass(c *Class) *CampusUpdate

SetClass sets the "class" edge to the Class entity.

func (*CampusUpdate) SetClassID

func (cu *CampusUpdate) SetClassID(id int) *CampusUpdate

SetClassID sets the "class" edge to the Class entity by ID.

func (*CampusUpdate) SetName

func (cu *CampusUpdate) SetName(s string) *CampusUpdate

SetName sets the "name" field.

func (*CampusUpdate) SetNillableClassID

func (cu *CampusUpdate) SetNillableClassID(id *int) *CampusUpdate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*CampusUpdate) Where

func (cu *CampusUpdate) Where(ps ...predicate.Campus) *CampusUpdate

Where appends a list predicates to the CampusUpdate builder.

type CampusUpdateOne

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

CampusUpdateOne is the builder for updating a single Campus entity.

func (*CampusUpdateOne) ClearClass

func (cuo *CampusUpdateOne) ClearClass() *CampusUpdateOne

ClearClass clears the "class" edge to the Class entity.

func (*CampusUpdateOne) Exec

func (cuo *CampusUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CampusUpdateOne) ExecX

func (cuo *CampusUpdateOne) ExecX(ctx context.Context)

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

func (*CampusUpdateOne) Mutation

func (cuo *CampusUpdateOne) Mutation() *CampusMutation

Mutation returns the CampusMutation object of the builder.

func (*CampusUpdateOne) Save

func (cuo *CampusUpdateOne) Save(ctx context.Context) (*Campus, error)

Save executes the query and returns the updated Campus entity.

func (*CampusUpdateOne) SaveX

func (cuo *CampusUpdateOne) SaveX(ctx context.Context) *Campus

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

func (*CampusUpdateOne) Select

func (cuo *CampusUpdateOne) Select(field string, fields ...string) *CampusUpdateOne

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

func (*CampusUpdateOne) SetAddress

func (cuo *CampusUpdateOne) SetAddress(s string) *CampusUpdateOne

SetAddress sets the "address" field.

func (*CampusUpdateOne) SetClass

func (cuo *CampusUpdateOne) SetClass(c *Class) *CampusUpdateOne

SetClass sets the "class" edge to the Class entity.

func (*CampusUpdateOne) SetClassID

func (cuo *CampusUpdateOne) SetClassID(id int) *CampusUpdateOne

SetClassID sets the "class" edge to the Class entity by ID.

func (*CampusUpdateOne) SetName

func (cuo *CampusUpdateOne) SetName(s string) *CampusUpdateOne

SetName sets the "name" field.

func (*CampusUpdateOne) SetNillableClassID

func (cuo *CampusUpdateOne) SetNillableClassID(id *int) *CampusUpdateOne

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*CampusUpdateOne) Where

func (cuo *CampusUpdateOne) Where(ps ...predicate.Campus) *CampusUpdateOne

Where appends a list predicates to the CampusUpdate builder.

type Certificate

type Certificate struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 证书名称
	Name string `json:"name,omitempty"`
	// 证书代码
	Code string `json:"code,omitempty"`
	// 证书描述
	Description string `json:"description,omitempty"`
	// 颁发部门
	Department string `json:"department,omitempty"`
	// 颁发日期
	IssueDate string `json:"issue_date,omitempty"`
	// 证书类型
	CertificateType string `json:"certificate_type,omitempty"`
	// 证书级别
	CertificateLevel string `json:"certificate_level,omitempty"`
	// 证书类别
	CertificateType2 string `json:"certificate_type2,omitempty"`
	// 获奖类别
	AwardCategory string `json:"award_category,omitempty"`
	// 证书图片
	CertificateImage []byte `json:"certificate_image,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CertificateQuery when eager-loading is set.
	Edges CertificateEdges `json:"edges"`
	// contains filtered or unexported fields
}

Certificate is the model entity for the Certificate schema.

func (*Certificate) QueryStudent

func (c *Certificate) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the Certificate entity.

func (*Certificate) String

func (c *Certificate) String() string

String implements the fmt.Stringer.

func (*Certificate) Unwrap

func (c *Certificate) Unwrap() *Certificate

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

func (c *Certificate) Update() *CertificateUpdateOne

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

type CertificateClient

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

CertificateClient is a client for the Certificate schema.

func NewCertificateClient

func NewCertificateClient(c config) *CertificateClient

NewCertificateClient returns a client for the Certificate from the given config.

func (*CertificateClient) Create

func (c *CertificateClient) Create() *CertificateCreate

Create returns a builder for creating a Certificate entity.

func (*CertificateClient) CreateBulk

func (c *CertificateClient) CreateBulk(builders ...*CertificateCreate) *CertificateCreateBulk

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

func (*CertificateClient) Delete

func (c *CertificateClient) Delete() *CertificateDelete

Delete returns a delete builder for Certificate.

func (*CertificateClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CertificateClient) DeleteOneID

func (c *CertificateClient) DeleteOneID(id int) *CertificateDeleteOne

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

func (*CertificateClient) Get

func (c *CertificateClient) Get(ctx context.Context, id int) (*Certificate, error)

Get returns a Certificate entity by its id.

func (*CertificateClient) GetX

func (c *CertificateClient) GetX(ctx context.Context, id int) *Certificate

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

func (*CertificateClient) Hooks

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

Hooks returns the client hooks.

func (*CertificateClient) Intercept

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

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

func (*CertificateClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CertificateClient) Query

func (c *CertificateClient) Query() *CertificateQuery

Query returns a query builder for Certificate.

func (*CertificateClient) QueryStudent

func (c *CertificateClient) QueryStudent(ce *Certificate) *StudentQuery

QueryStudent queries the student edge of a Certificate.

func (*CertificateClient) Update

func (c *CertificateClient) Update() *CertificateUpdate

Update returns an update builder for Certificate.

func (*CertificateClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CertificateClient) UpdateOneID

func (c *CertificateClient) UpdateOneID(id int) *CertificateUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CertificateClient) Use

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

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

type CertificateCreate

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

CertificateCreate is the builder for creating a Certificate entity.

func (*CertificateCreate) Exec

func (cc *CertificateCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CertificateCreate) ExecX

func (cc *CertificateCreate) ExecX(ctx context.Context)

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

func (*CertificateCreate) Mutation

func (cc *CertificateCreate) Mutation() *CertificateMutation

Mutation returns the CertificateMutation object of the builder.

func (*CertificateCreate) Save

Save creates the Certificate in the database.

func (*CertificateCreate) SaveX

func (cc *CertificateCreate) SaveX(ctx context.Context) *Certificate

SaveX calls Save and panics if Save returns an error.

func (*CertificateCreate) SetAwardCategory

func (cc *CertificateCreate) SetAwardCategory(s string) *CertificateCreate

SetAwardCategory sets the "award_category" field.

func (*CertificateCreate) SetCertificateImage

func (cc *CertificateCreate) SetCertificateImage(b []byte) *CertificateCreate

SetCertificateImage sets the "certificate_image" field.

func (*CertificateCreate) SetCertificateLevel

func (cc *CertificateCreate) SetCertificateLevel(s string) *CertificateCreate

SetCertificateLevel sets the "certificate_level" field.

func (*CertificateCreate) SetCertificateType

func (cc *CertificateCreate) SetCertificateType(s string) *CertificateCreate

SetCertificateType sets the "certificate_type" field.

func (*CertificateCreate) SetCertificateType2

func (cc *CertificateCreate) SetCertificateType2(s string) *CertificateCreate

SetCertificateType2 sets the "certificate_type2" field.

func (*CertificateCreate) SetCode

func (cc *CertificateCreate) SetCode(s string) *CertificateCreate

SetCode sets the "code" field.

func (*CertificateCreate) SetDepartment

func (cc *CertificateCreate) SetDepartment(s string) *CertificateCreate

SetDepartment sets the "department" field.

func (*CertificateCreate) SetDescription

func (cc *CertificateCreate) SetDescription(s string) *CertificateCreate

SetDescription sets the "description" field.

func (*CertificateCreate) SetIssueDate

func (cc *CertificateCreate) SetIssueDate(s string) *CertificateCreate

SetIssueDate sets the "issue_date" field.

func (*CertificateCreate) SetName

func (cc *CertificateCreate) SetName(s string) *CertificateCreate

SetName sets the "name" field.

func (*CertificateCreate) SetNillableStudentID

func (cc *CertificateCreate) SetNillableStudentID(id *int) *CertificateCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*CertificateCreate) SetStudent

func (cc *CertificateCreate) SetStudent(s *Student) *CertificateCreate

SetStudent sets the "student" edge to the Student entity.

func (*CertificateCreate) SetStudentID

func (cc *CertificateCreate) SetStudentID(id int) *CertificateCreate

SetStudentID sets the "student" edge to the Student entity by ID.

type CertificateCreateBulk

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

CertificateCreateBulk is the builder for creating many Certificate entities in bulk.

func (*CertificateCreateBulk) Exec

func (ccb *CertificateCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CertificateCreateBulk) ExecX

func (ccb *CertificateCreateBulk) ExecX(ctx context.Context)

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

func (*CertificateCreateBulk) Save

func (ccb *CertificateCreateBulk) Save(ctx context.Context) ([]*Certificate, error)

Save creates the Certificate entities in the database.

func (*CertificateCreateBulk) SaveX

func (ccb *CertificateCreateBulk) SaveX(ctx context.Context) []*Certificate

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

type CertificateDelete

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

CertificateDelete is the builder for deleting a Certificate entity.

func (*CertificateDelete) Exec

func (cd *CertificateDelete) Exec(ctx context.Context) (int, error)

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

func (*CertificateDelete) ExecX

func (cd *CertificateDelete) ExecX(ctx context.Context) int

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

func (*CertificateDelete) Where

Where appends a list predicates to the CertificateDelete builder.

type CertificateDeleteOne

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

CertificateDeleteOne is the builder for deleting a single Certificate entity.

func (*CertificateDeleteOne) Exec

func (cdo *CertificateDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CertificateDeleteOne) ExecX

func (cdo *CertificateDeleteOne) ExecX(ctx context.Context)

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

func (*CertificateDeleteOne) Where

Where appends a list predicates to the CertificateDelete builder.

type CertificateEdges

type CertificateEdges struct {
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

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

func (CertificateEdges) StudentOrErr

func (e CertificateEdges) StudentOrErr() (*Student, error)

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

type CertificateGroupBy

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

CertificateGroupBy is the group-by builder for Certificate entities.

func (*CertificateGroupBy) Aggregate

func (cgb *CertificateGroupBy) Aggregate(fns ...AggregateFunc) *CertificateGroupBy

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

func (*CertificateGroupBy) Bool

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

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

func (*CertificateGroupBy) BoolX

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

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

func (*CertificateGroupBy) Bools

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

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

func (*CertificateGroupBy) BoolsX

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

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

func (*CertificateGroupBy) Float64

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

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

func (*CertificateGroupBy) Float64X

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

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

func (*CertificateGroupBy) Float64s

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

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

func (*CertificateGroupBy) Float64sX

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

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

func (*CertificateGroupBy) Int

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

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

func (*CertificateGroupBy) IntX

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

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

func (*CertificateGroupBy) Ints

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

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

func (*CertificateGroupBy) IntsX

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

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

func (*CertificateGroupBy) Scan

func (cgb *CertificateGroupBy) Scan(ctx context.Context, v any) error

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

func (*CertificateGroupBy) ScanX

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

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

func (*CertificateGroupBy) String

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

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

func (*CertificateGroupBy) StringX

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

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

func (*CertificateGroupBy) Strings

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

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

func (*CertificateGroupBy) StringsX

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

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

type CertificateMutation

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

CertificateMutation represents an operation that mutates the Certificate nodes in the graph.

func (*CertificateMutation) AddField

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

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

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

func (*CertificateMutation) AddedField

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

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

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

func (*CertificateMutation) AddedIDs

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

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

func (*CertificateMutation) AwardCategory

func (m *CertificateMutation) AwardCategory() (r string, exists bool)

AwardCategory returns the value of the "award_category" field in the mutation.

func (*CertificateMutation) CertificateImage

func (m *CertificateMutation) CertificateImage() (r []byte, exists bool)

CertificateImage returns the value of the "certificate_image" field in the mutation.

func (*CertificateMutation) CertificateLevel

func (m *CertificateMutation) CertificateLevel() (r string, exists bool)

CertificateLevel returns the value of the "certificate_level" field in the mutation.

func (*CertificateMutation) CertificateType

func (m *CertificateMutation) CertificateType() (r string, exists bool)

CertificateType returns the value of the "certificate_type" field in the mutation.

func (*CertificateMutation) CertificateType2

func (m *CertificateMutation) CertificateType2() (r string, exists bool)

CertificateType2 returns the value of the "certificate_type2" field in the mutation.

func (*CertificateMutation) ClearEdge

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

func (m *CertificateMutation) 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 (*CertificateMutation) ClearStudent

func (m *CertificateMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*CertificateMutation) ClearedEdges

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

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

func (*CertificateMutation) ClearedFields

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

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

func (CertificateMutation) Client

func (m CertificateMutation) 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 (*CertificateMutation) Code

func (m *CertificateMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*CertificateMutation) Department

func (m *CertificateMutation) Department() (r string, exists bool)

Department returns the value of the "department" field in the mutation.

func (*CertificateMutation) Description

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

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

func (*CertificateMutation) EdgeCleared

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

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

func (*CertificateMutation) Field

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

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

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

func (*CertificateMutation) Fields

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

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

func (m *CertificateMutation) 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 (*CertificateMutation) IssueDate

func (m *CertificateMutation) IssueDate() (r string, exists bool)

IssueDate returns the value of the "issue_date" field in the mutation.

func (*CertificateMutation) Name

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

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

func (*CertificateMutation) OldAwardCategory

func (m *CertificateMutation) OldAwardCategory(ctx context.Context) (v string, err error)

OldAwardCategory returns the old "award_category" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateImage

func (m *CertificateMutation) OldCertificateImage(ctx context.Context) (v []byte, err error)

OldCertificateImage returns the old "certificate_image" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateLevel

func (m *CertificateMutation) OldCertificateLevel(ctx context.Context) (v string, err error)

OldCertificateLevel returns the old "certificate_level" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateType

func (m *CertificateMutation) OldCertificateType(ctx context.Context) (v string, err error)

OldCertificateType returns the old "certificate_type" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCertificateType2

func (m *CertificateMutation) OldCertificateType2(ctx context.Context) (v string, err error)

OldCertificateType2 returns the old "certificate_type2" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldCode

func (m *CertificateMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldDepartment

func (m *CertificateMutation) OldDepartment(ctx context.Context) (v string, err error)

OldDepartment returns the old "department" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldDescription

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

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

func (m *CertificateMutation) 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 (*CertificateMutation) OldIssueDate

func (m *CertificateMutation) OldIssueDate(ctx context.Context) (v string, err error)

OldIssueDate returns the old "issue_date" field's value of the Certificate entity. If the Certificate 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 (*CertificateMutation) OldName

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

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

func (m *CertificateMutation) Op() Op

Op returns the operation name.

func (*CertificateMutation) RemovedEdges

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

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

func (*CertificateMutation) RemovedIDs

func (m *CertificateMutation) 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 (*CertificateMutation) ResetAwardCategory

func (m *CertificateMutation) ResetAwardCategory()

ResetAwardCategory resets all changes to the "award_category" field.

func (*CertificateMutation) ResetCertificateImage

func (m *CertificateMutation) ResetCertificateImage()

ResetCertificateImage resets all changes to the "certificate_image" field.

func (*CertificateMutation) ResetCertificateLevel

func (m *CertificateMutation) ResetCertificateLevel()

ResetCertificateLevel resets all changes to the "certificate_level" field.

func (*CertificateMutation) ResetCertificateType

func (m *CertificateMutation) ResetCertificateType()

ResetCertificateType resets all changes to the "certificate_type" field.

func (*CertificateMutation) ResetCertificateType2

func (m *CertificateMutation) ResetCertificateType2()

ResetCertificateType2 resets all changes to the "certificate_type2" field.

func (*CertificateMutation) ResetCode

func (m *CertificateMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*CertificateMutation) ResetDepartment

func (m *CertificateMutation) ResetDepartment()

ResetDepartment resets all changes to the "department" field.

func (*CertificateMutation) ResetDescription

func (m *CertificateMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*CertificateMutation) ResetEdge

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

func (m *CertificateMutation) 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 (*CertificateMutation) ResetIssueDate

func (m *CertificateMutation) ResetIssueDate()

ResetIssueDate resets all changes to the "issue_date" field.

func (*CertificateMutation) ResetName

func (m *CertificateMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CertificateMutation) ResetStudent

func (m *CertificateMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*CertificateMutation) SetAwardCategory

func (m *CertificateMutation) SetAwardCategory(s string)

SetAwardCategory sets the "award_category" field.

func (*CertificateMutation) SetCertificateImage

func (m *CertificateMutation) SetCertificateImage(b []byte)

SetCertificateImage sets the "certificate_image" field.

func (*CertificateMutation) SetCertificateLevel

func (m *CertificateMutation) SetCertificateLevel(s string)

SetCertificateLevel sets the "certificate_level" field.

func (*CertificateMutation) SetCertificateType

func (m *CertificateMutation) SetCertificateType(s string)

SetCertificateType sets the "certificate_type" field.

func (*CertificateMutation) SetCertificateType2

func (m *CertificateMutation) SetCertificateType2(s string)

SetCertificateType2 sets the "certificate_type2" field.

func (*CertificateMutation) SetCode

func (m *CertificateMutation) SetCode(s string)

SetCode sets the "code" field.

func (*CertificateMutation) SetDepartment

func (m *CertificateMutation) SetDepartment(s string)

SetDepartment sets the "department" field.

func (*CertificateMutation) SetDescription

func (m *CertificateMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*CertificateMutation) SetField

func (m *CertificateMutation) 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 (*CertificateMutation) SetIssueDate

func (m *CertificateMutation) SetIssueDate(s string)

SetIssueDate sets the "issue_date" field.

func (*CertificateMutation) SetName

func (m *CertificateMutation) SetName(s string)

SetName sets the "name" field.

func (*CertificateMutation) SetOp

func (m *CertificateMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CertificateMutation) SetStudentID

func (m *CertificateMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*CertificateMutation) StudentCleared

func (m *CertificateMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*CertificateMutation) StudentID

func (m *CertificateMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*CertificateMutation) StudentIDs

func (m *CertificateMutation) StudentIDs() (ids []int)

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

func (CertificateMutation) Tx

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

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

func (*CertificateMutation) Type

func (m *CertificateMutation) Type() string

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

func (*CertificateMutation) Where

func (m *CertificateMutation) Where(ps ...predicate.Certificate)

Where appends a list predicates to the CertificateMutation builder.

func (*CertificateMutation) WhereP

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

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

type CertificateQuery

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

CertificateQuery is the builder for querying Certificate entities.

func (*CertificateQuery) Aggregate

func (cq *CertificateQuery) Aggregate(fns ...AggregateFunc) *CertificateSelect

Aggregate returns a CertificateSelect configured with the given aggregations.

func (*CertificateQuery) All

func (cq *CertificateQuery) All(ctx context.Context) ([]*Certificate, error)

All executes the query and returns a list of Certificates.

func (*CertificateQuery) AllX

func (cq *CertificateQuery) AllX(ctx context.Context) []*Certificate

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

func (*CertificateQuery) Clone

func (cq *CertificateQuery) Clone() *CertificateQuery

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

func (*CertificateQuery) Count

func (cq *CertificateQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CertificateQuery) CountX

func (cq *CertificateQuery) CountX(ctx context.Context) int

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

func (*CertificateQuery) Exist

func (cq *CertificateQuery) Exist(ctx context.Context) (bool, error)

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

func (*CertificateQuery) ExistX

func (cq *CertificateQuery) ExistX(ctx context.Context) bool

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

func (*CertificateQuery) First

func (cq *CertificateQuery) First(ctx context.Context) (*Certificate, error)

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

func (*CertificateQuery) FirstID

func (cq *CertificateQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CertificateQuery) FirstIDX

func (cq *CertificateQuery) FirstIDX(ctx context.Context) int

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

func (*CertificateQuery) FirstX

func (cq *CertificateQuery) FirstX(ctx context.Context) *Certificate

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

func (*CertificateQuery) GroupBy

func (cq *CertificateQuery) GroupBy(field string, fields ...string) *CertificateGroupBy

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

Example:

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

client.Certificate.Query().
	GroupBy(certificate.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*CertificateQuery) IDs

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

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

func (*CertificateQuery) IDsX

func (cq *CertificateQuery) IDsX(ctx context.Context) []int

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

func (*CertificateQuery) Limit

func (cq *CertificateQuery) Limit(limit int) *CertificateQuery

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

func (*CertificateQuery) Offset

func (cq *CertificateQuery) Offset(offset int) *CertificateQuery

Offset to start from.

func (*CertificateQuery) Only

func (cq *CertificateQuery) Only(ctx context.Context) (*Certificate, error)

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

func (*CertificateQuery) OnlyID

func (cq *CertificateQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CertificateQuery) OnlyIDX

func (cq *CertificateQuery) OnlyIDX(ctx context.Context) int

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

func (*CertificateQuery) OnlyX

func (cq *CertificateQuery) OnlyX(ctx context.Context) *Certificate

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

func (*CertificateQuery) Order

func (cq *CertificateQuery) Order(o ...OrderFunc) *CertificateQuery

Order specifies how the records should be ordered.

func (*CertificateQuery) QueryStudent

func (cq *CertificateQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*CertificateQuery) Select

func (cq *CertificateQuery) Select(fields ...string) *CertificateSelect

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

Example:

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

client.Certificate.Query().
	Select(certificate.FieldName).
	Scan(ctx, &v)

func (*CertificateQuery) Unique

func (cq *CertificateQuery) Unique(unique bool) *CertificateQuery

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

Where adds a new predicate for the CertificateQuery builder.

func (*CertificateQuery) WithStudent

func (cq *CertificateQuery) WithStudent(opts ...func(*StudentQuery)) *CertificateQuery

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

type CertificateSelect

type CertificateSelect struct {
	*CertificateQuery
	// contains filtered or unexported fields
}

CertificateSelect is the builder for selecting fields of Certificate entities.

func (*CertificateSelect) Aggregate

func (cs *CertificateSelect) Aggregate(fns ...AggregateFunc) *CertificateSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CertificateSelect) Bool

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

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

func (*CertificateSelect) BoolX

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

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

func (*CertificateSelect) Bools

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

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

func (*CertificateSelect) BoolsX

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

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

func (*CertificateSelect) Float64

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

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

func (*CertificateSelect) Float64X

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

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

func (*CertificateSelect) Float64s

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

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

func (*CertificateSelect) Float64sX

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

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

func (*CertificateSelect) Int

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

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

func (*CertificateSelect) IntX

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

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

func (*CertificateSelect) Ints

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

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

func (*CertificateSelect) IntsX

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

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

func (*CertificateSelect) Scan

func (cs *CertificateSelect) Scan(ctx context.Context, v any) error

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

func (*CertificateSelect) ScanX

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

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

func (*CertificateSelect) String

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

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

func (*CertificateSelect) StringX

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

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

func (*CertificateSelect) Strings

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

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

func (*CertificateSelect) StringsX

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

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

type CertificateUpdate

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

CertificateUpdate is the builder for updating Certificate entities.

func (*CertificateUpdate) ClearStudent

func (cu *CertificateUpdate) ClearStudent() *CertificateUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*CertificateUpdate) Exec

func (cu *CertificateUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CertificateUpdate) ExecX

func (cu *CertificateUpdate) ExecX(ctx context.Context)

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

func (*CertificateUpdate) Mutation

func (cu *CertificateUpdate) Mutation() *CertificateMutation

Mutation returns the CertificateMutation object of the builder.

func (*CertificateUpdate) Save

func (cu *CertificateUpdate) Save(ctx context.Context) (int, error)

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

func (*CertificateUpdate) SaveX

func (cu *CertificateUpdate) SaveX(ctx context.Context) int

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

func (*CertificateUpdate) SetAwardCategory

func (cu *CertificateUpdate) SetAwardCategory(s string) *CertificateUpdate

SetAwardCategory sets the "award_category" field.

func (*CertificateUpdate) SetCertificateImage

func (cu *CertificateUpdate) SetCertificateImage(b []byte) *CertificateUpdate

SetCertificateImage sets the "certificate_image" field.

func (*CertificateUpdate) SetCertificateLevel

func (cu *CertificateUpdate) SetCertificateLevel(s string) *CertificateUpdate

SetCertificateLevel sets the "certificate_level" field.

func (*CertificateUpdate) SetCertificateType

func (cu *CertificateUpdate) SetCertificateType(s string) *CertificateUpdate

SetCertificateType sets the "certificate_type" field.

func (*CertificateUpdate) SetCertificateType2

func (cu *CertificateUpdate) SetCertificateType2(s string) *CertificateUpdate

SetCertificateType2 sets the "certificate_type2" field.

func (*CertificateUpdate) SetCode

func (cu *CertificateUpdate) SetCode(s string) *CertificateUpdate

SetCode sets the "code" field.

func (*CertificateUpdate) SetDepartment

func (cu *CertificateUpdate) SetDepartment(s string) *CertificateUpdate

SetDepartment sets the "department" field.

func (*CertificateUpdate) SetDescription

func (cu *CertificateUpdate) SetDescription(s string) *CertificateUpdate

SetDescription sets the "description" field.

func (*CertificateUpdate) SetIssueDate

func (cu *CertificateUpdate) SetIssueDate(s string) *CertificateUpdate

SetIssueDate sets the "issue_date" field.

func (*CertificateUpdate) SetName

func (cu *CertificateUpdate) SetName(s string) *CertificateUpdate

SetName sets the "name" field.

func (*CertificateUpdate) SetNillableStudentID

func (cu *CertificateUpdate) SetNillableStudentID(id *int) *CertificateUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*CertificateUpdate) SetStudent

func (cu *CertificateUpdate) SetStudent(s *Student) *CertificateUpdate

SetStudent sets the "student" edge to the Student entity.

func (*CertificateUpdate) SetStudentID

func (cu *CertificateUpdate) SetStudentID(id int) *CertificateUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*CertificateUpdate) Where

Where appends a list predicates to the CertificateUpdate builder.

type CertificateUpdateOne

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

CertificateUpdateOne is the builder for updating a single Certificate entity.

func (*CertificateUpdateOne) ClearStudent

func (cuo *CertificateUpdateOne) ClearStudent() *CertificateUpdateOne

ClearStudent clears the "student" edge to the Student entity.

func (*CertificateUpdateOne) Exec

func (cuo *CertificateUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CertificateUpdateOne) ExecX

func (cuo *CertificateUpdateOne) ExecX(ctx context.Context)

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

func (*CertificateUpdateOne) Mutation

func (cuo *CertificateUpdateOne) Mutation() *CertificateMutation

Mutation returns the CertificateMutation object of the builder.

func (*CertificateUpdateOne) Save

Save executes the query and returns the updated Certificate entity.

func (*CertificateUpdateOne) SaveX

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

func (*CertificateUpdateOne) Select

func (cuo *CertificateUpdateOne) Select(field string, fields ...string) *CertificateUpdateOne

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

func (*CertificateUpdateOne) SetAwardCategory

func (cuo *CertificateUpdateOne) SetAwardCategory(s string) *CertificateUpdateOne

SetAwardCategory sets the "award_category" field.

func (*CertificateUpdateOne) SetCertificateImage

func (cuo *CertificateUpdateOne) SetCertificateImage(b []byte) *CertificateUpdateOne

SetCertificateImage sets the "certificate_image" field.

func (*CertificateUpdateOne) SetCertificateLevel

func (cuo *CertificateUpdateOne) SetCertificateLevel(s string) *CertificateUpdateOne

SetCertificateLevel sets the "certificate_level" field.

func (*CertificateUpdateOne) SetCertificateType

func (cuo *CertificateUpdateOne) SetCertificateType(s string) *CertificateUpdateOne

SetCertificateType sets the "certificate_type" field.

func (*CertificateUpdateOne) SetCertificateType2

func (cuo *CertificateUpdateOne) SetCertificateType2(s string) *CertificateUpdateOne

SetCertificateType2 sets the "certificate_type2" field.

func (*CertificateUpdateOne) SetCode

SetCode sets the "code" field.

func (*CertificateUpdateOne) SetDepartment

func (cuo *CertificateUpdateOne) SetDepartment(s string) *CertificateUpdateOne

SetDepartment sets the "department" field.

func (*CertificateUpdateOne) SetDescription

func (cuo *CertificateUpdateOne) SetDescription(s string) *CertificateUpdateOne

SetDescription sets the "description" field.

func (*CertificateUpdateOne) SetIssueDate

func (cuo *CertificateUpdateOne) SetIssueDate(s string) *CertificateUpdateOne

SetIssueDate sets the "issue_date" field.

func (*CertificateUpdateOne) SetName

SetName sets the "name" field.

func (*CertificateUpdateOne) SetNillableStudentID

func (cuo *CertificateUpdateOne) SetNillableStudentID(id *int) *CertificateUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*CertificateUpdateOne) SetStudent

func (cuo *CertificateUpdateOne) SetStudent(s *Student) *CertificateUpdateOne

SetStudent sets the "student" edge to the Student entity.

func (*CertificateUpdateOne) SetStudentID

func (cuo *CertificateUpdateOne) SetStudentID(id int) *CertificateUpdateOne

SetStudentID sets the "student" edge to the Student entity by ID.

func (*CertificateUpdateOne) Where

Where appends a list predicates to the CertificateUpdate builder.

type Certificates

type Certificates []*Certificate

Certificates is a parsable slice of Certificate.

type Class

type Class struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 班级名称
	Name string `json:"name,omitempty"`
	// 班级编号
	Code string `json:"code,omitempty"`
	// 班级描述
	Description string `json:"description,omitempty"`
	// 班级类型
	Type string `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ClassQuery when eager-loading is set.
	Edges ClassEdges `json:"edges"`
	// contains filtered or unexported fields
}

Class is the model entity for the Class schema.

func (*Class) QueryCampus

func (c *Class) QueryCampus() *CampusQuery

QueryCampus queries the "campus" edge of the Class entity.

func (*Class) QueryClassLeader

func (c *Class) QueryClassLeader() *ClassLeaderQuery

QueryClassLeader queries the "class_leader" edge of the Class entity.

func (*Class) QueryDepartment

func (c *Class) QueryDepartment() *DepartmentQuery

QueryDepartment queries the "department" edge of the Class entity.

func (*Class) QueryMajor

func (c *Class) QueryMajor() *MajorQuery

QueryMajor queries the "major" edge of the Class entity.

func (*Class) QueryMajorDirection

func (c *Class) QueryMajorDirection() *MajorDirectionQuery

QueryMajorDirection queries the "major_direction" edge of the Class entity.

func (*Class) QueryStudent

func (c *Class) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the Class entity.

func (*Class) QueryTutor

func (c *Class) QueryTutor() *TutorQuery

QueryTutor queries the "tutor" edge of the Class entity.

func (*Class) String

func (c *Class) String() string

String implements the fmt.Stringer.

func (*Class) Unwrap

func (c *Class) Unwrap() *Class

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

func (c *Class) Update() *ClassUpdateOne

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

type ClassClient

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

ClassClient is a client for the Class schema.

func NewClassClient

func NewClassClient(c config) *ClassClient

NewClassClient returns a client for the Class from the given config.

func (*ClassClient) Create

func (c *ClassClient) Create() *ClassCreate

Create returns a builder for creating a Class entity.

func (*ClassClient) CreateBulk

func (c *ClassClient) CreateBulk(builders ...*ClassCreate) *ClassCreateBulk

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

func (*ClassClient) Delete

func (c *ClassClient) Delete() *ClassDelete

Delete returns a delete builder for Class.

func (*ClassClient) DeleteOne

func (c *ClassClient) DeleteOne(cl *Class) *ClassDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ClassClient) DeleteOneID

func (c *ClassClient) DeleteOneID(id int) *ClassDeleteOne

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

func (*ClassClient) Get

func (c *ClassClient) Get(ctx context.Context, id int) (*Class, error)

Get returns a Class entity by its id.

func (*ClassClient) GetX

func (c *ClassClient) GetX(ctx context.Context, id int) *Class

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

func (*ClassClient) Hooks

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

Hooks returns the client hooks.

func (*ClassClient) Intercept

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

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

func (*ClassClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ClassClient) Query

func (c *ClassClient) Query() *ClassQuery

Query returns a query builder for Class.

func (*ClassClient) QueryCampus

func (c *ClassClient) QueryCampus(cl *Class) *CampusQuery

QueryCampus queries the campus edge of a Class.

func (*ClassClient) QueryClassLeader

func (c *ClassClient) QueryClassLeader(cl *Class) *ClassLeaderQuery

QueryClassLeader queries the class_leader edge of a Class.

func (*ClassClient) QueryDepartment

func (c *ClassClient) QueryDepartment(cl *Class) *DepartmentQuery

QueryDepartment queries the department edge of a Class.

func (*ClassClient) QueryMajor

func (c *ClassClient) QueryMajor(cl *Class) *MajorQuery

QueryMajor queries the major edge of a Class.

func (*ClassClient) QueryMajorDirection

func (c *ClassClient) QueryMajorDirection(cl *Class) *MajorDirectionQuery

QueryMajorDirection queries the major_direction edge of a Class.

func (*ClassClient) QueryStudent

func (c *ClassClient) QueryStudent(cl *Class) *StudentQuery

QueryStudent queries the student edge of a Class.

func (*ClassClient) QueryTutor

func (c *ClassClient) QueryTutor(cl *Class) *TutorQuery

QueryTutor queries the tutor edge of a Class.

func (*ClassClient) Update

func (c *ClassClient) Update() *ClassUpdate

Update returns an update builder for Class.

func (*ClassClient) UpdateOne

func (c *ClassClient) UpdateOne(cl *Class) *ClassUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ClassClient) UpdateOneID

func (c *ClassClient) UpdateOneID(id int) *ClassUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ClassClient) Use

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

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

type ClassCreate

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

ClassCreate is the builder for creating a Class entity.

func (*ClassCreate) AddStudent

func (cc *ClassCreate) AddStudent(s ...*Student) *ClassCreate

AddStudent adds the "student" edges to the Student entity.

func (*ClassCreate) AddStudentIDs

func (cc *ClassCreate) AddStudentIDs(ids ...int) *ClassCreate

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*ClassCreate) Exec

func (cc *ClassCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ClassCreate) ExecX

func (cc *ClassCreate) ExecX(ctx context.Context)

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

func (*ClassCreate) Mutation

func (cc *ClassCreate) Mutation() *ClassMutation

Mutation returns the ClassMutation object of the builder.

func (*ClassCreate) Save

func (cc *ClassCreate) Save(ctx context.Context) (*Class, error)

Save creates the Class in the database.

func (*ClassCreate) SaveX

func (cc *ClassCreate) SaveX(ctx context.Context) *Class

SaveX calls Save and panics if Save returns an error.

func (*ClassCreate) SetCampus

func (cc *ClassCreate) SetCampus(c *Campus) *ClassCreate

SetCampus sets the "campus" edge to the Campus entity.

func (*ClassCreate) SetCampusID

func (cc *ClassCreate) SetCampusID(id int) *ClassCreate

SetCampusID sets the "campus" edge to the Campus entity by ID.

func (*ClassCreate) SetClassLeader

func (cc *ClassCreate) SetClassLeader(c *ClassLeader) *ClassCreate

SetClassLeader sets the "class_leader" edge to the ClassLeader entity.

func (*ClassCreate) SetClassLeaderID

func (cc *ClassCreate) SetClassLeaderID(id int) *ClassCreate

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.

func (*ClassCreate) SetCode

func (cc *ClassCreate) SetCode(s string) *ClassCreate

SetCode sets the "code" field.

func (*ClassCreate) SetDepartment

func (cc *ClassCreate) SetDepartment(d *Department) *ClassCreate

SetDepartment sets the "department" edge to the Department entity.

func (*ClassCreate) SetDepartmentID

func (cc *ClassCreate) SetDepartmentID(id int) *ClassCreate

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*ClassCreate) SetDescription

func (cc *ClassCreate) SetDescription(s string) *ClassCreate

SetDescription sets the "description" field.

func (*ClassCreate) SetMajor

func (cc *ClassCreate) SetMajor(m *Major) *ClassCreate

SetMajor sets the "major" edge to the Major entity.

func (*ClassCreate) SetMajorDirection

func (cc *ClassCreate) SetMajorDirection(m *MajorDirection) *ClassCreate

SetMajorDirection sets the "major_direction" edge to the MajorDirection entity.

func (*ClassCreate) SetMajorDirectionID

func (cc *ClassCreate) SetMajorDirectionID(id int) *ClassCreate

SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID.

func (*ClassCreate) SetMajorID

func (cc *ClassCreate) SetMajorID(id int) *ClassCreate

SetMajorID sets the "major" edge to the Major entity by ID.

func (*ClassCreate) SetName

func (cc *ClassCreate) SetName(s string) *ClassCreate

SetName sets the "name" field.

func (*ClassCreate) SetNillableCampusID

func (cc *ClassCreate) SetNillableCampusID(id *int) *ClassCreate

SetNillableCampusID sets the "campus" edge to the Campus entity by ID if the given value is not nil.

func (*ClassCreate) SetNillableClassLeaderID

func (cc *ClassCreate) SetNillableClassLeaderID(id *int) *ClassCreate

SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.

func (*ClassCreate) SetNillableDepartmentID

func (cc *ClassCreate) SetNillableDepartmentID(id *int) *ClassCreate

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*ClassCreate) SetNillableMajorDirectionID

func (cc *ClassCreate) SetNillableMajorDirectionID(id *int) *ClassCreate

SetNillableMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID if the given value is not nil.

func (*ClassCreate) SetNillableMajorID

func (cc *ClassCreate) SetNillableMajorID(id *int) *ClassCreate

SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.

func (*ClassCreate) SetNillableTutorID

func (cc *ClassCreate) SetNillableTutorID(id *int) *ClassCreate

SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.

func (*ClassCreate) SetTutor

func (cc *ClassCreate) SetTutor(t *Tutor) *ClassCreate

SetTutor sets the "tutor" edge to the Tutor entity.

func (*ClassCreate) SetTutorID

func (cc *ClassCreate) SetTutorID(id int) *ClassCreate

SetTutorID sets the "tutor" edge to the Tutor entity by ID.

func (*ClassCreate) SetType

func (cc *ClassCreate) SetType(s string) *ClassCreate

SetType sets the "type" field.

type ClassCreateBulk

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

ClassCreateBulk is the builder for creating many Class entities in bulk.

func (*ClassCreateBulk) Exec

func (ccb *ClassCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ClassCreateBulk) ExecX

func (ccb *ClassCreateBulk) ExecX(ctx context.Context)

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

func (*ClassCreateBulk) Save

func (ccb *ClassCreateBulk) Save(ctx context.Context) ([]*Class, error)

Save creates the Class entities in the database.

func (*ClassCreateBulk) SaveX

func (ccb *ClassCreateBulk) SaveX(ctx context.Context) []*Class

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

type ClassDelete

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

ClassDelete is the builder for deleting a Class entity.

func (*ClassDelete) Exec

func (cd *ClassDelete) Exec(ctx context.Context) (int, error)

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

func (*ClassDelete) ExecX

func (cd *ClassDelete) ExecX(ctx context.Context) int

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

func (*ClassDelete) Where

func (cd *ClassDelete) Where(ps ...predicate.Class) *ClassDelete

Where appends a list predicates to the ClassDelete builder.

type ClassDeleteOne

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

ClassDeleteOne is the builder for deleting a single Class entity.

func (*ClassDeleteOne) Exec

func (cdo *ClassDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ClassDeleteOne) ExecX

func (cdo *ClassDeleteOne) ExecX(ctx context.Context)

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

func (*ClassDeleteOne) Where

func (cdo *ClassDeleteOne) Where(ps ...predicate.Class) *ClassDeleteOne

Where appends a list predicates to the ClassDelete builder.

type ClassEdges

type ClassEdges struct {
	// Major holds the value of the major edge.
	Major *Major `json:"major,omitempty"`
	// Department holds the value of the department edge.
	Department *Department `json:"department,omitempty"`
	// Campus holds the value of the campus edge.
	Campus *Campus `json:"campus,omitempty"`
	// Student holds the value of the student edge.
	Student []*Student `json:"student,omitempty"`
	// ClassLeader holds the value of the class_leader edge.
	ClassLeader *ClassLeader `json:"class_leader,omitempty"`
	// Tutor holds the value of the tutor edge.
	Tutor *Tutor `json:"tutor,omitempty"`
	// MajorDirection holds the value of the major_direction edge.
	MajorDirection *MajorDirection `json:"major_direction,omitempty"`
	// contains filtered or unexported fields
}

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

func (ClassEdges) CampusOrErr

func (e ClassEdges) CampusOrErr() (*Campus, error)

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

func (ClassEdges) ClassLeaderOrErr

func (e ClassEdges) ClassLeaderOrErr() (*ClassLeader, error)

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

func (ClassEdges) DepartmentOrErr

func (e ClassEdges) DepartmentOrErr() (*Department, error)

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

func (ClassEdges) MajorDirectionOrErr

func (e ClassEdges) MajorDirectionOrErr() (*MajorDirection, error)

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

func (ClassEdges) MajorOrErr

func (e ClassEdges) MajorOrErr() (*Major, error)

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

func (ClassEdges) StudentOrErr

func (e ClassEdges) StudentOrErr() ([]*Student, error)

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

func (ClassEdges) TutorOrErr

func (e ClassEdges) TutorOrErr() (*Tutor, error)

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

type ClassGroupBy

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

ClassGroupBy is the group-by builder for Class entities.

func (*ClassGroupBy) Aggregate

func (cgb *ClassGroupBy) Aggregate(fns ...AggregateFunc) *ClassGroupBy

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

func (*ClassGroupBy) Bool

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

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

func (*ClassGroupBy) BoolX

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

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

func (*ClassGroupBy) Bools

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

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

func (*ClassGroupBy) BoolsX

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

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

func (*ClassGroupBy) Float64

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

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

func (*ClassGroupBy) Float64X

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

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

func (*ClassGroupBy) Float64s

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

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

func (*ClassGroupBy) Float64sX

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

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

func (*ClassGroupBy) Int

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

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

func (*ClassGroupBy) IntX

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

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

func (*ClassGroupBy) Ints

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

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

func (*ClassGroupBy) IntsX

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

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

func (*ClassGroupBy) Scan

func (cgb *ClassGroupBy) Scan(ctx context.Context, v any) error

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

func (*ClassGroupBy) ScanX

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

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

func (*ClassGroupBy) String

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

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

func (*ClassGroupBy) StringX

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

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

func (*ClassGroupBy) Strings

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

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

func (*ClassGroupBy) StringsX

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

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

type ClassLeader

type ClassLeader struct {

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

ClassLeader is the model entity for the ClassLeader schema.

func (*ClassLeader) QueryClass

func (cl *ClassLeader) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the ClassLeader entity.

func (*ClassLeader) QueryStudent

func (cl *ClassLeader) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the ClassLeader entity.

func (*ClassLeader) String

func (cl *ClassLeader) String() string

String implements the fmt.Stringer.

func (*ClassLeader) Unwrap

func (cl *ClassLeader) Unwrap() *ClassLeader

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

func (cl *ClassLeader) Update() *ClassLeaderUpdateOne

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

type ClassLeaderClient

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

ClassLeaderClient is a client for the ClassLeader schema.

func NewClassLeaderClient

func NewClassLeaderClient(c config) *ClassLeaderClient

NewClassLeaderClient returns a client for the ClassLeader from the given config.

func (*ClassLeaderClient) Create

func (c *ClassLeaderClient) Create() *ClassLeaderCreate

Create returns a builder for creating a ClassLeader entity.

func (*ClassLeaderClient) CreateBulk

func (c *ClassLeaderClient) CreateBulk(builders ...*ClassLeaderCreate) *ClassLeaderCreateBulk

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

func (*ClassLeaderClient) Delete

func (c *ClassLeaderClient) Delete() *ClassLeaderDelete

Delete returns a delete builder for ClassLeader.

func (*ClassLeaderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ClassLeaderClient) DeleteOneID

func (c *ClassLeaderClient) DeleteOneID(id int) *ClassLeaderDeleteOne

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

func (*ClassLeaderClient) Get

func (c *ClassLeaderClient) Get(ctx context.Context, id int) (*ClassLeader, error)

Get returns a ClassLeader entity by its id.

func (*ClassLeaderClient) GetX

func (c *ClassLeaderClient) GetX(ctx context.Context, id int) *ClassLeader

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

func (*ClassLeaderClient) Hooks

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

Hooks returns the client hooks.

func (*ClassLeaderClient) Intercept

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

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

func (*ClassLeaderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ClassLeaderClient) Query

func (c *ClassLeaderClient) Query() *ClassLeaderQuery

Query returns a query builder for ClassLeader.

func (*ClassLeaderClient) QueryClass

func (c *ClassLeaderClient) QueryClass(cl *ClassLeader) *ClassQuery

QueryClass queries the class edge of a ClassLeader.

func (*ClassLeaderClient) QueryStudent

func (c *ClassLeaderClient) QueryStudent(cl *ClassLeader) *StudentQuery

QueryStudent queries the student edge of a ClassLeader.

func (*ClassLeaderClient) Update

func (c *ClassLeaderClient) Update() *ClassLeaderUpdate

Update returns an update builder for ClassLeader.

func (*ClassLeaderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ClassLeaderClient) UpdateOneID

func (c *ClassLeaderClient) UpdateOneID(id int) *ClassLeaderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ClassLeaderClient) Use

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

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

type ClassLeaderCreate

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

ClassLeaderCreate is the builder for creating a ClassLeader entity.

func (*ClassLeaderCreate) Exec

func (clc *ClassLeaderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ClassLeaderCreate) ExecX

func (clc *ClassLeaderCreate) ExecX(ctx context.Context)

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

func (*ClassLeaderCreate) Mutation

func (clc *ClassLeaderCreate) Mutation() *ClassLeaderMutation

Mutation returns the ClassLeaderMutation object of the builder.

func (*ClassLeaderCreate) Save

func (clc *ClassLeaderCreate) Save(ctx context.Context) (*ClassLeader, error)

Save creates the ClassLeader in the database.

func (*ClassLeaderCreate) SaveX

func (clc *ClassLeaderCreate) SaveX(ctx context.Context) *ClassLeader

SaveX calls Save and panics if Save returns an error.

func (*ClassLeaderCreate) SetClass

func (clc *ClassLeaderCreate) SetClass(c *Class) *ClassLeaderCreate

SetClass sets the "class" edge to the Class entity.

func (*ClassLeaderCreate) SetClassID

func (clc *ClassLeaderCreate) SetClassID(id int) *ClassLeaderCreate

SetClassID sets the "class" edge to the Class entity by ID.

func (*ClassLeaderCreate) SetNillableClassID

func (clc *ClassLeaderCreate) SetNillableClassID(id *int) *ClassLeaderCreate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*ClassLeaderCreate) SetNillableStudentID

func (clc *ClassLeaderCreate) SetNillableStudentID(id *int) *ClassLeaderCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*ClassLeaderCreate) SetStudent

func (clc *ClassLeaderCreate) SetStudent(s *Student) *ClassLeaderCreate

SetStudent sets the "student" edge to the Student entity.

func (*ClassLeaderCreate) SetStudentID

func (clc *ClassLeaderCreate) SetStudentID(id int) *ClassLeaderCreate

SetStudentID sets the "student" edge to the Student entity by ID.

type ClassLeaderCreateBulk

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

ClassLeaderCreateBulk is the builder for creating many ClassLeader entities in bulk.

func (*ClassLeaderCreateBulk) Exec

func (clcb *ClassLeaderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ClassLeaderCreateBulk) ExecX

func (clcb *ClassLeaderCreateBulk) ExecX(ctx context.Context)

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

func (*ClassLeaderCreateBulk) Save

func (clcb *ClassLeaderCreateBulk) Save(ctx context.Context) ([]*ClassLeader, error)

Save creates the ClassLeader entities in the database.

func (*ClassLeaderCreateBulk) SaveX

func (clcb *ClassLeaderCreateBulk) SaveX(ctx context.Context) []*ClassLeader

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

type ClassLeaderDelete

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

ClassLeaderDelete is the builder for deleting a ClassLeader entity.

func (*ClassLeaderDelete) Exec

func (cld *ClassLeaderDelete) Exec(ctx context.Context) (int, error)

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

func (*ClassLeaderDelete) ExecX

func (cld *ClassLeaderDelete) ExecX(ctx context.Context) int

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

func (*ClassLeaderDelete) Where

Where appends a list predicates to the ClassLeaderDelete builder.

type ClassLeaderDeleteOne

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

ClassLeaderDeleteOne is the builder for deleting a single ClassLeader entity.

func (*ClassLeaderDeleteOne) Exec

func (cldo *ClassLeaderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ClassLeaderDeleteOne) ExecX

func (cldo *ClassLeaderDeleteOne) ExecX(ctx context.Context)

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

func (*ClassLeaderDeleteOne) Where

Where appends a list predicates to the ClassLeaderDelete builder.

type ClassLeaderEdges

type ClassLeaderEdges struct {
	// Class holds the value of the class edge.
	Class *Class `json:"class,omitempty"`
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

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

func (ClassLeaderEdges) ClassOrErr

func (e ClassLeaderEdges) ClassOrErr() (*Class, error)

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

func (ClassLeaderEdges) StudentOrErr

func (e ClassLeaderEdges) StudentOrErr() (*Student, error)

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

type ClassLeaderGroupBy

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

ClassLeaderGroupBy is the group-by builder for ClassLeader entities.

func (*ClassLeaderGroupBy) Aggregate

func (clgb *ClassLeaderGroupBy) Aggregate(fns ...AggregateFunc) *ClassLeaderGroupBy

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

func (*ClassLeaderGroupBy) Bool

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

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

func (*ClassLeaderGroupBy) BoolX

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

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

func (*ClassLeaderGroupBy) Bools

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

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

func (*ClassLeaderGroupBy) BoolsX

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

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

func (*ClassLeaderGroupBy) Float64

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

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

func (*ClassLeaderGroupBy) Float64X

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

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

func (*ClassLeaderGroupBy) Float64s

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

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

func (*ClassLeaderGroupBy) Float64sX

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

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

func (*ClassLeaderGroupBy) Int

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

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

func (*ClassLeaderGroupBy) IntX

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

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

func (*ClassLeaderGroupBy) Ints

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

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

func (*ClassLeaderGroupBy) IntsX

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

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

func (*ClassLeaderGroupBy) Scan

func (clgb *ClassLeaderGroupBy) Scan(ctx context.Context, v any) error

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

func (*ClassLeaderGroupBy) ScanX

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

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

func (*ClassLeaderGroupBy) String

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

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

func (*ClassLeaderGroupBy) StringX

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

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

func (*ClassLeaderGroupBy) Strings

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

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

func (*ClassLeaderGroupBy) StringsX

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

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

type ClassLeaderMutation

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

ClassLeaderMutation represents an operation that mutates the ClassLeader nodes in the graph.

func (*ClassLeaderMutation) AddField

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

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

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

func (*ClassLeaderMutation) AddedField

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

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

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

func (*ClassLeaderMutation) AddedIDs

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

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

func (*ClassLeaderMutation) ClassCleared

func (m *ClassLeaderMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*ClassLeaderMutation) ClassID

func (m *ClassLeaderMutation) ClassID() (id int, exists bool)

ClassID returns the "class" edge ID in the mutation.

func (*ClassLeaderMutation) ClassIDs

func (m *ClassLeaderMutation) ClassIDs() (ids []int)

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

func (*ClassLeaderMutation) ClearClass

func (m *ClassLeaderMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*ClassLeaderMutation) ClearEdge

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

func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ClearStudent

func (m *ClassLeaderMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*ClassLeaderMutation) ClearedEdges

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

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

func (*ClassLeaderMutation) ClearedFields

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

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

func (ClassLeaderMutation) Client

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

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

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

func (*ClassLeaderMutation) Field

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

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

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

func (*ClassLeaderMutation) Fields

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

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

func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) OldField

func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) Op

func (m *ClassLeaderMutation) Op() Op

Op returns the operation name.

func (*ClassLeaderMutation) RemovedEdges

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

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

func (*ClassLeaderMutation) RemovedIDs

func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ResetClass

func (m *ClassLeaderMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*ClassLeaderMutation) ResetEdge

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

func (m *ClassLeaderMutation) 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 (*ClassLeaderMutation) ResetStudent

func (m *ClassLeaderMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*ClassLeaderMutation) SetClassID

func (m *ClassLeaderMutation) SetClassID(id int)

SetClassID sets the "class" edge to the Class entity by id.

func (*ClassLeaderMutation) SetField

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

func (m *ClassLeaderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ClassLeaderMutation) SetStudentID

func (m *ClassLeaderMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*ClassLeaderMutation) StudentCleared

func (m *ClassLeaderMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*ClassLeaderMutation) StudentID

func (m *ClassLeaderMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*ClassLeaderMutation) StudentIDs

func (m *ClassLeaderMutation) StudentIDs() (ids []int)

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

func (ClassLeaderMutation) Tx

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

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

func (*ClassLeaderMutation) Type

func (m *ClassLeaderMutation) Type() string

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

func (*ClassLeaderMutation) Where

func (m *ClassLeaderMutation) Where(ps ...predicate.ClassLeader)

Where appends a list predicates to the ClassLeaderMutation builder.

func (*ClassLeaderMutation) WhereP

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

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

type ClassLeaderQuery

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

ClassLeaderQuery is the builder for querying ClassLeader entities.

func (*ClassLeaderQuery) Aggregate

func (clq *ClassLeaderQuery) Aggregate(fns ...AggregateFunc) *ClassLeaderSelect

Aggregate returns a ClassLeaderSelect configured with the given aggregations.

func (*ClassLeaderQuery) All

func (clq *ClassLeaderQuery) All(ctx context.Context) ([]*ClassLeader, error)

All executes the query and returns a list of ClassLeaders.

func (*ClassLeaderQuery) AllX

func (clq *ClassLeaderQuery) AllX(ctx context.Context) []*ClassLeader

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

func (*ClassLeaderQuery) Clone

func (clq *ClassLeaderQuery) Clone() *ClassLeaderQuery

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

func (*ClassLeaderQuery) Count

func (clq *ClassLeaderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ClassLeaderQuery) CountX

func (clq *ClassLeaderQuery) CountX(ctx context.Context) int

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

func (*ClassLeaderQuery) Exist

func (clq *ClassLeaderQuery) Exist(ctx context.Context) (bool, error)

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

func (*ClassLeaderQuery) ExistX

func (clq *ClassLeaderQuery) ExistX(ctx context.Context) bool

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

func (*ClassLeaderQuery) First

func (clq *ClassLeaderQuery) First(ctx context.Context) (*ClassLeader, error)

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

func (*ClassLeaderQuery) FirstID

func (clq *ClassLeaderQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ClassLeaderQuery) FirstIDX

func (clq *ClassLeaderQuery) FirstIDX(ctx context.Context) int

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

func (*ClassLeaderQuery) FirstX

func (clq *ClassLeaderQuery) FirstX(ctx context.Context) *ClassLeader

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

func (*ClassLeaderQuery) GroupBy

func (clq *ClassLeaderQuery) GroupBy(field string, fields ...string) *ClassLeaderGroupBy

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.

func (*ClassLeaderQuery) IDs

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

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

func (*ClassLeaderQuery) IDsX

func (clq *ClassLeaderQuery) IDsX(ctx context.Context) []int

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

func (*ClassLeaderQuery) Limit

func (clq *ClassLeaderQuery) Limit(limit int) *ClassLeaderQuery

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

func (*ClassLeaderQuery) Offset

func (clq *ClassLeaderQuery) Offset(offset int) *ClassLeaderQuery

Offset to start from.

func (*ClassLeaderQuery) Only

func (clq *ClassLeaderQuery) Only(ctx context.Context) (*ClassLeader, error)

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

func (*ClassLeaderQuery) OnlyID

func (clq *ClassLeaderQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ClassLeaderQuery) OnlyIDX

func (clq *ClassLeaderQuery) OnlyIDX(ctx context.Context) int

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

func (*ClassLeaderQuery) OnlyX

func (clq *ClassLeaderQuery) OnlyX(ctx context.Context) *ClassLeader

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

func (*ClassLeaderQuery) Order

func (clq *ClassLeaderQuery) Order(o ...OrderFunc) *ClassLeaderQuery

Order specifies how the records should be ordered.

func (*ClassLeaderQuery) QueryClass

func (clq *ClassLeaderQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*ClassLeaderQuery) QueryStudent

func (clq *ClassLeaderQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*ClassLeaderQuery) Select

func (clq *ClassLeaderQuery) Select(fields ...string) *ClassLeaderSelect

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

func (*ClassLeaderQuery) Unique

func (clq *ClassLeaderQuery) Unique(unique bool) *ClassLeaderQuery

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

Where adds a new predicate for the ClassLeaderQuery builder.

func (*ClassLeaderQuery) WithClass

func (clq *ClassLeaderQuery) WithClass(opts ...func(*ClassQuery)) *ClassLeaderQuery

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

func (*ClassLeaderQuery) WithStudent

func (clq *ClassLeaderQuery) WithStudent(opts ...func(*StudentQuery)) *ClassLeaderQuery

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

type ClassLeaderSelect

type ClassLeaderSelect struct {
	*ClassLeaderQuery
	// contains filtered or unexported fields
}

ClassLeaderSelect is the builder for selecting fields of ClassLeader entities.

func (*ClassLeaderSelect) Aggregate

func (cls *ClassLeaderSelect) Aggregate(fns ...AggregateFunc) *ClassLeaderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ClassLeaderSelect) Bool

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

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

func (*ClassLeaderSelect) BoolX

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

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

func (*ClassLeaderSelect) Bools

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

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

func (*ClassLeaderSelect) BoolsX

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

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

func (*ClassLeaderSelect) Float64

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

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

func (*ClassLeaderSelect) Float64X

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

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

func (*ClassLeaderSelect) Float64s

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

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

func (*ClassLeaderSelect) Float64sX

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

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

func (*ClassLeaderSelect) Int

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

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

func (*ClassLeaderSelect) IntX

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

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

func (*ClassLeaderSelect) Ints

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

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

func (*ClassLeaderSelect) IntsX

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

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

func (*ClassLeaderSelect) Scan

func (cls *ClassLeaderSelect) Scan(ctx context.Context, v any) error

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

func (*ClassLeaderSelect) ScanX

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

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

func (*ClassLeaderSelect) String

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

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

func (*ClassLeaderSelect) StringX

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

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

func (*ClassLeaderSelect) Strings

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

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

func (*ClassLeaderSelect) StringsX

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

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

type ClassLeaderUpdate

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

ClassLeaderUpdate is the builder for updating ClassLeader entities.

func (*ClassLeaderUpdate) ClearClass

func (clu *ClassLeaderUpdate) ClearClass() *ClassLeaderUpdate

ClearClass clears the "class" edge to the Class entity.

func (*ClassLeaderUpdate) ClearStudent

func (clu *ClassLeaderUpdate) ClearStudent() *ClassLeaderUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*ClassLeaderUpdate) Exec

func (clu *ClassLeaderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ClassLeaderUpdate) ExecX

func (clu *ClassLeaderUpdate) ExecX(ctx context.Context)

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

func (*ClassLeaderUpdate) Mutation

func (clu *ClassLeaderUpdate) Mutation() *ClassLeaderMutation

Mutation returns the ClassLeaderMutation object of the builder.

func (*ClassLeaderUpdate) Save

func (clu *ClassLeaderUpdate) Save(ctx context.Context) (int, error)

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

func (*ClassLeaderUpdate) SaveX

func (clu *ClassLeaderUpdate) SaveX(ctx context.Context) int

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

func (*ClassLeaderUpdate) SetClass

func (clu *ClassLeaderUpdate) SetClass(c *Class) *ClassLeaderUpdate

SetClass sets the "class" edge to the Class entity.

func (*ClassLeaderUpdate) SetClassID

func (clu *ClassLeaderUpdate) SetClassID(id int) *ClassLeaderUpdate

SetClassID sets the "class" edge to the Class entity by ID.

func (*ClassLeaderUpdate) SetNillableClassID

func (clu *ClassLeaderUpdate) SetNillableClassID(id *int) *ClassLeaderUpdate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*ClassLeaderUpdate) SetNillableStudentID

func (clu *ClassLeaderUpdate) SetNillableStudentID(id *int) *ClassLeaderUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*ClassLeaderUpdate) SetStudent

func (clu *ClassLeaderUpdate) SetStudent(s *Student) *ClassLeaderUpdate

SetStudent sets the "student" edge to the Student entity.

func (*ClassLeaderUpdate) SetStudentID

func (clu *ClassLeaderUpdate) SetStudentID(id int) *ClassLeaderUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*ClassLeaderUpdate) Where

Where appends a list predicates to the ClassLeaderUpdate builder.

type ClassLeaderUpdateOne

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

ClassLeaderUpdateOne is the builder for updating a single ClassLeader entity.

func (*ClassLeaderUpdateOne) ClearClass

func (cluo *ClassLeaderUpdateOne) ClearClass() *ClassLeaderUpdateOne

ClearClass clears the "class" edge to the Class entity.

func (*ClassLeaderUpdateOne) ClearStudent

func (cluo *ClassLeaderUpdateOne) ClearStudent() *ClassLeaderUpdateOne

ClearStudent clears the "student" edge to the Student entity.

func (*ClassLeaderUpdateOne) Exec

func (cluo *ClassLeaderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ClassLeaderUpdateOne) ExecX

func (cluo *ClassLeaderUpdateOne) ExecX(ctx context.Context)

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

func (*ClassLeaderUpdateOne) Mutation

func (cluo *ClassLeaderUpdateOne) Mutation() *ClassLeaderMutation

Mutation returns the ClassLeaderMutation object of the builder.

func (*ClassLeaderUpdateOne) Save

Save executes the query and returns the updated ClassLeader entity.

func (*ClassLeaderUpdateOne) SaveX

func (cluo *ClassLeaderUpdateOne) SaveX(ctx context.Context) *ClassLeader

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

func (*ClassLeaderUpdateOne) Select

func (cluo *ClassLeaderUpdateOne) Select(field string, fields ...string) *ClassLeaderUpdateOne

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

func (*ClassLeaderUpdateOne) SetClass

func (cluo *ClassLeaderUpdateOne) SetClass(c *Class) *ClassLeaderUpdateOne

SetClass sets the "class" edge to the Class entity.

func (*ClassLeaderUpdateOne) SetClassID

func (cluo *ClassLeaderUpdateOne) SetClassID(id int) *ClassLeaderUpdateOne

SetClassID sets the "class" edge to the Class entity by ID.

func (*ClassLeaderUpdateOne) SetNillableClassID

func (cluo *ClassLeaderUpdateOne) SetNillableClassID(id *int) *ClassLeaderUpdateOne

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*ClassLeaderUpdateOne) SetNillableStudentID

func (cluo *ClassLeaderUpdateOne) SetNillableStudentID(id *int) *ClassLeaderUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*ClassLeaderUpdateOne) SetStudent

func (cluo *ClassLeaderUpdateOne) SetStudent(s *Student) *ClassLeaderUpdateOne

SetStudent sets the "student" edge to the Student entity.

func (*ClassLeaderUpdateOne) SetStudentID

func (cluo *ClassLeaderUpdateOne) SetStudentID(id int) *ClassLeaderUpdateOne

SetStudentID sets the "student" edge to the Student entity by ID.

func (*ClassLeaderUpdateOne) Where

Where appends a list predicates to the ClassLeaderUpdate builder.

type ClassLeaders

type ClassLeaders []*ClassLeader

ClassLeaders is a parsable slice of ClassLeader.

type ClassMutation

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

ClassMutation represents an operation that mutates the Class nodes in the graph.

func (*ClassMutation) AddField

func (m *ClassMutation) 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 (*ClassMutation) AddStudentIDs

func (m *ClassMutation) AddStudentIDs(ids ...int)

AddStudentIDs adds the "student" edge to the Student entity by ids.

func (*ClassMutation) AddedEdges

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

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

func (*ClassMutation) AddedField

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

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

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

func (*ClassMutation) AddedIDs

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

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

func (*ClassMutation) CampusCleared

func (m *ClassMutation) CampusCleared() bool

CampusCleared reports if the "campus" edge to the Campus entity was cleared.

func (*ClassMutation) CampusID

func (m *ClassMutation) CampusID() (id int, exists bool)

CampusID returns the "campus" edge ID in the mutation.

func (*ClassMutation) CampusIDs

func (m *ClassMutation) CampusIDs() (ids []int)

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

func (*ClassMutation) ClassLeaderCleared

func (m *ClassMutation) ClassLeaderCleared() bool

ClassLeaderCleared reports if the "class_leader" edge to the ClassLeader entity was cleared.

func (*ClassMutation) ClassLeaderID

func (m *ClassMutation) ClassLeaderID() (id int, exists bool)

ClassLeaderID returns the "class_leader" edge ID in the mutation.

func (*ClassMutation) ClassLeaderIDs

func (m *ClassMutation) ClassLeaderIDs() (ids []int)

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

func (*ClassMutation) ClearCampus

func (m *ClassMutation) ClearCampus()

ClearCampus clears the "campus" edge to the Campus entity.

func (*ClassMutation) ClearClassLeader

func (m *ClassMutation) ClearClassLeader()

ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.

func (*ClassMutation) ClearDepartment

func (m *ClassMutation) ClearDepartment()

ClearDepartment clears the "department" edge to the Department entity.

func (*ClassMutation) ClearEdge

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

func (m *ClassMutation) 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 (*ClassMutation) ClearMajor

func (m *ClassMutation) ClearMajor()

ClearMajor clears the "major" edge to the Major entity.

func (*ClassMutation) ClearMajorDirection

func (m *ClassMutation) ClearMajorDirection()

ClearMajorDirection clears the "major_direction" edge to the MajorDirection entity.

func (*ClassMutation) ClearStudent

func (m *ClassMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*ClassMutation) ClearTutor

func (m *ClassMutation) ClearTutor()

ClearTutor clears the "tutor" edge to the Tutor entity.

func (*ClassMutation) ClearedEdges

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

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

func (*ClassMutation) ClearedFields

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

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

func (ClassMutation) Client

func (m ClassMutation) 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 (*ClassMutation) Code

func (m *ClassMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*ClassMutation) DepartmentCleared

func (m *ClassMutation) DepartmentCleared() bool

DepartmentCleared reports if the "department" edge to the Department entity was cleared.

func (*ClassMutation) DepartmentID

func (m *ClassMutation) DepartmentID() (id int, exists bool)

DepartmentID returns the "department" edge ID in the mutation.

func (*ClassMutation) DepartmentIDs

func (m *ClassMutation) DepartmentIDs() (ids []int)

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

func (*ClassMutation) Description

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

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

func (*ClassMutation) EdgeCleared

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

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

func (*ClassMutation) Field

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

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

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

func (*ClassMutation) Fields

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

func (m *ClassMutation) GetType() (r string, exists bool)

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

func (*ClassMutation) ID

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

func (m *ClassMutation) 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 (*ClassMutation) MajorCleared

func (m *ClassMutation) MajorCleared() bool

MajorCleared reports if the "major" edge to the Major entity was cleared.

func (*ClassMutation) MajorDirectionCleared

func (m *ClassMutation) MajorDirectionCleared() bool

MajorDirectionCleared reports if the "major_direction" edge to the MajorDirection entity was cleared.

func (*ClassMutation) MajorDirectionID

func (m *ClassMutation) MajorDirectionID() (id int, exists bool)

MajorDirectionID returns the "major_direction" edge ID in the mutation.

func (*ClassMutation) MajorDirectionIDs

func (m *ClassMutation) MajorDirectionIDs() (ids []int)

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

func (*ClassMutation) MajorID

func (m *ClassMutation) MajorID() (id int, exists bool)

MajorID returns the "major" edge ID in the mutation.

func (*ClassMutation) MajorIDs

func (m *ClassMutation) MajorIDs() (ids []int)

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

func (*ClassMutation) Name

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

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

func (*ClassMutation) OldCode

func (m *ClassMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Class entity. If the Class 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 (*ClassMutation) OldDescription

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

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

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

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

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

func (m *ClassMutation) OldType(ctx context.Context) (v string, err error)

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

func (m *ClassMutation) Op() Op

Op returns the operation name.

func (*ClassMutation) RemoveStudentIDs

func (m *ClassMutation) RemoveStudentIDs(ids ...int)

RemoveStudentIDs removes the "student" edge to the Student entity by IDs.

func (*ClassMutation) RemovedEdges

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

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

func (*ClassMutation) RemovedIDs

func (m *ClassMutation) 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 (*ClassMutation) RemovedStudentIDs

func (m *ClassMutation) RemovedStudentIDs() (ids []int)

RemovedStudent returns the removed IDs of the "student" edge to the Student entity.

func (*ClassMutation) ResetCampus

func (m *ClassMutation) ResetCampus()

ResetCampus resets all changes to the "campus" edge.

func (*ClassMutation) ResetClassLeader

func (m *ClassMutation) ResetClassLeader()

ResetClassLeader resets all changes to the "class_leader" edge.

func (*ClassMutation) ResetCode

func (m *ClassMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*ClassMutation) ResetDepartment

func (m *ClassMutation) ResetDepartment()

ResetDepartment resets all changes to the "department" edge.

func (*ClassMutation) ResetDescription

func (m *ClassMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ClassMutation) ResetEdge

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

func (m *ClassMutation) 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 (*ClassMutation) ResetMajor

func (m *ClassMutation) ResetMajor()

ResetMajor resets all changes to the "major" edge.

func (*ClassMutation) ResetMajorDirection

func (m *ClassMutation) ResetMajorDirection()

ResetMajorDirection resets all changes to the "major_direction" edge.

func (*ClassMutation) ResetName

func (m *ClassMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ClassMutation) ResetStudent

func (m *ClassMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*ClassMutation) ResetTutor

func (m *ClassMutation) ResetTutor()

ResetTutor resets all changes to the "tutor" edge.

func (*ClassMutation) ResetType

func (m *ClassMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ClassMutation) SetCampusID

func (m *ClassMutation) SetCampusID(id int)

SetCampusID sets the "campus" edge to the Campus entity by id.

func (*ClassMutation) SetClassLeaderID

func (m *ClassMutation) SetClassLeaderID(id int)

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by id.

func (*ClassMutation) SetCode

func (m *ClassMutation) SetCode(s string)

SetCode sets the "code" field.

func (*ClassMutation) SetDepartmentID

func (m *ClassMutation) SetDepartmentID(id int)

SetDepartmentID sets the "department" edge to the Department entity by id.

func (*ClassMutation) SetDescription

func (m *ClassMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ClassMutation) SetField

func (m *ClassMutation) 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 (*ClassMutation) SetMajorDirectionID

func (m *ClassMutation) SetMajorDirectionID(id int)

SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by id.

func (*ClassMutation) SetMajorID

func (m *ClassMutation) SetMajorID(id int)

SetMajorID sets the "major" edge to the Major entity by id.

func (*ClassMutation) SetName

func (m *ClassMutation) SetName(s string)

SetName sets the "name" field.

func (*ClassMutation) SetOp

func (m *ClassMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ClassMutation) SetTutorID

func (m *ClassMutation) SetTutorID(id int)

SetTutorID sets the "tutor" edge to the Tutor entity by id.

func (*ClassMutation) SetType

func (m *ClassMutation) SetType(s string)

SetType sets the "type" field.

func (*ClassMutation) StudentCleared

func (m *ClassMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*ClassMutation) StudentIDs

func (m *ClassMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation.

func (*ClassMutation) TutorCleared

func (m *ClassMutation) TutorCleared() bool

TutorCleared reports if the "tutor" edge to the Tutor entity was cleared.

func (*ClassMutation) TutorID

func (m *ClassMutation) TutorID() (id int, exists bool)

TutorID returns the "tutor" edge ID in the mutation.

func (*ClassMutation) TutorIDs

func (m *ClassMutation) TutorIDs() (ids []int)

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

func (ClassMutation) Tx

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

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

func (*ClassMutation) Type

func (m *ClassMutation) Type() string

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

func (*ClassMutation) Where

func (m *ClassMutation) Where(ps ...predicate.Class)

Where appends a list predicates to the ClassMutation builder.

func (*ClassMutation) WhereP

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

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

type ClassQuery

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

ClassQuery is the builder for querying Class entities.

func (*ClassQuery) Aggregate

func (cq *ClassQuery) Aggregate(fns ...AggregateFunc) *ClassSelect

Aggregate returns a ClassSelect configured with the given aggregations.

func (*ClassQuery) All

func (cq *ClassQuery) All(ctx context.Context) ([]*Class, error)

All executes the query and returns a list of Classes.

func (*ClassQuery) AllX

func (cq *ClassQuery) AllX(ctx context.Context) []*Class

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

func (*ClassQuery) Clone

func (cq *ClassQuery) Clone() *ClassQuery

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

func (*ClassQuery) Count

func (cq *ClassQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ClassQuery) CountX

func (cq *ClassQuery) CountX(ctx context.Context) int

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

func (*ClassQuery) Exist

func (cq *ClassQuery) Exist(ctx context.Context) (bool, error)

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

func (*ClassQuery) ExistX

func (cq *ClassQuery) ExistX(ctx context.Context) bool

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

func (*ClassQuery) First

func (cq *ClassQuery) First(ctx context.Context) (*Class, error)

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

func (*ClassQuery) FirstID

func (cq *ClassQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ClassQuery) FirstIDX

func (cq *ClassQuery) FirstIDX(ctx context.Context) int

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

func (*ClassQuery) FirstX

func (cq *ClassQuery) FirstX(ctx context.Context) *Class

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

func (*ClassQuery) GroupBy

func (cq *ClassQuery) GroupBy(field string, fields ...string) *ClassGroupBy

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

Example:

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

client.Class.Query().
	GroupBy(class.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*ClassQuery) IDs

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

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

func (*ClassQuery) IDsX

func (cq *ClassQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ClassQuery) Limit

func (cq *ClassQuery) Limit(limit int) *ClassQuery

Limit the number of records to be returned by this query.

func (*ClassQuery) Offset

func (cq *ClassQuery) Offset(offset int) *ClassQuery

Offset to start from.

func (*ClassQuery) Only

func (cq *ClassQuery) Only(ctx context.Context) (*Class, error)

Only returns a single Class entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Class entity is found. Returns a *NotFoundError when no Class entities are found.

func (*ClassQuery) OnlyID

func (cq *ClassQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Class ID in the query. Returns a *NotSingularError when more than one Class ID is found. Returns a *NotFoundError when no entities are found.

func (*ClassQuery) OnlyIDX

func (cq *ClassQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ClassQuery) OnlyX

func (cq *ClassQuery) OnlyX(ctx context.Context) *Class

OnlyX is like Only, but panics if an error occurs.

func (*ClassQuery) Order

func (cq *ClassQuery) Order(o ...OrderFunc) *ClassQuery

Order specifies how the records should be ordered.

func (*ClassQuery) QueryCampus

func (cq *ClassQuery) QueryCampus() *CampusQuery

QueryCampus chains the current query on the "campus" edge.

func (*ClassQuery) QueryClassLeader

func (cq *ClassQuery) QueryClassLeader() *ClassLeaderQuery

QueryClassLeader chains the current query on the "class_leader" edge.

func (*ClassQuery) QueryDepartment

func (cq *ClassQuery) QueryDepartment() *DepartmentQuery

QueryDepartment chains the current query on the "department" edge.

func (*ClassQuery) QueryMajor

func (cq *ClassQuery) QueryMajor() *MajorQuery

QueryMajor chains the current query on the "major" edge.

func (*ClassQuery) QueryMajorDirection

func (cq *ClassQuery) QueryMajorDirection() *MajorDirectionQuery

QueryMajorDirection chains the current query on the "major_direction" edge.

func (*ClassQuery) QueryStudent

func (cq *ClassQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*ClassQuery) QueryTutor

func (cq *ClassQuery) QueryTutor() *TutorQuery

QueryTutor chains the current query on the "tutor" edge.

func (*ClassQuery) Select

func (cq *ClassQuery) Select(fields ...string) *ClassSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Class.Query().
	Select(class.FieldName).
	Scan(ctx, &v)

func (*ClassQuery) Unique

func (cq *ClassQuery) Unique(unique bool) *ClassQuery

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 (*ClassQuery) Where

func (cq *ClassQuery) Where(ps ...predicate.Class) *ClassQuery

Where adds a new predicate for the ClassQuery builder.

func (*ClassQuery) WithCampus

func (cq *ClassQuery) WithCampus(opts ...func(*CampusQuery)) *ClassQuery

WithCampus tells the query-builder to eager-load the nodes that are connected to the "campus" edge. The optional arguments are used to configure the query builder of the edge.

func (*ClassQuery) WithClassLeader

func (cq *ClassQuery) WithClassLeader(opts ...func(*ClassLeaderQuery)) *ClassQuery

WithClassLeader tells the query-builder to eager-load the nodes that are connected to the "class_leader" edge. The optional arguments are used to configure the query builder of the edge.

func (*ClassQuery) WithDepartment

func (cq *ClassQuery) WithDepartment(opts ...func(*DepartmentQuery)) *ClassQuery

WithDepartment tells the query-builder to eager-load the nodes that are connected to the "department" edge. The optional arguments are used to configure the query builder of the edge.

func (*ClassQuery) WithMajor

func (cq *ClassQuery) WithMajor(opts ...func(*MajorQuery)) *ClassQuery

WithMajor tells the query-builder to eager-load the nodes that are connected to the "major" edge. The optional arguments are used to configure the query builder of the edge.

func (*ClassQuery) WithMajorDirection

func (cq *ClassQuery) WithMajorDirection(opts ...func(*MajorDirectionQuery)) *ClassQuery

WithMajorDirection tells the query-builder to eager-load the nodes that are connected to the "major_direction" edge. The optional arguments are used to configure the query builder of the edge.

func (*ClassQuery) WithStudent

func (cq *ClassQuery) WithStudent(opts ...func(*StudentQuery)) *ClassQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

func (*ClassQuery) WithTutor

func (cq *ClassQuery) WithTutor(opts ...func(*TutorQuery)) *ClassQuery

WithTutor tells the query-builder to eager-load the nodes that are connected to the "tutor" edge. The optional arguments are used to configure the query builder of the edge.

type ClassSelect

type ClassSelect struct {
	*ClassQuery
	// contains filtered or unexported fields
}

ClassSelect is the builder for selecting fields of Class entities.

func (*ClassSelect) Aggregate

func (cs *ClassSelect) Aggregate(fns ...AggregateFunc) *ClassSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ClassSelect) Bool

func (s *ClassSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ClassSelect) BoolX

func (s *ClassSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ClassSelect) Bools

func (s *ClassSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ClassSelect) BoolsX

func (s *ClassSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ClassSelect) Float64

func (s *ClassSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ClassSelect) Float64X

func (s *ClassSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ClassSelect) Float64s

func (s *ClassSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ClassSelect) Float64sX

func (s *ClassSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ClassSelect) Int

func (s *ClassSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ClassSelect) IntX

func (s *ClassSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ClassSelect) Ints

func (s *ClassSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ClassSelect) IntsX

func (s *ClassSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ClassSelect) Scan

func (cs *ClassSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ClassSelect) ScanX

func (s *ClassSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ClassSelect) String

func (s *ClassSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ClassSelect) StringX

func (s *ClassSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ClassSelect) Strings

func (s *ClassSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ClassSelect) StringsX

func (s *ClassSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ClassUpdate

type ClassUpdate struct {
	// contains filtered or unexported fields
}

ClassUpdate is the builder for updating Class entities.

func (*ClassUpdate) AddStudent

func (cu *ClassUpdate) AddStudent(s ...*Student) *ClassUpdate

AddStudent adds the "student" edges to the Student entity.

func (*ClassUpdate) AddStudentIDs

func (cu *ClassUpdate) AddStudentIDs(ids ...int) *ClassUpdate

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*ClassUpdate) ClearCampus

func (cu *ClassUpdate) ClearCampus() *ClassUpdate

ClearCampus clears the "campus" edge to the Campus entity.

func (*ClassUpdate) ClearClassLeader

func (cu *ClassUpdate) ClearClassLeader() *ClassUpdate

ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.

func (*ClassUpdate) ClearDepartment

func (cu *ClassUpdate) ClearDepartment() *ClassUpdate

ClearDepartment clears the "department" edge to the Department entity.

func (*ClassUpdate) ClearMajor

func (cu *ClassUpdate) ClearMajor() *ClassUpdate

ClearMajor clears the "major" edge to the Major entity.

func (*ClassUpdate) ClearMajorDirection

func (cu *ClassUpdate) ClearMajorDirection() *ClassUpdate

ClearMajorDirection clears the "major_direction" edge to the MajorDirection entity.

func (*ClassUpdate) ClearStudent

func (cu *ClassUpdate) ClearStudent() *ClassUpdate

ClearStudent clears all "student" edges to the Student entity.

func (*ClassUpdate) ClearTutor

func (cu *ClassUpdate) ClearTutor() *ClassUpdate

ClearTutor clears the "tutor" edge to the Tutor entity.

func (*ClassUpdate) Exec

func (cu *ClassUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ClassUpdate) ExecX

func (cu *ClassUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ClassUpdate) Mutation

func (cu *ClassUpdate) Mutation() *ClassMutation

Mutation returns the ClassMutation object of the builder.

func (*ClassUpdate) RemoveStudent

func (cu *ClassUpdate) RemoveStudent(s ...*Student) *ClassUpdate

RemoveStudent removes "student" edges to Student entities.

func (*ClassUpdate) RemoveStudentIDs

func (cu *ClassUpdate) RemoveStudentIDs(ids ...int) *ClassUpdate

RemoveStudentIDs removes the "student" edge to Student entities by IDs.

func (*ClassUpdate) Save

func (cu *ClassUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ClassUpdate) SaveX

func (cu *ClassUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ClassUpdate) SetCampus

func (cu *ClassUpdate) SetCampus(c *Campus) *ClassUpdate

SetCampus sets the "campus" edge to the Campus entity.

func (*ClassUpdate) SetCampusID

func (cu *ClassUpdate) SetCampusID(id int) *ClassUpdate

SetCampusID sets the "campus" edge to the Campus entity by ID.

func (*ClassUpdate) SetClassLeader

func (cu *ClassUpdate) SetClassLeader(c *ClassLeader) *ClassUpdate

SetClassLeader sets the "class_leader" edge to the ClassLeader entity.

func (*ClassUpdate) SetClassLeaderID

func (cu *ClassUpdate) SetClassLeaderID(id int) *ClassUpdate

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.

func (*ClassUpdate) SetCode

func (cu *ClassUpdate) SetCode(s string) *ClassUpdate

SetCode sets the "code" field.

func (*ClassUpdate) SetDepartment

func (cu *ClassUpdate) SetDepartment(d *Department) *ClassUpdate

SetDepartment sets the "department" edge to the Department entity.

func (*ClassUpdate) SetDepartmentID

func (cu *ClassUpdate) SetDepartmentID(id int) *ClassUpdate

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*ClassUpdate) SetDescription

func (cu *ClassUpdate) SetDescription(s string) *ClassUpdate

SetDescription sets the "description" field.

func (*ClassUpdate) SetMajor

func (cu *ClassUpdate) SetMajor(m *Major) *ClassUpdate

SetMajor sets the "major" edge to the Major entity.

func (*ClassUpdate) SetMajorDirection

func (cu *ClassUpdate) SetMajorDirection(m *MajorDirection) *ClassUpdate

SetMajorDirection sets the "major_direction" edge to the MajorDirection entity.

func (*ClassUpdate) SetMajorDirectionID

func (cu *ClassUpdate) SetMajorDirectionID(id int) *ClassUpdate

SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID.

func (*ClassUpdate) SetMajorID

func (cu *ClassUpdate) SetMajorID(id int) *ClassUpdate

SetMajorID sets the "major" edge to the Major entity by ID.

func (*ClassUpdate) SetName

func (cu *ClassUpdate) SetName(s string) *ClassUpdate

SetName sets the "name" field.

func (*ClassUpdate) SetNillableCampusID

func (cu *ClassUpdate) SetNillableCampusID(id *int) *ClassUpdate

SetNillableCampusID sets the "campus" edge to the Campus entity by ID if the given value is not nil.

func (*ClassUpdate) SetNillableClassLeaderID

func (cu *ClassUpdate) SetNillableClassLeaderID(id *int) *ClassUpdate

SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.

func (*ClassUpdate) SetNillableDepartmentID

func (cu *ClassUpdate) SetNillableDepartmentID(id *int) *ClassUpdate

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*ClassUpdate) SetNillableMajorDirectionID

func (cu *ClassUpdate) SetNillableMajorDirectionID(id *int) *ClassUpdate

SetNillableMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID if the given value is not nil.

func (*ClassUpdate) SetNillableMajorID

func (cu *ClassUpdate) SetNillableMajorID(id *int) *ClassUpdate

SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.

func (*ClassUpdate) SetNillableTutorID

func (cu *ClassUpdate) SetNillableTutorID(id *int) *ClassUpdate

SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.

func (*ClassUpdate) SetTutor

func (cu *ClassUpdate) SetTutor(t *Tutor) *ClassUpdate

SetTutor sets the "tutor" edge to the Tutor entity.

func (*ClassUpdate) SetTutorID

func (cu *ClassUpdate) SetTutorID(id int) *ClassUpdate

SetTutorID sets the "tutor" edge to the Tutor entity by ID.

func (*ClassUpdate) SetType

func (cu *ClassUpdate) SetType(s string) *ClassUpdate

SetType sets the "type" field.

func (*ClassUpdate) Where

func (cu *ClassUpdate) Where(ps ...predicate.Class) *ClassUpdate

Where appends a list predicates to the ClassUpdate builder.

type ClassUpdateOne

type ClassUpdateOne struct {
	// contains filtered or unexported fields
}

ClassUpdateOne is the builder for updating a single Class entity.

func (*ClassUpdateOne) AddStudent

func (cuo *ClassUpdateOne) AddStudent(s ...*Student) *ClassUpdateOne

AddStudent adds the "student" edges to the Student entity.

func (*ClassUpdateOne) AddStudentIDs

func (cuo *ClassUpdateOne) AddStudentIDs(ids ...int) *ClassUpdateOne

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*ClassUpdateOne) ClearCampus

func (cuo *ClassUpdateOne) ClearCampus() *ClassUpdateOne

ClearCampus clears the "campus" edge to the Campus entity.

func (*ClassUpdateOne) ClearClassLeader

func (cuo *ClassUpdateOne) ClearClassLeader() *ClassUpdateOne

ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.

func (*ClassUpdateOne) ClearDepartment

func (cuo *ClassUpdateOne) ClearDepartment() *ClassUpdateOne

ClearDepartment clears the "department" edge to the Department entity.

func (*ClassUpdateOne) ClearMajor

func (cuo *ClassUpdateOne) ClearMajor() *ClassUpdateOne

ClearMajor clears the "major" edge to the Major entity.

func (*ClassUpdateOne) ClearMajorDirection

func (cuo *ClassUpdateOne) ClearMajorDirection() *ClassUpdateOne

ClearMajorDirection clears the "major_direction" edge to the MajorDirection entity.

func (*ClassUpdateOne) ClearStudent

func (cuo *ClassUpdateOne) ClearStudent() *ClassUpdateOne

ClearStudent clears all "student" edges to the Student entity.

func (*ClassUpdateOne) ClearTutor

func (cuo *ClassUpdateOne) ClearTutor() *ClassUpdateOne

ClearTutor clears the "tutor" edge to the Tutor entity.

func (*ClassUpdateOne) Exec

func (cuo *ClassUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ClassUpdateOne) ExecX

func (cuo *ClassUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ClassUpdateOne) Mutation

func (cuo *ClassUpdateOne) Mutation() *ClassMutation

Mutation returns the ClassMutation object of the builder.

func (*ClassUpdateOne) RemoveStudent

func (cuo *ClassUpdateOne) RemoveStudent(s ...*Student) *ClassUpdateOne

RemoveStudent removes "student" edges to Student entities.

func (*ClassUpdateOne) RemoveStudentIDs

func (cuo *ClassUpdateOne) RemoveStudentIDs(ids ...int) *ClassUpdateOne

RemoveStudentIDs removes the "student" edge to Student entities by IDs.

func (*ClassUpdateOne) Save

func (cuo *ClassUpdateOne) Save(ctx context.Context) (*Class, error)

Save executes the query and returns the updated Class entity.

func (*ClassUpdateOne) SaveX

func (cuo *ClassUpdateOne) SaveX(ctx context.Context) *Class

SaveX is like Save, but panics if an error occurs.

func (*ClassUpdateOne) Select

func (cuo *ClassUpdateOne) Select(field string, fields ...string) *ClassUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ClassUpdateOne) SetCampus

func (cuo *ClassUpdateOne) SetCampus(c *Campus) *ClassUpdateOne

SetCampus sets the "campus" edge to the Campus entity.

func (*ClassUpdateOne) SetCampusID

func (cuo *ClassUpdateOne) SetCampusID(id int) *ClassUpdateOne

SetCampusID sets the "campus" edge to the Campus entity by ID.

func (*ClassUpdateOne) SetClassLeader

func (cuo *ClassUpdateOne) SetClassLeader(c *ClassLeader) *ClassUpdateOne

SetClassLeader sets the "class_leader" edge to the ClassLeader entity.

func (*ClassUpdateOne) SetClassLeaderID

func (cuo *ClassUpdateOne) SetClassLeaderID(id int) *ClassUpdateOne

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.

func (*ClassUpdateOne) SetCode

func (cuo *ClassUpdateOne) SetCode(s string) *ClassUpdateOne

SetCode sets the "code" field.

func (*ClassUpdateOne) SetDepartment

func (cuo *ClassUpdateOne) SetDepartment(d *Department) *ClassUpdateOne

SetDepartment sets the "department" edge to the Department entity.

func (*ClassUpdateOne) SetDepartmentID

func (cuo *ClassUpdateOne) SetDepartmentID(id int) *ClassUpdateOne

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*ClassUpdateOne) SetDescription

func (cuo *ClassUpdateOne) SetDescription(s string) *ClassUpdateOne

SetDescription sets the "description" field.

func (*ClassUpdateOne) SetMajor

func (cuo *ClassUpdateOne) SetMajor(m *Major) *ClassUpdateOne

SetMajor sets the "major" edge to the Major entity.

func (*ClassUpdateOne) SetMajorDirection

func (cuo *ClassUpdateOne) SetMajorDirection(m *MajorDirection) *ClassUpdateOne

SetMajorDirection sets the "major_direction" edge to the MajorDirection entity.

func (*ClassUpdateOne) SetMajorDirectionID

func (cuo *ClassUpdateOne) SetMajorDirectionID(id int) *ClassUpdateOne

SetMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID.

func (*ClassUpdateOne) SetMajorID

func (cuo *ClassUpdateOne) SetMajorID(id int) *ClassUpdateOne

SetMajorID sets the "major" edge to the Major entity by ID.

func (*ClassUpdateOne) SetName

func (cuo *ClassUpdateOne) SetName(s string) *ClassUpdateOne

SetName sets the "name" field.

func (*ClassUpdateOne) SetNillableCampusID

func (cuo *ClassUpdateOne) SetNillableCampusID(id *int) *ClassUpdateOne

SetNillableCampusID sets the "campus" edge to the Campus entity by ID if the given value is not nil.

func (*ClassUpdateOne) SetNillableClassLeaderID

func (cuo *ClassUpdateOne) SetNillableClassLeaderID(id *int) *ClassUpdateOne

SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.

func (*ClassUpdateOne) SetNillableDepartmentID

func (cuo *ClassUpdateOne) SetNillableDepartmentID(id *int) *ClassUpdateOne

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*ClassUpdateOne) SetNillableMajorDirectionID

func (cuo *ClassUpdateOne) SetNillableMajorDirectionID(id *int) *ClassUpdateOne

SetNillableMajorDirectionID sets the "major_direction" edge to the MajorDirection entity by ID if the given value is not nil.

func (*ClassUpdateOne) SetNillableMajorID

func (cuo *ClassUpdateOne) SetNillableMajorID(id *int) *ClassUpdateOne

SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.

func (*ClassUpdateOne) SetNillableTutorID

func (cuo *ClassUpdateOne) SetNillableTutorID(id *int) *ClassUpdateOne

SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.

func (*ClassUpdateOne) SetTutor

func (cuo *ClassUpdateOne) SetTutor(t *Tutor) *ClassUpdateOne

SetTutor sets the "tutor" edge to the Tutor entity.

func (*ClassUpdateOne) SetTutorID

func (cuo *ClassUpdateOne) SetTutorID(id int) *ClassUpdateOne

SetTutorID sets the "tutor" edge to the Tutor entity by ID.

func (*ClassUpdateOne) SetType

func (cuo *ClassUpdateOne) SetType(s string) *ClassUpdateOne

SetType sets the "type" field.

func (*ClassUpdateOne) Where

func (cuo *ClassUpdateOne) Where(ps ...predicate.Class) *ClassUpdateOne

Where appends a list predicates to the ClassUpdate builder.

type Classes

type Classes []*Class

Classes is a parsable slice of Class.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Authorization is the client for interacting with the Authorization builders.
	Authorization *AuthorizationClient
	// Campus is the client for interacting with the Campus builders.
	Campus *CampusClient
	// Certificate is the client for interacting with the Certificate builders.
	Certificate *CertificateClient
	// Class is the client for interacting with the Class builders.
	Class *ClassClient
	// ClassLeader is the client for interacting with the ClassLeader builders.
	ClassLeader *ClassLeaderClient
	// Department is the client for interacting with the Department builders.
	Department *DepartmentClient
	// EducationLevel is the client for interacting with the EducationLevel builders.
	EducationLevel *EducationLevelClient
	// EnrollmentStatus is the client for interacting with the EnrollmentStatus builders.
	EnrollmentStatus *EnrollmentStatusClient
	// FamilyInfo is the client for interacting with the FamilyInfo builders.
	FamilyInfo *FamilyInfoClient
	// Major is the client for interacting with the Major builders.
	Major *MajorClient
	// MajorDirection is the client for interacting with the MajorDirection builders.
	MajorDirection *MajorDirectionClient
	// PracticalExperience is the client for interacting with the PracticalExperience builders.
	PracticalExperience *PracticalExperienceClient
	// Resource is the client for interacting with the Resource builders.
	Resource *ResourceClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Student is the client for interacting with the Student builders.
	Student *StudentClient
	// Tutor is the client for interacting with the Tutor builders.
	Tutor *TutorClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Authorization.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Department

type Department struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 系部名称
	Name string `json:"name,omitempty"`
	// 系部代码
	Code string `json:"code,omitempty"`
	// 系部描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DepartmentQuery when eager-loading is set.
	Edges DepartmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Department is the model entity for the Department schema.

func (*Department) QueryClass

func (d *Department) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the Department entity.

func (*Department) QueryMajor

func (d *Department) QueryMajor() *MajorQuery

QueryMajor queries the "major" edge of the Department entity.

func (*Department) QueryStudent

func (d *Department) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the Department entity.

func (*Department) String

func (d *Department) String() string

String implements the fmt.Stringer.

func (*Department) Unwrap

func (d *Department) Unwrap() *Department

Unwrap unwraps the Department 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 (*Department) Update

func (d *Department) Update() *DepartmentUpdateOne

Update returns a builder for updating this Department. Note that you need to call Department.Unwrap() before calling this method if this Department was returned from a transaction, and the transaction was committed or rolled back.

type DepartmentClient

type DepartmentClient struct {
	// contains filtered or unexported fields
}

DepartmentClient is a client for the Department schema.

func NewDepartmentClient

func NewDepartmentClient(c config) *DepartmentClient

NewDepartmentClient returns a client for the Department from the given config.

func (*DepartmentClient) Create

func (c *DepartmentClient) Create() *DepartmentCreate

Create returns a builder for creating a Department entity.

func (*DepartmentClient) CreateBulk

func (c *DepartmentClient) CreateBulk(builders ...*DepartmentCreate) *DepartmentCreateBulk

CreateBulk returns a builder for creating a bulk of Department entities.

func (*DepartmentClient) Delete

func (c *DepartmentClient) Delete() *DepartmentDelete

Delete returns a delete builder for Department.

func (*DepartmentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DepartmentClient) DeleteOneID

func (c *DepartmentClient) DeleteOneID(id int) *DepartmentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DepartmentClient) Get

func (c *DepartmentClient) Get(ctx context.Context, id int) (*Department, error)

Get returns a Department entity by its id.

func (*DepartmentClient) GetX

func (c *DepartmentClient) GetX(ctx context.Context, id int) *Department

GetX is like Get, but panics if an error occurs.

func (*DepartmentClient) Hooks

func (c *DepartmentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DepartmentClient) Intercept

func (c *DepartmentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `department.Intercept(f(g(h())))`.

func (*DepartmentClient) Interceptors

func (c *DepartmentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DepartmentClient) Query

func (c *DepartmentClient) Query() *DepartmentQuery

Query returns a query builder for Department.

func (*DepartmentClient) QueryClass

func (c *DepartmentClient) QueryClass(d *Department) *ClassQuery

QueryClass queries the class edge of a Department.

func (*DepartmentClient) QueryMajor

func (c *DepartmentClient) QueryMajor(d *Department) *MajorQuery

QueryMajor queries the major edge of a Department.

func (*DepartmentClient) QueryStudent

func (c *DepartmentClient) QueryStudent(d *Department) *StudentQuery

QueryStudent queries the student edge of a Department.

func (*DepartmentClient) Update

func (c *DepartmentClient) Update() *DepartmentUpdate

Update returns an update builder for Department.

func (*DepartmentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DepartmentClient) UpdateOneID

func (c *DepartmentClient) UpdateOneID(id int) *DepartmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DepartmentClient) Use

func (c *DepartmentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `department.Hooks(f(g(h())))`.

type DepartmentCreate

type DepartmentCreate struct {
	// contains filtered or unexported fields
}

DepartmentCreate is the builder for creating a Department entity.

func (*DepartmentCreate) AddClasIDs

func (dc *DepartmentCreate) AddClasIDs(ids ...int) *DepartmentCreate

AddClasIDs adds the "class" edge to the Class entity by IDs.

func (*DepartmentCreate) AddClass

func (dc *DepartmentCreate) AddClass(c ...*Class) *DepartmentCreate

AddClass adds the "class" edges to the Class entity.

func (*DepartmentCreate) AddMajor

func (dc *DepartmentCreate) AddMajor(m ...*Major) *DepartmentCreate

AddMajor adds the "major" edges to the Major entity.

func (*DepartmentCreate) AddMajorIDs

func (dc *DepartmentCreate) AddMajorIDs(ids ...int) *DepartmentCreate

AddMajorIDs adds the "major" edge to the Major entity by IDs.

func (*DepartmentCreate) AddStudent

func (dc *DepartmentCreate) AddStudent(s ...*Student) *DepartmentCreate

AddStudent adds the "student" edges to the Student entity.

func (*DepartmentCreate) AddStudentIDs

func (dc *DepartmentCreate) AddStudentIDs(ids ...int) *DepartmentCreate

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*DepartmentCreate) Exec

func (dc *DepartmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentCreate) ExecX

func (dc *DepartmentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentCreate) Mutation

func (dc *DepartmentCreate) Mutation() *DepartmentMutation

Mutation returns the DepartmentMutation object of the builder.

func (*DepartmentCreate) Save

func (dc *DepartmentCreate) Save(ctx context.Context) (*Department, error)

Save creates the Department in the database.

func (*DepartmentCreate) SaveX

func (dc *DepartmentCreate) SaveX(ctx context.Context) *Department

SaveX calls Save and panics if Save returns an error.

func (*DepartmentCreate) SetCode

func (dc *DepartmentCreate) SetCode(s string) *DepartmentCreate

SetCode sets the "code" field.

func (*DepartmentCreate) SetDescription

func (dc *DepartmentCreate) SetDescription(s string) *DepartmentCreate

SetDescription sets the "description" field.

func (*DepartmentCreate) SetName

func (dc *DepartmentCreate) SetName(s string) *DepartmentCreate

SetName sets the "name" field.

type DepartmentCreateBulk

type DepartmentCreateBulk struct {
	// contains filtered or unexported fields
}

DepartmentCreateBulk is the builder for creating many Department entities in bulk.

func (*DepartmentCreateBulk) Exec

func (dcb *DepartmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentCreateBulk) ExecX

func (dcb *DepartmentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentCreateBulk) Save

func (dcb *DepartmentCreateBulk) Save(ctx context.Context) ([]*Department, error)

Save creates the Department entities in the database.

func (*DepartmentCreateBulk) SaveX

func (dcb *DepartmentCreateBulk) SaveX(ctx context.Context) []*Department

SaveX is like Save, but panics if an error occurs.

type DepartmentDelete

type DepartmentDelete struct {
	// contains filtered or unexported fields
}

DepartmentDelete is the builder for deleting a Department entity.

func (*DepartmentDelete) Exec

func (dd *DepartmentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DepartmentDelete) ExecX

func (dd *DepartmentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentDelete) Where

Where appends a list predicates to the DepartmentDelete builder.

type DepartmentDeleteOne

type DepartmentDeleteOne struct {
	// contains filtered or unexported fields
}

DepartmentDeleteOne is the builder for deleting a single Department entity.

func (*DepartmentDeleteOne) Exec

func (ddo *DepartmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DepartmentDeleteOne) ExecX

func (ddo *DepartmentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentDeleteOne) Where

Where appends a list predicates to the DepartmentDelete builder.

type DepartmentEdges

type DepartmentEdges struct {
	// Major holds the value of the major edge.
	Major []*Major `json:"major,omitempty"`
	// Class holds the value of the class edge.
	Class []*Class `json:"class,omitempty"`
	// Student holds the value of the student edge.
	Student []*Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

DepartmentEdges holds the relations/edges for other nodes in the graph.

func (DepartmentEdges) ClassOrErr

func (e DepartmentEdges) ClassOrErr() ([]*Class, error)

ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading.

func (DepartmentEdges) MajorOrErr

func (e DepartmentEdges) MajorOrErr() ([]*Major, error)

MajorOrErr returns the Major value or an error if the edge was not loaded in eager-loading.

func (DepartmentEdges) StudentOrErr

func (e DepartmentEdges) StudentOrErr() ([]*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading.

type DepartmentGroupBy

type DepartmentGroupBy struct {
	// contains filtered or unexported fields
}

DepartmentGroupBy is the group-by builder for Department entities.

func (*DepartmentGroupBy) Aggregate

func (dgb *DepartmentGroupBy) Aggregate(fns ...AggregateFunc) *DepartmentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DepartmentGroupBy) Bool

func (s *DepartmentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) BoolX

func (s *DepartmentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DepartmentGroupBy) Bools

func (s *DepartmentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) BoolsX

func (s *DepartmentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DepartmentGroupBy) Float64

func (s *DepartmentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) Float64X

func (s *DepartmentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DepartmentGroupBy) Float64s

func (s *DepartmentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) Float64sX

func (s *DepartmentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DepartmentGroupBy) Int

func (s *DepartmentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) IntX

func (s *DepartmentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DepartmentGroupBy) Ints

func (s *DepartmentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) IntsX

func (s *DepartmentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DepartmentGroupBy) Scan

func (dgb *DepartmentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DepartmentGroupBy) ScanX

func (s *DepartmentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DepartmentGroupBy) String

func (s *DepartmentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) StringX

func (s *DepartmentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DepartmentGroupBy) Strings

func (s *DepartmentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) StringsX

func (s *DepartmentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DepartmentMutation

type DepartmentMutation struct {
	// contains filtered or unexported fields
}

DepartmentMutation represents an operation that mutates the Department nodes in the graph.

func (*DepartmentMutation) AddClasIDs

func (m *DepartmentMutation) AddClasIDs(ids ...int)

AddClasIDs adds the "class" edge to the Class entity by ids.

func (*DepartmentMutation) AddField

func (m *DepartmentMutation) 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 (*DepartmentMutation) AddMajorIDs

func (m *DepartmentMutation) AddMajorIDs(ids ...int)

AddMajorIDs adds the "major" edge to the Major entity by ids.

func (*DepartmentMutation) AddStudentIDs

func (m *DepartmentMutation) AddStudentIDs(ids ...int)

AddStudentIDs adds the "student" edge to the Student entity by ids.

func (*DepartmentMutation) AddedEdges

func (m *DepartmentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DepartmentMutation) AddedField

func (m *DepartmentMutation) 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 (*DepartmentMutation) AddedFields

func (m *DepartmentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DepartmentMutation) AddedIDs

func (m *DepartmentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DepartmentMutation) ClassCleared

func (m *DepartmentMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*DepartmentMutation) ClassIDs

func (m *DepartmentMutation) ClassIDs() (ids []int)

ClassIDs returns the "class" edge IDs in the mutation.

func (*DepartmentMutation) ClearClass

func (m *DepartmentMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*DepartmentMutation) ClearEdge

func (m *DepartmentMutation) 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 (*DepartmentMutation) ClearField

func (m *DepartmentMutation) 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 (*DepartmentMutation) ClearMajor

func (m *DepartmentMutation) ClearMajor()

ClearMajor clears the "major" edge to the Major entity.

func (*DepartmentMutation) ClearStudent

func (m *DepartmentMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*DepartmentMutation) ClearedEdges

func (m *DepartmentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DepartmentMutation) ClearedFields

func (m *DepartmentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DepartmentMutation) Client

func (m DepartmentMutation) 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 (*DepartmentMutation) Code

func (m *DepartmentMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*DepartmentMutation) Description

func (m *DepartmentMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*DepartmentMutation) EdgeCleared

func (m *DepartmentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DepartmentMutation) Field

func (m *DepartmentMutation) 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 (*DepartmentMutation) FieldCleared

func (m *DepartmentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DepartmentMutation) Fields

func (m *DepartmentMutation) 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 (*DepartmentMutation) ID

func (m *DepartmentMutation) 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 (*DepartmentMutation) IDs

func (m *DepartmentMutation) 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 (*DepartmentMutation) MajorCleared

func (m *DepartmentMutation) MajorCleared() bool

MajorCleared reports if the "major" edge to the Major entity was cleared.

func (*DepartmentMutation) MajorIDs

func (m *DepartmentMutation) MajorIDs() (ids []int)

MajorIDs returns the "major" edge IDs in the mutation.

func (*DepartmentMutation) Name

func (m *DepartmentMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*DepartmentMutation) OldCode

func (m *DepartmentMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Department entity. If the Department 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 (*DepartmentMutation) OldDescription

func (m *DepartmentMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Department entity. If the Department 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 (*DepartmentMutation) OldField

func (m *DepartmentMutation) 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 (*DepartmentMutation) OldName

func (m *DepartmentMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Department entity. If the Department 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 (*DepartmentMutation) Op

func (m *DepartmentMutation) Op() Op

Op returns the operation name.

func (*DepartmentMutation) RemoveClasIDs

func (m *DepartmentMutation) RemoveClasIDs(ids ...int)

RemoveClasIDs removes the "class" edge to the Class entity by IDs.

func (*DepartmentMutation) RemoveMajorIDs

func (m *DepartmentMutation) RemoveMajorIDs(ids ...int)

RemoveMajorIDs removes the "major" edge to the Major entity by IDs.

func (*DepartmentMutation) RemoveStudentIDs

func (m *DepartmentMutation) RemoveStudentIDs(ids ...int)

RemoveStudentIDs removes the "student" edge to the Student entity by IDs.

func (*DepartmentMutation) RemovedClassIDs

func (m *DepartmentMutation) RemovedClassIDs() (ids []int)

RemovedClass returns the removed IDs of the "class" edge to the Class entity.

func (*DepartmentMutation) RemovedEdges

func (m *DepartmentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DepartmentMutation) RemovedIDs

func (m *DepartmentMutation) 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 (*DepartmentMutation) RemovedMajorIDs

func (m *DepartmentMutation) RemovedMajorIDs() (ids []int)

RemovedMajor returns the removed IDs of the "major" edge to the Major entity.

func (*DepartmentMutation) RemovedStudentIDs

func (m *DepartmentMutation) RemovedStudentIDs() (ids []int)

RemovedStudent returns the removed IDs of the "student" edge to the Student entity.

func (*DepartmentMutation) ResetClass

func (m *DepartmentMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*DepartmentMutation) ResetCode

func (m *DepartmentMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*DepartmentMutation) ResetDescription

func (m *DepartmentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DepartmentMutation) ResetEdge

func (m *DepartmentMutation) 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 (*DepartmentMutation) ResetField

func (m *DepartmentMutation) 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 (*DepartmentMutation) ResetMajor

func (m *DepartmentMutation) ResetMajor()

ResetMajor resets all changes to the "major" edge.

func (*DepartmentMutation) ResetName

func (m *DepartmentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DepartmentMutation) ResetStudent

func (m *DepartmentMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*DepartmentMutation) SetCode

func (m *DepartmentMutation) SetCode(s string)

SetCode sets the "code" field.

func (*DepartmentMutation) SetDescription

func (m *DepartmentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DepartmentMutation) SetField

func (m *DepartmentMutation) 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 (*DepartmentMutation) SetName

func (m *DepartmentMutation) SetName(s string)

SetName sets the "name" field.

func (*DepartmentMutation) SetOp

func (m *DepartmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DepartmentMutation) StudentCleared

func (m *DepartmentMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*DepartmentMutation) StudentIDs

func (m *DepartmentMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation.

func (DepartmentMutation) Tx

func (m DepartmentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DepartmentMutation) Type

func (m *DepartmentMutation) Type() string

Type returns the node type of this mutation (Department).

func (*DepartmentMutation) Where

func (m *DepartmentMutation) Where(ps ...predicate.Department)

Where appends a list predicates to the DepartmentMutation builder.

func (*DepartmentMutation) WhereP

func (m *DepartmentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DepartmentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DepartmentQuery

type DepartmentQuery struct {
	// contains filtered or unexported fields
}

DepartmentQuery is the builder for querying Department entities.

func (*DepartmentQuery) Aggregate

func (dq *DepartmentQuery) Aggregate(fns ...AggregateFunc) *DepartmentSelect

Aggregate returns a DepartmentSelect configured with the given aggregations.

func (*DepartmentQuery) All

func (dq *DepartmentQuery) All(ctx context.Context) ([]*Department, error)

All executes the query and returns a list of Departments.

func (*DepartmentQuery) AllX

func (dq *DepartmentQuery) AllX(ctx context.Context) []*Department

AllX is like All, but panics if an error occurs.

func (*DepartmentQuery) Clone

func (dq *DepartmentQuery) Clone() *DepartmentQuery

Clone returns a duplicate of the DepartmentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DepartmentQuery) Count

func (dq *DepartmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DepartmentQuery) CountX

func (dq *DepartmentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DepartmentQuery) Exist

func (dq *DepartmentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DepartmentQuery) ExistX

func (dq *DepartmentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DepartmentQuery) First

func (dq *DepartmentQuery) First(ctx context.Context) (*Department, error)

First returns the first Department entity from the query. Returns a *NotFoundError when no Department was found.

func (*DepartmentQuery) FirstID

func (dq *DepartmentQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Department ID from the query. Returns a *NotFoundError when no Department ID was found.

func (*DepartmentQuery) FirstIDX

func (dq *DepartmentQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*DepartmentQuery) FirstX

func (dq *DepartmentQuery) FirstX(ctx context.Context) *Department

FirstX is like First, but panics if an error occurs.

func (*DepartmentQuery) GroupBy

func (dq *DepartmentQuery) GroupBy(field string, fields ...string) *DepartmentGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Department.Query().
	GroupBy(department.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*DepartmentQuery) IDs

func (dq *DepartmentQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Department IDs.

func (*DepartmentQuery) IDsX

func (dq *DepartmentQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*DepartmentQuery) Limit

func (dq *DepartmentQuery) Limit(limit int) *DepartmentQuery

Limit the number of records to be returned by this query.

func (*DepartmentQuery) Offset

func (dq *DepartmentQuery) Offset(offset int) *DepartmentQuery

Offset to start from.

func (*DepartmentQuery) Only

func (dq *DepartmentQuery) Only(ctx context.Context) (*Department, error)

Only returns a single Department entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Department entity is found. Returns a *NotFoundError when no Department entities are found.

func (*DepartmentQuery) OnlyID

func (dq *DepartmentQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Department ID in the query. Returns a *NotSingularError when more than one Department ID is found. Returns a *NotFoundError when no entities are found.

func (*DepartmentQuery) OnlyIDX

func (dq *DepartmentQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DepartmentQuery) OnlyX

func (dq *DepartmentQuery) OnlyX(ctx context.Context) *Department

OnlyX is like Only, but panics if an error occurs.

func (*DepartmentQuery) Order

func (dq *DepartmentQuery) Order(o ...OrderFunc) *DepartmentQuery

Order specifies how the records should be ordered.

func (*DepartmentQuery) QueryClass

func (dq *DepartmentQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*DepartmentQuery) QueryMajor

func (dq *DepartmentQuery) QueryMajor() *MajorQuery

QueryMajor chains the current query on the "major" edge.

func (*DepartmentQuery) QueryStudent

func (dq *DepartmentQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*DepartmentQuery) Select

func (dq *DepartmentQuery) Select(fields ...string) *DepartmentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Department.Query().
	Select(department.FieldName).
	Scan(ctx, &v)

func (*DepartmentQuery) Unique

func (dq *DepartmentQuery) Unique(unique bool) *DepartmentQuery

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 (*DepartmentQuery) Where

Where adds a new predicate for the DepartmentQuery builder.

func (*DepartmentQuery) WithClass

func (dq *DepartmentQuery) WithClass(opts ...func(*ClassQuery)) *DepartmentQuery

WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.

func (*DepartmentQuery) WithMajor

func (dq *DepartmentQuery) WithMajor(opts ...func(*MajorQuery)) *DepartmentQuery

WithMajor tells the query-builder to eager-load the nodes that are connected to the "major" edge. The optional arguments are used to configure the query builder of the edge.

func (*DepartmentQuery) WithStudent

func (dq *DepartmentQuery) WithStudent(opts ...func(*StudentQuery)) *DepartmentQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type DepartmentSelect

type DepartmentSelect struct {
	*DepartmentQuery
	// contains filtered or unexported fields
}

DepartmentSelect is the builder for selecting fields of Department entities.

func (*DepartmentSelect) Aggregate

func (ds *DepartmentSelect) Aggregate(fns ...AggregateFunc) *DepartmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DepartmentSelect) Bool

func (s *DepartmentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) BoolX

func (s *DepartmentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DepartmentSelect) Bools

func (s *DepartmentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) BoolsX

func (s *DepartmentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DepartmentSelect) Float64

func (s *DepartmentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) Float64X

func (s *DepartmentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DepartmentSelect) Float64s

func (s *DepartmentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) Float64sX

func (s *DepartmentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DepartmentSelect) Int

func (s *DepartmentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) IntX

func (s *DepartmentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DepartmentSelect) Ints

func (s *DepartmentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) IntsX

func (s *DepartmentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DepartmentSelect) Scan

func (ds *DepartmentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DepartmentSelect) ScanX

func (s *DepartmentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DepartmentSelect) String

func (s *DepartmentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) StringX

func (s *DepartmentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DepartmentSelect) Strings

func (s *DepartmentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) StringsX

func (s *DepartmentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DepartmentUpdate

type DepartmentUpdate struct {
	// contains filtered or unexported fields
}

DepartmentUpdate is the builder for updating Department entities.

func (*DepartmentUpdate) AddClasIDs

func (du *DepartmentUpdate) AddClasIDs(ids ...int) *DepartmentUpdate

AddClasIDs adds the "class" edge to the Class entity by IDs.

func (*DepartmentUpdate) AddClass

func (du *DepartmentUpdate) AddClass(c ...*Class) *DepartmentUpdate

AddClass adds the "class" edges to the Class entity.

func (*DepartmentUpdate) AddMajor

func (du *DepartmentUpdate) AddMajor(m ...*Major) *DepartmentUpdate

AddMajor adds the "major" edges to the Major entity.

func (*DepartmentUpdate) AddMajorIDs

func (du *DepartmentUpdate) AddMajorIDs(ids ...int) *DepartmentUpdate

AddMajorIDs adds the "major" edge to the Major entity by IDs.

func (*DepartmentUpdate) AddStudent

func (du *DepartmentUpdate) AddStudent(s ...*Student) *DepartmentUpdate

AddStudent adds the "student" edges to the Student entity.

func (*DepartmentUpdate) AddStudentIDs

func (du *DepartmentUpdate) AddStudentIDs(ids ...int) *DepartmentUpdate

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*DepartmentUpdate) ClearClass

func (du *DepartmentUpdate) ClearClass() *DepartmentUpdate

ClearClass clears all "class" edges to the Class entity.

func (*DepartmentUpdate) ClearMajor

func (du *DepartmentUpdate) ClearMajor() *DepartmentUpdate

ClearMajor clears all "major" edges to the Major entity.

func (*DepartmentUpdate) ClearStudent

func (du *DepartmentUpdate) ClearStudent() *DepartmentUpdate

ClearStudent clears all "student" edges to the Student entity.

func (*DepartmentUpdate) Exec

func (du *DepartmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentUpdate) ExecX

func (du *DepartmentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentUpdate) Mutation

func (du *DepartmentUpdate) Mutation() *DepartmentMutation

Mutation returns the DepartmentMutation object of the builder.

func (*DepartmentUpdate) RemoveClasIDs

func (du *DepartmentUpdate) RemoveClasIDs(ids ...int) *DepartmentUpdate

RemoveClasIDs removes the "class" edge to Class entities by IDs.

func (*DepartmentUpdate) RemoveClass

func (du *DepartmentUpdate) RemoveClass(c ...*Class) *DepartmentUpdate

RemoveClass removes "class" edges to Class entities.

func (*DepartmentUpdate) RemoveMajor

func (du *DepartmentUpdate) RemoveMajor(m ...*Major) *DepartmentUpdate

RemoveMajor removes "major" edges to Major entities.

func (*DepartmentUpdate) RemoveMajorIDs

func (du *DepartmentUpdate) RemoveMajorIDs(ids ...int) *DepartmentUpdate

RemoveMajorIDs removes the "major" edge to Major entities by IDs.

func (*DepartmentUpdate) RemoveStudent

func (du *DepartmentUpdate) RemoveStudent(s ...*Student) *DepartmentUpdate

RemoveStudent removes "student" edges to Student entities.

func (*DepartmentUpdate) RemoveStudentIDs

func (du *DepartmentUpdate) RemoveStudentIDs(ids ...int) *DepartmentUpdate

RemoveStudentIDs removes the "student" edge to Student entities by IDs.

func (*DepartmentUpdate) Save

func (du *DepartmentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DepartmentUpdate) SaveX

func (du *DepartmentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DepartmentUpdate) SetCode

func (du *DepartmentUpdate) SetCode(s string) *DepartmentUpdate

SetCode sets the "code" field.

func (*DepartmentUpdate) SetDescription

func (du *DepartmentUpdate) SetDescription(s string) *DepartmentUpdate

SetDescription sets the "description" field.

func (*DepartmentUpdate) SetName

func (du *DepartmentUpdate) SetName(s string) *DepartmentUpdate

SetName sets the "name" field.

func (*DepartmentUpdate) Where

Where appends a list predicates to the DepartmentUpdate builder.

type DepartmentUpdateOne

type DepartmentUpdateOne struct {
	// contains filtered or unexported fields
}

DepartmentUpdateOne is the builder for updating a single Department entity.

func (*DepartmentUpdateOne) AddClasIDs

func (duo *DepartmentUpdateOne) AddClasIDs(ids ...int) *DepartmentUpdateOne

AddClasIDs adds the "class" edge to the Class entity by IDs.

func (*DepartmentUpdateOne) AddClass

func (duo *DepartmentUpdateOne) AddClass(c ...*Class) *DepartmentUpdateOne

AddClass adds the "class" edges to the Class entity.

func (*DepartmentUpdateOne) AddMajor

func (duo *DepartmentUpdateOne) AddMajor(m ...*Major) *DepartmentUpdateOne

AddMajor adds the "major" edges to the Major entity.

func (*DepartmentUpdateOne) AddMajorIDs

func (duo *DepartmentUpdateOne) AddMajorIDs(ids ...int) *DepartmentUpdateOne

AddMajorIDs adds the "major" edge to the Major entity by IDs.

func (*DepartmentUpdateOne) AddStudent

func (duo *DepartmentUpdateOne) AddStudent(s ...*Student) *DepartmentUpdateOne

AddStudent adds the "student" edges to the Student entity.

func (*DepartmentUpdateOne) AddStudentIDs

func (duo *DepartmentUpdateOne) AddStudentIDs(ids ...int) *DepartmentUpdateOne

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*DepartmentUpdateOne) ClearClass

func (duo *DepartmentUpdateOne) ClearClass() *DepartmentUpdateOne

ClearClass clears all "class" edges to the Class entity.

func (*DepartmentUpdateOne) ClearMajor

func (duo *DepartmentUpdateOne) ClearMajor() *DepartmentUpdateOne

ClearMajor clears all "major" edges to the Major entity.

func (*DepartmentUpdateOne) ClearStudent

func (duo *DepartmentUpdateOne) ClearStudent() *DepartmentUpdateOne

ClearStudent clears all "student" edges to the Student entity.

func (*DepartmentUpdateOne) Exec

func (duo *DepartmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DepartmentUpdateOne) ExecX

func (duo *DepartmentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentUpdateOne) Mutation

func (duo *DepartmentUpdateOne) Mutation() *DepartmentMutation

Mutation returns the DepartmentMutation object of the builder.

func (*DepartmentUpdateOne) RemoveClasIDs

func (duo *DepartmentUpdateOne) RemoveClasIDs(ids ...int) *DepartmentUpdateOne

RemoveClasIDs removes the "class" edge to Class entities by IDs.

func (*DepartmentUpdateOne) RemoveClass

func (duo *DepartmentUpdateOne) RemoveClass(c ...*Class) *DepartmentUpdateOne

RemoveClass removes "class" edges to Class entities.

func (*DepartmentUpdateOne) RemoveMajor

func (duo *DepartmentUpdateOne) RemoveMajor(m ...*Major) *DepartmentUpdateOne

RemoveMajor removes "major" edges to Major entities.

func (*DepartmentUpdateOne) RemoveMajorIDs

func (duo *DepartmentUpdateOne) RemoveMajorIDs(ids ...int) *DepartmentUpdateOne

RemoveMajorIDs removes the "major" edge to Major entities by IDs.

func (*DepartmentUpdateOne) RemoveStudent

func (duo *DepartmentUpdateOne) RemoveStudent(s ...*Student) *DepartmentUpdateOne

RemoveStudent removes "student" edges to Student entities.

func (*DepartmentUpdateOne) RemoveStudentIDs

func (duo *DepartmentUpdateOne) RemoveStudentIDs(ids ...int) *DepartmentUpdateOne

RemoveStudentIDs removes the "student" edge to Student entities by IDs.

func (*DepartmentUpdateOne) Save

func (duo *DepartmentUpdateOne) Save(ctx context.Context) (*Department, error)

Save executes the query and returns the updated Department entity.

func (*DepartmentUpdateOne) SaveX

func (duo *DepartmentUpdateOne) SaveX(ctx context.Context) *Department

SaveX is like Save, but panics if an error occurs.

func (*DepartmentUpdateOne) Select

func (duo *DepartmentUpdateOne) Select(field string, fields ...string) *DepartmentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DepartmentUpdateOne) SetCode

SetCode sets the "code" field.

func (*DepartmentUpdateOne) SetDescription

func (duo *DepartmentUpdateOne) SetDescription(s string) *DepartmentUpdateOne

SetDescription sets the "description" field.

func (*DepartmentUpdateOne) SetName

SetName sets the "name" field.

func (*DepartmentUpdateOne) Where

Where appends a list predicates to the DepartmentUpdate builder.

type Departments

type Departments []*Department

Departments is a parsable slice of Department.

type EducationLevel

type EducationLevel struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 培养层次名称
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EducationLevelQuery when eager-loading is set.
	Edges EducationLevelEdges `json:"edges"`
	// contains filtered or unexported fields
}

EducationLevel is the model entity for the EducationLevel schema.

func (*EducationLevel) QueryStudent

func (el *EducationLevel) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the EducationLevel entity.

func (*EducationLevel) String

func (el *EducationLevel) String() string

String implements the fmt.Stringer.

func (*EducationLevel) Unwrap

func (el *EducationLevel) Unwrap() *EducationLevel

Unwrap unwraps the EducationLevel 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 (*EducationLevel) Update

Update returns a builder for updating this EducationLevel. Note that you need to call EducationLevel.Unwrap() before calling this method if this EducationLevel was returned from a transaction, and the transaction was committed or rolled back.

type EducationLevelClient

type EducationLevelClient struct {
	// contains filtered or unexported fields
}

EducationLevelClient is a client for the EducationLevel schema.

func NewEducationLevelClient

func NewEducationLevelClient(c config) *EducationLevelClient

NewEducationLevelClient returns a client for the EducationLevel from the given config.

func (*EducationLevelClient) Create

Create returns a builder for creating a EducationLevel entity.

func (*EducationLevelClient) CreateBulk

CreateBulk returns a builder for creating a bulk of EducationLevel entities.

func (*EducationLevelClient) Delete

Delete returns a delete builder for EducationLevel.

func (*EducationLevelClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EducationLevelClient) DeleteOneID

func (c *EducationLevelClient) DeleteOneID(id int) *EducationLevelDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EducationLevelClient) Get

Get returns a EducationLevel entity by its id.

func (*EducationLevelClient) GetX

GetX is like Get, but panics if an error occurs.

func (*EducationLevelClient) Hooks

func (c *EducationLevelClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EducationLevelClient) Intercept

func (c *EducationLevelClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `educationlevel.Intercept(f(g(h())))`.

func (*EducationLevelClient) Interceptors

func (c *EducationLevelClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EducationLevelClient) Query

Query returns a query builder for EducationLevel.

func (*EducationLevelClient) QueryStudent

func (c *EducationLevelClient) QueryStudent(el *EducationLevel) *StudentQuery

QueryStudent queries the student edge of a EducationLevel.

func (*EducationLevelClient) Update

Update returns an update builder for EducationLevel.

func (*EducationLevelClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*EducationLevelClient) UpdateOneID

func (c *EducationLevelClient) UpdateOneID(id int) *EducationLevelUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EducationLevelClient) Use

func (c *EducationLevelClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `educationlevel.Hooks(f(g(h())))`.

type EducationLevelCreate

type EducationLevelCreate struct {
	// contains filtered or unexported fields
}

EducationLevelCreate is the builder for creating a EducationLevel entity.

func (*EducationLevelCreate) Exec

func (elc *EducationLevelCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EducationLevelCreate) ExecX

func (elc *EducationLevelCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EducationLevelCreate) Mutation

Mutation returns the EducationLevelMutation object of the builder.

func (*EducationLevelCreate) Save

Save creates the EducationLevel in the database.

func (*EducationLevelCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*EducationLevelCreate) SetName

SetName sets the "name" field.

func (*EducationLevelCreate) SetNillableStudentID

func (elc *EducationLevelCreate) SetNillableStudentID(id *int) *EducationLevelCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*EducationLevelCreate) SetStudent

func (elc *EducationLevelCreate) SetStudent(s *Student) *EducationLevelCreate

SetStudent sets the "student" edge to the Student entity.

func (*EducationLevelCreate) SetStudentID

func (elc *EducationLevelCreate) SetStudentID(id int) *EducationLevelCreate

SetStudentID sets the "student" edge to the Student entity by ID.

type EducationLevelCreateBulk

type EducationLevelCreateBulk struct {
	// contains filtered or unexported fields
}

EducationLevelCreateBulk is the builder for creating many EducationLevel entities in bulk.

func (*EducationLevelCreateBulk) Exec

Exec executes the query.

func (*EducationLevelCreateBulk) ExecX

func (elcb *EducationLevelCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EducationLevelCreateBulk) Save

Save creates the EducationLevel entities in the database.

func (*EducationLevelCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type EducationLevelDelete

type EducationLevelDelete struct {
	// contains filtered or unexported fields
}

EducationLevelDelete is the builder for deleting a EducationLevel entity.

func (*EducationLevelDelete) Exec

func (eld *EducationLevelDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EducationLevelDelete) ExecX

func (eld *EducationLevelDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EducationLevelDelete) Where

Where appends a list predicates to the EducationLevelDelete builder.

type EducationLevelDeleteOne

type EducationLevelDeleteOne struct {
	// contains filtered or unexported fields
}

EducationLevelDeleteOne is the builder for deleting a single EducationLevel entity.

func (*EducationLevelDeleteOne) Exec

func (eldo *EducationLevelDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EducationLevelDeleteOne) ExecX

func (eldo *EducationLevelDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EducationLevelDeleteOne) Where

Where appends a list predicates to the EducationLevelDelete builder.

type EducationLevelEdges

type EducationLevelEdges struct {
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

EducationLevelEdges holds the relations/edges for other nodes in the graph.

func (EducationLevelEdges) StudentOrErr

func (e EducationLevelEdges) StudentOrErr() (*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type EducationLevelGroupBy

type EducationLevelGroupBy struct {
	// contains filtered or unexported fields
}

EducationLevelGroupBy is the group-by builder for EducationLevel entities.

func (*EducationLevelGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*EducationLevelGroupBy) Bool

func (s *EducationLevelGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) BoolX

func (s *EducationLevelGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EducationLevelGroupBy) Bools

func (s *EducationLevelGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) BoolsX

func (s *EducationLevelGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EducationLevelGroupBy) Float64

func (s *EducationLevelGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) Float64X

func (s *EducationLevelGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EducationLevelGroupBy) Float64s

func (s *EducationLevelGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) Float64sX

func (s *EducationLevelGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EducationLevelGroupBy) Int

func (s *EducationLevelGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) IntX

func (s *EducationLevelGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EducationLevelGroupBy) Ints

func (s *EducationLevelGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) IntsX

func (s *EducationLevelGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EducationLevelGroupBy) Scan

func (elgb *EducationLevelGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EducationLevelGroupBy) ScanX

func (s *EducationLevelGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EducationLevelGroupBy) String

func (s *EducationLevelGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) StringX

func (s *EducationLevelGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EducationLevelGroupBy) Strings

func (s *EducationLevelGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EducationLevelGroupBy) StringsX

func (s *EducationLevelGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EducationLevelMutation

type EducationLevelMutation struct {
	// contains filtered or unexported fields
}

EducationLevelMutation represents an operation that mutates the EducationLevel nodes in the graph.

func (*EducationLevelMutation) AddField

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) AddedEdges

func (m *EducationLevelMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EducationLevelMutation) AddedField

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) AddedFields

func (m *EducationLevelMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EducationLevelMutation) AddedIDs

func (m *EducationLevelMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EducationLevelMutation) ClearEdge

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ClearField

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ClearStudent

func (m *EducationLevelMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*EducationLevelMutation) ClearedEdges

func (m *EducationLevelMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EducationLevelMutation) ClearedFields

func (m *EducationLevelMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EducationLevelMutation) Client

func (m EducationLevelMutation) 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 (*EducationLevelMutation) EdgeCleared

func (m *EducationLevelMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EducationLevelMutation) Field

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) FieldCleared

func (m *EducationLevelMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EducationLevelMutation) Fields

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ID

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) IDs

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) Name

func (m *EducationLevelMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*EducationLevelMutation) OldField

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) OldName

func (m *EducationLevelMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the EducationLevel entity. If the EducationLevel 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 (*EducationLevelMutation) Op

func (m *EducationLevelMutation) Op() Op

Op returns the operation name.

func (*EducationLevelMutation) RemovedEdges

func (m *EducationLevelMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EducationLevelMutation) RemovedIDs

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ResetEdge

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ResetField

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) ResetName

func (m *EducationLevelMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EducationLevelMutation) ResetStudent

func (m *EducationLevelMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*EducationLevelMutation) SetField

func (m *EducationLevelMutation) 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 (*EducationLevelMutation) SetName

func (m *EducationLevelMutation) SetName(s string)

SetName sets the "name" field.

func (*EducationLevelMutation) SetOp

func (m *EducationLevelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EducationLevelMutation) SetStudentID

func (m *EducationLevelMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*EducationLevelMutation) StudentCleared

func (m *EducationLevelMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*EducationLevelMutation) StudentID

func (m *EducationLevelMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*EducationLevelMutation) StudentIDs

func (m *EducationLevelMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.

func (EducationLevelMutation) Tx

func (m EducationLevelMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EducationLevelMutation) Type

func (m *EducationLevelMutation) Type() string

Type returns the node type of this mutation (EducationLevel).

func (*EducationLevelMutation) Where

Where appends a list predicates to the EducationLevelMutation builder.

func (*EducationLevelMutation) WhereP

func (m *EducationLevelMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EducationLevelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EducationLevelQuery

type EducationLevelQuery struct {
	// contains filtered or unexported fields
}

EducationLevelQuery is the builder for querying EducationLevel entities.

func (*EducationLevelQuery) Aggregate

func (elq *EducationLevelQuery) Aggregate(fns ...AggregateFunc) *EducationLevelSelect

Aggregate returns a EducationLevelSelect configured with the given aggregations.

func (*EducationLevelQuery) All

All executes the query and returns a list of EducationLevels.

func (*EducationLevelQuery) AllX

AllX is like All, but panics if an error occurs.

func (*EducationLevelQuery) Clone

Clone returns a duplicate of the EducationLevelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EducationLevelQuery) Count

func (elq *EducationLevelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EducationLevelQuery) CountX

func (elq *EducationLevelQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EducationLevelQuery) Exist

func (elq *EducationLevelQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EducationLevelQuery) ExistX

func (elq *EducationLevelQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EducationLevelQuery) First

First returns the first EducationLevel entity from the query. Returns a *NotFoundError when no EducationLevel was found.

func (*EducationLevelQuery) FirstID

func (elq *EducationLevelQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first EducationLevel ID from the query. Returns a *NotFoundError when no EducationLevel ID was found.

func (*EducationLevelQuery) FirstIDX

func (elq *EducationLevelQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EducationLevelQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*EducationLevelQuery) GroupBy

func (elq *EducationLevelQuery) GroupBy(field string, fields ...string) *EducationLevelGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EducationLevel.Query().
	GroupBy(educationlevel.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*EducationLevelQuery) IDs

func (elq *EducationLevelQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of EducationLevel IDs.

func (*EducationLevelQuery) IDsX

func (elq *EducationLevelQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EducationLevelQuery) Limit

func (elq *EducationLevelQuery) Limit(limit int) *EducationLevelQuery

Limit the number of records to be returned by this query.

func (*EducationLevelQuery) Offset

func (elq *EducationLevelQuery) Offset(offset int) *EducationLevelQuery

Offset to start from.

func (*EducationLevelQuery) Only

Only returns a single EducationLevel entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EducationLevel entity is found. Returns a *NotFoundError when no EducationLevel entities are found.

func (*EducationLevelQuery) OnlyID

func (elq *EducationLevelQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only EducationLevel ID in the query. Returns a *NotSingularError when more than one EducationLevel ID is found. Returns a *NotFoundError when no entities are found.

func (*EducationLevelQuery) OnlyIDX

func (elq *EducationLevelQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EducationLevelQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*EducationLevelQuery) Order

Order specifies how the records should be ordered.

func (*EducationLevelQuery) QueryStudent

func (elq *EducationLevelQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*EducationLevelQuery) Select

func (elq *EducationLevelQuery) Select(fields ...string) *EducationLevelSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.EducationLevel.Query().
	Select(educationlevel.FieldName).
	Scan(ctx, &v)

func (*EducationLevelQuery) Unique

func (elq *EducationLevelQuery) Unique(unique bool) *EducationLevelQuery

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 (*EducationLevelQuery) Where

Where adds a new predicate for the EducationLevelQuery builder.

func (*EducationLevelQuery) WithStudent

func (elq *EducationLevelQuery) WithStudent(opts ...func(*StudentQuery)) *EducationLevelQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type EducationLevelSelect

type EducationLevelSelect struct {
	*EducationLevelQuery
	// contains filtered or unexported fields
}

EducationLevelSelect is the builder for selecting fields of EducationLevel entities.

func (*EducationLevelSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*EducationLevelSelect) Bool

func (s *EducationLevelSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) BoolX

func (s *EducationLevelSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EducationLevelSelect) Bools

func (s *EducationLevelSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) BoolsX

func (s *EducationLevelSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EducationLevelSelect) Float64

func (s *EducationLevelSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) Float64X

func (s *EducationLevelSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EducationLevelSelect) Float64s

func (s *EducationLevelSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) Float64sX

func (s *EducationLevelSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EducationLevelSelect) Int

func (s *EducationLevelSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) IntX

func (s *EducationLevelSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EducationLevelSelect) Ints

func (s *EducationLevelSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) IntsX

func (s *EducationLevelSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EducationLevelSelect) Scan

func (els *EducationLevelSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EducationLevelSelect) ScanX

func (s *EducationLevelSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EducationLevelSelect) String

func (s *EducationLevelSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) StringX

func (s *EducationLevelSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EducationLevelSelect) Strings

func (s *EducationLevelSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EducationLevelSelect) StringsX

func (s *EducationLevelSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EducationLevelUpdate

type EducationLevelUpdate struct {
	// contains filtered or unexported fields
}

EducationLevelUpdate is the builder for updating EducationLevel entities.

func (*EducationLevelUpdate) ClearStudent

func (elu *EducationLevelUpdate) ClearStudent() *EducationLevelUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*EducationLevelUpdate) Exec

func (elu *EducationLevelUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EducationLevelUpdate) ExecX

func (elu *EducationLevelUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EducationLevelUpdate) Mutation

Mutation returns the EducationLevelMutation object of the builder.

func (*EducationLevelUpdate) Save

func (elu *EducationLevelUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EducationLevelUpdate) SaveX

func (elu *EducationLevelUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EducationLevelUpdate) SetName

SetName sets the "name" field.

func (*EducationLevelUpdate) SetNillableStudentID

func (elu *EducationLevelUpdate) SetNillableStudentID(id *int) *EducationLevelUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*EducationLevelUpdate) SetStudent

func (elu *EducationLevelUpdate) SetStudent(s *Student) *EducationLevelUpdate

SetStudent sets the "student" edge to the Student entity.

func (*EducationLevelUpdate) SetStudentID

func (elu *EducationLevelUpdate) SetStudentID(id int) *EducationLevelUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*EducationLevelUpdate) Where

Where appends a list predicates to the EducationLevelUpdate builder.

type EducationLevelUpdateOne

type EducationLevelUpdateOne struct {
	// contains filtered or unexported fields
}

EducationLevelUpdateOne is the builder for updating a single EducationLevel entity.

func (*EducationLevelUpdateOne) ClearStudent

func (eluo *EducationLevelUpdateOne) ClearStudent() *EducationLevelUpdateOne

ClearStudent clears the "student" edge to the Student entity.

func (*EducationLevelUpdateOne) Exec

func (eluo *EducationLevelUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EducationLevelUpdateOne) ExecX

func (eluo *EducationLevelUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EducationLevelUpdateOne) Mutation

Mutation returns the EducationLevelMutation object of the builder.

func (*EducationLevelUpdateOne) Save

Save executes the query and returns the updated EducationLevel entity.

func (*EducationLevelUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*EducationLevelUpdateOne) Select

func (eluo *EducationLevelUpdateOne) Select(field string, fields ...string) *EducationLevelUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EducationLevelUpdateOne) SetName

SetName sets the "name" field.

func (*EducationLevelUpdateOne) SetNillableStudentID

func (eluo *EducationLevelUpdateOne) SetNillableStudentID(id *int) *EducationLevelUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*EducationLevelUpdateOne) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*EducationLevelUpdateOne) SetStudentID

func (eluo *EducationLevelUpdateOne) SetStudentID(id int) *EducationLevelUpdateOne

SetStudentID sets the "student" edge to the Student entity by ID.

func (*EducationLevelUpdateOne) Where

Where appends a list predicates to the EducationLevelUpdate builder.

type EducationLevels

type EducationLevels []*EducationLevel

EducationLevels is a parsable slice of EducationLevel.

type EnrollmentStatus

type EnrollmentStatus struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 学籍状态名称
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EnrollmentStatusQuery when eager-loading is set.
	Edges EnrollmentStatusEdges `json:"edges"`
	// contains filtered or unexported fields
}

EnrollmentStatus is the model entity for the EnrollmentStatus schema.

func (*EnrollmentStatus) QueryStudent

func (es *EnrollmentStatus) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the EnrollmentStatus entity.

func (*EnrollmentStatus) String

func (es *EnrollmentStatus) String() string

String implements the fmt.Stringer.

func (*EnrollmentStatus) Unwrap

func (es *EnrollmentStatus) Unwrap() *EnrollmentStatus

Unwrap unwraps the EnrollmentStatus 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 (*EnrollmentStatus) Update

Update returns a builder for updating this EnrollmentStatus. Note that you need to call EnrollmentStatus.Unwrap() before calling this method if this EnrollmentStatus was returned from a transaction, and the transaction was committed or rolled back.

type EnrollmentStatusClient

type EnrollmentStatusClient struct {
	// contains filtered or unexported fields
}

EnrollmentStatusClient is a client for the EnrollmentStatus schema.

func NewEnrollmentStatusClient

func NewEnrollmentStatusClient(c config) *EnrollmentStatusClient

NewEnrollmentStatusClient returns a client for the EnrollmentStatus from the given config.

func (*EnrollmentStatusClient) Create

Create returns a builder for creating a EnrollmentStatus entity.

func (*EnrollmentStatusClient) CreateBulk

CreateBulk returns a builder for creating a bulk of EnrollmentStatus entities.

func (*EnrollmentStatusClient) Delete

Delete returns a delete builder for EnrollmentStatus.

func (*EnrollmentStatusClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EnrollmentStatusClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EnrollmentStatusClient) Get

Get returns a EnrollmentStatus entity by its id.

func (*EnrollmentStatusClient) GetX

GetX is like Get, but panics if an error occurs.

func (*EnrollmentStatusClient) Hooks

func (c *EnrollmentStatusClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EnrollmentStatusClient) Intercept

func (c *EnrollmentStatusClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `enrollmentstatus.Intercept(f(g(h())))`.

func (*EnrollmentStatusClient) Interceptors

func (c *EnrollmentStatusClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EnrollmentStatusClient) Query

Query returns a query builder for EnrollmentStatus.

func (*EnrollmentStatusClient) QueryStudent

QueryStudent queries the student edge of a EnrollmentStatus.

func (*EnrollmentStatusClient) Update

Update returns an update builder for EnrollmentStatus.

func (*EnrollmentStatusClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*EnrollmentStatusClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*EnrollmentStatusClient) Use

func (c *EnrollmentStatusClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `enrollmentstatus.Hooks(f(g(h())))`.

type EnrollmentStatusCreate

type EnrollmentStatusCreate struct {
	// contains filtered or unexported fields
}

EnrollmentStatusCreate is the builder for creating a EnrollmentStatus entity.

func (*EnrollmentStatusCreate) Exec

Exec executes the query.

func (*EnrollmentStatusCreate) ExecX

func (esc *EnrollmentStatusCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EnrollmentStatusCreate) Mutation

Mutation returns the EnrollmentStatusMutation object of the builder.

func (*EnrollmentStatusCreate) Save

Save creates the EnrollmentStatus in the database.

func (*EnrollmentStatusCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*EnrollmentStatusCreate) SetName

SetName sets the "name" field.

func (*EnrollmentStatusCreate) SetNillableStudentID

func (esc *EnrollmentStatusCreate) SetNillableStudentID(id *int) *EnrollmentStatusCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*EnrollmentStatusCreate) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*EnrollmentStatusCreate) SetStudentID

func (esc *EnrollmentStatusCreate) SetStudentID(id int) *EnrollmentStatusCreate

SetStudentID sets the "student" edge to the Student entity by ID.

type EnrollmentStatusCreateBulk

type EnrollmentStatusCreateBulk struct {
	// contains filtered or unexported fields
}

EnrollmentStatusCreateBulk is the builder for creating many EnrollmentStatus entities in bulk.

func (*EnrollmentStatusCreateBulk) Exec

Exec executes the query.

func (*EnrollmentStatusCreateBulk) ExecX

func (escb *EnrollmentStatusCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EnrollmentStatusCreateBulk) Save

Save creates the EnrollmentStatus entities in the database.

func (*EnrollmentStatusCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type EnrollmentStatusDelete

type EnrollmentStatusDelete struct {
	// contains filtered or unexported fields
}

EnrollmentStatusDelete is the builder for deleting a EnrollmentStatus entity.

func (*EnrollmentStatusDelete) Exec

func (esd *EnrollmentStatusDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EnrollmentStatusDelete) ExecX

func (esd *EnrollmentStatusDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EnrollmentStatusDelete) Where

Where appends a list predicates to the EnrollmentStatusDelete builder.

type EnrollmentStatusDeleteOne

type EnrollmentStatusDeleteOne struct {
	// contains filtered or unexported fields
}

EnrollmentStatusDeleteOne is the builder for deleting a single EnrollmentStatus entity.

func (*EnrollmentStatusDeleteOne) Exec

Exec executes the deletion query.

func (*EnrollmentStatusDeleteOne) ExecX

func (esdo *EnrollmentStatusDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EnrollmentStatusDeleteOne) Where

Where appends a list predicates to the EnrollmentStatusDelete builder.

type EnrollmentStatusEdges

type EnrollmentStatusEdges struct {
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

EnrollmentStatusEdges holds the relations/edges for other nodes in the graph.

func (EnrollmentStatusEdges) StudentOrErr

func (e EnrollmentStatusEdges) StudentOrErr() (*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type EnrollmentStatusGroupBy

type EnrollmentStatusGroupBy struct {
	// contains filtered or unexported fields
}

EnrollmentStatusGroupBy is the group-by builder for EnrollmentStatus entities.

func (*EnrollmentStatusGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*EnrollmentStatusGroupBy) Bool

func (s *EnrollmentStatusGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) BoolX

func (s *EnrollmentStatusGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Bools

func (s *EnrollmentStatusGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) BoolsX

func (s *EnrollmentStatusGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Float64

func (s *EnrollmentStatusGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) Float64X

func (s *EnrollmentStatusGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Float64s

func (s *EnrollmentStatusGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) Float64sX

func (s *EnrollmentStatusGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Int

func (s *EnrollmentStatusGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) IntX

func (s *EnrollmentStatusGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Ints

func (s *EnrollmentStatusGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) IntsX

func (s *EnrollmentStatusGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Scan

func (esgb *EnrollmentStatusGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EnrollmentStatusGroupBy) ScanX

func (s *EnrollmentStatusGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) String

func (s *EnrollmentStatusGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) StringX

func (s *EnrollmentStatusGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EnrollmentStatusGroupBy) Strings

func (s *EnrollmentStatusGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusGroupBy) StringsX

func (s *EnrollmentStatusGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EnrollmentStatusMutation

type EnrollmentStatusMutation struct {
	// contains filtered or unexported fields
}

EnrollmentStatusMutation represents an operation that mutates the EnrollmentStatus nodes in the graph.

func (*EnrollmentStatusMutation) AddField

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) AddedEdges

func (m *EnrollmentStatusMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EnrollmentStatusMutation) AddedField

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) AddedFields

func (m *EnrollmentStatusMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EnrollmentStatusMutation) AddedIDs

func (m *EnrollmentStatusMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EnrollmentStatusMutation) ClearEdge

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ClearField

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ClearStudent

func (m *EnrollmentStatusMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*EnrollmentStatusMutation) ClearedEdges

func (m *EnrollmentStatusMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EnrollmentStatusMutation) ClearedFields

func (m *EnrollmentStatusMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EnrollmentStatusMutation) Client

func (m EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) EdgeCleared

func (m *EnrollmentStatusMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EnrollmentStatusMutation) Field

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) FieldCleared

func (m *EnrollmentStatusMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EnrollmentStatusMutation) Fields

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ID

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EnrollmentStatusMutation) Name

func (m *EnrollmentStatusMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*EnrollmentStatusMutation) OldField

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) OldName

func (m *EnrollmentStatusMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the EnrollmentStatus entity. If the EnrollmentStatus 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 (*EnrollmentStatusMutation) Op

func (m *EnrollmentStatusMutation) Op() Op

Op returns the operation name.

func (*EnrollmentStatusMutation) RemovedEdges

func (m *EnrollmentStatusMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EnrollmentStatusMutation) RemovedIDs

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ResetEdge

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ResetField

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) ResetName

func (m *EnrollmentStatusMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EnrollmentStatusMutation) ResetStudent

func (m *EnrollmentStatusMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*EnrollmentStatusMutation) SetField

func (m *EnrollmentStatusMutation) 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 (*EnrollmentStatusMutation) SetName

func (m *EnrollmentStatusMutation) SetName(s string)

SetName sets the "name" field.

func (*EnrollmentStatusMutation) SetOp

func (m *EnrollmentStatusMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EnrollmentStatusMutation) SetStudentID

func (m *EnrollmentStatusMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*EnrollmentStatusMutation) StudentCleared

func (m *EnrollmentStatusMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*EnrollmentStatusMutation) StudentID

func (m *EnrollmentStatusMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*EnrollmentStatusMutation) StudentIDs

func (m *EnrollmentStatusMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.

func (EnrollmentStatusMutation) Tx

func (m EnrollmentStatusMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EnrollmentStatusMutation) Type

func (m *EnrollmentStatusMutation) Type() string

Type returns the node type of this mutation (EnrollmentStatus).

func (*EnrollmentStatusMutation) Where

Where appends a list predicates to the EnrollmentStatusMutation builder.

func (*EnrollmentStatusMutation) WhereP

func (m *EnrollmentStatusMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EnrollmentStatusMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EnrollmentStatusQuery

type EnrollmentStatusQuery struct {
	// contains filtered or unexported fields
}

EnrollmentStatusQuery is the builder for querying EnrollmentStatus entities.

func (*EnrollmentStatusQuery) Aggregate

Aggregate returns a EnrollmentStatusSelect configured with the given aggregations.

func (*EnrollmentStatusQuery) All

All executes the query and returns a list of EnrollmentStatusSlice.

func (*EnrollmentStatusQuery) AllX

AllX is like All, but panics if an error occurs.

func (*EnrollmentStatusQuery) Clone

Clone returns a duplicate of the EnrollmentStatusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EnrollmentStatusQuery) Count

func (esq *EnrollmentStatusQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EnrollmentStatusQuery) CountX

func (esq *EnrollmentStatusQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EnrollmentStatusQuery) Exist

func (esq *EnrollmentStatusQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EnrollmentStatusQuery) ExistX

func (esq *EnrollmentStatusQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EnrollmentStatusQuery) First

First returns the first EnrollmentStatus entity from the query. Returns a *NotFoundError when no EnrollmentStatus was found.

func (*EnrollmentStatusQuery) FirstID

func (esq *EnrollmentStatusQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first EnrollmentStatus ID from the query. Returns a *NotFoundError when no EnrollmentStatus ID was found.

func (*EnrollmentStatusQuery) FirstIDX

func (esq *EnrollmentStatusQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EnrollmentStatusQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*EnrollmentStatusQuery) GroupBy

func (esq *EnrollmentStatusQuery) GroupBy(field string, fields ...string) *EnrollmentStatusGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EnrollmentStatus.Query().
	GroupBy(enrollmentstatus.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*EnrollmentStatusQuery) IDs

func (esq *EnrollmentStatusQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of EnrollmentStatus IDs.

func (*EnrollmentStatusQuery) IDsX

func (esq *EnrollmentStatusQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EnrollmentStatusQuery) Limit

func (esq *EnrollmentStatusQuery) Limit(limit int) *EnrollmentStatusQuery

Limit the number of records to be returned by this query.

func (*EnrollmentStatusQuery) Offset

func (esq *EnrollmentStatusQuery) Offset(offset int) *EnrollmentStatusQuery

Offset to start from.

func (*EnrollmentStatusQuery) Only

Only returns a single EnrollmentStatus entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EnrollmentStatus entity is found. Returns a *NotFoundError when no EnrollmentStatus entities are found.

func (*EnrollmentStatusQuery) OnlyID

func (esq *EnrollmentStatusQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only EnrollmentStatus ID in the query. Returns a *NotSingularError when more than one EnrollmentStatus ID is found. Returns a *NotFoundError when no entities are found.

func (*EnrollmentStatusQuery) OnlyIDX

func (esq *EnrollmentStatusQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EnrollmentStatusQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*EnrollmentStatusQuery) Order

Order specifies how the records should be ordered.

func (*EnrollmentStatusQuery) QueryStudent

func (esq *EnrollmentStatusQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*EnrollmentStatusQuery) Select

func (esq *EnrollmentStatusQuery) Select(fields ...string) *EnrollmentStatusSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.EnrollmentStatus.Query().
	Select(enrollmentstatus.FieldName).
	Scan(ctx, &v)

func (*EnrollmentStatusQuery) Unique

func (esq *EnrollmentStatusQuery) Unique(unique bool) *EnrollmentStatusQuery

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 (*EnrollmentStatusQuery) Where

Where adds a new predicate for the EnrollmentStatusQuery builder.

func (*EnrollmentStatusQuery) WithStudent

func (esq *EnrollmentStatusQuery) WithStudent(opts ...func(*StudentQuery)) *EnrollmentStatusQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type EnrollmentStatusSelect

type EnrollmentStatusSelect struct {
	*EnrollmentStatusQuery
	// contains filtered or unexported fields
}

EnrollmentStatusSelect is the builder for selecting fields of EnrollmentStatus entities.

func (*EnrollmentStatusSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*EnrollmentStatusSelect) Bool

func (s *EnrollmentStatusSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) BoolX

func (s *EnrollmentStatusSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EnrollmentStatusSelect) Bools

func (s *EnrollmentStatusSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) BoolsX

func (s *EnrollmentStatusSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EnrollmentStatusSelect) Float64

func (s *EnrollmentStatusSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) Float64X

func (s *EnrollmentStatusSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EnrollmentStatusSelect) Float64s

func (s *EnrollmentStatusSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) Float64sX

func (s *EnrollmentStatusSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EnrollmentStatusSelect) Int

func (s *EnrollmentStatusSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) IntX

func (s *EnrollmentStatusSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EnrollmentStatusSelect) Ints

func (s *EnrollmentStatusSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) IntsX

func (s *EnrollmentStatusSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EnrollmentStatusSelect) Scan

func (ess *EnrollmentStatusSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EnrollmentStatusSelect) ScanX

func (s *EnrollmentStatusSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EnrollmentStatusSelect) String

func (s *EnrollmentStatusSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) StringX

func (s *EnrollmentStatusSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EnrollmentStatusSelect) Strings

func (s *EnrollmentStatusSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EnrollmentStatusSelect) StringsX

func (s *EnrollmentStatusSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EnrollmentStatusSlice

type EnrollmentStatusSlice []*EnrollmentStatus

EnrollmentStatusSlice is a parsable slice of EnrollmentStatus.

type EnrollmentStatusUpdate

type EnrollmentStatusUpdate struct {
	// contains filtered or unexported fields
}

EnrollmentStatusUpdate is the builder for updating EnrollmentStatus entities.

func (*EnrollmentStatusUpdate) ClearStudent

func (esu *EnrollmentStatusUpdate) ClearStudent() *EnrollmentStatusUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*EnrollmentStatusUpdate) Exec

Exec executes the query.

func (*EnrollmentStatusUpdate) ExecX

func (esu *EnrollmentStatusUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EnrollmentStatusUpdate) Mutation

Mutation returns the EnrollmentStatusMutation object of the builder.

func (*EnrollmentStatusUpdate) Save

func (esu *EnrollmentStatusUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EnrollmentStatusUpdate) SaveX

func (esu *EnrollmentStatusUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EnrollmentStatusUpdate) SetName

SetName sets the "name" field.

func (*EnrollmentStatusUpdate) SetNillableStudentID

func (esu *EnrollmentStatusUpdate) SetNillableStudentID(id *int) *EnrollmentStatusUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*EnrollmentStatusUpdate) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*EnrollmentStatusUpdate) SetStudentID

func (esu *EnrollmentStatusUpdate) SetStudentID(id int) *EnrollmentStatusUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*EnrollmentStatusUpdate) Where

Where appends a list predicates to the EnrollmentStatusUpdate builder.

type EnrollmentStatusUpdateOne

type EnrollmentStatusUpdateOne struct {
	// contains filtered or unexported fields
}

EnrollmentStatusUpdateOne is the builder for updating a single EnrollmentStatus entity.

func (*EnrollmentStatusUpdateOne) ClearStudent

ClearStudent clears the "student" edge to the Student entity.

func (*EnrollmentStatusUpdateOne) Exec

Exec executes the query on the entity.

func (*EnrollmentStatusUpdateOne) ExecX

func (esuo *EnrollmentStatusUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EnrollmentStatusUpdateOne) Mutation

Mutation returns the EnrollmentStatusMutation object of the builder.

func (*EnrollmentStatusUpdateOne) Save

Save executes the query and returns the updated EnrollmentStatus entity.

func (*EnrollmentStatusUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*EnrollmentStatusUpdateOne) Select

func (esuo *EnrollmentStatusUpdateOne) Select(field string, fields ...string) *EnrollmentStatusUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EnrollmentStatusUpdateOne) SetName

SetName sets the "name" field.

func (*EnrollmentStatusUpdateOne) SetNillableStudentID

func (esuo *EnrollmentStatusUpdateOne) SetNillableStudentID(id *int) *EnrollmentStatusUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*EnrollmentStatusUpdateOne) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*EnrollmentStatusUpdateOne) SetStudentID

SetStudentID sets the "student" edge to the Student entity by ID.

func (*EnrollmentStatusUpdateOne) Where

Where appends a list predicates to the EnrollmentStatusUpdate builder.

type FamilyInfo

type FamilyInfo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 家庭成员姓名
	Name string `json:"name,omitempty"`
	// 与学生关系
	Relationship string `json:"relationship,omitempty"`
	// 身份证号
	IDCard string `json:"id_card,omitempty"`
	// 年龄
	Age string `json:"age,omitempty"`
	// 职业
	Occupation string `json:"occupation,omitempty"`
	// 职务
	Post string `json:"post,omitempty"`
	// 工作单位
	WorkUnit string `json:"work_unit,omitempty"`
	// 联系电话
	ContactNumber string `json:"contact_number,omitempty"`
	// 健康状况
	Health string `json:"health,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FamilyInfoQuery when eager-loading is set.
	Edges FamilyInfoEdges `json:"edges"`
	// contains filtered or unexported fields
}

FamilyInfo is the model entity for the FamilyInfo schema.

func (*FamilyInfo) QueryStudent

func (fi *FamilyInfo) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the FamilyInfo entity.

func (*FamilyInfo) String

func (fi *FamilyInfo) String() string

String implements the fmt.Stringer.

func (*FamilyInfo) Unwrap

func (fi *FamilyInfo) Unwrap() *FamilyInfo

Unwrap unwraps the FamilyInfo 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 (*FamilyInfo) Update

func (fi *FamilyInfo) Update() *FamilyInfoUpdateOne

Update returns a builder for updating this FamilyInfo. Note that you need to call FamilyInfo.Unwrap() before calling this method if this FamilyInfo was returned from a transaction, and the transaction was committed or rolled back.

type FamilyInfoClient

type FamilyInfoClient struct {
	// contains filtered or unexported fields
}

FamilyInfoClient is a client for the FamilyInfo schema.

func NewFamilyInfoClient

func NewFamilyInfoClient(c config) *FamilyInfoClient

NewFamilyInfoClient returns a client for the FamilyInfo from the given config.

func (*FamilyInfoClient) Create

func (c *FamilyInfoClient) Create() *FamilyInfoCreate

Create returns a builder for creating a FamilyInfo entity.

func (*FamilyInfoClient) CreateBulk

func (c *FamilyInfoClient) CreateBulk(builders ...*FamilyInfoCreate) *FamilyInfoCreateBulk

CreateBulk returns a builder for creating a bulk of FamilyInfo entities.

func (*FamilyInfoClient) Delete

func (c *FamilyInfoClient) Delete() *FamilyInfoDelete

Delete returns a delete builder for FamilyInfo.

func (*FamilyInfoClient) DeleteOne

func (c *FamilyInfoClient) DeleteOne(fi *FamilyInfo) *FamilyInfoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FamilyInfoClient) DeleteOneID

func (c *FamilyInfoClient) DeleteOneID(id int) *FamilyInfoDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FamilyInfoClient) Get

func (c *FamilyInfoClient) Get(ctx context.Context, id int) (*FamilyInfo, error)

Get returns a FamilyInfo entity by its id.

func (*FamilyInfoClient) GetX

func (c *FamilyInfoClient) GetX(ctx context.Context, id int) *FamilyInfo

GetX is like Get, but panics if an error occurs.

func (*FamilyInfoClient) Hooks

func (c *FamilyInfoClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FamilyInfoClient) Intercept

func (c *FamilyInfoClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `familyinfo.Intercept(f(g(h())))`.

func (*FamilyInfoClient) Interceptors

func (c *FamilyInfoClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FamilyInfoClient) Query

func (c *FamilyInfoClient) Query() *FamilyInfoQuery

Query returns a query builder for FamilyInfo.

func (*FamilyInfoClient) QueryStudent

func (c *FamilyInfoClient) QueryStudent(fi *FamilyInfo) *StudentQuery

QueryStudent queries the student edge of a FamilyInfo.

func (*FamilyInfoClient) Update

func (c *FamilyInfoClient) Update() *FamilyInfoUpdate

Update returns an update builder for FamilyInfo.

func (*FamilyInfoClient) UpdateOne

func (c *FamilyInfoClient) UpdateOne(fi *FamilyInfo) *FamilyInfoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FamilyInfoClient) UpdateOneID

func (c *FamilyInfoClient) UpdateOneID(id int) *FamilyInfoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FamilyInfoClient) Use

func (c *FamilyInfoClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `familyinfo.Hooks(f(g(h())))`.

type FamilyInfoCreate

type FamilyInfoCreate struct {
	// contains filtered or unexported fields
}

FamilyInfoCreate is the builder for creating a FamilyInfo entity.

func (*FamilyInfoCreate) Exec

func (fic *FamilyInfoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FamilyInfoCreate) ExecX

func (fic *FamilyInfoCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FamilyInfoCreate) Mutation

func (fic *FamilyInfoCreate) Mutation() *FamilyInfoMutation

Mutation returns the FamilyInfoMutation object of the builder.

func (*FamilyInfoCreate) Save

func (fic *FamilyInfoCreate) Save(ctx context.Context) (*FamilyInfo, error)

Save creates the FamilyInfo in the database.

func (*FamilyInfoCreate) SaveX

func (fic *FamilyInfoCreate) SaveX(ctx context.Context) *FamilyInfo

SaveX calls Save and panics if Save returns an error.

func (*FamilyInfoCreate) SetAge

func (fic *FamilyInfoCreate) SetAge(s string) *FamilyInfoCreate

SetAge sets the "age" field.

func (*FamilyInfoCreate) SetContactNumber

func (fic *FamilyInfoCreate) SetContactNumber(s string) *FamilyInfoCreate

SetContactNumber sets the "contact_number" field.

func (*FamilyInfoCreate) SetHealth

func (fic *FamilyInfoCreate) SetHealth(s string) *FamilyInfoCreate

SetHealth sets the "health" field.

func (*FamilyInfoCreate) SetIDCard

func (fic *FamilyInfoCreate) SetIDCard(s string) *FamilyInfoCreate

SetIDCard sets the "id_card" field.

func (*FamilyInfoCreate) SetName

func (fic *FamilyInfoCreate) SetName(s string) *FamilyInfoCreate

SetName sets the "name" field.

func (*FamilyInfoCreate) SetNillableStudentID

func (fic *FamilyInfoCreate) SetNillableStudentID(id *int) *FamilyInfoCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*FamilyInfoCreate) SetOccupation

func (fic *FamilyInfoCreate) SetOccupation(s string) *FamilyInfoCreate

SetOccupation sets the "occupation" field.

func (*FamilyInfoCreate) SetPost

func (fic *FamilyInfoCreate) SetPost(s string) *FamilyInfoCreate

SetPost sets the "post" field.

func (*FamilyInfoCreate) SetRelationship

func (fic *FamilyInfoCreate) SetRelationship(s string) *FamilyInfoCreate

SetRelationship sets the "relationship" field.

func (*FamilyInfoCreate) SetStudent

func (fic *FamilyInfoCreate) SetStudent(s *Student) *FamilyInfoCreate

SetStudent sets the "student" edge to the Student entity.

func (*FamilyInfoCreate) SetStudentID

func (fic *FamilyInfoCreate) SetStudentID(id int) *FamilyInfoCreate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*FamilyInfoCreate) SetWorkUnit

func (fic *FamilyInfoCreate) SetWorkUnit(s string) *FamilyInfoCreate

SetWorkUnit sets the "work_unit" field.

type FamilyInfoCreateBulk

type FamilyInfoCreateBulk struct {
	// contains filtered or unexported fields
}

FamilyInfoCreateBulk is the builder for creating many FamilyInfo entities in bulk.

func (*FamilyInfoCreateBulk) Exec

func (ficb *FamilyInfoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FamilyInfoCreateBulk) ExecX

func (ficb *FamilyInfoCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FamilyInfoCreateBulk) Save

func (ficb *FamilyInfoCreateBulk) Save(ctx context.Context) ([]*FamilyInfo, error)

Save creates the FamilyInfo entities in the database.

func (*FamilyInfoCreateBulk) SaveX

func (ficb *FamilyInfoCreateBulk) SaveX(ctx context.Context) []*FamilyInfo

SaveX is like Save, but panics if an error occurs.

type FamilyInfoDelete

type FamilyInfoDelete struct {
	// contains filtered or unexported fields
}

FamilyInfoDelete is the builder for deleting a FamilyInfo entity.

func (*FamilyInfoDelete) Exec

func (fid *FamilyInfoDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FamilyInfoDelete) ExecX

func (fid *FamilyInfoDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FamilyInfoDelete) Where

Where appends a list predicates to the FamilyInfoDelete builder.

type FamilyInfoDeleteOne

type FamilyInfoDeleteOne struct {
	// contains filtered or unexported fields
}

FamilyInfoDeleteOne is the builder for deleting a single FamilyInfo entity.

func (*FamilyInfoDeleteOne) Exec

func (fido *FamilyInfoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FamilyInfoDeleteOne) ExecX

func (fido *FamilyInfoDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FamilyInfoDeleteOne) Where

Where appends a list predicates to the FamilyInfoDelete builder.

type FamilyInfoEdges

type FamilyInfoEdges struct {
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

FamilyInfoEdges holds the relations/edges for other nodes in the graph.

func (FamilyInfoEdges) StudentOrErr

func (e FamilyInfoEdges) StudentOrErr() (*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type FamilyInfoGroupBy

type FamilyInfoGroupBy struct {
	// contains filtered or unexported fields
}

FamilyInfoGroupBy is the group-by builder for FamilyInfo entities.

func (*FamilyInfoGroupBy) Aggregate

func (figb *FamilyInfoGroupBy) Aggregate(fns ...AggregateFunc) *FamilyInfoGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FamilyInfoGroupBy) Bool

func (s *FamilyInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) BoolX

func (s *FamilyInfoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FamilyInfoGroupBy) Bools

func (s *FamilyInfoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) BoolsX

func (s *FamilyInfoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FamilyInfoGroupBy) Float64

func (s *FamilyInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) Float64X

func (s *FamilyInfoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FamilyInfoGroupBy) Float64s

func (s *FamilyInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) Float64sX

func (s *FamilyInfoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FamilyInfoGroupBy) Int

func (s *FamilyInfoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) IntX

func (s *FamilyInfoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FamilyInfoGroupBy) Ints

func (s *FamilyInfoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) IntsX

func (s *FamilyInfoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FamilyInfoGroupBy) Scan

func (figb *FamilyInfoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FamilyInfoGroupBy) ScanX

func (s *FamilyInfoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FamilyInfoGroupBy) String

func (s *FamilyInfoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) StringX

func (s *FamilyInfoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FamilyInfoGroupBy) Strings

func (s *FamilyInfoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FamilyInfoGroupBy) StringsX

func (s *FamilyInfoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FamilyInfoMutation

type FamilyInfoMutation struct {
	// contains filtered or unexported fields
}

FamilyInfoMutation represents an operation that mutates the FamilyInfo nodes in the graph.

func (*FamilyInfoMutation) AddField

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) AddedEdges

func (m *FamilyInfoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FamilyInfoMutation) AddedField

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) AddedFields

func (m *FamilyInfoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FamilyInfoMutation) AddedIDs

func (m *FamilyInfoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FamilyInfoMutation) Age

func (m *FamilyInfoMutation) Age() (r string, exists bool)

Age returns the value of the "age" field in the mutation.

func (*FamilyInfoMutation) ClearEdge

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ClearField

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ClearStudent

func (m *FamilyInfoMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*FamilyInfoMutation) ClearedEdges

func (m *FamilyInfoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FamilyInfoMutation) ClearedFields

func (m *FamilyInfoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FamilyInfoMutation) Client

func (m FamilyInfoMutation) 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 (*FamilyInfoMutation) ContactNumber

func (m *FamilyInfoMutation) ContactNumber() (r string, exists bool)

ContactNumber returns the value of the "contact_number" field in the mutation.

func (*FamilyInfoMutation) EdgeCleared

func (m *FamilyInfoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FamilyInfoMutation) Field

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) FieldCleared

func (m *FamilyInfoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FamilyInfoMutation) Fields

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) Health

func (m *FamilyInfoMutation) Health() (r string, exists bool)

Health returns the value of the "health" field in the mutation.

func (*FamilyInfoMutation) ID

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) IDCard

func (m *FamilyInfoMutation) IDCard() (r string, exists bool)

IDCard returns the value of the "id_card" field in the mutation.

func (*FamilyInfoMutation) IDs

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) Name

func (m *FamilyInfoMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*FamilyInfoMutation) Occupation

func (m *FamilyInfoMutation) Occupation() (r string, exists bool)

Occupation returns the value of the "occupation" field in the mutation.

func (*FamilyInfoMutation) OldAge

func (m *FamilyInfoMutation) OldAge(ctx context.Context) (v string, err error)

OldAge returns the old "age" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldContactNumber

func (m *FamilyInfoMutation) OldContactNumber(ctx context.Context) (v string, err error)

OldContactNumber returns the old "contact_number" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldField

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) OldHealth

func (m *FamilyInfoMutation) OldHealth(ctx context.Context) (v string, err error)

OldHealth returns the old "health" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldIDCard

func (m *FamilyInfoMutation) OldIDCard(ctx context.Context) (v string, err error)

OldIDCard returns the old "id_card" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldName

func (m *FamilyInfoMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldOccupation

func (m *FamilyInfoMutation) OldOccupation(ctx context.Context) (v string, err error)

OldOccupation returns the old "occupation" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldPost

func (m *FamilyInfoMutation) OldPost(ctx context.Context) (v string, err error)

OldPost returns the old "post" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldRelationship

func (m *FamilyInfoMutation) OldRelationship(ctx context.Context) (v string, err error)

OldRelationship returns the old "relationship" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) OldWorkUnit

func (m *FamilyInfoMutation) OldWorkUnit(ctx context.Context) (v string, err error)

OldWorkUnit returns the old "work_unit" field's value of the FamilyInfo entity. If the FamilyInfo 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 (*FamilyInfoMutation) Op

func (m *FamilyInfoMutation) Op() Op

Op returns the operation name.

func (*FamilyInfoMutation) Post

func (m *FamilyInfoMutation) Post() (r string, exists bool)

Post returns the value of the "post" field in the mutation.

func (*FamilyInfoMutation) Relationship

func (m *FamilyInfoMutation) Relationship() (r string, exists bool)

Relationship returns the value of the "relationship" field in the mutation.

func (*FamilyInfoMutation) RemovedEdges

func (m *FamilyInfoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FamilyInfoMutation) RemovedIDs

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ResetAge

func (m *FamilyInfoMutation) ResetAge()

ResetAge resets all changes to the "age" field.

func (*FamilyInfoMutation) ResetContactNumber

func (m *FamilyInfoMutation) ResetContactNumber()

ResetContactNumber resets all changes to the "contact_number" field.

func (*FamilyInfoMutation) ResetEdge

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ResetField

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) ResetHealth

func (m *FamilyInfoMutation) ResetHealth()

ResetHealth resets all changes to the "health" field.

func (*FamilyInfoMutation) ResetIDCard

func (m *FamilyInfoMutation) ResetIDCard()

ResetIDCard resets all changes to the "id_card" field.

func (*FamilyInfoMutation) ResetName

func (m *FamilyInfoMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FamilyInfoMutation) ResetOccupation

func (m *FamilyInfoMutation) ResetOccupation()

ResetOccupation resets all changes to the "occupation" field.

func (*FamilyInfoMutation) ResetPost

func (m *FamilyInfoMutation) ResetPost()

ResetPost resets all changes to the "post" field.

func (*FamilyInfoMutation) ResetRelationship

func (m *FamilyInfoMutation) ResetRelationship()

ResetRelationship resets all changes to the "relationship" field.

func (*FamilyInfoMutation) ResetStudent

func (m *FamilyInfoMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*FamilyInfoMutation) ResetWorkUnit

func (m *FamilyInfoMutation) ResetWorkUnit()

ResetWorkUnit resets all changes to the "work_unit" field.

func (*FamilyInfoMutation) SetAge

func (m *FamilyInfoMutation) SetAge(s string)

SetAge sets the "age" field.

func (*FamilyInfoMutation) SetContactNumber

func (m *FamilyInfoMutation) SetContactNumber(s string)

SetContactNumber sets the "contact_number" field.

func (*FamilyInfoMutation) SetField

func (m *FamilyInfoMutation) 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 (*FamilyInfoMutation) SetHealth

func (m *FamilyInfoMutation) SetHealth(s string)

SetHealth sets the "health" field.

func (*FamilyInfoMutation) SetIDCard

func (m *FamilyInfoMutation) SetIDCard(s string)

SetIDCard sets the "id_card" field.

func (*FamilyInfoMutation) SetName

func (m *FamilyInfoMutation) SetName(s string)

SetName sets the "name" field.

func (*FamilyInfoMutation) SetOccupation

func (m *FamilyInfoMutation) SetOccupation(s string)

SetOccupation sets the "occupation" field.

func (*FamilyInfoMutation) SetOp

func (m *FamilyInfoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FamilyInfoMutation) SetPost

func (m *FamilyInfoMutation) SetPost(s string)

SetPost sets the "post" field.

func (*FamilyInfoMutation) SetRelationship

func (m *FamilyInfoMutation) SetRelationship(s string)

SetRelationship sets the "relationship" field.

func (*FamilyInfoMutation) SetStudentID

func (m *FamilyInfoMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*FamilyInfoMutation) SetWorkUnit

func (m *FamilyInfoMutation) SetWorkUnit(s string)

SetWorkUnit sets the "work_unit" field.

func (*FamilyInfoMutation) StudentCleared

func (m *FamilyInfoMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*FamilyInfoMutation) StudentID

func (m *FamilyInfoMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*FamilyInfoMutation) StudentIDs

func (m *FamilyInfoMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.

func (FamilyInfoMutation) Tx

func (m FamilyInfoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FamilyInfoMutation) Type

func (m *FamilyInfoMutation) Type() string

Type returns the node type of this mutation (FamilyInfo).

func (*FamilyInfoMutation) Where

func (m *FamilyInfoMutation) Where(ps ...predicate.FamilyInfo)

Where appends a list predicates to the FamilyInfoMutation builder.

func (*FamilyInfoMutation) WhereP

func (m *FamilyInfoMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FamilyInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*FamilyInfoMutation) WorkUnit

func (m *FamilyInfoMutation) WorkUnit() (r string, exists bool)

WorkUnit returns the value of the "work_unit" field in the mutation.

type FamilyInfoQuery

type FamilyInfoQuery struct {
	// contains filtered or unexported fields
}

FamilyInfoQuery is the builder for querying FamilyInfo entities.

func (*FamilyInfoQuery) Aggregate

func (fiq *FamilyInfoQuery) Aggregate(fns ...AggregateFunc) *FamilyInfoSelect

Aggregate returns a FamilyInfoSelect configured with the given aggregations.

func (*FamilyInfoQuery) All

func (fiq *FamilyInfoQuery) All(ctx context.Context) ([]*FamilyInfo, error)

All executes the query and returns a list of FamilyInfos.

func (*FamilyInfoQuery) AllX

func (fiq *FamilyInfoQuery) AllX(ctx context.Context) []*FamilyInfo

AllX is like All, but panics if an error occurs.

func (*FamilyInfoQuery) Clone

func (fiq *FamilyInfoQuery) Clone() *FamilyInfoQuery

Clone returns a duplicate of the FamilyInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FamilyInfoQuery) Count

func (fiq *FamilyInfoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FamilyInfoQuery) CountX

func (fiq *FamilyInfoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FamilyInfoQuery) Exist

func (fiq *FamilyInfoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FamilyInfoQuery) ExistX

func (fiq *FamilyInfoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FamilyInfoQuery) First

func (fiq *FamilyInfoQuery) First(ctx context.Context) (*FamilyInfo, error)

First returns the first FamilyInfo entity from the query. Returns a *NotFoundError when no FamilyInfo was found.

func (*FamilyInfoQuery) FirstID

func (fiq *FamilyInfoQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first FamilyInfo ID from the query. Returns a *NotFoundError when no FamilyInfo ID was found.

func (*FamilyInfoQuery) FirstIDX

func (fiq *FamilyInfoQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*FamilyInfoQuery) FirstX

func (fiq *FamilyInfoQuery) FirstX(ctx context.Context) *FamilyInfo

FirstX is like First, but panics if an error occurs.

func (*FamilyInfoQuery) GroupBy

func (fiq *FamilyInfoQuery) GroupBy(field string, fields ...string) *FamilyInfoGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.FamilyInfo.Query().
	GroupBy(familyinfo.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*FamilyInfoQuery) IDs

func (fiq *FamilyInfoQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of FamilyInfo IDs.

func (*FamilyInfoQuery) IDsX

func (fiq *FamilyInfoQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*FamilyInfoQuery) Limit

func (fiq *FamilyInfoQuery) Limit(limit int) *FamilyInfoQuery

Limit the number of records to be returned by this query.

func (*FamilyInfoQuery) Offset

func (fiq *FamilyInfoQuery) Offset(offset int) *FamilyInfoQuery

Offset to start from.

func (*FamilyInfoQuery) Only

func (fiq *FamilyInfoQuery) Only(ctx context.Context) (*FamilyInfo, error)

Only returns a single FamilyInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one FamilyInfo entity is found. Returns a *NotFoundError when no FamilyInfo entities are found.

func (*FamilyInfoQuery) OnlyID

func (fiq *FamilyInfoQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only FamilyInfo ID in the query. Returns a *NotSingularError when more than one FamilyInfo ID is found. Returns a *NotFoundError when no entities are found.

func (*FamilyInfoQuery) OnlyIDX

func (fiq *FamilyInfoQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FamilyInfoQuery) OnlyX

func (fiq *FamilyInfoQuery) OnlyX(ctx context.Context) *FamilyInfo

OnlyX is like Only, but panics if an error occurs.

func (*FamilyInfoQuery) Order

func (fiq *FamilyInfoQuery) Order(o ...OrderFunc) *FamilyInfoQuery

Order specifies how the records should be ordered.

func (*FamilyInfoQuery) QueryStudent

func (fiq *FamilyInfoQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*FamilyInfoQuery) Select

func (fiq *FamilyInfoQuery) Select(fields ...string) *FamilyInfoSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.FamilyInfo.Query().
	Select(familyinfo.FieldName).
	Scan(ctx, &v)

func (*FamilyInfoQuery) Unique

func (fiq *FamilyInfoQuery) Unique(unique bool) *FamilyInfoQuery

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 (*FamilyInfoQuery) Where

Where adds a new predicate for the FamilyInfoQuery builder.

func (*FamilyInfoQuery) WithStudent

func (fiq *FamilyInfoQuery) WithStudent(opts ...func(*StudentQuery)) *FamilyInfoQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type FamilyInfoSelect

type FamilyInfoSelect struct {
	*FamilyInfoQuery
	// contains filtered or unexported fields
}

FamilyInfoSelect is the builder for selecting fields of FamilyInfo entities.

func (*FamilyInfoSelect) Aggregate

func (fis *FamilyInfoSelect) Aggregate(fns ...AggregateFunc) *FamilyInfoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FamilyInfoSelect) Bool

func (s *FamilyInfoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) BoolX

func (s *FamilyInfoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FamilyInfoSelect) Bools

func (s *FamilyInfoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) BoolsX

func (s *FamilyInfoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FamilyInfoSelect) Float64

func (s *FamilyInfoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) Float64X

func (s *FamilyInfoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FamilyInfoSelect) Float64s

func (s *FamilyInfoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) Float64sX

func (s *FamilyInfoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FamilyInfoSelect) Int

func (s *FamilyInfoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) IntX

func (s *FamilyInfoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FamilyInfoSelect) Ints

func (s *FamilyInfoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) IntsX

func (s *FamilyInfoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FamilyInfoSelect) Scan

func (fis *FamilyInfoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FamilyInfoSelect) ScanX

func (s *FamilyInfoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FamilyInfoSelect) String

func (s *FamilyInfoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) StringX

func (s *FamilyInfoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FamilyInfoSelect) Strings

func (s *FamilyInfoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FamilyInfoSelect) StringsX

func (s *FamilyInfoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FamilyInfoUpdate

type FamilyInfoUpdate struct {
	// contains filtered or unexported fields
}

FamilyInfoUpdate is the builder for updating FamilyInfo entities.

func (*FamilyInfoUpdate) ClearStudent

func (fiu *FamilyInfoUpdate) ClearStudent() *FamilyInfoUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*FamilyInfoUpdate) Exec

func (fiu *FamilyInfoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FamilyInfoUpdate) ExecX

func (fiu *FamilyInfoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FamilyInfoUpdate) Mutation

func (fiu *FamilyInfoUpdate) Mutation() *FamilyInfoMutation

Mutation returns the FamilyInfoMutation object of the builder.

func (*FamilyInfoUpdate) Save

func (fiu *FamilyInfoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FamilyInfoUpdate) SaveX

func (fiu *FamilyInfoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FamilyInfoUpdate) SetAge

func (fiu *FamilyInfoUpdate) SetAge(s string) *FamilyInfoUpdate

SetAge sets the "age" field.

func (*FamilyInfoUpdate) SetContactNumber

func (fiu *FamilyInfoUpdate) SetContactNumber(s string) *FamilyInfoUpdate

SetContactNumber sets the "contact_number" field.

func (*FamilyInfoUpdate) SetHealth

func (fiu *FamilyInfoUpdate) SetHealth(s string) *FamilyInfoUpdate

SetHealth sets the "health" field.

func (*FamilyInfoUpdate) SetIDCard

func (fiu *FamilyInfoUpdate) SetIDCard(s string) *FamilyInfoUpdate

SetIDCard sets the "id_card" field.

func (*FamilyInfoUpdate) SetName

func (fiu *FamilyInfoUpdate) SetName(s string) *FamilyInfoUpdate

SetName sets the "name" field.

func (*FamilyInfoUpdate) SetNillableStudentID

func (fiu *FamilyInfoUpdate) SetNillableStudentID(id *int) *FamilyInfoUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*FamilyInfoUpdate) SetOccupation

func (fiu *FamilyInfoUpdate) SetOccupation(s string) *FamilyInfoUpdate

SetOccupation sets the "occupation" field.

func (*FamilyInfoUpdate) SetPost

func (fiu *FamilyInfoUpdate) SetPost(s string) *FamilyInfoUpdate

SetPost sets the "post" field.

func (*FamilyInfoUpdate) SetRelationship

func (fiu *FamilyInfoUpdate) SetRelationship(s string) *FamilyInfoUpdate

SetRelationship sets the "relationship" field.

func (*FamilyInfoUpdate) SetStudent

func (fiu *FamilyInfoUpdate) SetStudent(s *Student) *FamilyInfoUpdate

SetStudent sets the "student" edge to the Student entity.

func (*FamilyInfoUpdate) SetStudentID

func (fiu *FamilyInfoUpdate) SetStudentID(id int) *FamilyInfoUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*FamilyInfoUpdate) SetWorkUnit

func (fiu *FamilyInfoUpdate) SetWorkUnit(s string) *FamilyInfoUpdate

SetWorkUnit sets the "work_unit" field.

func (*FamilyInfoUpdate) Where

Where appends a list predicates to the FamilyInfoUpdate builder.

type FamilyInfoUpdateOne

type FamilyInfoUpdateOne struct {
	// contains filtered or unexported fields
}

FamilyInfoUpdateOne is the builder for updating a single FamilyInfo entity.

func (*FamilyInfoUpdateOne) ClearStudent

func (fiuo *FamilyInfoUpdateOne) ClearStudent() *FamilyInfoUpdateOne

ClearStudent clears the "student" edge to the Student entity.

func (*FamilyInfoUpdateOne) Exec

func (fiuo *FamilyInfoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FamilyInfoUpdateOne) ExecX

func (fiuo *FamilyInfoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FamilyInfoUpdateOne) Mutation

func (fiuo *FamilyInfoUpdateOne) Mutation() *FamilyInfoMutation

Mutation returns the FamilyInfoMutation object of the builder.

func (*FamilyInfoUpdateOne) Save

func (fiuo *FamilyInfoUpdateOne) Save(ctx context.Context) (*FamilyInfo, error)

Save executes the query and returns the updated FamilyInfo entity.

func (*FamilyInfoUpdateOne) SaveX

func (fiuo *FamilyInfoUpdateOne) SaveX(ctx context.Context) *FamilyInfo

SaveX is like Save, but panics if an error occurs.

func (*FamilyInfoUpdateOne) Select

func (fiuo *FamilyInfoUpdateOne) Select(field string, fields ...string) *FamilyInfoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*FamilyInfoUpdateOne) SetAge

SetAge sets the "age" field.

func (*FamilyInfoUpdateOne) SetContactNumber

func (fiuo *FamilyInfoUpdateOne) SetContactNumber(s string) *FamilyInfoUpdateOne

SetContactNumber sets the "contact_number" field.

func (*FamilyInfoUpdateOne) SetHealth

func (fiuo *FamilyInfoUpdateOne) SetHealth(s string) *FamilyInfoUpdateOne

SetHealth sets the "health" field.

func (*FamilyInfoUpdateOne) SetIDCard

func (fiuo *FamilyInfoUpdateOne) SetIDCard(s string) *FamilyInfoUpdateOne

SetIDCard sets the "id_card" field.

func (*FamilyInfoUpdateOne) SetName

SetName sets the "name" field.

func (*FamilyInfoUpdateOne) SetNillableStudentID

func (fiuo *FamilyInfoUpdateOne) SetNillableStudentID(id *int) *FamilyInfoUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*FamilyInfoUpdateOne) SetOccupation

func (fiuo *FamilyInfoUpdateOne) SetOccupation(s string) *FamilyInfoUpdateOne

SetOccupation sets the "occupation" field.

func (*FamilyInfoUpdateOne) SetPost

SetPost sets the "post" field.

func (*FamilyInfoUpdateOne) SetRelationship

func (fiuo *FamilyInfoUpdateOne) SetRelationship(s string) *FamilyInfoUpdateOne

SetRelationship sets the "relationship" field.

func (*FamilyInfoUpdateOne) SetStudent

func (fiuo *FamilyInfoUpdateOne) SetStudent(s *Student) *FamilyInfoUpdateOne

SetStudent sets the "student" edge to the Student entity.

func (*FamilyInfoUpdateOne) SetStudentID

func (fiuo *FamilyInfoUpdateOne) SetStudentID(id int) *FamilyInfoUpdateOne

SetStudentID sets the "student" edge to the Student entity by ID.

func (*FamilyInfoUpdateOne) SetWorkUnit

func (fiuo *FamilyInfoUpdateOne) SetWorkUnit(s string) *FamilyInfoUpdateOne

SetWorkUnit sets the "work_unit" field.

func (*FamilyInfoUpdateOne) Where

Where appends a list predicates to the FamilyInfoUpdate builder.

type FamilyInfos

type FamilyInfos []*FamilyInfo

FamilyInfos is a parsable slice of FamilyInfo.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Major

type Major struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 专业名称
	Name string `json:"name,omitempty"`
	// 专业代码
	Code string `json:"code,omitempty"`
	// 专业描述
	Description string `json:"description,omitempty"`
	// 特殊类型
	SpecialType string `json:"special_type,omitempty"`
	// 招生类型
	EnrollmentType string `json:"enrollment_type,omitempty"`
	// 是否专业大类
	IsMajorCategory bool `json:"is_major_category,omitempty"`
	// 专业大类
	MajorCategory string `json:"major_category,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MajorQuery when eager-loading is set.
	Edges MajorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Major is the model entity for the Major schema.

func (*Major) QueryClass

func (m *Major) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the Major entity.

func (*Major) QueryDepartment

func (m *Major) QueryDepartment() *DepartmentQuery

QueryDepartment queries the "department" edge of the Major entity.

func (*Major) QueryStudent

func (m *Major) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the Major entity.

func (*Major) String

func (m *Major) String() string

String implements the fmt.Stringer.

func (*Major) Unwrap

func (m *Major) Unwrap() *Major

Unwrap unwraps the Major 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 (*Major) Update

func (m *Major) Update() *MajorUpdateOne

Update returns a builder for updating this Major. Note that you need to call Major.Unwrap() before calling this method if this Major was returned from a transaction, and the transaction was committed or rolled back.

type MajorClient

type MajorClient struct {
	// contains filtered or unexported fields
}

MajorClient is a client for the Major schema.

func NewMajorClient

func NewMajorClient(c config) *MajorClient

NewMajorClient returns a client for the Major from the given config.

func (*MajorClient) Create

func (c *MajorClient) Create() *MajorCreate

Create returns a builder for creating a Major entity.

func (*MajorClient) CreateBulk

func (c *MajorClient) CreateBulk(builders ...*MajorCreate) *MajorCreateBulk

CreateBulk returns a builder for creating a bulk of Major entities.

func (*MajorClient) Delete

func (c *MajorClient) Delete() *MajorDelete

Delete returns a delete builder for Major.

func (*MajorClient) DeleteOne

func (c *MajorClient) DeleteOne(m *Major) *MajorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MajorClient) DeleteOneID

func (c *MajorClient) DeleteOneID(id int) *MajorDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MajorClient) Get

func (c *MajorClient) Get(ctx context.Context, id int) (*Major, error)

Get returns a Major entity by its id.

func (*MajorClient) GetX

func (c *MajorClient) GetX(ctx context.Context, id int) *Major

GetX is like Get, but panics if an error occurs.

func (*MajorClient) Hooks

func (c *MajorClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MajorClient) Intercept

func (c *MajorClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `major.Intercept(f(g(h())))`.

func (*MajorClient) Interceptors

func (c *MajorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MajorClient) Query

func (c *MajorClient) Query() *MajorQuery

Query returns a query builder for Major.

func (*MajorClient) QueryClass

func (c *MajorClient) QueryClass(m *Major) *ClassQuery

QueryClass queries the class edge of a Major.

func (*MajorClient) QueryDepartment

func (c *MajorClient) QueryDepartment(m *Major) *DepartmentQuery

QueryDepartment queries the department edge of a Major.

func (*MajorClient) QueryStudent

func (c *MajorClient) QueryStudent(m *Major) *StudentQuery

QueryStudent queries the student edge of a Major.

func (*MajorClient) Update

func (c *MajorClient) Update() *MajorUpdate

Update returns an update builder for Major.

func (*MajorClient) UpdateOne

func (c *MajorClient) UpdateOne(m *Major) *MajorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MajorClient) UpdateOneID

func (c *MajorClient) UpdateOneID(id int) *MajorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MajorClient) Use

func (c *MajorClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `major.Hooks(f(g(h())))`.

type MajorCreate

type MajorCreate struct {
	// contains filtered or unexported fields
}

MajorCreate is the builder for creating a Major entity.

func (*MajorCreate) AddClasIDs

func (mc *MajorCreate) AddClasIDs(ids ...int) *MajorCreate

AddClasIDs adds the "class" edge to the Class entity by IDs.

func (*MajorCreate) AddClass

func (mc *MajorCreate) AddClass(c ...*Class) *MajorCreate

AddClass adds the "class" edges to the Class entity.

func (*MajorCreate) AddStudent

func (mc *MajorCreate) AddStudent(s ...*Student) *MajorCreate

AddStudent adds the "student" edges to the Student entity.

func (*MajorCreate) AddStudentIDs

func (mc *MajorCreate) AddStudentIDs(ids ...int) *MajorCreate

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*MajorCreate) Exec

func (mc *MajorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MajorCreate) ExecX

func (mc *MajorCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorCreate) Mutation

func (mc *MajorCreate) Mutation() *MajorMutation

Mutation returns the MajorMutation object of the builder.

func (*MajorCreate) Save

func (mc *MajorCreate) Save(ctx context.Context) (*Major, error)

Save creates the Major in the database.

func (*MajorCreate) SaveX

func (mc *MajorCreate) SaveX(ctx context.Context) *Major

SaveX calls Save and panics if Save returns an error.

func (*MajorCreate) SetCode

func (mc *MajorCreate) SetCode(s string) *MajorCreate

SetCode sets the "code" field.

func (*MajorCreate) SetDepartment

func (mc *MajorCreate) SetDepartment(d *Department) *MajorCreate

SetDepartment sets the "department" edge to the Department entity.

func (*MajorCreate) SetDepartmentID

func (mc *MajorCreate) SetDepartmentID(id int) *MajorCreate

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*MajorCreate) SetDescription

func (mc *MajorCreate) SetDescription(s string) *MajorCreate

SetDescription sets the "description" field.

func (*MajorCreate) SetEnrollmentType

func (mc *MajorCreate) SetEnrollmentType(s string) *MajorCreate

SetEnrollmentType sets the "enrollment_type" field.

func (*MajorCreate) SetIsMajorCategory

func (mc *MajorCreate) SetIsMajorCategory(b bool) *MajorCreate

SetIsMajorCategory sets the "is_major_category" field.

func (*MajorCreate) SetMajorCategory

func (mc *MajorCreate) SetMajorCategory(s string) *MajorCreate

SetMajorCategory sets the "major_category" field.

func (*MajorCreate) SetName

func (mc *MajorCreate) SetName(s string) *MajorCreate

SetName sets the "name" field.

func (*MajorCreate) SetNillableDepartmentID

func (mc *MajorCreate) SetNillableDepartmentID(id *int) *MajorCreate

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*MajorCreate) SetSpecialType

func (mc *MajorCreate) SetSpecialType(s string) *MajorCreate

SetSpecialType sets the "special_type" field.

type MajorCreateBulk

type MajorCreateBulk struct {
	// contains filtered or unexported fields
}

MajorCreateBulk is the builder for creating many Major entities in bulk.

func (*MajorCreateBulk) Exec

func (mcb *MajorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MajorCreateBulk) ExecX

func (mcb *MajorCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorCreateBulk) Save

func (mcb *MajorCreateBulk) Save(ctx context.Context) ([]*Major, error)

Save creates the Major entities in the database.

func (*MajorCreateBulk) SaveX

func (mcb *MajorCreateBulk) SaveX(ctx context.Context) []*Major

SaveX is like Save, but panics if an error occurs.

type MajorDelete

type MajorDelete struct {
	// contains filtered or unexported fields
}

MajorDelete is the builder for deleting a Major entity.

func (*MajorDelete) Exec

func (md *MajorDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MajorDelete) ExecX

func (md *MajorDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MajorDelete) Where

func (md *MajorDelete) Where(ps ...predicate.Major) *MajorDelete

Where appends a list predicates to the MajorDelete builder.

type MajorDeleteOne

type MajorDeleteOne struct {
	// contains filtered or unexported fields
}

MajorDeleteOne is the builder for deleting a single Major entity.

func (*MajorDeleteOne) Exec

func (mdo *MajorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MajorDeleteOne) ExecX

func (mdo *MajorDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorDeleteOne) Where

func (mdo *MajorDeleteOne) Where(ps ...predicate.Major) *MajorDeleteOne

Where appends a list predicates to the MajorDelete builder.

type MajorDirection

type MajorDirection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 专业方向名称
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MajorDirectionQuery when eager-loading is set.
	Edges MajorDirectionEdges `json:"edges"`
	// contains filtered or unexported fields
}

MajorDirection is the model entity for the MajorDirection schema.

func (*MajorDirection) QueryClass

func (md *MajorDirection) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the MajorDirection entity.

func (*MajorDirection) String

func (md *MajorDirection) String() string

String implements the fmt.Stringer.

func (*MajorDirection) Unwrap

func (md *MajorDirection) Unwrap() *MajorDirection

Unwrap unwraps the MajorDirection 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 (*MajorDirection) Update

Update returns a builder for updating this MajorDirection. Note that you need to call MajorDirection.Unwrap() before calling this method if this MajorDirection was returned from a transaction, and the transaction was committed or rolled back.

type MajorDirectionClient

type MajorDirectionClient struct {
	// contains filtered or unexported fields
}

MajorDirectionClient is a client for the MajorDirection schema.

func NewMajorDirectionClient

func NewMajorDirectionClient(c config) *MajorDirectionClient

NewMajorDirectionClient returns a client for the MajorDirection from the given config.

func (*MajorDirectionClient) Create

Create returns a builder for creating a MajorDirection entity.

func (*MajorDirectionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of MajorDirection entities.

func (*MajorDirectionClient) Delete

Delete returns a delete builder for MajorDirection.

func (*MajorDirectionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MajorDirectionClient) DeleteOneID

func (c *MajorDirectionClient) DeleteOneID(id int) *MajorDirectionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MajorDirectionClient) Get

Get returns a MajorDirection entity by its id.

func (*MajorDirectionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*MajorDirectionClient) Hooks

func (c *MajorDirectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MajorDirectionClient) Intercept

func (c *MajorDirectionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `majordirection.Intercept(f(g(h())))`.

func (*MajorDirectionClient) Interceptors

func (c *MajorDirectionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MajorDirectionClient) Query

Query returns a query builder for MajorDirection.

func (*MajorDirectionClient) QueryClass

func (c *MajorDirectionClient) QueryClass(md *MajorDirection) *ClassQuery

QueryClass queries the class edge of a MajorDirection.

func (*MajorDirectionClient) Update

Update returns an update builder for MajorDirection.

func (*MajorDirectionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MajorDirectionClient) UpdateOneID

func (c *MajorDirectionClient) UpdateOneID(id int) *MajorDirectionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MajorDirectionClient) Use

func (c *MajorDirectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `majordirection.Hooks(f(g(h())))`.

type MajorDirectionCreate

type MajorDirectionCreate struct {
	// contains filtered or unexported fields
}

MajorDirectionCreate is the builder for creating a MajorDirection entity.

func (*MajorDirectionCreate) Exec

func (mdc *MajorDirectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MajorDirectionCreate) ExecX

func (mdc *MajorDirectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorDirectionCreate) Mutation

Mutation returns the MajorDirectionMutation object of the builder.

func (*MajorDirectionCreate) Save

Save creates the MajorDirection in the database.

func (*MajorDirectionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MajorDirectionCreate) SetClass

func (mdc *MajorDirectionCreate) SetClass(c *Class) *MajorDirectionCreate

SetClass sets the "class" edge to the Class entity.

func (*MajorDirectionCreate) SetClassID

func (mdc *MajorDirectionCreate) SetClassID(id int) *MajorDirectionCreate

SetClassID sets the "class" edge to the Class entity by ID.

func (*MajorDirectionCreate) SetName

SetName sets the "name" field.

func (*MajorDirectionCreate) SetNillableClassID

func (mdc *MajorDirectionCreate) SetNillableClassID(id *int) *MajorDirectionCreate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

type MajorDirectionCreateBulk

type MajorDirectionCreateBulk struct {
	// contains filtered or unexported fields
}

MajorDirectionCreateBulk is the builder for creating many MajorDirection entities in bulk.

func (*MajorDirectionCreateBulk) Exec

Exec executes the query.

func (*MajorDirectionCreateBulk) ExecX

func (mdcb *MajorDirectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorDirectionCreateBulk) Save

Save creates the MajorDirection entities in the database.

func (*MajorDirectionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type MajorDirectionDelete

type MajorDirectionDelete struct {
	// contains filtered or unexported fields
}

MajorDirectionDelete is the builder for deleting a MajorDirection entity.

func (*MajorDirectionDelete) Exec

func (mdd *MajorDirectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MajorDirectionDelete) ExecX

func (mdd *MajorDirectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MajorDirectionDelete) Where

Where appends a list predicates to the MajorDirectionDelete builder.

type MajorDirectionDeleteOne

type MajorDirectionDeleteOne struct {
	// contains filtered or unexported fields
}

MajorDirectionDeleteOne is the builder for deleting a single MajorDirection entity.

func (*MajorDirectionDeleteOne) Exec

func (mddo *MajorDirectionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MajorDirectionDeleteOne) ExecX

func (mddo *MajorDirectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorDirectionDeleteOne) Where

Where appends a list predicates to the MajorDirectionDelete builder.

type MajorDirectionEdges

type MajorDirectionEdges struct {
	// Class holds the value of the class edge.
	Class *Class `json:"class,omitempty"`
	// contains filtered or unexported fields
}

MajorDirectionEdges holds the relations/edges for other nodes in the graph.

func (MajorDirectionEdges) ClassOrErr

func (e MajorDirectionEdges) ClassOrErr() (*Class, error)

ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MajorDirectionGroupBy

type MajorDirectionGroupBy struct {
	// contains filtered or unexported fields
}

MajorDirectionGroupBy is the group-by builder for MajorDirection entities.

func (*MajorDirectionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*MajorDirectionGroupBy) Bool

func (s *MajorDirectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) BoolX

func (s *MajorDirectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MajorDirectionGroupBy) Bools

func (s *MajorDirectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) BoolsX

func (s *MajorDirectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MajorDirectionGroupBy) Float64

func (s *MajorDirectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) Float64X

func (s *MajorDirectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MajorDirectionGroupBy) Float64s

func (s *MajorDirectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) Float64sX

func (s *MajorDirectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MajorDirectionGroupBy) Int

func (s *MajorDirectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) IntX

func (s *MajorDirectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MajorDirectionGroupBy) Ints

func (s *MajorDirectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) IntsX

func (s *MajorDirectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MajorDirectionGroupBy) Scan

func (mdgb *MajorDirectionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MajorDirectionGroupBy) ScanX

func (s *MajorDirectionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MajorDirectionGroupBy) String

func (s *MajorDirectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) StringX

func (s *MajorDirectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MajorDirectionGroupBy) Strings

func (s *MajorDirectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MajorDirectionGroupBy) StringsX

func (s *MajorDirectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MajorDirectionMutation

type MajorDirectionMutation struct {
	// contains filtered or unexported fields
}

MajorDirectionMutation represents an operation that mutates the MajorDirection nodes in the graph.

func (*MajorDirectionMutation) AddField

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) AddedEdges

func (m *MajorDirectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MajorDirectionMutation) AddedField

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) AddedFields

func (m *MajorDirectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MajorDirectionMutation) AddedIDs

func (m *MajorDirectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MajorDirectionMutation) ClassCleared

func (m *MajorDirectionMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*MajorDirectionMutation) ClassID

func (m *MajorDirectionMutation) ClassID() (id int, exists bool)

ClassID returns the "class" edge ID in the mutation.

func (*MajorDirectionMutation) ClassIDs

func (m *MajorDirectionMutation) ClassIDs() (ids []int)

ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.

func (*MajorDirectionMutation) ClearClass

func (m *MajorDirectionMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*MajorDirectionMutation) ClearEdge

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ClearField

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ClearedEdges

func (m *MajorDirectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MajorDirectionMutation) ClearedFields

func (m *MajorDirectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MajorDirectionMutation) Client

func (m MajorDirectionMutation) 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 (*MajorDirectionMutation) EdgeCleared

func (m *MajorDirectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MajorDirectionMutation) Field

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) FieldCleared

func (m *MajorDirectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MajorDirectionMutation) Fields

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ID

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) IDs

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) Name

func (m *MajorDirectionMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MajorDirectionMutation) OldField

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) OldName

func (m *MajorDirectionMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the MajorDirection entity. If the MajorDirection 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 (*MajorDirectionMutation) Op

func (m *MajorDirectionMutation) Op() Op

Op returns the operation name.

func (*MajorDirectionMutation) RemovedEdges

func (m *MajorDirectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MajorDirectionMutation) RemovedIDs

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ResetClass

func (m *MajorDirectionMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*MajorDirectionMutation) ResetEdge

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ResetField

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) ResetName

func (m *MajorDirectionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MajorDirectionMutation) SetClassID

func (m *MajorDirectionMutation) SetClassID(id int)

SetClassID sets the "class" edge to the Class entity by id.

func (*MajorDirectionMutation) SetField

func (m *MajorDirectionMutation) 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 (*MajorDirectionMutation) SetName

func (m *MajorDirectionMutation) SetName(s string)

SetName sets the "name" field.

func (*MajorDirectionMutation) SetOp

func (m *MajorDirectionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (MajorDirectionMutation) Tx

func (m MajorDirectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MajorDirectionMutation) Type

func (m *MajorDirectionMutation) Type() string

Type returns the node type of this mutation (MajorDirection).

func (*MajorDirectionMutation) Where

Where appends a list predicates to the MajorDirectionMutation builder.

func (*MajorDirectionMutation) WhereP

func (m *MajorDirectionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MajorDirectionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MajorDirectionQuery

type MajorDirectionQuery struct {
	// contains filtered or unexported fields
}

MajorDirectionQuery is the builder for querying MajorDirection entities.

func (*MajorDirectionQuery) Aggregate

func (mdq *MajorDirectionQuery) Aggregate(fns ...AggregateFunc) *MajorDirectionSelect

Aggregate returns a MajorDirectionSelect configured with the given aggregations.

func (*MajorDirectionQuery) All

All executes the query and returns a list of MajorDirections.

func (*MajorDirectionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*MajorDirectionQuery) Clone

Clone returns a duplicate of the MajorDirectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MajorDirectionQuery) Count

func (mdq *MajorDirectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MajorDirectionQuery) CountX

func (mdq *MajorDirectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MajorDirectionQuery) Exist

func (mdq *MajorDirectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MajorDirectionQuery) ExistX

func (mdq *MajorDirectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MajorDirectionQuery) First

First returns the first MajorDirection entity from the query. Returns a *NotFoundError when no MajorDirection was found.

func (*MajorDirectionQuery) FirstID

func (mdq *MajorDirectionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MajorDirection ID from the query. Returns a *NotFoundError when no MajorDirection ID was found.

func (*MajorDirectionQuery) FirstIDX

func (mdq *MajorDirectionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MajorDirectionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*MajorDirectionQuery) GroupBy

func (mdq *MajorDirectionQuery) GroupBy(field string, fields ...string) *MajorDirectionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MajorDirection.Query().
	GroupBy(majordirection.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*MajorDirectionQuery) IDs

func (mdq *MajorDirectionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of MajorDirection IDs.

func (*MajorDirectionQuery) IDsX

func (mdq *MajorDirectionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MajorDirectionQuery) Limit

func (mdq *MajorDirectionQuery) Limit(limit int) *MajorDirectionQuery

Limit the number of records to be returned by this query.

func (*MajorDirectionQuery) Offset

func (mdq *MajorDirectionQuery) Offset(offset int) *MajorDirectionQuery

Offset to start from.

func (*MajorDirectionQuery) Only

Only returns a single MajorDirection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MajorDirection entity is found. Returns a *NotFoundError when no MajorDirection entities are found.

func (*MajorDirectionQuery) OnlyID

func (mdq *MajorDirectionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MajorDirection ID in the query. Returns a *NotSingularError when more than one MajorDirection ID is found. Returns a *NotFoundError when no entities are found.

func (*MajorDirectionQuery) OnlyIDX

func (mdq *MajorDirectionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MajorDirectionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*MajorDirectionQuery) Order

Order specifies how the records should be ordered.

func (*MajorDirectionQuery) QueryClass

func (mdq *MajorDirectionQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*MajorDirectionQuery) Select

func (mdq *MajorDirectionQuery) Select(fields ...string) *MajorDirectionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.MajorDirection.Query().
	Select(majordirection.FieldName).
	Scan(ctx, &v)

func (*MajorDirectionQuery) Unique

func (mdq *MajorDirectionQuery) Unique(unique bool) *MajorDirectionQuery

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 (*MajorDirectionQuery) Where

Where adds a new predicate for the MajorDirectionQuery builder.

func (*MajorDirectionQuery) WithClass

func (mdq *MajorDirectionQuery) WithClass(opts ...func(*ClassQuery)) *MajorDirectionQuery

WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.

type MajorDirectionSelect

type MajorDirectionSelect struct {
	*MajorDirectionQuery
	// contains filtered or unexported fields
}

MajorDirectionSelect is the builder for selecting fields of MajorDirection entities.

func (*MajorDirectionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MajorDirectionSelect) Bool

func (s *MajorDirectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) BoolX

func (s *MajorDirectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MajorDirectionSelect) Bools

func (s *MajorDirectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) BoolsX

func (s *MajorDirectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MajorDirectionSelect) Float64

func (s *MajorDirectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) Float64X

func (s *MajorDirectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MajorDirectionSelect) Float64s

func (s *MajorDirectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) Float64sX

func (s *MajorDirectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MajorDirectionSelect) Int

func (s *MajorDirectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) IntX

func (s *MajorDirectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MajorDirectionSelect) Ints

func (s *MajorDirectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) IntsX

func (s *MajorDirectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MajorDirectionSelect) Scan

func (mds *MajorDirectionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MajorDirectionSelect) ScanX

func (s *MajorDirectionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MajorDirectionSelect) String

func (s *MajorDirectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) StringX

func (s *MajorDirectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MajorDirectionSelect) Strings

func (s *MajorDirectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MajorDirectionSelect) StringsX

func (s *MajorDirectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MajorDirectionUpdate

type MajorDirectionUpdate struct {
	// contains filtered or unexported fields
}

MajorDirectionUpdate is the builder for updating MajorDirection entities.

func (*MajorDirectionUpdate) ClearClass

func (mdu *MajorDirectionUpdate) ClearClass() *MajorDirectionUpdate

ClearClass clears the "class" edge to the Class entity.

func (*MajorDirectionUpdate) Exec

func (mdu *MajorDirectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MajorDirectionUpdate) ExecX

func (mdu *MajorDirectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorDirectionUpdate) Mutation

Mutation returns the MajorDirectionMutation object of the builder.

func (*MajorDirectionUpdate) Save

func (mdu *MajorDirectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MajorDirectionUpdate) SaveX

func (mdu *MajorDirectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MajorDirectionUpdate) SetClass

func (mdu *MajorDirectionUpdate) SetClass(c *Class) *MajorDirectionUpdate

SetClass sets the "class" edge to the Class entity.

func (*MajorDirectionUpdate) SetClassID

func (mdu *MajorDirectionUpdate) SetClassID(id int) *MajorDirectionUpdate

SetClassID sets the "class" edge to the Class entity by ID.

func (*MajorDirectionUpdate) SetName

SetName sets the "name" field.

func (*MajorDirectionUpdate) SetNillableClassID

func (mdu *MajorDirectionUpdate) SetNillableClassID(id *int) *MajorDirectionUpdate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*MajorDirectionUpdate) Where

Where appends a list predicates to the MajorDirectionUpdate builder.

type MajorDirectionUpdateOne

type MajorDirectionUpdateOne struct {
	// contains filtered or unexported fields
}

MajorDirectionUpdateOne is the builder for updating a single MajorDirection entity.

func (*MajorDirectionUpdateOne) ClearClass

ClearClass clears the "class" edge to the Class entity.

func (*MajorDirectionUpdateOne) Exec

func (mduo *MajorDirectionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MajorDirectionUpdateOne) ExecX

func (mduo *MajorDirectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorDirectionUpdateOne) Mutation

Mutation returns the MajorDirectionMutation object of the builder.

func (*MajorDirectionUpdateOne) Save

Save executes the query and returns the updated MajorDirection entity.

func (*MajorDirectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*MajorDirectionUpdateOne) Select

func (mduo *MajorDirectionUpdateOne) Select(field string, fields ...string) *MajorDirectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MajorDirectionUpdateOne) SetClass

SetClass sets the "class" edge to the Class entity.

func (*MajorDirectionUpdateOne) SetClassID

func (mduo *MajorDirectionUpdateOne) SetClassID(id int) *MajorDirectionUpdateOne

SetClassID sets the "class" edge to the Class entity by ID.

func (*MajorDirectionUpdateOne) SetName

SetName sets the "name" field.

func (*MajorDirectionUpdateOne) SetNillableClassID

func (mduo *MajorDirectionUpdateOne) SetNillableClassID(id *int) *MajorDirectionUpdateOne

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*MajorDirectionUpdateOne) Where

Where appends a list predicates to the MajorDirectionUpdate builder.

type MajorDirections

type MajorDirections []*MajorDirection

MajorDirections is a parsable slice of MajorDirection.

type MajorEdges

type MajorEdges struct {
	// Department holds the value of the department edge.
	Department *Department `json:"department,omitempty"`
	// Student holds the value of the student edge.
	Student []*Student `json:"student,omitempty"`
	// Class holds the value of the class edge.
	Class []*Class `json:"class,omitempty"`
	// contains filtered or unexported fields
}

MajorEdges holds the relations/edges for other nodes in the graph.

func (MajorEdges) ClassOrErr

func (e MajorEdges) ClassOrErr() ([]*Class, error)

ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading.

func (MajorEdges) DepartmentOrErr

func (e MajorEdges) DepartmentOrErr() (*Department, error)

DepartmentOrErr returns the Department value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MajorEdges) StudentOrErr

func (e MajorEdges) StudentOrErr() ([]*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading.

type MajorGroupBy

type MajorGroupBy struct {
	// contains filtered or unexported fields
}

MajorGroupBy is the group-by builder for Major entities.

func (*MajorGroupBy) Aggregate

func (mgb *MajorGroupBy) Aggregate(fns ...AggregateFunc) *MajorGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MajorGroupBy) Bool

func (s *MajorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) BoolX

func (s *MajorGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MajorGroupBy) Bools

func (s *MajorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) BoolsX

func (s *MajorGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MajorGroupBy) Float64

func (s *MajorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) Float64X

func (s *MajorGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MajorGroupBy) Float64s

func (s *MajorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) Float64sX

func (s *MajorGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MajorGroupBy) Int

func (s *MajorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) IntX

func (s *MajorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MajorGroupBy) Ints

func (s *MajorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) IntsX

func (s *MajorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MajorGroupBy) Scan

func (mgb *MajorGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MajorGroupBy) ScanX

func (s *MajorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MajorGroupBy) String

func (s *MajorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) StringX

func (s *MajorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MajorGroupBy) Strings

func (s *MajorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MajorGroupBy) StringsX

func (s *MajorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MajorMutation

type MajorMutation struct {
	// contains filtered or unexported fields
}

MajorMutation represents an operation that mutates the Major nodes in the graph.

func (*MajorMutation) AddClasIDs

func (m *MajorMutation) AddClasIDs(ids ...int)

AddClasIDs adds the "class" edge to the Class entity by ids.

func (*MajorMutation) AddField

func (m *MajorMutation) 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 (*MajorMutation) AddStudentIDs

func (m *MajorMutation) AddStudentIDs(ids ...int)

AddStudentIDs adds the "student" edge to the Student entity by ids.

func (*MajorMutation) AddedEdges

func (m *MajorMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MajorMutation) AddedField

func (m *MajorMutation) 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 (*MajorMutation) AddedFields

func (m *MajorMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MajorMutation) AddedIDs

func (m *MajorMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MajorMutation) ClassCleared

func (m *MajorMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*MajorMutation) ClassIDs

func (m *MajorMutation) ClassIDs() (ids []int)

ClassIDs returns the "class" edge IDs in the mutation.

func (*MajorMutation) ClearClass

func (m *MajorMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*MajorMutation) ClearDepartment

func (m *MajorMutation) ClearDepartment()

ClearDepartment clears the "department" edge to the Department entity.

func (*MajorMutation) ClearEdge

func (m *MajorMutation) 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 (*MajorMutation) ClearField

func (m *MajorMutation) 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 (*MajorMutation) ClearStudent

func (m *MajorMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*MajorMutation) ClearedEdges

func (m *MajorMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MajorMutation) ClearedFields

func (m *MajorMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MajorMutation) Client

func (m MajorMutation) 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 (*MajorMutation) Code

func (m *MajorMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*MajorMutation) DepartmentCleared

func (m *MajorMutation) DepartmentCleared() bool

DepartmentCleared reports if the "department" edge to the Department entity was cleared.

func (*MajorMutation) DepartmentID

func (m *MajorMutation) DepartmentID() (id int, exists bool)

DepartmentID returns the "department" edge ID in the mutation.

func (*MajorMutation) DepartmentIDs

func (m *MajorMutation) DepartmentIDs() (ids []int)

DepartmentIDs returns the "department" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DepartmentID instead. It exists only for internal usage by the builders.

func (*MajorMutation) Description

func (m *MajorMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*MajorMutation) EdgeCleared

func (m *MajorMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MajorMutation) EnrollmentType

func (m *MajorMutation) EnrollmentType() (r string, exists bool)

EnrollmentType returns the value of the "enrollment_type" field in the mutation.

func (*MajorMutation) Field

func (m *MajorMutation) 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 (*MajorMutation) FieldCleared

func (m *MajorMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MajorMutation) Fields

func (m *MajorMutation) 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 (*MajorMutation) ID

func (m *MajorMutation) 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 (*MajorMutation) IDs

func (m *MajorMutation) 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 (*MajorMutation) IsMajorCategory

func (m *MajorMutation) IsMajorCategory() (r bool, exists bool)

IsMajorCategory returns the value of the "is_major_category" field in the mutation.

func (*MajorMutation) MajorCategory

func (m *MajorMutation) MajorCategory() (r string, exists bool)

MajorCategory returns the value of the "major_category" field in the mutation.

func (*MajorMutation) Name

func (m *MajorMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MajorMutation) OldCode

func (m *MajorMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Major entity. If the Major 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 (*MajorMutation) OldDescription

func (m *MajorMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Major entity. If the Major 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 (*MajorMutation) OldEnrollmentType

func (m *MajorMutation) OldEnrollmentType(ctx context.Context) (v string, err error)

OldEnrollmentType returns the old "enrollment_type" field's value of the Major entity. If the Major 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 (*MajorMutation) OldField

func (m *MajorMutation) 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 (*MajorMutation) OldIsMajorCategory

func (m *MajorMutation) OldIsMajorCategory(ctx context.Context) (v bool, err error)

OldIsMajorCategory returns the old "is_major_category" field's value of the Major entity. If the Major 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 (*MajorMutation) OldMajorCategory

func (m *MajorMutation) OldMajorCategory(ctx context.Context) (v string, err error)

OldMajorCategory returns the old "major_category" field's value of the Major entity. If the Major 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 (*MajorMutation) OldName

func (m *MajorMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Major entity. If the Major 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 (*MajorMutation) OldSpecialType

func (m *MajorMutation) OldSpecialType(ctx context.Context) (v string, err error)

OldSpecialType returns the old "special_type" field's value of the Major entity. If the Major 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 (*MajorMutation) Op

func (m *MajorMutation) Op() Op

Op returns the operation name.

func (*MajorMutation) RemoveClasIDs

func (m *MajorMutation) RemoveClasIDs(ids ...int)

RemoveClasIDs removes the "class" edge to the Class entity by IDs.

func (*MajorMutation) RemoveStudentIDs

func (m *MajorMutation) RemoveStudentIDs(ids ...int)

RemoveStudentIDs removes the "student" edge to the Student entity by IDs.

func (*MajorMutation) RemovedClassIDs

func (m *MajorMutation) RemovedClassIDs() (ids []int)

RemovedClass returns the removed IDs of the "class" edge to the Class entity.

func (*MajorMutation) RemovedEdges

func (m *MajorMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MajorMutation) RemovedIDs

func (m *MajorMutation) 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 (*MajorMutation) RemovedStudentIDs

func (m *MajorMutation) RemovedStudentIDs() (ids []int)

RemovedStudent returns the removed IDs of the "student" edge to the Student entity.

func (*MajorMutation) ResetClass

func (m *MajorMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*MajorMutation) ResetCode

func (m *MajorMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*MajorMutation) ResetDepartment

func (m *MajorMutation) ResetDepartment()

ResetDepartment resets all changes to the "department" edge.

func (*MajorMutation) ResetDescription

func (m *MajorMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MajorMutation) ResetEdge

func (m *MajorMutation) 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 (*MajorMutation) ResetEnrollmentType

func (m *MajorMutation) ResetEnrollmentType()

ResetEnrollmentType resets all changes to the "enrollment_type" field.

func (*MajorMutation) ResetField

func (m *MajorMutation) 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 (*MajorMutation) ResetIsMajorCategory

func (m *MajorMutation) ResetIsMajorCategory()

ResetIsMajorCategory resets all changes to the "is_major_category" field.

func (*MajorMutation) ResetMajorCategory

func (m *MajorMutation) ResetMajorCategory()

ResetMajorCategory resets all changes to the "major_category" field.

func (*MajorMutation) ResetName

func (m *MajorMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MajorMutation) ResetSpecialType

func (m *MajorMutation) ResetSpecialType()

ResetSpecialType resets all changes to the "special_type" field.

func (*MajorMutation) ResetStudent

func (m *MajorMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*MajorMutation) SetCode

func (m *MajorMutation) SetCode(s string)

SetCode sets the "code" field.

func (*MajorMutation) SetDepartmentID

func (m *MajorMutation) SetDepartmentID(id int)

SetDepartmentID sets the "department" edge to the Department entity by id.

func (*MajorMutation) SetDescription

func (m *MajorMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MajorMutation) SetEnrollmentType

func (m *MajorMutation) SetEnrollmentType(s string)

SetEnrollmentType sets the "enrollment_type" field.

func (*MajorMutation) SetField

func (m *MajorMutation) 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 (*MajorMutation) SetIsMajorCategory

func (m *MajorMutation) SetIsMajorCategory(b bool)

SetIsMajorCategory sets the "is_major_category" field.

func (*MajorMutation) SetMajorCategory

func (m *MajorMutation) SetMajorCategory(s string)

SetMajorCategory sets the "major_category" field.

func (*MajorMutation) SetName

func (m *MajorMutation) SetName(s string)

SetName sets the "name" field.

func (*MajorMutation) SetOp

func (m *MajorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MajorMutation) SetSpecialType

func (m *MajorMutation) SetSpecialType(s string)

SetSpecialType sets the "special_type" field.

func (*MajorMutation) SpecialType

func (m *MajorMutation) SpecialType() (r string, exists bool)

SpecialType returns the value of the "special_type" field in the mutation.

func (*MajorMutation) StudentCleared

func (m *MajorMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*MajorMutation) StudentIDs

func (m *MajorMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation.

func (MajorMutation) Tx

func (m MajorMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MajorMutation) Type

func (m *MajorMutation) Type() string

Type returns the node type of this mutation (Major).

func (*MajorMutation) Where

func (m *MajorMutation) Where(ps ...predicate.Major)

Where appends a list predicates to the MajorMutation builder.

func (*MajorMutation) WhereP

func (m *MajorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MajorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MajorQuery

type MajorQuery struct {
	// contains filtered or unexported fields
}

MajorQuery is the builder for querying Major entities.

func (*MajorQuery) Aggregate

func (mq *MajorQuery) Aggregate(fns ...AggregateFunc) *MajorSelect

Aggregate returns a MajorSelect configured with the given aggregations.

func (*MajorQuery) All

func (mq *MajorQuery) All(ctx context.Context) ([]*Major, error)

All executes the query and returns a list of Majors.

func (*MajorQuery) AllX

func (mq *MajorQuery) AllX(ctx context.Context) []*Major

AllX is like All, but panics if an error occurs.

func (*MajorQuery) Clone

func (mq *MajorQuery) Clone() *MajorQuery

Clone returns a duplicate of the MajorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MajorQuery) Count

func (mq *MajorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MajorQuery) CountX

func (mq *MajorQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MajorQuery) Exist

func (mq *MajorQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MajorQuery) ExistX

func (mq *MajorQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MajorQuery) First

func (mq *MajorQuery) First(ctx context.Context) (*Major, error)

First returns the first Major entity from the query. Returns a *NotFoundError when no Major was found.

func (*MajorQuery) FirstID

func (mq *MajorQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Major ID from the query. Returns a *NotFoundError when no Major ID was found.

func (*MajorQuery) FirstIDX

func (mq *MajorQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MajorQuery) FirstX

func (mq *MajorQuery) FirstX(ctx context.Context) *Major

FirstX is like First, but panics if an error occurs.

func (*MajorQuery) GroupBy

func (mq *MajorQuery) GroupBy(field string, fields ...string) *MajorGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Major.Query().
	GroupBy(major.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*MajorQuery) IDs

func (mq *MajorQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Major IDs.

func (*MajorQuery) IDsX

func (mq *MajorQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MajorQuery) Limit

func (mq *MajorQuery) Limit(limit int) *MajorQuery

Limit the number of records to be returned by this query.

func (*MajorQuery) Offset

func (mq *MajorQuery) Offset(offset int) *MajorQuery

Offset to start from.

func (*MajorQuery) Only

func (mq *MajorQuery) Only(ctx context.Context) (*Major, error)

Only returns a single Major entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Major entity is found. Returns a *NotFoundError when no Major entities are found.

func (*MajorQuery) OnlyID

func (mq *MajorQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Major ID in the query. Returns a *NotSingularError when more than one Major ID is found. Returns a *NotFoundError when no entities are found.

func (*MajorQuery) OnlyIDX

func (mq *MajorQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MajorQuery) OnlyX

func (mq *MajorQuery) OnlyX(ctx context.Context) *Major

OnlyX is like Only, but panics if an error occurs.

func (*MajorQuery) Order

func (mq *MajorQuery) Order(o ...OrderFunc) *MajorQuery

Order specifies how the records should be ordered.

func (*MajorQuery) QueryClass

func (mq *MajorQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*MajorQuery) QueryDepartment

func (mq *MajorQuery) QueryDepartment() *DepartmentQuery

QueryDepartment chains the current query on the "department" edge.

func (*MajorQuery) QueryStudent

func (mq *MajorQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*MajorQuery) Select

func (mq *MajorQuery) Select(fields ...string) *MajorSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Major.Query().
	Select(major.FieldName).
	Scan(ctx, &v)

func (*MajorQuery) Unique

func (mq *MajorQuery) Unique(unique bool) *MajorQuery

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 (*MajorQuery) Where

func (mq *MajorQuery) Where(ps ...predicate.Major) *MajorQuery

Where adds a new predicate for the MajorQuery builder.

func (*MajorQuery) WithClass

func (mq *MajorQuery) WithClass(opts ...func(*ClassQuery)) *MajorQuery

WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.

func (*MajorQuery) WithDepartment

func (mq *MajorQuery) WithDepartment(opts ...func(*DepartmentQuery)) *MajorQuery

WithDepartment tells the query-builder to eager-load the nodes that are connected to the "department" edge. The optional arguments are used to configure the query builder of the edge.

func (*MajorQuery) WithStudent

func (mq *MajorQuery) WithStudent(opts ...func(*StudentQuery)) *MajorQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type MajorSelect

type MajorSelect struct {
	*MajorQuery
	// contains filtered or unexported fields
}

MajorSelect is the builder for selecting fields of Major entities.

func (*MajorSelect) Aggregate

func (ms *MajorSelect) Aggregate(fns ...AggregateFunc) *MajorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MajorSelect) Bool

func (s *MajorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MajorSelect) BoolX

func (s *MajorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MajorSelect) Bools

func (s *MajorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MajorSelect) BoolsX

func (s *MajorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MajorSelect) Float64

func (s *MajorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MajorSelect) Float64X

func (s *MajorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MajorSelect) Float64s

func (s *MajorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MajorSelect) Float64sX

func (s *MajorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MajorSelect) Int

func (s *MajorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MajorSelect) IntX

func (s *MajorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MajorSelect) Ints

func (s *MajorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MajorSelect) IntsX

func (s *MajorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MajorSelect) Scan

func (ms *MajorSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MajorSelect) ScanX

func (s *MajorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MajorSelect) String

func (s *MajorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MajorSelect) StringX

func (s *MajorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MajorSelect) Strings

func (s *MajorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MajorSelect) StringsX

func (s *MajorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MajorUpdate

type MajorUpdate struct {
	// contains filtered or unexported fields
}

MajorUpdate is the builder for updating Major entities.

func (*MajorUpdate) AddClasIDs

func (mu *MajorUpdate) AddClasIDs(ids ...int) *MajorUpdate

AddClasIDs adds the "class" edge to the Class entity by IDs.

func (*MajorUpdate) AddClass

func (mu *MajorUpdate) AddClass(c ...*Class) *MajorUpdate

AddClass adds the "class" edges to the Class entity.

func (*MajorUpdate) AddStudent

func (mu *MajorUpdate) AddStudent(s ...*Student) *MajorUpdate

AddStudent adds the "student" edges to the Student entity.

func (*MajorUpdate) AddStudentIDs

func (mu *MajorUpdate) AddStudentIDs(ids ...int) *MajorUpdate

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*MajorUpdate) ClearClass

func (mu *MajorUpdate) ClearClass() *MajorUpdate

ClearClass clears all "class" edges to the Class entity.

func (*MajorUpdate) ClearDepartment

func (mu *MajorUpdate) ClearDepartment() *MajorUpdate

ClearDepartment clears the "department" edge to the Department entity.

func (*MajorUpdate) ClearStudent

func (mu *MajorUpdate) ClearStudent() *MajorUpdate

ClearStudent clears all "student" edges to the Student entity.

func (*MajorUpdate) Exec

func (mu *MajorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MajorUpdate) ExecX

func (mu *MajorUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorUpdate) Mutation

func (mu *MajorUpdate) Mutation() *MajorMutation

Mutation returns the MajorMutation object of the builder.

func (*MajorUpdate) RemoveClasIDs

func (mu *MajorUpdate) RemoveClasIDs(ids ...int) *MajorUpdate

RemoveClasIDs removes the "class" edge to Class entities by IDs.

func (*MajorUpdate) RemoveClass

func (mu *MajorUpdate) RemoveClass(c ...*Class) *MajorUpdate

RemoveClass removes "class" edges to Class entities.

func (*MajorUpdate) RemoveStudent

func (mu *MajorUpdate) RemoveStudent(s ...*Student) *MajorUpdate

RemoveStudent removes "student" edges to Student entities.

func (*MajorUpdate) RemoveStudentIDs

func (mu *MajorUpdate) RemoveStudentIDs(ids ...int) *MajorUpdate

RemoveStudentIDs removes the "student" edge to Student entities by IDs.

func (*MajorUpdate) Save

func (mu *MajorUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MajorUpdate) SaveX

func (mu *MajorUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MajorUpdate) SetCode

func (mu *MajorUpdate) SetCode(s string) *MajorUpdate

SetCode sets the "code" field.

func (*MajorUpdate) SetDepartment

func (mu *MajorUpdate) SetDepartment(d *Department) *MajorUpdate

SetDepartment sets the "department" edge to the Department entity.

func (*MajorUpdate) SetDepartmentID

func (mu *MajorUpdate) SetDepartmentID(id int) *MajorUpdate

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*MajorUpdate) SetDescription

func (mu *MajorUpdate) SetDescription(s string) *MajorUpdate

SetDescription sets the "description" field.

func (*MajorUpdate) SetEnrollmentType

func (mu *MajorUpdate) SetEnrollmentType(s string) *MajorUpdate

SetEnrollmentType sets the "enrollment_type" field.

func (*MajorUpdate) SetIsMajorCategory

func (mu *MajorUpdate) SetIsMajorCategory(b bool) *MajorUpdate

SetIsMajorCategory sets the "is_major_category" field.

func (*MajorUpdate) SetMajorCategory

func (mu *MajorUpdate) SetMajorCategory(s string) *MajorUpdate

SetMajorCategory sets the "major_category" field.

func (*MajorUpdate) SetName

func (mu *MajorUpdate) SetName(s string) *MajorUpdate

SetName sets the "name" field.

func (*MajorUpdate) SetNillableDepartmentID

func (mu *MajorUpdate) SetNillableDepartmentID(id *int) *MajorUpdate

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*MajorUpdate) SetSpecialType

func (mu *MajorUpdate) SetSpecialType(s string) *MajorUpdate

SetSpecialType sets the "special_type" field.

func (*MajorUpdate) Where

func (mu *MajorUpdate) Where(ps ...predicate.Major) *MajorUpdate

Where appends a list predicates to the MajorUpdate builder.

type MajorUpdateOne

type MajorUpdateOne struct {
	// contains filtered or unexported fields
}

MajorUpdateOne is the builder for updating a single Major entity.

func (*MajorUpdateOne) AddClasIDs

func (muo *MajorUpdateOne) AddClasIDs(ids ...int) *MajorUpdateOne

AddClasIDs adds the "class" edge to the Class entity by IDs.

func (*MajorUpdateOne) AddClass

func (muo *MajorUpdateOne) AddClass(c ...*Class) *MajorUpdateOne

AddClass adds the "class" edges to the Class entity.

func (*MajorUpdateOne) AddStudent

func (muo *MajorUpdateOne) AddStudent(s ...*Student) *MajorUpdateOne

AddStudent adds the "student" edges to the Student entity.

func (*MajorUpdateOne) AddStudentIDs

func (muo *MajorUpdateOne) AddStudentIDs(ids ...int) *MajorUpdateOne

AddStudentIDs adds the "student" edge to the Student entity by IDs.

func (*MajorUpdateOne) ClearClass

func (muo *MajorUpdateOne) ClearClass() *MajorUpdateOne

ClearClass clears all "class" edges to the Class entity.

func (*MajorUpdateOne) ClearDepartment

func (muo *MajorUpdateOne) ClearDepartment() *MajorUpdateOne

ClearDepartment clears the "department" edge to the Department entity.

func (*MajorUpdateOne) ClearStudent

func (muo *MajorUpdateOne) ClearStudent() *MajorUpdateOne

ClearStudent clears all "student" edges to the Student entity.

func (*MajorUpdateOne) Exec

func (muo *MajorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MajorUpdateOne) ExecX

func (muo *MajorUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MajorUpdateOne) Mutation

func (muo *MajorUpdateOne) Mutation() *MajorMutation

Mutation returns the MajorMutation object of the builder.

func (*MajorUpdateOne) RemoveClasIDs

func (muo *MajorUpdateOne) RemoveClasIDs(ids ...int) *MajorUpdateOne

RemoveClasIDs removes the "class" edge to Class entities by IDs.

func (*MajorUpdateOne) RemoveClass

func (muo *MajorUpdateOne) RemoveClass(c ...*Class) *MajorUpdateOne

RemoveClass removes "class" edges to Class entities.

func (*MajorUpdateOne) RemoveStudent

func (muo *MajorUpdateOne) RemoveStudent(s ...*Student) *MajorUpdateOne

RemoveStudent removes "student" edges to Student entities.

func (*MajorUpdateOne) RemoveStudentIDs

func (muo *MajorUpdateOne) RemoveStudentIDs(ids ...int) *MajorUpdateOne

RemoveStudentIDs removes the "student" edge to Student entities by IDs.

func (*MajorUpdateOne) Save

func (muo *MajorUpdateOne) Save(ctx context.Context) (*Major, error)

Save executes the query and returns the updated Major entity.

func (*MajorUpdateOne) SaveX

func (muo *MajorUpdateOne) SaveX(ctx context.Context) *Major

SaveX is like Save, but panics if an error occurs.

func (*MajorUpdateOne) Select

func (muo *MajorUpdateOne) Select(field string, fields ...string) *MajorUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MajorUpdateOne) SetCode

func (muo *MajorUpdateOne) SetCode(s string) *MajorUpdateOne

SetCode sets the "code" field.

func (*MajorUpdateOne) SetDepartment

func (muo *MajorUpdateOne) SetDepartment(d *Department) *MajorUpdateOne

SetDepartment sets the "department" edge to the Department entity.

func (*MajorUpdateOne) SetDepartmentID

func (muo *MajorUpdateOne) SetDepartmentID(id int) *MajorUpdateOne

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*MajorUpdateOne) SetDescription

func (muo *MajorUpdateOne) SetDescription(s string) *MajorUpdateOne

SetDescription sets the "description" field.

func (*MajorUpdateOne) SetEnrollmentType

func (muo *MajorUpdateOne) SetEnrollmentType(s string) *MajorUpdateOne

SetEnrollmentType sets the "enrollment_type" field.

func (*MajorUpdateOne) SetIsMajorCategory

func (muo *MajorUpdateOne) SetIsMajorCategory(b bool) *MajorUpdateOne

SetIsMajorCategory sets the "is_major_category" field.

func (*MajorUpdateOne) SetMajorCategory

func (muo *MajorUpdateOne) SetMajorCategory(s string) *MajorUpdateOne

SetMajorCategory sets the "major_category" field.

func (*MajorUpdateOne) SetName

func (muo *MajorUpdateOne) SetName(s string) *MajorUpdateOne

SetName sets the "name" field.

func (*MajorUpdateOne) SetNillableDepartmentID

func (muo *MajorUpdateOne) SetNillableDepartmentID(id *int) *MajorUpdateOne

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*MajorUpdateOne) SetSpecialType

func (muo *MajorUpdateOne) SetSpecialType(s string) *MajorUpdateOne

SetSpecialType sets the "special_type" field.

func (*MajorUpdateOne) Where

func (muo *MajorUpdateOne) Where(ps ...predicate.Major) *MajorUpdateOne

Where appends a list predicates to the MajorUpdate builder.

type Majors

type Majors []*Major

Majors is a parsable slice of Major.

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 PracticalExperience

type PracticalExperience struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 实践名称
	Name string `json:"name,omitempty"`
	// 实践单位
	Unit string `json:"unit,omitempty"`
	// 开始时间
	StartTime string `json:"start_time,omitempty"`
	// 结束时间
	EndTime string `json:"end_time,omitempty"`
	// 实践描述
	Describe string `json:"describe,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PracticalExperienceQuery when eager-loading is set.
	Edges PracticalExperienceEdges `json:"edges"`
	// contains filtered or unexported fields
}

PracticalExperience is the model entity for the PracticalExperience schema.

func (*PracticalExperience) QueryStudent

func (pe *PracticalExperience) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the PracticalExperience entity.

func (*PracticalExperience) String

func (pe *PracticalExperience) String() string

String implements the fmt.Stringer.

func (*PracticalExperience) Unwrap

Unwrap unwraps the PracticalExperience 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 (*PracticalExperience) Update

Update returns a builder for updating this PracticalExperience. Note that you need to call PracticalExperience.Unwrap() before calling this method if this PracticalExperience was returned from a transaction, and the transaction was committed or rolled back.

type PracticalExperienceClient

type PracticalExperienceClient struct {
	// contains filtered or unexported fields
}

PracticalExperienceClient is a client for the PracticalExperience schema.

func NewPracticalExperienceClient

func NewPracticalExperienceClient(c config) *PracticalExperienceClient

NewPracticalExperienceClient returns a client for the PracticalExperience from the given config.

func (*PracticalExperienceClient) Create

Create returns a builder for creating a PracticalExperience entity.

func (*PracticalExperienceClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PracticalExperience entities.

func (*PracticalExperienceClient) Delete

Delete returns a delete builder for PracticalExperience.

func (*PracticalExperienceClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PracticalExperienceClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PracticalExperienceClient) Get

Get returns a PracticalExperience entity by its id.

func (*PracticalExperienceClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PracticalExperienceClient) Hooks

func (c *PracticalExperienceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PracticalExperienceClient) Intercept

func (c *PracticalExperienceClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `practicalexperience.Intercept(f(g(h())))`.

func (*PracticalExperienceClient) Interceptors

func (c *PracticalExperienceClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PracticalExperienceClient) Query

Query returns a query builder for PracticalExperience.

func (*PracticalExperienceClient) QueryStudent

QueryStudent queries the student edge of a PracticalExperience.

func (*PracticalExperienceClient) Update

Update returns an update builder for PracticalExperience.

func (*PracticalExperienceClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PracticalExperienceClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*PracticalExperienceClient) Use

func (c *PracticalExperienceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `practicalexperience.Hooks(f(g(h())))`.

type PracticalExperienceCreate

type PracticalExperienceCreate struct {
	// contains filtered or unexported fields
}

PracticalExperienceCreate is the builder for creating a PracticalExperience entity.

func (*PracticalExperienceCreate) Exec

Exec executes the query.

func (*PracticalExperienceCreate) ExecX

func (pec *PracticalExperienceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PracticalExperienceCreate) Mutation

Mutation returns the PracticalExperienceMutation object of the builder.

func (*PracticalExperienceCreate) Save

Save creates the PracticalExperience in the database.

func (*PracticalExperienceCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PracticalExperienceCreate) SetDescribe

SetDescribe sets the "describe" field.

func (*PracticalExperienceCreate) SetEndTime

SetEndTime sets the "end_time" field.

func (*PracticalExperienceCreate) SetName

SetName sets the "name" field.

func (*PracticalExperienceCreate) SetNillableStudentID

func (pec *PracticalExperienceCreate) SetNillableStudentID(id *int) *PracticalExperienceCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*PracticalExperienceCreate) SetStartTime

SetStartTime sets the "start_time" field.

func (*PracticalExperienceCreate) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*PracticalExperienceCreate) SetStudentID

SetStudentID sets the "student" edge to the Student entity by ID.

func (*PracticalExperienceCreate) SetUnit

SetUnit sets the "unit" field.

type PracticalExperienceCreateBulk

type PracticalExperienceCreateBulk struct {
	// contains filtered or unexported fields
}

PracticalExperienceCreateBulk is the builder for creating many PracticalExperience entities in bulk.

func (*PracticalExperienceCreateBulk) Exec

Exec executes the query.

func (*PracticalExperienceCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*PracticalExperienceCreateBulk) Save

Save creates the PracticalExperience entities in the database.

func (*PracticalExperienceCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PracticalExperienceDelete

type PracticalExperienceDelete struct {
	// contains filtered or unexported fields
}

PracticalExperienceDelete is the builder for deleting a PracticalExperience entity.

func (*PracticalExperienceDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*PracticalExperienceDelete) ExecX

func (ped *PracticalExperienceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PracticalExperienceDelete) Where

Where appends a list predicates to the PracticalExperienceDelete builder.

type PracticalExperienceDeleteOne

type PracticalExperienceDeleteOne struct {
	// contains filtered or unexported fields
}

PracticalExperienceDeleteOne is the builder for deleting a single PracticalExperience entity.

func (*PracticalExperienceDeleteOne) Exec

Exec executes the deletion query.

func (*PracticalExperienceDeleteOne) ExecX

func (pedo *PracticalExperienceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PracticalExperienceDeleteOne) Where

Where appends a list predicates to the PracticalExperienceDelete builder.

type PracticalExperienceEdges

type PracticalExperienceEdges struct {
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

PracticalExperienceEdges holds the relations/edges for other nodes in the graph.

func (PracticalExperienceEdges) StudentOrErr

func (e PracticalExperienceEdges) StudentOrErr() (*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PracticalExperienceGroupBy

type PracticalExperienceGroupBy struct {
	// contains filtered or unexported fields
}

PracticalExperienceGroupBy is the group-by builder for PracticalExperience entities.

func (*PracticalExperienceGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PracticalExperienceGroupBy) Bool

func (s *PracticalExperienceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) BoolX

func (s *PracticalExperienceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Bools

func (s *PracticalExperienceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) BoolsX

func (s *PracticalExperienceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Float64

func (s *PracticalExperienceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) Float64X

func (s *PracticalExperienceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Float64s

func (s *PracticalExperienceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) Float64sX

func (s *PracticalExperienceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Int

func (s *PracticalExperienceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) IntX

func (s *PracticalExperienceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Ints

func (s *PracticalExperienceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) IntsX

func (s *PracticalExperienceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Scan

func (pegb *PracticalExperienceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PracticalExperienceGroupBy) ScanX

func (s *PracticalExperienceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PracticalExperienceGroupBy) String

func (s *PracticalExperienceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) StringX

func (s *PracticalExperienceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PracticalExperienceGroupBy) Strings

func (s *PracticalExperienceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceGroupBy) StringsX

func (s *PracticalExperienceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PracticalExperienceMutation

type PracticalExperienceMutation struct {
	// contains filtered or unexported fields
}

PracticalExperienceMutation represents an operation that mutates the PracticalExperience nodes in the graph.

func (*PracticalExperienceMutation) AddField

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) AddedEdges

func (m *PracticalExperienceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PracticalExperienceMutation) AddedField

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) AddedFields

func (m *PracticalExperienceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PracticalExperienceMutation) AddedIDs

func (m *PracticalExperienceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PracticalExperienceMutation) ClearEdge

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ClearField

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ClearStudent

func (m *PracticalExperienceMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*PracticalExperienceMutation) ClearedEdges

func (m *PracticalExperienceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PracticalExperienceMutation) ClearedFields

func (m *PracticalExperienceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PracticalExperienceMutation) Client

func (m PracticalExperienceMutation) 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 (*PracticalExperienceMutation) Describe

func (m *PracticalExperienceMutation) Describe() (r string, exists bool)

Describe returns the value of the "describe" field in the mutation.

func (*PracticalExperienceMutation) EdgeCleared

func (m *PracticalExperienceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PracticalExperienceMutation) EndTime

func (m *PracticalExperienceMutation) EndTime() (r string, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*PracticalExperienceMutation) Field

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) FieldCleared

func (m *PracticalExperienceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PracticalExperienceMutation) Fields

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ID

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PracticalExperienceMutation) Name

func (m *PracticalExperienceMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PracticalExperienceMutation) OldDescribe

func (m *PracticalExperienceMutation) OldDescribe(ctx context.Context) (v string, err error)

OldDescribe returns the old "describe" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldEndTime

func (m *PracticalExperienceMutation) OldEndTime(ctx context.Context) (v string, err error)

OldEndTime returns the old "end_time" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldField

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) OldName

func (m *PracticalExperienceMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldStartTime

func (m *PracticalExperienceMutation) OldStartTime(ctx context.Context) (v string, err error)

OldStartTime returns the old "start_time" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) OldUnit

func (m *PracticalExperienceMutation) OldUnit(ctx context.Context) (v string, err error)

OldUnit returns the old "unit" field's value of the PracticalExperience entity. If the PracticalExperience 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 (*PracticalExperienceMutation) Op

Op returns the operation name.

func (*PracticalExperienceMutation) RemovedEdges

func (m *PracticalExperienceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PracticalExperienceMutation) RemovedIDs

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ResetDescribe

func (m *PracticalExperienceMutation) ResetDescribe()

ResetDescribe resets all changes to the "describe" field.

func (*PracticalExperienceMutation) ResetEdge

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ResetEndTime

func (m *PracticalExperienceMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*PracticalExperienceMutation) ResetField

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) ResetName

func (m *PracticalExperienceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PracticalExperienceMutation) ResetStartTime

func (m *PracticalExperienceMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*PracticalExperienceMutation) ResetStudent

func (m *PracticalExperienceMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*PracticalExperienceMutation) ResetUnit

func (m *PracticalExperienceMutation) ResetUnit()

ResetUnit resets all changes to the "unit" field.

func (*PracticalExperienceMutation) SetDescribe

func (m *PracticalExperienceMutation) SetDescribe(s string)

SetDescribe sets the "describe" field.

func (*PracticalExperienceMutation) SetEndTime

func (m *PracticalExperienceMutation) SetEndTime(s string)

SetEndTime sets the "end_time" field.

func (*PracticalExperienceMutation) SetField

func (m *PracticalExperienceMutation) 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 (*PracticalExperienceMutation) SetName

func (m *PracticalExperienceMutation) SetName(s string)

SetName sets the "name" field.

func (*PracticalExperienceMutation) SetOp

func (m *PracticalExperienceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PracticalExperienceMutation) SetStartTime

func (m *PracticalExperienceMutation) SetStartTime(s string)

SetStartTime sets the "start_time" field.

func (*PracticalExperienceMutation) SetStudentID

func (m *PracticalExperienceMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*PracticalExperienceMutation) SetUnit

func (m *PracticalExperienceMutation) SetUnit(s string)

SetUnit sets the "unit" field.

func (*PracticalExperienceMutation) StartTime

func (m *PracticalExperienceMutation) StartTime() (r string, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (*PracticalExperienceMutation) StudentCleared

func (m *PracticalExperienceMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*PracticalExperienceMutation) StudentID

func (m *PracticalExperienceMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*PracticalExperienceMutation) StudentIDs

func (m *PracticalExperienceMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.

func (PracticalExperienceMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PracticalExperienceMutation) Type

Type returns the node type of this mutation (PracticalExperience).

func (*PracticalExperienceMutation) Unit

func (m *PracticalExperienceMutation) Unit() (r string, exists bool)

Unit returns the value of the "unit" field in the mutation.

func (*PracticalExperienceMutation) Where

Where appends a list predicates to the PracticalExperienceMutation builder.

func (*PracticalExperienceMutation) WhereP

func (m *PracticalExperienceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PracticalExperienceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PracticalExperienceQuery

type PracticalExperienceQuery struct {
	// contains filtered or unexported fields
}

PracticalExperienceQuery is the builder for querying PracticalExperience entities.

func (*PracticalExperienceQuery) Aggregate

Aggregate returns a PracticalExperienceSelect configured with the given aggregations.

func (*PracticalExperienceQuery) All

All executes the query and returns a list of PracticalExperiences.

func (*PracticalExperienceQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PracticalExperienceQuery) Clone

Clone returns a duplicate of the PracticalExperienceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PracticalExperienceQuery) Count

func (peq *PracticalExperienceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PracticalExperienceQuery) CountX

func (peq *PracticalExperienceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PracticalExperienceQuery) Exist

func (peq *PracticalExperienceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PracticalExperienceQuery) ExistX

func (peq *PracticalExperienceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PracticalExperienceQuery) First

First returns the first PracticalExperience entity from the query. Returns a *NotFoundError when no PracticalExperience was found.

func (*PracticalExperienceQuery) FirstID

func (peq *PracticalExperienceQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PracticalExperience ID from the query. Returns a *NotFoundError when no PracticalExperience ID was found.

func (*PracticalExperienceQuery) FirstIDX

func (peq *PracticalExperienceQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PracticalExperienceQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PracticalExperienceQuery) GroupBy

func (peq *PracticalExperienceQuery) GroupBy(field string, fields ...string) *PracticalExperienceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PracticalExperience.Query().
	GroupBy(practicalexperience.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*PracticalExperienceQuery) IDs

func (peq *PracticalExperienceQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PracticalExperience IDs.

func (*PracticalExperienceQuery) IDsX

func (peq *PracticalExperienceQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PracticalExperienceQuery) Limit

Limit the number of records to be returned by this query.

func (*PracticalExperienceQuery) Offset

Offset to start from.

func (*PracticalExperienceQuery) Only

Only returns a single PracticalExperience entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PracticalExperience entity is found. Returns a *NotFoundError when no PracticalExperience entities are found.

func (*PracticalExperienceQuery) OnlyID

func (peq *PracticalExperienceQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PracticalExperience ID in the query. Returns a *NotSingularError when more than one PracticalExperience ID is found. Returns a *NotFoundError when no entities are found.

func (*PracticalExperienceQuery) OnlyIDX

func (peq *PracticalExperienceQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PracticalExperienceQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PracticalExperienceQuery) Order

Order specifies how the records should be ordered.

func (*PracticalExperienceQuery) QueryStudent

func (peq *PracticalExperienceQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*PracticalExperienceQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.PracticalExperience.Query().
	Select(practicalexperience.FieldName).
	Scan(ctx, &v)

func (*PracticalExperienceQuery) Unique

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 (*PracticalExperienceQuery) Where

Where adds a new predicate for the PracticalExperienceQuery builder.

func (*PracticalExperienceQuery) WithStudent

func (peq *PracticalExperienceQuery) WithStudent(opts ...func(*StudentQuery)) *PracticalExperienceQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type PracticalExperienceSelect

type PracticalExperienceSelect struct {
	*PracticalExperienceQuery
	// contains filtered or unexported fields
}

PracticalExperienceSelect is the builder for selecting fields of PracticalExperience entities.

func (*PracticalExperienceSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PracticalExperienceSelect) Bool

func (s *PracticalExperienceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) BoolX

func (s *PracticalExperienceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PracticalExperienceSelect) Bools

func (s *PracticalExperienceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) BoolsX

func (s *PracticalExperienceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PracticalExperienceSelect) Float64

func (s *PracticalExperienceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) Float64X

func (s *PracticalExperienceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PracticalExperienceSelect) Float64s

func (s *PracticalExperienceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) Float64sX

func (s *PracticalExperienceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PracticalExperienceSelect) Int

func (s *PracticalExperienceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) IntX

func (s *PracticalExperienceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PracticalExperienceSelect) Ints

func (s *PracticalExperienceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) IntsX

func (s *PracticalExperienceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PracticalExperienceSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*PracticalExperienceSelect) ScanX

func (s *PracticalExperienceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PracticalExperienceSelect) String

func (s *PracticalExperienceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) StringX

func (s *PracticalExperienceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PracticalExperienceSelect) Strings

func (s *PracticalExperienceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PracticalExperienceSelect) StringsX

func (s *PracticalExperienceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PracticalExperienceUpdate

type PracticalExperienceUpdate struct {
	// contains filtered or unexported fields
}

PracticalExperienceUpdate is the builder for updating PracticalExperience entities.

func (*PracticalExperienceUpdate) ClearStudent

ClearStudent clears the "student" edge to the Student entity.

func (*PracticalExperienceUpdate) Exec

Exec executes the query.

func (*PracticalExperienceUpdate) ExecX

func (peu *PracticalExperienceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PracticalExperienceUpdate) Mutation

Mutation returns the PracticalExperienceMutation object of the builder.

func (*PracticalExperienceUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*PracticalExperienceUpdate) SaveX

func (peu *PracticalExperienceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PracticalExperienceUpdate) SetDescribe

SetDescribe sets the "describe" field.

func (*PracticalExperienceUpdate) SetEndTime

SetEndTime sets the "end_time" field.

func (*PracticalExperienceUpdate) SetName

SetName sets the "name" field.

func (*PracticalExperienceUpdate) SetNillableStudentID

func (peu *PracticalExperienceUpdate) SetNillableStudentID(id *int) *PracticalExperienceUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*PracticalExperienceUpdate) SetStartTime

SetStartTime sets the "start_time" field.

func (*PracticalExperienceUpdate) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*PracticalExperienceUpdate) SetStudentID

SetStudentID sets the "student" edge to the Student entity by ID.

func (*PracticalExperienceUpdate) SetUnit

SetUnit sets the "unit" field.

func (*PracticalExperienceUpdate) Where

Where appends a list predicates to the PracticalExperienceUpdate builder.

type PracticalExperienceUpdateOne

type PracticalExperienceUpdateOne struct {
	// contains filtered or unexported fields
}

PracticalExperienceUpdateOne is the builder for updating a single PracticalExperience entity.

func (*PracticalExperienceUpdateOne) ClearStudent

ClearStudent clears the "student" edge to the Student entity.

func (*PracticalExperienceUpdateOne) Exec

Exec executes the query on the entity.

func (*PracticalExperienceUpdateOne) ExecX

func (peuo *PracticalExperienceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PracticalExperienceUpdateOne) Mutation

Mutation returns the PracticalExperienceMutation object of the builder.

func (*PracticalExperienceUpdateOne) Save

Save executes the query and returns the updated PracticalExperience entity.

func (*PracticalExperienceUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PracticalExperienceUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PracticalExperienceUpdateOne) SetDescribe

SetDescribe sets the "describe" field.

func (*PracticalExperienceUpdateOne) SetEndTime

SetEndTime sets the "end_time" field.

func (*PracticalExperienceUpdateOne) SetName

SetName sets the "name" field.

func (*PracticalExperienceUpdateOne) SetNillableStudentID

func (peuo *PracticalExperienceUpdateOne) SetNillableStudentID(id *int) *PracticalExperienceUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*PracticalExperienceUpdateOne) SetStartTime

SetStartTime sets the "start_time" field.

func (*PracticalExperienceUpdateOne) SetStudent

SetStudent sets the "student" edge to the Student entity.

func (*PracticalExperienceUpdateOne) SetStudentID

SetStudentID sets the "student" edge to the Student entity by ID.

func (*PracticalExperienceUpdateOne) SetUnit

SetUnit sets the "unit" field.

func (*PracticalExperienceUpdateOne) Where

Where appends a list predicates to the PracticalExperienceUpdate builder.

type PracticalExperiences

type PracticalExperiences []*PracticalExperience

PracticalExperiences is a parsable slice of PracticalExperience.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Resource

type Resource struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ResourceName holds the value of the "resource_name" field.
	ResourceName string `json:"resource_name,omitempty"`
	// ResourceValue holds the value of the "resource_value" field.
	ResourceValue string `json:"resource_value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ResourceQuery when eager-loading is set.
	Edges ResourceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Resource is the model entity for the Resource schema.

func (*Resource) QueryAuthorization

func (r *Resource) QueryAuthorization() *AuthorizationQuery

QueryAuthorization queries the "authorization" edge of the Resource entity.

func (*Resource) QueryRole

func (r *Resource) QueryRole() *RoleQuery

QueryRole queries the "role" edge of the Resource entity.

func (*Resource) QueryUser

func (r *Resource) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Resource entity.

func (*Resource) String

func (r *Resource) String() string

String implements the fmt.Stringer.

func (*Resource) Unwrap

func (r *Resource) Unwrap() *Resource

Unwrap unwraps the Resource 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 (*Resource) Update

func (r *Resource) Update() *ResourceUpdateOne

Update returns a builder for updating this Resource. Note that you need to call Resource.Unwrap() before calling this method if this Resource was returned from a transaction, and the transaction was committed or rolled back.

type ResourceClient

type ResourceClient struct {
	// contains filtered or unexported fields
}

ResourceClient is a client for the Resource schema.

func NewResourceClient

func NewResourceClient(c config) *ResourceClient

NewResourceClient returns a client for the Resource from the given config.

func (*ResourceClient) Create

func (c *ResourceClient) Create() *ResourceCreate

Create returns a builder for creating a Resource entity.

func (*ResourceClient) CreateBulk

func (c *ResourceClient) CreateBulk(builders ...*ResourceCreate) *ResourceCreateBulk

CreateBulk returns a builder for creating a bulk of Resource entities.

func (*ResourceClient) Delete

func (c *ResourceClient) Delete() *ResourceDelete

Delete returns a delete builder for Resource.

func (*ResourceClient) DeleteOne

func (c *ResourceClient) DeleteOne(r *Resource) *ResourceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResourceClient) DeleteOneID

func (c *ResourceClient) DeleteOneID(id int) *ResourceDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ResourceClient) Get

func (c *ResourceClient) Get(ctx context.Context, id int) (*Resource, error)

Get returns a Resource entity by its id.

func (*ResourceClient) GetX

func (c *ResourceClient) GetX(ctx context.Context, id int) *Resource

GetX is like Get, but panics if an error occurs.

func (*ResourceClient) Hooks

func (c *ResourceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ResourceClient) Intercept

func (c *ResourceClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `resource.Intercept(f(g(h())))`.

func (*ResourceClient) Interceptors

func (c *ResourceClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ResourceClient) Query

func (c *ResourceClient) Query() *ResourceQuery

Query returns a query builder for Resource.

func (*ResourceClient) QueryAuthorization

func (c *ResourceClient) QueryAuthorization(r *Resource) *AuthorizationQuery

QueryAuthorization queries the authorization edge of a Resource.

func (*ResourceClient) QueryRole

func (c *ResourceClient) QueryRole(r *Resource) *RoleQuery

QueryRole queries the role edge of a Resource.

func (*ResourceClient) QueryUser

func (c *ResourceClient) QueryUser(r *Resource) *UserQuery

QueryUser queries the user edge of a Resource.

func (*ResourceClient) Update

func (c *ResourceClient) Update() *ResourceUpdate

Update returns an update builder for Resource.

func (*ResourceClient) UpdateOne

func (c *ResourceClient) UpdateOne(r *Resource) *ResourceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResourceClient) UpdateOneID

func (c *ResourceClient) UpdateOneID(id int) *ResourceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResourceClient) Use

func (c *ResourceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `resource.Hooks(f(g(h())))`.

type ResourceCreate

type ResourceCreate struct {
	// contains filtered or unexported fields
}

ResourceCreate is the builder for creating a Resource entity.

func (*ResourceCreate) AddAuthorization

func (rc *ResourceCreate) AddAuthorization(a ...*Authorization) *ResourceCreate

AddAuthorization adds the "authorization" edges to the Authorization entity.

func (*ResourceCreate) AddAuthorizationIDs

func (rc *ResourceCreate) AddAuthorizationIDs(ids ...int) *ResourceCreate

AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by IDs.

func (*ResourceCreate) AddRole

func (rc *ResourceCreate) AddRole(r ...*Role) *ResourceCreate

AddRole adds the "role" edges to the Role entity.

func (*ResourceCreate) AddRoleIDs

func (rc *ResourceCreate) AddRoleIDs(ids ...int) *ResourceCreate

AddRoleIDs adds the "role" edge to the Role entity by IDs.

func (*ResourceCreate) AddUser

func (rc *ResourceCreate) AddUser(u ...*User) *ResourceCreate

AddUser adds the "user" edges to the User entity.

func (*ResourceCreate) AddUserIDs

func (rc *ResourceCreate) AddUserIDs(ids ...int) *ResourceCreate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*ResourceCreate) Exec

func (rc *ResourceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceCreate) ExecX

func (rc *ResourceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceCreate) Mutation

func (rc *ResourceCreate) Mutation() *ResourceMutation

Mutation returns the ResourceMutation object of the builder.

func (*ResourceCreate) Save

func (rc *ResourceCreate) Save(ctx context.Context) (*Resource, error)

Save creates the Resource in the database.

func (*ResourceCreate) SaveX

func (rc *ResourceCreate) SaveX(ctx context.Context) *Resource

SaveX calls Save and panics if Save returns an error.

func (*ResourceCreate) SetResourceName

func (rc *ResourceCreate) SetResourceName(s string) *ResourceCreate

SetResourceName sets the "resource_name" field.

func (*ResourceCreate) SetResourceValue

func (rc *ResourceCreate) SetResourceValue(s string) *ResourceCreate

SetResourceValue sets the "resource_value" field.

type ResourceCreateBulk

type ResourceCreateBulk struct {
	// contains filtered or unexported fields
}

ResourceCreateBulk is the builder for creating many Resource entities in bulk.

func (*ResourceCreateBulk) Exec

func (rcb *ResourceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceCreateBulk) ExecX

func (rcb *ResourceCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceCreateBulk) Save

func (rcb *ResourceCreateBulk) Save(ctx context.Context) ([]*Resource, error)

Save creates the Resource entities in the database.

func (*ResourceCreateBulk) SaveX

func (rcb *ResourceCreateBulk) SaveX(ctx context.Context) []*Resource

SaveX is like Save, but panics if an error occurs.

type ResourceDelete

type ResourceDelete struct {
	// contains filtered or unexported fields
}

ResourceDelete is the builder for deleting a Resource entity.

func (*ResourceDelete) Exec

func (rd *ResourceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ResourceDelete) ExecX

func (rd *ResourceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ResourceDelete) Where

func (rd *ResourceDelete) Where(ps ...predicate.Resource) *ResourceDelete

Where appends a list predicates to the ResourceDelete builder.

type ResourceDeleteOne

type ResourceDeleteOne struct {
	// contains filtered or unexported fields
}

ResourceDeleteOne is the builder for deleting a single Resource entity.

func (*ResourceDeleteOne) Exec

func (rdo *ResourceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ResourceDeleteOne) ExecX

func (rdo *ResourceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceDeleteOne) Where

Where appends a list predicates to the ResourceDelete builder.

type ResourceEdges

type ResourceEdges struct {
	// Role holds the value of the role edge.
	Role []*Role `json:"role,omitempty"`
	// User holds the value of the user edge.
	User []*User `json:"user,omitempty"`
	// Authorization holds the value of the authorization edge.
	Authorization []*Authorization `json:"authorization,omitempty"`
	// contains filtered or unexported fields
}

ResourceEdges holds the relations/edges for other nodes in the graph.

func (ResourceEdges) AuthorizationOrErr

func (e ResourceEdges) AuthorizationOrErr() ([]*Authorization, error)

AuthorizationOrErr returns the Authorization value or an error if the edge was not loaded in eager-loading.

func (ResourceEdges) RoleOrErr

func (e ResourceEdges) RoleOrErr() ([]*Role, error)

RoleOrErr returns the Role value or an error if the edge was not loaded in eager-loading.

func (ResourceEdges) UserOrErr

func (e ResourceEdges) UserOrErr() ([]*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.

type ResourceGroupBy

type ResourceGroupBy struct {
	// contains filtered or unexported fields
}

ResourceGroupBy is the group-by builder for Resource entities.

func (*ResourceGroupBy) Aggregate

func (rgb *ResourceGroupBy) Aggregate(fns ...AggregateFunc) *ResourceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ResourceGroupBy) Bool

func (s *ResourceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) BoolX

func (s *ResourceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResourceGroupBy) Bools

func (s *ResourceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) BoolsX

func (s *ResourceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResourceGroupBy) Float64

func (s *ResourceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) Float64X

func (s *ResourceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResourceGroupBy) Float64s

func (s *ResourceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) Float64sX

func (s *ResourceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResourceGroupBy) Int

func (s *ResourceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) IntX

func (s *ResourceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResourceGroupBy) Ints

func (s *ResourceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) IntsX

func (s *ResourceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResourceGroupBy) Scan

func (rgb *ResourceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResourceGroupBy) ScanX

func (s *ResourceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResourceGroupBy) String

func (s *ResourceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) StringX

func (s *ResourceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResourceGroupBy) Strings

func (s *ResourceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) StringsX

func (s *ResourceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResourceMutation

type ResourceMutation struct {
	// contains filtered or unexported fields
}

ResourceMutation represents an operation that mutates the Resource nodes in the graph.

func (*ResourceMutation) AddAuthorizationIDs

func (m *ResourceMutation) AddAuthorizationIDs(ids ...int)

AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by ids.

func (*ResourceMutation) AddField

func (m *ResourceMutation) 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 (*ResourceMutation) AddRoleIDs

func (m *ResourceMutation) AddRoleIDs(ids ...int)

AddRoleIDs adds the "role" edge to the Role entity by ids.

func (*ResourceMutation) AddUserIDs

func (m *ResourceMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "user" edge to the User entity by ids.

func (*ResourceMutation) AddedEdges

func (m *ResourceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ResourceMutation) AddedField

func (m *ResourceMutation) 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 (*ResourceMutation) AddedFields

func (m *ResourceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ResourceMutation) AddedIDs

func (m *ResourceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ResourceMutation) AuthorizationCleared

func (m *ResourceMutation) AuthorizationCleared() bool

AuthorizationCleared reports if the "authorization" edge to the Authorization entity was cleared.

func (*ResourceMutation) AuthorizationIDs

func (m *ResourceMutation) AuthorizationIDs() (ids []int)

AuthorizationIDs returns the "authorization" edge IDs in the mutation.

func (*ResourceMutation) ClearAuthorization

func (m *ResourceMutation) ClearAuthorization()

ClearAuthorization clears the "authorization" edge to the Authorization entity.

func (*ResourceMutation) ClearEdge

func (m *ResourceMutation) 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 (*ResourceMutation) ClearField

func (m *ResourceMutation) 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 (*ResourceMutation) ClearRole

func (m *ResourceMutation) ClearRole()

ClearRole clears the "role" edge to the Role entity.

func (*ResourceMutation) ClearUser

func (m *ResourceMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ResourceMutation) ClearedEdges

func (m *ResourceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ResourceMutation) ClearedFields

func (m *ResourceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ResourceMutation) Client

func (m ResourceMutation) 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 (*ResourceMutation) EdgeCleared

func (m *ResourceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ResourceMutation) Field

func (m *ResourceMutation) 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 (*ResourceMutation) FieldCleared

func (m *ResourceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ResourceMutation) Fields

func (m *ResourceMutation) 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 (*ResourceMutation) ID

func (m *ResourceMutation) 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 (*ResourceMutation) IDs

func (m *ResourceMutation) 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 (*ResourceMutation) OldField

func (m *ResourceMutation) 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 (*ResourceMutation) OldResourceName

func (m *ResourceMutation) OldResourceName(ctx context.Context) (v string, err error)

OldResourceName returns the old "resource_name" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldResourceValue

func (m *ResourceMutation) OldResourceValue(ctx context.Context) (v string, err error)

OldResourceValue returns the old "resource_value" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) Op

func (m *ResourceMutation) Op() Op

Op returns the operation name.

func (*ResourceMutation) RemoveAuthorizationIDs

func (m *ResourceMutation) RemoveAuthorizationIDs(ids ...int)

RemoveAuthorizationIDs removes the "authorization" edge to the Authorization entity by IDs.

func (*ResourceMutation) RemoveRoleIDs

func (m *ResourceMutation) RemoveRoleIDs(ids ...int)

RemoveRoleIDs removes the "role" edge to the Role entity by IDs.

func (*ResourceMutation) RemoveUserIDs

func (m *ResourceMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "user" edge to the User entity by IDs.

func (*ResourceMutation) RemovedAuthorizationIDs

func (m *ResourceMutation) RemovedAuthorizationIDs() (ids []int)

RemovedAuthorization returns the removed IDs of the "authorization" edge to the Authorization entity.

func (*ResourceMutation) RemovedEdges

func (m *ResourceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ResourceMutation) RemovedIDs

func (m *ResourceMutation) 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 (*ResourceMutation) RemovedRoleIDs

func (m *ResourceMutation) RemovedRoleIDs() (ids []int)

RemovedRole returns the removed IDs of the "role" edge to the Role entity.

func (*ResourceMutation) RemovedUserIDs

func (m *ResourceMutation) RemovedUserIDs() (ids []int)

RemovedUser returns the removed IDs of the "user" edge to the User entity.

func (*ResourceMutation) ResetAuthorization

func (m *ResourceMutation) ResetAuthorization()

ResetAuthorization resets all changes to the "authorization" edge.

func (*ResourceMutation) ResetEdge

func (m *ResourceMutation) 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 (*ResourceMutation) ResetField

func (m *ResourceMutation) 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 (*ResourceMutation) ResetResourceName

func (m *ResourceMutation) ResetResourceName()

ResetResourceName resets all changes to the "resource_name" field.

func (*ResourceMutation) ResetResourceValue

func (m *ResourceMutation) ResetResourceValue()

ResetResourceValue resets all changes to the "resource_value" field.

func (*ResourceMutation) ResetRole

func (m *ResourceMutation) ResetRole()

ResetRole resets all changes to the "role" edge.

func (*ResourceMutation) ResetUser

func (m *ResourceMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ResourceMutation) ResourceName

func (m *ResourceMutation) ResourceName() (r string, exists bool)

ResourceName returns the value of the "resource_name" field in the mutation.

func (*ResourceMutation) ResourceValue

func (m *ResourceMutation) ResourceValue() (r string, exists bool)

ResourceValue returns the value of the "resource_value" field in the mutation.

func (*ResourceMutation) RoleCleared

func (m *ResourceMutation) RoleCleared() bool

RoleCleared reports if the "role" edge to the Role entity was cleared.

func (*ResourceMutation) RoleIDs

func (m *ResourceMutation) RoleIDs() (ids []int)

RoleIDs returns the "role" edge IDs in the mutation.

func (*ResourceMutation) SetField

func (m *ResourceMutation) 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 (*ResourceMutation) SetOp

func (m *ResourceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ResourceMutation) SetResourceName

func (m *ResourceMutation) SetResourceName(s string)

SetResourceName sets the "resource_name" field.

func (*ResourceMutation) SetResourceValue

func (m *ResourceMutation) SetResourceValue(s string)

SetResourceValue sets the "resource_value" field.

func (ResourceMutation) Tx

func (m ResourceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ResourceMutation) Type

func (m *ResourceMutation) Type() string

Type returns the node type of this mutation (Resource).

func (*ResourceMutation) UserCleared

func (m *ResourceMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ResourceMutation) UserIDs

func (m *ResourceMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation.

func (*ResourceMutation) Where

func (m *ResourceMutation) Where(ps ...predicate.Resource)

Where appends a list predicates to the ResourceMutation builder.

func (*ResourceMutation) WhereP

func (m *ResourceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ResourceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ResourceQuery

type ResourceQuery struct {
	// contains filtered or unexported fields
}

ResourceQuery is the builder for querying Resource entities.

func (*ResourceQuery) Aggregate

func (rq *ResourceQuery) Aggregate(fns ...AggregateFunc) *ResourceSelect

Aggregate returns a ResourceSelect configured with the given aggregations.

func (*ResourceQuery) All

func (rq *ResourceQuery) All(ctx context.Context) ([]*Resource, error)

All executes the query and returns a list of Resources.

func (*ResourceQuery) AllX

func (rq *ResourceQuery) AllX(ctx context.Context) []*Resource

AllX is like All, but panics if an error occurs.

func (*ResourceQuery) Clone

func (rq *ResourceQuery) Clone() *ResourceQuery

Clone returns a duplicate of the ResourceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ResourceQuery) Count

func (rq *ResourceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResourceQuery) CountX

func (rq *ResourceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ResourceQuery) Exist

func (rq *ResourceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ResourceQuery) ExistX

func (rq *ResourceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ResourceQuery) First

func (rq *ResourceQuery) First(ctx context.Context) (*Resource, error)

First returns the first Resource entity from the query. Returns a *NotFoundError when no Resource was found.

func (*ResourceQuery) FirstID

func (rq *ResourceQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Resource ID from the query. Returns a *NotFoundError when no Resource ID was found.

func (*ResourceQuery) FirstIDX

func (rq *ResourceQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ResourceQuery) FirstX

func (rq *ResourceQuery) FirstX(ctx context.Context) *Resource

FirstX is like First, but panics if an error occurs.

func (*ResourceQuery) GroupBy

func (rq *ResourceQuery) GroupBy(field string, fields ...string) *ResourceGroupBy

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 {
	ResourceName string `json:"resource_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Resource.Query().
	GroupBy(resource.FieldResourceName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*ResourceQuery) IDs

func (rq *ResourceQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Resource IDs.

func (*ResourceQuery) IDsX

func (rq *ResourceQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ResourceQuery) Limit

func (rq *ResourceQuery) Limit(limit int) *ResourceQuery

Limit the number of records to be returned by this query.

func (*ResourceQuery) Offset

func (rq *ResourceQuery) Offset(offset int) *ResourceQuery

Offset to start from.

func (*ResourceQuery) Only

func (rq *ResourceQuery) Only(ctx context.Context) (*Resource, error)

Only returns a single Resource entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Resource entity is found. Returns a *NotFoundError when no Resource entities are found.

func (*ResourceQuery) OnlyID

func (rq *ResourceQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Resource ID in the query. Returns a *NotSingularError when more than one Resource ID is found. Returns a *NotFoundError when no entities are found.

func (*ResourceQuery) OnlyIDX

func (rq *ResourceQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ResourceQuery) OnlyX

func (rq *ResourceQuery) OnlyX(ctx context.Context) *Resource

OnlyX is like Only, but panics if an error occurs.

func (*ResourceQuery) Order

func (rq *ResourceQuery) Order(o ...OrderFunc) *ResourceQuery

Order specifies how the records should be ordered.

func (*ResourceQuery) QueryAuthorization

func (rq *ResourceQuery) QueryAuthorization() *AuthorizationQuery

QueryAuthorization chains the current query on the "authorization" edge.

func (*ResourceQuery) QueryRole

func (rq *ResourceQuery) QueryRole() *RoleQuery

QueryRole chains the current query on the "role" edge.

func (*ResourceQuery) QueryUser

func (rq *ResourceQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ResourceQuery) Select

func (rq *ResourceQuery) Select(fields ...string) *ResourceSelect

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 {
	ResourceName string `json:"resource_name,omitempty"`
}

client.Resource.Query().
	Select(resource.FieldResourceName).
	Scan(ctx, &v)

func (*ResourceQuery) Unique

func (rq *ResourceQuery) Unique(unique bool) *ResourceQuery

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 (*ResourceQuery) Where

func (rq *ResourceQuery) Where(ps ...predicate.Resource) *ResourceQuery

Where adds a new predicate for the ResourceQuery builder.

func (*ResourceQuery) WithAuthorization

func (rq *ResourceQuery) WithAuthorization(opts ...func(*AuthorizationQuery)) *ResourceQuery

WithAuthorization tells the query-builder to eager-load the nodes that are connected to the "authorization" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResourceQuery) WithRole

func (rq *ResourceQuery) WithRole(opts ...func(*RoleQuery)) *ResourceQuery

WithRole tells the query-builder to eager-load the nodes that are connected to the "role" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResourceQuery) WithUser

func (rq *ResourceQuery) WithUser(opts ...func(*UserQuery)) *ResourceQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type ResourceSelect

type ResourceSelect struct {
	*ResourceQuery
	// contains filtered or unexported fields
}

ResourceSelect is the builder for selecting fields of Resource entities.

func (*ResourceSelect) Aggregate

func (rs *ResourceSelect) Aggregate(fns ...AggregateFunc) *ResourceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ResourceSelect) Bool

func (s *ResourceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) BoolX

func (s *ResourceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResourceSelect) Bools

func (s *ResourceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) BoolsX

func (s *ResourceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResourceSelect) Float64

func (s *ResourceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) Float64X

func (s *ResourceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResourceSelect) Float64s

func (s *ResourceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) Float64sX

func (s *ResourceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResourceSelect) Int

func (s *ResourceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) IntX

func (s *ResourceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResourceSelect) Ints

func (s *ResourceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) IntsX

func (s *ResourceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResourceSelect) Scan

func (rs *ResourceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResourceSelect) ScanX

func (s *ResourceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResourceSelect) String

func (s *ResourceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) StringX

func (s *ResourceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResourceSelect) Strings

func (s *ResourceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) StringsX

func (s *ResourceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResourceUpdate

type ResourceUpdate struct {
	// contains filtered or unexported fields
}

ResourceUpdate is the builder for updating Resource entities.

func (*ResourceUpdate) AddAuthorization

func (ru *ResourceUpdate) AddAuthorization(a ...*Authorization) *ResourceUpdate

AddAuthorization adds the "authorization" edges to the Authorization entity.

func (*ResourceUpdate) AddAuthorizationIDs

func (ru *ResourceUpdate) AddAuthorizationIDs(ids ...int) *ResourceUpdate

AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by IDs.

func (*ResourceUpdate) AddRole

func (ru *ResourceUpdate) AddRole(r ...*Role) *ResourceUpdate

AddRole adds the "role" edges to the Role entity.

func (*ResourceUpdate) AddRoleIDs

func (ru *ResourceUpdate) AddRoleIDs(ids ...int) *ResourceUpdate

AddRoleIDs adds the "role" edge to the Role entity by IDs.

func (*ResourceUpdate) AddUser

func (ru *ResourceUpdate) AddUser(u ...*User) *ResourceUpdate

AddUser adds the "user" edges to the User entity.

func (*ResourceUpdate) AddUserIDs

func (ru *ResourceUpdate) AddUserIDs(ids ...int) *ResourceUpdate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*ResourceUpdate) ClearAuthorization

func (ru *ResourceUpdate) ClearAuthorization() *ResourceUpdate

ClearAuthorization clears all "authorization" edges to the Authorization entity.

func (*ResourceUpdate) ClearRole

func (ru *ResourceUpdate) ClearRole() *ResourceUpdate

ClearRole clears all "role" edges to the Role entity.

func (*ResourceUpdate) ClearUser

func (ru *ResourceUpdate) ClearUser() *ResourceUpdate

ClearUser clears all "user" edges to the User entity.

func (*ResourceUpdate) Exec

func (ru *ResourceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceUpdate) ExecX

func (ru *ResourceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceUpdate) Mutation

func (ru *ResourceUpdate) Mutation() *ResourceMutation

Mutation returns the ResourceMutation object of the builder.

func (*ResourceUpdate) RemoveAuthorization

func (ru *ResourceUpdate) RemoveAuthorization(a ...*Authorization) *ResourceUpdate

RemoveAuthorization removes "authorization" edges to Authorization entities.

func (*ResourceUpdate) RemoveAuthorizationIDs

func (ru *ResourceUpdate) RemoveAuthorizationIDs(ids ...int) *ResourceUpdate

RemoveAuthorizationIDs removes the "authorization" edge to Authorization entities by IDs.

func (*ResourceUpdate) RemoveRole

func (ru *ResourceUpdate) RemoveRole(r ...*Role) *ResourceUpdate

RemoveRole removes "role" edges to Role entities.

func (*ResourceUpdate) RemoveRoleIDs

func (ru *ResourceUpdate) RemoveRoleIDs(ids ...int) *ResourceUpdate

RemoveRoleIDs removes the "role" edge to Role entities by IDs.

func (*ResourceUpdate) RemoveUser

func (ru *ResourceUpdate) RemoveUser(u ...*User) *ResourceUpdate

RemoveUser removes "user" edges to User entities.

func (*ResourceUpdate) RemoveUserIDs

func (ru *ResourceUpdate) RemoveUserIDs(ids ...int) *ResourceUpdate

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*ResourceUpdate) Save

func (ru *ResourceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ResourceUpdate) SaveX

func (ru *ResourceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ResourceUpdate) SetResourceName

func (ru *ResourceUpdate) SetResourceName(s string) *ResourceUpdate

SetResourceName sets the "resource_name" field.

func (*ResourceUpdate) SetResourceValue

func (ru *ResourceUpdate) SetResourceValue(s string) *ResourceUpdate

SetResourceValue sets the "resource_value" field.

func (*ResourceUpdate) Where

func (ru *ResourceUpdate) Where(ps ...predicate.Resource) *ResourceUpdate

Where appends a list predicates to the ResourceUpdate builder.

type ResourceUpdateOne

type ResourceUpdateOne struct {
	// contains filtered or unexported fields
}

ResourceUpdateOne is the builder for updating a single Resource entity.

func (*ResourceUpdateOne) AddAuthorization

func (ruo *ResourceUpdateOne) AddAuthorization(a ...*Authorization) *ResourceUpdateOne

AddAuthorization adds the "authorization" edges to the Authorization entity.

func (*ResourceUpdateOne) AddAuthorizationIDs

func (ruo *ResourceUpdateOne) AddAuthorizationIDs(ids ...int) *ResourceUpdateOne

AddAuthorizationIDs adds the "authorization" edge to the Authorization entity by IDs.

func (*ResourceUpdateOne) AddRole

func (ruo *ResourceUpdateOne) AddRole(r ...*Role) *ResourceUpdateOne

AddRole adds the "role" edges to the Role entity.

func (*ResourceUpdateOne) AddRoleIDs

func (ruo *ResourceUpdateOne) AddRoleIDs(ids ...int) *ResourceUpdateOne

AddRoleIDs adds the "role" edge to the Role entity by IDs.

func (*ResourceUpdateOne) AddUser

func (ruo *ResourceUpdateOne) AddUser(u ...*User) *ResourceUpdateOne

AddUser adds the "user" edges to the User entity.

func (*ResourceUpdateOne) AddUserIDs

func (ruo *ResourceUpdateOne) AddUserIDs(ids ...int) *ResourceUpdateOne

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*ResourceUpdateOne) ClearAuthorization

func (ruo *ResourceUpdateOne) ClearAuthorization() *ResourceUpdateOne

ClearAuthorization clears all "authorization" edges to the Authorization entity.

func (*ResourceUpdateOne) ClearRole

func (ruo *ResourceUpdateOne) ClearRole() *ResourceUpdateOne

ClearRole clears all "role" edges to the Role entity.

func (*ResourceUpdateOne) ClearUser

func (ruo *ResourceUpdateOne) ClearUser() *ResourceUpdateOne

ClearUser clears all "user" edges to the User entity.

func (*ResourceUpdateOne) Exec

func (ruo *ResourceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResourceUpdateOne) ExecX

func (ruo *ResourceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceUpdateOne) Mutation

func (ruo *ResourceUpdateOne) Mutation() *ResourceMutation

Mutation returns the ResourceMutation object of the builder.

func (*ResourceUpdateOne) RemoveAuthorization

func (ruo *ResourceUpdateOne) RemoveAuthorization(a ...*Authorization) *ResourceUpdateOne

RemoveAuthorization removes "authorization" edges to Authorization entities.

func (*ResourceUpdateOne) RemoveAuthorizationIDs

func (ruo *ResourceUpdateOne) RemoveAuthorizationIDs(ids ...int) *ResourceUpdateOne

RemoveAuthorizationIDs removes the "authorization" edge to Authorization entities by IDs.

func (*ResourceUpdateOne) RemoveRole

func (ruo *ResourceUpdateOne) RemoveRole(r ...*Role) *ResourceUpdateOne

RemoveRole removes "role" edges to Role entities.

func (*ResourceUpdateOne) RemoveRoleIDs

func (ruo *ResourceUpdateOne) RemoveRoleIDs(ids ...int) *ResourceUpdateOne

RemoveRoleIDs removes the "role" edge to Role entities by IDs.

func (*ResourceUpdateOne) RemoveUser

func (ruo *ResourceUpdateOne) RemoveUser(u ...*User) *ResourceUpdateOne

RemoveUser removes "user" edges to User entities.

func (*ResourceUpdateOne) RemoveUserIDs

func (ruo *ResourceUpdateOne) RemoveUserIDs(ids ...int) *ResourceUpdateOne

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*ResourceUpdateOne) Save

func (ruo *ResourceUpdateOne) Save(ctx context.Context) (*Resource, error)

Save executes the query and returns the updated Resource entity.

func (*ResourceUpdateOne) SaveX

func (ruo *ResourceUpdateOne) SaveX(ctx context.Context) *Resource

SaveX is like Save, but panics if an error occurs.

func (*ResourceUpdateOne) Select

func (ruo *ResourceUpdateOne) Select(field string, fields ...string) *ResourceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ResourceUpdateOne) SetResourceName

func (ruo *ResourceUpdateOne) SetResourceName(s string) *ResourceUpdateOne

SetResourceName sets the "resource_name" field.

func (*ResourceUpdateOne) SetResourceValue

func (ruo *ResourceUpdateOne) SetResourceValue(s string) *ResourceUpdateOne

SetResourceValue sets the "resource_value" field.

func (*ResourceUpdateOne) Where

Where appends a list predicates to the ResourceUpdate builder.

type Resources

type Resources []*Resource

Resources is a parsable slice of Resource.

type Role

type Role struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// RoleName holds the value of the "role_name" field.
	RoleName string `json:"role_name,omitempty"`
	// RoleValue holds the value of the "role_value" field.
	RoleValue string `json:"role_value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleQuery when eager-loading is set.
	Edges RoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) QueryResource

func (r *Role) QueryResource() *ResourceQuery

QueryResource queries the "resource" edge of the Role entity.

func (*Role) QueryUser

func (r *Role) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Role entity.

func (*Role) String

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) Unwrap

func (r *Role) Unwrap() *Role

Unwrap unwraps the Role 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 (*Role) Update

func (r *Role) Update() *RoleUpdateOne

Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.

type RoleClient

type RoleClient struct {
	// contains filtered or unexported fields
}

RoleClient is a client for the Role schema.

func NewRoleClient

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create

func (c *RoleClient) Create() *RoleCreate

Create returns a builder for creating a Role entity.

func (*RoleClient) CreateBulk

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

CreateBulk returns a builder for creating a bulk of Role entities.

func (*RoleClient) Delete

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleClient) DeleteOneID

func (c *RoleClient) DeleteOneID(id int) *RoleDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id int) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id int) *Role

GetX is like Get, but panics if an error occurs.

func (*RoleClient) Hooks

func (c *RoleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoleClient) Intercept

func (c *RoleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`.

func (*RoleClient) Interceptors

func (c *RoleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RoleClient) Query

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) QueryResource

func (c *RoleClient) QueryResource(r *Role) *ResourceQuery

QueryResource queries the resource edge of a Role.

func (*RoleClient) QueryUser

func (c *RoleClient) QueryUser(r *Role) *UserQuery

QueryUser queries the user edge of a Role.

func (*RoleClient) Update

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID

func (c *RoleClient) UpdateOneID(id int) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use

func (c *RoleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`.

type RoleCreate

type RoleCreate struct {
	// contains filtered or unexported fields
}

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) AddResource

func (rc *RoleCreate) AddResource(r ...*Resource) *RoleCreate

AddResource adds the "resource" edges to the Resource entity.

func (*RoleCreate) AddResourceIDs

func (rc *RoleCreate) AddResourceIDs(ids ...int) *RoleCreate

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*RoleCreate) AddUser

func (rc *RoleCreate) AddUser(u ...*User) *RoleCreate

AddUser adds the "user" edges to the User entity.

func (*RoleCreate) AddUserIDs

func (rc *RoleCreate) AddUserIDs(ids ...int) *RoleCreate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*RoleCreate) Exec

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecX

func (rc *RoleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreate) Mutation

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) Save

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

func (*RoleCreate) SetRoleName

func (rc *RoleCreate) SetRoleName(s string) *RoleCreate

SetRoleName sets the "role_name" field.

func (*RoleCreate) SetRoleValue

func (rc *RoleCreate) SetRoleValue(s string) *RoleCreate

SetRoleValue sets the "role_value" field.

type RoleCreateBulk

type RoleCreateBulk struct {
	// contains filtered or unexported fields
}

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreateBulk) Save

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

SaveX is like Save, but panics if an error occurs.

type RoleDelete

type RoleDelete struct {
	// contains filtered or unexported fields
}

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoleDelete) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoleDelete) Where

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne

type RoleDeleteOne struct {
	// contains filtered or unexported fields
}

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleDeleteOne) Where

func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne

Where appends a list predicates to the RoleDelete builder.

type RoleEdges

type RoleEdges struct {
	// Resource holds the value of the resource edge.
	Resource []*Resource `json:"resource,omitempty"`
	// User holds the value of the user edge.
	User []*User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

RoleEdges holds the relations/edges for other nodes in the graph.

func (RoleEdges) ResourceOrErr

func (e RoleEdges) ResourceOrErr() ([]*Resource, error)

ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading.

func (RoleEdges) UserOrErr

func (e RoleEdges) UserOrErr() ([]*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading.

type RoleGroupBy

type RoleGroupBy struct {
	// contains filtered or unexported fields
}

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoleGroupBy) Bool

func (s *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolX

func (s *RoleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleGroupBy) Bools

func (s *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolsX

func (s *RoleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleGroupBy) Float64

func (s *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64X

func (s *RoleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleGroupBy) Float64s

func (s *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64sX

func (s *RoleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleGroupBy) Int

func (s *RoleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntX

func (s *RoleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleGroupBy) Ints

func (s *RoleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntsX

func (s *RoleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleGroupBy) Scan

func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleGroupBy) ScanX

func (s *RoleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleGroupBy) String

func (s *RoleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringX

func (s *RoleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleGroupBy) Strings

func (s *RoleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringsX

func (s *RoleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleMutation

type RoleMutation struct {
	// contains filtered or unexported fields
}

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddField

func (m *RoleMutation) 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 (*RoleMutation) AddResourceIDs

func (m *RoleMutation) AddResourceIDs(ids ...int)

AddResourceIDs adds the "resource" edge to the Resource entity by ids.

func (*RoleMutation) AddUserIDs

func (m *RoleMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "user" edge to the User entity by ids.

func (*RoleMutation) AddedEdges

func (m *RoleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoleMutation) AddedField

func (m *RoleMutation) 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 (*RoleMutation) AddedFields

func (m *RoleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoleMutation) AddedIDs

func (m *RoleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoleMutation) ClearEdge

func (m *RoleMutation) 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 (*RoleMutation) ClearField

func (m *RoleMutation) 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 (*RoleMutation) ClearResource

func (m *RoleMutation) ClearResource()

ClearResource clears the "resource" edge to the Resource entity.

func (*RoleMutation) ClearUser

func (m *RoleMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*RoleMutation) ClearedEdges

func (m *RoleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoleMutation) ClearedFields

func (m *RoleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoleMutation) Client

func (m RoleMutation) 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 (*RoleMutation) EdgeCleared

func (m *RoleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoleMutation) Field

func (m *RoleMutation) 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 (*RoleMutation) FieldCleared

func (m *RoleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoleMutation) Fields

func (m *RoleMutation) 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 (*RoleMutation) ID

func (m *RoleMutation) 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 (*RoleMutation) IDs

func (m *RoleMutation) 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 (*RoleMutation) OldField

func (m *RoleMutation) 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 (*RoleMutation) OldRoleName

func (m *RoleMutation) OldRoleName(ctx context.Context) (v string, err error)

OldRoleName returns the old "role_name" field's value of the Role entity. If the Role 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 (*RoleMutation) OldRoleValue

func (m *RoleMutation) OldRoleValue(ctx context.Context) (v string, err error)

OldRoleValue returns the old "role_value" field's value of the Role entity. If the Role 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 (*RoleMutation) Op

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) RemoveResourceIDs

func (m *RoleMutation) RemoveResourceIDs(ids ...int)

RemoveResourceIDs removes the "resource" edge to the Resource entity by IDs.

func (*RoleMutation) RemoveUserIDs

func (m *RoleMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "user" edge to the User entity by IDs.

func (*RoleMutation) RemovedEdges

func (m *RoleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoleMutation) RemovedIDs

func (m *RoleMutation) 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 (*RoleMutation) RemovedResourceIDs

func (m *RoleMutation) RemovedResourceIDs() (ids []int)

RemovedResource returns the removed IDs of the "resource" edge to the Resource entity.

func (*RoleMutation) RemovedUserIDs

func (m *RoleMutation) RemovedUserIDs() (ids []int)

RemovedUser returns the removed IDs of the "user" edge to the User entity.

func (*RoleMutation) ResetEdge

func (m *RoleMutation) 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 (*RoleMutation) ResetField

func (m *RoleMutation) 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 (*RoleMutation) ResetResource

func (m *RoleMutation) ResetResource()

ResetResource resets all changes to the "resource" edge.

func (*RoleMutation) ResetRoleName

func (m *RoleMutation) ResetRoleName()

ResetRoleName resets all changes to the "role_name" field.

func (*RoleMutation) ResetRoleValue

func (m *RoleMutation) ResetRoleValue()

ResetRoleValue resets all changes to the "role_value" field.

func (*RoleMutation) ResetUser

func (m *RoleMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*RoleMutation) ResourceCleared

func (m *RoleMutation) ResourceCleared() bool

ResourceCleared reports if the "resource" edge to the Resource entity was cleared.

func (*RoleMutation) ResourceIDs

func (m *RoleMutation) ResourceIDs() (ids []int)

ResourceIDs returns the "resource" edge IDs in the mutation.

func (*RoleMutation) RoleName

func (m *RoleMutation) RoleName() (r string, exists bool)

RoleName returns the value of the "role_name" field in the mutation.

func (*RoleMutation) RoleValue

func (m *RoleMutation) RoleValue() (r string, exists bool)

RoleValue returns the value of the "role_value" field in the mutation.

func (*RoleMutation) SetField

func (m *RoleMutation) 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 (*RoleMutation) SetOp

func (m *RoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RoleMutation) SetRoleName

func (m *RoleMutation) SetRoleName(s string)

SetRoleName sets the "role_name" field.

func (*RoleMutation) SetRoleValue

func (m *RoleMutation) SetRoleValue(s string)

SetRoleValue sets the "role_value" field.

func (RoleMutation) Tx

func (m RoleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoleMutation) Type

func (m *RoleMutation) Type() string

Type returns the node type of this mutation (Role).

func (*RoleMutation) UserCleared

func (m *RoleMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*RoleMutation) UserIDs

func (m *RoleMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation.

func (*RoleMutation) Where

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

func (*RoleMutation) WhereP

func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RoleQuery

type RoleQuery struct {
	// contains filtered or unexported fields
}

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) Aggregate

func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate returns a RoleSelect configured with the given aggregations.

func (*RoleQuery) All

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

AllX is like All, but panics if an error occurs.

func (*RoleQuery) Clone

func (rq *RoleQuery) Clone() *RoleQuery

Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoleQuery) Count

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX

func (rq *RoleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoleQuery) Exist

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoleQuery) ExistX

func (rq *RoleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoleQuery) First

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.

func (*RoleQuery) FirstID

func (rq *RoleQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.

func (*RoleQuery) FirstIDX

func (rq *RoleQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoleQuery) FirstX

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

FirstX is like First, but panics if an error occurs.

func (*RoleQuery) GroupBy

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

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 {
	RoleName string `json:"role_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Role.Query().
	GroupBy(role.FieldRoleName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*RoleQuery) IDs

func (rq *RoleQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Role IDs.

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RoleQuery) Limit

func (rq *RoleQuery) Limit(limit int) *RoleQuery

Limit the number of records to be returned by this query.

func (*RoleQuery) Offset

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset to start from.

func (*RoleQuery) Only

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.

func (*RoleQuery) OnlyID

func (rq *RoleQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.

func (*RoleQuery) OnlyIDX

func (rq *RoleQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoleQuery) OnlyX

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

OnlyX is like Only, but panics if an error occurs.

func (*RoleQuery) Order

func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery

Order specifies how the records should be ordered.

func (*RoleQuery) QueryResource

func (rq *RoleQuery) QueryResource() *ResourceQuery

QueryResource chains the current query on the "resource" edge.

func (*RoleQuery) QueryUser

func (rq *RoleQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*RoleQuery) Select

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

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 {
	RoleName string `json:"role_name,omitempty"`
}

client.Role.Query().
	Select(role.FieldRoleName).
	Scan(ctx, &v)

func (*RoleQuery) Unique

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

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 (*RoleQuery) Where

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

func (*RoleQuery) WithResource

func (rq *RoleQuery) WithResource(opts ...func(*ResourceQuery)) *RoleQuery

WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoleQuery) WithUser

func (rq *RoleQuery) WithUser(opts ...func(*UserQuery)) *RoleQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type RoleSelect

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Aggregate

func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleSelect) Bool

func (s *RoleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolX

func (s *RoleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleSelect) Bools

func (s *RoleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolsX

func (s *RoleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleSelect) Float64

func (s *RoleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64X

func (s *RoleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleSelect) Float64s

func (s *RoleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64sX

func (s *RoleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleSelect) Int

func (s *RoleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntX

func (s *RoleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleSelect) Ints

func (s *RoleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntsX

func (s *RoleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleSelect) Scan

func (rs *RoleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleSelect) ScanX

func (s *RoleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleSelect) String

func (s *RoleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringX

func (s *RoleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleSelect) Strings

func (s *RoleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringsX

func (s *RoleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleUpdate

type RoleUpdate struct {
	// contains filtered or unexported fields
}

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) AddResource

func (ru *RoleUpdate) AddResource(r ...*Resource) *RoleUpdate

AddResource adds the "resource" edges to the Resource entity.

func (*RoleUpdate) AddResourceIDs

func (ru *RoleUpdate) AddResourceIDs(ids ...int) *RoleUpdate

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*RoleUpdate) AddUser

func (ru *RoleUpdate) AddUser(u ...*User) *RoleUpdate

AddUser adds the "user" edges to the User entity.

func (*RoleUpdate) AddUserIDs

func (ru *RoleUpdate) AddUserIDs(ids ...int) *RoleUpdate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*RoleUpdate) ClearResource

func (ru *RoleUpdate) ClearResource() *RoleUpdate

ClearResource clears all "resource" edges to the Resource entity.

func (*RoleUpdate) ClearUser

func (ru *RoleUpdate) ClearUser() *RoleUpdate

ClearUser clears all "user" edges to the User entity.

func (*RoleUpdate) Exec

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) RemoveResource

func (ru *RoleUpdate) RemoveResource(r ...*Resource) *RoleUpdate

RemoveResource removes "resource" edges to Resource entities.

func (*RoleUpdate) RemoveResourceIDs

func (ru *RoleUpdate) RemoveResourceIDs(ids ...int) *RoleUpdate

RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.

func (*RoleUpdate) RemoveUser

func (ru *RoleUpdate) RemoveUser(u ...*User) *RoleUpdate

RemoveUser removes "user" edges to User entities.

func (*RoleUpdate) RemoveUserIDs

func (ru *RoleUpdate) RemoveUserIDs(ids ...int) *RoleUpdate

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*RoleUpdate) Save

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoleUpdate) SaveX

func (ru *RoleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdate) SetRoleName

func (ru *RoleUpdate) SetRoleName(s string) *RoleUpdate

SetRoleName sets the "role_name" field.

func (*RoleUpdate) SetRoleValue

func (ru *RoleUpdate) SetRoleValue(s string) *RoleUpdate

SetRoleValue sets the "role_value" field.

func (*RoleUpdate) Where

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne

type RoleUpdateOne struct {
	// contains filtered or unexported fields
}

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) AddResource

func (ruo *RoleUpdateOne) AddResource(r ...*Resource) *RoleUpdateOne

AddResource adds the "resource" edges to the Resource entity.

func (*RoleUpdateOne) AddResourceIDs

func (ruo *RoleUpdateOne) AddResourceIDs(ids ...int) *RoleUpdateOne

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*RoleUpdateOne) AddUser

func (ruo *RoleUpdateOne) AddUser(u ...*User) *RoleUpdateOne

AddUser adds the "user" edges to the User entity.

func (*RoleUpdateOne) AddUserIDs

func (ruo *RoleUpdateOne) AddUserIDs(ids ...int) *RoleUpdateOne

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*RoleUpdateOne) ClearResource

func (ruo *RoleUpdateOne) ClearResource() *RoleUpdateOne

ClearResource clears all "resource" edges to the Resource entity.

func (*RoleUpdateOne) ClearUser

func (ruo *RoleUpdateOne) ClearUser() *RoleUpdateOne

ClearUser clears all "user" edges to the User entity.

func (*RoleUpdateOne) Exec

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) RemoveResource

func (ruo *RoleUpdateOne) RemoveResource(r ...*Resource) *RoleUpdateOne

RemoveResource removes "resource" edges to Resource entities.

func (*RoleUpdateOne) RemoveResourceIDs

func (ruo *RoleUpdateOne) RemoveResourceIDs(ids ...int) *RoleUpdateOne

RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.

func (*RoleUpdateOne) RemoveUser

func (ruo *RoleUpdateOne) RemoveUser(u ...*User) *RoleUpdateOne

RemoveUser removes "user" edges to User entities.

func (*RoleUpdateOne) RemoveUserIDs

func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...int) *RoleUpdateOne

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*RoleUpdateOne) Save

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdateOne) Select

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoleUpdateOne) SetRoleName

func (ruo *RoleUpdateOne) SetRoleName(s string) *RoleUpdateOne

SetRoleName sets the "role_name" field.

func (*RoleUpdateOne) SetRoleValue

func (ruo *RoleUpdateOne) SetRoleValue(s string) *RoleUpdateOne

SetRoleValue sets the "role_value" field.

func (*RoleUpdateOne) Where

func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne

Where appends a list predicates to the RoleUpdate builder.

type Roles

type Roles []*Role

Roles is a parsable slice of Role.

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 Student

type Student struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 姓名
	Name string `json:"name,omitempty"`
	// 年龄
	Age int `json:"age,omitempty"`
	// 性别
	Sex string `json:"sex,omitempty"`
	// 学号
	Code string `json:"code,omitempty"`
	// 头像
	Avatar []byte `json:"avatar,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the StudentQuery when eager-loading is set.
	Edges StudentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Student is the model entity for the Student schema.

func (*Student) QueryCertificate

func (s *Student) QueryCertificate() *CertificateQuery

QueryCertificate queries the "certificate" edge of the Student entity.

func (*Student) QueryClass

func (s *Student) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the Student entity.

func (*Student) QueryClassLeader

func (s *Student) QueryClassLeader() *ClassLeaderQuery

QueryClassLeader queries the "class_leader" edge of the Student entity.

func (*Student) QueryDepartment

func (s *Student) QueryDepartment() *DepartmentQuery

QueryDepartment queries the "department" edge of the Student entity.

func (*Student) QueryEducationLevel

func (s *Student) QueryEducationLevel() *EducationLevelQuery

QueryEducationLevel queries the "education_level" edge of the Student entity.

func (*Student) QueryEnrollmentStatus

func (s *Student) QueryEnrollmentStatus() *EnrollmentStatusQuery

QueryEnrollmentStatus queries the "enrollment_status" edge of the Student entity.

func (*Student) QueryFamilyInfo

func (s *Student) QueryFamilyInfo() *FamilyInfoQuery

QueryFamilyInfo queries the "family_info" edge of the Student entity.

func (*Student) QueryMajor

func (s *Student) QueryMajor() *MajorQuery

QueryMajor queries the "major" edge of the Student entity.

func (*Student) QueryPracticalExperience

func (s *Student) QueryPracticalExperience() *PracticalExperienceQuery

QueryPracticalExperience queries the "practical_experience" edge of the Student entity.

func (*Student) QueryTutor

func (s *Student) QueryTutor() *TutorQuery

QueryTutor queries the "tutor" edge of the Student entity.

func (*Student) QueryUser

func (s *Student) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Student entity.

func (*Student) String

func (s *Student) String() string

String implements the fmt.Stringer.

func (*Student) Unwrap

func (s *Student) Unwrap() *Student

Unwrap unwraps the Student 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 (*Student) Update

func (s *Student) Update() *StudentUpdateOne

Update returns a builder for updating this Student. Note that you need to call Student.Unwrap() before calling this method if this Student was returned from a transaction, and the transaction was committed or rolled back.

type StudentClient

type StudentClient struct {
	// contains filtered or unexported fields
}

StudentClient is a client for the Student schema.

func NewStudentClient

func NewStudentClient(c config) *StudentClient

NewStudentClient returns a client for the Student from the given config.

func (*StudentClient) Create

func (c *StudentClient) Create() *StudentCreate

Create returns a builder for creating a Student entity.

func (*StudentClient) CreateBulk

func (c *StudentClient) CreateBulk(builders ...*StudentCreate) *StudentCreateBulk

CreateBulk returns a builder for creating a bulk of Student entities.

func (*StudentClient) Delete

func (c *StudentClient) Delete() *StudentDelete

Delete returns a delete builder for Student.

func (*StudentClient) DeleteOne

func (c *StudentClient) DeleteOne(s *Student) *StudentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StudentClient) DeleteOneID

func (c *StudentClient) DeleteOneID(id int) *StudentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*StudentClient) Get

func (c *StudentClient) Get(ctx context.Context, id int) (*Student, error)

Get returns a Student entity by its id.

func (*StudentClient) GetX

func (c *StudentClient) GetX(ctx context.Context, id int) *Student

GetX is like Get, but panics if an error occurs.

func (*StudentClient) Hooks

func (c *StudentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*StudentClient) Intercept

func (c *StudentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `student.Intercept(f(g(h())))`.

func (*StudentClient) Interceptors

func (c *StudentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*StudentClient) Query

func (c *StudentClient) Query() *StudentQuery

Query returns a query builder for Student.

func (*StudentClient) QueryCertificate

func (c *StudentClient) QueryCertificate(s *Student) *CertificateQuery

QueryCertificate queries the certificate edge of a Student.

func (*StudentClient) QueryClass

func (c *StudentClient) QueryClass(s *Student) *ClassQuery

QueryClass queries the class edge of a Student.

func (*StudentClient) QueryClassLeader

func (c *StudentClient) QueryClassLeader(s *Student) *ClassLeaderQuery

QueryClassLeader queries the class_leader edge of a Student.

func (*StudentClient) QueryDepartment

func (c *StudentClient) QueryDepartment(s *Student) *DepartmentQuery

QueryDepartment queries the department edge of a Student.

func (*StudentClient) QueryEducationLevel

func (c *StudentClient) QueryEducationLevel(s *Student) *EducationLevelQuery

QueryEducationLevel queries the education_level edge of a Student.

func (*StudentClient) QueryEnrollmentStatus

func (c *StudentClient) QueryEnrollmentStatus(s *Student) *EnrollmentStatusQuery

QueryEnrollmentStatus queries the enrollment_status edge of a Student.

func (*StudentClient) QueryFamilyInfo

func (c *StudentClient) QueryFamilyInfo(s *Student) *FamilyInfoQuery

QueryFamilyInfo queries the family_info edge of a Student.

func (*StudentClient) QueryMajor

func (c *StudentClient) QueryMajor(s *Student) *MajorQuery

QueryMajor queries the major edge of a Student.

func (*StudentClient) QueryPracticalExperience

func (c *StudentClient) QueryPracticalExperience(s *Student) *PracticalExperienceQuery

QueryPracticalExperience queries the practical_experience edge of a Student.

func (*StudentClient) QueryTutor

func (c *StudentClient) QueryTutor(s *Student) *TutorQuery

QueryTutor queries the tutor edge of a Student.

func (*StudentClient) QueryUser

func (c *StudentClient) QueryUser(s *Student) *UserQuery

QueryUser queries the user edge of a Student.

func (*StudentClient) Update

func (c *StudentClient) Update() *StudentUpdate

Update returns an update builder for Student.

func (*StudentClient) UpdateOne

func (c *StudentClient) UpdateOne(s *Student) *StudentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*StudentClient) UpdateOneID

func (c *StudentClient) UpdateOneID(id int) *StudentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*StudentClient) Use

func (c *StudentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `student.Hooks(f(g(h())))`.

type StudentCreate

type StudentCreate struct {
	// contains filtered or unexported fields
}

StudentCreate is the builder for creating a Student entity.

func (*StudentCreate) AddCertificate

func (sc *StudentCreate) AddCertificate(c ...*Certificate) *StudentCreate

AddCertificate adds the "certificate" edges to the Certificate entity.

func (*StudentCreate) AddCertificateIDs

func (sc *StudentCreate) AddCertificateIDs(ids ...int) *StudentCreate

AddCertificateIDs adds the "certificate" edge to the Certificate entity by IDs.

func (*StudentCreate) AddEducationLevel

func (sc *StudentCreate) AddEducationLevel(e ...*EducationLevel) *StudentCreate

AddEducationLevel adds the "education_level" edges to the EducationLevel entity.

func (*StudentCreate) AddEducationLevelIDs

func (sc *StudentCreate) AddEducationLevelIDs(ids ...int) *StudentCreate

AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by IDs.

func (*StudentCreate) AddEnrollmentStatuIDs

func (sc *StudentCreate) AddEnrollmentStatuIDs(ids ...int) *StudentCreate

AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by IDs.

func (*StudentCreate) AddEnrollmentStatus

func (sc *StudentCreate) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentCreate

AddEnrollmentStatus adds the "enrollment_status" edges to the EnrollmentStatus entity.

func (*StudentCreate) AddFamilyInfo

func (sc *StudentCreate) AddFamilyInfo(f ...*FamilyInfo) *StudentCreate

AddFamilyInfo adds the "family_info" edges to the FamilyInfo entity.

func (*StudentCreate) AddFamilyInfoIDs

func (sc *StudentCreate) AddFamilyInfoIDs(ids ...int) *StudentCreate

AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by IDs.

func (*StudentCreate) AddPracticalExperience

func (sc *StudentCreate) AddPracticalExperience(p ...*PracticalExperience) *StudentCreate

AddPracticalExperience adds the "practical_experience" edges to the PracticalExperience entity.

func (*StudentCreate) AddPracticalExperienceIDs

func (sc *StudentCreate) AddPracticalExperienceIDs(ids ...int) *StudentCreate

AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by IDs.

func (*StudentCreate) Exec

func (sc *StudentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StudentCreate) ExecX

func (sc *StudentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudentCreate) Mutation

func (sc *StudentCreate) Mutation() *StudentMutation

Mutation returns the StudentMutation object of the builder.

func (*StudentCreate) Save

func (sc *StudentCreate) Save(ctx context.Context) (*Student, error)

Save creates the Student in the database.

func (*StudentCreate) SaveX

func (sc *StudentCreate) SaveX(ctx context.Context) *Student

SaveX calls Save and panics if Save returns an error.

func (*StudentCreate) SetAge

func (sc *StudentCreate) SetAge(i int) *StudentCreate

SetAge sets the "age" field.

func (*StudentCreate) SetAvatar

func (sc *StudentCreate) SetAvatar(b []byte) *StudentCreate

SetAvatar sets the "avatar" field.

func (*StudentCreate) SetClass

func (sc *StudentCreate) SetClass(c *Class) *StudentCreate

SetClass sets the "class" edge to the Class entity.

func (*StudentCreate) SetClassID

func (sc *StudentCreate) SetClassID(id int) *StudentCreate

SetClassID sets the "class" edge to the Class entity by ID.

func (*StudentCreate) SetClassLeader

func (sc *StudentCreate) SetClassLeader(c *ClassLeader) *StudentCreate

SetClassLeader sets the "class_leader" edge to the ClassLeader entity.

func (*StudentCreate) SetClassLeaderID

func (sc *StudentCreate) SetClassLeaderID(id int) *StudentCreate

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.

func (*StudentCreate) SetCode

func (sc *StudentCreate) SetCode(s string) *StudentCreate

SetCode sets the "code" field.

func (*StudentCreate) SetDepartment

func (sc *StudentCreate) SetDepartment(d *Department) *StudentCreate

SetDepartment sets the "department" edge to the Department entity.

func (*StudentCreate) SetDepartmentID

func (sc *StudentCreate) SetDepartmentID(id int) *StudentCreate

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*StudentCreate) SetMajor

func (sc *StudentCreate) SetMajor(m *Major) *StudentCreate

SetMajor sets the "major" edge to the Major entity.

func (*StudentCreate) SetMajorID

func (sc *StudentCreate) SetMajorID(id int) *StudentCreate

SetMajorID sets the "major" edge to the Major entity by ID.

func (*StudentCreate) SetName

func (sc *StudentCreate) SetName(s string) *StudentCreate

SetName sets the "name" field.

func (*StudentCreate) SetNillableClassID

func (sc *StudentCreate) SetNillableClassID(id *int) *StudentCreate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*StudentCreate) SetNillableClassLeaderID

func (sc *StudentCreate) SetNillableClassLeaderID(id *int) *StudentCreate

SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.

func (*StudentCreate) SetNillableDepartmentID

func (sc *StudentCreate) SetNillableDepartmentID(id *int) *StudentCreate

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*StudentCreate) SetNillableMajorID

func (sc *StudentCreate) SetNillableMajorID(id *int) *StudentCreate

SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.

func (*StudentCreate) SetNillableTutorID

func (sc *StudentCreate) SetNillableTutorID(id *int) *StudentCreate

SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.

func (*StudentCreate) SetNillableUserID

func (sc *StudentCreate) SetNillableUserID(id *int) *StudentCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*StudentCreate) SetSex

func (sc *StudentCreate) SetSex(s string) *StudentCreate

SetSex sets the "sex" field.

func (*StudentCreate) SetTutor

func (sc *StudentCreate) SetTutor(t *Tutor) *StudentCreate

SetTutor sets the "tutor" edge to the Tutor entity.

func (*StudentCreate) SetTutorID

func (sc *StudentCreate) SetTutorID(id int) *StudentCreate

SetTutorID sets the "tutor" edge to the Tutor entity by ID.

func (*StudentCreate) SetUser

func (sc *StudentCreate) SetUser(u *User) *StudentCreate

SetUser sets the "user" edge to the User entity.

func (*StudentCreate) SetUserID

func (sc *StudentCreate) SetUserID(id int) *StudentCreate

SetUserID sets the "user" edge to the User entity by ID.

type StudentCreateBulk

type StudentCreateBulk struct {
	// contains filtered or unexported fields
}

StudentCreateBulk is the builder for creating many Student entities in bulk.

func (*StudentCreateBulk) Exec

func (scb *StudentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StudentCreateBulk) ExecX

func (scb *StudentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudentCreateBulk) Save

func (scb *StudentCreateBulk) Save(ctx context.Context) ([]*Student, error)

Save creates the Student entities in the database.

func (*StudentCreateBulk) SaveX

func (scb *StudentCreateBulk) SaveX(ctx context.Context) []*Student

SaveX is like Save, but panics if an error occurs.

type StudentDelete

type StudentDelete struct {
	// contains filtered or unexported fields
}

StudentDelete is the builder for deleting a Student entity.

func (*StudentDelete) Exec

func (sd *StudentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StudentDelete) ExecX

func (sd *StudentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StudentDelete) Where

func (sd *StudentDelete) Where(ps ...predicate.Student) *StudentDelete

Where appends a list predicates to the StudentDelete builder.

type StudentDeleteOne

type StudentDeleteOne struct {
	// contains filtered or unexported fields
}

StudentDeleteOne is the builder for deleting a single Student entity.

func (*StudentDeleteOne) Exec

func (sdo *StudentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StudentDeleteOne) ExecX

func (sdo *StudentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudentDeleteOne) Where

Where appends a list predicates to the StudentDelete builder.

type StudentEdges

type StudentEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Department holds the value of the department edge.
	Department *Department `json:"department,omitempty"`
	// Major holds the value of the major edge.
	Major *Major `json:"major,omitempty"`
	// Class holds the value of the class edge.
	Class *Class `json:"class,omitempty"`
	// ClassLeader holds the value of the class_leader edge.
	ClassLeader *ClassLeader `json:"class_leader,omitempty"`
	// Tutor holds the value of the tutor edge.
	Tutor *Tutor `json:"tutor,omitempty"`
	// Certificate holds the value of the certificate edge.
	Certificate []*Certificate `json:"certificate,omitempty"`
	// EducationLevel holds the value of the education_level edge.
	EducationLevel []*EducationLevel `json:"education_level,omitempty"`
	// EnrollmentStatus holds the value of the enrollment_status edge.
	EnrollmentStatus []*EnrollmentStatus `json:"enrollment_status,omitempty"`
	// FamilyInfo holds the value of the family_info edge.
	FamilyInfo []*FamilyInfo `json:"family_info,omitempty"`
	// PracticalExperience holds the value of the practical_experience edge.
	PracticalExperience []*PracticalExperience `json:"practical_experience,omitempty"`
	// contains filtered or unexported fields
}

StudentEdges holds the relations/edges for other nodes in the graph.

func (StudentEdges) CertificateOrErr

func (e StudentEdges) CertificateOrErr() ([]*Certificate, error)

CertificateOrErr returns the Certificate value or an error if the edge was not loaded in eager-loading.

func (StudentEdges) ClassLeaderOrErr

func (e StudentEdges) ClassLeaderOrErr() (*ClassLeader, error)

ClassLeaderOrErr returns the ClassLeader value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StudentEdges) ClassOrErr

func (e StudentEdges) ClassOrErr() (*Class, error)

ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StudentEdges) DepartmentOrErr

func (e StudentEdges) DepartmentOrErr() (*Department, error)

DepartmentOrErr returns the Department value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StudentEdges) EducationLevelOrErr

func (e StudentEdges) EducationLevelOrErr() ([]*EducationLevel, error)

EducationLevelOrErr returns the EducationLevel value or an error if the edge was not loaded in eager-loading.

func (StudentEdges) EnrollmentStatusOrErr

func (e StudentEdges) EnrollmentStatusOrErr() ([]*EnrollmentStatus, error)

EnrollmentStatusOrErr returns the EnrollmentStatus value or an error if the edge was not loaded in eager-loading.

func (StudentEdges) FamilyInfoOrErr

func (e StudentEdges) FamilyInfoOrErr() ([]*FamilyInfo, error)

FamilyInfoOrErr returns the FamilyInfo value or an error if the edge was not loaded in eager-loading.

func (StudentEdges) MajorOrErr

func (e StudentEdges) MajorOrErr() (*Major, error)

MajorOrErr returns the Major value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StudentEdges) PracticalExperienceOrErr

func (e StudentEdges) PracticalExperienceOrErr() ([]*PracticalExperience, error)

PracticalExperienceOrErr returns the PracticalExperience value or an error if the edge was not loaded in eager-loading.

func (StudentEdges) TutorOrErr

func (e StudentEdges) TutorOrErr() (*Tutor, error)

TutorOrErr returns the Tutor value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StudentEdges) UserOrErr

func (e StudentEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type StudentGroupBy

type StudentGroupBy struct {
	// contains filtered or unexported fields
}

StudentGroupBy is the group-by builder for Student entities.

func (*StudentGroupBy) Aggregate

func (sgb *StudentGroupBy) Aggregate(fns ...AggregateFunc) *StudentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*StudentGroupBy) Bool

func (s *StudentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) BoolX

func (s *StudentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StudentGroupBy) Bools

func (s *StudentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) BoolsX

func (s *StudentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StudentGroupBy) Float64

func (s *StudentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) Float64X

func (s *StudentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StudentGroupBy) Float64s

func (s *StudentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) Float64sX

func (s *StudentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StudentGroupBy) Int

func (s *StudentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) IntX

func (s *StudentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StudentGroupBy) Ints

func (s *StudentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) IntsX

func (s *StudentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StudentGroupBy) Scan

func (sgb *StudentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StudentGroupBy) ScanX

func (s *StudentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StudentGroupBy) String

func (s *StudentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) StringX

func (s *StudentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StudentGroupBy) Strings

func (s *StudentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StudentGroupBy) StringsX

func (s *StudentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StudentMutation

type StudentMutation struct {
	// contains filtered or unexported fields
}

StudentMutation represents an operation that mutates the Student nodes in the graph.

func (*StudentMutation) AddAge

func (m *StudentMutation) AddAge(i int)

AddAge adds i to the "age" field.

func (*StudentMutation) AddCertificateIDs

func (m *StudentMutation) AddCertificateIDs(ids ...int)

AddCertificateIDs adds the "certificate" edge to the Certificate entity by ids.

func (*StudentMutation) AddEducationLevelIDs

func (m *StudentMutation) AddEducationLevelIDs(ids ...int)

AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by ids.

func (*StudentMutation) AddEnrollmentStatuIDs

func (m *StudentMutation) AddEnrollmentStatuIDs(ids ...int)

AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by ids.

func (*StudentMutation) AddFamilyInfoIDs

func (m *StudentMutation) AddFamilyInfoIDs(ids ...int)

AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by ids.

func (*StudentMutation) AddField

func (m *StudentMutation) 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 (*StudentMutation) AddPracticalExperienceIDs

func (m *StudentMutation) AddPracticalExperienceIDs(ids ...int)

AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by ids.

func (*StudentMutation) AddedAge

func (m *StudentMutation) AddedAge() (r int, exists bool)

AddedAge returns the value that was added to the "age" field in this mutation.

func (*StudentMutation) AddedEdges

func (m *StudentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StudentMutation) AddedField

func (m *StudentMutation) 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 (*StudentMutation) AddedFields

func (m *StudentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StudentMutation) AddedIDs

func (m *StudentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StudentMutation) Age

func (m *StudentMutation) Age() (r int, exists bool)

Age returns the value of the "age" field in the mutation.

func (*StudentMutation) Avatar

func (m *StudentMutation) Avatar() (r []byte, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*StudentMutation) CertificateCleared

func (m *StudentMutation) CertificateCleared() bool

CertificateCleared reports if the "certificate" edge to the Certificate entity was cleared.

func (*StudentMutation) CertificateIDs

func (m *StudentMutation) CertificateIDs() (ids []int)

CertificateIDs returns the "certificate" edge IDs in the mutation.

func (*StudentMutation) ClassCleared

func (m *StudentMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*StudentMutation) ClassID

func (m *StudentMutation) ClassID() (id int, exists bool)

ClassID returns the "class" edge ID in the mutation.

func (*StudentMutation) ClassIDs

func (m *StudentMutation) ClassIDs() (ids []int)

ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.

func (*StudentMutation) ClassLeaderCleared

func (m *StudentMutation) ClassLeaderCleared() bool

ClassLeaderCleared reports if the "class_leader" edge to the ClassLeader entity was cleared.

func (*StudentMutation) ClassLeaderID

func (m *StudentMutation) ClassLeaderID() (id int, exists bool)

ClassLeaderID returns the "class_leader" edge ID in the mutation.

func (*StudentMutation) ClassLeaderIDs

func (m *StudentMutation) ClassLeaderIDs() (ids []int)

ClassLeaderIDs returns the "class_leader" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassLeaderID instead. It exists only for internal usage by the builders.

func (*StudentMutation) ClearCertificate

func (m *StudentMutation) ClearCertificate()

ClearCertificate clears the "certificate" edge to the Certificate entity.

func (*StudentMutation) ClearClass

func (m *StudentMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*StudentMutation) ClearClassLeader

func (m *StudentMutation) ClearClassLeader()

ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.

func (*StudentMutation) ClearDepartment

func (m *StudentMutation) ClearDepartment()

ClearDepartment clears the "department" edge to the Department entity.

func (*StudentMutation) ClearEdge

func (m *StudentMutation) 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 (*StudentMutation) ClearEducationLevel

func (m *StudentMutation) ClearEducationLevel()

ClearEducationLevel clears the "education_level" edge to the EducationLevel entity.

func (*StudentMutation) ClearEnrollmentStatus

func (m *StudentMutation) ClearEnrollmentStatus()

ClearEnrollmentStatus clears the "enrollment_status" edge to the EnrollmentStatus entity.

func (*StudentMutation) ClearFamilyInfo

func (m *StudentMutation) ClearFamilyInfo()

ClearFamilyInfo clears the "family_info" edge to the FamilyInfo entity.

func (*StudentMutation) ClearField

func (m *StudentMutation) 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 (*StudentMutation) ClearMajor

func (m *StudentMutation) ClearMajor()

ClearMajor clears the "major" edge to the Major entity.

func (*StudentMutation) ClearPracticalExperience

func (m *StudentMutation) ClearPracticalExperience()

ClearPracticalExperience clears the "practical_experience" edge to the PracticalExperience entity.

func (*StudentMutation) ClearTutor

func (m *StudentMutation) ClearTutor()

ClearTutor clears the "tutor" edge to the Tutor entity.

func (*StudentMutation) ClearUser

func (m *StudentMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*StudentMutation) ClearedEdges

func (m *StudentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StudentMutation) ClearedFields

func (m *StudentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StudentMutation) Client

func (m StudentMutation) 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 (*StudentMutation) Code

func (m *StudentMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*StudentMutation) DepartmentCleared

func (m *StudentMutation) DepartmentCleared() bool

DepartmentCleared reports if the "department" edge to the Department entity was cleared.

func (*StudentMutation) DepartmentID

func (m *StudentMutation) DepartmentID() (id int, exists bool)

DepartmentID returns the "department" edge ID in the mutation.

func (*StudentMutation) DepartmentIDs

func (m *StudentMutation) DepartmentIDs() (ids []int)

DepartmentIDs returns the "department" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DepartmentID instead. It exists only for internal usage by the builders.

func (*StudentMutation) EdgeCleared

func (m *StudentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StudentMutation) EducationLevelCleared

func (m *StudentMutation) EducationLevelCleared() bool

EducationLevelCleared reports if the "education_level" edge to the EducationLevel entity was cleared.

func (*StudentMutation) EducationLevelIDs

func (m *StudentMutation) EducationLevelIDs() (ids []int)

EducationLevelIDs returns the "education_level" edge IDs in the mutation.

func (*StudentMutation) EnrollmentStatusCleared

func (m *StudentMutation) EnrollmentStatusCleared() bool

EnrollmentStatusCleared reports if the "enrollment_status" edge to the EnrollmentStatus entity was cleared.

func (*StudentMutation) EnrollmentStatusIDs

func (m *StudentMutation) EnrollmentStatusIDs() (ids []int)

EnrollmentStatusIDs returns the "enrollment_status" edge IDs in the mutation.

func (*StudentMutation) FamilyInfoCleared

func (m *StudentMutation) FamilyInfoCleared() bool

FamilyInfoCleared reports if the "family_info" edge to the FamilyInfo entity was cleared.

func (*StudentMutation) FamilyInfoIDs

func (m *StudentMutation) FamilyInfoIDs() (ids []int)

FamilyInfoIDs returns the "family_info" edge IDs in the mutation.

func (*StudentMutation) Field

func (m *StudentMutation) 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 (*StudentMutation) FieldCleared

func (m *StudentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StudentMutation) Fields

func (m *StudentMutation) 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 (*StudentMutation) ID

func (m *StudentMutation) 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 (*StudentMutation) IDs

func (m *StudentMutation) 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 (*StudentMutation) MajorCleared

func (m *StudentMutation) MajorCleared() bool

MajorCleared reports if the "major" edge to the Major entity was cleared.

func (*StudentMutation) MajorID

func (m *StudentMutation) MajorID() (id int, exists bool)

MajorID returns the "major" edge ID in the mutation.

func (*StudentMutation) MajorIDs

func (m *StudentMutation) MajorIDs() (ids []int)

MajorIDs returns the "major" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MajorID instead. It exists only for internal usage by the builders.

func (*StudentMutation) Name

func (m *StudentMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*StudentMutation) OldAge

func (m *StudentMutation) OldAge(ctx context.Context) (v int, err error)

OldAge returns the old "age" field's value of the Student entity. If the Student 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 (*StudentMutation) OldAvatar

func (m *StudentMutation) OldAvatar(ctx context.Context) (v []byte, err error)

OldAvatar returns the old "avatar" field's value of the Student entity. If the Student 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 (*StudentMutation) OldCode

func (m *StudentMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Student entity. If the Student 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 (*StudentMutation) OldField

func (m *StudentMutation) 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 (*StudentMutation) OldName

func (m *StudentMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Student entity. If the Student 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 (*StudentMutation) OldSex

func (m *StudentMutation) OldSex(ctx context.Context) (v string, err error)

OldSex returns the old "sex" field's value of the Student entity. If the Student 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 (*StudentMutation) Op

func (m *StudentMutation) Op() Op

Op returns the operation name.

func (*StudentMutation) PracticalExperienceCleared

func (m *StudentMutation) PracticalExperienceCleared() bool

PracticalExperienceCleared reports if the "practical_experience" edge to the PracticalExperience entity was cleared.

func (*StudentMutation) PracticalExperienceIDs

func (m *StudentMutation) PracticalExperienceIDs() (ids []int)

PracticalExperienceIDs returns the "practical_experience" edge IDs in the mutation.

func (*StudentMutation) RemoveCertificateIDs

func (m *StudentMutation) RemoveCertificateIDs(ids ...int)

RemoveCertificateIDs removes the "certificate" edge to the Certificate entity by IDs.

func (*StudentMutation) RemoveEducationLevelIDs

func (m *StudentMutation) RemoveEducationLevelIDs(ids ...int)

RemoveEducationLevelIDs removes the "education_level" edge to the EducationLevel entity by IDs.

func (*StudentMutation) RemoveEnrollmentStatuIDs

func (m *StudentMutation) RemoveEnrollmentStatuIDs(ids ...int)

RemoveEnrollmentStatuIDs removes the "enrollment_status" edge to the EnrollmentStatus entity by IDs.

func (*StudentMutation) RemoveFamilyInfoIDs

func (m *StudentMutation) RemoveFamilyInfoIDs(ids ...int)

RemoveFamilyInfoIDs removes the "family_info" edge to the FamilyInfo entity by IDs.

func (*StudentMutation) RemovePracticalExperienceIDs

func (m *StudentMutation) RemovePracticalExperienceIDs(ids ...int)

RemovePracticalExperienceIDs removes the "practical_experience" edge to the PracticalExperience entity by IDs.

func (*StudentMutation) RemovedCertificateIDs

func (m *StudentMutation) RemovedCertificateIDs() (ids []int)

RemovedCertificate returns the removed IDs of the "certificate" edge to the Certificate entity.

func (*StudentMutation) RemovedEdges

func (m *StudentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StudentMutation) RemovedEducationLevelIDs

func (m *StudentMutation) RemovedEducationLevelIDs() (ids []int)

RemovedEducationLevel returns the removed IDs of the "education_level" edge to the EducationLevel entity.

func (*StudentMutation) RemovedEnrollmentStatusIDs

func (m *StudentMutation) RemovedEnrollmentStatusIDs() (ids []int)

RemovedEnrollmentStatus returns the removed IDs of the "enrollment_status" edge to the EnrollmentStatus entity.

func (*StudentMutation) RemovedFamilyInfoIDs

func (m *StudentMutation) RemovedFamilyInfoIDs() (ids []int)

RemovedFamilyInfo returns the removed IDs of the "family_info" edge to the FamilyInfo entity.

func (*StudentMutation) RemovedIDs

func (m *StudentMutation) 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 (*StudentMutation) RemovedPracticalExperienceIDs

func (m *StudentMutation) RemovedPracticalExperienceIDs() (ids []int)

RemovedPracticalExperience returns the removed IDs of the "practical_experience" edge to the PracticalExperience entity.

func (*StudentMutation) ResetAge

func (m *StudentMutation) ResetAge()

ResetAge resets all changes to the "age" field.

func (*StudentMutation) ResetAvatar

func (m *StudentMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*StudentMutation) ResetCertificate

func (m *StudentMutation) ResetCertificate()

ResetCertificate resets all changes to the "certificate" edge.

func (*StudentMutation) ResetClass

func (m *StudentMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*StudentMutation) ResetClassLeader

func (m *StudentMutation) ResetClassLeader()

ResetClassLeader resets all changes to the "class_leader" edge.

func (*StudentMutation) ResetCode

func (m *StudentMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*StudentMutation) ResetDepartment

func (m *StudentMutation) ResetDepartment()

ResetDepartment resets all changes to the "department" edge.

func (*StudentMutation) ResetEdge

func (m *StudentMutation) 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 (*StudentMutation) ResetEducationLevel

func (m *StudentMutation) ResetEducationLevel()

ResetEducationLevel resets all changes to the "education_level" edge.

func (*StudentMutation) ResetEnrollmentStatus

func (m *StudentMutation) ResetEnrollmentStatus()

ResetEnrollmentStatus resets all changes to the "enrollment_status" edge.

func (*StudentMutation) ResetFamilyInfo

func (m *StudentMutation) ResetFamilyInfo()

ResetFamilyInfo resets all changes to the "family_info" edge.

func (*StudentMutation) ResetField

func (m *StudentMutation) 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 (*StudentMutation) ResetMajor

func (m *StudentMutation) ResetMajor()

ResetMajor resets all changes to the "major" edge.

func (*StudentMutation) ResetName

func (m *StudentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*StudentMutation) ResetPracticalExperience

func (m *StudentMutation) ResetPracticalExperience()

ResetPracticalExperience resets all changes to the "practical_experience" edge.

func (*StudentMutation) ResetSex

func (m *StudentMutation) ResetSex()

ResetSex resets all changes to the "sex" field.

func (*StudentMutation) ResetTutor

func (m *StudentMutation) ResetTutor()

ResetTutor resets all changes to the "tutor" edge.

func (*StudentMutation) ResetUser

func (m *StudentMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*StudentMutation) SetAge

func (m *StudentMutation) SetAge(i int)

SetAge sets the "age" field.

func (*StudentMutation) SetAvatar

func (m *StudentMutation) SetAvatar(b []byte)

SetAvatar sets the "avatar" field.

func (*StudentMutation) SetClassID

func (m *StudentMutation) SetClassID(id int)

SetClassID sets the "class" edge to the Class entity by id.

func (*StudentMutation) SetClassLeaderID

func (m *StudentMutation) SetClassLeaderID(id int)

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by id.

func (*StudentMutation) SetCode

func (m *StudentMutation) SetCode(s string)

SetCode sets the "code" field.

func (*StudentMutation) SetDepartmentID

func (m *StudentMutation) SetDepartmentID(id int)

SetDepartmentID sets the "department" edge to the Department entity by id.

func (*StudentMutation) SetField

func (m *StudentMutation) 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 (*StudentMutation) SetMajorID

func (m *StudentMutation) SetMajorID(id int)

SetMajorID sets the "major" edge to the Major entity by id.

func (*StudentMutation) SetName

func (m *StudentMutation) SetName(s string)

SetName sets the "name" field.

func (*StudentMutation) SetOp

func (m *StudentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StudentMutation) SetSex

func (m *StudentMutation) SetSex(s string)

SetSex sets the "sex" field.

func (*StudentMutation) SetTutorID

func (m *StudentMutation) SetTutorID(id int)

SetTutorID sets the "tutor" edge to the Tutor entity by id.

func (*StudentMutation) SetUserID

func (m *StudentMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*StudentMutation) Sex

func (m *StudentMutation) Sex() (r string, exists bool)

Sex returns the value of the "sex" field in the mutation.

func (*StudentMutation) TutorCleared

func (m *StudentMutation) TutorCleared() bool

TutorCleared reports if the "tutor" edge to the Tutor entity was cleared.

func (*StudentMutation) TutorID

func (m *StudentMutation) TutorID() (id int, exists bool)

TutorID returns the "tutor" edge ID in the mutation.

func (*StudentMutation) TutorIDs

func (m *StudentMutation) TutorIDs() (ids []int)

TutorIDs returns the "tutor" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TutorID instead. It exists only for internal usage by the builders.

func (StudentMutation) Tx

func (m StudentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StudentMutation) Type

func (m *StudentMutation) Type() string

Type returns the node type of this mutation (Student).

func (*StudentMutation) UserCleared

func (m *StudentMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*StudentMutation) UserID

func (m *StudentMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*StudentMutation) UserIDs

func (m *StudentMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*StudentMutation) Where

func (m *StudentMutation) Where(ps ...predicate.Student)

Where appends a list predicates to the StudentMutation builder.

func (*StudentMutation) WhereP

func (m *StudentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the StudentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type StudentQuery

type StudentQuery struct {
	// contains filtered or unexported fields
}

StudentQuery is the builder for querying Student entities.

func (*StudentQuery) Aggregate

func (sq *StudentQuery) Aggregate(fns ...AggregateFunc) *StudentSelect

Aggregate returns a StudentSelect configured with the given aggregations.

func (*StudentQuery) All

func (sq *StudentQuery) All(ctx context.Context) ([]*Student, error)

All executes the query and returns a list of Students.

func (*StudentQuery) AllX

func (sq *StudentQuery) AllX(ctx context.Context) []*Student

AllX is like All, but panics if an error occurs.

func (*StudentQuery) Clone

func (sq *StudentQuery) Clone() *StudentQuery

Clone returns a duplicate of the StudentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StudentQuery) Count

func (sq *StudentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StudentQuery) CountX

func (sq *StudentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StudentQuery) Exist

func (sq *StudentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StudentQuery) ExistX

func (sq *StudentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StudentQuery) First

func (sq *StudentQuery) First(ctx context.Context) (*Student, error)

First returns the first Student entity from the query. Returns a *NotFoundError when no Student was found.

func (*StudentQuery) FirstID

func (sq *StudentQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Student ID from the query. Returns a *NotFoundError when no Student ID was found.

func (*StudentQuery) FirstIDX

func (sq *StudentQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*StudentQuery) FirstX

func (sq *StudentQuery) FirstX(ctx context.Context) *Student

FirstX is like First, but panics if an error occurs.

func (*StudentQuery) GroupBy

func (sq *StudentQuery) GroupBy(field string, fields ...string) *StudentGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Student.Query().
	GroupBy(student.FieldName).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*StudentQuery) IDs

func (sq *StudentQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Student IDs.

func (*StudentQuery) IDsX

func (sq *StudentQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*StudentQuery) Limit

func (sq *StudentQuery) Limit(limit int) *StudentQuery

Limit the number of records to be returned by this query.

func (*StudentQuery) Offset

func (sq *StudentQuery) Offset(offset int) *StudentQuery

Offset to start from.

func (*StudentQuery) Only

func (sq *StudentQuery) Only(ctx context.Context) (*Student, error)

Only returns a single Student entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Student entity is found. Returns a *NotFoundError when no Student entities are found.

func (*StudentQuery) OnlyID

func (sq *StudentQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Student ID in the query. Returns a *NotSingularError when more than one Student ID is found. Returns a *NotFoundError when no entities are found.

func (*StudentQuery) OnlyIDX

func (sq *StudentQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StudentQuery) OnlyX

func (sq *StudentQuery) OnlyX(ctx context.Context) *Student

OnlyX is like Only, but panics if an error occurs.

func (*StudentQuery) Order

func (sq *StudentQuery) Order(o ...OrderFunc) *StudentQuery

Order specifies how the records should be ordered.

func (*StudentQuery) QueryCertificate

func (sq *StudentQuery) QueryCertificate() *CertificateQuery

QueryCertificate chains the current query on the "certificate" edge.

func (*StudentQuery) QueryClass

func (sq *StudentQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*StudentQuery) QueryClassLeader

func (sq *StudentQuery) QueryClassLeader() *ClassLeaderQuery

QueryClassLeader chains the current query on the "class_leader" edge.

func (*StudentQuery) QueryDepartment

func (sq *StudentQuery) QueryDepartment() *DepartmentQuery

QueryDepartment chains the current query on the "department" edge.

func (*StudentQuery) QueryEducationLevel

func (sq *StudentQuery) QueryEducationLevel() *EducationLevelQuery

QueryEducationLevel chains the current query on the "education_level" edge.

func (*StudentQuery) QueryEnrollmentStatus

func (sq *StudentQuery) QueryEnrollmentStatus() *EnrollmentStatusQuery

QueryEnrollmentStatus chains the current query on the "enrollment_status" edge.

func (*StudentQuery) QueryFamilyInfo

func (sq *StudentQuery) QueryFamilyInfo() *FamilyInfoQuery

QueryFamilyInfo chains the current query on the "family_info" edge.

func (*StudentQuery) QueryMajor

func (sq *StudentQuery) QueryMajor() *MajorQuery

QueryMajor chains the current query on the "major" edge.

func (*StudentQuery) QueryPracticalExperience

func (sq *StudentQuery) QueryPracticalExperience() *PracticalExperienceQuery

QueryPracticalExperience chains the current query on the "practical_experience" edge.

func (*StudentQuery) QueryTutor

func (sq *StudentQuery) QueryTutor() *TutorQuery

QueryTutor chains the current query on the "tutor" edge.

func (*StudentQuery) QueryUser

func (sq *StudentQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*StudentQuery) Select

func (sq *StudentQuery) Select(fields ...string) *StudentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Student.Query().
	Select(student.FieldName).
	Scan(ctx, &v)

func (*StudentQuery) Unique

func (sq *StudentQuery) Unique(unique bool) *StudentQuery

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 (*StudentQuery) Where

func (sq *StudentQuery) Where(ps ...predicate.Student) *StudentQuery

Where adds a new predicate for the StudentQuery builder.

func (*StudentQuery) WithCertificate

func (sq *StudentQuery) WithCertificate(opts ...func(*CertificateQuery)) *StudentQuery

WithCertificate tells the query-builder to eager-load the nodes that are connected to the "certificate" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithClass

func (sq *StudentQuery) WithClass(opts ...func(*ClassQuery)) *StudentQuery

WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithClassLeader

func (sq *StudentQuery) WithClassLeader(opts ...func(*ClassLeaderQuery)) *StudentQuery

WithClassLeader tells the query-builder to eager-load the nodes that are connected to the "class_leader" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithDepartment

func (sq *StudentQuery) WithDepartment(opts ...func(*DepartmentQuery)) *StudentQuery

WithDepartment tells the query-builder to eager-load the nodes that are connected to the "department" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithEducationLevel

func (sq *StudentQuery) WithEducationLevel(opts ...func(*EducationLevelQuery)) *StudentQuery

WithEducationLevel tells the query-builder to eager-load the nodes that are connected to the "education_level" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithEnrollmentStatus

func (sq *StudentQuery) WithEnrollmentStatus(opts ...func(*EnrollmentStatusQuery)) *StudentQuery

WithEnrollmentStatus tells the query-builder to eager-load the nodes that are connected to the "enrollment_status" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithFamilyInfo

func (sq *StudentQuery) WithFamilyInfo(opts ...func(*FamilyInfoQuery)) *StudentQuery

WithFamilyInfo tells the query-builder to eager-load the nodes that are connected to the "family_info" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithMajor

func (sq *StudentQuery) WithMajor(opts ...func(*MajorQuery)) *StudentQuery

WithMajor tells the query-builder to eager-load the nodes that are connected to the "major" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithPracticalExperience

func (sq *StudentQuery) WithPracticalExperience(opts ...func(*PracticalExperienceQuery)) *StudentQuery

WithPracticalExperience tells the query-builder to eager-load the nodes that are connected to the "practical_experience" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithTutor

func (sq *StudentQuery) WithTutor(opts ...func(*TutorQuery)) *StudentQuery

WithTutor tells the query-builder to eager-load the nodes that are connected to the "tutor" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudentQuery) WithUser

func (sq *StudentQuery) WithUser(opts ...func(*UserQuery)) *StudentQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type StudentSelect

type StudentSelect struct {
	*StudentQuery
	// contains filtered or unexported fields
}

StudentSelect is the builder for selecting fields of Student entities.

func (*StudentSelect) Aggregate

func (ss *StudentSelect) Aggregate(fns ...AggregateFunc) *StudentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*StudentSelect) Bool

func (s *StudentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StudentSelect) BoolX

func (s *StudentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StudentSelect) Bools

func (s *StudentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StudentSelect) BoolsX

func (s *StudentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StudentSelect) Float64

func (s *StudentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StudentSelect) Float64X

func (s *StudentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StudentSelect) Float64s

func (s *StudentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StudentSelect) Float64sX

func (s *StudentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StudentSelect) Int

func (s *StudentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StudentSelect) IntX

func (s *StudentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StudentSelect) Ints

func (s *StudentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StudentSelect) IntsX

func (s *StudentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StudentSelect) Scan

func (ss *StudentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StudentSelect) ScanX

func (s *StudentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StudentSelect) String

func (s *StudentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StudentSelect) StringX

func (s *StudentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StudentSelect) Strings

func (s *StudentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StudentSelect) StringsX

func (s *StudentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StudentUpdate

type StudentUpdate struct {
	// contains filtered or unexported fields
}

StudentUpdate is the builder for updating Student entities.

func (*StudentUpdate) AddAge

func (su *StudentUpdate) AddAge(i int) *StudentUpdate

AddAge adds i to the "age" field.

func (*StudentUpdate) AddCertificate

func (su *StudentUpdate) AddCertificate(c ...*Certificate) *StudentUpdate

AddCertificate adds the "certificate" edges to the Certificate entity.

func (*StudentUpdate) AddCertificateIDs

func (su *StudentUpdate) AddCertificateIDs(ids ...int) *StudentUpdate

AddCertificateIDs adds the "certificate" edge to the Certificate entity by IDs.

func (*StudentUpdate) AddEducationLevel

func (su *StudentUpdate) AddEducationLevel(e ...*EducationLevel) *StudentUpdate

AddEducationLevel adds the "education_level" edges to the EducationLevel entity.

func (*StudentUpdate) AddEducationLevelIDs

func (su *StudentUpdate) AddEducationLevelIDs(ids ...int) *StudentUpdate

AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by IDs.

func (*StudentUpdate) AddEnrollmentStatuIDs

func (su *StudentUpdate) AddEnrollmentStatuIDs(ids ...int) *StudentUpdate

AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by IDs.

func (*StudentUpdate) AddEnrollmentStatus

func (su *StudentUpdate) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdate

AddEnrollmentStatus adds the "enrollment_status" edges to the EnrollmentStatus entity.

func (*StudentUpdate) AddFamilyInfo

func (su *StudentUpdate) AddFamilyInfo(f ...*FamilyInfo) *StudentUpdate

AddFamilyInfo adds the "family_info" edges to the FamilyInfo entity.

func (*StudentUpdate) AddFamilyInfoIDs

func (su *StudentUpdate) AddFamilyInfoIDs(ids ...int) *StudentUpdate

AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by IDs.

func (*StudentUpdate) AddPracticalExperience

func (su *StudentUpdate) AddPracticalExperience(p ...*PracticalExperience) *StudentUpdate

AddPracticalExperience adds the "practical_experience" edges to the PracticalExperience entity.

func (*StudentUpdate) AddPracticalExperienceIDs

func (su *StudentUpdate) AddPracticalExperienceIDs(ids ...int) *StudentUpdate

AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by IDs.

func (*StudentUpdate) ClearCertificate

func (su *StudentUpdate) ClearCertificate() *StudentUpdate

ClearCertificate clears all "certificate" edges to the Certificate entity.

func (*StudentUpdate) ClearClass

func (su *StudentUpdate) ClearClass() *StudentUpdate

ClearClass clears the "class" edge to the Class entity.

func (*StudentUpdate) ClearClassLeader

func (su *StudentUpdate) ClearClassLeader() *StudentUpdate

ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.

func (*StudentUpdate) ClearDepartment

func (su *StudentUpdate) ClearDepartment() *StudentUpdate

ClearDepartment clears the "department" edge to the Department entity.

func (*StudentUpdate) ClearEducationLevel

func (su *StudentUpdate) ClearEducationLevel() *StudentUpdate

ClearEducationLevel clears all "education_level" edges to the EducationLevel entity.

func (*StudentUpdate) ClearEnrollmentStatus

func (su *StudentUpdate) ClearEnrollmentStatus() *StudentUpdate

ClearEnrollmentStatus clears all "enrollment_status" edges to the EnrollmentStatus entity.

func (*StudentUpdate) ClearFamilyInfo

func (su *StudentUpdate) ClearFamilyInfo() *StudentUpdate

ClearFamilyInfo clears all "family_info" edges to the FamilyInfo entity.

func (*StudentUpdate) ClearMajor

func (su *StudentUpdate) ClearMajor() *StudentUpdate

ClearMajor clears the "major" edge to the Major entity.

func (*StudentUpdate) ClearPracticalExperience

func (su *StudentUpdate) ClearPracticalExperience() *StudentUpdate

ClearPracticalExperience clears all "practical_experience" edges to the PracticalExperience entity.

func (*StudentUpdate) ClearTutor

func (su *StudentUpdate) ClearTutor() *StudentUpdate

ClearTutor clears the "tutor" edge to the Tutor entity.

func (*StudentUpdate) ClearUser

func (su *StudentUpdate) ClearUser() *StudentUpdate

ClearUser clears the "user" edge to the User entity.

func (*StudentUpdate) Exec

func (su *StudentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StudentUpdate) ExecX

func (su *StudentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudentUpdate) Mutation

func (su *StudentUpdate) Mutation() *StudentMutation

Mutation returns the StudentMutation object of the builder.

func (*StudentUpdate) RemoveCertificate

func (su *StudentUpdate) RemoveCertificate(c ...*Certificate) *StudentUpdate

RemoveCertificate removes "certificate" edges to Certificate entities.

func (*StudentUpdate) RemoveCertificateIDs

func (su *StudentUpdate) RemoveCertificateIDs(ids ...int) *StudentUpdate

RemoveCertificateIDs removes the "certificate" edge to Certificate entities by IDs.

func (*StudentUpdate) RemoveEducationLevel

func (su *StudentUpdate) RemoveEducationLevel(e ...*EducationLevel) *StudentUpdate

RemoveEducationLevel removes "education_level" edges to EducationLevel entities.

func (*StudentUpdate) RemoveEducationLevelIDs

func (su *StudentUpdate) RemoveEducationLevelIDs(ids ...int) *StudentUpdate

RemoveEducationLevelIDs removes the "education_level" edge to EducationLevel entities by IDs.

func (*StudentUpdate) RemoveEnrollmentStatuIDs

func (su *StudentUpdate) RemoveEnrollmentStatuIDs(ids ...int) *StudentUpdate

RemoveEnrollmentStatuIDs removes the "enrollment_status" edge to EnrollmentStatus entities by IDs.

func (*StudentUpdate) RemoveEnrollmentStatus

func (su *StudentUpdate) RemoveEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdate

RemoveEnrollmentStatus removes "enrollment_status" edges to EnrollmentStatus entities.

func (*StudentUpdate) RemoveFamilyInfo

func (su *StudentUpdate) RemoveFamilyInfo(f ...*FamilyInfo) *StudentUpdate

RemoveFamilyInfo removes "family_info" edges to FamilyInfo entities.

func (*StudentUpdate) RemoveFamilyInfoIDs

func (su *StudentUpdate) RemoveFamilyInfoIDs(ids ...int) *StudentUpdate

RemoveFamilyInfoIDs removes the "family_info" edge to FamilyInfo entities by IDs.

func (*StudentUpdate) RemovePracticalExperience

func (su *StudentUpdate) RemovePracticalExperience(p ...*PracticalExperience) *StudentUpdate

RemovePracticalExperience removes "practical_experience" edges to PracticalExperience entities.

func (*StudentUpdate) RemovePracticalExperienceIDs

func (su *StudentUpdate) RemovePracticalExperienceIDs(ids ...int) *StudentUpdate

RemovePracticalExperienceIDs removes the "practical_experience" edge to PracticalExperience entities by IDs.

func (*StudentUpdate) Save

func (su *StudentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StudentUpdate) SaveX

func (su *StudentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StudentUpdate) SetAge

func (su *StudentUpdate) SetAge(i int) *StudentUpdate

SetAge sets the "age" field.

func (*StudentUpdate) SetAvatar

func (su *StudentUpdate) SetAvatar(b []byte) *StudentUpdate

SetAvatar sets the "avatar" field.

func (*StudentUpdate) SetClass

func (su *StudentUpdate) SetClass(c *Class) *StudentUpdate

SetClass sets the "class" edge to the Class entity.

func (*StudentUpdate) SetClassID

func (su *StudentUpdate) SetClassID(id int) *StudentUpdate

SetClassID sets the "class" edge to the Class entity by ID.

func (*StudentUpdate) SetClassLeader

func (su *StudentUpdate) SetClassLeader(c *ClassLeader) *StudentUpdate

SetClassLeader sets the "class_leader" edge to the ClassLeader entity.

func (*StudentUpdate) SetClassLeaderID

func (su *StudentUpdate) SetClassLeaderID(id int) *StudentUpdate

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.

func (*StudentUpdate) SetCode

func (su *StudentUpdate) SetCode(s string) *StudentUpdate

SetCode sets the "code" field.

func (*StudentUpdate) SetDepartment

func (su *StudentUpdate) SetDepartment(d *Department) *StudentUpdate

SetDepartment sets the "department" edge to the Department entity.

func (*StudentUpdate) SetDepartmentID

func (su *StudentUpdate) SetDepartmentID(id int) *StudentUpdate

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*StudentUpdate) SetMajor

func (su *StudentUpdate) SetMajor(m *Major) *StudentUpdate

SetMajor sets the "major" edge to the Major entity.

func (*StudentUpdate) SetMajorID

func (su *StudentUpdate) SetMajorID(id int) *StudentUpdate

SetMajorID sets the "major" edge to the Major entity by ID.

func (*StudentUpdate) SetName

func (su *StudentUpdate) SetName(s string) *StudentUpdate

SetName sets the "name" field.

func (*StudentUpdate) SetNillableClassID

func (su *StudentUpdate) SetNillableClassID(id *int) *StudentUpdate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*StudentUpdate) SetNillableClassLeaderID

func (su *StudentUpdate) SetNillableClassLeaderID(id *int) *StudentUpdate

SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.

func (*StudentUpdate) SetNillableDepartmentID

func (su *StudentUpdate) SetNillableDepartmentID(id *int) *StudentUpdate

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*StudentUpdate) SetNillableMajorID

func (su *StudentUpdate) SetNillableMajorID(id *int) *StudentUpdate

SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.

func (*StudentUpdate) SetNillableTutorID

func (su *StudentUpdate) SetNillableTutorID(id *int) *StudentUpdate

SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.

func (*StudentUpdate) SetNillableUserID

func (su *StudentUpdate) SetNillableUserID(id *int) *StudentUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*StudentUpdate) SetSex

func (su *StudentUpdate) SetSex(s string) *StudentUpdate

SetSex sets the "sex" field.

func (*StudentUpdate) SetTutor

func (su *StudentUpdate) SetTutor(t *Tutor) *StudentUpdate

SetTutor sets the "tutor" edge to the Tutor entity.

func (*StudentUpdate) SetTutorID

func (su *StudentUpdate) SetTutorID(id int) *StudentUpdate

SetTutorID sets the "tutor" edge to the Tutor entity by ID.

func (*StudentUpdate) SetUser

func (su *StudentUpdate) SetUser(u *User) *StudentUpdate

SetUser sets the "user" edge to the User entity.

func (*StudentUpdate) SetUserID

func (su *StudentUpdate) SetUserID(id int) *StudentUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*StudentUpdate) Where

func (su *StudentUpdate) Where(ps ...predicate.Student) *StudentUpdate

Where appends a list predicates to the StudentUpdate builder.

type StudentUpdateOne

type StudentUpdateOne struct {
	// contains filtered or unexported fields
}

StudentUpdateOne is the builder for updating a single Student entity.

func (*StudentUpdateOne) AddAge

func (suo *StudentUpdateOne) AddAge(i int) *StudentUpdateOne

AddAge adds i to the "age" field.

func (*StudentUpdateOne) AddCertificate

func (suo *StudentUpdateOne) AddCertificate(c ...*Certificate) *StudentUpdateOne

AddCertificate adds the "certificate" edges to the Certificate entity.

func (*StudentUpdateOne) AddCertificateIDs

func (suo *StudentUpdateOne) AddCertificateIDs(ids ...int) *StudentUpdateOne

AddCertificateIDs adds the "certificate" edge to the Certificate entity by IDs.

func (*StudentUpdateOne) AddEducationLevel

func (suo *StudentUpdateOne) AddEducationLevel(e ...*EducationLevel) *StudentUpdateOne

AddEducationLevel adds the "education_level" edges to the EducationLevel entity.

func (*StudentUpdateOne) AddEducationLevelIDs

func (suo *StudentUpdateOne) AddEducationLevelIDs(ids ...int) *StudentUpdateOne

AddEducationLevelIDs adds the "education_level" edge to the EducationLevel entity by IDs.

func (*StudentUpdateOne) AddEnrollmentStatuIDs

func (suo *StudentUpdateOne) AddEnrollmentStatuIDs(ids ...int) *StudentUpdateOne

AddEnrollmentStatuIDs adds the "enrollment_status" edge to the EnrollmentStatus entity by IDs.

func (*StudentUpdateOne) AddEnrollmentStatus

func (suo *StudentUpdateOne) AddEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdateOne

AddEnrollmentStatus adds the "enrollment_status" edges to the EnrollmentStatus entity.

func (*StudentUpdateOne) AddFamilyInfo

func (suo *StudentUpdateOne) AddFamilyInfo(f ...*FamilyInfo) *StudentUpdateOne

AddFamilyInfo adds the "family_info" edges to the FamilyInfo entity.

func (*StudentUpdateOne) AddFamilyInfoIDs

func (suo *StudentUpdateOne) AddFamilyInfoIDs(ids ...int) *StudentUpdateOne

AddFamilyInfoIDs adds the "family_info" edge to the FamilyInfo entity by IDs.

func (*StudentUpdateOne) AddPracticalExperience

func (suo *StudentUpdateOne) AddPracticalExperience(p ...*PracticalExperience) *StudentUpdateOne

AddPracticalExperience adds the "practical_experience" edges to the PracticalExperience entity.

func (*StudentUpdateOne) AddPracticalExperienceIDs

func (suo *StudentUpdateOne) AddPracticalExperienceIDs(ids ...int) *StudentUpdateOne

AddPracticalExperienceIDs adds the "practical_experience" edge to the PracticalExperience entity by IDs.

func (*StudentUpdateOne) ClearCertificate

func (suo *StudentUpdateOne) ClearCertificate() *StudentUpdateOne

ClearCertificate clears all "certificate" edges to the Certificate entity.

func (*StudentUpdateOne) ClearClass

func (suo *StudentUpdateOne) ClearClass() *StudentUpdateOne

ClearClass clears the "class" edge to the Class entity.

func (*StudentUpdateOne) ClearClassLeader

func (suo *StudentUpdateOne) ClearClassLeader() *StudentUpdateOne

ClearClassLeader clears the "class_leader" edge to the ClassLeader entity.

func (*StudentUpdateOne) ClearDepartment

func (suo *StudentUpdateOne) ClearDepartment() *StudentUpdateOne

ClearDepartment clears the "department" edge to the Department entity.

func (*StudentUpdateOne) ClearEducationLevel

func (suo *StudentUpdateOne) ClearEducationLevel() *StudentUpdateOne

ClearEducationLevel clears all "education_level" edges to the EducationLevel entity.

func (*StudentUpdateOne) ClearEnrollmentStatus

func (suo *StudentUpdateOne) ClearEnrollmentStatus() *StudentUpdateOne

ClearEnrollmentStatus clears all "enrollment_status" edges to the EnrollmentStatus entity.

func (*StudentUpdateOne) ClearFamilyInfo

func (suo *StudentUpdateOne) ClearFamilyInfo() *StudentUpdateOne

ClearFamilyInfo clears all "family_info" edges to the FamilyInfo entity.

func (*StudentUpdateOne) ClearMajor

func (suo *StudentUpdateOne) ClearMajor() *StudentUpdateOne

ClearMajor clears the "major" edge to the Major entity.

func (*StudentUpdateOne) ClearPracticalExperience

func (suo *StudentUpdateOne) ClearPracticalExperience() *StudentUpdateOne

ClearPracticalExperience clears all "practical_experience" edges to the PracticalExperience entity.

func (*StudentUpdateOne) ClearTutor

func (suo *StudentUpdateOne) ClearTutor() *StudentUpdateOne

ClearTutor clears the "tutor" edge to the Tutor entity.

func (*StudentUpdateOne) ClearUser

func (suo *StudentUpdateOne) ClearUser() *StudentUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*StudentUpdateOne) Exec

func (suo *StudentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StudentUpdateOne) ExecX

func (suo *StudentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudentUpdateOne) Mutation

func (suo *StudentUpdateOne) Mutation() *StudentMutation

Mutation returns the StudentMutation object of the builder.

func (*StudentUpdateOne) RemoveCertificate

func (suo *StudentUpdateOne) RemoveCertificate(c ...*Certificate) *StudentUpdateOne

RemoveCertificate removes "certificate" edges to Certificate entities.

func (*StudentUpdateOne) RemoveCertificateIDs

func (suo *StudentUpdateOne) RemoveCertificateIDs(ids ...int) *StudentUpdateOne

RemoveCertificateIDs removes the "certificate" edge to Certificate entities by IDs.

func (*StudentUpdateOne) RemoveEducationLevel

func (suo *StudentUpdateOne) RemoveEducationLevel(e ...*EducationLevel) *StudentUpdateOne

RemoveEducationLevel removes "education_level" edges to EducationLevel entities.

func (*StudentUpdateOne) RemoveEducationLevelIDs

func (suo *StudentUpdateOne) RemoveEducationLevelIDs(ids ...int) *StudentUpdateOne

RemoveEducationLevelIDs removes the "education_level" edge to EducationLevel entities by IDs.

func (*StudentUpdateOne) RemoveEnrollmentStatuIDs

func (suo *StudentUpdateOne) RemoveEnrollmentStatuIDs(ids ...int) *StudentUpdateOne

RemoveEnrollmentStatuIDs removes the "enrollment_status" edge to EnrollmentStatus entities by IDs.

func (*StudentUpdateOne) RemoveEnrollmentStatus

func (suo *StudentUpdateOne) RemoveEnrollmentStatus(e ...*EnrollmentStatus) *StudentUpdateOne

RemoveEnrollmentStatus removes "enrollment_status" edges to EnrollmentStatus entities.

func (*StudentUpdateOne) RemoveFamilyInfo

func (suo *StudentUpdateOne) RemoveFamilyInfo(f ...*FamilyInfo) *StudentUpdateOne

RemoveFamilyInfo removes "family_info" edges to FamilyInfo entities.

func (*StudentUpdateOne) RemoveFamilyInfoIDs

func (suo *StudentUpdateOne) RemoveFamilyInfoIDs(ids ...int) *StudentUpdateOne

RemoveFamilyInfoIDs removes the "family_info" edge to FamilyInfo entities by IDs.

func (*StudentUpdateOne) RemovePracticalExperience

func (suo *StudentUpdateOne) RemovePracticalExperience(p ...*PracticalExperience) *StudentUpdateOne

RemovePracticalExperience removes "practical_experience" edges to PracticalExperience entities.

func (*StudentUpdateOne) RemovePracticalExperienceIDs

func (suo *StudentUpdateOne) RemovePracticalExperienceIDs(ids ...int) *StudentUpdateOne

RemovePracticalExperienceIDs removes the "practical_experience" edge to PracticalExperience entities by IDs.

func (*StudentUpdateOne) Save

func (suo *StudentUpdateOne) Save(ctx context.Context) (*Student, error)

Save executes the query and returns the updated Student entity.

func (*StudentUpdateOne) SaveX

func (suo *StudentUpdateOne) SaveX(ctx context.Context) *Student

SaveX is like Save, but panics if an error occurs.

func (*StudentUpdateOne) Select

func (suo *StudentUpdateOne) Select(field string, fields ...string) *StudentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StudentUpdateOne) SetAge

func (suo *StudentUpdateOne) SetAge(i int) *StudentUpdateOne

SetAge sets the "age" field.

func (*StudentUpdateOne) SetAvatar

func (suo *StudentUpdateOne) SetAvatar(b []byte) *StudentUpdateOne

SetAvatar sets the "avatar" field.

func (*StudentUpdateOne) SetClass

func (suo *StudentUpdateOne) SetClass(c *Class) *StudentUpdateOne

SetClass sets the "class" edge to the Class entity.

func (*StudentUpdateOne) SetClassID

func (suo *StudentUpdateOne) SetClassID(id int) *StudentUpdateOne

SetClassID sets the "class" edge to the Class entity by ID.

func (*StudentUpdateOne) SetClassLeader

func (suo *StudentUpdateOne) SetClassLeader(c *ClassLeader) *StudentUpdateOne

SetClassLeader sets the "class_leader" edge to the ClassLeader entity.

func (*StudentUpdateOne) SetClassLeaderID

func (suo *StudentUpdateOne) SetClassLeaderID(id int) *StudentUpdateOne

SetClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID.

func (*StudentUpdateOne) SetCode

func (suo *StudentUpdateOne) SetCode(s string) *StudentUpdateOne

SetCode sets the "code" field.

func (*StudentUpdateOne) SetDepartment

func (suo *StudentUpdateOne) SetDepartment(d *Department) *StudentUpdateOne

SetDepartment sets the "department" edge to the Department entity.

func (*StudentUpdateOne) SetDepartmentID

func (suo *StudentUpdateOne) SetDepartmentID(id int) *StudentUpdateOne

SetDepartmentID sets the "department" edge to the Department entity by ID.

func (*StudentUpdateOne) SetMajor

func (suo *StudentUpdateOne) SetMajor(m *Major) *StudentUpdateOne

SetMajor sets the "major" edge to the Major entity.

func (*StudentUpdateOne) SetMajorID

func (suo *StudentUpdateOne) SetMajorID(id int) *StudentUpdateOne

SetMajorID sets the "major" edge to the Major entity by ID.

func (*StudentUpdateOne) SetName

func (suo *StudentUpdateOne) SetName(s string) *StudentUpdateOne

SetName sets the "name" field.

func (*StudentUpdateOne) SetNillableClassID

func (suo *StudentUpdateOne) SetNillableClassID(id *int) *StudentUpdateOne

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*StudentUpdateOne) SetNillableClassLeaderID

func (suo *StudentUpdateOne) SetNillableClassLeaderID(id *int) *StudentUpdateOne

SetNillableClassLeaderID sets the "class_leader" edge to the ClassLeader entity by ID if the given value is not nil.

func (*StudentUpdateOne) SetNillableDepartmentID

func (suo *StudentUpdateOne) SetNillableDepartmentID(id *int) *StudentUpdateOne

SetNillableDepartmentID sets the "department" edge to the Department entity by ID if the given value is not nil.

func (*StudentUpdateOne) SetNillableMajorID

func (suo *StudentUpdateOne) SetNillableMajorID(id *int) *StudentUpdateOne

SetNillableMajorID sets the "major" edge to the Major entity by ID if the given value is not nil.

func (*StudentUpdateOne) SetNillableTutorID

func (suo *StudentUpdateOne) SetNillableTutorID(id *int) *StudentUpdateOne

SetNillableTutorID sets the "tutor" edge to the Tutor entity by ID if the given value is not nil.

func (*StudentUpdateOne) SetNillableUserID

func (suo *StudentUpdateOne) SetNillableUserID(id *int) *StudentUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*StudentUpdateOne) SetSex

func (suo *StudentUpdateOne) SetSex(s string) *StudentUpdateOne

SetSex sets the "sex" field.

func (*StudentUpdateOne) SetTutor

func (suo *StudentUpdateOne) SetTutor(t *Tutor) *StudentUpdateOne

SetTutor sets the "tutor" edge to the Tutor entity.

func (*StudentUpdateOne) SetTutorID

func (suo *StudentUpdateOne) SetTutorID(id int) *StudentUpdateOne

SetTutorID sets the "tutor" edge to the Tutor entity by ID.

func (*StudentUpdateOne) SetUser

func (suo *StudentUpdateOne) SetUser(u *User) *StudentUpdateOne

SetUser sets the "user" edge to the User entity.

func (*StudentUpdateOne) SetUserID

func (suo *StudentUpdateOne) SetUserID(id int) *StudentUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*StudentUpdateOne) Where

Where appends a list predicates to the StudentUpdate builder.

type Students

type Students []*Student

Students is a parsable slice of Student.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tutor

type Tutor struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TutorQuery when eager-loading is set.
	Edges TutorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tutor is the model entity for the Tutor schema.

func (*Tutor) QueryClass

func (t *Tutor) QueryClass() *ClassQuery

QueryClass queries the "class" edge of the Tutor entity.

func (*Tutor) QueryStudent

func (t *Tutor) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the Tutor entity.

func (*Tutor) String

func (t *Tutor) String() string

String implements the fmt.Stringer.

func (*Tutor) Unwrap

func (t *Tutor) Unwrap() *Tutor

Unwrap unwraps the Tutor 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 (*Tutor) Update

func (t *Tutor) Update() *TutorUpdateOne

Update returns a builder for updating this Tutor. Note that you need to call Tutor.Unwrap() before calling this method if this Tutor was returned from a transaction, and the transaction was committed or rolled back.

type TutorClient

type TutorClient struct {
	// contains filtered or unexported fields
}

TutorClient is a client for the Tutor schema.

func NewTutorClient

func NewTutorClient(c config) *TutorClient

NewTutorClient returns a client for the Tutor from the given config.

func (*TutorClient) Create

func (c *TutorClient) Create() *TutorCreate

Create returns a builder for creating a Tutor entity.

func (*TutorClient) CreateBulk

func (c *TutorClient) CreateBulk(builders ...*TutorCreate) *TutorCreateBulk

CreateBulk returns a builder for creating a bulk of Tutor entities.

func (*TutorClient) Delete

func (c *TutorClient) Delete() *TutorDelete

Delete returns a delete builder for Tutor.

func (*TutorClient) DeleteOne

func (c *TutorClient) DeleteOne(t *Tutor) *TutorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TutorClient) DeleteOneID

func (c *TutorClient) DeleteOneID(id int) *TutorDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TutorClient) Get

func (c *TutorClient) Get(ctx context.Context, id int) (*Tutor, error)

Get returns a Tutor entity by its id.

func (*TutorClient) GetX

func (c *TutorClient) GetX(ctx context.Context, id int) *Tutor

GetX is like Get, but panics if an error occurs.

func (*TutorClient) Hooks

func (c *TutorClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TutorClient) Intercept

func (c *TutorClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tutor.Intercept(f(g(h())))`.

func (*TutorClient) Interceptors

func (c *TutorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TutorClient) Query

func (c *TutorClient) Query() *TutorQuery

Query returns a query builder for Tutor.

func (*TutorClient) QueryClass

func (c *TutorClient) QueryClass(t *Tutor) *ClassQuery

QueryClass queries the class edge of a Tutor.

func (*TutorClient) QueryStudent

func (c *TutorClient) QueryStudent(t *Tutor) *StudentQuery

QueryStudent queries the student edge of a Tutor.

func (*TutorClient) Update

func (c *TutorClient) Update() *TutorUpdate

Update returns an update builder for Tutor.

func (*TutorClient) UpdateOne

func (c *TutorClient) UpdateOne(t *Tutor) *TutorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TutorClient) UpdateOneID

func (c *TutorClient) UpdateOneID(id int) *TutorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TutorClient) Use

func (c *TutorClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tutor.Hooks(f(g(h())))`.

type TutorCreate

type TutorCreate struct {
	// contains filtered or unexported fields
}

TutorCreate is the builder for creating a Tutor entity.

func (*TutorCreate) Exec

func (tc *TutorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TutorCreate) ExecX

func (tc *TutorCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TutorCreate) Mutation

func (tc *TutorCreate) Mutation() *TutorMutation

Mutation returns the TutorMutation object of the builder.

func (*TutorCreate) Save

func (tc *TutorCreate) Save(ctx context.Context) (*Tutor, error)

Save creates the Tutor in the database.

func (*TutorCreate) SaveX

func (tc *TutorCreate) SaveX(ctx context.Context) *Tutor

SaveX calls Save and panics if Save returns an error.

func (*TutorCreate) SetClass

func (tc *TutorCreate) SetClass(c *Class) *TutorCreate

SetClass sets the "class" edge to the Class entity.

func (*TutorCreate) SetClassID

func (tc *TutorCreate) SetClassID(id int) *TutorCreate

SetClassID sets the "class" edge to the Class entity by ID.

func (*TutorCreate) SetNillableClassID

func (tc *TutorCreate) SetNillableClassID(id *int) *TutorCreate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*TutorCreate) SetNillableStudentID

func (tc *TutorCreate) SetNillableStudentID(id *int) *TutorCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*TutorCreate) SetStudent

func (tc *TutorCreate) SetStudent(s *Student) *TutorCreate

SetStudent sets the "student" edge to the Student entity.

func (*TutorCreate) SetStudentID

func (tc *TutorCreate) SetStudentID(id int) *TutorCreate

SetStudentID sets the "student" edge to the Student entity by ID.

type TutorCreateBulk

type TutorCreateBulk struct {
	// contains filtered or unexported fields
}

TutorCreateBulk is the builder for creating many Tutor entities in bulk.

func (*TutorCreateBulk) Exec

func (tcb *TutorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TutorCreateBulk) ExecX

func (tcb *TutorCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TutorCreateBulk) Save

func (tcb *TutorCreateBulk) Save(ctx context.Context) ([]*Tutor, error)

Save creates the Tutor entities in the database.

func (*TutorCreateBulk) SaveX

func (tcb *TutorCreateBulk) SaveX(ctx context.Context) []*Tutor

SaveX is like Save, but panics if an error occurs.

type TutorDelete

type TutorDelete struct {
	// contains filtered or unexported fields
}

TutorDelete is the builder for deleting a Tutor entity.

func (*TutorDelete) Exec

func (td *TutorDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TutorDelete) ExecX

func (td *TutorDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TutorDelete) Where

func (td *TutorDelete) Where(ps ...predicate.Tutor) *TutorDelete

Where appends a list predicates to the TutorDelete builder.

type TutorDeleteOne

type TutorDeleteOne struct {
	// contains filtered or unexported fields
}

TutorDeleteOne is the builder for deleting a single Tutor entity.

func (*TutorDeleteOne) Exec

func (tdo *TutorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TutorDeleteOne) ExecX

func (tdo *TutorDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TutorDeleteOne) Where

func (tdo *TutorDeleteOne) Where(ps ...predicate.Tutor) *TutorDeleteOne

Where appends a list predicates to the TutorDelete builder.

type TutorEdges

type TutorEdges struct {
	// Class holds the value of the class edge.
	Class *Class `json:"class,omitempty"`
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

TutorEdges holds the relations/edges for other nodes in the graph.

func (TutorEdges) ClassOrErr

func (e TutorEdges) ClassOrErr() (*Class, error)

ClassOrErr returns the Class value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TutorEdges) StudentOrErr

func (e TutorEdges) StudentOrErr() (*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TutorGroupBy

type TutorGroupBy struct {
	// contains filtered or unexported fields
}

TutorGroupBy is the group-by builder for Tutor entities.

func (*TutorGroupBy) Aggregate

func (tgb *TutorGroupBy) Aggregate(fns ...AggregateFunc) *TutorGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TutorGroupBy) Bool

func (s *TutorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) BoolX

func (s *TutorGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TutorGroupBy) Bools

func (s *TutorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) BoolsX

func (s *TutorGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TutorGroupBy) Float64

func (s *TutorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) Float64X

func (s *TutorGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TutorGroupBy) Float64s

func (s *TutorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) Float64sX

func (s *TutorGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TutorGroupBy) Int

func (s *TutorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) IntX

func (s *TutorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TutorGroupBy) Ints

func (s *TutorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) IntsX

func (s *TutorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TutorGroupBy) Scan

func (tgb *TutorGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TutorGroupBy) ScanX

func (s *TutorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TutorGroupBy) String

func (s *TutorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) StringX

func (s *TutorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TutorGroupBy) Strings

func (s *TutorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TutorGroupBy) StringsX

func (s *TutorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TutorMutation

type TutorMutation struct {
	// contains filtered or unexported fields
}

TutorMutation represents an operation that mutates the Tutor nodes in the graph.

func (*TutorMutation) AddField

func (m *TutorMutation) 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 (*TutorMutation) AddedEdges

func (m *TutorMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TutorMutation) AddedField

func (m *TutorMutation) 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 (*TutorMutation) AddedFields

func (m *TutorMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TutorMutation) AddedIDs

func (m *TutorMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TutorMutation) ClassCleared

func (m *TutorMutation) ClassCleared() bool

ClassCleared reports if the "class" edge to the Class entity was cleared.

func (*TutorMutation) ClassID

func (m *TutorMutation) ClassID() (id int, exists bool)

ClassID returns the "class" edge ID in the mutation.

func (*TutorMutation) ClassIDs

func (m *TutorMutation) ClassIDs() (ids []int)

ClassIDs returns the "class" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ClassID instead. It exists only for internal usage by the builders.

func (*TutorMutation) ClearClass

func (m *TutorMutation) ClearClass()

ClearClass clears the "class" edge to the Class entity.

func (*TutorMutation) ClearEdge

func (m *TutorMutation) 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 (*TutorMutation) ClearField

func (m *TutorMutation) 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 (*TutorMutation) ClearStudent

func (m *TutorMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*TutorMutation) ClearedEdges

func (m *TutorMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TutorMutation) ClearedFields

func (m *TutorMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TutorMutation) Client

func (m TutorMutation) 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 (*TutorMutation) EdgeCleared

func (m *TutorMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TutorMutation) Field

func (m *TutorMutation) 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 (*TutorMutation) FieldCleared

func (m *TutorMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TutorMutation) Fields

func (m *TutorMutation) 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 (*TutorMutation) ID

func (m *TutorMutation) 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 (*TutorMutation) IDs

func (m *TutorMutation) 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 (*TutorMutation) OldField

func (m *TutorMutation) 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 (*TutorMutation) Op

func (m *TutorMutation) Op() Op

Op returns the operation name.

func (*TutorMutation) RemovedEdges

func (m *TutorMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TutorMutation) RemovedIDs

func (m *TutorMutation) 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 (*TutorMutation) ResetClass

func (m *TutorMutation) ResetClass()

ResetClass resets all changes to the "class" edge.

func (*TutorMutation) ResetEdge

func (m *TutorMutation) 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 (*TutorMutation) ResetField

func (m *TutorMutation) 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 (*TutorMutation) ResetStudent

func (m *TutorMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*TutorMutation) SetClassID

func (m *TutorMutation) SetClassID(id int)

SetClassID sets the "class" edge to the Class entity by id.

func (*TutorMutation) SetField

func (m *TutorMutation) 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 (*TutorMutation) SetOp

func (m *TutorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TutorMutation) SetStudentID

func (m *TutorMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*TutorMutation) StudentCleared

func (m *TutorMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*TutorMutation) StudentID

func (m *TutorMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*TutorMutation) StudentIDs

func (m *TutorMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.

func (TutorMutation) Tx

func (m TutorMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TutorMutation) Type

func (m *TutorMutation) Type() string

Type returns the node type of this mutation (Tutor).

func (*TutorMutation) Where

func (m *TutorMutation) Where(ps ...predicate.Tutor)

Where appends a list predicates to the TutorMutation builder.

func (*TutorMutation) WhereP

func (m *TutorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TutorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TutorQuery

type TutorQuery struct {
	// contains filtered or unexported fields
}

TutorQuery is the builder for querying Tutor entities.

func (*TutorQuery) Aggregate

func (tq *TutorQuery) Aggregate(fns ...AggregateFunc) *TutorSelect

Aggregate returns a TutorSelect configured with the given aggregations.

func (*TutorQuery) All

func (tq *TutorQuery) All(ctx context.Context) ([]*Tutor, error)

All executes the query and returns a list of Tutors.

func (*TutorQuery) AllX

func (tq *TutorQuery) AllX(ctx context.Context) []*Tutor

AllX is like All, but panics if an error occurs.

func (*TutorQuery) Clone

func (tq *TutorQuery) Clone() *TutorQuery

Clone returns a duplicate of the TutorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TutorQuery) Count

func (tq *TutorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TutorQuery) CountX

func (tq *TutorQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TutorQuery) Exist

func (tq *TutorQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TutorQuery) ExistX

func (tq *TutorQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TutorQuery) First

func (tq *TutorQuery) First(ctx context.Context) (*Tutor, error)

First returns the first Tutor entity from the query. Returns a *NotFoundError when no Tutor was found.

func (*TutorQuery) FirstID

func (tq *TutorQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tutor ID from the query. Returns a *NotFoundError when no Tutor ID was found.

func (*TutorQuery) FirstIDX

func (tq *TutorQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TutorQuery) FirstX

func (tq *TutorQuery) FirstX(ctx context.Context) *Tutor

FirstX is like First, but panics if an error occurs.

func (*TutorQuery) GroupBy

func (tq *TutorQuery) GroupBy(field string, fields ...string) *TutorGroupBy

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.

func (*TutorQuery) IDs

func (tq *TutorQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Tutor IDs.

func (*TutorQuery) IDsX

func (tq *TutorQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TutorQuery) Limit

func (tq *TutorQuery) Limit(limit int) *TutorQuery

Limit the number of records to be returned by this query.

func (*TutorQuery) Offset

func (tq *TutorQuery) Offset(offset int) *TutorQuery

Offset to start from.

func (*TutorQuery) Only

func (tq *TutorQuery) Only(ctx context.Context) (*Tutor, error)

Only returns a single Tutor entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Tutor entity is found. Returns a *NotFoundError when no Tutor entities are found.

func (*TutorQuery) OnlyID

func (tq *TutorQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Tutor ID in the query. Returns a *NotSingularError when more than one Tutor ID is found. Returns a *NotFoundError when no entities are found.

func (*TutorQuery) OnlyIDX

func (tq *TutorQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TutorQuery) OnlyX

func (tq *TutorQuery) OnlyX(ctx context.Context) *Tutor

OnlyX is like Only, but panics if an error occurs.

func (*TutorQuery) Order

func (tq *TutorQuery) Order(o ...OrderFunc) *TutorQuery

Order specifies how the records should be ordered.

func (*TutorQuery) QueryClass

func (tq *TutorQuery) QueryClass() *ClassQuery

QueryClass chains the current query on the "class" edge.

func (*TutorQuery) QueryStudent

func (tq *TutorQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*TutorQuery) Select

func (tq *TutorQuery) Select(fields ...string) *TutorSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*TutorQuery) Unique

func (tq *TutorQuery) Unique(unique bool) *TutorQuery

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 (*TutorQuery) Where

func (tq *TutorQuery) Where(ps ...predicate.Tutor) *TutorQuery

Where adds a new predicate for the TutorQuery builder.

func (*TutorQuery) WithClass

func (tq *TutorQuery) WithClass(opts ...func(*ClassQuery)) *TutorQuery

WithClass tells the query-builder to eager-load the nodes that are connected to the "class" edge. The optional arguments are used to configure the query builder of the edge.

func (*TutorQuery) WithStudent

func (tq *TutorQuery) WithStudent(opts ...func(*StudentQuery)) *TutorQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type TutorSelect

type TutorSelect struct {
	*TutorQuery
	// contains filtered or unexported fields
}

TutorSelect is the builder for selecting fields of Tutor entities.

func (*TutorSelect) Aggregate

func (ts *TutorSelect) Aggregate(fns ...AggregateFunc) *TutorSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TutorSelect) Bool

func (s *TutorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TutorSelect) BoolX

func (s *TutorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TutorSelect) Bools

func (s *TutorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TutorSelect) BoolsX

func (s *TutorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TutorSelect) Float64

func (s *TutorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TutorSelect) Float64X

func (s *TutorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TutorSelect) Float64s

func (s *TutorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TutorSelect) Float64sX

func (s *TutorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TutorSelect) Int

func (s *TutorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TutorSelect) IntX

func (s *TutorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TutorSelect) Ints

func (s *TutorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TutorSelect) IntsX

func (s *TutorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TutorSelect) Scan

func (ts *TutorSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TutorSelect) ScanX

func (s *TutorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TutorSelect) String

func (s *TutorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TutorSelect) StringX

func (s *TutorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TutorSelect) Strings

func (s *TutorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TutorSelect) StringsX

func (s *TutorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TutorUpdate

type TutorUpdate struct {
	// contains filtered or unexported fields
}

TutorUpdate is the builder for updating Tutor entities.

func (*TutorUpdate) ClearClass

func (tu *TutorUpdate) ClearClass() *TutorUpdate

ClearClass clears the "class" edge to the Class entity.

func (*TutorUpdate) ClearStudent

func (tu *TutorUpdate) ClearStudent() *TutorUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*TutorUpdate) Exec

func (tu *TutorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TutorUpdate) ExecX

func (tu *TutorUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TutorUpdate) Mutation

func (tu *TutorUpdate) Mutation() *TutorMutation

Mutation returns the TutorMutation object of the builder.

func (*TutorUpdate) Save

func (tu *TutorUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TutorUpdate) SaveX

func (tu *TutorUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TutorUpdate) SetClass

func (tu *TutorUpdate) SetClass(c *Class) *TutorUpdate

SetClass sets the "class" edge to the Class entity.

func (*TutorUpdate) SetClassID

func (tu *TutorUpdate) SetClassID(id int) *TutorUpdate

SetClassID sets the "class" edge to the Class entity by ID.

func (*TutorUpdate) SetNillableClassID

func (tu *TutorUpdate) SetNillableClassID(id *int) *TutorUpdate

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*TutorUpdate) SetNillableStudentID

func (tu *TutorUpdate) SetNillableStudentID(id *int) *TutorUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*TutorUpdate) SetStudent

func (tu *TutorUpdate) SetStudent(s *Student) *TutorUpdate

SetStudent sets the "student" edge to the Student entity.

func (*TutorUpdate) SetStudentID

func (tu *TutorUpdate) SetStudentID(id int) *TutorUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*TutorUpdate) Where

func (tu *TutorUpdate) Where(ps ...predicate.Tutor) *TutorUpdate

Where appends a list predicates to the TutorUpdate builder.

type TutorUpdateOne

type TutorUpdateOne struct {
	// contains filtered or unexported fields
}

TutorUpdateOne is the builder for updating a single Tutor entity.

func (*TutorUpdateOne) ClearClass

func (tuo *TutorUpdateOne) ClearClass() *TutorUpdateOne

ClearClass clears the "class" edge to the Class entity.

func (*TutorUpdateOne) ClearStudent

func (tuo *TutorUpdateOne) ClearStudent() *TutorUpdateOne

ClearStudent clears the "student" edge to the Student entity.

func (*TutorUpdateOne) Exec

func (tuo *TutorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TutorUpdateOne) ExecX

func (tuo *TutorUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TutorUpdateOne) Mutation

func (tuo *TutorUpdateOne) Mutation() *TutorMutation

Mutation returns the TutorMutation object of the builder.

func (*TutorUpdateOne) Save

func (tuo *TutorUpdateOne) Save(ctx context.Context) (*Tutor, error)

Save executes the query and returns the updated Tutor entity.

func (*TutorUpdateOne) SaveX

func (tuo *TutorUpdateOne) SaveX(ctx context.Context) *Tutor

SaveX is like Save, but panics if an error occurs.

func (*TutorUpdateOne) Select

func (tuo *TutorUpdateOne) Select(field string, fields ...string) *TutorUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TutorUpdateOne) SetClass

func (tuo *TutorUpdateOne) SetClass(c *Class) *TutorUpdateOne

SetClass sets the "class" edge to the Class entity.

func (*TutorUpdateOne) SetClassID

func (tuo *TutorUpdateOne) SetClassID(id int) *TutorUpdateOne

SetClassID sets the "class" edge to the Class entity by ID.

func (*TutorUpdateOne) SetNillableClassID

func (tuo *TutorUpdateOne) SetNillableClassID(id *int) *TutorUpdateOne

SetNillableClassID sets the "class" edge to the Class entity by ID if the given value is not nil.

func (*TutorUpdateOne) SetNillableStudentID

func (tuo *TutorUpdateOne) SetNillableStudentID(id *int) *TutorUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*TutorUpdateOne) SetStudent

func (tuo *TutorUpdateOne) SetStudent(s *Student) *TutorUpdateOne

SetStudent sets the "student" edge to the Student entity.

func (*TutorUpdateOne) SetStudentID

func (tuo *TutorUpdateOne) SetStudentID(id int) *TutorUpdateOne

SetStudentID sets the "student" edge to the Student entity by ID.

func (*TutorUpdateOne) Where

func (tuo *TutorUpdateOne) Where(ps ...predicate.Tutor) *TutorUpdateOne

Where appends a list predicates to the TutorUpdate builder.

type Tutors

type Tutors []*Tutor

Tutors is a parsable slice of Tutor.

type Tx

type Tx struct {

	// Authorization is the client for interacting with the Authorization builders.
	Authorization *AuthorizationClient
	// Campus is the client for interacting with the Campus builders.
	Campus *CampusClient
	// Certificate is the client for interacting with the Certificate builders.
	Certificate *CertificateClient
	// Class is the client for interacting with the Class builders.
	Class *ClassClient
	// ClassLeader is the client for interacting with the ClassLeader builders.
	ClassLeader *ClassLeaderClient
	// Department is the client for interacting with the Department builders.
	Department *DepartmentClient
	// EducationLevel is the client for interacting with the EducationLevel builders.
	EducationLevel *EducationLevelClient
	// EnrollmentStatus is the client for interacting with the EnrollmentStatus builders.
	EnrollmentStatus *EnrollmentStatusClient
	// FamilyInfo is the client for interacting with the FamilyInfo builders.
	FamilyInfo *FamilyInfoClient
	// Major is the client for interacting with the Major builders.
	Major *MajorClient
	// MajorDirection is the client for interacting with the MajorDirection builders.
	MajorDirection *MajorDirectionClient
	// PracticalExperience is the client for interacting with the PracticalExperience builders.
	PracticalExperience *PracticalExperienceClient
	// Resource is the client for interacting with the Resource builders.
	Resource *ResourceClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Student is the client for interacting with the Student builders.
	Student *StudentClient
	// Tutor is the client for interacting with the Tutor builders.
	Tutor *TutorClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) 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"`
	// Account holds the value of the "account" field.
	Account string `json:"account,omitempty"`
	// Passwd holds the value of the "passwd" field.
	Passwd string `json:"passwd,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Avatar holds the value of the "avatar" field.
	Avatar *[]byte `json:"avatar,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryResource

func (u *User) QueryResource() *ResourceQuery

QueryResource queries the "resource" edge of the User entity.

func (*User) QueryRole

func (u *User) QueryRole() *RoleQuery

QueryRole queries the "role" edge of the User entity.

func (*User) QueryStudent

func (u *User) QueryStudent() *StudentQuery

QueryStudent queries the "student" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryResource

func (c *UserClient) QueryResource(u *User) *ResourceQuery

QueryResource queries the resource edge of a User.

func (*UserClient) QueryRole

func (c *UserClient) QueryRole(u *User) *RoleQuery

QueryRole queries the role edge of a User.

func (*UserClient) QueryStudent

func (c *UserClient) QueryStudent(u *User) *StudentQuery

QueryStudent queries the student edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddResource

func (uc *UserCreate) AddResource(r ...*Resource) *UserCreate

AddResource adds the "resource" edges to the Resource entity.

func (*UserCreate) AddResourceIDs

func (uc *UserCreate) AddResourceIDs(ids ...int) *UserCreate

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*UserCreate) AddRole

func (uc *UserCreate) AddRole(r ...*Role) *UserCreate

AddRole adds the "role" edges to the Role entity.

func (*UserCreate) AddRoleIDs

func (uc *UserCreate) AddRoleIDs(ids ...int) *UserCreate

AddRoleIDs adds the "role" edge to the Role entity by IDs.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAccount

func (uc *UserCreate) SetAccount(s string) *UserCreate

SetAccount sets the "account" field.

func (*UserCreate) SetAvatar

func (uc *UserCreate) SetAvatar(b []byte) *UserCreate

SetAvatar sets the "avatar" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetNillableStudentID

func (uc *UserCreate) SetNillableStudentID(id *int) *UserCreate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*UserCreate) SetPasswd

func (uc *UserCreate) SetPasswd(s string) *UserCreate

SetPasswd sets the "passwd" field.

func (*UserCreate) SetStudent

func (uc *UserCreate) SetStudent(s *Student) *UserCreate

SetStudent sets the "student" edge to the Student entity.

func (*UserCreate) SetStudentID

func (uc *UserCreate) SetStudentID(id int) *UserCreate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Role holds the value of the role edge.
	Role []*Role `json:"role,omitempty"`
	// Resource holds the value of the resource edge.
	Resource []*Resource `json:"resource,omitempty"`
	// Student holds the value of the student edge.
	Student *Student `json:"student,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) ResourceOrErr

func (e UserEdges) ResourceOrErr() ([]*Resource, error)

ResourceOrErr returns the Resource value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RoleOrErr

func (e UserEdges) RoleOrErr() ([]*Role, error)

RoleOrErr returns the Role value or an error if the edge was not loaded in eager-loading.

func (UserEdges) StudentOrErr

func (e UserEdges) StudentOrErr() (*Student, error)

StudentOrErr returns the Student value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) Account

func (m *UserMutation) Account() (r string, exists bool)

Account returns the value of the "account" field in the mutation.

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) AddResourceIDs

func (m *UserMutation) AddResourceIDs(ids ...int)

AddResourceIDs adds the "resource" edge to the Resource entity by ids.

func (*UserMutation) AddRoleIDs

func (m *UserMutation) AddRoleIDs(ids ...int)

AddRoleIDs adds the "role" edge to the Role entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) Avatar

func (m *UserMutation) Avatar() (r []byte, exists bool)

Avatar returns the value of the "avatar" field in the 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) ClearResource

func (m *UserMutation) ClearResource()

ClearResource clears the "resource" edge to the Resource entity.

func (*UserMutation) ClearRole

func (m *UserMutation) ClearRole()

ClearRole clears the "role" edge to the Role entity.

func (*UserMutation) ClearStudent

func (m *UserMutation) ClearStudent()

ClearStudent clears the "student" edge to the Student entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) OldAccount

func (m *UserMutation) OldAccount(ctx context.Context) (v string, err error)

OldAccount returns the old "account" 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) OldAvatar

func (m *UserMutation) OldAvatar(ctx context.Context) (v *[]byte, err error)

OldAvatar returns the old "avatar" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldPasswd

func (m *UserMutation) OldPasswd(ctx context.Context) (v string, err error)

OldPasswd returns the old "passwd" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Passwd

func (m *UserMutation) Passwd() (r string, exists bool)

Passwd returns the value of the "passwd" field in the mutation.

func (*UserMutation) RemoveResourceIDs

func (m *UserMutation) RemoveResourceIDs(ids ...int)

RemoveResourceIDs removes the "resource" edge to the Resource entity by IDs.

func (*UserMutation) RemoveRoleIDs

func (m *UserMutation) RemoveRoleIDs(ids ...int)

RemoveRoleIDs removes the "role" edge to the Role entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedResourceIDs

func (m *UserMutation) RemovedResourceIDs() (ids []int)

RemovedResource returns the removed IDs of the "resource" edge to the Resource entity.

func (*UserMutation) RemovedRoleIDs

func (m *UserMutation) RemovedRoleIDs() (ids []int)

RemovedRole returns the removed IDs of the "role" edge to the Role entity.

func (*UserMutation) ResetAccount

func (m *UserMutation) ResetAccount()

ResetAccount resets all changes to the "account" field.

func (*UserMutation) ResetAvatar

func (m *UserMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetPasswd

func (m *UserMutation) ResetPasswd()

ResetPasswd resets all changes to the "passwd" field.

func (*UserMutation) ResetResource

func (m *UserMutation) ResetResource()

ResetResource resets all changes to the "resource" edge.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" edge.

func (*UserMutation) ResetStudent

func (m *UserMutation) ResetStudent()

ResetStudent resets all changes to the "student" edge.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) ResourceCleared

func (m *UserMutation) ResourceCleared() bool

ResourceCleared reports if the "resource" edge to the Resource entity was cleared.

func (*UserMutation) ResourceIDs

func (m *UserMutation) ResourceIDs() (ids []int)

ResourceIDs returns the "resource" edge IDs in the mutation.

func (*UserMutation) RoleCleared

func (m *UserMutation) RoleCleared() bool

RoleCleared reports if the "role" edge to the Role entity was cleared.

func (*UserMutation) RoleIDs

func (m *UserMutation) RoleIDs() (ids []int)

RoleIDs returns the "role" edge IDs in the mutation.

func (*UserMutation) SetAccount

func (m *UserMutation) SetAccount(s string)

SetAccount sets the "account" field.

func (*UserMutation) SetAvatar

func (m *UserMutation) SetAvatar(b []byte)

SetAvatar sets the "avatar" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPasswd

func (m *UserMutation) SetPasswd(s string)

SetPasswd sets the "passwd" field.

func (*UserMutation) SetStudentID

func (m *UserMutation) SetStudentID(id int)

SetStudentID sets the "student" edge to the Student entity by id.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UserMutation) StudentCleared

func (m *UserMutation) StudentCleared() bool

StudentCleared reports if the "student" edge to the Student entity was cleared.

func (*UserMutation) StudentID

func (m *UserMutation) StudentID() (id int, exists bool)

StudentID returns the "student" edge ID in the mutation.

func (*UserMutation) StudentIDs

func (m *UserMutation) StudentIDs() (ids []int)

StudentIDs returns the "student" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudentID instead. It exists only for internal usage by the builders.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id 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 {
	Account string `json:"account,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldAccount).
	Aggregate(domain.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryResource

func (uq *UserQuery) QueryResource() *ResourceQuery

QueryResource chains the current query on the "resource" edge.

func (*UserQuery) QueryRole

func (uq *UserQuery) QueryRole() *RoleQuery

QueryRole chains the current query on the "role" edge.

func (*UserQuery) QueryStudent

func (uq *UserQuery) QueryStudent() *StudentQuery

QueryStudent chains the current query on the "student" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Account string `json:"account,omitempty"`
}

client.User.Query().
	Select(user.FieldAccount).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithResource

func (uq *UserQuery) WithResource(opts ...func(*ResourceQuery)) *UserQuery

WithResource tells the query-builder to eager-load the nodes that are connected to the "resource" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRole

func (uq *UserQuery) WithRole(opts ...func(*RoleQuery)) *UserQuery

WithRole tells the query-builder to eager-load the nodes that are connected to the "role" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithStudent

func (uq *UserQuery) WithStudent(opts ...func(*StudentQuery)) *UserQuery

WithStudent tells the query-builder to eager-load the nodes that are connected to the "student" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddResource

func (uu *UserUpdate) AddResource(r ...*Resource) *UserUpdate

AddResource adds the "resource" edges to the Resource entity.

func (*UserUpdate) AddResourceIDs

func (uu *UserUpdate) AddResourceIDs(ids ...int) *UserUpdate

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*UserUpdate) AddRole

func (uu *UserUpdate) AddRole(r ...*Role) *UserUpdate

AddRole adds the "role" edges to the Role entity.

func (*UserUpdate) AddRoleIDs

func (uu *UserUpdate) AddRoleIDs(ids ...int) *UserUpdate

AddRoleIDs adds the "role" edge to the Role entity by IDs.

func (*UserUpdate) ClearResource

func (uu *UserUpdate) ClearResource() *UserUpdate

ClearResource clears all "resource" edges to the Resource entity.

func (*UserUpdate) ClearRole

func (uu *UserUpdate) ClearRole() *UserUpdate

ClearRole clears all "role" edges to the Role entity.

func (*UserUpdate) ClearStudent

func (uu *UserUpdate) ClearStudent() *UserUpdate

ClearStudent clears the "student" edge to the Student entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveResource

func (uu *UserUpdate) RemoveResource(r ...*Resource) *UserUpdate

RemoveResource removes "resource" edges to Resource entities.

func (*UserUpdate) RemoveResourceIDs

func (uu *UserUpdate) RemoveResourceIDs(ids ...int) *UserUpdate

RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.

func (*UserUpdate) RemoveRole

func (uu *UserUpdate) RemoveRole(r ...*Role) *UserUpdate

RemoveRole removes "role" edges to Role entities.

func (*UserUpdate) RemoveRoleIDs

func (uu *UserUpdate) RemoveRoleIDs(ids ...int) *UserUpdate

RemoveRoleIDs removes the "role" edge to Role entities by IDs.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAccount

func (uu *UserUpdate) SetAccount(s string) *UserUpdate

SetAccount sets the "account" field.

func (*UserUpdate) SetAvatar

func (uu *UserUpdate) SetAvatar(b []byte) *UserUpdate

SetAvatar sets the "avatar" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableStudentID

func (uu *UserUpdate) SetNillableStudentID(id *int) *UserUpdate

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*UserUpdate) SetPasswd

func (uu *UserUpdate) SetPasswd(s string) *UserUpdate

SetPasswd sets the "passwd" field.

func (*UserUpdate) SetStudent

func (uu *UserUpdate) SetStudent(s *Student) *UserUpdate

SetStudent sets the "student" edge to the Student entity.

func (*UserUpdate) SetStudentID

func (uu *UserUpdate) SetStudentID(id int) *UserUpdate

SetStudentID sets the "student" edge to the Student entity by ID.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddResource

func (uuo *UserUpdateOne) AddResource(r ...*Resource) *UserUpdateOne

AddResource adds the "resource" edges to the Resource entity.

func (*UserUpdateOne) AddResourceIDs

func (uuo *UserUpdateOne) AddResourceIDs(ids ...int) *UserUpdateOne

AddResourceIDs adds the "resource" edge to the Resource entity by IDs.

func (*UserUpdateOne) AddRole

func (uuo *UserUpdateOne) AddRole(r ...*Role) *UserUpdateOne

AddRole adds the "role" edges to the Role entity.

func (*UserUpdateOne) AddRoleIDs

func (uuo *UserUpdateOne) AddRoleIDs(ids ...int) *UserUpdateOne

AddRoleIDs adds the "role" edge to the Role entity by IDs.

func (*UserUpdateOne) ClearResource

func (uuo *UserUpdateOne) ClearResource() *UserUpdateOne

ClearResource clears all "resource" edges to the Resource entity.

func (*UserUpdateOne) ClearRole

func (uuo *UserUpdateOne) ClearRole() *UserUpdateOne

ClearRole clears all "role" edges to the Role entity.

func (*UserUpdateOne) ClearStudent

func (uuo *UserUpdateOne) ClearStudent() *UserUpdateOne

ClearStudent clears the "student" edge to the Student entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveResource

func (uuo *UserUpdateOne) RemoveResource(r ...*Resource) *UserUpdateOne

RemoveResource removes "resource" edges to Resource entities.

func (*UserUpdateOne) RemoveResourceIDs

func (uuo *UserUpdateOne) RemoveResourceIDs(ids ...int) *UserUpdateOne

RemoveResourceIDs removes the "resource" edge to Resource entities by IDs.

func (*UserUpdateOne) RemoveRole

func (uuo *UserUpdateOne) RemoveRole(r ...*Role) *UserUpdateOne

RemoveRole removes "role" edges to Role entities.

func (*UserUpdateOne) RemoveRoleIDs

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int) *UserUpdateOne

RemoveRoleIDs removes the "role" edge to Role entities by IDs.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAccount

func (uuo *UserUpdateOne) SetAccount(s string) *UserUpdateOne

SetAccount sets the "account" field.

func (*UserUpdateOne) SetAvatar

func (uuo *UserUpdateOne) SetAvatar(b []byte) *UserUpdateOne

SetAvatar sets the "avatar" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableStudentID

func (uuo *UserUpdateOne) SetNillableStudentID(id *int) *UserUpdateOne

SetNillableStudentID sets the "student" edge to the Student entity by ID if the given value is not nil.

func (*UserUpdateOne) SetPasswd

func (uuo *UserUpdateOne) SetPasswd(s string) *UserUpdateOne

SetPasswd sets the "passwd" field.

func (*UserUpdateOne) SetStudent

func (uuo *UserUpdateOne) SetStudent(s *Student) *UserUpdateOne

SetStudent sets the "student" edge to the Student entity.

func (*UserUpdateOne) SetStudentID

func (uuo *UserUpdateOne) SetStudentID(id int) *UserUpdateOne

SetStudentID sets the "student" edge to the Student entity by ID.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL