lion

package
v0.3.9-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 38 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.
	TypeAuthProviders   = "AuthProviders"
	TypeCredentials     = "Credentials"
	TypeDemo            = "Demo"
	TypeDepartmentRoles = "DepartmentRoles"
	TypeDepartments     = "Departments"
	TypeGroupRoles      = "GroupRoles"
	TypeGroups          = "Groups"
	TypePermissions     = "Permissions"
	TypePolicies        = "Policies"
	TypeResources       = "Resources"
	TypeRolePermissions = "RolePermissions"
	TypeRoles           = "Roles"
	TypeUserDepartments = "UserDepartments"
	TypeUserGroups      = "UserGroups"
	TypeUserIdentities  = "UserIdentities"
	TypeUserProfiles    = "UserProfiles"
	TypeUserRoles       = "UserRoles"
	TypeUsers           = "Users"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type 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(lion.As(lion.Sum(field1), "sum_field1"), (lion.As(lion.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 AuthProviders

type AuthProviders struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 认证提供方名称
	Name string `json:"name,omitempty"`
	// 支持的认证提供方
	ProviderType int `json:"provider_type,omitempty"`
	// ClientID holds the value of the "client_id" field.
	ClientID string `json:"client_id,omitempty"`
	// Enabled holds the value of the "enabled" field.
	Enabled bool `json:"enabled,omitempty"`
	// ClientSecretEncrypted holds the value of the "client_secret_encrypted" field.
	ClientSecretEncrypted []byte `json:"-"`
	// Scopes holds the value of the "scopes" field.
	Scopes string `json:"scopes,omitempty"`
	// RedirectURI holds the value of the "redirect_uri" field.
	RedirectURI string `json:"redirect_uri,omitempty"`
	// Issuer holds the value of the "issuer" field.
	Issuer string `json:"issuer,omitempty"`
	// AuthorizationEndpoint holds the value of the "authorization_endpoint" field.
	AuthorizationEndpoint string `json:"authorization_endpoint,omitempty"`
	// TokenEndpoint holds the value of the "token_endpoint" field.
	TokenEndpoint string `json:"token_endpoint,omitempty"`
	// UserinfoEndpoint holds the value of the "userinfo_endpoint" field.
	UserinfoEndpoint string `json:"userinfo_endpoint,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthProvidersQuery when eager-loading is set.
	Edges AuthProvidersEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuthProviders is the model entity for the AuthProviders schema.

func (*AuthProviders) QueryLionUserIdentities

func (_m *AuthProviders) QueryLionUserIdentities() *UserIdentitiesQuery

QueryLionUserIdentities queries the "lion_user_identities" edge of the AuthProviders entity.

func (*AuthProviders) String

func (_m *AuthProviders) String() string

String implements the fmt.Stringer.

func (*AuthProviders) Unwrap

func (_m *AuthProviders) Unwrap() *AuthProviders

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

func (_m *AuthProviders) Update() *AuthProvidersUpdateOne

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

func (*AuthProviders) Value

func (_m *AuthProviders) Value(name string) (ent.Value, error)

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

type AuthProvidersClient

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

AuthProvidersClient is a client for the AuthProviders schema.

func NewAuthProvidersClient

func NewAuthProvidersClient(c config) *AuthProvidersClient

NewAuthProvidersClient returns a client for the AuthProviders from the given config.

func (*AuthProvidersClient) Create

Create returns a builder for creating a AuthProviders entity.

func (*AuthProvidersClient) CreateBulk

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

func (*AuthProvidersClient) Delete

Delete returns a delete builder for AuthProviders.

func (*AuthProvidersClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthProvidersClient) DeleteOneID

func (c *AuthProvidersClient) DeleteOneID(id int) *AuthProvidersDeleteOne

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

func (*AuthProvidersClient) Get

Get returns a AuthProviders entity by its id.

func (*AuthProvidersClient) GetX

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

func (*AuthProvidersClient) Hooks

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

Hooks returns the client hooks.

func (*AuthProvidersClient) Intercept

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

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

func (*AuthProvidersClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthProvidersClient) MapCreateBulk

func (c *AuthProvidersClient) MapCreateBulk(slice any, setFunc func(*AuthProvidersCreate, int)) *AuthProvidersCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AuthProvidersClient) Query

Query returns a query builder for AuthProviders.

func (*AuthProvidersClient) QueryLionUserIdentities

func (c *AuthProvidersClient) QueryLionUserIdentities(_m *AuthProviders) *UserIdentitiesQuery

QueryLionUserIdentities queries the lion_user_identities edge of a AuthProviders.

func (*AuthProvidersClient) Update

Update returns an update builder for AuthProviders.

func (*AuthProvidersClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthProvidersClient) UpdateOneID

func (c *AuthProvidersClient) UpdateOneID(id int) *AuthProvidersUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuthProvidersClient) Use

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

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

type AuthProvidersCreate

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

AuthProvidersCreate is the builder for creating a AuthProviders entity.

func (*AuthProvidersCreate) AddLionUserIdentities

func (_c *AuthProvidersCreate) AddLionUserIdentities(v ...*UserIdentities) *AuthProvidersCreate

AddLionUserIdentities adds the "lion_user_identities" edges to the UserIdentities entity.

func (*AuthProvidersCreate) AddLionUserIdentityIDs

func (_c *AuthProvidersCreate) AddLionUserIdentityIDs(ids ...int) *AuthProvidersCreate

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*AuthProvidersCreate) Exec

func (_c *AuthProvidersCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthProvidersCreate) ExecX

func (_c *AuthProvidersCreate) ExecX(ctx context.Context)

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

func (*AuthProvidersCreate) Mutation

Mutation returns the AuthProvidersMutation object of the builder.

func (*AuthProvidersCreate) Save

Save creates the AuthProviders in the database.

func (*AuthProvidersCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AuthProvidersCreate) SetAuthorizationEndpoint

func (_c *AuthProvidersCreate) SetAuthorizationEndpoint(v string) *AuthProvidersCreate

SetAuthorizationEndpoint sets the "authorization_endpoint" field.

func (*AuthProvidersCreate) SetClientID

func (_c *AuthProvidersCreate) SetClientID(v string) *AuthProvidersCreate

SetClientID sets the "client_id" field.

func (*AuthProvidersCreate) SetClientSecretEncrypted

func (_c *AuthProvidersCreate) SetClientSecretEncrypted(v []byte) *AuthProvidersCreate

SetClientSecretEncrypted sets the "client_secret_encrypted" field.

func (*AuthProvidersCreate) SetCreatedAt

func (_c *AuthProvidersCreate) SetCreatedAt(v time.Time) *AuthProvidersCreate

SetCreatedAt sets the "created_at" field.

func (*AuthProvidersCreate) SetCreatedBy

func (_c *AuthProvidersCreate) SetCreatedBy(v int64) *AuthProvidersCreate

SetCreatedBy sets the "created_by" field.

func (*AuthProvidersCreate) SetEnabled

func (_c *AuthProvidersCreate) SetEnabled(v bool) *AuthProvidersCreate

SetEnabled sets the "enabled" field.

func (*AuthProvidersCreate) SetIssuer

SetIssuer sets the "issuer" field.

func (*AuthProvidersCreate) SetName

SetName sets the "name" field.

func (*AuthProvidersCreate) SetNillableAuthorizationEndpoint

func (_c *AuthProvidersCreate) SetNillableAuthorizationEndpoint(v *string) *AuthProvidersCreate

SetNillableAuthorizationEndpoint sets the "authorization_endpoint" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableClientID

func (_c *AuthProvidersCreate) SetNillableClientID(v *string) *AuthProvidersCreate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableCreatedAt

func (_c *AuthProvidersCreate) SetNillableCreatedAt(v *time.Time) *AuthProvidersCreate

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

func (*AuthProvidersCreate) SetNillableCreatedBy

func (_c *AuthProvidersCreate) SetNillableCreatedBy(v *int64) *AuthProvidersCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableEnabled

func (_c *AuthProvidersCreate) SetNillableEnabled(v *bool) *AuthProvidersCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableIssuer

func (_c *AuthProvidersCreate) SetNillableIssuer(v *string) *AuthProvidersCreate

SetNillableIssuer sets the "issuer" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableRedirectURI

func (_c *AuthProvidersCreate) SetNillableRedirectURI(v *string) *AuthProvidersCreate

SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableScopes

func (_c *AuthProvidersCreate) SetNillableScopes(v *string) *AuthProvidersCreate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableTokenEndpoint

func (_c *AuthProvidersCreate) SetNillableTokenEndpoint(v *string) *AuthProvidersCreate

SetNillableTokenEndpoint sets the "token_endpoint" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableUpdatedAt

func (_c *AuthProvidersCreate) SetNillableUpdatedAt(v *time.Time) *AuthProvidersCreate

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

func (*AuthProvidersCreate) SetNillableUpdatedBy

func (_c *AuthProvidersCreate) SetNillableUpdatedBy(v *int64) *AuthProvidersCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableUserinfoEndpoint

func (_c *AuthProvidersCreate) SetNillableUserinfoEndpoint(v *string) *AuthProvidersCreate

SetNillableUserinfoEndpoint sets the "userinfo_endpoint" field if the given value is not nil.

func (*AuthProvidersCreate) SetProviderType

func (_c *AuthProvidersCreate) SetProviderType(v int) *AuthProvidersCreate

SetProviderType sets the "provider_type" field.

func (*AuthProvidersCreate) SetRedirectURI

func (_c *AuthProvidersCreate) SetRedirectURI(v string) *AuthProvidersCreate

SetRedirectURI sets the "redirect_uri" field.

func (*AuthProvidersCreate) SetScopes

SetScopes sets the "scopes" field.

func (*AuthProvidersCreate) SetTokenEndpoint

func (_c *AuthProvidersCreate) SetTokenEndpoint(v string) *AuthProvidersCreate

SetTokenEndpoint sets the "token_endpoint" field.

func (*AuthProvidersCreate) SetUpdatedAt

func (_c *AuthProvidersCreate) SetUpdatedAt(v time.Time) *AuthProvidersCreate

SetUpdatedAt sets the "updated_at" field.

func (*AuthProvidersCreate) SetUpdatedBy

func (_c *AuthProvidersCreate) SetUpdatedBy(v int64) *AuthProvidersCreate

SetUpdatedBy sets the "updated_by" field.

func (*AuthProvidersCreate) SetUserinfoEndpoint

func (_c *AuthProvidersCreate) SetUserinfoEndpoint(v string) *AuthProvidersCreate

SetUserinfoEndpoint sets the "userinfo_endpoint" field.

type AuthProvidersCreateBulk

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

AuthProvidersCreateBulk is the builder for creating many AuthProviders entities in bulk.

func (*AuthProvidersCreateBulk) Exec

Exec executes the query.

func (*AuthProvidersCreateBulk) ExecX

func (_c *AuthProvidersCreateBulk) ExecX(ctx context.Context)

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

func (*AuthProvidersCreateBulk) Save

Save creates the AuthProviders entities in the database.

func (*AuthProvidersCreateBulk) SaveX

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

type AuthProvidersDelete

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

AuthProvidersDelete is the builder for deleting a AuthProviders entity.

func (*AuthProvidersDelete) Exec

func (_d *AuthProvidersDelete) Exec(ctx context.Context) (int, error)

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

func (*AuthProvidersDelete) ExecX

func (_d *AuthProvidersDelete) ExecX(ctx context.Context) int

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

func (*AuthProvidersDelete) Where

Where appends a list predicates to the AuthProvidersDelete builder.

type AuthProvidersDeleteOne

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

AuthProvidersDeleteOne is the builder for deleting a single AuthProviders entity.

func (*AuthProvidersDeleteOne) Exec

Exec executes the deletion query.

func (*AuthProvidersDeleteOne) ExecX

func (_d *AuthProvidersDeleteOne) ExecX(ctx context.Context)

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

func (*AuthProvidersDeleteOne) Where

Where appends a list predicates to the AuthProvidersDelete builder.

type AuthProvidersEdges

type AuthProvidersEdges struct {
	// LionUserIdentities holds the value of the lion_user_identities edge.
	LionUserIdentities []*UserIdentities `json:"lion_user_identities,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthProvidersEdges) LionUserIdentitiesOrErr

func (e AuthProvidersEdges) LionUserIdentitiesOrErr() ([]*UserIdentities, error)

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

type AuthProvidersGroupBy

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

AuthProvidersGroupBy is the group-by builder for AuthProviders entities.

func (*AuthProvidersGroupBy) Aggregate

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

func (*AuthProvidersGroupBy) Bool

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

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

func (*AuthProvidersGroupBy) BoolX

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

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

func (*AuthProvidersGroupBy) Bools

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

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

func (*AuthProvidersGroupBy) BoolsX

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

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

func (*AuthProvidersGroupBy) Float64

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

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

func (*AuthProvidersGroupBy) Float64X

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

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

func (*AuthProvidersGroupBy) Float64s

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

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

func (*AuthProvidersGroupBy) Float64sX

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

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

func (*AuthProvidersGroupBy) Int

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

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

func (*AuthProvidersGroupBy) IntX

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

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

func (*AuthProvidersGroupBy) Ints

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

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

func (*AuthProvidersGroupBy) IntsX

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

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

func (*AuthProvidersGroupBy) Scan

func (_g *AuthProvidersGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthProvidersGroupBy) ScanX

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

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

func (*AuthProvidersGroupBy) String

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

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

func (*AuthProvidersGroupBy) StringX

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

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

func (*AuthProvidersGroupBy) Strings

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

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

func (*AuthProvidersGroupBy) StringsX

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

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

type AuthProvidersMutation

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

AuthProvidersMutation represents an operation that mutates the AuthProviders nodes in the graph.

func (*AuthProvidersMutation) AddCreatedBy

func (m *AuthProvidersMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*AuthProvidersMutation) AddField

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) AddLionUserIdentityIDs

func (m *AuthProvidersMutation) AddLionUserIdentityIDs(ids ...int)

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by ids.

func (*AuthProvidersMutation) AddProviderType

func (m *AuthProvidersMutation) AddProviderType(i int)

AddProviderType adds i to the "provider_type" field.

func (*AuthProvidersMutation) AddUpdatedBy

func (m *AuthProvidersMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*AuthProvidersMutation) AddedCreatedBy

func (m *AuthProvidersMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*AuthProvidersMutation) AddedEdges

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

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

func (*AuthProvidersMutation) AddedField

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

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

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

func (*AuthProvidersMutation) AddedIDs

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

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

func (*AuthProvidersMutation) AddedProviderType

func (m *AuthProvidersMutation) AddedProviderType() (r int, exists bool)

AddedProviderType returns the value that was added to the "provider_type" field in this mutation.

func (*AuthProvidersMutation) AddedUpdatedBy

func (m *AuthProvidersMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*AuthProvidersMutation) AuthorizationEndpoint

func (m *AuthProvidersMutation) AuthorizationEndpoint() (r string, exists bool)

AuthorizationEndpoint returns the value of the "authorization_endpoint" field in the mutation.

func (*AuthProvidersMutation) ClearCreatedBy

func (m *AuthProvidersMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*AuthProvidersMutation) ClearEdge

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

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) ClearLionUserIdentities

func (m *AuthProvidersMutation) ClearLionUserIdentities()

ClearLionUserIdentities clears the "lion_user_identities" edge to the UserIdentities entity.

func (*AuthProvidersMutation) ClearUpdatedBy

func (m *AuthProvidersMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*AuthProvidersMutation) ClearedEdges

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

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

func (*AuthProvidersMutation) ClearedFields

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

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

func (AuthProvidersMutation) Client

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

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

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

func (*AuthProvidersMutation) ClientSecretEncrypted

func (m *AuthProvidersMutation) ClientSecretEncrypted() (r []byte, exists bool)

ClientSecretEncrypted returns the value of the "client_secret_encrypted" field in the mutation.

func (*AuthProvidersMutation) CreatedAt

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

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

func (*AuthProvidersMutation) CreatedBy

func (m *AuthProvidersMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*AuthProvidersMutation) CreatedByCleared

func (m *AuthProvidersMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*AuthProvidersMutation) EdgeCleared

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

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

func (*AuthProvidersMutation) Enabled

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

Enabled returns the value of the "enabled" field in the mutation.

func (*AuthProvidersMutation) Field

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

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

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

func (*AuthProvidersMutation) Fields

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

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

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) Issuer

func (m *AuthProvidersMutation) Issuer() (r string, exists bool)

Issuer returns the value of the "issuer" field in the mutation.

func (*AuthProvidersMutation) LionUserIdentitiesCleared

func (m *AuthProvidersMutation) LionUserIdentitiesCleared() bool

LionUserIdentitiesCleared reports if the "lion_user_identities" edge to the UserIdentities entity was cleared.

func (*AuthProvidersMutation) LionUserIdentitiesIDs

func (m *AuthProvidersMutation) LionUserIdentitiesIDs() (ids []int)

LionUserIdentitiesIDs returns the "lion_user_identities" edge IDs in the mutation.

func (*AuthProvidersMutation) Name

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

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

func (*AuthProvidersMutation) OldAuthorizationEndpoint

func (m *AuthProvidersMutation) OldAuthorizationEndpoint(ctx context.Context) (v string, err error)

OldAuthorizationEndpoint returns the old "authorization_endpoint" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldClientID

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

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

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

OldClientSecretEncrypted returns the old "client_secret_encrypted" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldCreatedAt

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

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

func (m *AuthProvidersMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldEnabled

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

OldEnabled returns the old "enabled" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldField

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) OldIssuer

func (m *AuthProvidersMutation) OldIssuer(ctx context.Context) (v string, err error)

OldIssuer returns the old "issuer" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldName

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

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

func (m *AuthProvidersMutation) OldProviderType(ctx context.Context) (v int, err error)

OldProviderType returns the old "provider_type" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldRedirectURI

func (m *AuthProvidersMutation) OldRedirectURI(ctx context.Context) (v string, err error)

OldRedirectURI returns the old "redirect_uri" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldScopes

func (m *AuthProvidersMutation) OldScopes(ctx context.Context) (v string, err error)

OldScopes returns the old "scopes" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldTokenEndpoint

func (m *AuthProvidersMutation) OldTokenEndpoint(ctx context.Context) (v string, err error)

OldTokenEndpoint returns the old "token_endpoint" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldUpdatedAt

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

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

func (m *AuthProvidersMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) OldUserinfoEndpoint

func (m *AuthProvidersMutation) OldUserinfoEndpoint(ctx context.Context) (v string, err error)

OldUserinfoEndpoint returns the old "userinfo_endpoint" field's value of the AuthProviders entity. If the AuthProviders 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 (*AuthProvidersMutation) Op

func (m *AuthProvidersMutation) Op() Op

Op returns the operation name.

func (*AuthProvidersMutation) ProviderType

func (m *AuthProvidersMutation) ProviderType() (r int, exists bool)

ProviderType returns the value of the "provider_type" field in the mutation.

func (*AuthProvidersMutation) RedirectURI

func (m *AuthProvidersMutation) RedirectURI() (r string, exists bool)

RedirectURI returns the value of the "redirect_uri" field in the mutation.

func (*AuthProvidersMutation) RemoveLionUserIdentityIDs

func (m *AuthProvidersMutation) RemoveLionUserIdentityIDs(ids ...int)

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*AuthProvidersMutation) RemovedEdges

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

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

func (*AuthProvidersMutation) RemovedIDs

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) RemovedLionUserIdentitiesIDs

func (m *AuthProvidersMutation) RemovedLionUserIdentitiesIDs() (ids []int)

RemovedLionUserIdentities returns the removed IDs of the "lion_user_identities" edge to the UserIdentities entity.

func (*AuthProvidersMutation) ResetAuthorizationEndpoint

func (m *AuthProvidersMutation) ResetAuthorizationEndpoint()

ResetAuthorizationEndpoint resets all changes to the "authorization_endpoint" field.

func (*AuthProvidersMutation) ResetClientID

func (m *AuthProvidersMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*AuthProvidersMutation) ResetClientSecretEncrypted

func (m *AuthProvidersMutation) ResetClientSecretEncrypted()

ResetClientSecretEncrypted resets all changes to the "client_secret_encrypted" field.

func (*AuthProvidersMutation) ResetCreatedAt

func (m *AuthProvidersMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AuthProvidersMutation) ResetCreatedBy

func (m *AuthProvidersMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*AuthProvidersMutation) ResetEdge

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) ResetEnabled

func (m *AuthProvidersMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*AuthProvidersMutation) ResetField

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) ResetIssuer

func (m *AuthProvidersMutation) ResetIssuer()

ResetIssuer resets all changes to the "issuer" field.

func (*AuthProvidersMutation) ResetLionUserIdentities

func (m *AuthProvidersMutation) ResetLionUserIdentities()

ResetLionUserIdentities resets all changes to the "lion_user_identities" edge.

func (*AuthProvidersMutation) ResetName

func (m *AuthProvidersMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AuthProvidersMutation) ResetProviderType

func (m *AuthProvidersMutation) ResetProviderType()

ResetProviderType resets all changes to the "provider_type" field.

func (*AuthProvidersMutation) ResetRedirectURI

func (m *AuthProvidersMutation) ResetRedirectURI()

ResetRedirectURI resets all changes to the "redirect_uri" field.

func (*AuthProvidersMutation) ResetScopes

func (m *AuthProvidersMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*AuthProvidersMutation) ResetTokenEndpoint

func (m *AuthProvidersMutation) ResetTokenEndpoint()

ResetTokenEndpoint resets all changes to the "token_endpoint" field.

func (*AuthProvidersMutation) ResetUpdatedAt

func (m *AuthProvidersMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AuthProvidersMutation) ResetUpdatedBy

func (m *AuthProvidersMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*AuthProvidersMutation) ResetUserinfoEndpoint

func (m *AuthProvidersMutation) ResetUserinfoEndpoint()

ResetUserinfoEndpoint resets all changes to the "userinfo_endpoint" field.

func (*AuthProvidersMutation) Scopes

func (m *AuthProvidersMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*AuthProvidersMutation) SetAuthorizationEndpoint

func (m *AuthProvidersMutation) SetAuthorizationEndpoint(s string)

SetAuthorizationEndpoint sets the "authorization_endpoint" field.

func (*AuthProvidersMutation) SetClientID

func (m *AuthProvidersMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*AuthProvidersMutation) SetClientSecretEncrypted

func (m *AuthProvidersMutation) SetClientSecretEncrypted(b []byte)

SetClientSecretEncrypted sets the "client_secret_encrypted" field.

func (*AuthProvidersMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AuthProvidersMutation) SetCreatedBy

func (m *AuthProvidersMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*AuthProvidersMutation) SetEnabled

func (m *AuthProvidersMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*AuthProvidersMutation) SetField

func (m *AuthProvidersMutation) 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 (*AuthProvidersMutation) SetIssuer

func (m *AuthProvidersMutation) SetIssuer(s string)

SetIssuer sets the "issuer" field.

func (*AuthProvidersMutation) SetName

func (m *AuthProvidersMutation) SetName(s string)

SetName sets the "name" field.

func (*AuthProvidersMutation) SetOp

func (m *AuthProvidersMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthProvidersMutation) SetProviderType

func (m *AuthProvidersMutation) SetProviderType(i int)

SetProviderType sets the "provider_type" field.

func (*AuthProvidersMutation) SetRedirectURI

func (m *AuthProvidersMutation) SetRedirectURI(s string)

SetRedirectURI sets the "redirect_uri" field.

func (*AuthProvidersMutation) SetScopes

func (m *AuthProvidersMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*AuthProvidersMutation) SetTokenEndpoint

func (m *AuthProvidersMutation) SetTokenEndpoint(s string)

SetTokenEndpoint sets the "token_endpoint" field.

func (*AuthProvidersMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AuthProvidersMutation) SetUpdatedBy

func (m *AuthProvidersMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*AuthProvidersMutation) SetUserinfoEndpoint

func (m *AuthProvidersMutation) SetUserinfoEndpoint(s string)

SetUserinfoEndpoint sets the "userinfo_endpoint" field.

func (*AuthProvidersMutation) TokenEndpoint

func (m *AuthProvidersMutation) TokenEndpoint() (r string, exists bool)

TokenEndpoint returns the value of the "token_endpoint" field in the mutation.

func (AuthProvidersMutation) Tx

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

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

func (*AuthProvidersMutation) Type

func (m *AuthProvidersMutation) Type() string

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

func (*AuthProvidersMutation) UpdatedAt

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

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

func (*AuthProvidersMutation) UpdatedBy

func (m *AuthProvidersMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*AuthProvidersMutation) UpdatedByCleared

func (m *AuthProvidersMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*AuthProvidersMutation) UserinfoEndpoint

func (m *AuthProvidersMutation) UserinfoEndpoint() (r string, exists bool)

UserinfoEndpoint returns the value of the "userinfo_endpoint" field in the mutation.

func (*AuthProvidersMutation) Where

Where appends a list predicates to the AuthProvidersMutation builder.

func (*AuthProvidersMutation) WhereP

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

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

type AuthProvidersQuery

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

AuthProvidersQuery is the builder for querying AuthProviders entities.

func (*AuthProvidersQuery) Aggregate

func (_q *AuthProvidersQuery) Aggregate(fns ...AggregateFunc) *AuthProvidersSelect

Aggregate returns a AuthProvidersSelect configured with the given aggregations.

func (*AuthProvidersQuery) All

All executes the query and returns a list of AuthProvidersSlice.

func (*AuthProvidersQuery) AllX

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

func (*AuthProvidersQuery) Clone

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

func (*AuthProvidersQuery) Count

func (_q *AuthProvidersQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuthProvidersQuery) CountX

func (_q *AuthProvidersQuery) CountX(ctx context.Context) int

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

func (*AuthProvidersQuery) Exist

func (_q *AuthProvidersQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuthProvidersQuery) ExistX

func (_q *AuthProvidersQuery) ExistX(ctx context.Context) bool

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

func (*AuthProvidersQuery) First

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

func (*AuthProvidersQuery) FirstID

func (_q *AuthProvidersQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AuthProvidersQuery) FirstIDX

func (_q *AuthProvidersQuery) FirstIDX(ctx context.Context) int

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

func (*AuthProvidersQuery) FirstX

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

func (*AuthProvidersQuery) GroupBy

func (_q *AuthProvidersQuery) GroupBy(field string, fields ...string) *AuthProvidersGroupBy

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

Example:

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

client.AuthProviders.Query().
	GroupBy(authproviders.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*AuthProvidersQuery) IDs

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

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

func (*AuthProvidersQuery) IDsX

func (_q *AuthProvidersQuery) IDsX(ctx context.Context) []int

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

func (*AuthProvidersQuery) Limit

func (_q *AuthProvidersQuery) Limit(limit int) *AuthProvidersQuery

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

func (*AuthProvidersQuery) Offset

func (_q *AuthProvidersQuery) Offset(offset int) *AuthProvidersQuery

Offset to start from.

func (*AuthProvidersQuery) Only

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

func (*AuthProvidersQuery) OnlyID

func (_q *AuthProvidersQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AuthProvidersQuery) OnlyIDX

func (_q *AuthProvidersQuery) OnlyIDX(ctx context.Context) int

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

func (*AuthProvidersQuery) OnlyX

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

func (*AuthProvidersQuery) Order

Order specifies how the records should be ordered.

func (*AuthProvidersQuery) QueryLionUserIdentities

func (_q *AuthProvidersQuery) QueryLionUserIdentities() *UserIdentitiesQuery

QueryLionUserIdentities chains the current query on the "lion_user_identities" edge.

func (*AuthProvidersQuery) Select

func (_q *AuthProvidersQuery) Select(fields ...string) *AuthProvidersSelect

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

Example:

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

client.AuthProviders.Query().
	Select(authproviders.FieldCreatedAt).
	Scan(ctx, &v)

func (*AuthProvidersQuery) Unique

func (_q *AuthProvidersQuery) Unique(unique bool) *AuthProvidersQuery

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

Where adds a new predicate for the AuthProvidersQuery builder.

func (*AuthProvidersQuery) WithLionUserIdentities

func (_q *AuthProvidersQuery) WithLionUserIdentities(opts ...func(*UserIdentitiesQuery)) *AuthProvidersQuery

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

type AuthProvidersSelect

type AuthProvidersSelect struct {
	*AuthProvidersQuery
	// contains filtered or unexported fields
}

AuthProvidersSelect is the builder for selecting fields of AuthProviders entities.

func (*AuthProvidersSelect) Aggregate

func (_s *AuthProvidersSelect) Aggregate(fns ...AggregateFunc) *AuthProvidersSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuthProvidersSelect) Bool

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

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

func (*AuthProvidersSelect) BoolX

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

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

func (*AuthProvidersSelect) Bools

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

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

func (*AuthProvidersSelect) BoolsX

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

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

func (*AuthProvidersSelect) Float64

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

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

func (*AuthProvidersSelect) Float64X

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

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

func (*AuthProvidersSelect) Float64s

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

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

func (*AuthProvidersSelect) Float64sX

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

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

func (*AuthProvidersSelect) Int

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

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

func (*AuthProvidersSelect) IntX

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

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

func (*AuthProvidersSelect) Ints

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

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

func (*AuthProvidersSelect) IntsX

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

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

func (*AuthProvidersSelect) Scan

func (_s *AuthProvidersSelect) Scan(ctx context.Context, v any) error

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

func (*AuthProvidersSelect) ScanX

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

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

func (*AuthProvidersSelect) String

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

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

func (*AuthProvidersSelect) StringX

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

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

func (*AuthProvidersSelect) Strings

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

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

func (*AuthProvidersSelect) StringsX

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

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

type AuthProvidersSlice

type AuthProvidersSlice []*AuthProviders

AuthProvidersSlice is a parsable slice of AuthProviders.

type AuthProvidersUpdate

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

AuthProvidersUpdate is the builder for updating AuthProviders entities.

func (*AuthProvidersUpdate) AddCreatedBy

func (_u *AuthProvidersUpdate) AddCreatedBy(v int64) *AuthProvidersUpdate

AddCreatedBy adds value to the "created_by" field.

func (*AuthProvidersUpdate) AddLionUserIdentities

func (_u *AuthProvidersUpdate) AddLionUserIdentities(v ...*UserIdentities) *AuthProvidersUpdate

AddLionUserIdentities adds the "lion_user_identities" edges to the UserIdentities entity.

func (*AuthProvidersUpdate) AddLionUserIdentityIDs

func (_u *AuthProvidersUpdate) AddLionUserIdentityIDs(ids ...int) *AuthProvidersUpdate

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*AuthProvidersUpdate) AddProviderType

func (_u *AuthProvidersUpdate) AddProviderType(v int) *AuthProvidersUpdate

AddProviderType adds value to the "provider_type" field.

func (*AuthProvidersUpdate) AddUpdatedBy

func (_u *AuthProvidersUpdate) AddUpdatedBy(v int64) *AuthProvidersUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*AuthProvidersUpdate) ClearCreatedBy

func (_u *AuthProvidersUpdate) ClearCreatedBy() *AuthProvidersUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*AuthProvidersUpdate) ClearLionUserIdentities

func (_u *AuthProvidersUpdate) ClearLionUserIdentities() *AuthProvidersUpdate

ClearLionUserIdentities clears all "lion_user_identities" edges to the UserIdentities entity.

func (*AuthProvidersUpdate) ClearUpdatedBy

func (_u *AuthProvidersUpdate) ClearUpdatedBy() *AuthProvidersUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*AuthProvidersUpdate) Exec

func (_u *AuthProvidersUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthProvidersUpdate) ExecX

func (_u *AuthProvidersUpdate) ExecX(ctx context.Context)

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

func (*AuthProvidersUpdate) Mutation

Mutation returns the AuthProvidersMutation object of the builder.

func (*AuthProvidersUpdate) RemoveLionUserIdentities

func (_u *AuthProvidersUpdate) RemoveLionUserIdentities(v ...*UserIdentities) *AuthProvidersUpdate

RemoveLionUserIdentities removes "lion_user_identities" edges to UserIdentities entities.

func (*AuthProvidersUpdate) RemoveLionUserIdentityIDs

func (_u *AuthProvidersUpdate) RemoveLionUserIdentityIDs(ids ...int) *AuthProvidersUpdate

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to UserIdentities entities by IDs.

func (*AuthProvidersUpdate) Save

func (_u *AuthProvidersUpdate) Save(ctx context.Context) (int, error)

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

func (*AuthProvidersUpdate) SaveX

func (_u *AuthProvidersUpdate) SaveX(ctx context.Context) int

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

func (*AuthProvidersUpdate) SetAuthorizationEndpoint

func (_u *AuthProvidersUpdate) SetAuthorizationEndpoint(v string) *AuthProvidersUpdate

SetAuthorizationEndpoint sets the "authorization_endpoint" field.

func (*AuthProvidersUpdate) SetClientID

func (_u *AuthProvidersUpdate) SetClientID(v string) *AuthProvidersUpdate

SetClientID sets the "client_id" field.

func (*AuthProvidersUpdate) SetClientSecretEncrypted

func (_u *AuthProvidersUpdate) SetClientSecretEncrypted(v []byte) *AuthProvidersUpdate

SetClientSecretEncrypted sets the "client_secret_encrypted" field.

func (*AuthProvidersUpdate) SetCreatedBy

func (_u *AuthProvidersUpdate) SetCreatedBy(v int64) *AuthProvidersUpdate

SetCreatedBy sets the "created_by" field.

func (*AuthProvidersUpdate) SetEnabled

func (_u *AuthProvidersUpdate) SetEnabled(v bool) *AuthProvidersUpdate

SetEnabled sets the "enabled" field.

func (*AuthProvidersUpdate) SetIssuer

SetIssuer sets the "issuer" field.

func (*AuthProvidersUpdate) SetName

SetName sets the "name" field.

func (*AuthProvidersUpdate) SetNillableAuthorizationEndpoint

func (_u *AuthProvidersUpdate) SetNillableAuthorizationEndpoint(v *string) *AuthProvidersUpdate

SetNillableAuthorizationEndpoint sets the "authorization_endpoint" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableClientID

func (_u *AuthProvidersUpdate) SetNillableClientID(v *string) *AuthProvidersUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableCreatedBy

func (_u *AuthProvidersUpdate) SetNillableCreatedBy(v *int64) *AuthProvidersUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableEnabled

func (_u *AuthProvidersUpdate) SetNillableEnabled(v *bool) *AuthProvidersUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableIssuer

func (_u *AuthProvidersUpdate) SetNillableIssuer(v *string) *AuthProvidersUpdate

SetNillableIssuer sets the "issuer" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableName

func (_u *AuthProvidersUpdate) SetNillableName(v *string) *AuthProvidersUpdate

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

func (*AuthProvidersUpdate) SetNillableProviderType

func (_u *AuthProvidersUpdate) SetNillableProviderType(v *int) *AuthProvidersUpdate

SetNillableProviderType sets the "provider_type" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableRedirectURI

func (_u *AuthProvidersUpdate) SetNillableRedirectURI(v *string) *AuthProvidersUpdate

SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableScopes

func (_u *AuthProvidersUpdate) SetNillableScopes(v *string) *AuthProvidersUpdate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableTokenEndpoint

func (_u *AuthProvidersUpdate) SetNillableTokenEndpoint(v *string) *AuthProvidersUpdate

SetNillableTokenEndpoint sets the "token_endpoint" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableUpdatedBy

func (_u *AuthProvidersUpdate) SetNillableUpdatedBy(v *int64) *AuthProvidersUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableUserinfoEndpoint

func (_u *AuthProvidersUpdate) SetNillableUserinfoEndpoint(v *string) *AuthProvidersUpdate

SetNillableUserinfoEndpoint sets the "userinfo_endpoint" field if the given value is not nil.

func (*AuthProvidersUpdate) SetProviderType

func (_u *AuthProvidersUpdate) SetProviderType(v int) *AuthProvidersUpdate

SetProviderType sets the "provider_type" field.

func (*AuthProvidersUpdate) SetRedirectURI

func (_u *AuthProvidersUpdate) SetRedirectURI(v string) *AuthProvidersUpdate

SetRedirectURI sets the "redirect_uri" field.

func (*AuthProvidersUpdate) SetScopes

SetScopes sets the "scopes" field.

func (*AuthProvidersUpdate) SetTokenEndpoint

func (_u *AuthProvidersUpdate) SetTokenEndpoint(v string) *AuthProvidersUpdate

SetTokenEndpoint sets the "token_endpoint" field.

func (*AuthProvidersUpdate) SetUpdatedAt

func (_u *AuthProvidersUpdate) SetUpdatedAt(v time.Time) *AuthProvidersUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AuthProvidersUpdate) SetUpdatedBy

func (_u *AuthProvidersUpdate) SetUpdatedBy(v int64) *AuthProvidersUpdate

SetUpdatedBy sets the "updated_by" field.

func (*AuthProvidersUpdate) SetUserinfoEndpoint

func (_u *AuthProvidersUpdate) SetUserinfoEndpoint(v string) *AuthProvidersUpdate

SetUserinfoEndpoint sets the "userinfo_endpoint" field.

func (*AuthProvidersUpdate) Where

Where appends a list predicates to the AuthProvidersUpdate builder.

type AuthProvidersUpdateOne

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

AuthProvidersUpdateOne is the builder for updating a single AuthProviders entity.

func (*AuthProvidersUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*AuthProvidersUpdateOne) AddLionUserIdentities

func (_u *AuthProvidersUpdateOne) AddLionUserIdentities(v ...*UserIdentities) *AuthProvidersUpdateOne

AddLionUserIdentities adds the "lion_user_identities" edges to the UserIdentities entity.

func (*AuthProvidersUpdateOne) AddLionUserIdentityIDs

func (_u *AuthProvidersUpdateOne) AddLionUserIdentityIDs(ids ...int) *AuthProvidersUpdateOne

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*AuthProvidersUpdateOne) AddProviderType

func (_u *AuthProvidersUpdateOne) AddProviderType(v int) *AuthProvidersUpdateOne

AddProviderType adds value to the "provider_type" field.

func (*AuthProvidersUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*AuthProvidersUpdateOne) ClearCreatedBy

func (_u *AuthProvidersUpdateOne) ClearCreatedBy() *AuthProvidersUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*AuthProvidersUpdateOne) ClearLionUserIdentities

func (_u *AuthProvidersUpdateOne) ClearLionUserIdentities() *AuthProvidersUpdateOne

ClearLionUserIdentities clears all "lion_user_identities" edges to the UserIdentities entity.

func (*AuthProvidersUpdateOne) ClearUpdatedBy

func (_u *AuthProvidersUpdateOne) ClearUpdatedBy() *AuthProvidersUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*AuthProvidersUpdateOne) Exec

Exec executes the query on the entity.

func (*AuthProvidersUpdateOne) ExecX

func (_u *AuthProvidersUpdateOne) ExecX(ctx context.Context)

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

func (*AuthProvidersUpdateOne) Mutation

Mutation returns the AuthProvidersMutation object of the builder.

func (*AuthProvidersUpdateOne) RemoveLionUserIdentities

func (_u *AuthProvidersUpdateOne) RemoveLionUserIdentities(v ...*UserIdentities) *AuthProvidersUpdateOne

RemoveLionUserIdentities removes "lion_user_identities" edges to UserIdentities entities.

func (*AuthProvidersUpdateOne) RemoveLionUserIdentityIDs

func (_u *AuthProvidersUpdateOne) RemoveLionUserIdentityIDs(ids ...int) *AuthProvidersUpdateOne

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to UserIdentities entities by IDs.

func (*AuthProvidersUpdateOne) Save

Save executes the query and returns the updated AuthProviders entity.

func (*AuthProvidersUpdateOne) SaveX

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

func (*AuthProvidersUpdateOne) Select

func (_u *AuthProvidersUpdateOne) Select(field string, fields ...string) *AuthProvidersUpdateOne

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

func (*AuthProvidersUpdateOne) SetAuthorizationEndpoint

func (_u *AuthProvidersUpdateOne) SetAuthorizationEndpoint(v string) *AuthProvidersUpdateOne

SetAuthorizationEndpoint sets the "authorization_endpoint" field.

func (*AuthProvidersUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*AuthProvidersUpdateOne) SetClientSecretEncrypted

func (_u *AuthProvidersUpdateOne) SetClientSecretEncrypted(v []byte) *AuthProvidersUpdateOne

SetClientSecretEncrypted sets the "client_secret_encrypted" field.

func (*AuthProvidersUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*AuthProvidersUpdateOne) SetEnabled

SetEnabled sets the "enabled" field.

func (*AuthProvidersUpdateOne) SetIssuer

SetIssuer sets the "issuer" field.

func (*AuthProvidersUpdateOne) SetName

SetName sets the "name" field.

func (*AuthProvidersUpdateOne) SetNillableAuthorizationEndpoint

func (_u *AuthProvidersUpdateOne) SetNillableAuthorizationEndpoint(v *string) *AuthProvidersUpdateOne

SetNillableAuthorizationEndpoint sets the "authorization_endpoint" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableClientID

func (_u *AuthProvidersUpdateOne) SetNillableClientID(v *string) *AuthProvidersUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableCreatedBy

func (_u *AuthProvidersUpdateOne) SetNillableCreatedBy(v *int64) *AuthProvidersUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableEnabled

func (_u *AuthProvidersUpdateOne) SetNillableEnabled(v *bool) *AuthProvidersUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableIssuer

func (_u *AuthProvidersUpdateOne) SetNillableIssuer(v *string) *AuthProvidersUpdateOne

SetNillableIssuer sets the "issuer" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableName

func (_u *AuthProvidersUpdateOne) SetNillableName(v *string) *AuthProvidersUpdateOne

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

func (*AuthProvidersUpdateOne) SetNillableProviderType

func (_u *AuthProvidersUpdateOne) SetNillableProviderType(v *int) *AuthProvidersUpdateOne

SetNillableProviderType sets the "provider_type" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableRedirectURI

func (_u *AuthProvidersUpdateOne) SetNillableRedirectURI(v *string) *AuthProvidersUpdateOne

SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableScopes

func (_u *AuthProvidersUpdateOne) SetNillableScopes(v *string) *AuthProvidersUpdateOne

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableTokenEndpoint

func (_u *AuthProvidersUpdateOne) SetNillableTokenEndpoint(v *string) *AuthProvidersUpdateOne

SetNillableTokenEndpoint sets the "token_endpoint" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableUpdatedBy

func (_u *AuthProvidersUpdateOne) SetNillableUpdatedBy(v *int64) *AuthProvidersUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableUserinfoEndpoint

func (_u *AuthProvidersUpdateOne) SetNillableUserinfoEndpoint(v *string) *AuthProvidersUpdateOne

SetNillableUserinfoEndpoint sets the "userinfo_endpoint" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetProviderType

func (_u *AuthProvidersUpdateOne) SetProviderType(v int) *AuthProvidersUpdateOne

SetProviderType sets the "provider_type" field.

func (*AuthProvidersUpdateOne) SetRedirectURI

func (_u *AuthProvidersUpdateOne) SetRedirectURI(v string) *AuthProvidersUpdateOne

SetRedirectURI sets the "redirect_uri" field.

func (*AuthProvidersUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*AuthProvidersUpdateOne) SetTokenEndpoint

func (_u *AuthProvidersUpdateOne) SetTokenEndpoint(v string) *AuthProvidersUpdateOne

SetTokenEndpoint sets the "token_endpoint" field.

func (*AuthProvidersUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*AuthProvidersUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*AuthProvidersUpdateOne) SetUserinfoEndpoint

func (_u *AuthProvidersUpdateOne) SetUserinfoEndpoint(v string) *AuthProvidersUpdateOne

SetUserinfoEndpoint sets the "userinfo_endpoint" field.

func (*AuthProvidersUpdateOne) Where

Where appends a list predicates to the AuthProvidersUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AuthProviders is the client for interacting with the AuthProviders builders.
	AuthProviders *AuthProvidersClient
	// Credentials is the client for interacting with the Credentials builders.
	Credentials *CredentialsClient
	// Demo is the client for interacting with the Demo builders.
	Demo *DemoClient
	// DepartmentRoles is the client for interacting with the DepartmentRoles builders.
	DepartmentRoles *DepartmentRolesClient
	// Departments is the client for interacting with the Departments builders.
	Departments *DepartmentsClient
	// GroupRoles is the client for interacting with the GroupRoles builders.
	GroupRoles *GroupRolesClient
	// Groups is the client for interacting with the Groups builders.
	Groups *GroupsClient
	// Permissions is the client for interacting with the Permissions builders.
	Permissions *PermissionsClient
	// Policies is the client for interacting with the Policies builders.
	Policies *PoliciesClient
	// Resources is the client for interacting with the Resources builders.
	Resources *ResourcesClient
	// RolePermissions is the client for interacting with the RolePermissions builders.
	RolePermissions *RolePermissionsClient
	// Roles is the client for interacting with the Roles builders.
	Roles *RolesClient
	// UserDepartments is the client for interacting with the UserDepartments builders.
	UserDepartments *UserDepartmentsClient
	// UserGroups is the client for interacting with the UserGroups builders.
	UserGroups *UserGroupsClient
	// UserIdentities is the client for interacting with the UserIdentities builders.
	UserIdentities *UserIdentitiesClient
	// UserProfiles is the client for interacting with the UserProfiles builders.
	UserProfiles *UserProfilesClient
	// UserRoles is the client for interacting with the UserRoles builders.
	UserRoles *UserRolesClient
	// Users is the client for interacting with the Users builders.
	Users *UsersClient
	// 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().
	AuthProviders.
	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 Credentials

type Credentials struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 凭证显示名称
	Name string `json:"name,omitempty"`
	// 凭证类型: 0=未指定, 1=API_KEY, 2=SYMMETRIC_KEY, 3=KEY_PAIR, 4=X509, 5=LICENSE, 6=JWKS, 7=HSM_REF, 8=FIDO, 99=OTHER
	CredentialType int `json:"credential_type,omitempty"`
	// 算法类型: 0=未指定, 1=RSA, 2=ECDSA, 3=ED25519, 4=HMAC, 5=AES, 6=CHACHA20_POLY1305, 99=OTHER
	CredentialAlgorithm int `json:"credential_algorithm,omitempty"`
	// 凭证用途: 0=未指定, 1=SIGNING, 2=ENCRYPTION, 10=AUTH, 11=LICENSE, 12=OTP
	CredentialUsage int `json:"credential_usage,omitempty"`
	// 可见性: 0=未指定, 1=PRIVATE, 2=INTERNAL, 3=PUBLIC, 4=GROUP
	CredentialVisibility int `json:"credential_visibility,omitempty"`
	// 状态: 0=未指定, 1=ACTIVE, 2=PENDING, 3=DISABLED, 4=EXPIRED, 5=REVOKED
	CredentialStatus int `json:"credential_status,omitempty"`
	// 来源: 0=未指定, 1=SYSTEM, 2=USER, 3=KMS, 4=EXTERNAL
	CredentialSource int `json:"credential_source,omitempty"`
	// 外部系统 Key ID / JWKS ID / HSM ID
	KeyID string `json:"key_id,omitempty"`
	// API Key 的公有标识
	APIKey string `json:"api_key,omitempty"`
	// API Secret / 私密部分,敏感数据
	APISecretEncrypted []byte `json:"-"`
	// 公钥内容(PEM/DER 格式)
	PublicKey string `json:"public_key,omitempty"`
	// 私钥内容(PEM/DER 格式),敏感数据
	PrivateKeyEncrypted []byte `json:"-"`
	// 私钥加密口令,可选
	PassphraseEncrypted []byte `json:"-"`
	// 主证书(PEM/DER 格式)
	Certificate []byte `json:"certificate,omitempty"`
	// 可选 CA 证书链(顺序从根到中间证书)
	CaChain [][]uint8 `json:"ca_chain,omitempty"`
	// 许可证密钥或主体内容
	LicenseKeyEncrypted string `json:"license_key_encrypted,omitempty"`
	// 许可证数字签名,用于验证完整性
	Signature string `json:"signature,omitempty"`
	// 对称密钥 / HMAC / JWT
	SymmetricKey []byte `json:"-"`
	// JWKS URI
	JwksURI string `json:"jwks_uri,omitempty"`
	// 生效时间(Not Before)
	NotBefore *time.Time `json:"not_before,omitempty"`
	// 过期时间
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// 自定义业务属性,许可证附加信息,如授权范围、用户数、有效期等
	Metadata map[string]string `json:"metadata,omitempty"`
	// 凭证说明或备注
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

Credentials is the model entity for the Credentials schema.

func (*Credentials) String

func (_m *Credentials) String() string

String implements the fmt.Stringer.

func (*Credentials) Unwrap

func (_m *Credentials) Unwrap() *Credentials

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

func (_m *Credentials) Update() *CredentialsUpdateOne

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

func (*Credentials) Value

func (_m *Credentials) Value(name string) (ent.Value, error)

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

type CredentialsClient

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

CredentialsClient is a client for the Credentials schema.

func NewCredentialsClient

func NewCredentialsClient(c config) *CredentialsClient

NewCredentialsClient returns a client for the Credentials from the given config.

func (*CredentialsClient) Create

func (c *CredentialsClient) Create() *CredentialsCreate

Create returns a builder for creating a Credentials entity.

func (*CredentialsClient) CreateBulk

func (c *CredentialsClient) CreateBulk(builders ...*CredentialsCreate) *CredentialsCreateBulk

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

func (*CredentialsClient) Delete

func (c *CredentialsClient) Delete() *CredentialsDelete

Delete returns a delete builder for Credentials.

func (*CredentialsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CredentialsClient) DeleteOneID

func (c *CredentialsClient) DeleteOneID(id int) *CredentialsDeleteOne

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

func (*CredentialsClient) Get

func (c *CredentialsClient) Get(ctx context.Context, id int) (*Credentials, error)

Get returns a Credentials entity by its id.

func (*CredentialsClient) GetX

func (c *CredentialsClient) GetX(ctx context.Context, id int) *Credentials

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

func (*CredentialsClient) Hooks

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

Hooks returns the client hooks.

func (*CredentialsClient) Intercept

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

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

func (*CredentialsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CredentialsClient) MapCreateBulk

func (c *CredentialsClient) MapCreateBulk(slice any, setFunc func(*CredentialsCreate, int)) *CredentialsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CredentialsClient) Query

func (c *CredentialsClient) Query() *CredentialsQuery

Query returns a query builder for Credentials.

func (*CredentialsClient) Update

func (c *CredentialsClient) Update() *CredentialsUpdate

Update returns an update builder for Credentials.

func (*CredentialsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CredentialsClient) UpdateOneID

func (c *CredentialsClient) UpdateOneID(id int) *CredentialsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CredentialsClient) Use

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

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

type CredentialsCreate

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

CredentialsCreate is the builder for creating a Credentials entity.

func (*CredentialsCreate) Exec

func (_c *CredentialsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialsCreate) ExecX

func (_c *CredentialsCreate) ExecX(ctx context.Context)

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

func (*CredentialsCreate) Mutation

func (_c *CredentialsCreate) Mutation() *CredentialsMutation

Mutation returns the CredentialsMutation object of the builder.

func (*CredentialsCreate) Save

Save creates the Credentials in the database.

func (*CredentialsCreate) SaveX

func (_c *CredentialsCreate) SaveX(ctx context.Context) *Credentials

SaveX calls Save and panics if Save returns an error.

func (*CredentialsCreate) SetAPIKey

func (_c *CredentialsCreate) SetAPIKey(v string) *CredentialsCreate

SetAPIKey sets the "api_key" field.

func (*CredentialsCreate) SetAPISecretEncrypted

func (_c *CredentialsCreate) SetAPISecretEncrypted(v []byte) *CredentialsCreate

SetAPISecretEncrypted sets the "api_secret_encrypted" field.

func (*CredentialsCreate) SetCaChain

func (_c *CredentialsCreate) SetCaChain(v [][]uint8) *CredentialsCreate

SetCaChain sets the "ca_chain" field.

func (*CredentialsCreate) SetCertificate

func (_c *CredentialsCreate) SetCertificate(v []byte) *CredentialsCreate

SetCertificate sets the "certificate" field.

func (*CredentialsCreate) SetCreatedAt

func (_c *CredentialsCreate) SetCreatedAt(v time.Time) *CredentialsCreate

SetCreatedAt sets the "created_at" field.

func (*CredentialsCreate) SetCreatedBy

func (_c *CredentialsCreate) SetCreatedBy(v int64) *CredentialsCreate

SetCreatedBy sets the "created_by" field.

func (*CredentialsCreate) SetCredentialAlgorithm

func (_c *CredentialsCreate) SetCredentialAlgorithm(v int) *CredentialsCreate

SetCredentialAlgorithm sets the "credential_algorithm" field.

func (*CredentialsCreate) SetCredentialSource

func (_c *CredentialsCreate) SetCredentialSource(v int) *CredentialsCreate

SetCredentialSource sets the "credential_source" field.

func (*CredentialsCreate) SetCredentialStatus

func (_c *CredentialsCreate) SetCredentialStatus(v int) *CredentialsCreate

SetCredentialStatus sets the "credential_status" field.

func (*CredentialsCreate) SetCredentialType

func (_c *CredentialsCreate) SetCredentialType(v int) *CredentialsCreate

SetCredentialType sets the "credential_type" field.

func (*CredentialsCreate) SetCredentialUsage

func (_c *CredentialsCreate) SetCredentialUsage(v int) *CredentialsCreate

SetCredentialUsage sets the "credential_usage" field.

func (*CredentialsCreate) SetCredentialVisibility

func (_c *CredentialsCreate) SetCredentialVisibility(v int) *CredentialsCreate

SetCredentialVisibility sets the "credential_visibility" field.

func (*CredentialsCreate) SetDescription

func (_c *CredentialsCreate) SetDescription(v string) *CredentialsCreate

SetDescription sets the "description" field.

func (*CredentialsCreate) SetExpiresAt

func (_c *CredentialsCreate) SetExpiresAt(v time.Time) *CredentialsCreate

SetExpiresAt sets the "expires_at" field.

func (*CredentialsCreate) SetJwksURI

func (_c *CredentialsCreate) SetJwksURI(v string) *CredentialsCreate

SetJwksURI sets the "jwks_uri" field.

func (*CredentialsCreate) SetKeyID

func (_c *CredentialsCreate) SetKeyID(v string) *CredentialsCreate

SetKeyID sets the "key_id" field.

func (*CredentialsCreate) SetLicenseKeyEncrypted

func (_c *CredentialsCreate) SetLicenseKeyEncrypted(v string) *CredentialsCreate

SetLicenseKeyEncrypted sets the "license_key_encrypted" field.

func (*CredentialsCreate) SetMetadata

func (_c *CredentialsCreate) SetMetadata(v map[string]string) *CredentialsCreate

SetMetadata sets the "metadata" field.

func (*CredentialsCreate) SetName

func (_c *CredentialsCreate) SetName(v string) *CredentialsCreate

SetName sets the "name" field.

func (*CredentialsCreate) SetNillableAPIKey

func (_c *CredentialsCreate) SetNillableAPIKey(v *string) *CredentialsCreate

SetNillableAPIKey sets the "api_key" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCreatedAt

func (_c *CredentialsCreate) SetNillableCreatedAt(v *time.Time) *CredentialsCreate

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

func (*CredentialsCreate) SetNillableCreatedBy

func (_c *CredentialsCreate) SetNillableCreatedBy(v *int64) *CredentialsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCredentialAlgorithm

func (_c *CredentialsCreate) SetNillableCredentialAlgorithm(v *int) *CredentialsCreate

SetNillableCredentialAlgorithm sets the "credential_algorithm" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCredentialSource

func (_c *CredentialsCreate) SetNillableCredentialSource(v *int) *CredentialsCreate

SetNillableCredentialSource sets the "credential_source" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCredentialStatus

func (_c *CredentialsCreate) SetNillableCredentialStatus(v *int) *CredentialsCreate

SetNillableCredentialStatus sets the "credential_status" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCredentialType

func (_c *CredentialsCreate) SetNillableCredentialType(v *int) *CredentialsCreate

SetNillableCredentialType sets the "credential_type" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCredentialUsage

func (_c *CredentialsCreate) SetNillableCredentialUsage(v *int) *CredentialsCreate

SetNillableCredentialUsage sets the "credential_usage" field if the given value is not nil.

func (*CredentialsCreate) SetNillableCredentialVisibility

func (_c *CredentialsCreate) SetNillableCredentialVisibility(v *int) *CredentialsCreate

SetNillableCredentialVisibility sets the "credential_visibility" field if the given value is not nil.

func (*CredentialsCreate) SetNillableDescription

func (_c *CredentialsCreate) SetNillableDescription(v *string) *CredentialsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*CredentialsCreate) SetNillableExpiresAt

func (_c *CredentialsCreate) SetNillableExpiresAt(v *time.Time) *CredentialsCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CredentialsCreate) SetNillableJwksURI

func (_c *CredentialsCreate) SetNillableJwksURI(v *string) *CredentialsCreate

SetNillableJwksURI sets the "jwks_uri" field if the given value is not nil.

func (*CredentialsCreate) SetNillableKeyID

func (_c *CredentialsCreate) SetNillableKeyID(v *string) *CredentialsCreate

SetNillableKeyID sets the "key_id" field if the given value is not nil.

func (*CredentialsCreate) SetNillableLicenseKeyEncrypted

func (_c *CredentialsCreate) SetNillableLicenseKeyEncrypted(v *string) *CredentialsCreate

SetNillableLicenseKeyEncrypted sets the "license_key_encrypted" field if the given value is not nil.

func (*CredentialsCreate) SetNillableNotBefore

func (_c *CredentialsCreate) SetNillableNotBefore(v *time.Time) *CredentialsCreate

SetNillableNotBefore sets the "not_before" field if the given value is not nil.

func (*CredentialsCreate) SetNillablePublicKey

func (_c *CredentialsCreate) SetNillablePublicKey(v *string) *CredentialsCreate

SetNillablePublicKey sets the "public_key" field if the given value is not nil.

func (*CredentialsCreate) SetNillableSignature

func (_c *CredentialsCreate) SetNillableSignature(v *string) *CredentialsCreate

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*CredentialsCreate) SetNillableUpdatedAt

func (_c *CredentialsCreate) SetNillableUpdatedAt(v *time.Time) *CredentialsCreate

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

func (*CredentialsCreate) SetNillableUpdatedBy

func (_c *CredentialsCreate) SetNillableUpdatedBy(v *int64) *CredentialsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*CredentialsCreate) SetNotBefore

func (_c *CredentialsCreate) SetNotBefore(v time.Time) *CredentialsCreate

SetNotBefore sets the "not_before" field.

func (*CredentialsCreate) SetPassphraseEncrypted

func (_c *CredentialsCreate) SetPassphraseEncrypted(v []byte) *CredentialsCreate

SetPassphraseEncrypted sets the "passphrase_encrypted" field.

func (*CredentialsCreate) SetPrivateKeyEncrypted

func (_c *CredentialsCreate) SetPrivateKeyEncrypted(v []byte) *CredentialsCreate

SetPrivateKeyEncrypted sets the "private_key_encrypted" field.

func (*CredentialsCreate) SetPublicKey

func (_c *CredentialsCreate) SetPublicKey(v string) *CredentialsCreate

SetPublicKey sets the "public_key" field.

func (*CredentialsCreate) SetSignature

func (_c *CredentialsCreate) SetSignature(v string) *CredentialsCreate

SetSignature sets the "signature" field.

func (*CredentialsCreate) SetSymmetricKey

func (_c *CredentialsCreate) SetSymmetricKey(v []byte) *CredentialsCreate

SetSymmetricKey sets the "symmetric_key" field.

func (*CredentialsCreate) SetUpdatedAt

func (_c *CredentialsCreate) SetUpdatedAt(v time.Time) *CredentialsCreate

SetUpdatedAt sets the "updated_at" field.

func (*CredentialsCreate) SetUpdatedBy

func (_c *CredentialsCreate) SetUpdatedBy(v int64) *CredentialsCreate

SetUpdatedBy sets the "updated_by" field.

type CredentialsCreateBulk

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

CredentialsCreateBulk is the builder for creating many Credentials entities in bulk.

func (*CredentialsCreateBulk) Exec

Exec executes the query.

func (*CredentialsCreateBulk) ExecX

func (_c *CredentialsCreateBulk) ExecX(ctx context.Context)

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

func (*CredentialsCreateBulk) Save

Save creates the Credentials entities in the database.

func (*CredentialsCreateBulk) SaveX

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

type CredentialsDelete

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

CredentialsDelete is the builder for deleting a Credentials entity.

func (*CredentialsDelete) Exec

func (_d *CredentialsDelete) Exec(ctx context.Context) (int, error)

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

func (*CredentialsDelete) ExecX

func (_d *CredentialsDelete) ExecX(ctx context.Context) int

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

func (*CredentialsDelete) Where

Where appends a list predicates to the CredentialsDelete builder.

type CredentialsDeleteOne

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

CredentialsDeleteOne is the builder for deleting a single Credentials entity.

func (*CredentialsDeleteOne) Exec

func (_d *CredentialsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CredentialsDeleteOne) ExecX

func (_d *CredentialsDeleteOne) ExecX(ctx context.Context)

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

func (*CredentialsDeleteOne) Where

Where appends a list predicates to the CredentialsDelete builder.

type CredentialsGroupBy

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

CredentialsGroupBy is the group-by builder for Credentials entities.

func (*CredentialsGroupBy) Aggregate

func (_g *CredentialsGroupBy) Aggregate(fns ...AggregateFunc) *CredentialsGroupBy

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

func (*CredentialsGroupBy) Bool

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

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

func (*CredentialsGroupBy) BoolX

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

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

func (*CredentialsGroupBy) Bools

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

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

func (*CredentialsGroupBy) BoolsX

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

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

func (*CredentialsGroupBy) Float64

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

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

func (*CredentialsGroupBy) Float64X

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

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

func (*CredentialsGroupBy) Float64s

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

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

func (*CredentialsGroupBy) Float64sX

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

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

func (*CredentialsGroupBy) Int

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

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

func (*CredentialsGroupBy) IntX

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

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

func (*CredentialsGroupBy) Ints

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

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

func (*CredentialsGroupBy) IntsX

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

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

func (*CredentialsGroupBy) Scan

func (_g *CredentialsGroupBy) Scan(ctx context.Context, v any) error

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

func (*CredentialsGroupBy) ScanX

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

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

func (*CredentialsGroupBy) String

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

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

func (*CredentialsGroupBy) StringX

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

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

func (*CredentialsGroupBy) Strings

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

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

func (*CredentialsGroupBy) StringsX

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

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

type CredentialsMutation

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

CredentialsMutation represents an operation that mutates the Credentials nodes in the graph.

func (*CredentialsMutation) APIKey

func (m *CredentialsMutation) APIKey() (r string, exists bool)

APIKey returns the value of the "api_key" field in the mutation.

func (*CredentialsMutation) APIKeyCleared

func (m *CredentialsMutation) APIKeyCleared() bool

APIKeyCleared returns if the "api_key" field was cleared in this mutation.

func (*CredentialsMutation) APISecretEncrypted

func (m *CredentialsMutation) APISecretEncrypted() (r []byte, exists bool)

APISecretEncrypted returns the value of the "api_secret_encrypted" field in the mutation.

func (*CredentialsMutation) APISecretEncryptedCleared

func (m *CredentialsMutation) APISecretEncryptedCleared() bool

APISecretEncryptedCleared returns if the "api_secret_encrypted" field was cleared in this mutation.

func (*CredentialsMutation) AddCreatedBy

func (m *CredentialsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*CredentialsMutation) AddCredentialAlgorithm

func (m *CredentialsMutation) AddCredentialAlgorithm(i int)

AddCredentialAlgorithm adds i to the "credential_algorithm" field.

func (*CredentialsMutation) AddCredentialSource

func (m *CredentialsMutation) AddCredentialSource(i int)

AddCredentialSource adds i to the "credential_source" field.

func (*CredentialsMutation) AddCredentialStatus

func (m *CredentialsMutation) AddCredentialStatus(i int)

AddCredentialStatus adds i to the "credential_status" field.

func (*CredentialsMutation) AddCredentialType

func (m *CredentialsMutation) AddCredentialType(i int)

AddCredentialType adds i to the "credential_type" field.

func (*CredentialsMutation) AddCredentialUsage

func (m *CredentialsMutation) AddCredentialUsage(i int)

AddCredentialUsage adds i to the "credential_usage" field.

func (*CredentialsMutation) AddCredentialVisibility

func (m *CredentialsMutation) AddCredentialVisibility(i int)

AddCredentialVisibility adds i to the "credential_visibility" field.

func (*CredentialsMutation) AddField

func (m *CredentialsMutation) 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 (*CredentialsMutation) AddUpdatedBy

func (m *CredentialsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*CredentialsMutation) AddedCreatedBy

func (m *CredentialsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*CredentialsMutation) AddedCredentialAlgorithm

func (m *CredentialsMutation) AddedCredentialAlgorithm() (r int, exists bool)

AddedCredentialAlgorithm returns the value that was added to the "credential_algorithm" field in this mutation.

func (*CredentialsMutation) AddedCredentialSource

func (m *CredentialsMutation) AddedCredentialSource() (r int, exists bool)

AddedCredentialSource returns the value that was added to the "credential_source" field in this mutation.

func (*CredentialsMutation) AddedCredentialStatus

func (m *CredentialsMutation) AddedCredentialStatus() (r int, exists bool)

AddedCredentialStatus returns the value that was added to the "credential_status" field in this mutation.

func (*CredentialsMutation) AddedCredentialType

func (m *CredentialsMutation) AddedCredentialType() (r int, exists bool)

AddedCredentialType returns the value that was added to the "credential_type" field in this mutation.

func (*CredentialsMutation) AddedCredentialUsage

func (m *CredentialsMutation) AddedCredentialUsage() (r int, exists bool)

AddedCredentialUsage returns the value that was added to the "credential_usage" field in this mutation.

func (*CredentialsMutation) AddedCredentialVisibility

func (m *CredentialsMutation) AddedCredentialVisibility() (r int, exists bool)

AddedCredentialVisibility returns the value that was added to the "credential_visibility" field in this mutation.

func (*CredentialsMutation) AddedEdges

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

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

func (*CredentialsMutation) AddedField

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

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

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

func (*CredentialsMutation) AddedIDs

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

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

func (*CredentialsMutation) AddedUpdatedBy

func (m *CredentialsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*CredentialsMutation) AppendCaChain

func (m *CredentialsMutation) AppendCaChain(u [][]uint8)

AppendCaChain adds u to the "ca_chain" field.

func (*CredentialsMutation) AppendedCaChain

func (m *CredentialsMutation) AppendedCaChain() ([][]uint8, bool)

AppendedCaChain returns the list of values that were appended to the "ca_chain" field in this mutation.

func (*CredentialsMutation) CaChain

func (m *CredentialsMutation) CaChain() (r [][]uint8, exists bool)

CaChain returns the value of the "ca_chain" field in the mutation.

func (*CredentialsMutation) CaChainCleared

func (m *CredentialsMutation) CaChainCleared() bool

CaChainCleared returns if the "ca_chain" field was cleared in this mutation.

func (*CredentialsMutation) Certificate

func (m *CredentialsMutation) Certificate() (r []byte, exists bool)

Certificate returns the value of the "certificate" field in the mutation.

func (*CredentialsMutation) CertificateCleared

func (m *CredentialsMutation) CertificateCleared() bool

CertificateCleared returns if the "certificate" field was cleared in this mutation.

func (*CredentialsMutation) ClearAPIKey

func (m *CredentialsMutation) ClearAPIKey()

ClearAPIKey clears the value of the "api_key" field.

func (*CredentialsMutation) ClearAPISecretEncrypted

func (m *CredentialsMutation) ClearAPISecretEncrypted()

ClearAPISecretEncrypted clears the value of the "api_secret_encrypted" field.

func (*CredentialsMutation) ClearCaChain

func (m *CredentialsMutation) ClearCaChain()

ClearCaChain clears the value of the "ca_chain" field.

func (*CredentialsMutation) ClearCertificate

func (m *CredentialsMutation) ClearCertificate()

ClearCertificate clears the value of the "certificate" field.

func (*CredentialsMutation) ClearCreatedBy

func (m *CredentialsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*CredentialsMutation) ClearDescription

func (m *CredentialsMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*CredentialsMutation) ClearEdge

func (m *CredentialsMutation) 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 (*CredentialsMutation) ClearExpiresAt

func (m *CredentialsMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*CredentialsMutation) ClearField

func (m *CredentialsMutation) 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 (*CredentialsMutation) ClearJwksURI

func (m *CredentialsMutation) ClearJwksURI()

ClearJwksURI clears the value of the "jwks_uri" field.

func (*CredentialsMutation) ClearKeyID

func (m *CredentialsMutation) ClearKeyID()

ClearKeyID clears the value of the "key_id" field.

func (*CredentialsMutation) ClearLicenseKeyEncrypted

func (m *CredentialsMutation) ClearLicenseKeyEncrypted()

ClearLicenseKeyEncrypted clears the value of the "license_key_encrypted" field.

func (*CredentialsMutation) ClearMetadata

func (m *CredentialsMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*CredentialsMutation) ClearNotBefore

func (m *CredentialsMutation) ClearNotBefore()

ClearNotBefore clears the value of the "not_before" field.

func (*CredentialsMutation) ClearPassphraseEncrypted

func (m *CredentialsMutation) ClearPassphraseEncrypted()

ClearPassphraseEncrypted clears the value of the "passphrase_encrypted" field.

func (*CredentialsMutation) ClearPrivateKeyEncrypted

func (m *CredentialsMutation) ClearPrivateKeyEncrypted()

ClearPrivateKeyEncrypted clears the value of the "private_key_encrypted" field.

func (*CredentialsMutation) ClearPublicKey

func (m *CredentialsMutation) ClearPublicKey()

ClearPublicKey clears the value of the "public_key" field.

func (*CredentialsMutation) ClearSignature

func (m *CredentialsMutation) ClearSignature()

ClearSignature clears the value of the "signature" field.

func (*CredentialsMutation) ClearSymmetricKey

func (m *CredentialsMutation) ClearSymmetricKey()

ClearSymmetricKey clears the value of the "symmetric_key" field.

func (*CredentialsMutation) ClearUpdatedBy

func (m *CredentialsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*CredentialsMutation) ClearedEdges

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

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

func (*CredentialsMutation) ClearedFields

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

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

func (CredentialsMutation) Client

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

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

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

func (*CredentialsMutation) CreatedBy

func (m *CredentialsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*CredentialsMutation) CreatedByCleared

func (m *CredentialsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*CredentialsMutation) CredentialAlgorithm

func (m *CredentialsMutation) CredentialAlgorithm() (r int, exists bool)

CredentialAlgorithm returns the value of the "credential_algorithm" field in the mutation.

func (*CredentialsMutation) CredentialSource

func (m *CredentialsMutation) CredentialSource() (r int, exists bool)

CredentialSource returns the value of the "credential_source" field in the mutation.

func (*CredentialsMutation) CredentialStatus

func (m *CredentialsMutation) CredentialStatus() (r int, exists bool)

CredentialStatus returns the value of the "credential_status" field in the mutation.

func (*CredentialsMutation) CredentialType

func (m *CredentialsMutation) CredentialType() (r int, exists bool)

CredentialType returns the value of the "credential_type" field in the mutation.

func (*CredentialsMutation) CredentialUsage

func (m *CredentialsMutation) CredentialUsage() (r int, exists bool)

CredentialUsage returns the value of the "credential_usage" field in the mutation.

func (*CredentialsMutation) CredentialVisibility

func (m *CredentialsMutation) CredentialVisibility() (r int, exists bool)

CredentialVisibility returns the value of the "credential_visibility" field in the mutation.

func (*CredentialsMutation) Description

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

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

func (*CredentialsMutation) DescriptionCleared

func (m *CredentialsMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*CredentialsMutation) EdgeCleared

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

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

func (*CredentialsMutation) ExpiresAt

func (m *CredentialsMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*CredentialsMutation) ExpiresAtCleared

func (m *CredentialsMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*CredentialsMutation) Field

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

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

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

func (*CredentialsMutation) Fields

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

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

func (m *CredentialsMutation) 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 (*CredentialsMutation) JwksURI

func (m *CredentialsMutation) JwksURI() (r string, exists bool)

JwksURI returns the value of the "jwks_uri" field in the mutation.

func (*CredentialsMutation) JwksURICleared

func (m *CredentialsMutation) JwksURICleared() bool

JwksURICleared returns if the "jwks_uri" field was cleared in this mutation.

func (*CredentialsMutation) KeyID

func (m *CredentialsMutation) KeyID() (r string, exists bool)

KeyID returns the value of the "key_id" field in the mutation.

func (*CredentialsMutation) KeyIDCleared

func (m *CredentialsMutation) KeyIDCleared() bool

KeyIDCleared returns if the "key_id" field was cleared in this mutation.

func (*CredentialsMutation) LicenseKeyEncrypted

func (m *CredentialsMutation) LicenseKeyEncrypted() (r string, exists bool)

LicenseKeyEncrypted returns the value of the "license_key_encrypted" field in the mutation.

func (*CredentialsMutation) LicenseKeyEncryptedCleared

func (m *CredentialsMutation) LicenseKeyEncryptedCleared() bool

LicenseKeyEncryptedCleared returns if the "license_key_encrypted" field was cleared in this mutation.

func (*CredentialsMutation) Metadata

func (m *CredentialsMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*CredentialsMutation) MetadataCleared

func (m *CredentialsMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*CredentialsMutation) Name

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

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

func (*CredentialsMutation) NotBefore

func (m *CredentialsMutation) NotBefore() (r time.Time, exists bool)

NotBefore returns the value of the "not_before" field in the mutation.

func (*CredentialsMutation) NotBeforeCleared

func (m *CredentialsMutation) NotBeforeCleared() bool

NotBeforeCleared returns if the "not_before" field was cleared in this mutation.

func (*CredentialsMutation) OldAPIKey

func (m *CredentialsMutation) OldAPIKey(ctx context.Context) (v string, err error)

OldAPIKey returns the old "api_key" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldAPISecretEncrypted

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

OldAPISecretEncrypted returns the old "api_secret_encrypted" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCaChain

func (m *CredentialsMutation) OldCaChain(ctx context.Context) (v [][]uint8, err error)

OldCaChain returns the old "ca_chain" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCertificate

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

OldCertificate returns the old "certificate" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCreatedAt

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

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

func (m *CredentialsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCredentialAlgorithm

func (m *CredentialsMutation) OldCredentialAlgorithm(ctx context.Context) (v int, err error)

OldCredentialAlgorithm returns the old "credential_algorithm" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCredentialSource

func (m *CredentialsMutation) OldCredentialSource(ctx context.Context) (v int, err error)

OldCredentialSource returns the old "credential_source" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCredentialStatus

func (m *CredentialsMutation) OldCredentialStatus(ctx context.Context) (v int, err error)

OldCredentialStatus returns the old "credential_status" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCredentialType

func (m *CredentialsMutation) OldCredentialType(ctx context.Context) (v int, err error)

OldCredentialType returns the old "credential_type" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCredentialUsage

func (m *CredentialsMutation) OldCredentialUsage(ctx context.Context) (v int, err error)

OldCredentialUsage returns the old "credential_usage" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldCredentialVisibility

func (m *CredentialsMutation) OldCredentialVisibility(ctx context.Context) (v int, err error)

OldCredentialVisibility returns the old "credential_visibility" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldDescription

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

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

func (m *CredentialsMutation) OldExpiresAt(ctx context.Context) (v *time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldField

func (m *CredentialsMutation) 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 (*CredentialsMutation) OldJwksURI

func (m *CredentialsMutation) OldJwksURI(ctx context.Context) (v string, err error)

OldJwksURI returns the old "jwks_uri" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldKeyID

func (m *CredentialsMutation) OldKeyID(ctx context.Context) (v string, err error)

OldKeyID returns the old "key_id" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldLicenseKeyEncrypted

func (m *CredentialsMutation) OldLicenseKeyEncrypted(ctx context.Context) (v string, err error)

OldLicenseKeyEncrypted returns the old "license_key_encrypted" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldMetadata

func (m *CredentialsMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldName

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

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

func (m *CredentialsMutation) OldNotBefore(ctx context.Context) (v *time.Time, err error)

OldNotBefore returns the old "not_before" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldPassphraseEncrypted

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

OldPassphraseEncrypted returns the old "passphrase_encrypted" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldPrivateKeyEncrypted

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

OldPrivateKeyEncrypted returns the old "private_key_encrypted" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldPublicKey

func (m *CredentialsMutation) OldPublicKey(ctx context.Context) (v string, err error)

OldPublicKey returns the old "public_key" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldSignature

func (m *CredentialsMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old "signature" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldSymmetricKey

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

OldSymmetricKey returns the old "symmetric_key" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) OldUpdatedAt

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

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

func (m *CredentialsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Credentials entity. If the Credentials 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 (*CredentialsMutation) Op

func (m *CredentialsMutation) Op() Op

Op returns the operation name.

func (*CredentialsMutation) PassphraseEncrypted

func (m *CredentialsMutation) PassphraseEncrypted() (r []byte, exists bool)

PassphraseEncrypted returns the value of the "passphrase_encrypted" field in the mutation.

func (*CredentialsMutation) PassphraseEncryptedCleared

func (m *CredentialsMutation) PassphraseEncryptedCleared() bool

PassphraseEncryptedCleared returns if the "passphrase_encrypted" field was cleared in this mutation.

func (*CredentialsMutation) PrivateKeyEncrypted

func (m *CredentialsMutation) PrivateKeyEncrypted() (r []byte, exists bool)

PrivateKeyEncrypted returns the value of the "private_key_encrypted" field in the mutation.

func (*CredentialsMutation) PrivateKeyEncryptedCleared

func (m *CredentialsMutation) PrivateKeyEncryptedCleared() bool

PrivateKeyEncryptedCleared returns if the "private_key_encrypted" field was cleared in this mutation.

func (*CredentialsMutation) PublicKey

func (m *CredentialsMutation) PublicKey() (r string, exists bool)

PublicKey returns the value of the "public_key" field in the mutation.

func (*CredentialsMutation) PublicKeyCleared

func (m *CredentialsMutation) PublicKeyCleared() bool

PublicKeyCleared returns if the "public_key" field was cleared in this mutation.

func (*CredentialsMutation) RemovedEdges

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

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

func (*CredentialsMutation) RemovedIDs

func (m *CredentialsMutation) 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 (*CredentialsMutation) ResetAPIKey

func (m *CredentialsMutation) ResetAPIKey()

ResetAPIKey resets all changes to the "api_key" field.

func (*CredentialsMutation) ResetAPISecretEncrypted

func (m *CredentialsMutation) ResetAPISecretEncrypted()

ResetAPISecretEncrypted resets all changes to the "api_secret_encrypted" field.

func (*CredentialsMutation) ResetCaChain

func (m *CredentialsMutation) ResetCaChain()

ResetCaChain resets all changes to the "ca_chain" field.

func (*CredentialsMutation) ResetCertificate

func (m *CredentialsMutation) ResetCertificate()

ResetCertificate resets all changes to the "certificate" field.

func (*CredentialsMutation) ResetCreatedAt

func (m *CredentialsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CredentialsMutation) ResetCreatedBy

func (m *CredentialsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*CredentialsMutation) ResetCredentialAlgorithm

func (m *CredentialsMutation) ResetCredentialAlgorithm()

ResetCredentialAlgorithm resets all changes to the "credential_algorithm" field.

func (*CredentialsMutation) ResetCredentialSource

func (m *CredentialsMutation) ResetCredentialSource()

ResetCredentialSource resets all changes to the "credential_source" field.

func (*CredentialsMutation) ResetCredentialStatus

func (m *CredentialsMutation) ResetCredentialStatus()

ResetCredentialStatus resets all changes to the "credential_status" field.

func (*CredentialsMutation) ResetCredentialType

func (m *CredentialsMutation) ResetCredentialType()

ResetCredentialType resets all changes to the "credential_type" field.

func (*CredentialsMutation) ResetCredentialUsage

func (m *CredentialsMutation) ResetCredentialUsage()

ResetCredentialUsage resets all changes to the "credential_usage" field.

func (*CredentialsMutation) ResetCredentialVisibility

func (m *CredentialsMutation) ResetCredentialVisibility()

ResetCredentialVisibility resets all changes to the "credential_visibility" field.

func (*CredentialsMutation) ResetDescription

func (m *CredentialsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*CredentialsMutation) ResetEdge

func (m *CredentialsMutation) 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 (*CredentialsMutation) ResetExpiresAt

func (m *CredentialsMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*CredentialsMutation) ResetField

func (m *CredentialsMutation) 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 (*CredentialsMutation) ResetJwksURI

func (m *CredentialsMutation) ResetJwksURI()

ResetJwksURI resets all changes to the "jwks_uri" field.

func (*CredentialsMutation) ResetKeyID

func (m *CredentialsMutation) ResetKeyID()

ResetKeyID resets all changes to the "key_id" field.

func (*CredentialsMutation) ResetLicenseKeyEncrypted

func (m *CredentialsMutation) ResetLicenseKeyEncrypted()

ResetLicenseKeyEncrypted resets all changes to the "license_key_encrypted" field.

func (*CredentialsMutation) ResetMetadata

func (m *CredentialsMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*CredentialsMutation) ResetName

func (m *CredentialsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CredentialsMutation) ResetNotBefore

func (m *CredentialsMutation) ResetNotBefore()

ResetNotBefore resets all changes to the "not_before" field.

func (*CredentialsMutation) ResetPassphraseEncrypted

func (m *CredentialsMutation) ResetPassphraseEncrypted()

ResetPassphraseEncrypted resets all changes to the "passphrase_encrypted" field.

func (*CredentialsMutation) ResetPrivateKeyEncrypted

func (m *CredentialsMutation) ResetPrivateKeyEncrypted()

ResetPrivateKeyEncrypted resets all changes to the "private_key_encrypted" field.

func (*CredentialsMutation) ResetPublicKey

func (m *CredentialsMutation) ResetPublicKey()

ResetPublicKey resets all changes to the "public_key" field.

func (*CredentialsMutation) ResetSignature

func (m *CredentialsMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*CredentialsMutation) ResetSymmetricKey

func (m *CredentialsMutation) ResetSymmetricKey()

ResetSymmetricKey resets all changes to the "symmetric_key" field.

func (*CredentialsMutation) ResetUpdatedAt

func (m *CredentialsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CredentialsMutation) ResetUpdatedBy

func (m *CredentialsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*CredentialsMutation) SetAPIKey

func (m *CredentialsMutation) SetAPIKey(s string)

SetAPIKey sets the "api_key" field.

func (*CredentialsMutation) SetAPISecretEncrypted

func (m *CredentialsMutation) SetAPISecretEncrypted(b []byte)

SetAPISecretEncrypted sets the "api_secret_encrypted" field.

func (*CredentialsMutation) SetCaChain

func (m *CredentialsMutation) SetCaChain(u [][]uint8)

SetCaChain sets the "ca_chain" field.

func (*CredentialsMutation) SetCertificate

func (m *CredentialsMutation) SetCertificate(b []byte)

SetCertificate sets the "certificate" field.

func (*CredentialsMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CredentialsMutation) SetCreatedBy

func (m *CredentialsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*CredentialsMutation) SetCredentialAlgorithm

func (m *CredentialsMutation) SetCredentialAlgorithm(i int)

SetCredentialAlgorithm sets the "credential_algorithm" field.

func (*CredentialsMutation) SetCredentialSource

func (m *CredentialsMutation) SetCredentialSource(i int)

SetCredentialSource sets the "credential_source" field.

func (*CredentialsMutation) SetCredentialStatus

func (m *CredentialsMutation) SetCredentialStatus(i int)

SetCredentialStatus sets the "credential_status" field.

func (*CredentialsMutation) SetCredentialType

func (m *CredentialsMutation) SetCredentialType(i int)

SetCredentialType sets the "credential_type" field.

func (*CredentialsMutation) SetCredentialUsage

func (m *CredentialsMutation) SetCredentialUsage(i int)

SetCredentialUsage sets the "credential_usage" field.

func (*CredentialsMutation) SetCredentialVisibility

func (m *CredentialsMutation) SetCredentialVisibility(i int)

SetCredentialVisibility sets the "credential_visibility" field.

func (*CredentialsMutation) SetDescription

func (m *CredentialsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*CredentialsMutation) SetExpiresAt

func (m *CredentialsMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*CredentialsMutation) SetField

func (m *CredentialsMutation) 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 (*CredentialsMutation) SetJwksURI

func (m *CredentialsMutation) SetJwksURI(s string)

SetJwksURI sets the "jwks_uri" field.

func (*CredentialsMutation) SetKeyID

func (m *CredentialsMutation) SetKeyID(s string)

SetKeyID sets the "key_id" field.

func (*CredentialsMutation) SetLicenseKeyEncrypted

func (m *CredentialsMutation) SetLicenseKeyEncrypted(s string)

SetLicenseKeyEncrypted sets the "license_key_encrypted" field.

func (*CredentialsMutation) SetMetadata

func (m *CredentialsMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*CredentialsMutation) SetName

func (m *CredentialsMutation) SetName(s string)

SetName sets the "name" field.

func (*CredentialsMutation) SetNotBefore

func (m *CredentialsMutation) SetNotBefore(t time.Time)

SetNotBefore sets the "not_before" field.

func (*CredentialsMutation) SetOp

func (m *CredentialsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CredentialsMutation) SetPassphraseEncrypted

func (m *CredentialsMutation) SetPassphraseEncrypted(b []byte)

SetPassphraseEncrypted sets the "passphrase_encrypted" field.

func (*CredentialsMutation) SetPrivateKeyEncrypted

func (m *CredentialsMutation) SetPrivateKeyEncrypted(b []byte)

SetPrivateKeyEncrypted sets the "private_key_encrypted" field.

func (*CredentialsMutation) SetPublicKey

func (m *CredentialsMutation) SetPublicKey(s string)

SetPublicKey sets the "public_key" field.

func (*CredentialsMutation) SetSignature

func (m *CredentialsMutation) SetSignature(s string)

SetSignature sets the "signature" field.

func (*CredentialsMutation) SetSymmetricKey

func (m *CredentialsMutation) SetSymmetricKey(b []byte)

SetSymmetricKey sets the "symmetric_key" field.

func (*CredentialsMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CredentialsMutation) SetUpdatedBy

func (m *CredentialsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*CredentialsMutation) Signature

func (m *CredentialsMutation) Signature() (r string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (*CredentialsMutation) SignatureCleared

func (m *CredentialsMutation) SignatureCleared() bool

SignatureCleared returns if the "signature" field was cleared in this mutation.

func (*CredentialsMutation) SymmetricKey

func (m *CredentialsMutation) SymmetricKey() (r []byte, exists bool)

SymmetricKey returns the value of the "symmetric_key" field in the mutation.

func (*CredentialsMutation) SymmetricKeyCleared

func (m *CredentialsMutation) SymmetricKeyCleared() bool

SymmetricKeyCleared returns if the "symmetric_key" field was cleared in this mutation.

func (CredentialsMutation) Tx

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

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

func (*CredentialsMutation) Type

func (m *CredentialsMutation) Type() string

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

func (*CredentialsMutation) UpdatedAt

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

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

func (*CredentialsMutation) UpdatedBy

func (m *CredentialsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*CredentialsMutation) UpdatedByCleared

func (m *CredentialsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*CredentialsMutation) Where

func (m *CredentialsMutation) Where(ps ...predicate.Credentials)

Where appends a list predicates to the CredentialsMutation builder.

func (*CredentialsMutation) WhereP

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

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

type CredentialsQuery

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

CredentialsQuery is the builder for querying Credentials entities.

func (*CredentialsQuery) Aggregate

func (_q *CredentialsQuery) Aggregate(fns ...AggregateFunc) *CredentialsSelect

Aggregate returns a CredentialsSelect configured with the given aggregations.

func (*CredentialsQuery) All

func (_q *CredentialsQuery) All(ctx context.Context) ([]*Credentials, error)

All executes the query and returns a list of CredentialsSlice.

func (*CredentialsQuery) AllX

func (_q *CredentialsQuery) AllX(ctx context.Context) []*Credentials

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

func (*CredentialsQuery) Clone

func (_q *CredentialsQuery) Clone() *CredentialsQuery

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

func (*CredentialsQuery) Count

func (_q *CredentialsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CredentialsQuery) CountX

func (_q *CredentialsQuery) CountX(ctx context.Context) int

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

func (*CredentialsQuery) Exist

func (_q *CredentialsQuery) Exist(ctx context.Context) (bool, error)

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

func (*CredentialsQuery) ExistX

func (_q *CredentialsQuery) ExistX(ctx context.Context) bool

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

func (*CredentialsQuery) First

func (_q *CredentialsQuery) First(ctx context.Context) (*Credentials, error)

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

func (*CredentialsQuery) FirstID

func (_q *CredentialsQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CredentialsQuery) FirstIDX

func (_q *CredentialsQuery) FirstIDX(ctx context.Context) int

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

func (*CredentialsQuery) FirstX

func (_q *CredentialsQuery) FirstX(ctx context.Context) *Credentials

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

func (*CredentialsQuery) GroupBy

func (_q *CredentialsQuery) GroupBy(field string, fields ...string) *CredentialsGroupBy

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

Example:

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

client.Credentials.Query().
	GroupBy(credentials.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*CredentialsQuery) IDs

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

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

func (*CredentialsQuery) IDsX

func (_q *CredentialsQuery) IDsX(ctx context.Context) []int

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

func (*CredentialsQuery) Limit

func (_q *CredentialsQuery) Limit(limit int) *CredentialsQuery

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

func (*CredentialsQuery) Offset

func (_q *CredentialsQuery) Offset(offset int) *CredentialsQuery

Offset to start from.

func (*CredentialsQuery) Only

func (_q *CredentialsQuery) Only(ctx context.Context) (*Credentials, error)

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

func (*CredentialsQuery) OnlyID

func (_q *CredentialsQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CredentialsQuery) OnlyIDX

func (_q *CredentialsQuery) OnlyIDX(ctx context.Context) int

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

func (*CredentialsQuery) OnlyX

func (_q *CredentialsQuery) OnlyX(ctx context.Context) *Credentials

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

func (*CredentialsQuery) Order

Order specifies how the records should be ordered.

func (*CredentialsQuery) Select

func (_q *CredentialsQuery) Select(fields ...string) *CredentialsSelect

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

Example:

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

client.Credentials.Query().
	Select(credentials.FieldCreatedAt).
	Scan(ctx, &v)

func (*CredentialsQuery) Unique

func (_q *CredentialsQuery) Unique(unique bool) *CredentialsQuery

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

Where adds a new predicate for the CredentialsQuery builder.

type CredentialsSelect

type CredentialsSelect struct {
	*CredentialsQuery
	// contains filtered or unexported fields
}

CredentialsSelect is the builder for selecting fields of Credentials entities.

func (*CredentialsSelect) Aggregate

func (_s *CredentialsSelect) Aggregate(fns ...AggregateFunc) *CredentialsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CredentialsSelect) Bool

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

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

func (*CredentialsSelect) BoolX

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

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

func (*CredentialsSelect) Bools

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

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

func (*CredentialsSelect) BoolsX

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

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

func (*CredentialsSelect) Float64

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

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

func (*CredentialsSelect) Float64X

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

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

func (*CredentialsSelect) Float64s

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

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

func (*CredentialsSelect) Float64sX

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

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

func (*CredentialsSelect) Int

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

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

func (*CredentialsSelect) IntX

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

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

func (*CredentialsSelect) Ints

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

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

func (*CredentialsSelect) IntsX

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

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

func (*CredentialsSelect) Scan

func (_s *CredentialsSelect) Scan(ctx context.Context, v any) error

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

func (*CredentialsSelect) ScanX

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

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

func (*CredentialsSelect) String

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

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

func (*CredentialsSelect) StringX

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

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

func (*CredentialsSelect) Strings

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

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

func (*CredentialsSelect) StringsX

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

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

type CredentialsSlice

type CredentialsSlice []*Credentials

CredentialsSlice is a parsable slice of Credentials.

type CredentialsUpdate

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

CredentialsUpdate is the builder for updating Credentials entities.

func (*CredentialsUpdate) AddCreatedBy

func (_u *CredentialsUpdate) AddCreatedBy(v int64) *CredentialsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*CredentialsUpdate) AddCredentialAlgorithm

func (_u *CredentialsUpdate) AddCredentialAlgorithm(v int) *CredentialsUpdate

AddCredentialAlgorithm adds value to the "credential_algorithm" field.

func (*CredentialsUpdate) AddCredentialSource

func (_u *CredentialsUpdate) AddCredentialSource(v int) *CredentialsUpdate

AddCredentialSource adds value to the "credential_source" field.

func (*CredentialsUpdate) AddCredentialStatus

func (_u *CredentialsUpdate) AddCredentialStatus(v int) *CredentialsUpdate

AddCredentialStatus adds value to the "credential_status" field.

func (*CredentialsUpdate) AddCredentialType

func (_u *CredentialsUpdate) AddCredentialType(v int) *CredentialsUpdate

AddCredentialType adds value to the "credential_type" field.

func (*CredentialsUpdate) AddCredentialUsage

func (_u *CredentialsUpdate) AddCredentialUsage(v int) *CredentialsUpdate

AddCredentialUsage adds value to the "credential_usage" field.

func (*CredentialsUpdate) AddCredentialVisibility

func (_u *CredentialsUpdate) AddCredentialVisibility(v int) *CredentialsUpdate

AddCredentialVisibility adds value to the "credential_visibility" field.

func (*CredentialsUpdate) AddUpdatedBy

func (_u *CredentialsUpdate) AddUpdatedBy(v int64) *CredentialsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*CredentialsUpdate) AppendCaChain

func (_u *CredentialsUpdate) AppendCaChain(v [][]uint8) *CredentialsUpdate

AppendCaChain appends value to the "ca_chain" field.

func (*CredentialsUpdate) ClearAPIKey

func (_u *CredentialsUpdate) ClearAPIKey() *CredentialsUpdate

ClearAPIKey clears the value of the "api_key" field.

func (*CredentialsUpdate) ClearAPISecretEncrypted

func (_u *CredentialsUpdate) ClearAPISecretEncrypted() *CredentialsUpdate

ClearAPISecretEncrypted clears the value of the "api_secret_encrypted" field.

func (*CredentialsUpdate) ClearCaChain

func (_u *CredentialsUpdate) ClearCaChain() *CredentialsUpdate

ClearCaChain clears the value of the "ca_chain" field.

func (*CredentialsUpdate) ClearCertificate

func (_u *CredentialsUpdate) ClearCertificate() *CredentialsUpdate

ClearCertificate clears the value of the "certificate" field.

func (*CredentialsUpdate) ClearCreatedBy

func (_u *CredentialsUpdate) ClearCreatedBy() *CredentialsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*CredentialsUpdate) ClearDescription

func (_u *CredentialsUpdate) ClearDescription() *CredentialsUpdate

ClearDescription clears the value of the "description" field.

func (*CredentialsUpdate) ClearExpiresAt

func (_u *CredentialsUpdate) ClearExpiresAt() *CredentialsUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*CredentialsUpdate) ClearJwksURI

func (_u *CredentialsUpdate) ClearJwksURI() *CredentialsUpdate

ClearJwksURI clears the value of the "jwks_uri" field.

func (*CredentialsUpdate) ClearKeyID

func (_u *CredentialsUpdate) ClearKeyID() *CredentialsUpdate

ClearKeyID clears the value of the "key_id" field.

func (*CredentialsUpdate) ClearLicenseKeyEncrypted

func (_u *CredentialsUpdate) ClearLicenseKeyEncrypted() *CredentialsUpdate

ClearLicenseKeyEncrypted clears the value of the "license_key_encrypted" field.

func (*CredentialsUpdate) ClearMetadata

func (_u *CredentialsUpdate) ClearMetadata() *CredentialsUpdate

ClearMetadata clears the value of the "metadata" field.

func (*CredentialsUpdate) ClearNotBefore

func (_u *CredentialsUpdate) ClearNotBefore() *CredentialsUpdate

ClearNotBefore clears the value of the "not_before" field.

func (*CredentialsUpdate) ClearPassphraseEncrypted

func (_u *CredentialsUpdate) ClearPassphraseEncrypted() *CredentialsUpdate

ClearPassphraseEncrypted clears the value of the "passphrase_encrypted" field.

func (*CredentialsUpdate) ClearPrivateKeyEncrypted

func (_u *CredentialsUpdate) ClearPrivateKeyEncrypted() *CredentialsUpdate

ClearPrivateKeyEncrypted clears the value of the "private_key_encrypted" field.

func (*CredentialsUpdate) ClearPublicKey

func (_u *CredentialsUpdate) ClearPublicKey() *CredentialsUpdate

ClearPublicKey clears the value of the "public_key" field.

func (*CredentialsUpdate) ClearSignature

func (_u *CredentialsUpdate) ClearSignature() *CredentialsUpdate

ClearSignature clears the value of the "signature" field.

func (*CredentialsUpdate) ClearSymmetricKey

func (_u *CredentialsUpdate) ClearSymmetricKey() *CredentialsUpdate

ClearSymmetricKey clears the value of the "symmetric_key" field.

func (*CredentialsUpdate) ClearUpdatedBy

func (_u *CredentialsUpdate) ClearUpdatedBy() *CredentialsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*CredentialsUpdate) Exec

func (_u *CredentialsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CredentialsUpdate) ExecX

func (_u *CredentialsUpdate) ExecX(ctx context.Context)

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

func (*CredentialsUpdate) Mutation

func (_u *CredentialsUpdate) Mutation() *CredentialsMutation

Mutation returns the CredentialsMutation object of the builder.

func (*CredentialsUpdate) Save

func (_u *CredentialsUpdate) Save(ctx context.Context) (int, error)

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

func (*CredentialsUpdate) SaveX

func (_u *CredentialsUpdate) SaveX(ctx context.Context) int

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

func (*CredentialsUpdate) SetAPIKey

func (_u *CredentialsUpdate) SetAPIKey(v string) *CredentialsUpdate

SetAPIKey sets the "api_key" field.

func (*CredentialsUpdate) SetAPISecretEncrypted

func (_u *CredentialsUpdate) SetAPISecretEncrypted(v []byte) *CredentialsUpdate

SetAPISecretEncrypted sets the "api_secret_encrypted" field.

func (*CredentialsUpdate) SetCaChain

func (_u *CredentialsUpdate) SetCaChain(v [][]uint8) *CredentialsUpdate

SetCaChain sets the "ca_chain" field.

func (*CredentialsUpdate) SetCertificate

func (_u *CredentialsUpdate) SetCertificate(v []byte) *CredentialsUpdate

SetCertificate sets the "certificate" field.

func (*CredentialsUpdate) SetCreatedBy

func (_u *CredentialsUpdate) SetCreatedBy(v int64) *CredentialsUpdate

SetCreatedBy sets the "created_by" field.

func (*CredentialsUpdate) SetCredentialAlgorithm

func (_u *CredentialsUpdate) SetCredentialAlgorithm(v int) *CredentialsUpdate

SetCredentialAlgorithm sets the "credential_algorithm" field.

func (*CredentialsUpdate) SetCredentialSource

func (_u *CredentialsUpdate) SetCredentialSource(v int) *CredentialsUpdate

SetCredentialSource sets the "credential_source" field.

func (*CredentialsUpdate) SetCredentialStatus

func (_u *CredentialsUpdate) SetCredentialStatus(v int) *CredentialsUpdate

SetCredentialStatus sets the "credential_status" field.

func (*CredentialsUpdate) SetCredentialType

func (_u *CredentialsUpdate) SetCredentialType(v int) *CredentialsUpdate

SetCredentialType sets the "credential_type" field.

func (*CredentialsUpdate) SetCredentialUsage

func (_u *CredentialsUpdate) SetCredentialUsage(v int) *CredentialsUpdate

SetCredentialUsage sets the "credential_usage" field.

func (*CredentialsUpdate) SetCredentialVisibility

func (_u *CredentialsUpdate) SetCredentialVisibility(v int) *CredentialsUpdate

SetCredentialVisibility sets the "credential_visibility" field.

func (*CredentialsUpdate) SetDescription

func (_u *CredentialsUpdate) SetDescription(v string) *CredentialsUpdate

SetDescription sets the "description" field.

func (*CredentialsUpdate) SetExpiresAt

func (_u *CredentialsUpdate) SetExpiresAt(v time.Time) *CredentialsUpdate

SetExpiresAt sets the "expires_at" field.

func (*CredentialsUpdate) SetJwksURI

func (_u *CredentialsUpdate) SetJwksURI(v string) *CredentialsUpdate

SetJwksURI sets the "jwks_uri" field.

func (*CredentialsUpdate) SetKeyID

func (_u *CredentialsUpdate) SetKeyID(v string) *CredentialsUpdate

SetKeyID sets the "key_id" field.

func (*CredentialsUpdate) SetLicenseKeyEncrypted

func (_u *CredentialsUpdate) SetLicenseKeyEncrypted(v string) *CredentialsUpdate

SetLicenseKeyEncrypted sets the "license_key_encrypted" field.

func (*CredentialsUpdate) SetMetadata

func (_u *CredentialsUpdate) SetMetadata(v map[string]string) *CredentialsUpdate

SetMetadata sets the "metadata" field.

func (*CredentialsUpdate) SetName

func (_u *CredentialsUpdate) SetName(v string) *CredentialsUpdate

SetName sets the "name" field.

func (*CredentialsUpdate) SetNillableAPIKey

func (_u *CredentialsUpdate) SetNillableAPIKey(v *string) *CredentialsUpdate

SetNillableAPIKey sets the "api_key" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCreatedBy

func (_u *CredentialsUpdate) SetNillableCreatedBy(v *int64) *CredentialsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCredentialAlgorithm

func (_u *CredentialsUpdate) SetNillableCredentialAlgorithm(v *int) *CredentialsUpdate

SetNillableCredentialAlgorithm sets the "credential_algorithm" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCredentialSource

func (_u *CredentialsUpdate) SetNillableCredentialSource(v *int) *CredentialsUpdate

SetNillableCredentialSource sets the "credential_source" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCredentialStatus

func (_u *CredentialsUpdate) SetNillableCredentialStatus(v *int) *CredentialsUpdate

SetNillableCredentialStatus sets the "credential_status" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCredentialType

func (_u *CredentialsUpdate) SetNillableCredentialType(v *int) *CredentialsUpdate

SetNillableCredentialType sets the "credential_type" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCredentialUsage

func (_u *CredentialsUpdate) SetNillableCredentialUsage(v *int) *CredentialsUpdate

SetNillableCredentialUsage sets the "credential_usage" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableCredentialVisibility

func (_u *CredentialsUpdate) SetNillableCredentialVisibility(v *int) *CredentialsUpdate

SetNillableCredentialVisibility sets the "credential_visibility" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableDescription

func (_u *CredentialsUpdate) SetNillableDescription(v *string) *CredentialsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableExpiresAt

func (_u *CredentialsUpdate) SetNillableExpiresAt(v *time.Time) *CredentialsUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableJwksURI

func (_u *CredentialsUpdate) SetNillableJwksURI(v *string) *CredentialsUpdate

SetNillableJwksURI sets the "jwks_uri" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableKeyID

func (_u *CredentialsUpdate) SetNillableKeyID(v *string) *CredentialsUpdate

SetNillableKeyID sets the "key_id" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableLicenseKeyEncrypted

func (_u *CredentialsUpdate) SetNillableLicenseKeyEncrypted(v *string) *CredentialsUpdate

SetNillableLicenseKeyEncrypted sets the "license_key_encrypted" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableName

func (_u *CredentialsUpdate) SetNillableName(v *string) *CredentialsUpdate

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

func (*CredentialsUpdate) SetNillableNotBefore

func (_u *CredentialsUpdate) SetNillableNotBefore(v *time.Time) *CredentialsUpdate

SetNillableNotBefore sets the "not_before" field if the given value is not nil.

func (*CredentialsUpdate) SetNillablePublicKey

func (_u *CredentialsUpdate) SetNillablePublicKey(v *string) *CredentialsUpdate

SetNillablePublicKey sets the "public_key" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableSignature

func (_u *CredentialsUpdate) SetNillableSignature(v *string) *CredentialsUpdate

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*CredentialsUpdate) SetNillableUpdatedBy

func (_u *CredentialsUpdate) SetNillableUpdatedBy(v *int64) *CredentialsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*CredentialsUpdate) SetNotBefore

func (_u *CredentialsUpdate) SetNotBefore(v time.Time) *CredentialsUpdate

SetNotBefore sets the "not_before" field.

func (*CredentialsUpdate) SetPassphraseEncrypted

func (_u *CredentialsUpdate) SetPassphraseEncrypted(v []byte) *CredentialsUpdate

SetPassphraseEncrypted sets the "passphrase_encrypted" field.

func (*CredentialsUpdate) SetPrivateKeyEncrypted

func (_u *CredentialsUpdate) SetPrivateKeyEncrypted(v []byte) *CredentialsUpdate

SetPrivateKeyEncrypted sets the "private_key_encrypted" field.

func (*CredentialsUpdate) SetPublicKey

func (_u *CredentialsUpdate) SetPublicKey(v string) *CredentialsUpdate

SetPublicKey sets the "public_key" field.

func (*CredentialsUpdate) SetSignature

func (_u *CredentialsUpdate) SetSignature(v string) *CredentialsUpdate

SetSignature sets the "signature" field.

func (*CredentialsUpdate) SetSymmetricKey

func (_u *CredentialsUpdate) SetSymmetricKey(v []byte) *CredentialsUpdate

SetSymmetricKey sets the "symmetric_key" field.

func (*CredentialsUpdate) SetUpdatedAt

func (_u *CredentialsUpdate) SetUpdatedAt(v time.Time) *CredentialsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CredentialsUpdate) SetUpdatedBy

func (_u *CredentialsUpdate) SetUpdatedBy(v int64) *CredentialsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*CredentialsUpdate) Where

Where appends a list predicates to the CredentialsUpdate builder.

type CredentialsUpdateOne

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

CredentialsUpdateOne is the builder for updating a single Credentials entity.

func (*CredentialsUpdateOne) AddCreatedBy

func (_u *CredentialsUpdateOne) AddCreatedBy(v int64) *CredentialsUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*CredentialsUpdateOne) AddCredentialAlgorithm

func (_u *CredentialsUpdateOne) AddCredentialAlgorithm(v int) *CredentialsUpdateOne

AddCredentialAlgorithm adds value to the "credential_algorithm" field.

func (*CredentialsUpdateOne) AddCredentialSource

func (_u *CredentialsUpdateOne) AddCredentialSource(v int) *CredentialsUpdateOne

AddCredentialSource adds value to the "credential_source" field.

func (*CredentialsUpdateOne) AddCredentialStatus

func (_u *CredentialsUpdateOne) AddCredentialStatus(v int) *CredentialsUpdateOne

AddCredentialStatus adds value to the "credential_status" field.

func (*CredentialsUpdateOne) AddCredentialType

func (_u *CredentialsUpdateOne) AddCredentialType(v int) *CredentialsUpdateOne

AddCredentialType adds value to the "credential_type" field.

func (*CredentialsUpdateOne) AddCredentialUsage

func (_u *CredentialsUpdateOne) AddCredentialUsage(v int) *CredentialsUpdateOne

AddCredentialUsage adds value to the "credential_usage" field.

func (*CredentialsUpdateOne) AddCredentialVisibility

func (_u *CredentialsUpdateOne) AddCredentialVisibility(v int) *CredentialsUpdateOne

AddCredentialVisibility adds value to the "credential_visibility" field.

func (*CredentialsUpdateOne) AddUpdatedBy

func (_u *CredentialsUpdateOne) AddUpdatedBy(v int64) *CredentialsUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*CredentialsUpdateOne) AppendCaChain

func (_u *CredentialsUpdateOne) AppendCaChain(v [][]uint8) *CredentialsUpdateOne

AppendCaChain appends value to the "ca_chain" field.

func (*CredentialsUpdateOne) ClearAPIKey

func (_u *CredentialsUpdateOne) ClearAPIKey() *CredentialsUpdateOne

ClearAPIKey clears the value of the "api_key" field.

func (*CredentialsUpdateOne) ClearAPISecretEncrypted

func (_u *CredentialsUpdateOne) ClearAPISecretEncrypted() *CredentialsUpdateOne

ClearAPISecretEncrypted clears the value of the "api_secret_encrypted" field.

func (*CredentialsUpdateOne) ClearCaChain

func (_u *CredentialsUpdateOne) ClearCaChain() *CredentialsUpdateOne

ClearCaChain clears the value of the "ca_chain" field.

func (*CredentialsUpdateOne) ClearCertificate

func (_u *CredentialsUpdateOne) ClearCertificate() *CredentialsUpdateOne

ClearCertificate clears the value of the "certificate" field.

func (*CredentialsUpdateOne) ClearCreatedBy

func (_u *CredentialsUpdateOne) ClearCreatedBy() *CredentialsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*CredentialsUpdateOne) ClearDescription

func (_u *CredentialsUpdateOne) ClearDescription() *CredentialsUpdateOne

ClearDescription clears the value of the "description" field.

func (*CredentialsUpdateOne) ClearExpiresAt

func (_u *CredentialsUpdateOne) ClearExpiresAt() *CredentialsUpdateOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*CredentialsUpdateOne) ClearJwksURI

func (_u *CredentialsUpdateOne) ClearJwksURI() *CredentialsUpdateOne

ClearJwksURI clears the value of the "jwks_uri" field.

func (*CredentialsUpdateOne) ClearKeyID

func (_u *CredentialsUpdateOne) ClearKeyID() *CredentialsUpdateOne

ClearKeyID clears the value of the "key_id" field.

func (*CredentialsUpdateOne) ClearLicenseKeyEncrypted

func (_u *CredentialsUpdateOne) ClearLicenseKeyEncrypted() *CredentialsUpdateOne

ClearLicenseKeyEncrypted clears the value of the "license_key_encrypted" field.

func (*CredentialsUpdateOne) ClearMetadata

func (_u *CredentialsUpdateOne) ClearMetadata() *CredentialsUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*CredentialsUpdateOne) ClearNotBefore

func (_u *CredentialsUpdateOne) ClearNotBefore() *CredentialsUpdateOne

ClearNotBefore clears the value of the "not_before" field.

func (*CredentialsUpdateOne) ClearPassphraseEncrypted

func (_u *CredentialsUpdateOne) ClearPassphraseEncrypted() *CredentialsUpdateOne

ClearPassphraseEncrypted clears the value of the "passphrase_encrypted" field.

func (*CredentialsUpdateOne) ClearPrivateKeyEncrypted

func (_u *CredentialsUpdateOne) ClearPrivateKeyEncrypted() *CredentialsUpdateOne

ClearPrivateKeyEncrypted clears the value of the "private_key_encrypted" field.

func (*CredentialsUpdateOne) ClearPublicKey

func (_u *CredentialsUpdateOne) ClearPublicKey() *CredentialsUpdateOne

ClearPublicKey clears the value of the "public_key" field.

func (*CredentialsUpdateOne) ClearSignature

func (_u *CredentialsUpdateOne) ClearSignature() *CredentialsUpdateOne

ClearSignature clears the value of the "signature" field.

func (*CredentialsUpdateOne) ClearSymmetricKey

func (_u *CredentialsUpdateOne) ClearSymmetricKey() *CredentialsUpdateOne

ClearSymmetricKey clears the value of the "symmetric_key" field.

func (*CredentialsUpdateOne) ClearUpdatedBy

func (_u *CredentialsUpdateOne) ClearUpdatedBy() *CredentialsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*CredentialsUpdateOne) Exec

func (_u *CredentialsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CredentialsUpdateOne) ExecX

func (_u *CredentialsUpdateOne) ExecX(ctx context.Context)

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

func (*CredentialsUpdateOne) Mutation

func (_u *CredentialsUpdateOne) Mutation() *CredentialsMutation

Mutation returns the CredentialsMutation object of the builder.

func (*CredentialsUpdateOne) Save

Save executes the query and returns the updated Credentials entity.

func (*CredentialsUpdateOne) SaveX

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

func (*CredentialsUpdateOne) Select

func (_u *CredentialsUpdateOne) Select(field string, fields ...string) *CredentialsUpdateOne

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

func (*CredentialsUpdateOne) SetAPIKey

SetAPIKey sets the "api_key" field.

func (*CredentialsUpdateOne) SetAPISecretEncrypted

func (_u *CredentialsUpdateOne) SetAPISecretEncrypted(v []byte) *CredentialsUpdateOne

SetAPISecretEncrypted sets the "api_secret_encrypted" field.

func (*CredentialsUpdateOne) SetCaChain

func (_u *CredentialsUpdateOne) SetCaChain(v [][]uint8) *CredentialsUpdateOne

SetCaChain sets the "ca_chain" field.

func (*CredentialsUpdateOne) SetCertificate

func (_u *CredentialsUpdateOne) SetCertificate(v []byte) *CredentialsUpdateOne

SetCertificate sets the "certificate" field.

func (*CredentialsUpdateOne) SetCreatedBy

func (_u *CredentialsUpdateOne) SetCreatedBy(v int64) *CredentialsUpdateOne

SetCreatedBy sets the "created_by" field.

func (*CredentialsUpdateOne) SetCredentialAlgorithm

func (_u *CredentialsUpdateOne) SetCredentialAlgorithm(v int) *CredentialsUpdateOne

SetCredentialAlgorithm sets the "credential_algorithm" field.

func (*CredentialsUpdateOne) SetCredentialSource

func (_u *CredentialsUpdateOne) SetCredentialSource(v int) *CredentialsUpdateOne

SetCredentialSource sets the "credential_source" field.

func (*CredentialsUpdateOne) SetCredentialStatus

func (_u *CredentialsUpdateOne) SetCredentialStatus(v int) *CredentialsUpdateOne

SetCredentialStatus sets the "credential_status" field.

func (*CredentialsUpdateOne) SetCredentialType

func (_u *CredentialsUpdateOne) SetCredentialType(v int) *CredentialsUpdateOne

SetCredentialType sets the "credential_type" field.

func (*CredentialsUpdateOne) SetCredentialUsage

func (_u *CredentialsUpdateOne) SetCredentialUsage(v int) *CredentialsUpdateOne

SetCredentialUsage sets the "credential_usage" field.

func (*CredentialsUpdateOne) SetCredentialVisibility

func (_u *CredentialsUpdateOne) SetCredentialVisibility(v int) *CredentialsUpdateOne

SetCredentialVisibility sets the "credential_visibility" field.

func (*CredentialsUpdateOne) SetDescription

func (_u *CredentialsUpdateOne) SetDescription(v string) *CredentialsUpdateOne

SetDescription sets the "description" field.

func (*CredentialsUpdateOne) SetExpiresAt

func (_u *CredentialsUpdateOne) SetExpiresAt(v time.Time) *CredentialsUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*CredentialsUpdateOne) SetJwksURI

SetJwksURI sets the "jwks_uri" field.

func (*CredentialsUpdateOne) SetKeyID

SetKeyID sets the "key_id" field.

func (*CredentialsUpdateOne) SetLicenseKeyEncrypted

func (_u *CredentialsUpdateOne) SetLicenseKeyEncrypted(v string) *CredentialsUpdateOne

SetLicenseKeyEncrypted sets the "license_key_encrypted" field.

func (*CredentialsUpdateOne) SetMetadata

func (_u *CredentialsUpdateOne) SetMetadata(v map[string]string) *CredentialsUpdateOne

SetMetadata sets the "metadata" field.

func (*CredentialsUpdateOne) SetName

SetName sets the "name" field.

func (*CredentialsUpdateOne) SetNillableAPIKey

func (_u *CredentialsUpdateOne) SetNillableAPIKey(v *string) *CredentialsUpdateOne

SetNillableAPIKey sets the "api_key" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCreatedBy

func (_u *CredentialsUpdateOne) SetNillableCreatedBy(v *int64) *CredentialsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCredentialAlgorithm

func (_u *CredentialsUpdateOne) SetNillableCredentialAlgorithm(v *int) *CredentialsUpdateOne

SetNillableCredentialAlgorithm sets the "credential_algorithm" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCredentialSource

func (_u *CredentialsUpdateOne) SetNillableCredentialSource(v *int) *CredentialsUpdateOne

SetNillableCredentialSource sets the "credential_source" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCredentialStatus

func (_u *CredentialsUpdateOne) SetNillableCredentialStatus(v *int) *CredentialsUpdateOne

SetNillableCredentialStatus sets the "credential_status" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCredentialType

func (_u *CredentialsUpdateOne) SetNillableCredentialType(v *int) *CredentialsUpdateOne

SetNillableCredentialType sets the "credential_type" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCredentialUsage

func (_u *CredentialsUpdateOne) SetNillableCredentialUsage(v *int) *CredentialsUpdateOne

SetNillableCredentialUsage sets the "credential_usage" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableCredentialVisibility

func (_u *CredentialsUpdateOne) SetNillableCredentialVisibility(v *int) *CredentialsUpdateOne

SetNillableCredentialVisibility sets the "credential_visibility" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableDescription

func (_u *CredentialsUpdateOne) SetNillableDescription(v *string) *CredentialsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableExpiresAt

func (_u *CredentialsUpdateOne) SetNillableExpiresAt(v *time.Time) *CredentialsUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableJwksURI

func (_u *CredentialsUpdateOne) SetNillableJwksURI(v *string) *CredentialsUpdateOne

SetNillableJwksURI sets the "jwks_uri" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableKeyID

func (_u *CredentialsUpdateOne) SetNillableKeyID(v *string) *CredentialsUpdateOne

SetNillableKeyID sets the "key_id" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableLicenseKeyEncrypted

func (_u *CredentialsUpdateOne) SetNillableLicenseKeyEncrypted(v *string) *CredentialsUpdateOne

SetNillableLicenseKeyEncrypted sets the "license_key_encrypted" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableName

func (_u *CredentialsUpdateOne) SetNillableName(v *string) *CredentialsUpdateOne

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

func (*CredentialsUpdateOne) SetNillableNotBefore

func (_u *CredentialsUpdateOne) SetNillableNotBefore(v *time.Time) *CredentialsUpdateOne

SetNillableNotBefore sets the "not_before" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillablePublicKey

func (_u *CredentialsUpdateOne) SetNillablePublicKey(v *string) *CredentialsUpdateOne

SetNillablePublicKey sets the "public_key" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableSignature

func (_u *CredentialsUpdateOne) SetNillableSignature(v *string) *CredentialsUpdateOne

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNillableUpdatedBy

func (_u *CredentialsUpdateOne) SetNillableUpdatedBy(v *int64) *CredentialsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*CredentialsUpdateOne) SetNotBefore

func (_u *CredentialsUpdateOne) SetNotBefore(v time.Time) *CredentialsUpdateOne

SetNotBefore sets the "not_before" field.

func (*CredentialsUpdateOne) SetPassphraseEncrypted

func (_u *CredentialsUpdateOne) SetPassphraseEncrypted(v []byte) *CredentialsUpdateOne

SetPassphraseEncrypted sets the "passphrase_encrypted" field.

func (*CredentialsUpdateOne) SetPrivateKeyEncrypted

func (_u *CredentialsUpdateOne) SetPrivateKeyEncrypted(v []byte) *CredentialsUpdateOne

SetPrivateKeyEncrypted sets the "private_key_encrypted" field.

func (*CredentialsUpdateOne) SetPublicKey

func (_u *CredentialsUpdateOne) SetPublicKey(v string) *CredentialsUpdateOne

SetPublicKey sets the "public_key" field.

func (*CredentialsUpdateOne) SetSignature

func (_u *CredentialsUpdateOne) SetSignature(v string) *CredentialsUpdateOne

SetSignature sets the "signature" field.

func (*CredentialsUpdateOne) SetSymmetricKey

func (_u *CredentialsUpdateOne) SetSymmetricKey(v []byte) *CredentialsUpdateOne

SetSymmetricKey sets the "symmetric_key" field.

func (*CredentialsUpdateOne) SetUpdatedAt

func (_u *CredentialsUpdateOne) SetUpdatedAt(v time.Time) *CredentialsUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CredentialsUpdateOne) SetUpdatedBy

func (_u *CredentialsUpdateOne) SetUpdatedBy(v int64) *CredentialsUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*CredentialsUpdateOne) Where

Where appends a list predicates to the CredentialsUpdate builder.

type Demo

type Demo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

Demo is the model entity for the Demo schema.

func (*Demo) String

func (_m *Demo) String() string

String implements the fmt.Stringer.

func (*Demo) Unwrap

func (_m *Demo) Unwrap() *Demo

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

func (_m *Demo) Update() *DemoUpdateOne

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

func (*Demo) Value

func (_m *Demo) Value(name string) (ent.Value, error)

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

type DemoClient

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

DemoClient is a client for the Demo schema.

func NewDemoClient

func NewDemoClient(c config) *DemoClient

NewDemoClient returns a client for the Demo from the given config.

func (*DemoClient) Create

func (c *DemoClient) Create() *DemoCreate

Create returns a builder for creating a Demo entity.

func (*DemoClient) CreateBulk

func (c *DemoClient) CreateBulk(builders ...*DemoCreate) *DemoCreateBulk

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

func (*DemoClient) Delete

func (c *DemoClient) Delete() *DemoDelete

Delete returns a delete builder for Demo.

func (*DemoClient) DeleteOne

func (c *DemoClient) DeleteOne(_m *Demo) *DemoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DemoClient) DeleteOneID

func (c *DemoClient) DeleteOneID(id int) *DemoDeleteOne

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

func (*DemoClient) Get

func (c *DemoClient) Get(ctx context.Context, id int) (*Demo, error)

Get returns a Demo entity by its id.

func (*DemoClient) GetX

func (c *DemoClient) GetX(ctx context.Context, id int) *Demo

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

func (*DemoClient) Hooks

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

Hooks returns the client hooks.

func (*DemoClient) Intercept

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

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

func (*DemoClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DemoClient) MapCreateBulk

func (c *DemoClient) MapCreateBulk(slice any, setFunc func(*DemoCreate, int)) *DemoCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DemoClient) Query

func (c *DemoClient) Query() *DemoQuery

Query returns a query builder for Demo.

func (*DemoClient) Update

func (c *DemoClient) Update() *DemoUpdate

Update returns an update builder for Demo.

func (*DemoClient) UpdateOne

func (c *DemoClient) UpdateOne(_m *Demo) *DemoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DemoClient) UpdateOneID

func (c *DemoClient) UpdateOneID(id int) *DemoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DemoClient) Use

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

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

type DemoCreate

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

DemoCreate is the builder for creating a Demo entity.

func (*DemoCreate) Exec

func (_c *DemoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DemoCreate) ExecX

func (_c *DemoCreate) ExecX(ctx context.Context)

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

func (*DemoCreate) Mutation

func (_c *DemoCreate) Mutation() *DemoMutation

Mutation returns the DemoMutation object of the builder.

func (*DemoCreate) Save

func (_c *DemoCreate) Save(ctx context.Context) (*Demo, error)

Save creates the Demo in the database.

func (*DemoCreate) SaveX

func (_c *DemoCreate) SaveX(ctx context.Context) *Demo

SaveX calls Save and panics if Save returns an error.

func (*DemoCreate) SetCreatedAt

func (_c *DemoCreate) SetCreatedAt(v time.Time) *DemoCreate

SetCreatedAt sets the "created_at" field.

func (*DemoCreate) SetDeletedAt

func (_c *DemoCreate) SetDeletedAt(v time.Time) *DemoCreate

SetDeletedAt sets the "deleted_at" field.

func (*DemoCreate) SetName

func (_c *DemoCreate) SetName(v string) *DemoCreate

SetName sets the "name" field.

func (*DemoCreate) SetNillableCreatedAt

func (_c *DemoCreate) SetNillableCreatedAt(v *time.Time) *DemoCreate

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

func (*DemoCreate) SetNillableDeletedAt

func (_c *DemoCreate) SetNillableDeletedAt(v *time.Time) *DemoCreate

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

func (*DemoCreate) SetNillableName

func (_c *DemoCreate) SetNillableName(v *string) *DemoCreate

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

func (*DemoCreate) SetNillableUpdatedAt

func (_c *DemoCreate) SetNillableUpdatedAt(v *time.Time) *DemoCreate

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

func (*DemoCreate) SetUpdatedAt

func (_c *DemoCreate) SetUpdatedAt(v time.Time) *DemoCreate

SetUpdatedAt sets the "updated_at" field.

type DemoCreateBulk

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

DemoCreateBulk is the builder for creating many Demo entities in bulk.

func (*DemoCreateBulk) Exec

func (_c *DemoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DemoCreateBulk) ExecX

func (_c *DemoCreateBulk) ExecX(ctx context.Context)

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

func (*DemoCreateBulk) Save

func (_c *DemoCreateBulk) Save(ctx context.Context) ([]*Demo, error)

Save creates the Demo entities in the database.

func (*DemoCreateBulk) SaveX

func (_c *DemoCreateBulk) SaveX(ctx context.Context) []*Demo

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

type DemoDelete

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

DemoDelete is the builder for deleting a Demo entity.

func (*DemoDelete) Exec

func (_d *DemoDelete) Exec(ctx context.Context) (int, error)

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

func (*DemoDelete) ExecX

func (_d *DemoDelete) ExecX(ctx context.Context) int

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

func (*DemoDelete) Where

func (_d *DemoDelete) Where(ps ...predicate.Demo) *DemoDelete

Where appends a list predicates to the DemoDelete builder.

type DemoDeleteOne

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

DemoDeleteOne is the builder for deleting a single Demo entity.

func (*DemoDeleteOne) Exec

func (_d *DemoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DemoDeleteOne) ExecX

func (_d *DemoDeleteOne) ExecX(ctx context.Context)

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

func (*DemoDeleteOne) Where

func (_d *DemoDeleteOne) Where(ps ...predicate.Demo) *DemoDeleteOne

Where appends a list predicates to the DemoDelete builder.

type DemoGroupBy

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

DemoGroupBy is the group-by builder for Demo entities.

func (*DemoGroupBy) Aggregate

func (_g *DemoGroupBy) Aggregate(fns ...AggregateFunc) *DemoGroupBy

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

func (*DemoGroupBy) Bool

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

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

func (*DemoGroupBy) BoolX

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

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

func (*DemoGroupBy) Bools

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

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

func (*DemoGroupBy) BoolsX

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

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

func (*DemoGroupBy) Float64

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

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

func (*DemoGroupBy) Float64X

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

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

func (*DemoGroupBy) Float64s

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

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

func (*DemoGroupBy) Float64sX

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

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

func (*DemoGroupBy) Int

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

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

func (*DemoGroupBy) IntX

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

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

func (*DemoGroupBy) Ints

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

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

func (*DemoGroupBy) IntsX

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

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

func (*DemoGroupBy) Scan

func (_g *DemoGroupBy) Scan(ctx context.Context, v any) error

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

func (*DemoGroupBy) ScanX

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

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

func (*DemoGroupBy) String

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

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

func (*DemoGroupBy) StringX

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

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

func (*DemoGroupBy) Strings

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

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

func (*DemoGroupBy) StringsX

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

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

type DemoMutation

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

DemoMutation represents an operation that mutates the Demo nodes in the graph.

func (*DemoMutation) AddField

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

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

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

func (*DemoMutation) AddedField

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

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

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

func (*DemoMutation) AddedIDs

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

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

func (*DemoMutation) ClearDeletedAt

func (m *DemoMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DemoMutation) ClearEdge

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

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

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

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

func (*DemoMutation) ClearedFields

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

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

func (DemoMutation) Client

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

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

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

func (*DemoMutation) DeletedAt

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

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

func (*DemoMutation) DeletedAtCleared

func (m *DemoMutation) DeletedAtCleared() bool

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

func (*DemoMutation) EdgeCleared

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

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

func (*DemoMutation) Field

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

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

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

func (*DemoMutation) Fields

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

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

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

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

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

func (*DemoMutation) OldCreatedAt

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

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

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

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

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

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

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

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

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

func (m *DemoMutation) Op() Op

Op returns the operation name.

func (*DemoMutation) RemovedEdges

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

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

func (*DemoMutation) RemovedIDs

func (m *DemoMutation) 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 (*DemoMutation) ResetCreatedAt

func (m *DemoMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DemoMutation) ResetDeletedAt

func (m *DemoMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*DemoMutation) ResetEdge

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

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

func (m *DemoMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DemoMutation) ResetUpdatedAt

func (m *DemoMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DemoMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DemoMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*DemoMutation) SetField

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

func (m *DemoMutation) SetName(s string)

SetName sets the "name" field.

func (*DemoMutation) SetOp

func (m *DemoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DemoMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (DemoMutation) Tx

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

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

func (*DemoMutation) Type

func (m *DemoMutation) Type() string

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

func (*DemoMutation) UpdatedAt

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

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

func (*DemoMutation) Where

func (m *DemoMutation) Where(ps ...predicate.Demo)

Where appends a list predicates to the DemoMutation builder.

func (*DemoMutation) WhereP

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

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

type DemoQuery

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

DemoQuery is the builder for querying Demo entities.

func (*DemoQuery) Aggregate

func (_q *DemoQuery) Aggregate(fns ...AggregateFunc) *DemoSelect

Aggregate returns a DemoSelect configured with the given aggregations.

func (*DemoQuery) All

func (_q *DemoQuery) All(ctx context.Context) ([]*Demo, error)

All executes the query and returns a list of Demos.

func (*DemoQuery) AllX

func (_q *DemoQuery) AllX(ctx context.Context) []*Demo

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

func (*DemoQuery) Clone

func (_q *DemoQuery) Clone() *DemoQuery

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

func (*DemoQuery) Count

func (_q *DemoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DemoQuery) CountX

func (_q *DemoQuery) CountX(ctx context.Context) int

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

func (*DemoQuery) Exist

func (_q *DemoQuery) Exist(ctx context.Context) (bool, error)

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

func (*DemoQuery) ExistX

func (_q *DemoQuery) ExistX(ctx context.Context) bool

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

func (*DemoQuery) First

func (_q *DemoQuery) First(ctx context.Context) (*Demo, error)

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

func (*DemoQuery) FirstID

func (_q *DemoQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DemoQuery) FirstIDX

func (_q *DemoQuery) FirstIDX(ctx context.Context) int

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

func (*DemoQuery) FirstX

func (_q *DemoQuery) FirstX(ctx context.Context) *Demo

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

func (*DemoQuery) GroupBy

func (_q *DemoQuery) GroupBy(field string, fields ...string) *DemoGroupBy

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

Example:

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

client.Demo.Query().
	GroupBy(demo.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*DemoQuery) IDs

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

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

func (*DemoQuery) IDsX

func (_q *DemoQuery) IDsX(ctx context.Context) []int

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

func (*DemoQuery) Limit

func (_q *DemoQuery) Limit(limit int) *DemoQuery

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

func (*DemoQuery) Offset

func (_q *DemoQuery) Offset(offset int) *DemoQuery

Offset to start from.

func (*DemoQuery) Only

func (_q *DemoQuery) Only(ctx context.Context) (*Demo, error)

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

func (*DemoQuery) OnlyID

func (_q *DemoQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DemoQuery) OnlyIDX

func (_q *DemoQuery) OnlyIDX(ctx context.Context) int

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

func (*DemoQuery) OnlyX

func (_q *DemoQuery) OnlyX(ctx context.Context) *Demo

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

func (*DemoQuery) Order

func (_q *DemoQuery) Order(o ...demo.OrderOption) *DemoQuery

Order specifies how the records should be ordered.

func (*DemoQuery) Select

func (_q *DemoQuery) Select(fields ...string) *DemoSelect

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

Example:

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

client.Demo.Query().
	Select(demo.FieldCreatedAt).
	Scan(ctx, &v)

func (*DemoQuery) Unique

func (_q *DemoQuery) Unique(unique bool) *DemoQuery

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

func (_q *DemoQuery) Where(ps ...predicate.Demo) *DemoQuery

Where adds a new predicate for the DemoQuery builder.

type DemoSelect

type DemoSelect struct {
	*DemoQuery
	// contains filtered or unexported fields
}

DemoSelect is the builder for selecting fields of Demo entities.

func (*DemoSelect) Aggregate

func (_s *DemoSelect) Aggregate(fns ...AggregateFunc) *DemoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DemoSelect) Bool

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

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

func (*DemoSelect) BoolX

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

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

func (*DemoSelect) Bools

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

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

func (*DemoSelect) BoolsX

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

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

func (*DemoSelect) Float64

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

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

func (*DemoSelect) Float64X

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

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

func (*DemoSelect) Float64s

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

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

func (*DemoSelect) Float64sX

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

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

func (*DemoSelect) Int

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

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

func (*DemoSelect) IntX

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

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

func (*DemoSelect) Ints

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

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

func (*DemoSelect) IntsX

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

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

func (*DemoSelect) Scan

func (_s *DemoSelect) Scan(ctx context.Context, v any) error

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

func (*DemoSelect) ScanX

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

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

func (*DemoSelect) String

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

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

func (*DemoSelect) StringX

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

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

func (*DemoSelect) Strings

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

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

func (*DemoSelect) StringsX

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

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

type DemoUpdate

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

DemoUpdate is the builder for updating Demo entities.

func (*DemoUpdate) ClearDeletedAt

func (_u *DemoUpdate) ClearDeletedAt() *DemoUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DemoUpdate) Exec

func (_u *DemoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DemoUpdate) ExecX

func (_u *DemoUpdate) ExecX(ctx context.Context)

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

func (*DemoUpdate) Mutation

func (_u *DemoUpdate) Mutation() *DemoMutation

Mutation returns the DemoMutation object of the builder.

func (*DemoUpdate) Save

func (_u *DemoUpdate) Save(ctx context.Context) (int, error)

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

func (*DemoUpdate) SaveX

func (_u *DemoUpdate) SaveX(ctx context.Context) int

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

func (*DemoUpdate) SetDeletedAt

func (_u *DemoUpdate) SetDeletedAt(v time.Time) *DemoUpdate

SetDeletedAt sets the "deleted_at" field.

func (*DemoUpdate) SetName

func (_u *DemoUpdate) SetName(v string) *DemoUpdate

SetName sets the "name" field.

func (*DemoUpdate) SetNillableDeletedAt

func (_u *DemoUpdate) SetNillableDeletedAt(v *time.Time) *DemoUpdate

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

func (*DemoUpdate) SetNillableName

func (_u *DemoUpdate) SetNillableName(v *string) *DemoUpdate

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

func (*DemoUpdate) SetUpdatedAt

func (_u *DemoUpdate) SetUpdatedAt(v time.Time) *DemoUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DemoUpdate) Where

func (_u *DemoUpdate) Where(ps ...predicate.Demo) *DemoUpdate

Where appends a list predicates to the DemoUpdate builder.

type DemoUpdateOne

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

DemoUpdateOne is the builder for updating a single Demo entity.

func (*DemoUpdateOne) ClearDeletedAt

func (_u *DemoUpdateOne) ClearDeletedAt() *DemoUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DemoUpdateOne) Exec

func (_u *DemoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DemoUpdateOne) ExecX

func (_u *DemoUpdateOne) ExecX(ctx context.Context)

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

func (*DemoUpdateOne) Mutation

func (_u *DemoUpdateOne) Mutation() *DemoMutation

Mutation returns the DemoMutation object of the builder.

func (*DemoUpdateOne) Save

func (_u *DemoUpdateOne) Save(ctx context.Context) (*Demo, error)

Save executes the query and returns the updated Demo entity.

func (*DemoUpdateOne) SaveX

func (_u *DemoUpdateOne) SaveX(ctx context.Context) *Demo

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

func (*DemoUpdateOne) Select

func (_u *DemoUpdateOne) Select(field string, fields ...string) *DemoUpdateOne

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

func (*DemoUpdateOne) SetDeletedAt

func (_u *DemoUpdateOne) SetDeletedAt(v time.Time) *DemoUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*DemoUpdateOne) SetName

func (_u *DemoUpdateOne) SetName(v string) *DemoUpdateOne

SetName sets the "name" field.

func (*DemoUpdateOne) SetNillableDeletedAt

func (_u *DemoUpdateOne) SetNillableDeletedAt(v *time.Time) *DemoUpdateOne

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

func (*DemoUpdateOne) SetNillableName

func (_u *DemoUpdateOne) SetNillableName(v *string) *DemoUpdateOne

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

func (*DemoUpdateOne) SetUpdatedAt

func (_u *DemoUpdateOne) SetUpdatedAt(v time.Time) *DemoUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DemoUpdateOne) Where

func (_u *DemoUpdateOne) Where(ps ...predicate.Demo) *DemoUpdateOne

Where appends a list predicates to the DemoUpdate builder.

type Demos

type Demos []*Demo

Demos is a parsable slice of Demo.

type DepartmentRoles

type DepartmentRoles struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 关联 lion_role 表的用户组 ID
	RoleID int `json:"role_id,omitempty"`
	// 关联 lion_departments 表的资源 ID
	DepartmentID int `json:"department_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DepartmentRolesQuery when eager-loading is set.
	Edges DepartmentRolesEdges `json:"edges"`
	// contains filtered or unexported fields
}

DepartmentRoles is the model entity for the DepartmentRoles schema.

func (*DepartmentRoles) QueryLionDepartments

func (_m *DepartmentRoles) QueryLionDepartments() *DepartmentsQuery

QueryLionDepartments queries the "lion_departments" edge of the DepartmentRoles entity.

func (*DepartmentRoles) QueryLionRoles

func (_m *DepartmentRoles) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the DepartmentRoles entity.

func (*DepartmentRoles) String

func (_m *DepartmentRoles) String() string

String implements the fmt.Stringer.

func (*DepartmentRoles) Unwrap

func (_m *DepartmentRoles) Unwrap() *DepartmentRoles

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

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

func (*DepartmentRoles) Value

func (_m *DepartmentRoles) Value(name string) (ent.Value, error)

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

type DepartmentRolesClient

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

DepartmentRolesClient is a client for the DepartmentRoles schema.

func NewDepartmentRolesClient

func NewDepartmentRolesClient(c config) *DepartmentRolesClient

NewDepartmentRolesClient returns a client for the DepartmentRoles from the given config.

func (*DepartmentRolesClient) Create

Create returns a builder for creating a DepartmentRoles entity.

func (*DepartmentRolesClient) CreateBulk

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

func (*DepartmentRolesClient) Delete

Delete returns a delete builder for DepartmentRoles.

func (*DepartmentRolesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DepartmentRolesClient) DeleteOneID

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

func (*DepartmentRolesClient) Get

Get returns a DepartmentRoles entity by its id.

func (*DepartmentRolesClient) GetX

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

func (*DepartmentRolesClient) Hooks

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

Hooks returns the client hooks.

func (*DepartmentRolesClient) Intercept

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

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

func (*DepartmentRolesClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DepartmentRolesClient) MapCreateBulk

func (c *DepartmentRolesClient) MapCreateBulk(slice any, setFunc func(*DepartmentRolesCreate, int)) *DepartmentRolesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DepartmentRolesClient) Query

Query returns a query builder for DepartmentRoles.

func (*DepartmentRolesClient) QueryLionDepartments

func (c *DepartmentRolesClient) QueryLionDepartments(_m *DepartmentRoles) *DepartmentsQuery

QueryLionDepartments queries the lion_departments edge of a DepartmentRoles.

func (*DepartmentRolesClient) QueryLionRoles

func (c *DepartmentRolesClient) QueryLionRoles(_m *DepartmentRoles) *RolesQuery

QueryLionRoles queries the lion_roles edge of a DepartmentRoles.

func (*DepartmentRolesClient) Update

Update returns an update builder for DepartmentRoles.

func (*DepartmentRolesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DepartmentRolesClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DepartmentRolesClient) Use

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

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

type DepartmentRolesCreate

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

DepartmentRolesCreate is the builder for creating a DepartmentRoles entity.

func (*DepartmentRolesCreate) Exec

Exec executes the query.

func (*DepartmentRolesCreate) ExecX

func (_c *DepartmentRolesCreate) ExecX(ctx context.Context)

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

func (*DepartmentRolesCreate) Mutation

Mutation returns the DepartmentRolesMutation object of the builder.

func (*DepartmentRolesCreate) Save

Save creates the DepartmentRoles in the database.

func (*DepartmentRolesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DepartmentRolesCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*DepartmentRolesCreate) SetCreatedBy

func (_c *DepartmentRolesCreate) SetCreatedBy(v int64) *DepartmentRolesCreate

SetCreatedBy sets the "created_by" field.

func (*DepartmentRolesCreate) SetDepartmentID

func (_c *DepartmentRolesCreate) SetDepartmentID(v int) *DepartmentRolesCreate

SetDepartmentID sets the "department_id" field.

func (*DepartmentRolesCreate) SetLionDepartments

func (_c *DepartmentRolesCreate) SetLionDepartments(v *Departments) *DepartmentRolesCreate

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*DepartmentRolesCreate) SetLionDepartmentsID

func (_c *DepartmentRolesCreate) SetLionDepartmentsID(id int) *DepartmentRolesCreate

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*DepartmentRolesCreate) SetLionRoles

func (_c *DepartmentRolesCreate) SetLionRoles(v *Roles) *DepartmentRolesCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*DepartmentRolesCreate) SetLionRolesID

func (_c *DepartmentRolesCreate) SetLionRolesID(id int) *DepartmentRolesCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*DepartmentRolesCreate) SetNillableCreatedAt

func (_c *DepartmentRolesCreate) SetNillableCreatedAt(v *time.Time) *DepartmentRolesCreate

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

func (*DepartmentRolesCreate) SetNillableCreatedBy

func (_c *DepartmentRolesCreate) SetNillableCreatedBy(v *int64) *DepartmentRolesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DepartmentRolesCreate) SetNillableUpdatedAt

func (_c *DepartmentRolesCreate) SetNillableUpdatedAt(v *time.Time) *DepartmentRolesCreate

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

func (*DepartmentRolesCreate) SetNillableUpdatedBy

func (_c *DepartmentRolesCreate) SetNillableUpdatedBy(v *int64) *DepartmentRolesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DepartmentRolesCreate) SetRoleID

SetRoleID sets the "role_id" field.

func (*DepartmentRolesCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentRolesCreate) SetUpdatedBy

func (_c *DepartmentRolesCreate) SetUpdatedBy(v int64) *DepartmentRolesCreate

SetUpdatedBy sets the "updated_by" field.

type DepartmentRolesCreateBulk

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

DepartmentRolesCreateBulk is the builder for creating many DepartmentRoles entities in bulk.

func (*DepartmentRolesCreateBulk) Exec

Exec executes the query.

func (*DepartmentRolesCreateBulk) ExecX

func (_c *DepartmentRolesCreateBulk) ExecX(ctx context.Context)

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

func (*DepartmentRolesCreateBulk) Save

Save creates the DepartmentRoles entities in the database.

func (*DepartmentRolesCreateBulk) SaveX

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

type DepartmentRolesDelete

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

DepartmentRolesDelete is the builder for deleting a DepartmentRoles entity.

func (*DepartmentRolesDelete) Exec

func (_d *DepartmentRolesDelete) Exec(ctx context.Context) (int, error)

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

func (*DepartmentRolesDelete) ExecX

func (_d *DepartmentRolesDelete) ExecX(ctx context.Context) int

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

func (*DepartmentRolesDelete) Where

Where appends a list predicates to the DepartmentRolesDelete builder.

type DepartmentRolesDeleteOne

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

DepartmentRolesDeleteOne is the builder for deleting a single DepartmentRoles entity.

func (*DepartmentRolesDeleteOne) Exec

Exec executes the deletion query.

func (*DepartmentRolesDeleteOne) ExecX

func (_d *DepartmentRolesDeleteOne) ExecX(ctx context.Context)

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

func (*DepartmentRolesDeleteOne) Where

Where appends a list predicates to the DepartmentRolesDelete builder.

type DepartmentRolesEdges

type DepartmentRolesEdges struct {
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// LionDepartments holds the value of the lion_departments edge.
	LionDepartments *Departments `json:"lion_departments,omitempty"`
	// contains filtered or unexported fields
}

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

func (DepartmentRolesEdges) LionDepartmentsOrErr

func (e DepartmentRolesEdges) LionDepartmentsOrErr() (*Departments, error)

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

func (DepartmentRolesEdges) LionRolesOrErr

func (e DepartmentRolesEdges) LionRolesOrErr() (*Roles, error)

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

type DepartmentRolesGroupBy

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

DepartmentRolesGroupBy is the group-by builder for DepartmentRoles entities.

func (*DepartmentRolesGroupBy) Aggregate

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

func (*DepartmentRolesGroupBy) Bool

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

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

func (*DepartmentRolesGroupBy) BoolX

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

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

func (*DepartmentRolesGroupBy) Bools

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

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

func (*DepartmentRolesGroupBy) BoolsX

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

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

func (*DepartmentRolesGroupBy) Float64

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

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

func (*DepartmentRolesGroupBy) Float64X

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

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

func (*DepartmentRolesGroupBy) Float64s

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

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

func (*DepartmentRolesGroupBy) Float64sX

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

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

func (*DepartmentRolesGroupBy) Int

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

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

func (*DepartmentRolesGroupBy) IntX

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

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

func (*DepartmentRolesGroupBy) Ints

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

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

func (*DepartmentRolesGroupBy) IntsX

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

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

func (*DepartmentRolesGroupBy) Scan

func (_g *DepartmentRolesGroupBy) Scan(ctx context.Context, v any) error

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

func (*DepartmentRolesGroupBy) ScanX

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

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

func (*DepartmentRolesGroupBy) String

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

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

func (*DepartmentRolesGroupBy) StringX

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

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

func (*DepartmentRolesGroupBy) Strings

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

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

func (*DepartmentRolesGroupBy) StringsX

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

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

type DepartmentRolesMutation

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

DepartmentRolesMutation represents an operation that mutates the DepartmentRoles nodes in the graph.

func (*DepartmentRolesMutation) AddCreatedBy

func (m *DepartmentRolesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*DepartmentRolesMutation) AddField

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) AddUpdatedBy

func (m *DepartmentRolesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*DepartmentRolesMutation) AddedCreatedBy

func (m *DepartmentRolesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*DepartmentRolesMutation) AddedEdges

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

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

func (*DepartmentRolesMutation) AddedField

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

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

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

func (*DepartmentRolesMutation) AddedIDs

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

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

func (*DepartmentRolesMutation) AddedUpdatedBy

func (m *DepartmentRolesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*DepartmentRolesMutation) ClearCreatedBy

func (m *DepartmentRolesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*DepartmentRolesMutation) ClearEdge

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

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) ClearLionDepartments

func (m *DepartmentRolesMutation) ClearLionDepartments()

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*DepartmentRolesMutation) ClearLionRoles

func (m *DepartmentRolesMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*DepartmentRolesMutation) ClearUpdatedBy

func (m *DepartmentRolesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DepartmentRolesMutation) ClearedEdges

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

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

func (*DepartmentRolesMutation) ClearedFields

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

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

func (DepartmentRolesMutation) Client

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

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

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

func (*DepartmentRolesMutation) CreatedBy

func (m *DepartmentRolesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*DepartmentRolesMutation) CreatedByCleared

func (m *DepartmentRolesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*DepartmentRolesMutation) DepartmentID

func (m *DepartmentRolesMutation) DepartmentID() (r int, exists bool)

DepartmentID returns the value of the "department_id" field in the mutation.

func (*DepartmentRolesMutation) EdgeCleared

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

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

func (*DepartmentRolesMutation) Field

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

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

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

func (*DepartmentRolesMutation) Fields

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

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

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) LionDepartmentsCleared

func (m *DepartmentRolesMutation) LionDepartmentsCleared() bool

LionDepartmentsCleared reports if the "lion_departments" edge to the Departments entity was cleared.

func (*DepartmentRolesMutation) LionDepartmentsID

func (m *DepartmentRolesMutation) LionDepartmentsID() (id int, exists bool)

LionDepartmentsID returns the "lion_departments" edge ID in the mutation.

func (*DepartmentRolesMutation) LionDepartmentsIDs

func (m *DepartmentRolesMutation) LionDepartmentsIDs() (ids []int)

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

func (*DepartmentRolesMutation) LionRolesCleared

func (m *DepartmentRolesMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*DepartmentRolesMutation) LionRolesID

func (m *DepartmentRolesMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*DepartmentRolesMutation) LionRolesIDs

func (m *DepartmentRolesMutation) LionRolesIDs() (ids []int)

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

func (*DepartmentRolesMutation) OldCreatedAt

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

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

func (m *DepartmentRolesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the DepartmentRoles entity. If the DepartmentRoles 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 (*DepartmentRolesMutation) OldDepartmentID

func (m *DepartmentRolesMutation) OldDepartmentID(ctx context.Context) (v int, err error)

OldDepartmentID returns the old "department_id" field's value of the DepartmentRoles entity. If the DepartmentRoles 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 (*DepartmentRolesMutation) OldField

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) OldRoleID

func (m *DepartmentRolesMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the DepartmentRoles entity. If the DepartmentRoles 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 (*DepartmentRolesMutation) OldUpdatedAt

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

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

func (m *DepartmentRolesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the DepartmentRoles entity. If the DepartmentRoles 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 (*DepartmentRolesMutation) Op

func (m *DepartmentRolesMutation) Op() Op

Op returns the operation name.

func (*DepartmentRolesMutation) RemovedEdges

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

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

func (*DepartmentRolesMutation) RemovedIDs

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) ResetCreatedAt

func (m *DepartmentRolesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DepartmentRolesMutation) ResetCreatedBy

func (m *DepartmentRolesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*DepartmentRolesMutation) ResetDepartmentID

func (m *DepartmentRolesMutation) ResetDepartmentID()

ResetDepartmentID resets all changes to the "department_id" field.

func (*DepartmentRolesMutation) ResetEdge

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

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) ResetLionDepartments

func (m *DepartmentRolesMutation) ResetLionDepartments()

ResetLionDepartments resets all changes to the "lion_departments" edge.

func (*DepartmentRolesMutation) ResetLionRoles

func (m *DepartmentRolesMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*DepartmentRolesMutation) ResetRoleID

func (m *DepartmentRolesMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*DepartmentRolesMutation) ResetUpdatedAt

func (m *DepartmentRolesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DepartmentRolesMutation) ResetUpdatedBy

func (m *DepartmentRolesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*DepartmentRolesMutation) RoleID

func (m *DepartmentRolesMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*DepartmentRolesMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DepartmentRolesMutation) SetCreatedBy

func (m *DepartmentRolesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*DepartmentRolesMutation) SetDepartmentID

func (m *DepartmentRolesMutation) SetDepartmentID(i int)

SetDepartmentID sets the "department_id" field.

func (*DepartmentRolesMutation) SetField

func (m *DepartmentRolesMutation) 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 (*DepartmentRolesMutation) SetLionDepartmentsID

func (m *DepartmentRolesMutation) SetLionDepartmentsID(id int)

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by id.

func (*DepartmentRolesMutation) SetLionRolesID

func (m *DepartmentRolesMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*DepartmentRolesMutation) SetOp

func (m *DepartmentRolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DepartmentRolesMutation) SetRoleID

func (m *DepartmentRolesMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*DepartmentRolesMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentRolesMutation) SetUpdatedBy

func (m *DepartmentRolesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (DepartmentRolesMutation) Tx

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

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

func (*DepartmentRolesMutation) Type

func (m *DepartmentRolesMutation) Type() string

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

func (*DepartmentRolesMutation) UpdatedAt

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

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

func (*DepartmentRolesMutation) UpdatedBy

func (m *DepartmentRolesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*DepartmentRolesMutation) UpdatedByCleared

func (m *DepartmentRolesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*DepartmentRolesMutation) Where

Where appends a list predicates to the DepartmentRolesMutation builder.

func (*DepartmentRolesMutation) WhereP

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

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

type DepartmentRolesQuery

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

DepartmentRolesQuery is the builder for querying DepartmentRoles entities.

func (*DepartmentRolesQuery) Aggregate

Aggregate returns a DepartmentRolesSelect configured with the given aggregations.

func (*DepartmentRolesQuery) All

All executes the query and returns a list of DepartmentRolesSlice.

func (*DepartmentRolesQuery) AllX

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

func (*DepartmentRolesQuery) Clone

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

func (*DepartmentRolesQuery) Count

func (_q *DepartmentRolesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DepartmentRolesQuery) CountX

func (_q *DepartmentRolesQuery) CountX(ctx context.Context) int

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

func (*DepartmentRolesQuery) Exist

func (_q *DepartmentRolesQuery) Exist(ctx context.Context) (bool, error)

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

func (*DepartmentRolesQuery) ExistX

func (_q *DepartmentRolesQuery) ExistX(ctx context.Context) bool

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

func (*DepartmentRolesQuery) First

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

func (*DepartmentRolesQuery) FirstID

func (_q *DepartmentRolesQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DepartmentRolesQuery) FirstIDX

func (_q *DepartmentRolesQuery) FirstIDX(ctx context.Context) int

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

func (*DepartmentRolesQuery) FirstX

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

func (*DepartmentRolesQuery) GroupBy

func (_q *DepartmentRolesQuery) GroupBy(field string, fields ...string) *DepartmentRolesGroupBy

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

Example:

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

client.DepartmentRoles.Query().
	GroupBy(departmentroles.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*DepartmentRolesQuery) IDs

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

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

func (*DepartmentRolesQuery) IDsX

func (_q *DepartmentRolesQuery) IDsX(ctx context.Context) []int

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

func (*DepartmentRolesQuery) Limit

func (_q *DepartmentRolesQuery) Limit(limit int) *DepartmentRolesQuery

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

func (*DepartmentRolesQuery) Offset

func (_q *DepartmentRolesQuery) Offset(offset int) *DepartmentRolesQuery

Offset to start from.

func (*DepartmentRolesQuery) Only

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

func (*DepartmentRolesQuery) OnlyID

func (_q *DepartmentRolesQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DepartmentRolesQuery) OnlyIDX

func (_q *DepartmentRolesQuery) OnlyIDX(ctx context.Context) int

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

func (*DepartmentRolesQuery) OnlyX

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

func (*DepartmentRolesQuery) Order

Order specifies how the records should be ordered.

func (*DepartmentRolesQuery) QueryLionDepartments

func (_q *DepartmentRolesQuery) QueryLionDepartments() *DepartmentsQuery

QueryLionDepartments chains the current query on the "lion_departments" edge.

func (*DepartmentRolesQuery) QueryLionRoles

func (_q *DepartmentRolesQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*DepartmentRolesQuery) Select

func (_q *DepartmentRolesQuery) Select(fields ...string) *DepartmentRolesSelect

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

Example:

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

client.DepartmentRoles.Query().
	Select(departmentroles.FieldCreatedAt).
	Scan(ctx, &v)

func (*DepartmentRolesQuery) Unique

func (_q *DepartmentRolesQuery) Unique(unique bool) *DepartmentRolesQuery

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

Where adds a new predicate for the DepartmentRolesQuery builder.

func (*DepartmentRolesQuery) WithLionDepartments

func (_q *DepartmentRolesQuery) WithLionDepartments(opts ...func(*DepartmentsQuery)) *DepartmentRolesQuery

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

func (*DepartmentRolesQuery) WithLionRoles

func (_q *DepartmentRolesQuery) WithLionRoles(opts ...func(*RolesQuery)) *DepartmentRolesQuery

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

type DepartmentRolesSelect

type DepartmentRolesSelect struct {
	*DepartmentRolesQuery
	// contains filtered or unexported fields
}

DepartmentRolesSelect is the builder for selecting fields of DepartmentRoles entities.

func (*DepartmentRolesSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DepartmentRolesSelect) Bool

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

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

func (*DepartmentRolesSelect) BoolX

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

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

func (*DepartmentRolesSelect) Bools

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

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

func (*DepartmentRolesSelect) BoolsX

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

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

func (*DepartmentRolesSelect) Float64

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

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

func (*DepartmentRolesSelect) Float64X

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

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

func (*DepartmentRolesSelect) Float64s

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

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

func (*DepartmentRolesSelect) Float64sX

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

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

func (*DepartmentRolesSelect) Int

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

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

func (*DepartmentRolesSelect) IntX

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

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

func (*DepartmentRolesSelect) Ints

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

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

func (*DepartmentRolesSelect) IntsX

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

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

func (*DepartmentRolesSelect) Scan

func (_s *DepartmentRolesSelect) Scan(ctx context.Context, v any) error

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

func (*DepartmentRolesSelect) ScanX

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

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

func (*DepartmentRolesSelect) String

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

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

func (*DepartmentRolesSelect) StringX

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

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

func (*DepartmentRolesSelect) Strings

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

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

func (*DepartmentRolesSelect) StringsX

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

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

type DepartmentRolesSlice

type DepartmentRolesSlice []*DepartmentRoles

DepartmentRolesSlice is a parsable slice of DepartmentRoles.

type DepartmentRolesUpdate

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

DepartmentRolesUpdate is the builder for updating DepartmentRoles entities.

func (*DepartmentRolesUpdate) AddCreatedBy

func (_u *DepartmentRolesUpdate) AddCreatedBy(v int64) *DepartmentRolesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*DepartmentRolesUpdate) AddUpdatedBy

func (_u *DepartmentRolesUpdate) AddUpdatedBy(v int64) *DepartmentRolesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*DepartmentRolesUpdate) ClearCreatedBy

func (_u *DepartmentRolesUpdate) ClearCreatedBy() *DepartmentRolesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*DepartmentRolesUpdate) ClearLionDepartments

func (_u *DepartmentRolesUpdate) ClearLionDepartments() *DepartmentRolesUpdate

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*DepartmentRolesUpdate) ClearLionRoles

func (_u *DepartmentRolesUpdate) ClearLionRoles() *DepartmentRolesUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*DepartmentRolesUpdate) ClearUpdatedBy

func (_u *DepartmentRolesUpdate) ClearUpdatedBy() *DepartmentRolesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DepartmentRolesUpdate) Exec

Exec executes the query.

func (*DepartmentRolesUpdate) ExecX

func (_u *DepartmentRolesUpdate) ExecX(ctx context.Context)

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

func (*DepartmentRolesUpdate) Mutation

Mutation returns the DepartmentRolesMutation object of the builder.

func (*DepartmentRolesUpdate) Save

func (_u *DepartmentRolesUpdate) Save(ctx context.Context) (int, error)

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

func (*DepartmentRolesUpdate) SaveX

func (_u *DepartmentRolesUpdate) SaveX(ctx context.Context) int

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

func (*DepartmentRolesUpdate) SetCreatedBy

func (_u *DepartmentRolesUpdate) SetCreatedBy(v int64) *DepartmentRolesUpdate

SetCreatedBy sets the "created_by" field.

func (*DepartmentRolesUpdate) SetDepartmentID

func (_u *DepartmentRolesUpdate) SetDepartmentID(v int) *DepartmentRolesUpdate

SetDepartmentID sets the "department_id" field.

func (*DepartmentRolesUpdate) SetLionDepartments

func (_u *DepartmentRolesUpdate) SetLionDepartments(v *Departments) *DepartmentRolesUpdate

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*DepartmentRolesUpdate) SetLionDepartmentsID

func (_u *DepartmentRolesUpdate) SetLionDepartmentsID(id int) *DepartmentRolesUpdate

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*DepartmentRolesUpdate) SetLionRoles

func (_u *DepartmentRolesUpdate) SetLionRoles(v *Roles) *DepartmentRolesUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*DepartmentRolesUpdate) SetLionRolesID

func (_u *DepartmentRolesUpdate) SetLionRolesID(id int) *DepartmentRolesUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*DepartmentRolesUpdate) SetNillableCreatedBy

func (_u *DepartmentRolesUpdate) SetNillableCreatedBy(v *int64) *DepartmentRolesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DepartmentRolesUpdate) SetNillableDepartmentID

func (_u *DepartmentRolesUpdate) SetNillableDepartmentID(v *int) *DepartmentRolesUpdate

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*DepartmentRolesUpdate) SetNillableRoleID

func (_u *DepartmentRolesUpdate) SetNillableRoleID(v *int) *DepartmentRolesUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*DepartmentRolesUpdate) SetNillableUpdatedBy

func (_u *DepartmentRolesUpdate) SetNillableUpdatedBy(v *int64) *DepartmentRolesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DepartmentRolesUpdate) SetRoleID

SetRoleID sets the "role_id" field.

func (*DepartmentRolesUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentRolesUpdate) SetUpdatedBy

func (_u *DepartmentRolesUpdate) SetUpdatedBy(v int64) *DepartmentRolesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*DepartmentRolesUpdate) Where

Where appends a list predicates to the DepartmentRolesUpdate builder.

type DepartmentRolesUpdateOne

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

DepartmentRolesUpdateOne is the builder for updating a single DepartmentRoles entity.

func (*DepartmentRolesUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*DepartmentRolesUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*DepartmentRolesUpdateOne) ClearCreatedBy

func (_u *DepartmentRolesUpdateOne) ClearCreatedBy() *DepartmentRolesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*DepartmentRolesUpdateOne) ClearLionDepartments

func (_u *DepartmentRolesUpdateOne) ClearLionDepartments() *DepartmentRolesUpdateOne

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*DepartmentRolesUpdateOne) ClearLionRoles

func (_u *DepartmentRolesUpdateOne) ClearLionRoles() *DepartmentRolesUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*DepartmentRolesUpdateOne) ClearUpdatedBy

func (_u *DepartmentRolesUpdateOne) ClearUpdatedBy() *DepartmentRolesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DepartmentRolesUpdateOne) Exec

Exec executes the query on the entity.

func (*DepartmentRolesUpdateOne) ExecX

func (_u *DepartmentRolesUpdateOne) ExecX(ctx context.Context)

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

func (*DepartmentRolesUpdateOne) Mutation

Mutation returns the DepartmentRolesMutation object of the builder.

func (*DepartmentRolesUpdateOne) Save

Save executes the query and returns the updated DepartmentRoles entity.

func (*DepartmentRolesUpdateOne) SaveX

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

func (*DepartmentRolesUpdateOne) Select

func (_u *DepartmentRolesUpdateOne) Select(field string, fields ...string) *DepartmentRolesUpdateOne

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

func (*DepartmentRolesUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*DepartmentRolesUpdateOne) SetDepartmentID

func (_u *DepartmentRolesUpdateOne) SetDepartmentID(v int) *DepartmentRolesUpdateOne

SetDepartmentID sets the "department_id" field.

func (*DepartmentRolesUpdateOne) SetLionDepartments

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*DepartmentRolesUpdateOne) SetLionDepartmentsID

func (_u *DepartmentRolesUpdateOne) SetLionDepartmentsID(id int) *DepartmentRolesUpdateOne

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*DepartmentRolesUpdateOne) SetLionRoles

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*DepartmentRolesUpdateOne) SetLionRolesID

func (_u *DepartmentRolesUpdateOne) SetLionRolesID(id int) *DepartmentRolesUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*DepartmentRolesUpdateOne) SetNillableCreatedBy

func (_u *DepartmentRolesUpdateOne) SetNillableCreatedBy(v *int64) *DepartmentRolesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DepartmentRolesUpdateOne) SetNillableDepartmentID

func (_u *DepartmentRolesUpdateOne) SetNillableDepartmentID(v *int) *DepartmentRolesUpdateOne

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*DepartmentRolesUpdateOne) SetNillableRoleID

func (_u *DepartmentRolesUpdateOne) SetNillableRoleID(v *int) *DepartmentRolesUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*DepartmentRolesUpdateOne) SetNillableUpdatedBy

func (_u *DepartmentRolesUpdateOne) SetNillableUpdatedBy(v *int64) *DepartmentRolesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DepartmentRolesUpdateOne) SetRoleID

SetRoleID sets the "role_id" field.

func (*DepartmentRolesUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentRolesUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*DepartmentRolesUpdateOne) Where

Where appends a list predicates to the DepartmentRolesUpdate builder.

type Departments

type Departments struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 父部门ID,构建树形组织结构,值为 0 表示顶级部门
	ParentID int `json:"parent_id,omitempty"`
	// 部门名称,用于系统内部显示和业务逻辑
	Name string `json:"name,omitempty"`
	// 部门类型分类:0-未指定,1-业务部门,2-支持部门,3-管理部门,4-虚拟部门
	DepartmentType int `json:"department_type,omitempty"`
	// 部门运营状态:0-未指定,1-正常运营,2-暂停运营,3-已解散,4-合并中
	DepartmentStatus int `json:"department_status,omitempty"`
	// 部门排序顺序,用于同级部门的显示顺序,数值越小排序越靠前,建议使用 10 的倍数便于后续插入,默认值:100,范围:1-9999
	SortOrder int `json:"sort_order,omitempty"`
	// 部门公共邮箱地址,加密存储
	EmailEncrypted []byte `json:"-"`
	// 部门联系电话,加密存储
	PhoneNumberEncrypted []byte `json:"-"`
	// 部门办公地址,加密存储
	AddressEncrypted []byte `json:"-"`
	// 成本中心编码,用于财务核算和成本控制
	CostCenterCode string `json:"-"`
	// 预算编码,用于预算管理和费用控制
	BudgetItemCode string `json:"-"`
	// 部门最大成员数限制,值为 0 表示无限制
	MaxMembers int `json:"max_members,omitempty"`
	// 外部系统标识符,用于第三方系统集成
	ExternalID string `json:"external_id,omitempty"`
	// 扩展元数据,存储自定义业务属性
	Metadata map[string]string `json:"metadata,omitempty"`
	// 部门描述信息,详细说明部门职责和业务范围
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DepartmentsQuery when eager-loading is set.
	Edges DepartmentsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Departments is the model entity for the Departments schema.

func (*Departments) QueryLionDepartmentRoles

func (_m *Departments) QueryLionDepartmentRoles() *DepartmentRolesQuery

QueryLionDepartmentRoles queries the "lion_department_roles" edge of the Departments entity.

func (*Departments) QueryLionGroups

func (_m *Departments) QueryLionGroups() *GroupsQuery

QueryLionGroups queries the "lion_groups" edge of the Departments entity.

func (*Departments) QueryLionUserDepartments

func (_m *Departments) QueryLionUserDepartments() *UserDepartmentsQuery

QueryLionUserDepartments queries the "lion_user_departments" edge of the Departments entity.

func (*Departments) String

func (_m *Departments) String() string

String implements the fmt.Stringer.

func (*Departments) Unwrap

func (_m *Departments) Unwrap() *Departments

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

func (_m *Departments) Update() *DepartmentsUpdateOne

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

func (*Departments) Value

func (_m *Departments) Value(name string) (ent.Value, error)

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

type DepartmentsClient

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

DepartmentsClient is a client for the Departments schema.

func NewDepartmentsClient

func NewDepartmentsClient(c config) *DepartmentsClient

NewDepartmentsClient returns a client for the Departments from the given config.

func (*DepartmentsClient) Create

func (c *DepartmentsClient) Create() *DepartmentsCreate

Create returns a builder for creating a Departments entity.

func (*DepartmentsClient) CreateBulk

func (c *DepartmentsClient) CreateBulk(builders ...*DepartmentsCreate) *DepartmentsCreateBulk

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

func (*DepartmentsClient) Delete

func (c *DepartmentsClient) Delete() *DepartmentsDelete

Delete returns a delete builder for Departments.

func (*DepartmentsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DepartmentsClient) DeleteOneID

func (c *DepartmentsClient) DeleteOneID(id int) *DepartmentsDeleteOne

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

func (*DepartmentsClient) Get

func (c *DepartmentsClient) Get(ctx context.Context, id int) (*Departments, error)

Get returns a Departments entity by its id.

func (*DepartmentsClient) GetX

func (c *DepartmentsClient) GetX(ctx context.Context, id int) *Departments

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

func (*DepartmentsClient) Hooks

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

Hooks returns the client hooks.

func (*DepartmentsClient) Intercept

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

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

func (*DepartmentsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DepartmentsClient) MapCreateBulk

func (c *DepartmentsClient) MapCreateBulk(slice any, setFunc func(*DepartmentsCreate, int)) *DepartmentsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DepartmentsClient) Query

func (c *DepartmentsClient) Query() *DepartmentsQuery

Query returns a query builder for Departments.

func (*DepartmentsClient) QueryLionDepartmentRoles

func (c *DepartmentsClient) QueryLionDepartmentRoles(_m *Departments) *DepartmentRolesQuery

QueryLionDepartmentRoles queries the lion_department_roles edge of a Departments.

func (*DepartmentsClient) QueryLionGroups

func (c *DepartmentsClient) QueryLionGroups(_m *Departments) *GroupsQuery

QueryLionGroups queries the lion_groups edge of a Departments.

func (*DepartmentsClient) QueryLionUserDepartments

func (c *DepartmentsClient) QueryLionUserDepartments(_m *Departments) *UserDepartmentsQuery

QueryLionUserDepartments queries the lion_user_departments edge of a Departments.

func (*DepartmentsClient) Update

func (c *DepartmentsClient) Update() *DepartmentsUpdate

Update returns an update builder for Departments.

func (*DepartmentsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DepartmentsClient) UpdateOneID

func (c *DepartmentsClient) UpdateOneID(id int) *DepartmentsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DepartmentsClient) Use

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

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

type DepartmentsCreate

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

DepartmentsCreate is the builder for creating a Departments entity.

func (*DepartmentsCreate) AddLionDepartmentRoleIDs

func (_c *DepartmentsCreate) AddLionDepartmentRoleIDs(ids ...int) *DepartmentsCreate

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*DepartmentsCreate) AddLionDepartmentRoles

func (_c *DepartmentsCreate) AddLionDepartmentRoles(v ...*DepartmentRoles) *DepartmentsCreate

AddLionDepartmentRoles adds the "lion_department_roles" edges to the DepartmentRoles entity.

func (*DepartmentsCreate) AddLionGroupIDs

func (_c *DepartmentsCreate) AddLionGroupIDs(ids ...int) *DepartmentsCreate

AddLionGroupIDs adds the "lion_groups" edge to the Groups entity by IDs.

func (*DepartmentsCreate) AddLionGroups

func (_c *DepartmentsCreate) AddLionGroups(v ...*Groups) *DepartmentsCreate

AddLionGroups adds the "lion_groups" edges to the Groups entity.

func (*DepartmentsCreate) AddLionUserDepartmentIDs

func (_c *DepartmentsCreate) AddLionUserDepartmentIDs(ids ...int) *DepartmentsCreate

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*DepartmentsCreate) AddLionUserDepartments

func (_c *DepartmentsCreate) AddLionUserDepartments(v ...*UserDepartments) *DepartmentsCreate

AddLionUserDepartments adds the "lion_user_departments" edges to the UserDepartments entity.

func (*DepartmentsCreate) Exec

func (_c *DepartmentsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentsCreate) ExecX

func (_c *DepartmentsCreate) ExecX(ctx context.Context)

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

func (*DepartmentsCreate) Mutation

func (_c *DepartmentsCreate) Mutation() *DepartmentsMutation

Mutation returns the DepartmentsMutation object of the builder.

func (*DepartmentsCreate) Save

Save creates the Departments in the database.

func (*DepartmentsCreate) SaveX

func (_c *DepartmentsCreate) SaveX(ctx context.Context) *Departments

SaveX calls Save and panics if Save returns an error.

func (*DepartmentsCreate) SetAddressEncrypted

func (_c *DepartmentsCreate) SetAddressEncrypted(v []byte) *DepartmentsCreate

SetAddressEncrypted sets the "address_encrypted" field.

func (*DepartmentsCreate) SetBudgetItemCode

func (_c *DepartmentsCreate) SetBudgetItemCode(v string) *DepartmentsCreate

SetBudgetItemCode sets the "budget_item_code" field.

func (*DepartmentsCreate) SetCostCenterCode

func (_c *DepartmentsCreate) SetCostCenterCode(v string) *DepartmentsCreate

SetCostCenterCode sets the "cost_center_code" field.

func (*DepartmentsCreate) SetCreatedAt

func (_c *DepartmentsCreate) SetCreatedAt(v time.Time) *DepartmentsCreate

SetCreatedAt sets the "created_at" field.

func (*DepartmentsCreate) SetCreatedBy

func (_c *DepartmentsCreate) SetCreatedBy(v int64) *DepartmentsCreate

SetCreatedBy sets the "created_by" field.

func (*DepartmentsCreate) SetDeletedAt

func (_c *DepartmentsCreate) SetDeletedAt(v time.Time) *DepartmentsCreate

SetDeletedAt sets the "deleted_at" field.

func (*DepartmentsCreate) SetDepartmentStatus

func (_c *DepartmentsCreate) SetDepartmentStatus(v int) *DepartmentsCreate

SetDepartmentStatus sets the "department_status" field.

func (*DepartmentsCreate) SetDepartmentType

func (_c *DepartmentsCreate) SetDepartmentType(v int) *DepartmentsCreate

SetDepartmentType sets the "department_type" field.

func (*DepartmentsCreate) SetDescription

func (_c *DepartmentsCreate) SetDescription(v string) *DepartmentsCreate

SetDescription sets the "description" field.

func (*DepartmentsCreate) SetEmailEncrypted

func (_c *DepartmentsCreate) SetEmailEncrypted(v []byte) *DepartmentsCreate

SetEmailEncrypted sets the "email_encrypted" field.

func (*DepartmentsCreate) SetExternalID

func (_c *DepartmentsCreate) SetExternalID(v string) *DepartmentsCreate

SetExternalID sets the "external_id" field.

func (*DepartmentsCreate) SetMaxMembers

func (_c *DepartmentsCreate) SetMaxMembers(v int) *DepartmentsCreate

SetMaxMembers sets the "max_members" field.

func (*DepartmentsCreate) SetMetadata

func (_c *DepartmentsCreate) SetMetadata(v map[string]string) *DepartmentsCreate

SetMetadata sets the "metadata" field.

func (*DepartmentsCreate) SetName

func (_c *DepartmentsCreate) SetName(v string) *DepartmentsCreate

SetName sets the "name" field.

func (*DepartmentsCreate) SetNillableBudgetItemCode

func (_c *DepartmentsCreate) SetNillableBudgetItemCode(v *string) *DepartmentsCreate

SetNillableBudgetItemCode sets the "budget_item_code" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableCostCenterCode

func (_c *DepartmentsCreate) SetNillableCostCenterCode(v *string) *DepartmentsCreate

SetNillableCostCenterCode sets the "cost_center_code" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableCreatedAt

func (_c *DepartmentsCreate) SetNillableCreatedAt(v *time.Time) *DepartmentsCreate

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

func (*DepartmentsCreate) SetNillableCreatedBy

func (_c *DepartmentsCreate) SetNillableCreatedBy(v *int64) *DepartmentsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableDeletedAt

func (_c *DepartmentsCreate) SetNillableDeletedAt(v *time.Time) *DepartmentsCreate

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

func (*DepartmentsCreate) SetNillableDepartmentStatus

func (_c *DepartmentsCreate) SetNillableDepartmentStatus(v *int) *DepartmentsCreate

SetNillableDepartmentStatus sets the "department_status" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableDepartmentType

func (_c *DepartmentsCreate) SetNillableDepartmentType(v *int) *DepartmentsCreate

SetNillableDepartmentType sets the "department_type" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableDescription

func (_c *DepartmentsCreate) SetNillableDescription(v *string) *DepartmentsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableExternalID

func (_c *DepartmentsCreate) SetNillableExternalID(v *string) *DepartmentsCreate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableMaxMembers

func (_c *DepartmentsCreate) SetNillableMaxMembers(v *int) *DepartmentsCreate

SetNillableMaxMembers sets the "max_members" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableParentID

func (_c *DepartmentsCreate) SetNillableParentID(v *int) *DepartmentsCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableSortOrder

func (_c *DepartmentsCreate) SetNillableSortOrder(v *int) *DepartmentsCreate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*DepartmentsCreate) SetNillableUpdatedAt

func (_c *DepartmentsCreate) SetNillableUpdatedAt(v *time.Time) *DepartmentsCreate

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

func (*DepartmentsCreate) SetNillableUpdatedBy

func (_c *DepartmentsCreate) SetNillableUpdatedBy(v *int64) *DepartmentsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DepartmentsCreate) SetParentID

func (_c *DepartmentsCreate) SetParentID(v int) *DepartmentsCreate

SetParentID sets the "parent_id" field.

func (*DepartmentsCreate) SetPhoneNumberEncrypted

func (_c *DepartmentsCreate) SetPhoneNumberEncrypted(v []byte) *DepartmentsCreate

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*DepartmentsCreate) SetSortOrder

func (_c *DepartmentsCreate) SetSortOrder(v int) *DepartmentsCreate

SetSortOrder sets the "sort_order" field.

func (*DepartmentsCreate) SetUpdatedAt

func (_c *DepartmentsCreate) SetUpdatedAt(v time.Time) *DepartmentsCreate

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentsCreate) SetUpdatedBy

func (_c *DepartmentsCreate) SetUpdatedBy(v int64) *DepartmentsCreate

SetUpdatedBy sets the "updated_by" field.

type DepartmentsCreateBulk

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

DepartmentsCreateBulk is the builder for creating many Departments entities in bulk.

func (*DepartmentsCreateBulk) Exec

Exec executes the query.

func (*DepartmentsCreateBulk) ExecX

func (_c *DepartmentsCreateBulk) ExecX(ctx context.Context)

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

func (*DepartmentsCreateBulk) Save

Save creates the Departments entities in the database.

func (*DepartmentsCreateBulk) SaveX

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

type DepartmentsDelete

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

DepartmentsDelete is the builder for deleting a Departments entity.

func (*DepartmentsDelete) Exec

func (_d *DepartmentsDelete) Exec(ctx context.Context) (int, error)

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

func (*DepartmentsDelete) ExecX

func (_d *DepartmentsDelete) ExecX(ctx context.Context) int

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

func (*DepartmentsDelete) Where

Where appends a list predicates to the DepartmentsDelete builder.

type DepartmentsDeleteOne

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

DepartmentsDeleteOne is the builder for deleting a single Departments entity.

func (*DepartmentsDeleteOne) Exec

func (_d *DepartmentsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DepartmentsDeleteOne) ExecX

func (_d *DepartmentsDeleteOne) ExecX(ctx context.Context)

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

func (*DepartmentsDeleteOne) Where

Where appends a list predicates to the DepartmentsDelete builder.

type DepartmentsEdges

type DepartmentsEdges struct {
	// LionDepartmentRoles holds the value of the lion_department_roles edge.
	LionDepartmentRoles []*DepartmentRoles `json:"lion_department_roles,omitempty"`
	// LionUserDepartments holds the value of the lion_user_departments edge.
	LionUserDepartments []*UserDepartments `json:"lion_user_departments,omitempty"`
	// LionGroups holds the value of the lion_groups edge.
	LionGroups []*Groups `json:"lion_groups,omitempty"`
	// contains filtered or unexported fields
}

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

func (DepartmentsEdges) LionDepartmentRolesOrErr

func (e DepartmentsEdges) LionDepartmentRolesOrErr() ([]*DepartmentRoles, error)

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

func (DepartmentsEdges) LionGroupsOrErr

func (e DepartmentsEdges) LionGroupsOrErr() ([]*Groups, error)

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

func (DepartmentsEdges) LionUserDepartmentsOrErr

func (e DepartmentsEdges) LionUserDepartmentsOrErr() ([]*UserDepartments, error)

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

type DepartmentsGroupBy

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

DepartmentsGroupBy is the group-by builder for Departments entities.

func (*DepartmentsGroupBy) Aggregate

func (_g *DepartmentsGroupBy) Aggregate(fns ...AggregateFunc) *DepartmentsGroupBy

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

func (*DepartmentsGroupBy) Bool

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

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

func (*DepartmentsGroupBy) BoolX

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

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

func (*DepartmentsGroupBy) Bools

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

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

func (*DepartmentsGroupBy) BoolsX

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

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

func (*DepartmentsGroupBy) Float64

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

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

func (*DepartmentsGroupBy) Float64X

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

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

func (*DepartmentsGroupBy) Float64s

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

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

func (*DepartmentsGroupBy) Float64sX

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

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

func (*DepartmentsGroupBy) Int

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

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

func (*DepartmentsGroupBy) IntX

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

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

func (*DepartmentsGroupBy) Ints

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

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

func (*DepartmentsGroupBy) IntsX

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

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

func (*DepartmentsGroupBy) Scan

func (_g *DepartmentsGroupBy) Scan(ctx context.Context, v any) error

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

func (*DepartmentsGroupBy) ScanX

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

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

func (*DepartmentsGroupBy) String

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

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

func (*DepartmentsGroupBy) StringX

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

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

func (*DepartmentsGroupBy) Strings

func (s *DepartmentsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DepartmentsGroupBy) StringsX

func (s *DepartmentsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DepartmentsMutation

type DepartmentsMutation struct {
	// contains filtered or unexported fields
}

DepartmentsMutation represents an operation that mutates the Departments nodes in the graph.

func (*DepartmentsMutation) AddCreatedBy

func (m *DepartmentsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*DepartmentsMutation) AddDepartmentStatus

func (m *DepartmentsMutation) AddDepartmentStatus(i int)

AddDepartmentStatus adds i to the "department_status" field.

func (*DepartmentsMutation) AddDepartmentType

func (m *DepartmentsMutation) AddDepartmentType(i int)

AddDepartmentType adds i to the "department_type" field.

func (*DepartmentsMutation) AddField

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) AddLionDepartmentRoleIDs

func (m *DepartmentsMutation) AddLionDepartmentRoleIDs(ids ...int)

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by ids.

func (*DepartmentsMutation) AddLionGroupIDs

func (m *DepartmentsMutation) AddLionGroupIDs(ids ...int)

AddLionGroupIDs adds the "lion_groups" edge to the Groups entity by ids.

func (*DepartmentsMutation) AddLionUserDepartmentIDs

func (m *DepartmentsMutation) AddLionUserDepartmentIDs(ids ...int)

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by ids.

func (*DepartmentsMutation) AddMaxMembers

func (m *DepartmentsMutation) AddMaxMembers(i int)

AddMaxMembers adds i to the "max_members" field.

func (*DepartmentsMutation) AddParentID

func (m *DepartmentsMutation) AddParentID(i int)

AddParentID adds i to the "parent_id" field.

func (*DepartmentsMutation) AddSortOrder

func (m *DepartmentsMutation) AddSortOrder(i int)

AddSortOrder adds i to the "sort_order" field.

func (*DepartmentsMutation) AddUpdatedBy

func (m *DepartmentsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*DepartmentsMutation) AddedCreatedBy

func (m *DepartmentsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*DepartmentsMutation) AddedDepartmentStatus

func (m *DepartmentsMutation) AddedDepartmentStatus() (r int, exists bool)

AddedDepartmentStatus returns the value that was added to the "department_status" field in this mutation.

func (*DepartmentsMutation) AddedDepartmentType

func (m *DepartmentsMutation) AddedDepartmentType() (r int, exists bool)

AddedDepartmentType returns the value that was added to the "department_type" field in this mutation.

func (*DepartmentsMutation) AddedEdges

func (m *DepartmentsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DepartmentsMutation) AddedField

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) AddedFields

func (m *DepartmentsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DepartmentsMutation) AddedIDs

func (m *DepartmentsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DepartmentsMutation) AddedMaxMembers

func (m *DepartmentsMutation) AddedMaxMembers() (r int, exists bool)

AddedMaxMembers returns the value that was added to the "max_members" field in this mutation.

func (*DepartmentsMutation) AddedParentID

func (m *DepartmentsMutation) AddedParentID() (r int, exists bool)

AddedParentID returns the value that was added to the "parent_id" field in this mutation.

func (*DepartmentsMutation) AddedSortOrder

func (m *DepartmentsMutation) AddedSortOrder() (r int, exists bool)

AddedSortOrder returns the value that was added to the "sort_order" field in this mutation.

func (*DepartmentsMutation) AddedUpdatedBy

func (m *DepartmentsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*DepartmentsMutation) AddressEncrypted

func (m *DepartmentsMutation) AddressEncrypted() (r []byte, exists bool)

AddressEncrypted returns the value of the "address_encrypted" field in the mutation.

func (*DepartmentsMutation) AddressEncryptedCleared

func (m *DepartmentsMutation) AddressEncryptedCleared() bool

AddressEncryptedCleared returns if the "address_encrypted" field was cleared in this mutation.

func (*DepartmentsMutation) BudgetItemCode

func (m *DepartmentsMutation) BudgetItemCode() (r string, exists bool)

BudgetItemCode returns the value of the "budget_item_code" field in the mutation.

func (*DepartmentsMutation) BudgetItemCodeCleared

func (m *DepartmentsMutation) BudgetItemCodeCleared() bool

BudgetItemCodeCleared returns if the "budget_item_code" field was cleared in this mutation.

func (*DepartmentsMutation) ClearAddressEncrypted

func (m *DepartmentsMutation) ClearAddressEncrypted()

ClearAddressEncrypted clears the value of the "address_encrypted" field.

func (*DepartmentsMutation) ClearBudgetItemCode

func (m *DepartmentsMutation) ClearBudgetItemCode()

ClearBudgetItemCode clears the value of the "budget_item_code" field.

func (*DepartmentsMutation) ClearCostCenterCode

func (m *DepartmentsMutation) ClearCostCenterCode()

ClearCostCenterCode clears the value of the "cost_center_code" field.

func (*DepartmentsMutation) ClearCreatedBy

func (m *DepartmentsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*DepartmentsMutation) ClearDeletedAt

func (m *DepartmentsMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DepartmentsMutation) ClearEdge

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) ClearEmailEncrypted

func (m *DepartmentsMutation) ClearEmailEncrypted()

ClearEmailEncrypted clears the value of the "email_encrypted" field.

func (*DepartmentsMutation) ClearExternalID

func (m *DepartmentsMutation) ClearExternalID()

ClearExternalID clears the value of the "external_id" field.

func (*DepartmentsMutation) ClearField

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) ClearLionDepartmentRoles

func (m *DepartmentsMutation) ClearLionDepartmentRoles()

ClearLionDepartmentRoles clears the "lion_department_roles" edge to the DepartmentRoles entity.

func (*DepartmentsMutation) ClearLionGroups

func (m *DepartmentsMutation) ClearLionGroups()

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*DepartmentsMutation) ClearLionUserDepartments

func (m *DepartmentsMutation) ClearLionUserDepartments()

ClearLionUserDepartments clears the "lion_user_departments" edge to the UserDepartments entity.

func (*DepartmentsMutation) ClearMetadata

func (m *DepartmentsMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*DepartmentsMutation) ClearPhoneNumberEncrypted

func (m *DepartmentsMutation) ClearPhoneNumberEncrypted()

ClearPhoneNumberEncrypted clears the value of the "phone_number_encrypted" field.

func (*DepartmentsMutation) ClearUpdatedBy

func (m *DepartmentsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DepartmentsMutation) ClearedEdges

func (m *DepartmentsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DepartmentsMutation) ClearedFields

func (m *DepartmentsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DepartmentsMutation) Client

func (m DepartmentsMutation) 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 (*DepartmentsMutation) CostCenterCode

func (m *DepartmentsMutation) CostCenterCode() (r string, exists bool)

CostCenterCode returns the value of the "cost_center_code" field in the mutation.

func (*DepartmentsMutation) CostCenterCodeCleared

func (m *DepartmentsMutation) CostCenterCodeCleared() bool

CostCenterCodeCleared returns if the "cost_center_code" field was cleared in this mutation.

func (*DepartmentsMutation) CreatedAt

func (m *DepartmentsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DepartmentsMutation) CreatedBy

func (m *DepartmentsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*DepartmentsMutation) CreatedByCleared

func (m *DepartmentsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*DepartmentsMutation) DeletedAt

func (m *DepartmentsMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*DepartmentsMutation) DeletedAtCleared

func (m *DepartmentsMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*DepartmentsMutation) DepartmentStatus

func (m *DepartmentsMutation) DepartmentStatus() (r int, exists bool)

DepartmentStatus returns the value of the "department_status" field in the mutation.

func (*DepartmentsMutation) DepartmentType

func (m *DepartmentsMutation) DepartmentType() (r int, exists bool)

DepartmentType returns the value of the "department_type" field in the mutation.

func (*DepartmentsMutation) Description

func (m *DepartmentsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*DepartmentsMutation) EdgeCleared

func (m *DepartmentsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DepartmentsMutation) EmailEncrypted

func (m *DepartmentsMutation) EmailEncrypted() (r []byte, exists bool)

EmailEncrypted returns the value of the "email_encrypted" field in the mutation.

func (*DepartmentsMutation) EmailEncryptedCleared

func (m *DepartmentsMutation) EmailEncryptedCleared() bool

EmailEncryptedCleared returns if the "email_encrypted" field was cleared in this mutation.

func (*DepartmentsMutation) ExternalID

func (m *DepartmentsMutation) ExternalID() (r string, exists bool)

ExternalID returns the value of the "external_id" field in the mutation.

func (*DepartmentsMutation) ExternalIDCleared

func (m *DepartmentsMutation) ExternalIDCleared() bool

ExternalIDCleared returns if the "external_id" field was cleared in this mutation.

func (*DepartmentsMutation) Field

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) FieldCleared

func (m *DepartmentsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DepartmentsMutation) Fields

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) ID

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) IDs

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) LionDepartmentRolesCleared

func (m *DepartmentsMutation) LionDepartmentRolesCleared() bool

LionDepartmentRolesCleared reports if the "lion_department_roles" edge to the DepartmentRoles entity was cleared.

func (*DepartmentsMutation) LionDepartmentRolesIDs

func (m *DepartmentsMutation) LionDepartmentRolesIDs() (ids []int)

LionDepartmentRolesIDs returns the "lion_department_roles" edge IDs in the mutation.

func (*DepartmentsMutation) LionGroupsCleared

func (m *DepartmentsMutation) LionGroupsCleared() bool

LionGroupsCleared reports if the "lion_groups" edge to the Groups entity was cleared.

func (*DepartmentsMutation) LionGroupsIDs

func (m *DepartmentsMutation) LionGroupsIDs() (ids []int)

LionGroupsIDs returns the "lion_groups" edge IDs in the mutation.

func (*DepartmentsMutation) LionUserDepartmentsCleared

func (m *DepartmentsMutation) LionUserDepartmentsCleared() bool

LionUserDepartmentsCleared reports if the "lion_user_departments" edge to the UserDepartments entity was cleared.

func (*DepartmentsMutation) LionUserDepartmentsIDs

func (m *DepartmentsMutation) LionUserDepartmentsIDs() (ids []int)

LionUserDepartmentsIDs returns the "lion_user_departments" edge IDs in the mutation.

func (*DepartmentsMutation) MaxMembers

func (m *DepartmentsMutation) MaxMembers() (r int, exists bool)

MaxMembers returns the value of the "max_members" field in the mutation.

func (*DepartmentsMutation) Metadata

func (m *DepartmentsMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*DepartmentsMutation) MetadataCleared

func (m *DepartmentsMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*DepartmentsMutation) Name

func (m *DepartmentsMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*DepartmentsMutation) OldAddressEncrypted

func (m *DepartmentsMutation) OldAddressEncrypted(ctx context.Context) (v []byte, err error)

OldAddressEncrypted returns the old "address_encrypted" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldBudgetItemCode

func (m *DepartmentsMutation) OldBudgetItemCode(ctx context.Context) (v string, err error)

OldBudgetItemCode returns the old "budget_item_code" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldCostCenterCode

func (m *DepartmentsMutation) OldCostCenterCode(ctx context.Context) (v string, err error)

OldCostCenterCode returns the old "cost_center_code" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldCreatedAt

func (m *DepartmentsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldCreatedBy

func (m *DepartmentsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldDeletedAt

func (m *DepartmentsMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldDepartmentStatus

func (m *DepartmentsMutation) OldDepartmentStatus(ctx context.Context) (v int, err error)

OldDepartmentStatus returns the old "department_status" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldDepartmentType

func (m *DepartmentsMutation) OldDepartmentType(ctx context.Context) (v int, err error)

OldDepartmentType returns the old "department_type" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldDescription

func (m *DepartmentsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldEmailEncrypted

func (m *DepartmentsMutation) OldEmailEncrypted(ctx context.Context) (v []byte, err error)

OldEmailEncrypted returns the old "email_encrypted" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldExternalID

func (m *DepartmentsMutation) OldExternalID(ctx context.Context) (v string, err error)

OldExternalID returns the old "external_id" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldField

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) OldMaxMembers

func (m *DepartmentsMutation) OldMaxMembers(ctx context.Context) (v int, err error)

OldMaxMembers returns the old "max_members" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldMetadata

func (m *DepartmentsMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldName

func (m *DepartmentsMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldParentID

func (m *DepartmentsMutation) OldParentID(ctx context.Context) (v int, err error)

OldParentID returns the old "parent_id" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldPhoneNumberEncrypted

func (m *DepartmentsMutation) OldPhoneNumberEncrypted(ctx context.Context) (v []byte, err error)

OldPhoneNumberEncrypted returns the old "phone_number_encrypted" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldSortOrder

func (m *DepartmentsMutation) OldSortOrder(ctx context.Context) (v int, err error)

OldSortOrder returns the old "sort_order" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldUpdatedAt

func (m *DepartmentsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) OldUpdatedBy

func (m *DepartmentsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Departments entity. If the Departments 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 (*DepartmentsMutation) Op

func (m *DepartmentsMutation) Op() Op

Op returns the operation name.

func (*DepartmentsMutation) ParentID

func (m *DepartmentsMutation) ParentID() (r int, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*DepartmentsMutation) PhoneNumberEncrypted

func (m *DepartmentsMutation) PhoneNumberEncrypted() (r []byte, exists bool)

PhoneNumberEncrypted returns the value of the "phone_number_encrypted" field in the mutation.

func (*DepartmentsMutation) PhoneNumberEncryptedCleared

func (m *DepartmentsMutation) PhoneNumberEncryptedCleared() bool

PhoneNumberEncryptedCleared returns if the "phone_number_encrypted" field was cleared in this mutation.

func (*DepartmentsMutation) RemoveLionDepartmentRoleIDs

func (m *DepartmentsMutation) RemoveLionDepartmentRoleIDs(ids ...int)

RemoveLionDepartmentRoleIDs removes the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*DepartmentsMutation) RemoveLionGroupIDs

func (m *DepartmentsMutation) RemoveLionGroupIDs(ids ...int)

RemoveLionGroupIDs removes the "lion_groups" edge to the Groups entity by IDs.

func (*DepartmentsMutation) RemoveLionUserDepartmentIDs

func (m *DepartmentsMutation) RemoveLionUserDepartmentIDs(ids ...int)

RemoveLionUserDepartmentIDs removes the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*DepartmentsMutation) RemovedEdges

func (m *DepartmentsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DepartmentsMutation) RemovedIDs

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) RemovedLionDepartmentRolesIDs

func (m *DepartmentsMutation) RemovedLionDepartmentRolesIDs() (ids []int)

RemovedLionDepartmentRoles returns the removed IDs of the "lion_department_roles" edge to the DepartmentRoles entity.

func (*DepartmentsMutation) RemovedLionGroupsIDs

func (m *DepartmentsMutation) RemovedLionGroupsIDs() (ids []int)

RemovedLionGroups returns the removed IDs of the "lion_groups" edge to the Groups entity.

func (*DepartmentsMutation) RemovedLionUserDepartmentsIDs

func (m *DepartmentsMutation) RemovedLionUserDepartmentsIDs() (ids []int)

RemovedLionUserDepartments returns the removed IDs of the "lion_user_departments" edge to the UserDepartments entity.

func (*DepartmentsMutation) ResetAddressEncrypted

func (m *DepartmentsMutation) ResetAddressEncrypted()

ResetAddressEncrypted resets all changes to the "address_encrypted" field.

func (*DepartmentsMutation) ResetBudgetItemCode

func (m *DepartmentsMutation) ResetBudgetItemCode()

ResetBudgetItemCode resets all changes to the "budget_item_code" field.

func (*DepartmentsMutation) ResetCostCenterCode

func (m *DepartmentsMutation) ResetCostCenterCode()

ResetCostCenterCode resets all changes to the "cost_center_code" field.

func (*DepartmentsMutation) ResetCreatedAt

func (m *DepartmentsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DepartmentsMutation) ResetCreatedBy

func (m *DepartmentsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*DepartmentsMutation) ResetDeletedAt

func (m *DepartmentsMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*DepartmentsMutation) ResetDepartmentStatus

func (m *DepartmentsMutation) ResetDepartmentStatus()

ResetDepartmentStatus resets all changes to the "department_status" field.

func (*DepartmentsMutation) ResetDepartmentType

func (m *DepartmentsMutation) ResetDepartmentType()

ResetDepartmentType resets all changes to the "department_type" field.

func (*DepartmentsMutation) ResetDescription

func (m *DepartmentsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DepartmentsMutation) ResetEdge

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) ResetEmailEncrypted

func (m *DepartmentsMutation) ResetEmailEncrypted()

ResetEmailEncrypted resets all changes to the "email_encrypted" field.

func (*DepartmentsMutation) ResetExternalID

func (m *DepartmentsMutation) ResetExternalID()

ResetExternalID resets all changes to the "external_id" field.

func (*DepartmentsMutation) ResetField

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) ResetLionDepartmentRoles

func (m *DepartmentsMutation) ResetLionDepartmentRoles()

ResetLionDepartmentRoles resets all changes to the "lion_department_roles" edge.

func (*DepartmentsMutation) ResetLionGroups

func (m *DepartmentsMutation) ResetLionGroups()

ResetLionGroups resets all changes to the "lion_groups" edge.

func (*DepartmentsMutation) ResetLionUserDepartments

func (m *DepartmentsMutation) ResetLionUserDepartments()

ResetLionUserDepartments resets all changes to the "lion_user_departments" edge.

func (*DepartmentsMutation) ResetMaxMembers

func (m *DepartmentsMutation) ResetMaxMembers()

ResetMaxMembers resets all changes to the "max_members" field.

func (*DepartmentsMutation) ResetMetadata

func (m *DepartmentsMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*DepartmentsMutation) ResetName

func (m *DepartmentsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DepartmentsMutation) ResetParentID

func (m *DepartmentsMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*DepartmentsMutation) ResetPhoneNumberEncrypted

func (m *DepartmentsMutation) ResetPhoneNumberEncrypted()

ResetPhoneNumberEncrypted resets all changes to the "phone_number_encrypted" field.

func (*DepartmentsMutation) ResetSortOrder

func (m *DepartmentsMutation) ResetSortOrder()

ResetSortOrder resets all changes to the "sort_order" field.

func (*DepartmentsMutation) ResetUpdatedAt

func (m *DepartmentsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DepartmentsMutation) ResetUpdatedBy

func (m *DepartmentsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*DepartmentsMutation) SetAddressEncrypted

func (m *DepartmentsMutation) SetAddressEncrypted(b []byte)

SetAddressEncrypted sets the "address_encrypted" field.

func (*DepartmentsMutation) SetBudgetItemCode

func (m *DepartmentsMutation) SetBudgetItemCode(s string)

SetBudgetItemCode sets the "budget_item_code" field.

func (*DepartmentsMutation) SetCostCenterCode

func (m *DepartmentsMutation) SetCostCenterCode(s string)

SetCostCenterCode sets the "cost_center_code" field.

func (*DepartmentsMutation) SetCreatedAt

func (m *DepartmentsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DepartmentsMutation) SetCreatedBy

func (m *DepartmentsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*DepartmentsMutation) SetDeletedAt

func (m *DepartmentsMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*DepartmentsMutation) SetDepartmentStatus

func (m *DepartmentsMutation) SetDepartmentStatus(i int)

SetDepartmentStatus sets the "department_status" field.

func (*DepartmentsMutation) SetDepartmentType

func (m *DepartmentsMutation) SetDepartmentType(i int)

SetDepartmentType sets the "department_type" field.

func (*DepartmentsMutation) SetDescription

func (m *DepartmentsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DepartmentsMutation) SetEmailEncrypted

func (m *DepartmentsMutation) SetEmailEncrypted(b []byte)

SetEmailEncrypted sets the "email_encrypted" field.

func (*DepartmentsMutation) SetExternalID

func (m *DepartmentsMutation) SetExternalID(s string)

SetExternalID sets the "external_id" field.

func (*DepartmentsMutation) SetField

func (m *DepartmentsMutation) 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 (*DepartmentsMutation) SetMaxMembers

func (m *DepartmentsMutation) SetMaxMembers(i int)

SetMaxMembers sets the "max_members" field.

func (*DepartmentsMutation) SetMetadata

func (m *DepartmentsMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*DepartmentsMutation) SetName

func (m *DepartmentsMutation) SetName(s string)

SetName sets the "name" field.

func (*DepartmentsMutation) SetOp

func (m *DepartmentsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DepartmentsMutation) SetParentID

func (m *DepartmentsMutation) SetParentID(i int)

SetParentID sets the "parent_id" field.

func (*DepartmentsMutation) SetPhoneNumberEncrypted

func (m *DepartmentsMutation) SetPhoneNumberEncrypted(b []byte)

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*DepartmentsMutation) SetSortOrder

func (m *DepartmentsMutation) SetSortOrder(i int)

SetSortOrder sets the "sort_order" field.

func (*DepartmentsMutation) SetUpdatedAt

func (m *DepartmentsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentsMutation) SetUpdatedBy

func (m *DepartmentsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*DepartmentsMutation) SortOrder

func (m *DepartmentsMutation) SortOrder() (r int, exists bool)

SortOrder returns the value of the "sort_order" field in the mutation.

func (DepartmentsMutation) Tx

func (m DepartmentsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DepartmentsMutation) Type

func (m *DepartmentsMutation) Type() string

Type returns the node type of this mutation (Departments).

func (*DepartmentsMutation) UpdatedAt

func (m *DepartmentsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*DepartmentsMutation) UpdatedBy

func (m *DepartmentsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*DepartmentsMutation) UpdatedByCleared

func (m *DepartmentsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*DepartmentsMutation) Where

func (m *DepartmentsMutation) Where(ps ...predicate.Departments)

Where appends a list predicates to the DepartmentsMutation builder.

func (*DepartmentsMutation) WhereP

func (m *DepartmentsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DepartmentsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DepartmentsQuery

type DepartmentsQuery struct {
	// contains filtered or unexported fields
}

DepartmentsQuery is the builder for querying Departments entities.

func (*DepartmentsQuery) Aggregate

func (_q *DepartmentsQuery) Aggregate(fns ...AggregateFunc) *DepartmentsSelect

Aggregate returns a DepartmentsSelect configured with the given aggregations.

func (*DepartmentsQuery) All

func (_q *DepartmentsQuery) All(ctx context.Context) ([]*Departments, error)

All executes the query and returns a list of DepartmentsSlice.

func (*DepartmentsQuery) AllX

func (_q *DepartmentsQuery) AllX(ctx context.Context) []*Departments

AllX is like All, but panics if an error occurs.

func (*DepartmentsQuery) Clone

func (_q *DepartmentsQuery) Clone() *DepartmentsQuery

Clone returns a duplicate of the DepartmentsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DepartmentsQuery) Count

func (_q *DepartmentsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DepartmentsQuery) CountX

func (_q *DepartmentsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DepartmentsQuery) Exist

func (_q *DepartmentsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DepartmentsQuery) ExistX

func (_q *DepartmentsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DepartmentsQuery) First

func (_q *DepartmentsQuery) First(ctx context.Context) (*Departments, error)

First returns the first Departments entity from the query. Returns a *NotFoundError when no Departments was found.

func (*DepartmentsQuery) FirstID

func (_q *DepartmentsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Departments ID from the query. Returns a *NotFoundError when no Departments ID was found.

func (*DepartmentsQuery) FirstIDX

func (_q *DepartmentsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*DepartmentsQuery) FirstX

func (_q *DepartmentsQuery) FirstX(ctx context.Context) *Departments

FirstX is like First, but panics if an error occurs.

func (*DepartmentsQuery) GroupBy

func (_q *DepartmentsQuery) GroupBy(field string, fields ...string) *DepartmentsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Departments.Query().
	GroupBy(departments.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*DepartmentsQuery) IDs

func (_q *DepartmentsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Departments IDs.

func (*DepartmentsQuery) IDsX

func (_q *DepartmentsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*DepartmentsQuery) Limit

func (_q *DepartmentsQuery) Limit(limit int) *DepartmentsQuery

Limit the number of records to be returned by this query.

func (*DepartmentsQuery) Offset

func (_q *DepartmentsQuery) Offset(offset int) *DepartmentsQuery

Offset to start from.

func (*DepartmentsQuery) Only

func (_q *DepartmentsQuery) Only(ctx context.Context) (*Departments, error)

Only returns a single Departments entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Departments entity is found. Returns a *NotFoundError when no Departments entities are found.

func (*DepartmentsQuery) OnlyID

func (_q *DepartmentsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Departments ID in the query. Returns a *NotSingularError when more than one Departments ID is found. Returns a *NotFoundError when no entities are found.

func (*DepartmentsQuery) OnlyIDX

func (_q *DepartmentsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DepartmentsQuery) OnlyX

func (_q *DepartmentsQuery) OnlyX(ctx context.Context) *Departments

OnlyX is like Only, but panics if an error occurs.

func (*DepartmentsQuery) Order

Order specifies how the records should be ordered.

func (*DepartmentsQuery) QueryLionDepartmentRoles

func (_q *DepartmentsQuery) QueryLionDepartmentRoles() *DepartmentRolesQuery

QueryLionDepartmentRoles chains the current query on the "lion_department_roles" edge.

func (*DepartmentsQuery) QueryLionGroups

func (_q *DepartmentsQuery) QueryLionGroups() *GroupsQuery

QueryLionGroups chains the current query on the "lion_groups" edge.

func (*DepartmentsQuery) QueryLionUserDepartments

func (_q *DepartmentsQuery) QueryLionUserDepartments() *UserDepartmentsQuery

QueryLionUserDepartments chains the current query on the "lion_user_departments" edge.

func (*DepartmentsQuery) Select

func (_q *DepartmentsQuery) Select(fields ...string) *DepartmentsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Departments.Query().
	Select(departments.FieldCreatedAt).
	Scan(ctx, &v)

func (*DepartmentsQuery) Unique

func (_q *DepartmentsQuery) Unique(unique bool) *DepartmentsQuery

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 (*DepartmentsQuery) Where

Where adds a new predicate for the DepartmentsQuery builder.

func (*DepartmentsQuery) WithLionDepartmentRoles

func (_q *DepartmentsQuery) WithLionDepartmentRoles(opts ...func(*DepartmentRolesQuery)) *DepartmentsQuery

WithLionDepartmentRoles tells the query-builder to eager-load the nodes that are connected to the "lion_department_roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*DepartmentsQuery) WithLionGroups

func (_q *DepartmentsQuery) WithLionGroups(opts ...func(*GroupsQuery)) *DepartmentsQuery

WithLionGroups tells the query-builder to eager-load the nodes that are connected to the "lion_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*DepartmentsQuery) WithLionUserDepartments

func (_q *DepartmentsQuery) WithLionUserDepartments(opts ...func(*UserDepartmentsQuery)) *DepartmentsQuery

WithLionUserDepartments tells the query-builder to eager-load the nodes that are connected to the "lion_user_departments" edge. The optional arguments are used to configure the query builder of the edge.

type DepartmentsSelect

type DepartmentsSelect struct {
	*DepartmentsQuery
	// contains filtered or unexported fields
}

DepartmentsSelect is the builder for selecting fields of Departments entities.

func (*DepartmentsSelect) Aggregate

func (_s *DepartmentsSelect) Aggregate(fns ...AggregateFunc) *DepartmentsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DepartmentsSelect) Bool

func (s *DepartmentsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) BoolX

func (s *DepartmentsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DepartmentsSelect) Bools

func (s *DepartmentsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) BoolsX

func (s *DepartmentsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DepartmentsSelect) Float64

func (s *DepartmentsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) Float64X

func (s *DepartmentsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DepartmentsSelect) Float64s

func (s *DepartmentsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) Float64sX

func (s *DepartmentsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DepartmentsSelect) Int

func (s *DepartmentsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) IntX

func (s *DepartmentsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DepartmentsSelect) Ints

func (s *DepartmentsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) IntsX

func (s *DepartmentsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DepartmentsSelect) Scan

func (_s *DepartmentsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DepartmentsSelect) ScanX

func (s *DepartmentsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DepartmentsSelect) String

func (s *DepartmentsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) StringX

func (s *DepartmentsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DepartmentsSelect) Strings

func (s *DepartmentsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DepartmentsSelect) StringsX

func (s *DepartmentsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DepartmentsSlice

type DepartmentsSlice []*Departments

DepartmentsSlice is a parsable slice of Departments.

type DepartmentsUpdate

type DepartmentsUpdate struct {
	// contains filtered or unexported fields
}

DepartmentsUpdate is the builder for updating Departments entities.

func (*DepartmentsUpdate) AddCreatedBy

func (_u *DepartmentsUpdate) AddCreatedBy(v int64) *DepartmentsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*DepartmentsUpdate) AddDepartmentStatus

func (_u *DepartmentsUpdate) AddDepartmentStatus(v int) *DepartmentsUpdate

AddDepartmentStatus adds value to the "department_status" field.

func (*DepartmentsUpdate) AddDepartmentType

func (_u *DepartmentsUpdate) AddDepartmentType(v int) *DepartmentsUpdate

AddDepartmentType adds value to the "department_type" field.

func (*DepartmentsUpdate) AddLionDepartmentRoleIDs

func (_u *DepartmentsUpdate) AddLionDepartmentRoleIDs(ids ...int) *DepartmentsUpdate

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*DepartmentsUpdate) AddLionDepartmentRoles

func (_u *DepartmentsUpdate) AddLionDepartmentRoles(v ...*DepartmentRoles) *DepartmentsUpdate

AddLionDepartmentRoles adds the "lion_department_roles" edges to the DepartmentRoles entity.

func (*DepartmentsUpdate) AddLionGroupIDs

func (_u *DepartmentsUpdate) AddLionGroupIDs(ids ...int) *DepartmentsUpdate

AddLionGroupIDs adds the "lion_groups" edge to the Groups entity by IDs.

func (*DepartmentsUpdate) AddLionGroups

func (_u *DepartmentsUpdate) AddLionGroups(v ...*Groups) *DepartmentsUpdate

AddLionGroups adds the "lion_groups" edges to the Groups entity.

func (*DepartmentsUpdate) AddLionUserDepartmentIDs

func (_u *DepartmentsUpdate) AddLionUserDepartmentIDs(ids ...int) *DepartmentsUpdate

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*DepartmentsUpdate) AddLionUserDepartments

func (_u *DepartmentsUpdate) AddLionUserDepartments(v ...*UserDepartments) *DepartmentsUpdate

AddLionUserDepartments adds the "lion_user_departments" edges to the UserDepartments entity.

func (*DepartmentsUpdate) AddMaxMembers

func (_u *DepartmentsUpdate) AddMaxMembers(v int) *DepartmentsUpdate

AddMaxMembers adds value to the "max_members" field.

func (*DepartmentsUpdate) AddParentID

func (_u *DepartmentsUpdate) AddParentID(v int) *DepartmentsUpdate

AddParentID adds value to the "parent_id" field.

func (*DepartmentsUpdate) AddSortOrder

func (_u *DepartmentsUpdate) AddSortOrder(v int) *DepartmentsUpdate

AddSortOrder adds value to the "sort_order" field.

func (*DepartmentsUpdate) AddUpdatedBy

func (_u *DepartmentsUpdate) AddUpdatedBy(v int64) *DepartmentsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*DepartmentsUpdate) ClearAddressEncrypted

func (_u *DepartmentsUpdate) ClearAddressEncrypted() *DepartmentsUpdate

ClearAddressEncrypted clears the value of the "address_encrypted" field.

func (*DepartmentsUpdate) ClearBudgetItemCode

func (_u *DepartmentsUpdate) ClearBudgetItemCode() *DepartmentsUpdate

ClearBudgetItemCode clears the value of the "budget_item_code" field.

func (*DepartmentsUpdate) ClearCostCenterCode

func (_u *DepartmentsUpdate) ClearCostCenterCode() *DepartmentsUpdate

ClearCostCenterCode clears the value of the "cost_center_code" field.

func (*DepartmentsUpdate) ClearCreatedBy

func (_u *DepartmentsUpdate) ClearCreatedBy() *DepartmentsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*DepartmentsUpdate) ClearDeletedAt

func (_u *DepartmentsUpdate) ClearDeletedAt() *DepartmentsUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DepartmentsUpdate) ClearEmailEncrypted

func (_u *DepartmentsUpdate) ClearEmailEncrypted() *DepartmentsUpdate

ClearEmailEncrypted clears the value of the "email_encrypted" field.

func (*DepartmentsUpdate) ClearExternalID

func (_u *DepartmentsUpdate) ClearExternalID() *DepartmentsUpdate

ClearExternalID clears the value of the "external_id" field.

func (*DepartmentsUpdate) ClearLionDepartmentRoles

func (_u *DepartmentsUpdate) ClearLionDepartmentRoles() *DepartmentsUpdate

ClearLionDepartmentRoles clears all "lion_department_roles" edges to the DepartmentRoles entity.

func (*DepartmentsUpdate) ClearLionGroups

func (_u *DepartmentsUpdate) ClearLionGroups() *DepartmentsUpdate

ClearLionGroups clears all "lion_groups" edges to the Groups entity.

func (*DepartmentsUpdate) ClearLionUserDepartments

func (_u *DepartmentsUpdate) ClearLionUserDepartments() *DepartmentsUpdate

ClearLionUserDepartments clears all "lion_user_departments" edges to the UserDepartments entity.

func (*DepartmentsUpdate) ClearMetadata

func (_u *DepartmentsUpdate) ClearMetadata() *DepartmentsUpdate

ClearMetadata clears the value of the "metadata" field.

func (*DepartmentsUpdate) ClearPhoneNumberEncrypted

func (_u *DepartmentsUpdate) ClearPhoneNumberEncrypted() *DepartmentsUpdate

ClearPhoneNumberEncrypted clears the value of the "phone_number_encrypted" field.

func (*DepartmentsUpdate) ClearUpdatedBy

func (_u *DepartmentsUpdate) ClearUpdatedBy() *DepartmentsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DepartmentsUpdate) Exec

func (_u *DepartmentsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentsUpdate) ExecX

func (_u *DepartmentsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentsUpdate) Mutation

func (_u *DepartmentsUpdate) Mutation() *DepartmentsMutation

Mutation returns the DepartmentsMutation object of the builder.

func (*DepartmentsUpdate) RemoveLionDepartmentRoleIDs

func (_u *DepartmentsUpdate) RemoveLionDepartmentRoleIDs(ids ...int) *DepartmentsUpdate

RemoveLionDepartmentRoleIDs removes the "lion_department_roles" edge to DepartmentRoles entities by IDs.

func (*DepartmentsUpdate) RemoveLionDepartmentRoles

func (_u *DepartmentsUpdate) RemoveLionDepartmentRoles(v ...*DepartmentRoles) *DepartmentsUpdate

RemoveLionDepartmentRoles removes "lion_department_roles" edges to DepartmentRoles entities.

func (*DepartmentsUpdate) RemoveLionGroupIDs

func (_u *DepartmentsUpdate) RemoveLionGroupIDs(ids ...int) *DepartmentsUpdate

RemoveLionGroupIDs removes the "lion_groups" edge to Groups entities by IDs.

func (*DepartmentsUpdate) RemoveLionGroups

func (_u *DepartmentsUpdate) RemoveLionGroups(v ...*Groups) *DepartmentsUpdate

RemoveLionGroups removes "lion_groups" edges to Groups entities.

func (*DepartmentsUpdate) RemoveLionUserDepartmentIDs

func (_u *DepartmentsUpdate) RemoveLionUserDepartmentIDs(ids ...int) *DepartmentsUpdate

RemoveLionUserDepartmentIDs removes the "lion_user_departments" edge to UserDepartments entities by IDs.

func (*DepartmentsUpdate) RemoveLionUserDepartments

func (_u *DepartmentsUpdate) RemoveLionUserDepartments(v ...*UserDepartments) *DepartmentsUpdate

RemoveLionUserDepartments removes "lion_user_departments" edges to UserDepartments entities.

func (*DepartmentsUpdate) Save

func (_u *DepartmentsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DepartmentsUpdate) SaveX

func (_u *DepartmentsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DepartmentsUpdate) SetAddressEncrypted

func (_u *DepartmentsUpdate) SetAddressEncrypted(v []byte) *DepartmentsUpdate

SetAddressEncrypted sets the "address_encrypted" field.

func (*DepartmentsUpdate) SetBudgetItemCode

func (_u *DepartmentsUpdate) SetBudgetItemCode(v string) *DepartmentsUpdate

SetBudgetItemCode sets the "budget_item_code" field.

func (*DepartmentsUpdate) SetCostCenterCode

func (_u *DepartmentsUpdate) SetCostCenterCode(v string) *DepartmentsUpdate

SetCostCenterCode sets the "cost_center_code" field.

func (*DepartmentsUpdate) SetCreatedBy

func (_u *DepartmentsUpdate) SetCreatedBy(v int64) *DepartmentsUpdate

SetCreatedBy sets the "created_by" field.

func (*DepartmentsUpdate) SetDeletedAt

func (_u *DepartmentsUpdate) SetDeletedAt(v time.Time) *DepartmentsUpdate

SetDeletedAt sets the "deleted_at" field.

func (*DepartmentsUpdate) SetDepartmentStatus

func (_u *DepartmentsUpdate) SetDepartmentStatus(v int) *DepartmentsUpdate

SetDepartmentStatus sets the "department_status" field.

func (*DepartmentsUpdate) SetDepartmentType

func (_u *DepartmentsUpdate) SetDepartmentType(v int) *DepartmentsUpdate

SetDepartmentType sets the "department_type" field.

func (*DepartmentsUpdate) SetDescription

func (_u *DepartmentsUpdate) SetDescription(v string) *DepartmentsUpdate

SetDescription sets the "description" field.

func (*DepartmentsUpdate) SetEmailEncrypted

func (_u *DepartmentsUpdate) SetEmailEncrypted(v []byte) *DepartmentsUpdate

SetEmailEncrypted sets the "email_encrypted" field.

func (*DepartmentsUpdate) SetExternalID

func (_u *DepartmentsUpdate) SetExternalID(v string) *DepartmentsUpdate

SetExternalID sets the "external_id" field.

func (*DepartmentsUpdate) SetMaxMembers

func (_u *DepartmentsUpdate) SetMaxMembers(v int) *DepartmentsUpdate

SetMaxMembers sets the "max_members" field.

func (*DepartmentsUpdate) SetMetadata

func (_u *DepartmentsUpdate) SetMetadata(v map[string]string) *DepartmentsUpdate

SetMetadata sets the "metadata" field.

func (*DepartmentsUpdate) SetName

func (_u *DepartmentsUpdate) SetName(v string) *DepartmentsUpdate

SetName sets the "name" field.

func (*DepartmentsUpdate) SetNillableBudgetItemCode

func (_u *DepartmentsUpdate) SetNillableBudgetItemCode(v *string) *DepartmentsUpdate

SetNillableBudgetItemCode sets the "budget_item_code" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableCostCenterCode

func (_u *DepartmentsUpdate) SetNillableCostCenterCode(v *string) *DepartmentsUpdate

SetNillableCostCenterCode sets the "cost_center_code" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableCreatedBy

func (_u *DepartmentsUpdate) SetNillableCreatedBy(v *int64) *DepartmentsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableDeletedAt

func (_u *DepartmentsUpdate) SetNillableDeletedAt(v *time.Time) *DepartmentsUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableDepartmentStatus

func (_u *DepartmentsUpdate) SetNillableDepartmentStatus(v *int) *DepartmentsUpdate

SetNillableDepartmentStatus sets the "department_status" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableDepartmentType

func (_u *DepartmentsUpdate) SetNillableDepartmentType(v *int) *DepartmentsUpdate

SetNillableDepartmentType sets the "department_type" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableDescription

func (_u *DepartmentsUpdate) SetNillableDescription(v *string) *DepartmentsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableExternalID

func (_u *DepartmentsUpdate) SetNillableExternalID(v *string) *DepartmentsUpdate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableMaxMembers

func (_u *DepartmentsUpdate) SetNillableMaxMembers(v *int) *DepartmentsUpdate

SetNillableMaxMembers sets the "max_members" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableName

func (_u *DepartmentsUpdate) SetNillableName(v *string) *DepartmentsUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableParentID

func (_u *DepartmentsUpdate) SetNillableParentID(v *int) *DepartmentsUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableSortOrder

func (_u *DepartmentsUpdate) SetNillableSortOrder(v *int) *DepartmentsUpdate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableUpdatedBy

func (_u *DepartmentsUpdate) SetNillableUpdatedBy(v *int64) *DepartmentsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DepartmentsUpdate) SetParentID

func (_u *DepartmentsUpdate) SetParentID(v int) *DepartmentsUpdate

SetParentID sets the "parent_id" field.

func (*DepartmentsUpdate) SetPhoneNumberEncrypted

func (_u *DepartmentsUpdate) SetPhoneNumberEncrypted(v []byte) *DepartmentsUpdate

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*DepartmentsUpdate) SetSortOrder

func (_u *DepartmentsUpdate) SetSortOrder(v int) *DepartmentsUpdate

SetSortOrder sets the "sort_order" field.

func (*DepartmentsUpdate) SetUpdatedAt

func (_u *DepartmentsUpdate) SetUpdatedAt(v time.Time) *DepartmentsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentsUpdate) SetUpdatedBy

func (_u *DepartmentsUpdate) SetUpdatedBy(v int64) *DepartmentsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*DepartmentsUpdate) Where

Where appends a list predicates to the DepartmentsUpdate builder.

type DepartmentsUpdateOne

type DepartmentsUpdateOne struct {
	// contains filtered or unexported fields
}

DepartmentsUpdateOne is the builder for updating a single Departments entity.

func (*DepartmentsUpdateOne) AddCreatedBy

func (_u *DepartmentsUpdateOne) AddCreatedBy(v int64) *DepartmentsUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*DepartmentsUpdateOne) AddDepartmentStatus

func (_u *DepartmentsUpdateOne) AddDepartmentStatus(v int) *DepartmentsUpdateOne

AddDepartmentStatus adds value to the "department_status" field.

func (*DepartmentsUpdateOne) AddDepartmentType

func (_u *DepartmentsUpdateOne) AddDepartmentType(v int) *DepartmentsUpdateOne

AddDepartmentType adds value to the "department_type" field.

func (*DepartmentsUpdateOne) AddLionDepartmentRoleIDs

func (_u *DepartmentsUpdateOne) AddLionDepartmentRoleIDs(ids ...int) *DepartmentsUpdateOne

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*DepartmentsUpdateOne) AddLionDepartmentRoles

func (_u *DepartmentsUpdateOne) AddLionDepartmentRoles(v ...*DepartmentRoles) *DepartmentsUpdateOne

AddLionDepartmentRoles adds the "lion_department_roles" edges to the DepartmentRoles entity.

func (*DepartmentsUpdateOne) AddLionGroupIDs

func (_u *DepartmentsUpdateOne) AddLionGroupIDs(ids ...int) *DepartmentsUpdateOne

AddLionGroupIDs adds the "lion_groups" edge to the Groups entity by IDs.

func (*DepartmentsUpdateOne) AddLionGroups

func (_u *DepartmentsUpdateOne) AddLionGroups(v ...*Groups) *DepartmentsUpdateOne

AddLionGroups adds the "lion_groups" edges to the Groups entity.

func (*DepartmentsUpdateOne) AddLionUserDepartmentIDs

func (_u *DepartmentsUpdateOne) AddLionUserDepartmentIDs(ids ...int) *DepartmentsUpdateOne

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*DepartmentsUpdateOne) AddLionUserDepartments

func (_u *DepartmentsUpdateOne) AddLionUserDepartments(v ...*UserDepartments) *DepartmentsUpdateOne

AddLionUserDepartments adds the "lion_user_departments" edges to the UserDepartments entity.

func (*DepartmentsUpdateOne) AddMaxMembers

func (_u *DepartmentsUpdateOne) AddMaxMembers(v int) *DepartmentsUpdateOne

AddMaxMembers adds value to the "max_members" field.

func (*DepartmentsUpdateOne) AddParentID

func (_u *DepartmentsUpdateOne) AddParentID(v int) *DepartmentsUpdateOne

AddParentID adds value to the "parent_id" field.

func (*DepartmentsUpdateOne) AddSortOrder

func (_u *DepartmentsUpdateOne) AddSortOrder(v int) *DepartmentsUpdateOne

AddSortOrder adds value to the "sort_order" field.

func (*DepartmentsUpdateOne) AddUpdatedBy

func (_u *DepartmentsUpdateOne) AddUpdatedBy(v int64) *DepartmentsUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*DepartmentsUpdateOne) ClearAddressEncrypted

func (_u *DepartmentsUpdateOne) ClearAddressEncrypted() *DepartmentsUpdateOne

ClearAddressEncrypted clears the value of the "address_encrypted" field.

func (*DepartmentsUpdateOne) ClearBudgetItemCode

func (_u *DepartmentsUpdateOne) ClearBudgetItemCode() *DepartmentsUpdateOne

ClearBudgetItemCode clears the value of the "budget_item_code" field.

func (*DepartmentsUpdateOne) ClearCostCenterCode

func (_u *DepartmentsUpdateOne) ClearCostCenterCode() *DepartmentsUpdateOne

ClearCostCenterCode clears the value of the "cost_center_code" field.

func (*DepartmentsUpdateOne) ClearCreatedBy

func (_u *DepartmentsUpdateOne) ClearCreatedBy() *DepartmentsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*DepartmentsUpdateOne) ClearDeletedAt

func (_u *DepartmentsUpdateOne) ClearDeletedAt() *DepartmentsUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DepartmentsUpdateOne) ClearEmailEncrypted

func (_u *DepartmentsUpdateOne) ClearEmailEncrypted() *DepartmentsUpdateOne

ClearEmailEncrypted clears the value of the "email_encrypted" field.

func (*DepartmentsUpdateOne) ClearExternalID

func (_u *DepartmentsUpdateOne) ClearExternalID() *DepartmentsUpdateOne

ClearExternalID clears the value of the "external_id" field.

func (*DepartmentsUpdateOne) ClearLionDepartmentRoles

func (_u *DepartmentsUpdateOne) ClearLionDepartmentRoles() *DepartmentsUpdateOne

ClearLionDepartmentRoles clears all "lion_department_roles" edges to the DepartmentRoles entity.

func (*DepartmentsUpdateOne) ClearLionGroups

func (_u *DepartmentsUpdateOne) ClearLionGroups() *DepartmentsUpdateOne

ClearLionGroups clears all "lion_groups" edges to the Groups entity.

func (*DepartmentsUpdateOne) ClearLionUserDepartments

func (_u *DepartmentsUpdateOne) ClearLionUserDepartments() *DepartmentsUpdateOne

ClearLionUserDepartments clears all "lion_user_departments" edges to the UserDepartments entity.

func (*DepartmentsUpdateOne) ClearMetadata

func (_u *DepartmentsUpdateOne) ClearMetadata() *DepartmentsUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*DepartmentsUpdateOne) ClearPhoneNumberEncrypted

func (_u *DepartmentsUpdateOne) ClearPhoneNumberEncrypted() *DepartmentsUpdateOne

ClearPhoneNumberEncrypted clears the value of the "phone_number_encrypted" field.

func (*DepartmentsUpdateOne) ClearUpdatedBy

func (_u *DepartmentsUpdateOne) ClearUpdatedBy() *DepartmentsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*DepartmentsUpdateOne) Exec

func (_u *DepartmentsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DepartmentsUpdateOne) ExecX

func (_u *DepartmentsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentsUpdateOne) Mutation

func (_u *DepartmentsUpdateOne) Mutation() *DepartmentsMutation

Mutation returns the DepartmentsMutation object of the builder.

func (*DepartmentsUpdateOne) RemoveLionDepartmentRoleIDs

func (_u *DepartmentsUpdateOne) RemoveLionDepartmentRoleIDs(ids ...int) *DepartmentsUpdateOne

RemoveLionDepartmentRoleIDs removes the "lion_department_roles" edge to DepartmentRoles entities by IDs.

func (*DepartmentsUpdateOne) RemoveLionDepartmentRoles

func (_u *DepartmentsUpdateOne) RemoveLionDepartmentRoles(v ...*DepartmentRoles) *DepartmentsUpdateOne

RemoveLionDepartmentRoles removes "lion_department_roles" edges to DepartmentRoles entities.

func (*DepartmentsUpdateOne) RemoveLionGroupIDs

func (_u *DepartmentsUpdateOne) RemoveLionGroupIDs(ids ...int) *DepartmentsUpdateOne

RemoveLionGroupIDs removes the "lion_groups" edge to Groups entities by IDs.

func (*DepartmentsUpdateOne) RemoveLionGroups

func (_u *DepartmentsUpdateOne) RemoveLionGroups(v ...*Groups) *DepartmentsUpdateOne

RemoveLionGroups removes "lion_groups" edges to Groups entities.

func (*DepartmentsUpdateOne) RemoveLionUserDepartmentIDs

func (_u *DepartmentsUpdateOne) RemoveLionUserDepartmentIDs(ids ...int) *DepartmentsUpdateOne

RemoveLionUserDepartmentIDs removes the "lion_user_departments" edge to UserDepartments entities by IDs.

func (*DepartmentsUpdateOne) RemoveLionUserDepartments

func (_u *DepartmentsUpdateOne) RemoveLionUserDepartments(v ...*UserDepartments) *DepartmentsUpdateOne

RemoveLionUserDepartments removes "lion_user_departments" edges to UserDepartments entities.

func (*DepartmentsUpdateOne) Save

Save executes the query and returns the updated Departments entity.

func (*DepartmentsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*DepartmentsUpdateOne) Select

func (_u *DepartmentsUpdateOne) Select(field string, fields ...string) *DepartmentsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DepartmentsUpdateOne) SetAddressEncrypted

func (_u *DepartmentsUpdateOne) SetAddressEncrypted(v []byte) *DepartmentsUpdateOne

SetAddressEncrypted sets the "address_encrypted" field.

func (*DepartmentsUpdateOne) SetBudgetItemCode

func (_u *DepartmentsUpdateOne) SetBudgetItemCode(v string) *DepartmentsUpdateOne

SetBudgetItemCode sets the "budget_item_code" field.

func (*DepartmentsUpdateOne) SetCostCenterCode

func (_u *DepartmentsUpdateOne) SetCostCenterCode(v string) *DepartmentsUpdateOne

SetCostCenterCode sets the "cost_center_code" field.

func (*DepartmentsUpdateOne) SetCreatedBy

func (_u *DepartmentsUpdateOne) SetCreatedBy(v int64) *DepartmentsUpdateOne

SetCreatedBy sets the "created_by" field.

func (*DepartmentsUpdateOne) SetDeletedAt

func (_u *DepartmentsUpdateOne) SetDeletedAt(v time.Time) *DepartmentsUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*DepartmentsUpdateOne) SetDepartmentStatus

func (_u *DepartmentsUpdateOne) SetDepartmentStatus(v int) *DepartmentsUpdateOne

SetDepartmentStatus sets the "department_status" field.

func (*DepartmentsUpdateOne) SetDepartmentType

func (_u *DepartmentsUpdateOne) SetDepartmentType(v int) *DepartmentsUpdateOne

SetDepartmentType sets the "department_type" field.

func (*DepartmentsUpdateOne) SetDescription

func (_u *DepartmentsUpdateOne) SetDescription(v string) *DepartmentsUpdateOne

SetDescription sets the "description" field.

func (*DepartmentsUpdateOne) SetEmailEncrypted

func (_u *DepartmentsUpdateOne) SetEmailEncrypted(v []byte) *DepartmentsUpdateOne

SetEmailEncrypted sets the "email_encrypted" field.

func (*DepartmentsUpdateOne) SetExternalID

func (_u *DepartmentsUpdateOne) SetExternalID(v string) *DepartmentsUpdateOne

SetExternalID sets the "external_id" field.

func (*DepartmentsUpdateOne) SetMaxMembers

func (_u *DepartmentsUpdateOne) SetMaxMembers(v int) *DepartmentsUpdateOne

SetMaxMembers sets the "max_members" field.

func (*DepartmentsUpdateOne) SetMetadata

func (_u *DepartmentsUpdateOne) SetMetadata(v map[string]string) *DepartmentsUpdateOne

SetMetadata sets the "metadata" field.

func (*DepartmentsUpdateOne) SetName

SetName sets the "name" field.

func (*DepartmentsUpdateOne) SetNillableBudgetItemCode

func (_u *DepartmentsUpdateOne) SetNillableBudgetItemCode(v *string) *DepartmentsUpdateOne

SetNillableBudgetItemCode sets the "budget_item_code" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableCostCenterCode

func (_u *DepartmentsUpdateOne) SetNillableCostCenterCode(v *string) *DepartmentsUpdateOne

SetNillableCostCenterCode sets the "cost_center_code" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableCreatedBy

func (_u *DepartmentsUpdateOne) SetNillableCreatedBy(v *int64) *DepartmentsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableDeletedAt

func (_u *DepartmentsUpdateOne) SetNillableDeletedAt(v *time.Time) *DepartmentsUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableDepartmentStatus

func (_u *DepartmentsUpdateOne) SetNillableDepartmentStatus(v *int) *DepartmentsUpdateOne

SetNillableDepartmentStatus sets the "department_status" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableDepartmentType

func (_u *DepartmentsUpdateOne) SetNillableDepartmentType(v *int) *DepartmentsUpdateOne

SetNillableDepartmentType sets the "department_type" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableDescription

func (_u *DepartmentsUpdateOne) SetNillableDescription(v *string) *DepartmentsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableExternalID

func (_u *DepartmentsUpdateOne) SetNillableExternalID(v *string) *DepartmentsUpdateOne

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableMaxMembers

func (_u *DepartmentsUpdateOne) SetNillableMaxMembers(v *int) *DepartmentsUpdateOne

SetNillableMaxMembers sets the "max_members" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableName

func (_u *DepartmentsUpdateOne) SetNillableName(v *string) *DepartmentsUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableParentID

func (_u *DepartmentsUpdateOne) SetNillableParentID(v *int) *DepartmentsUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableSortOrder

func (_u *DepartmentsUpdateOne) SetNillableSortOrder(v *int) *DepartmentsUpdateOne

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableUpdatedBy

func (_u *DepartmentsUpdateOne) SetNillableUpdatedBy(v *int64) *DepartmentsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetParentID

func (_u *DepartmentsUpdateOne) SetParentID(v int) *DepartmentsUpdateOne

SetParentID sets the "parent_id" field.

func (*DepartmentsUpdateOne) SetPhoneNumberEncrypted

func (_u *DepartmentsUpdateOne) SetPhoneNumberEncrypted(v []byte) *DepartmentsUpdateOne

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*DepartmentsUpdateOne) SetSortOrder

func (_u *DepartmentsUpdateOne) SetSortOrder(v int) *DepartmentsUpdateOne

SetSortOrder sets the "sort_order" field.

func (*DepartmentsUpdateOne) SetUpdatedAt

func (_u *DepartmentsUpdateOne) SetUpdatedAt(v time.Time) *DepartmentsUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentsUpdateOne) SetUpdatedBy

func (_u *DepartmentsUpdateOne) SetUpdatedBy(v int64) *DepartmentsUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*DepartmentsUpdateOne) Where

Where appends a list predicates to the DepartmentsUpdate builder.

type GroupRoles

type GroupRoles struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 关联 lion_groups 表的菜单 ID
	GroupID int `json:"group_id,omitempty"`
	// 关联 lion_roles 表的用户组 ID
	RoleID int `json:"role_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupRolesQuery when eager-loading is set.
	Edges GroupRolesEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroupRoles is the model entity for the GroupRoles schema.

func (*GroupRoles) QueryLionGroups

func (_m *GroupRoles) QueryLionGroups() *GroupsQuery

QueryLionGroups queries the "lion_groups" edge of the GroupRoles entity.

func (*GroupRoles) QueryLionRoles

func (_m *GroupRoles) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the GroupRoles entity.

func (*GroupRoles) String

func (_m *GroupRoles) String() string

String implements the fmt.Stringer.

func (*GroupRoles) Unwrap

func (_m *GroupRoles) Unwrap() *GroupRoles

Unwrap unwraps the GroupRoles 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 (*GroupRoles) Update

func (_m *GroupRoles) Update() *GroupRolesUpdateOne

Update returns a builder for updating this GroupRoles. Note that you need to call GroupRoles.Unwrap() before calling this method if this GroupRoles was returned from a transaction, and the transaction was committed or rolled back.

func (*GroupRoles) Value

func (_m *GroupRoles) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GroupRoles. This includes values selected through modifiers, order, etc.

type GroupRolesClient

type GroupRolesClient struct {
	// contains filtered or unexported fields
}

GroupRolesClient is a client for the GroupRoles schema.

func NewGroupRolesClient

func NewGroupRolesClient(c config) *GroupRolesClient

NewGroupRolesClient returns a client for the GroupRoles from the given config.

func (*GroupRolesClient) Create

func (c *GroupRolesClient) Create() *GroupRolesCreate

Create returns a builder for creating a GroupRoles entity.

func (*GroupRolesClient) CreateBulk

func (c *GroupRolesClient) CreateBulk(builders ...*GroupRolesCreate) *GroupRolesCreateBulk

CreateBulk returns a builder for creating a bulk of GroupRoles entities.

func (*GroupRolesClient) Delete

func (c *GroupRolesClient) Delete() *GroupRolesDelete

Delete returns a delete builder for GroupRoles.

func (*GroupRolesClient) DeleteOne

func (c *GroupRolesClient) DeleteOne(_m *GroupRoles) *GroupRolesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupRolesClient) DeleteOneID

func (c *GroupRolesClient) DeleteOneID(id int) *GroupRolesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GroupRolesClient) Get

func (c *GroupRolesClient) Get(ctx context.Context, id int) (*GroupRoles, error)

Get returns a GroupRoles entity by its id.

func (*GroupRolesClient) GetX

func (c *GroupRolesClient) GetX(ctx context.Context, id int) *GroupRoles

GetX is like Get, but panics if an error occurs.

func (*GroupRolesClient) Hooks

func (c *GroupRolesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupRolesClient) Intercept

func (c *GroupRolesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `grouproles.Intercept(f(g(h())))`.

func (*GroupRolesClient) Interceptors

func (c *GroupRolesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupRolesClient) MapCreateBulk

func (c *GroupRolesClient) MapCreateBulk(slice any, setFunc func(*GroupRolesCreate, int)) *GroupRolesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*GroupRolesClient) Query

func (c *GroupRolesClient) Query() *GroupRolesQuery

Query returns a query builder for GroupRoles.

func (*GroupRolesClient) QueryLionGroups

func (c *GroupRolesClient) QueryLionGroups(_m *GroupRoles) *GroupsQuery

QueryLionGroups queries the lion_groups edge of a GroupRoles.

func (*GroupRolesClient) QueryLionRoles

func (c *GroupRolesClient) QueryLionRoles(_m *GroupRoles) *RolesQuery

QueryLionRoles queries the lion_roles edge of a GroupRoles.

func (*GroupRolesClient) Update

func (c *GroupRolesClient) Update() *GroupRolesUpdate

Update returns an update builder for GroupRoles.

func (*GroupRolesClient) UpdateOne

func (c *GroupRolesClient) UpdateOne(_m *GroupRoles) *GroupRolesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupRolesClient) UpdateOneID

func (c *GroupRolesClient) UpdateOneID(id int) *GroupRolesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupRolesClient) Use

func (c *GroupRolesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `grouproles.Hooks(f(g(h())))`.

type GroupRolesCreate

type GroupRolesCreate struct {
	// contains filtered or unexported fields
}

GroupRolesCreate is the builder for creating a GroupRoles entity.

func (*GroupRolesCreate) Exec

func (_c *GroupRolesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupRolesCreate) ExecX

func (_c *GroupRolesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupRolesCreate) Mutation

func (_c *GroupRolesCreate) Mutation() *GroupRolesMutation

Mutation returns the GroupRolesMutation object of the builder.

func (*GroupRolesCreate) Save

func (_c *GroupRolesCreate) Save(ctx context.Context) (*GroupRoles, error)

Save creates the GroupRoles in the database.

func (*GroupRolesCreate) SaveX

func (_c *GroupRolesCreate) SaveX(ctx context.Context) *GroupRoles

SaveX calls Save and panics if Save returns an error.

func (*GroupRolesCreate) SetCreatedAt

func (_c *GroupRolesCreate) SetCreatedAt(v time.Time) *GroupRolesCreate

SetCreatedAt sets the "created_at" field.

func (*GroupRolesCreate) SetCreatedBy

func (_c *GroupRolesCreate) SetCreatedBy(v int64) *GroupRolesCreate

SetCreatedBy sets the "created_by" field.

func (*GroupRolesCreate) SetGroupID

func (_c *GroupRolesCreate) SetGroupID(v int) *GroupRolesCreate

SetGroupID sets the "group_id" field.

func (*GroupRolesCreate) SetLionGroups

func (_c *GroupRolesCreate) SetLionGroups(v *Groups) *GroupRolesCreate

SetLionGroups sets the "lion_groups" edge to the Groups entity.

func (*GroupRolesCreate) SetLionGroupsID

func (_c *GroupRolesCreate) SetLionGroupsID(id int) *GroupRolesCreate

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by ID.

func (*GroupRolesCreate) SetLionRoles

func (_c *GroupRolesCreate) SetLionRoles(v *Roles) *GroupRolesCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*GroupRolesCreate) SetLionRolesID

func (_c *GroupRolesCreate) SetLionRolesID(id int) *GroupRolesCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*GroupRolesCreate) SetNillableCreatedAt

func (_c *GroupRolesCreate) SetNillableCreatedAt(v *time.Time) *GroupRolesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroupRolesCreate) SetNillableCreatedBy

func (_c *GroupRolesCreate) SetNillableCreatedBy(v *int64) *GroupRolesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupRolesCreate) SetNillableUpdatedAt

func (_c *GroupRolesCreate) SetNillableUpdatedAt(v *time.Time) *GroupRolesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GroupRolesCreate) SetNillableUpdatedBy

func (_c *GroupRolesCreate) SetNillableUpdatedBy(v *int64) *GroupRolesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupRolesCreate) SetRoleID

func (_c *GroupRolesCreate) SetRoleID(v int) *GroupRolesCreate

SetRoleID sets the "role_id" field.

func (*GroupRolesCreate) SetUpdatedAt

func (_c *GroupRolesCreate) SetUpdatedAt(v time.Time) *GroupRolesCreate

SetUpdatedAt sets the "updated_at" field.

func (*GroupRolesCreate) SetUpdatedBy

func (_c *GroupRolesCreate) SetUpdatedBy(v int64) *GroupRolesCreate

SetUpdatedBy sets the "updated_by" field.

type GroupRolesCreateBulk

type GroupRolesCreateBulk struct {
	// contains filtered or unexported fields
}

GroupRolesCreateBulk is the builder for creating many GroupRoles entities in bulk.

func (*GroupRolesCreateBulk) Exec

func (_c *GroupRolesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupRolesCreateBulk) ExecX

func (_c *GroupRolesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupRolesCreateBulk) Save

func (_c *GroupRolesCreateBulk) Save(ctx context.Context) ([]*GroupRoles, error)

Save creates the GroupRoles entities in the database.

func (*GroupRolesCreateBulk) SaveX

func (_c *GroupRolesCreateBulk) SaveX(ctx context.Context) []*GroupRoles

SaveX is like Save, but panics if an error occurs.

type GroupRolesDelete

type GroupRolesDelete struct {
	// contains filtered or unexported fields
}

GroupRolesDelete is the builder for deleting a GroupRoles entity.

func (*GroupRolesDelete) Exec

func (_d *GroupRolesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupRolesDelete) ExecX

func (_d *GroupRolesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupRolesDelete) Where

Where appends a list predicates to the GroupRolesDelete builder.

type GroupRolesDeleteOne

type GroupRolesDeleteOne struct {
	// contains filtered or unexported fields
}

GroupRolesDeleteOne is the builder for deleting a single GroupRoles entity.

func (*GroupRolesDeleteOne) Exec

func (_d *GroupRolesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupRolesDeleteOne) ExecX

func (_d *GroupRolesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupRolesDeleteOne) Where

Where appends a list predicates to the GroupRolesDelete builder.

type GroupRolesEdges

type GroupRolesEdges struct {
	// LionGroups holds the value of the lion_groups edge.
	LionGroups *Groups `json:"lion_groups,omitempty"`
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// contains filtered or unexported fields
}

GroupRolesEdges holds the relations/edges for other nodes in the graph.

func (GroupRolesEdges) LionGroupsOrErr

func (e GroupRolesEdges) LionGroupsOrErr() (*Groups, error)

LionGroupsOrErr returns the LionGroups value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GroupRolesEdges) LionRolesOrErr

func (e GroupRolesEdges) LionRolesOrErr() (*Roles, error)

LionRolesOrErr returns the LionRoles value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GroupRolesGroupBy

type GroupRolesGroupBy struct {
	// contains filtered or unexported fields
}

GroupRolesGroupBy is the group-by builder for GroupRoles entities.

func (*GroupRolesGroupBy) Aggregate

func (_g *GroupRolesGroupBy) Aggregate(fns ...AggregateFunc) *GroupRolesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupRolesGroupBy) Bool

func (s *GroupRolesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) BoolX

func (s *GroupRolesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupRolesGroupBy) Bools

func (s *GroupRolesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) BoolsX

func (s *GroupRolesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupRolesGroupBy) Float64

func (s *GroupRolesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) Float64X

func (s *GroupRolesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupRolesGroupBy) Float64s

func (s *GroupRolesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) Float64sX

func (s *GroupRolesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupRolesGroupBy) Int

func (s *GroupRolesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) IntX

func (s *GroupRolesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupRolesGroupBy) Ints

func (s *GroupRolesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) IntsX

func (s *GroupRolesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupRolesGroupBy) Scan

func (_g *GroupRolesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupRolesGroupBy) ScanX

func (s *GroupRolesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupRolesGroupBy) String

func (s *GroupRolesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) StringX

func (s *GroupRolesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupRolesGroupBy) Strings

func (s *GroupRolesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupRolesGroupBy) StringsX

func (s *GroupRolesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupRolesMutation

type GroupRolesMutation struct {
	// contains filtered or unexported fields
}

GroupRolesMutation represents an operation that mutates the GroupRoles nodes in the graph.

func (*GroupRolesMutation) AddCreatedBy

func (m *GroupRolesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*GroupRolesMutation) AddField

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) AddUpdatedBy

func (m *GroupRolesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*GroupRolesMutation) AddedCreatedBy

func (m *GroupRolesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*GroupRolesMutation) AddedEdges

func (m *GroupRolesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupRolesMutation) AddedField

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) AddedFields

func (m *GroupRolesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupRolesMutation) AddedIDs

func (m *GroupRolesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupRolesMutation) AddedUpdatedBy

func (m *GroupRolesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*GroupRolesMutation) ClearCreatedBy

func (m *GroupRolesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupRolesMutation) ClearEdge

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) ClearField

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) ClearLionGroups

func (m *GroupRolesMutation) ClearLionGroups()

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*GroupRolesMutation) ClearLionRoles

func (m *GroupRolesMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*GroupRolesMutation) ClearUpdatedBy

func (m *GroupRolesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupRolesMutation) ClearedEdges

func (m *GroupRolesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupRolesMutation) ClearedFields

func (m *GroupRolesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupRolesMutation) Client

func (m GroupRolesMutation) 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 (*GroupRolesMutation) CreatedAt

func (m *GroupRolesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroupRolesMutation) CreatedBy

func (m *GroupRolesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*GroupRolesMutation) CreatedByCleared

func (m *GroupRolesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*GroupRolesMutation) EdgeCleared

func (m *GroupRolesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupRolesMutation) Field

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) FieldCleared

func (m *GroupRolesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupRolesMutation) Fields

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) GroupID

func (m *GroupRolesMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*GroupRolesMutation) ID

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) IDs

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) LionGroupsCleared

func (m *GroupRolesMutation) LionGroupsCleared() bool

LionGroupsCleared reports if the "lion_groups" edge to the Groups entity was cleared.

func (*GroupRolesMutation) LionGroupsID

func (m *GroupRolesMutation) LionGroupsID() (id int, exists bool)

LionGroupsID returns the "lion_groups" edge ID in the mutation.

func (*GroupRolesMutation) LionGroupsIDs

func (m *GroupRolesMutation) LionGroupsIDs() (ids []int)

LionGroupsIDs returns the "lion_groups" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionGroupsID instead. It exists only for internal usage by the builders.

func (*GroupRolesMutation) LionRolesCleared

func (m *GroupRolesMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*GroupRolesMutation) LionRolesID

func (m *GroupRolesMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*GroupRolesMutation) LionRolesIDs

func (m *GroupRolesMutation) LionRolesIDs() (ids []int)

LionRolesIDs returns the "lion_roles" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionRolesID instead. It exists only for internal usage by the builders.

func (*GroupRolesMutation) OldCreatedAt

func (m *GroupRolesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the GroupRoles entity. If the GroupRoles 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 (*GroupRolesMutation) OldCreatedBy

func (m *GroupRolesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the GroupRoles entity. If the GroupRoles 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 (*GroupRolesMutation) OldField

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) OldGroupID

func (m *GroupRolesMutation) OldGroupID(ctx context.Context) (v int, err error)

OldGroupID returns the old "group_id" field's value of the GroupRoles entity. If the GroupRoles 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 (*GroupRolesMutation) OldRoleID

func (m *GroupRolesMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the GroupRoles entity. If the GroupRoles 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 (*GroupRolesMutation) OldUpdatedAt

func (m *GroupRolesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the GroupRoles entity. If the GroupRoles 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 (*GroupRolesMutation) OldUpdatedBy

func (m *GroupRolesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the GroupRoles entity. If the GroupRoles 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 (*GroupRolesMutation) Op

func (m *GroupRolesMutation) Op() Op

Op returns the operation name.

func (*GroupRolesMutation) RemovedEdges

func (m *GroupRolesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupRolesMutation) RemovedIDs

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) ResetCreatedAt

func (m *GroupRolesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupRolesMutation) ResetCreatedBy

func (m *GroupRolesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GroupRolesMutation) ResetEdge

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) ResetField

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) ResetGroupID

func (m *GroupRolesMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*GroupRolesMutation) ResetLionGroups

func (m *GroupRolesMutation) ResetLionGroups()

ResetLionGroups resets all changes to the "lion_groups" edge.

func (*GroupRolesMutation) ResetLionRoles

func (m *GroupRolesMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*GroupRolesMutation) ResetRoleID

func (m *GroupRolesMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*GroupRolesMutation) ResetUpdatedAt

func (m *GroupRolesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupRolesMutation) ResetUpdatedBy

func (m *GroupRolesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GroupRolesMutation) RoleID

func (m *GroupRolesMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*GroupRolesMutation) SetCreatedAt

func (m *GroupRolesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroupRolesMutation) SetCreatedBy

func (m *GroupRolesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*GroupRolesMutation) SetField

func (m *GroupRolesMutation) 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 (*GroupRolesMutation) SetGroupID

func (m *GroupRolesMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*GroupRolesMutation) SetLionGroupsID

func (m *GroupRolesMutation) SetLionGroupsID(id int)

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by id.

func (*GroupRolesMutation) SetLionRolesID

func (m *GroupRolesMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*GroupRolesMutation) SetOp

func (m *GroupRolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupRolesMutation) SetRoleID

func (m *GroupRolesMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*GroupRolesMutation) SetUpdatedAt

func (m *GroupRolesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GroupRolesMutation) SetUpdatedBy

func (m *GroupRolesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (GroupRolesMutation) Tx

func (m GroupRolesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupRolesMutation) Type

func (m *GroupRolesMutation) Type() string

Type returns the node type of this mutation (GroupRoles).

func (*GroupRolesMutation) UpdatedAt

func (m *GroupRolesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GroupRolesMutation) UpdatedBy

func (m *GroupRolesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*GroupRolesMutation) UpdatedByCleared

func (m *GroupRolesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*GroupRolesMutation) Where

func (m *GroupRolesMutation) Where(ps ...predicate.GroupRoles)

Where appends a list predicates to the GroupRolesMutation builder.

func (*GroupRolesMutation) WhereP

func (m *GroupRolesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupRolesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupRolesQuery

type GroupRolesQuery struct {
	// contains filtered or unexported fields
}

GroupRolesQuery is the builder for querying GroupRoles entities.

func (*GroupRolesQuery) Aggregate

func (_q *GroupRolesQuery) Aggregate(fns ...AggregateFunc) *GroupRolesSelect

Aggregate returns a GroupRolesSelect configured with the given aggregations.

func (*GroupRolesQuery) All

func (_q *GroupRolesQuery) All(ctx context.Context) ([]*GroupRoles, error)

All executes the query and returns a list of GroupRolesSlice.

func (*GroupRolesQuery) AllX

func (_q *GroupRolesQuery) AllX(ctx context.Context) []*GroupRoles

AllX is like All, but panics if an error occurs.

func (*GroupRolesQuery) Clone

func (_q *GroupRolesQuery) Clone() *GroupRolesQuery

Clone returns a duplicate of the GroupRolesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupRolesQuery) Count

func (_q *GroupRolesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupRolesQuery) CountX

func (_q *GroupRolesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupRolesQuery) Exist

func (_q *GroupRolesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupRolesQuery) ExistX

func (_q *GroupRolesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupRolesQuery) First

func (_q *GroupRolesQuery) First(ctx context.Context) (*GroupRoles, error)

First returns the first GroupRoles entity from the query. Returns a *NotFoundError when no GroupRoles was found.

func (*GroupRolesQuery) FirstID

func (_q *GroupRolesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GroupRoles ID from the query. Returns a *NotFoundError when no GroupRoles ID was found.

func (*GroupRolesQuery) FirstIDX

func (_q *GroupRolesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupRolesQuery) FirstX

func (_q *GroupRolesQuery) FirstX(ctx context.Context) *GroupRoles

FirstX is like First, but panics if an error occurs.

func (*GroupRolesQuery) GroupBy

func (_q *GroupRolesQuery) GroupBy(field string, fields ...string) *GroupRolesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GroupRoles.Query().
	GroupBy(grouproles.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*GroupRolesQuery) IDs

func (_q *GroupRolesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GroupRoles IDs.

func (*GroupRolesQuery) IDsX

func (_q *GroupRolesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroupRolesQuery) Limit

func (_q *GroupRolesQuery) Limit(limit int) *GroupRolesQuery

Limit the number of records to be returned by this query.

func (*GroupRolesQuery) Offset

func (_q *GroupRolesQuery) Offset(offset int) *GroupRolesQuery

Offset to start from.

func (*GroupRolesQuery) Only

func (_q *GroupRolesQuery) Only(ctx context.Context) (*GroupRoles, error)

Only returns a single GroupRoles entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroupRoles entity is found. Returns a *NotFoundError when no GroupRoles entities are found.

func (*GroupRolesQuery) OnlyID

func (_q *GroupRolesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GroupRoles ID in the query. Returns a *NotSingularError when more than one GroupRoles ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupRolesQuery) OnlyIDX

func (_q *GroupRolesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupRolesQuery) OnlyX

func (_q *GroupRolesQuery) OnlyX(ctx context.Context) *GroupRoles

OnlyX is like Only, but panics if an error occurs.

func (*GroupRolesQuery) Order

Order specifies how the records should be ordered.

func (*GroupRolesQuery) QueryLionGroups

func (_q *GroupRolesQuery) QueryLionGroups() *GroupsQuery

QueryLionGroups chains the current query on the "lion_groups" edge.

func (*GroupRolesQuery) QueryLionRoles

func (_q *GroupRolesQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*GroupRolesQuery) Select

func (_q *GroupRolesQuery) Select(fields ...string) *GroupRolesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.GroupRoles.Query().
	Select(grouproles.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupRolesQuery) Unique

func (_q *GroupRolesQuery) Unique(unique bool) *GroupRolesQuery

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 (*GroupRolesQuery) Where

Where adds a new predicate for the GroupRolesQuery builder.

func (*GroupRolesQuery) WithLionGroups

func (_q *GroupRolesQuery) WithLionGroups(opts ...func(*GroupsQuery)) *GroupRolesQuery

WithLionGroups tells the query-builder to eager-load the nodes that are connected to the "lion_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupRolesQuery) WithLionRoles

func (_q *GroupRolesQuery) WithLionRoles(opts ...func(*RolesQuery)) *GroupRolesQuery

WithLionRoles tells the query-builder to eager-load the nodes that are connected to the "lion_roles" edge. The optional arguments are used to configure the query builder of the edge.

type GroupRolesSelect

type GroupRolesSelect struct {
	*GroupRolesQuery
	// contains filtered or unexported fields
}

GroupRolesSelect is the builder for selecting fields of GroupRoles entities.

func (*GroupRolesSelect) Aggregate

func (_s *GroupRolesSelect) Aggregate(fns ...AggregateFunc) *GroupRolesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupRolesSelect) Bool

func (s *GroupRolesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) BoolX

func (s *GroupRolesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupRolesSelect) Bools

func (s *GroupRolesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) BoolsX

func (s *GroupRolesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupRolesSelect) Float64

func (s *GroupRolesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) Float64X

func (s *GroupRolesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupRolesSelect) Float64s

func (s *GroupRolesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) Float64sX

func (s *GroupRolesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupRolesSelect) Int

func (s *GroupRolesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) IntX

func (s *GroupRolesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupRolesSelect) Ints

func (s *GroupRolesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) IntsX

func (s *GroupRolesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupRolesSelect) Scan

func (_s *GroupRolesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupRolesSelect) ScanX

func (s *GroupRolesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupRolesSelect) String

func (s *GroupRolesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) StringX

func (s *GroupRolesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupRolesSelect) Strings

func (s *GroupRolesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupRolesSelect) StringsX

func (s *GroupRolesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupRolesSlice

type GroupRolesSlice []*GroupRoles

GroupRolesSlice is a parsable slice of GroupRoles.

type GroupRolesUpdate

type GroupRolesUpdate struct {
	// contains filtered or unexported fields
}

GroupRolesUpdate is the builder for updating GroupRoles entities.

func (*GroupRolesUpdate) AddCreatedBy

func (_u *GroupRolesUpdate) AddCreatedBy(v int64) *GroupRolesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*GroupRolesUpdate) AddUpdatedBy

func (_u *GroupRolesUpdate) AddUpdatedBy(v int64) *GroupRolesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*GroupRolesUpdate) ClearCreatedBy

func (_u *GroupRolesUpdate) ClearCreatedBy() *GroupRolesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupRolesUpdate) ClearLionGroups

func (_u *GroupRolesUpdate) ClearLionGroups() *GroupRolesUpdate

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*GroupRolesUpdate) ClearLionRoles

func (_u *GroupRolesUpdate) ClearLionRoles() *GroupRolesUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*GroupRolesUpdate) ClearUpdatedBy

func (_u *GroupRolesUpdate) ClearUpdatedBy() *GroupRolesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupRolesUpdate) Exec

func (_u *GroupRolesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupRolesUpdate) ExecX

func (_u *GroupRolesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupRolesUpdate) Mutation

func (_u *GroupRolesUpdate) Mutation() *GroupRolesMutation

Mutation returns the GroupRolesMutation object of the builder.

func (*GroupRolesUpdate) Save

func (_u *GroupRolesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupRolesUpdate) SaveX

func (_u *GroupRolesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupRolesUpdate) SetCreatedBy

func (_u *GroupRolesUpdate) SetCreatedBy(v int64) *GroupRolesUpdate

SetCreatedBy sets the "created_by" field.

func (*GroupRolesUpdate) SetGroupID

func (_u *GroupRolesUpdate) SetGroupID(v int) *GroupRolesUpdate

SetGroupID sets the "group_id" field.

func (*GroupRolesUpdate) SetLionGroups

func (_u *GroupRolesUpdate) SetLionGroups(v *Groups) *GroupRolesUpdate

SetLionGroups sets the "lion_groups" edge to the Groups entity.

func (*GroupRolesUpdate) SetLionGroupsID

func (_u *GroupRolesUpdate) SetLionGroupsID(id int) *GroupRolesUpdate

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by ID.

func (*GroupRolesUpdate) SetLionRoles

func (_u *GroupRolesUpdate) SetLionRoles(v *Roles) *GroupRolesUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*GroupRolesUpdate) SetLionRolesID

func (_u *GroupRolesUpdate) SetLionRolesID(id int) *GroupRolesUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*GroupRolesUpdate) SetNillableCreatedBy

func (_u *GroupRolesUpdate) SetNillableCreatedBy(v *int64) *GroupRolesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupRolesUpdate) SetNillableGroupID

func (_u *GroupRolesUpdate) SetNillableGroupID(v *int) *GroupRolesUpdate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*GroupRolesUpdate) SetNillableRoleID

func (_u *GroupRolesUpdate) SetNillableRoleID(v *int) *GroupRolesUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*GroupRolesUpdate) SetNillableUpdatedBy

func (_u *GroupRolesUpdate) SetNillableUpdatedBy(v *int64) *GroupRolesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupRolesUpdate) SetRoleID

func (_u *GroupRolesUpdate) SetRoleID(v int) *GroupRolesUpdate

SetRoleID sets the "role_id" field.

func (*GroupRolesUpdate) SetUpdatedAt

func (_u *GroupRolesUpdate) SetUpdatedAt(v time.Time) *GroupRolesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupRolesUpdate) SetUpdatedBy

func (_u *GroupRolesUpdate) SetUpdatedBy(v int64) *GroupRolesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*GroupRolesUpdate) Where

Where appends a list predicates to the GroupRolesUpdate builder.

type GroupRolesUpdateOne

type GroupRolesUpdateOne struct {
	// contains filtered or unexported fields
}

GroupRolesUpdateOne is the builder for updating a single GroupRoles entity.

func (*GroupRolesUpdateOne) AddCreatedBy

func (_u *GroupRolesUpdateOne) AddCreatedBy(v int64) *GroupRolesUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*GroupRolesUpdateOne) AddUpdatedBy

func (_u *GroupRolesUpdateOne) AddUpdatedBy(v int64) *GroupRolesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*GroupRolesUpdateOne) ClearCreatedBy

func (_u *GroupRolesUpdateOne) ClearCreatedBy() *GroupRolesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupRolesUpdateOne) ClearLionGroups

func (_u *GroupRolesUpdateOne) ClearLionGroups() *GroupRolesUpdateOne

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*GroupRolesUpdateOne) ClearLionRoles

func (_u *GroupRolesUpdateOne) ClearLionRoles() *GroupRolesUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*GroupRolesUpdateOne) ClearUpdatedBy

func (_u *GroupRolesUpdateOne) ClearUpdatedBy() *GroupRolesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupRolesUpdateOne) Exec

func (_u *GroupRolesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupRolesUpdateOne) ExecX

func (_u *GroupRolesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupRolesUpdateOne) Mutation

func (_u *GroupRolesUpdateOne) Mutation() *GroupRolesMutation

Mutation returns the GroupRolesMutation object of the builder.

func (*GroupRolesUpdateOne) Save

Save executes the query and returns the updated GroupRoles entity.

func (*GroupRolesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GroupRolesUpdateOne) Select

func (_u *GroupRolesUpdateOne) Select(field string, fields ...string) *GroupRolesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupRolesUpdateOne) SetCreatedBy

func (_u *GroupRolesUpdateOne) SetCreatedBy(v int64) *GroupRolesUpdateOne

SetCreatedBy sets the "created_by" field.

func (*GroupRolesUpdateOne) SetGroupID

func (_u *GroupRolesUpdateOne) SetGroupID(v int) *GroupRolesUpdateOne

SetGroupID sets the "group_id" field.

func (*GroupRolesUpdateOne) SetLionGroups

func (_u *GroupRolesUpdateOne) SetLionGroups(v *Groups) *GroupRolesUpdateOne

SetLionGroups sets the "lion_groups" edge to the Groups entity.

func (*GroupRolesUpdateOne) SetLionGroupsID

func (_u *GroupRolesUpdateOne) SetLionGroupsID(id int) *GroupRolesUpdateOne

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by ID.

func (*GroupRolesUpdateOne) SetLionRoles

func (_u *GroupRolesUpdateOne) SetLionRoles(v *Roles) *GroupRolesUpdateOne

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*GroupRolesUpdateOne) SetLionRolesID

func (_u *GroupRolesUpdateOne) SetLionRolesID(id int) *GroupRolesUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*GroupRolesUpdateOne) SetNillableCreatedBy

func (_u *GroupRolesUpdateOne) SetNillableCreatedBy(v *int64) *GroupRolesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupRolesUpdateOne) SetNillableGroupID

func (_u *GroupRolesUpdateOne) SetNillableGroupID(v *int) *GroupRolesUpdateOne

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*GroupRolesUpdateOne) SetNillableRoleID

func (_u *GroupRolesUpdateOne) SetNillableRoleID(v *int) *GroupRolesUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*GroupRolesUpdateOne) SetNillableUpdatedBy

func (_u *GroupRolesUpdateOne) SetNillableUpdatedBy(v *int64) *GroupRolesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupRolesUpdateOne) SetRoleID

func (_u *GroupRolesUpdateOne) SetRoleID(v int) *GroupRolesUpdateOne

SetRoleID sets the "role_id" field.

func (*GroupRolesUpdateOne) SetUpdatedAt

func (_u *GroupRolesUpdateOne) SetUpdatedAt(v time.Time) *GroupRolesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupRolesUpdateOne) SetUpdatedBy

func (_u *GroupRolesUpdateOne) SetUpdatedBy(v int64) *GroupRolesUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*GroupRolesUpdateOne) Where

Where appends a list predicates to the GroupRolesUpdate builder.

type Groups

type Groups struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 用户组名
	Name string `json:"name,omitempty"`
	// 群组类型,对应 api/known/admin/v1/common.proto 中定义
	GroupType int `json:"group_type,omitempty"`
	// 群组状态,对应 api/known/admin/v1/common.proto 中定义
	GroupStatus int `json:"group_status,omitempty"`
	// 群组排序顺序,用于同级群组的显示顺序,数值越小排序越靠前,建议使用 10 的倍数便于后续插入,默认值:100,范围:1-9999
	SortOrder int `json:"sort_order,omitempty"`
	// 父群组ID,为0表示顶级群组
	ParentID int `json:"parent_id,omitempty"`
	// 群组最大成员数量限制,0表示不限制
	MaxMembers int `json:"max_members,omitempty"`
	// 元数据,用于存储自定义属性,对应 proto 中的 map<string, string> metadata
	Metadata map[string]string `json:"metadata,omitempty"`
	// 外部系统ID,用于与外部系统集成
	ExternalID string `json:"external_id,omitempty"`
	// 关联 lion_departments 表的 ID
	DepartmentID int `json:"department_id,omitempty"`
	// 用户组描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupsQuery when eager-loading is set.
	Edges GroupsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Groups is the model entity for the Groups schema.

func (*Groups) QueryLionDepartments

func (_m *Groups) QueryLionDepartments() *DepartmentsQuery

QueryLionDepartments queries the "lion_departments" edge of the Groups entity.

func (*Groups) QueryLionGroups

func (_m *Groups) QueryLionGroups() *GroupRolesQuery

QueryLionGroups queries the "lion_groups" edge of the Groups entity.

func (*Groups) QueryLionUserGroups

func (_m *Groups) QueryLionUserGroups() *UserGroupsQuery

QueryLionUserGroups queries the "lion_user_groups" edge of the Groups entity.

func (*Groups) String

func (_m *Groups) String() string

String implements the fmt.Stringer.

func (*Groups) Unwrap

func (_m *Groups) Unwrap() *Groups

Unwrap unwraps the Groups 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 (*Groups) Update

func (_m *Groups) Update() *GroupsUpdateOne

Update returns a builder for updating this Groups. Note that you need to call Groups.Unwrap() before calling this method if this Groups was returned from a transaction, and the transaction was committed or rolled back.

func (*Groups) Value

func (_m *Groups) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Groups. This includes values selected through modifiers, order, etc.

type GroupsClient

type GroupsClient struct {
	// contains filtered or unexported fields
}

GroupsClient is a client for the Groups schema.

func NewGroupsClient

func NewGroupsClient(c config) *GroupsClient

NewGroupsClient returns a client for the Groups from the given config.

func (*GroupsClient) Create

func (c *GroupsClient) Create() *GroupsCreate

Create returns a builder for creating a Groups entity.

func (*GroupsClient) CreateBulk

func (c *GroupsClient) CreateBulk(builders ...*GroupsCreate) *GroupsCreateBulk

CreateBulk returns a builder for creating a bulk of Groups entities.

func (*GroupsClient) Delete

func (c *GroupsClient) Delete() *GroupsDelete

Delete returns a delete builder for Groups.

func (*GroupsClient) DeleteOne

func (c *GroupsClient) DeleteOne(_m *Groups) *GroupsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupsClient) DeleteOneID

func (c *GroupsClient) DeleteOneID(id int) *GroupsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GroupsClient) Get

func (c *GroupsClient) Get(ctx context.Context, id int) (*Groups, error)

Get returns a Groups entity by its id.

func (*GroupsClient) GetX

func (c *GroupsClient) GetX(ctx context.Context, id int) *Groups

GetX is like Get, but panics if an error occurs.

func (*GroupsClient) Hooks

func (c *GroupsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupsClient) Intercept

func (c *GroupsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `groups.Intercept(f(g(h())))`.

func (*GroupsClient) Interceptors

func (c *GroupsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupsClient) MapCreateBulk

func (c *GroupsClient) MapCreateBulk(slice any, setFunc func(*GroupsCreate, int)) *GroupsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*GroupsClient) Query

func (c *GroupsClient) Query() *GroupsQuery

Query returns a query builder for Groups.

func (*GroupsClient) QueryLionDepartments

func (c *GroupsClient) QueryLionDepartments(_m *Groups) *DepartmentsQuery

QueryLionDepartments queries the lion_departments edge of a Groups.

func (*GroupsClient) QueryLionGroups

func (c *GroupsClient) QueryLionGroups(_m *Groups) *GroupRolesQuery

QueryLionGroups queries the lion_groups edge of a Groups.

func (*GroupsClient) QueryLionUserGroups

func (c *GroupsClient) QueryLionUserGroups(_m *Groups) *UserGroupsQuery

QueryLionUserGroups queries the lion_user_groups edge of a Groups.

func (*GroupsClient) Update

func (c *GroupsClient) Update() *GroupsUpdate

Update returns an update builder for Groups.

func (*GroupsClient) UpdateOne

func (c *GroupsClient) UpdateOne(_m *Groups) *GroupsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupsClient) UpdateOneID

func (c *GroupsClient) UpdateOneID(id int) *GroupsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupsClient) Use

func (c *GroupsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `groups.Hooks(f(g(h())))`.

type GroupsCreate

type GroupsCreate struct {
	// contains filtered or unexported fields
}

GroupsCreate is the builder for creating a Groups entity.

func (*GroupsCreate) AddLionGroupIDs

func (_c *GroupsCreate) AddLionGroupIDs(ids ...int) *GroupsCreate

AddLionGroupIDs adds the "lion_groups" edge to the GroupRoles entity by IDs.

func (*GroupsCreate) AddLionGroups

func (_c *GroupsCreate) AddLionGroups(v ...*GroupRoles) *GroupsCreate

AddLionGroups adds the "lion_groups" edges to the GroupRoles entity.

func (*GroupsCreate) AddLionUserGroupIDs

func (_c *GroupsCreate) AddLionUserGroupIDs(ids ...int) *GroupsCreate

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*GroupsCreate) AddLionUserGroups

func (_c *GroupsCreate) AddLionUserGroups(v ...*UserGroups) *GroupsCreate

AddLionUserGroups adds the "lion_user_groups" edges to the UserGroups entity.

func (*GroupsCreate) Exec

func (_c *GroupsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupsCreate) ExecX

func (_c *GroupsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupsCreate) Mutation

func (_c *GroupsCreate) Mutation() *GroupsMutation

Mutation returns the GroupsMutation object of the builder.

func (*GroupsCreate) Save

func (_c *GroupsCreate) Save(ctx context.Context) (*Groups, error)

Save creates the Groups in the database.

func (*GroupsCreate) SaveX

func (_c *GroupsCreate) SaveX(ctx context.Context) *Groups

SaveX calls Save and panics if Save returns an error.

func (*GroupsCreate) SetCreatedAt

func (_c *GroupsCreate) SetCreatedAt(v time.Time) *GroupsCreate

SetCreatedAt sets the "created_at" field.

func (*GroupsCreate) SetCreatedBy

func (_c *GroupsCreate) SetCreatedBy(v int64) *GroupsCreate

SetCreatedBy sets the "created_by" field.

func (*GroupsCreate) SetDeletedAt

func (_c *GroupsCreate) SetDeletedAt(v time.Time) *GroupsCreate

SetDeletedAt sets the "deleted_at" field.

func (*GroupsCreate) SetDepartmentID

func (_c *GroupsCreate) SetDepartmentID(v int) *GroupsCreate

SetDepartmentID sets the "department_id" field.

func (*GroupsCreate) SetDescription

func (_c *GroupsCreate) SetDescription(v string) *GroupsCreate

SetDescription sets the "description" field.

func (*GroupsCreate) SetExternalID

func (_c *GroupsCreate) SetExternalID(v string) *GroupsCreate

SetExternalID sets the "external_id" field.

func (*GroupsCreate) SetGroupStatus

func (_c *GroupsCreate) SetGroupStatus(v int) *GroupsCreate

SetGroupStatus sets the "group_status" field.

func (*GroupsCreate) SetGroupType

func (_c *GroupsCreate) SetGroupType(v int) *GroupsCreate

SetGroupType sets the "group_type" field.

func (*GroupsCreate) SetLionDepartments

func (_c *GroupsCreate) SetLionDepartments(v *Departments) *GroupsCreate

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*GroupsCreate) SetLionDepartmentsID

func (_c *GroupsCreate) SetLionDepartmentsID(id int) *GroupsCreate

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*GroupsCreate) SetMaxMembers

func (_c *GroupsCreate) SetMaxMembers(v int) *GroupsCreate

SetMaxMembers sets the "max_members" field.

func (*GroupsCreate) SetMetadata

func (_c *GroupsCreate) SetMetadata(v map[string]string) *GroupsCreate

SetMetadata sets the "metadata" field.

func (*GroupsCreate) SetName

func (_c *GroupsCreate) SetName(v string) *GroupsCreate

SetName sets the "name" field.

func (*GroupsCreate) SetNillableCreatedAt

func (_c *GroupsCreate) SetNillableCreatedAt(v *time.Time) *GroupsCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroupsCreate) SetNillableCreatedBy

func (_c *GroupsCreate) SetNillableCreatedBy(v *int64) *GroupsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupsCreate) SetNillableDeletedAt

func (_c *GroupsCreate) SetNillableDeletedAt(v *time.Time) *GroupsCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GroupsCreate) SetNillableDepartmentID

func (_c *GroupsCreate) SetNillableDepartmentID(v *int) *GroupsCreate

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*GroupsCreate) SetNillableDescription

func (_c *GroupsCreate) SetNillableDescription(v *string) *GroupsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GroupsCreate) SetNillableExternalID

func (_c *GroupsCreate) SetNillableExternalID(v *string) *GroupsCreate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*GroupsCreate) SetNillableGroupStatus

func (_c *GroupsCreate) SetNillableGroupStatus(v *int) *GroupsCreate

SetNillableGroupStatus sets the "group_status" field if the given value is not nil.

func (*GroupsCreate) SetNillableGroupType

func (_c *GroupsCreate) SetNillableGroupType(v *int) *GroupsCreate

SetNillableGroupType sets the "group_type" field if the given value is not nil.

func (*GroupsCreate) SetNillableMaxMembers

func (_c *GroupsCreate) SetNillableMaxMembers(v *int) *GroupsCreate

SetNillableMaxMembers sets the "max_members" field if the given value is not nil.

func (*GroupsCreate) SetNillableParentID

func (_c *GroupsCreate) SetNillableParentID(v *int) *GroupsCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*GroupsCreate) SetNillableSortOrder

func (_c *GroupsCreate) SetNillableSortOrder(v *int) *GroupsCreate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*GroupsCreate) SetNillableUpdatedAt

func (_c *GroupsCreate) SetNillableUpdatedAt(v *time.Time) *GroupsCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GroupsCreate) SetNillableUpdatedBy

func (_c *GroupsCreate) SetNillableUpdatedBy(v *int64) *GroupsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupsCreate) SetParentID

func (_c *GroupsCreate) SetParentID(v int) *GroupsCreate

SetParentID sets the "parent_id" field.

func (*GroupsCreate) SetSortOrder

func (_c *GroupsCreate) SetSortOrder(v int) *GroupsCreate

SetSortOrder sets the "sort_order" field.

func (*GroupsCreate) SetUpdatedAt

func (_c *GroupsCreate) SetUpdatedAt(v time.Time) *GroupsCreate

SetUpdatedAt sets the "updated_at" field.

func (*GroupsCreate) SetUpdatedBy

func (_c *GroupsCreate) SetUpdatedBy(v int64) *GroupsCreate

SetUpdatedBy sets the "updated_by" field.

type GroupsCreateBulk

type GroupsCreateBulk struct {
	// contains filtered or unexported fields
}

GroupsCreateBulk is the builder for creating many Groups entities in bulk.

func (*GroupsCreateBulk) Exec

func (_c *GroupsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupsCreateBulk) ExecX

func (_c *GroupsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupsCreateBulk) Save

func (_c *GroupsCreateBulk) Save(ctx context.Context) ([]*Groups, error)

Save creates the Groups entities in the database.

func (*GroupsCreateBulk) SaveX

func (_c *GroupsCreateBulk) SaveX(ctx context.Context) []*Groups

SaveX is like Save, but panics if an error occurs.

type GroupsDelete

type GroupsDelete struct {
	// contains filtered or unexported fields
}

GroupsDelete is the builder for deleting a Groups entity.

func (*GroupsDelete) Exec

func (_d *GroupsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupsDelete) ExecX

func (_d *GroupsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupsDelete) Where

func (_d *GroupsDelete) Where(ps ...predicate.Groups) *GroupsDelete

Where appends a list predicates to the GroupsDelete builder.

type GroupsDeleteOne

type GroupsDeleteOne struct {
	// contains filtered or unexported fields
}

GroupsDeleteOne is the builder for deleting a single Groups entity.

func (*GroupsDeleteOne) Exec

func (_d *GroupsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupsDeleteOne) ExecX

func (_d *GroupsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupsDeleteOne) Where

func (_d *GroupsDeleteOne) Where(ps ...predicate.Groups) *GroupsDeleteOne

Where appends a list predicates to the GroupsDelete builder.

type GroupsEdges

type GroupsEdges struct {
	// LionGroups holds the value of the lion_groups edge.
	LionGroups []*GroupRoles `json:"lion_groups,omitempty"`
	// LionUserGroups holds the value of the lion_user_groups edge.
	LionUserGroups []*UserGroups `json:"lion_user_groups,omitempty"`
	// LionDepartments holds the value of the lion_departments edge.
	LionDepartments *Departments `json:"lion_departments,omitempty"`
	// contains filtered or unexported fields
}

GroupsEdges holds the relations/edges for other nodes in the graph.

func (GroupsEdges) LionDepartmentsOrErr

func (e GroupsEdges) LionDepartmentsOrErr() (*Departments, error)

LionDepartmentsOrErr returns the LionDepartments value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GroupsEdges) LionGroupsOrErr

func (e GroupsEdges) LionGroupsOrErr() ([]*GroupRoles, error)

LionGroupsOrErr returns the LionGroups value or an error if the edge was not loaded in eager-loading.

func (GroupsEdges) LionUserGroupsOrErr

func (e GroupsEdges) LionUserGroupsOrErr() ([]*UserGroups, error)

LionUserGroupsOrErr returns the LionUserGroups value or an error if the edge was not loaded in eager-loading.

type GroupsGroupBy

type GroupsGroupBy struct {
	// contains filtered or unexported fields
}

GroupsGroupBy is the group-by builder for Groups entities.

func (*GroupsGroupBy) Aggregate

func (_g *GroupsGroupBy) Aggregate(fns ...AggregateFunc) *GroupsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupsGroupBy) Bool

func (s *GroupsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) BoolX

func (s *GroupsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupsGroupBy) Bools

func (s *GroupsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) BoolsX

func (s *GroupsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupsGroupBy) Float64

func (s *GroupsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) Float64X

func (s *GroupsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupsGroupBy) Float64s

func (s *GroupsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) Float64sX

func (s *GroupsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupsGroupBy) Int

func (s *GroupsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) IntX

func (s *GroupsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupsGroupBy) Ints

func (s *GroupsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) IntsX

func (s *GroupsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupsGroupBy) Scan

func (_g *GroupsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupsGroupBy) ScanX

func (s *GroupsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupsGroupBy) String

func (s *GroupsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) StringX

func (s *GroupsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupsGroupBy) Strings

func (s *GroupsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupsGroupBy) StringsX

func (s *GroupsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupsMutation

type GroupsMutation struct {
	// contains filtered or unexported fields
}

GroupsMutation represents an operation that mutates the Groups nodes in the graph.

func (*GroupsMutation) AddCreatedBy

func (m *GroupsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*GroupsMutation) AddField

func (m *GroupsMutation) 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 (*GroupsMutation) AddGroupStatus

func (m *GroupsMutation) AddGroupStatus(i int)

AddGroupStatus adds i to the "group_status" field.

func (*GroupsMutation) AddGroupType

func (m *GroupsMutation) AddGroupType(i int)

AddGroupType adds i to the "group_type" field.

func (*GroupsMutation) AddLionGroupIDs

func (m *GroupsMutation) AddLionGroupIDs(ids ...int)

AddLionGroupIDs adds the "lion_groups" edge to the GroupRoles entity by ids.

func (*GroupsMutation) AddLionUserGroupIDs

func (m *GroupsMutation) AddLionUserGroupIDs(ids ...int)

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by ids.

func (*GroupsMutation) AddMaxMembers

func (m *GroupsMutation) AddMaxMembers(i int)

AddMaxMembers adds i to the "max_members" field.

func (*GroupsMutation) AddParentID

func (m *GroupsMutation) AddParentID(i int)

AddParentID adds i to the "parent_id" field.

func (*GroupsMutation) AddSortOrder

func (m *GroupsMutation) AddSortOrder(i int)

AddSortOrder adds i to the "sort_order" field.

func (*GroupsMutation) AddUpdatedBy

func (m *GroupsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*GroupsMutation) AddedCreatedBy

func (m *GroupsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*GroupsMutation) AddedEdges

func (m *GroupsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupsMutation) AddedField

func (m *GroupsMutation) 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 (*GroupsMutation) AddedFields

func (m *GroupsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupsMutation) AddedGroupStatus

func (m *GroupsMutation) AddedGroupStatus() (r int, exists bool)

AddedGroupStatus returns the value that was added to the "group_status" field in this mutation.

func (*GroupsMutation) AddedGroupType

func (m *GroupsMutation) AddedGroupType() (r int, exists bool)

AddedGroupType returns the value that was added to the "group_type" field in this mutation.

func (*GroupsMutation) AddedIDs

func (m *GroupsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupsMutation) AddedMaxMembers

func (m *GroupsMutation) AddedMaxMembers() (r int, exists bool)

AddedMaxMembers returns the value that was added to the "max_members" field in this mutation.

func (*GroupsMutation) AddedParentID

func (m *GroupsMutation) AddedParentID() (r int, exists bool)

AddedParentID returns the value that was added to the "parent_id" field in this mutation.

func (*GroupsMutation) AddedSortOrder

func (m *GroupsMutation) AddedSortOrder() (r int, exists bool)

AddedSortOrder returns the value that was added to the "sort_order" field in this mutation.

func (*GroupsMutation) AddedUpdatedBy

func (m *GroupsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*GroupsMutation) ClearCreatedBy

func (m *GroupsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupsMutation) ClearDeletedAt

func (m *GroupsMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GroupsMutation) ClearEdge

func (m *GroupsMutation) 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 (*GroupsMutation) ClearField

func (m *GroupsMutation) 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 (*GroupsMutation) ClearLionDepartments

func (m *GroupsMutation) ClearLionDepartments()

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*GroupsMutation) ClearLionGroups

func (m *GroupsMutation) ClearLionGroups()

ClearLionGroups clears the "lion_groups" edge to the GroupRoles entity.

func (*GroupsMutation) ClearLionUserGroups

func (m *GroupsMutation) ClearLionUserGroups()

ClearLionUserGroups clears the "lion_user_groups" edge to the UserGroups entity.

func (*GroupsMutation) ClearUpdatedBy

func (m *GroupsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupsMutation) ClearedEdges

func (m *GroupsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupsMutation) ClearedFields

func (m *GroupsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupsMutation) Client

func (m GroupsMutation) 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 (*GroupsMutation) CreatedAt

func (m *GroupsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroupsMutation) CreatedBy

func (m *GroupsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*GroupsMutation) CreatedByCleared

func (m *GroupsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*GroupsMutation) DeletedAt

func (m *GroupsMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*GroupsMutation) DeletedAtCleared

func (m *GroupsMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*GroupsMutation) DepartmentID

func (m *GroupsMutation) DepartmentID() (r int, exists bool)

DepartmentID returns the value of the "department_id" field in the mutation.

func (*GroupsMutation) Description

func (m *GroupsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*GroupsMutation) EdgeCleared

func (m *GroupsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupsMutation) ExternalID

func (m *GroupsMutation) ExternalID() (r string, exists bool)

ExternalID returns the value of the "external_id" field in the mutation.

func (*GroupsMutation) Field

func (m *GroupsMutation) 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 (*GroupsMutation) FieldCleared

func (m *GroupsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupsMutation) Fields

func (m *GroupsMutation) 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 (*GroupsMutation) GroupStatus

func (m *GroupsMutation) GroupStatus() (r int, exists bool)

GroupStatus returns the value of the "group_status" field in the mutation.

func (*GroupsMutation) GroupType

func (m *GroupsMutation) GroupType() (r int, exists bool)

GroupType returns the value of the "group_type" field in the mutation.

func (*GroupsMutation) ID

func (m *GroupsMutation) 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 (*GroupsMutation) IDs

func (m *GroupsMutation) 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 (*GroupsMutation) LionDepartmentsCleared

func (m *GroupsMutation) LionDepartmentsCleared() bool

LionDepartmentsCleared reports if the "lion_departments" edge to the Departments entity was cleared.

func (*GroupsMutation) LionDepartmentsID

func (m *GroupsMutation) LionDepartmentsID() (id int, exists bool)

LionDepartmentsID returns the "lion_departments" edge ID in the mutation.

func (*GroupsMutation) LionDepartmentsIDs

func (m *GroupsMutation) LionDepartmentsIDs() (ids []int)

LionDepartmentsIDs returns the "lion_departments" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionDepartmentsID instead. It exists only for internal usage by the builders.

func (*GroupsMutation) LionGroupsCleared

func (m *GroupsMutation) LionGroupsCleared() bool

LionGroupsCleared reports if the "lion_groups" edge to the GroupRoles entity was cleared.

func (*GroupsMutation) LionGroupsIDs

func (m *GroupsMutation) LionGroupsIDs() (ids []int)

LionGroupsIDs returns the "lion_groups" edge IDs in the mutation.

func (*GroupsMutation) LionUserGroupsCleared

func (m *GroupsMutation) LionUserGroupsCleared() bool

LionUserGroupsCleared reports if the "lion_user_groups" edge to the UserGroups entity was cleared.

func (*GroupsMutation) LionUserGroupsIDs

func (m *GroupsMutation) LionUserGroupsIDs() (ids []int)

LionUserGroupsIDs returns the "lion_user_groups" edge IDs in the mutation.

func (*GroupsMutation) MaxMembers

func (m *GroupsMutation) MaxMembers() (r int, exists bool)

MaxMembers returns the value of the "max_members" field in the mutation.

func (*GroupsMutation) Metadata

func (m *GroupsMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*GroupsMutation) Name

func (m *GroupsMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroupsMutation) OldCreatedAt

func (m *GroupsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldCreatedBy

func (m *GroupsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldDeletedAt

func (m *GroupsMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldDepartmentID

func (m *GroupsMutation) OldDepartmentID(ctx context.Context) (v int, err error)

OldDepartmentID returns the old "department_id" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldDescription

func (m *GroupsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldExternalID

func (m *GroupsMutation) OldExternalID(ctx context.Context) (v string, err error)

OldExternalID returns the old "external_id" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldField

func (m *GroupsMutation) 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 (*GroupsMutation) OldGroupStatus

func (m *GroupsMutation) OldGroupStatus(ctx context.Context) (v int, err error)

OldGroupStatus returns the old "group_status" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldGroupType

func (m *GroupsMutation) OldGroupType(ctx context.Context) (v int, err error)

OldGroupType returns the old "group_type" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldMaxMembers

func (m *GroupsMutation) OldMaxMembers(ctx context.Context) (v int, err error)

OldMaxMembers returns the old "max_members" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldMetadata

func (m *GroupsMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldName

func (m *GroupsMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldParentID

func (m *GroupsMutation) OldParentID(ctx context.Context) (v int, err error)

OldParentID returns the old "parent_id" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldSortOrder

func (m *GroupsMutation) OldSortOrder(ctx context.Context) (v int, err error)

OldSortOrder returns the old "sort_order" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldUpdatedAt

func (m *GroupsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) OldUpdatedBy

func (m *GroupsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Groups entity. If the Groups 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 (*GroupsMutation) Op

func (m *GroupsMutation) Op() Op

Op returns the operation name.

func (*GroupsMutation) ParentID

func (m *GroupsMutation) ParentID() (r int, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*GroupsMutation) RemoveLionGroupIDs

func (m *GroupsMutation) RemoveLionGroupIDs(ids ...int)

RemoveLionGroupIDs removes the "lion_groups" edge to the GroupRoles entity by IDs.

func (*GroupsMutation) RemoveLionUserGroupIDs

func (m *GroupsMutation) RemoveLionUserGroupIDs(ids ...int)

RemoveLionUserGroupIDs removes the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*GroupsMutation) RemovedEdges

func (m *GroupsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupsMutation) RemovedIDs

func (m *GroupsMutation) 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 (*GroupsMutation) RemovedLionGroupsIDs

func (m *GroupsMutation) RemovedLionGroupsIDs() (ids []int)

RemovedLionGroups returns the removed IDs of the "lion_groups" edge to the GroupRoles entity.

func (*GroupsMutation) RemovedLionUserGroupsIDs

func (m *GroupsMutation) RemovedLionUserGroupsIDs() (ids []int)

RemovedLionUserGroups returns the removed IDs of the "lion_user_groups" edge to the UserGroups entity.

func (*GroupsMutation) ResetCreatedAt

func (m *GroupsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupsMutation) ResetCreatedBy

func (m *GroupsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GroupsMutation) ResetDeletedAt

func (m *GroupsMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*GroupsMutation) ResetDepartmentID

func (m *GroupsMutation) ResetDepartmentID()

ResetDepartmentID resets all changes to the "department_id" field.

func (*GroupsMutation) ResetDescription

func (m *GroupsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GroupsMutation) ResetEdge

func (m *GroupsMutation) 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 (*GroupsMutation) ResetExternalID

func (m *GroupsMutation) ResetExternalID()

ResetExternalID resets all changes to the "external_id" field.

func (*GroupsMutation) ResetField

func (m *GroupsMutation) 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 (*GroupsMutation) ResetGroupStatus

func (m *GroupsMutation) ResetGroupStatus()

ResetGroupStatus resets all changes to the "group_status" field.

func (*GroupsMutation) ResetGroupType

func (m *GroupsMutation) ResetGroupType()

ResetGroupType resets all changes to the "group_type" field.

func (*GroupsMutation) ResetLionDepartments

func (m *GroupsMutation) ResetLionDepartments()

ResetLionDepartments resets all changes to the "lion_departments" edge.

func (*GroupsMutation) ResetLionGroups

func (m *GroupsMutation) ResetLionGroups()

ResetLionGroups resets all changes to the "lion_groups" edge.

func (*GroupsMutation) ResetLionUserGroups

func (m *GroupsMutation) ResetLionUserGroups()

ResetLionUserGroups resets all changes to the "lion_user_groups" edge.

func (*GroupsMutation) ResetMaxMembers

func (m *GroupsMutation) ResetMaxMembers()

ResetMaxMembers resets all changes to the "max_members" field.

func (*GroupsMutation) ResetMetadata

func (m *GroupsMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*GroupsMutation) ResetName

func (m *GroupsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupsMutation) ResetParentID

func (m *GroupsMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*GroupsMutation) ResetSortOrder

func (m *GroupsMutation) ResetSortOrder()

ResetSortOrder resets all changes to the "sort_order" field.

func (*GroupsMutation) ResetUpdatedAt

func (m *GroupsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupsMutation) ResetUpdatedBy

func (m *GroupsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GroupsMutation) SetCreatedAt

func (m *GroupsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroupsMutation) SetCreatedBy

func (m *GroupsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*GroupsMutation) SetDeletedAt

func (m *GroupsMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*GroupsMutation) SetDepartmentID

func (m *GroupsMutation) SetDepartmentID(i int)

SetDepartmentID sets the "department_id" field.

func (*GroupsMutation) SetDescription

func (m *GroupsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GroupsMutation) SetExternalID

func (m *GroupsMutation) SetExternalID(s string)

SetExternalID sets the "external_id" field.

func (*GroupsMutation) SetField

func (m *GroupsMutation) 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 (*GroupsMutation) SetGroupStatus

func (m *GroupsMutation) SetGroupStatus(i int)

SetGroupStatus sets the "group_status" field.

func (*GroupsMutation) SetGroupType

func (m *GroupsMutation) SetGroupType(i int)

SetGroupType sets the "group_type" field.

func (*GroupsMutation) SetLionDepartmentsID

func (m *GroupsMutation) SetLionDepartmentsID(id int)

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by id.

func (*GroupsMutation) SetMaxMembers

func (m *GroupsMutation) SetMaxMembers(i int)

SetMaxMembers sets the "max_members" field.

func (*GroupsMutation) SetMetadata

func (m *GroupsMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*GroupsMutation) SetName

func (m *GroupsMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupsMutation) SetOp

func (m *GroupsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupsMutation) SetParentID

func (m *GroupsMutation) SetParentID(i int)

SetParentID sets the "parent_id" field.

func (*GroupsMutation) SetSortOrder

func (m *GroupsMutation) SetSortOrder(i int)

SetSortOrder sets the "sort_order" field.

func (*GroupsMutation) SetUpdatedAt

func (m *GroupsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GroupsMutation) SetUpdatedBy

func (m *GroupsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*GroupsMutation) SortOrder

func (m *GroupsMutation) SortOrder() (r int, exists bool)

SortOrder returns the value of the "sort_order" field in the mutation.

func (GroupsMutation) Tx

func (m GroupsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupsMutation) Type

func (m *GroupsMutation) Type() string

Type returns the node type of this mutation (Groups).

func (*GroupsMutation) UpdatedAt

func (m *GroupsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GroupsMutation) UpdatedBy

func (m *GroupsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*GroupsMutation) UpdatedByCleared

func (m *GroupsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*GroupsMutation) Where

func (m *GroupsMutation) Where(ps ...predicate.Groups)

Where appends a list predicates to the GroupsMutation builder.

func (*GroupsMutation) WhereP

func (m *GroupsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupsQuery

type GroupsQuery struct {
	// contains filtered or unexported fields
}

GroupsQuery is the builder for querying Groups entities.

func (*GroupsQuery) Aggregate

func (_q *GroupsQuery) Aggregate(fns ...AggregateFunc) *GroupsSelect

Aggregate returns a GroupsSelect configured with the given aggregations.

func (*GroupsQuery) All

func (_q *GroupsQuery) All(ctx context.Context) ([]*Groups, error)

All executes the query and returns a list of GroupsSlice.

func (*GroupsQuery) AllX

func (_q *GroupsQuery) AllX(ctx context.Context) []*Groups

AllX is like All, but panics if an error occurs.

func (*GroupsQuery) Clone

func (_q *GroupsQuery) Clone() *GroupsQuery

Clone returns a duplicate of the GroupsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupsQuery) Count

func (_q *GroupsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupsQuery) CountX

func (_q *GroupsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupsQuery) Exist

func (_q *GroupsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupsQuery) ExistX

func (_q *GroupsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupsQuery) First

func (_q *GroupsQuery) First(ctx context.Context) (*Groups, error)

First returns the first Groups entity from the query. Returns a *NotFoundError when no Groups was found.

func (*GroupsQuery) FirstID

func (_q *GroupsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Groups ID from the query. Returns a *NotFoundError when no Groups ID was found.

func (*GroupsQuery) FirstIDX

func (_q *GroupsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupsQuery) FirstX

func (_q *GroupsQuery) FirstX(ctx context.Context) *Groups

FirstX is like First, but panics if an error occurs.

func (*GroupsQuery) GroupBy

func (_q *GroupsQuery) GroupBy(field string, fields ...string) *GroupsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Groups.Query().
	GroupBy(groups.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*GroupsQuery) IDs

func (_q *GroupsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Groups IDs.

func (*GroupsQuery) IDsX

func (_q *GroupsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroupsQuery) Limit

func (_q *GroupsQuery) Limit(limit int) *GroupsQuery

Limit the number of records to be returned by this query.

func (*GroupsQuery) Offset

func (_q *GroupsQuery) Offset(offset int) *GroupsQuery

Offset to start from.

func (*GroupsQuery) Only

func (_q *GroupsQuery) Only(ctx context.Context) (*Groups, error)

Only returns a single Groups entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Groups entity is found. Returns a *NotFoundError when no Groups entities are found.

func (*GroupsQuery) OnlyID

func (_q *GroupsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Groups ID in the query. Returns a *NotSingularError when more than one Groups ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupsQuery) OnlyIDX

func (_q *GroupsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupsQuery) OnlyX

func (_q *GroupsQuery) OnlyX(ctx context.Context) *Groups

OnlyX is like Only, but panics if an error occurs.

func (*GroupsQuery) Order

func (_q *GroupsQuery) Order(o ...groups.OrderOption) *GroupsQuery

Order specifies how the records should be ordered.

func (*GroupsQuery) QueryLionDepartments

func (_q *GroupsQuery) QueryLionDepartments() *DepartmentsQuery

QueryLionDepartments chains the current query on the "lion_departments" edge.

func (*GroupsQuery) QueryLionGroups

func (_q *GroupsQuery) QueryLionGroups() *GroupRolesQuery

QueryLionGroups chains the current query on the "lion_groups" edge.

func (*GroupsQuery) QueryLionUserGroups

func (_q *GroupsQuery) QueryLionUserGroups() *UserGroupsQuery

QueryLionUserGroups chains the current query on the "lion_user_groups" edge.

func (*GroupsQuery) Select

func (_q *GroupsQuery) Select(fields ...string) *GroupsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Groups.Query().
	Select(groups.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupsQuery) Unique

func (_q *GroupsQuery) Unique(unique bool) *GroupsQuery

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 (*GroupsQuery) Where

func (_q *GroupsQuery) Where(ps ...predicate.Groups) *GroupsQuery

Where adds a new predicate for the GroupsQuery builder.

func (*GroupsQuery) WithLionDepartments

func (_q *GroupsQuery) WithLionDepartments(opts ...func(*DepartmentsQuery)) *GroupsQuery

WithLionDepartments tells the query-builder to eager-load the nodes that are connected to the "lion_departments" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupsQuery) WithLionGroups

func (_q *GroupsQuery) WithLionGroups(opts ...func(*GroupRolesQuery)) *GroupsQuery

WithLionGroups tells the query-builder to eager-load the nodes that are connected to the "lion_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupsQuery) WithLionUserGroups

func (_q *GroupsQuery) WithLionUserGroups(opts ...func(*UserGroupsQuery)) *GroupsQuery

WithLionUserGroups tells the query-builder to eager-load the nodes that are connected to the "lion_user_groups" edge. The optional arguments are used to configure the query builder of the edge.

type GroupsSelect

type GroupsSelect struct {
	*GroupsQuery
	// contains filtered or unexported fields
}

GroupsSelect is the builder for selecting fields of Groups entities.

func (*GroupsSelect) Aggregate

func (_s *GroupsSelect) Aggregate(fns ...AggregateFunc) *GroupsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupsSelect) Bool

func (s *GroupsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) BoolX

func (s *GroupsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupsSelect) Bools

func (s *GroupsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) BoolsX

func (s *GroupsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupsSelect) Float64

func (s *GroupsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) Float64X

func (s *GroupsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupsSelect) Float64s

func (s *GroupsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) Float64sX

func (s *GroupsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupsSelect) Int

func (s *GroupsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) IntX

func (s *GroupsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupsSelect) Ints

func (s *GroupsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) IntsX

func (s *GroupsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupsSelect) Scan

func (_s *GroupsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupsSelect) ScanX

func (s *GroupsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupsSelect) String

func (s *GroupsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) StringX

func (s *GroupsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupsSelect) Strings

func (s *GroupsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupsSelect) StringsX

func (s *GroupsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupsSlice

type GroupsSlice []*Groups

GroupsSlice is a parsable slice of Groups.

type GroupsUpdate

type GroupsUpdate struct {
	// contains filtered or unexported fields
}

GroupsUpdate is the builder for updating Groups entities.

func (*GroupsUpdate) AddCreatedBy

func (_u *GroupsUpdate) AddCreatedBy(v int64) *GroupsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*GroupsUpdate) AddGroupStatus

func (_u *GroupsUpdate) AddGroupStatus(v int) *GroupsUpdate

AddGroupStatus adds value to the "group_status" field.

func (*GroupsUpdate) AddGroupType

func (_u *GroupsUpdate) AddGroupType(v int) *GroupsUpdate

AddGroupType adds value to the "group_type" field.

func (*GroupsUpdate) AddLionGroupIDs

func (_u *GroupsUpdate) AddLionGroupIDs(ids ...int) *GroupsUpdate

AddLionGroupIDs adds the "lion_groups" edge to the GroupRoles entity by IDs.

func (*GroupsUpdate) AddLionGroups

func (_u *GroupsUpdate) AddLionGroups(v ...*GroupRoles) *GroupsUpdate

AddLionGroups adds the "lion_groups" edges to the GroupRoles entity.

func (*GroupsUpdate) AddLionUserGroupIDs

func (_u *GroupsUpdate) AddLionUserGroupIDs(ids ...int) *GroupsUpdate

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*GroupsUpdate) AddLionUserGroups

func (_u *GroupsUpdate) AddLionUserGroups(v ...*UserGroups) *GroupsUpdate

AddLionUserGroups adds the "lion_user_groups" edges to the UserGroups entity.

func (*GroupsUpdate) AddMaxMembers

func (_u *GroupsUpdate) AddMaxMembers(v int) *GroupsUpdate

AddMaxMembers adds value to the "max_members" field.

func (*GroupsUpdate) AddParentID

func (_u *GroupsUpdate) AddParentID(v int) *GroupsUpdate

AddParentID adds value to the "parent_id" field.

func (*GroupsUpdate) AddSortOrder

func (_u *GroupsUpdate) AddSortOrder(v int) *GroupsUpdate

AddSortOrder adds value to the "sort_order" field.

func (*GroupsUpdate) AddUpdatedBy

func (_u *GroupsUpdate) AddUpdatedBy(v int64) *GroupsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*GroupsUpdate) ClearCreatedBy

func (_u *GroupsUpdate) ClearCreatedBy() *GroupsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupsUpdate) ClearDeletedAt

func (_u *GroupsUpdate) ClearDeletedAt() *GroupsUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GroupsUpdate) ClearLionDepartments

func (_u *GroupsUpdate) ClearLionDepartments() *GroupsUpdate

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*GroupsUpdate) ClearLionGroups

func (_u *GroupsUpdate) ClearLionGroups() *GroupsUpdate

ClearLionGroups clears all "lion_groups" edges to the GroupRoles entity.

func (*GroupsUpdate) ClearLionUserGroups

func (_u *GroupsUpdate) ClearLionUserGroups() *GroupsUpdate

ClearLionUserGroups clears all "lion_user_groups" edges to the UserGroups entity.

func (*GroupsUpdate) ClearUpdatedBy

func (_u *GroupsUpdate) ClearUpdatedBy() *GroupsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupsUpdate) Exec

func (_u *GroupsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupsUpdate) ExecX

func (_u *GroupsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupsUpdate) Mutation

func (_u *GroupsUpdate) Mutation() *GroupsMutation

Mutation returns the GroupsMutation object of the builder.

func (*GroupsUpdate) RemoveLionGroupIDs

func (_u *GroupsUpdate) RemoveLionGroupIDs(ids ...int) *GroupsUpdate

RemoveLionGroupIDs removes the "lion_groups" edge to GroupRoles entities by IDs.

func (*GroupsUpdate) RemoveLionGroups

func (_u *GroupsUpdate) RemoveLionGroups(v ...*GroupRoles) *GroupsUpdate

RemoveLionGroups removes "lion_groups" edges to GroupRoles entities.

func (*GroupsUpdate) RemoveLionUserGroupIDs

func (_u *GroupsUpdate) RemoveLionUserGroupIDs(ids ...int) *GroupsUpdate

RemoveLionUserGroupIDs removes the "lion_user_groups" edge to UserGroups entities by IDs.

func (*GroupsUpdate) RemoveLionUserGroups

func (_u *GroupsUpdate) RemoveLionUserGroups(v ...*UserGroups) *GroupsUpdate

RemoveLionUserGroups removes "lion_user_groups" edges to UserGroups entities.

func (*GroupsUpdate) Save

func (_u *GroupsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupsUpdate) SaveX

func (_u *GroupsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupsUpdate) SetCreatedBy

func (_u *GroupsUpdate) SetCreatedBy(v int64) *GroupsUpdate

SetCreatedBy sets the "created_by" field.

func (*GroupsUpdate) SetDeletedAt

func (_u *GroupsUpdate) SetDeletedAt(v time.Time) *GroupsUpdate

SetDeletedAt sets the "deleted_at" field.

func (*GroupsUpdate) SetDepartmentID

func (_u *GroupsUpdate) SetDepartmentID(v int) *GroupsUpdate

SetDepartmentID sets the "department_id" field.

func (*GroupsUpdate) SetDescription

func (_u *GroupsUpdate) SetDescription(v string) *GroupsUpdate

SetDescription sets the "description" field.

func (*GroupsUpdate) SetExternalID

func (_u *GroupsUpdate) SetExternalID(v string) *GroupsUpdate

SetExternalID sets the "external_id" field.

func (*GroupsUpdate) SetGroupStatus

func (_u *GroupsUpdate) SetGroupStatus(v int) *GroupsUpdate

SetGroupStatus sets the "group_status" field.

func (*GroupsUpdate) SetGroupType

func (_u *GroupsUpdate) SetGroupType(v int) *GroupsUpdate

SetGroupType sets the "group_type" field.

func (*GroupsUpdate) SetLionDepartments

func (_u *GroupsUpdate) SetLionDepartments(v *Departments) *GroupsUpdate

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*GroupsUpdate) SetLionDepartmentsID

func (_u *GroupsUpdate) SetLionDepartmentsID(id int) *GroupsUpdate

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*GroupsUpdate) SetMaxMembers

func (_u *GroupsUpdate) SetMaxMembers(v int) *GroupsUpdate

SetMaxMembers sets the "max_members" field.

func (*GroupsUpdate) SetMetadata

func (_u *GroupsUpdate) SetMetadata(v map[string]string) *GroupsUpdate

SetMetadata sets the "metadata" field.

func (*GroupsUpdate) SetName

func (_u *GroupsUpdate) SetName(v string) *GroupsUpdate

SetName sets the "name" field.

func (*GroupsUpdate) SetNillableCreatedBy

func (_u *GroupsUpdate) SetNillableCreatedBy(v *int64) *GroupsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupsUpdate) SetNillableDeletedAt

func (_u *GroupsUpdate) SetNillableDeletedAt(v *time.Time) *GroupsUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GroupsUpdate) SetNillableDepartmentID

func (_u *GroupsUpdate) SetNillableDepartmentID(v *int) *GroupsUpdate

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*GroupsUpdate) SetNillableDescription

func (_u *GroupsUpdate) SetNillableDescription(v *string) *GroupsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GroupsUpdate) SetNillableExternalID

func (_u *GroupsUpdate) SetNillableExternalID(v *string) *GroupsUpdate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*GroupsUpdate) SetNillableGroupStatus

func (_u *GroupsUpdate) SetNillableGroupStatus(v *int) *GroupsUpdate

SetNillableGroupStatus sets the "group_status" field if the given value is not nil.

func (*GroupsUpdate) SetNillableGroupType

func (_u *GroupsUpdate) SetNillableGroupType(v *int) *GroupsUpdate

SetNillableGroupType sets the "group_type" field if the given value is not nil.

func (*GroupsUpdate) SetNillableMaxMembers

func (_u *GroupsUpdate) SetNillableMaxMembers(v *int) *GroupsUpdate

SetNillableMaxMembers sets the "max_members" field if the given value is not nil.

func (*GroupsUpdate) SetNillableName

func (_u *GroupsUpdate) SetNillableName(v *string) *GroupsUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupsUpdate) SetNillableParentID

func (_u *GroupsUpdate) SetNillableParentID(v *int) *GroupsUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*GroupsUpdate) SetNillableSortOrder

func (_u *GroupsUpdate) SetNillableSortOrder(v *int) *GroupsUpdate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*GroupsUpdate) SetNillableUpdatedBy

func (_u *GroupsUpdate) SetNillableUpdatedBy(v *int64) *GroupsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupsUpdate) SetParentID

func (_u *GroupsUpdate) SetParentID(v int) *GroupsUpdate

SetParentID sets the "parent_id" field.

func (*GroupsUpdate) SetSortOrder

func (_u *GroupsUpdate) SetSortOrder(v int) *GroupsUpdate

SetSortOrder sets the "sort_order" field.

func (*GroupsUpdate) SetUpdatedAt

func (_u *GroupsUpdate) SetUpdatedAt(v time.Time) *GroupsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupsUpdate) SetUpdatedBy

func (_u *GroupsUpdate) SetUpdatedBy(v int64) *GroupsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*GroupsUpdate) Where

func (_u *GroupsUpdate) Where(ps ...predicate.Groups) *GroupsUpdate

Where appends a list predicates to the GroupsUpdate builder.

type GroupsUpdateOne

type GroupsUpdateOne struct {
	// contains filtered or unexported fields
}

GroupsUpdateOne is the builder for updating a single Groups entity.

func (*GroupsUpdateOne) AddCreatedBy

func (_u *GroupsUpdateOne) AddCreatedBy(v int64) *GroupsUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*GroupsUpdateOne) AddGroupStatus

func (_u *GroupsUpdateOne) AddGroupStatus(v int) *GroupsUpdateOne

AddGroupStatus adds value to the "group_status" field.

func (*GroupsUpdateOne) AddGroupType

func (_u *GroupsUpdateOne) AddGroupType(v int) *GroupsUpdateOne

AddGroupType adds value to the "group_type" field.

func (*GroupsUpdateOne) AddLionGroupIDs

func (_u *GroupsUpdateOne) AddLionGroupIDs(ids ...int) *GroupsUpdateOne

AddLionGroupIDs adds the "lion_groups" edge to the GroupRoles entity by IDs.

func (*GroupsUpdateOne) AddLionGroups

func (_u *GroupsUpdateOne) AddLionGroups(v ...*GroupRoles) *GroupsUpdateOne

AddLionGroups adds the "lion_groups" edges to the GroupRoles entity.

func (*GroupsUpdateOne) AddLionUserGroupIDs

func (_u *GroupsUpdateOne) AddLionUserGroupIDs(ids ...int) *GroupsUpdateOne

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*GroupsUpdateOne) AddLionUserGroups

func (_u *GroupsUpdateOne) AddLionUserGroups(v ...*UserGroups) *GroupsUpdateOne

AddLionUserGroups adds the "lion_user_groups" edges to the UserGroups entity.

func (*GroupsUpdateOne) AddMaxMembers

func (_u *GroupsUpdateOne) AddMaxMembers(v int) *GroupsUpdateOne

AddMaxMembers adds value to the "max_members" field.

func (*GroupsUpdateOne) AddParentID

func (_u *GroupsUpdateOne) AddParentID(v int) *GroupsUpdateOne

AddParentID adds value to the "parent_id" field.

func (*GroupsUpdateOne) AddSortOrder

func (_u *GroupsUpdateOne) AddSortOrder(v int) *GroupsUpdateOne

AddSortOrder adds value to the "sort_order" field.

func (*GroupsUpdateOne) AddUpdatedBy

func (_u *GroupsUpdateOne) AddUpdatedBy(v int64) *GroupsUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*GroupsUpdateOne) ClearCreatedBy

func (_u *GroupsUpdateOne) ClearCreatedBy() *GroupsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupsUpdateOne) ClearDeletedAt

func (_u *GroupsUpdateOne) ClearDeletedAt() *GroupsUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GroupsUpdateOne) ClearLionDepartments

func (_u *GroupsUpdateOne) ClearLionDepartments() *GroupsUpdateOne

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*GroupsUpdateOne) ClearLionGroups

func (_u *GroupsUpdateOne) ClearLionGroups() *GroupsUpdateOne

ClearLionGroups clears all "lion_groups" edges to the GroupRoles entity.

func (*GroupsUpdateOne) ClearLionUserGroups

func (_u *GroupsUpdateOne) ClearLionUserGroups() *GroupsUpdateOne

ClearLionUserGroups clears all "lion_user_groups" edges to the UserGroups entity.

func (*GroupsUpdateOne) ClearUpdatedBy

func (_u *GroupsUpdateOne) ClearUpdatedBy() *GroupsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupsUpdateOne) Exec

func (_u *GroupsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupsUpdateOne) ExecX

func (_u *GroupsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupsUpdateOne) Mutation

func (_u *GroupsUpdateOne) Mutation() *GroupsMutation

Mutation returns the GroupsMutation object of the builder.

func (*GroupsUpdateOne) RemoveLionGroupIDs

func (_u *GroupsUpdateOne) RemoveLionGroupIDs(ids ...int) *GroupsUpdateOne

RemoveLionGroupIDs removes the "lion_groups" edge to GroupRoles entities by IDs.

func (*GroupsUpdateOne) RemoveLionGroups

func (_u *GroupsUpdateOne) RemoveLionGroups(v ...*GroupRoles) *GroupsUpdateOne

RemoveLionGroups removes "lion_groups" edges to GroupRoles entities.

func (*GroupsUpdateOne) RemoveLionUserGroupIDs

func (_u *GroupsUpdateOne) RemoveLionUserGroupIDs(ids ...int) *GroupsUpdateOne

RemoveLionUserGroupIDs removes the "lion_user_groups" edge to UserGroups entities by IDs.

func (*GroupsUpdateOne) RemoveLionUserGroups

func (_u *GroupsUpdateOne) RemoveLionUserGroups(v ...*UserGroups) *GroupsUpdateOne

RemoveLionUserGroups removes "lion_user_groups" edges to UserGroups entities.

func (*GroupsUpdateOne) Save

func (_u *GroupsUpdateOne) Save(ctx context.Context) (*Groups, error)

Save executes the query and returns the updated Groups entity.

func (*GroupsUpdateOne) SaveX

func (_u *GroupsUpdateOne) SaveX(ctx context.Context) *Groups

SaveX is like Save, but panics if an error occurs.

func (*GroupsUpdateOne) Select

func (_u *GroupsUpdateOne) Select(field string, fields ...string) *GroupsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupsUpdateOne) SetCreatedBy

func (_u *GroupsUpdateOne) SetCreatedBy(v int64) *GroupsUpdateOne

SetCreatedBy sets the "created_by" field.

func (*GroupsUpdateOne) SetDeletedAt

func (_u *GroupsUpdateOne) SetDeletedAt(v time.Time) *GroupsUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*GroupsUpdateOne) SetDepartmentID

func (_u *GroupsUpdateOne) SetDepartmentID(v int) *GroupsUpdateOne

SetDepartmentID sets the "department_id" field.

func (*GroupsUpdateOne) SetDescription

func (_u *GroupsUpdateOne) SetDescription(v string) *GroupsUpdateOne

SetDescription sets the "description" field.

func (*GroupsUpdateOne) SetExternalID

func (_u *GroupsUpdateOne) SetExternalID(v string) *GroupsUpdateOne

SetExternalID sets the "external_id" field.

func (*GroupsUpdateOne) SetGroupStatus

func (_u *GroupsUpdateOne) SetGroupStatus(v int) *GroupsUpdateOne

SetGroupStatus sets the "group_status" field.

func (*GroupsUpdateOne) SetGroupType

func (_u *GroupsUpdateOne) SetGroupType(v int) *GroupsUpdateOne

SetGroupType sets the "group_type" field.

func (*GroupsUpdateOne) SetLionDepartments

func (_u *GroupsUpdateOne) SetLionDepartments(v *Departments) *GroupsUpdateOne

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*GroupsUpdateOne) SetLionDepartmentsID

func (_u *GroupsUpdateOne) SetLionDepartmentsID(id int) *GroupsUpdateOne

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*GroupsUpdateOne) SetMaxMembers

func (_u *GroupsUpdateOne) SetMaxMembers(v int) *GroupsUpdateOne

SetMaxMembers sets the "max_members" field.

func (*GroupsUpdateOne) SetMetadata

func (_u *GroupsUpdateOne) SetMetadata(v map[string]string) *GroupsUpdateOne

SetMetadata sets the "metadata" field.

func (*GroupsUpdateOne) SetName

func (_u *GroupsUpdateOne) SetName(v string) *GroupsUpdateOne

SetName sets the "name" field.

func (*GroupsUpdateOne) SetNillableCreatedBy

func (_u *GroupsUpdateOne) SetNillableCreatedBy(v *int64) *GroupsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableDeletedAt

func (_u *GroupsUpdateOne) SetNillableDeletedAt(v *time.Time) *GroupsUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableDepartmentID

func (_u *GroupsUpdateOne) SetNillableDepartmentID(v *int) *GroupsUpdateOne

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableDescription

func (_u *GroupsUpdateOne) SetNillableDescription(v *string) *GroupsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableExternalID

func (_u *GroupsUpdateOne) SetNillableExternalID(v *string) *GroupsUpdateOne

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableGroupStatus

func (_u *GroupsUpdateOne) SetNillableGroupStatus(v *int) *GroupsUpdateOne

SetNillableGroupStatus sets the "group_status" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableGroupType

func (_u *GroupsUpdateOne) SetNillableGroupType(v *int) *GroupsUpdateOne

SetNillableGroupType sets the "group_type" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableMaxMembers

func (_u *GroupsUpdateOne) SetNillableMaxMembers(v *int) *GroupsUpdateOne

SetNillableMaxMembers sets the "max_members" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableName

func (_u *GroupsUpdateOne) SetNillableName(v *string) *GroupsUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableParentID

func (_u *GroupsUpdateOne) SetNillableParentID(v *int) *GroupsUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableSortOrder

func (_u *GroupsUpdateOne) SetNillableSortOrder(v *int) *GroupsUpdateOne

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableUpdatedBy

func (_u *GroupsUpdateOne) SetNillableUpdatedBy(v *int64) *GroupsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupsUpdateOne) SetParentID

func (_u *GroupsUpdateOne) SetParentID(v int) *GroupsUpdateOne

SetParentID sets the "parent_id" field.

func (*GroupsUpdateOne) SetSortOrder

func (_u *GroupsUpdateOne) SetSortOrder(v int) *GroupsUpdateOne

SetSortOrder sets the "sort_order" field.

func (*GroupsUpdateOne) SetUpdatedAt

func (_u *GroupsUpdateOne) SetUpdatedAt(v time.Time) *GroupsUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupsUpdateOne) SetUpdatedBy

func (_u *GroupsUpdateOne) SetUpdatedBy(v int64) *GroupsUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*GroupsUpdateOne) Where

func (_u *GroupsUpdateOne) Where(ps ...predicate.Groups) *GroupsUpdateOne

Where appends a list predicates to the GroupsUpdate builder.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Permissions

type Permissions struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 关联 lion_resources 表的资源 ID
	ResourceID int `json:"resource_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PermissionsQuery when eager-loading is set.
	Edges PermissionsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Permissions is the model entity for the Permissions schema.

func (*Permissions) QueryLionResources

func (_m *Permissions) QueryLionResources() *ResourcesQuery

QueryLionResources queries the "lion_resources" edge of the Permissions entity.

func (*Permissions) QueryLionRolePermissions

func (_m *Permissions) QueryLionRolePermissions() *RolePermissionsQuery

QueryLionRolePermissions queries the "lion_role_permissions" edge of the Permissions entity.

func (*Permissions) String

func (_m *Permissions) String() string

String implements the fmt.Stringer.

func (*Permissions) Unwrap

func (_m *Permissions) Unwrap() *Permissions

Unwrap unwraps the Permissions 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 (*Permissions) Update

func (_m *Permissions) Update() *PermissionsUpdateOne

Update returns a builder for updating this Permissions. Note that you need to call Permissions.Unwrap() before calling this method if this Permissions was returned from a transaction, and the transaction was committed or rolled back.

func (*Permissions) Value

func (_m *Permissions) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Permissions. This includes values selected through modifiers, order, etc.

type PermissionsClient

type PermissionsClient struct {
	// contains filtered or unexported fields
}

PermissionsClient is a client for the Permissions schema.

func NewPermissionsClient

func NewPermissionsClient(c config) *PermissionsClient

NewPermissionsClient returns a client for the Permissions from the given config.

func (*PermissionsClient) Create

func (c *PermissionsClient) Create() *PermissionsCreate

Create returns a builder for creating a Permissions entity.

func (*PermissionsClient) CreateBulk

func (c *PermissionsClient) CreateBulk(builders ...*PermissionsCreate) *PermissionsCreateBulk

CreateBulk returns a builder for creating a bulk of Permissions entities.

func (*PermissionsClient) Delete

func (c *PermissionsClient) Delete() *PermissionsDelete

Delete returns a delete builder for Permissions.

func (*PermissionsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PermissionsClient) DeleteOneID

func (c *PermissionsClient) DeleteOneID(id int) *PermissionsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PermissionsClient) Get

func (c *PermissionsClient) Get(ctx context.Context, id int) (*Permissions, error)

Get returns a Permissions entity by its id.

func (*PermissionsClient) GetX

func (c *PermissionsClient) GetX(ctx context.Context, id int) *Permissions

GetX is like Get, but panics if an error occurs.

func (*PermissionsClient) Hooks

func (c *PermissionsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PermissionsClient) Intercept

func (c *PermissionsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `permissions.Intercept(f(g(h())))`.

func (*PermissionsClient) Interceptors

func (c *PermissionsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PermissionsClient) MapCreateBulk

func (c *PermissionsClient) MapCreateBulk(slice any, setFunc func(*PermissionsCreate, int)) *PermissionsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PermissionsClient) Query

func (c *PermissionsClient) Query() *PermissionsQuery

Query returns a query builder for Permissions.

func (*PermissionsClient) QueryLionResources

func (c *PermissionsClient) QueryLionResources(_m *Permissions) *ResourcesQuery

QueryLionResources queries the lion_resources edge of a Permissions.

func (*PermissionsClient) QueryLionRolePermissions

func (c *PermissionsClient) QueryLionRolePermissions(_m *Permissions) *RolePermissionsQuery

QueryLionRolePermissions queries the lion_role_permissions edge of a Permissions.

func (*PermissionsClient) Update

func (c *PermissionsClient) Update() *PermissionsUpdate

Update returns an update builder for Permissions.

func (*PermissionsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PermissionsClient) UpdateOneID

func (c *PermissionsClient) UpdateOneID(id int) *PermissionsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PermissionsClient) Use

func (c *PermissionsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `permissions.Hooks(f(g(h())))`.

type PermissionsCreate

type PermissionsCreate struct {
	// contains filtered or unexported fields
}

PermissionsCreate is the builder for creating a Permissions entity.

func (*PermissionsCreate) AddLionRolePermissionIDs

func (_c *PermissionsCreate) AddLionRolePermissionIDs(ids ...int) *PermissionsCreate

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*PermissionsCreate) AddLionRolePermissions

func (_c *PermissionsCreate) AddLionRolePermissions(v ...*RolePermissions) *PermissionsCreate

AddLionRolePermissions adds the "lion_role_permissions" edges to the RolePermissions entity.

func (*PermissionsCreate) Exec

func (_c *PermissionsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PermissionsCreate) ExecX

func (_c *PermissionsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PermissionsCreate) Mutation

func (_c *PermissionsCreate) Mutation() *PermissionsMutation

Mutation returns the PermissionsMutation object of the builder.

func (*PermissionsCreate) Save

Save creates the Permissions in the database.

func (*PermissionsCreate) SaveX

func (_c *PermissionsCreate) SaveX(ctx context.Context) *Permissions

SaveX calls Save and panics if Save returns an error.

func (*PermissionsCreate) SetCreatedAt

func (_c *PermissionsCreate) SetCreatedAt(v time.Time) *PermissionsCreate

SetCreatedAt sets the "created_at" field.

func (*PermissionsCreate) SetCreatedBy

func (_c *PermissionsCreate) SetCreatedBy(v int64) *PermissionsCreate

SetCreatedBy sets the "created_by" field.

func (*PermissionsCreate) SetLionResources

func (_c *PermissionsCreate) SetLionResources(v *Resources) *PermissionsCreate

SetLionResources sets the "lion_resources" edge to the Resources entity.

func (*PermissionsCreate) SetLionResourcesID

func (_c *PermissionsCreate) SetLionResourcesID(id int) *PermissionsCreate

SetLionResourcesID sets the "lion_resources" edge to the Resources entity by ID.

func (*PermissionsCreate) SetNillableCreatedAt

func (_c *PermissionsCreate) SetNillableCreatedAt(v *time.Time) *PermissionsCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PermissionsCreate) SetNillableCreatedBy

func (_c *PermissionsCreate) SetNillableCreatedBy(v *int64) *PermissionsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PermissionsCreate) SetNillableUpdatedAt

func (_c *PermissionsCreate) SetNillableUpdatedAt(v *time.Time) *PermissionsCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PermissionsCreate) SetNillableUpdatedBy

func (_c *PermissionsCreate) SetNillableUpdatedBy(v *int64) *PermissionsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PermissionsCreate) SetResourceID

func (_c *PermissionsCreate) SetResourceID(v int) *PermissionsCreate

SetResourceID sets the "resource_id" field.

func (*PermissionsCreate) SetUpdatedAt

func (_c *PermissionsCreate) SetUpdatedAt(v time.Time) *PermissionsCreate

SetUpdatedAt sets the "updated_at" field.

func (*PermissionsCreate) SetUpdatedBy

func (_c *PermissionsCreate) SetUpdatedBy(v int64) *PermissionsCreate

SetUpdatedBy sets the "updated_by" field.

type PermissionsCreateBulk

type PermissionsCreateBulk struct {
	// contains filtered or unexported fields
}

PermissionsCreateBulk is the builder for creating many Permissions entities in bulk.

func (*PermissionsCreateBulk) Exec

Exec executes the query.

func (*PermissionsCreateBulk) ExecX

func (_c *PermissionsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PermissionsCreateBulk) Save

Save creates the Permissions entities in the database.

func (*PermissionsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PermissionsDelete

type PermissionsDelete struct {
	// contains filtered or unexported fields
}

PermissionsDelete is the builder for deleting a Permissions entity.

func (*PermissionsDelete) Exec

func (_d *PermissionsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PermissionsDelete) ExecX

func (_d *PermissionsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PermissionsDelete) Where

Where appends a list predicates to the PermissionsDelete builder.

type PermissionsDeleteOne

type PermissionsDeleteOne struct {
	// contains filtered or unexported fields
}

PermissionsDeleteOne is the builder for deleting a single Permissions entity.

func (*PermissionsDeleteOne) Exec

func (_d *PermissionsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PermissionsDeleteOne) ExecX

func (_d *PermissionsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PermissionsDeleteOne) Where

Where appends a list predicates to the PermissionsDelete builder.

type PermissionsEdges

type PermissionsEdges struct {
	// LionRolePermissions holds the value of the lion_role_permissions edge.
	LionRolePermissions []*RolePermissions `json:"lion_role_permissions,omitempty"`
	// LionResources holds the value of the lion_resources edge.
	LionResources *Resources `json:"lion_resources,omitempty"`
	// contains filtered or unexported fields
}

PermissionsEdges holds the relations/edges for other nodes in the graph.

func (PermissionsEdges) LionResourcesOrErr

func (e PermissionsEdges) LionResourcesOrErr() (*Resources, error)

LionResourcesOrErr returns the LionResources value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PermissionsEdges) LionRolePermissionsOrErr

func (e PermissionsEdges) LionRolePermissionsOrErr() ([]*RolePermissions, error)

LionRolePermissionsOrErr returns the LionRolePermissions value or an error if the edge was not loaded in eager-loading.

type PermissionsGroupBy

type PermissionsGroupBy struct {
	// contains filtered or unexported fields
}

PermissionsGroupBy is the group-by builder for Permissions entities.

func (*PermissionsGroupBy) Aggregate

func (_g *PermissionsGroupBy) Aggregate(fns ...AggregateFunc) *PermissionsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PermissionsGroupBy) Bool

func (s *PermissionsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) BoolX

func (s *PermissionsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PermissionsGroupBy) Bools

func (s *PermissionsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) BoolsX

func (s *PermissionsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PermissionsGroupBy) Float64

func (s *PermissionsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) Float64X

func (s *PermissionsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PermissionsGroupBy) Float64s

func (s *PermissionsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) Float64sX

func (s *PermissionsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PermissionsGroupBy) Int

func (s *PermissionsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) IntX

func (s *PermissionsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PermissionsGroupBy) Ints

func (s *PermissionsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) IntsX

func (s *PermissionsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PermissionsGroupBy) Scan

func (_g *PermissionsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PermissionsGroupBy) ScanX

func (s *PermissionsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PermissionsGroupBy) String

func (s *PermissionsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) StringX

func (s *PermissionsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PermissionsGroupBy) Strings

func (s *PermissionsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PermissionsGroupBy) StringsX

func (s *PermissionsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PermissionsMutation

type PermissionsMutation struct {
	// contains filtered or unexported fields
}

PermissionsMutation represents an operation that mutates the Permissions nodes in the graph.

func (*PermissionsMutation) AddCreatedBy

func (m *PermissionsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*PermissionsMutation) AddField

func (m *PermissionsMutation) 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 (*PermissionsMutation) AddLionRolePermissionIDs

func (m *PermissionsMutation) AddLionRolePermissionIDs(ids ...int)

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by ids.

func (*PermissionsMutation) AddUpdatedBy

func (m *PermissionsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*PermissionsMutation) AddedCreatedBy

func (m *PermissionsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*PermissionsMutation) AddedEdges

func (m *PermissionsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PermissionsMutation) AddedField

func (m *PermissionsMutation) 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 (*PermissionsMutation) AddedFields

func (m *PermissionsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PermissionsMutation) AddedIDs

func (m *PermissionsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PermissionsMutation) AddedUpdatedBy

func (m *PermissionsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*PermissionsMutation) ClearCreatedBy

func (m *PermissionsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*PermissionsMutation) ClearEdge

func (m *PermissionsMutation) 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 (*PermissionsMutation) ClearField

func (m *PermissionsMutation) 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 (*PermissionsMutation) ClearLionResources

func (m *PermissionsMutation) ClearLionResources()

ClearLionResources clears the "lion_resources" edge to the Resources entity.

func (*PermissionsMutation) ClearLionRolePermissions

func (m *PermissionsMutation) ClearLionRolePermissions()

ClearLionRolePermissions clears the "lion_role_permissions" edge to the RolePermissions entity.

func (*PermissionsMutation) ClearUpdatedBy

func (m *PermissionsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PermissionsMutation) ClearedEdges

func (m *PermissionsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PermissionsMutation) ClearedFields

func (m *PermissionsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PermissionsMutation) Client

func (m PermissionsMutation) 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 (*PermissionsMutation) CreatedAt

func (m *PermissionsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PermissionsMutation) CreatedBy

func (m *PermissionsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*PermissionsMutation) CreatedByCleared

func (m *PermissionsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*PermissionsMutation) EdgeCleared

func (m *PermissionsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PermissionsMutation) Field

func (m *PermissionsMutation) 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 (*PermissionsMutation) FieldCleared

func (m *PermissionsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PermissionsMutation) Fields

func (m *PermissionsMutation) 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 (*PermissionsMutation) ID

func (m *PermissionsMutation) 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 (*PermissionsMutation) IDs

func (m *PermissionsMutation) 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 (*PermissionsMutation) LionResourcesCleared

func (m *PermissionsMutation) LionResourcesCleared() bool

LionResourcesCleared reports if the "lion_resources" edge to the Resources entity was cleared.

func (*PermissionsMutation) LionResourcesID

func (m *PermissionsMutation) LionResourcesID() (id int, exists bool)

LionResourcesID returns the "lion_resources" edge ID in the mutation.

func (*PermissionsMutation) LionResourcesIDs

func (m *PermissionsMutation) LionResourcesIDs() (ids []int)

LionResourcesIDs returns the "lion_resources" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionResourcesID instead. It exists only for internal usage by the builders.

func (*PermissionsMutation) LionRolePermissionsCleared

func (m *PermissionsMutation) LionRolePermissionsCleared() bool

LionRolePermissionsCleared reports if the "lion_role_permissions" edge to the RolePermissions entity was cleared.

func (*PermissionsMutation) LionRolePermissionsIDs

func (m *PermissionsMutation) LionRolePermissionsIDs() (ids []int)

LionRolePermissionsIDs returns the "lion_role_permissions" edge IDs in the mutation.

func (*PermissionsMutation) OldCreatedAt

func (m *PermissionsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Permissions entity. If the Permissions 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 (*PermissionsMutation) OldCreatedBy

func (m *PermissionsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Permissions entity. If the Permissions 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 (*PermissionsMutation) OldField

func (m *PermissionsMutation) 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 (*PermissionsMutation) OldResourceID

func (m *PermissionsMutation) OldResourceID(ctx context.Context) (v int, err error)

OldResourceID returns the old "resource_id" field's value of the Permissions entity. If the Permissions 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 (*PermissionsMutation) OldUpdatedAt

func (m *PermissionsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Permissions entity. If the Permissions 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 (*PermissionsMutation) OldUpdatedBy

func (m *PermissionsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Permissions entity. If the Permissions 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 (*PermissionsMutation) Op

func (m *PermissionsMutation) Op() Op

Op returns the operation name.

func (*PermissionsMutation) RemoveLionRolePermissionIDs

func (m *PermissionsMutation) RemoveLionRolePermissionIDs(ids ...int)

RemoveLionRolePermissionIDs removes the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*PermissionsMutation) RemovedEdges

func (m *PermissionsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PermissionsMutation) RemovedIDs

func (m *PermissionsMutation) 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 (*PermissionsMutation) RemovedLionRolePermissionsIDs

func (m *PermissionsMutation) RemovedLionRolePermissionsIDs() (ids []int)

RemovedLionRolePermissions returns the removed IDs of the "lion_role_permissions" edge to the RolePermissions entity.

func (*PermissionsMutation) ResetCreatedAt

func (m *PermissionsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PermissionsMutation) ResetCreatedBy

func (m *PermissionsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*PermissionsMutation) ResetEdge

func (m *PermissionsMutation) 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 (*PermissionsMutation) ResetField

func (m *PermissionsMutation) 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 (*PermissionsMutation) ResetLionResources

func (m *PermissionsMutation) ResetLionResources()

ResetLionResources resets all changes to the "lion_resources" edge.

func (*PermissionsMutation) ResetLionRolePermissions

func (m *PermissionsMutation) ResetLionRolePermissions()

ResetLionRolePermissions resets all changes to the "lion_role_permissions" edge.

func (*PermissionsMutation) ResetResourceID

func (m *PermissionsMutation) ResetResourceID()

ResetResourceID resets all changes to the "resource_id" field.

func (*PermissionsMutation) ResetUpdatedAt

func (m *PermissionsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PermissionsMutation) ResetUpdatedBy

func (m *PermissionsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*PermissionsMutation) ResourceID

func (m *PermissionsMutation) ResourceID() (r int, exists bool)

ResourceID returns the value of the "resource_id" field in the mutation.

func (*PermissionsMutation) SetCreatedAt

func (m *PermissionsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PermissionsMutation) SetCreatedBy

func (m *PermissionsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*PermissionsMutation) SetField

func (m *PermissionsMutation) 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 (*PermissionsMutation) SetLionResourcesID

func (m *PermissionsMutation) SetLionResourcesID(id int)

SetLionResourcesID sets the "lion_resources" edge to the Resources entity by id.

func (*PermissionsMutation) SetOp

func (m *PermissionsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PermissionsMutation) SetResourceID

func (m *PermissionsMutation) SetResourceID(i int)

SetResourceID sets the "resource_id" field.

func (*PermissionsMutation) SetUpdatedAt

func (m *PermissionsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PermissionsMutation) SetUpdatedBy

func (m *PermissionsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (PermissionsMutation) Tx

func (m PermissionsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PermissionsMutation) Type

func (m *PermissionsMutation) Type() string

Type returns the node type of this mutation (Permissions).

func (*PermissionsMutation) UpdatedAt

func (m *PermissionsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PermissionsMutation) UpdatedBy

func (m *PermissionsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*PermissionsMutation) UpdatedByCleared

func (m *PermissionsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*PermissionsMutation) Where

func (m *PermissionsMutation) Where(ps ...predicate.Permissions)

Where appends a list predicates to the PermissionsMutation builder.

func (*PermissionsMutation) WhereP

func (m *PermissionsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PermissionsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PermissionsQuery

type PermissionsQuery struct {
	// contains filtered or unexported fields
}

PermissionsQuery is the builder for querying Permissions entities.

func (*PermissionsQuery) Aggregate

func (_q *PermissionsQuery) Aggregate(fns ...AggregateFunc) *PermissionsSelect

Aggregate returns a PermissionsSelect configured with the given aggregations.

func (*PermissionsQuery) All

func (_q *PermissionsQuery) All(ctx context.Context) ([]*Permissions, error)

All executes the query and returns a list of PermissionsSlice.

func (*PermissionsQuery) AllX

func (_q *PermissionsQuery) AllX(ctx context.Context) []*Permissions

AllX is like All, but panics if an error occurs.

func (*PermissionsQuery) Clone

func (_q *PermissionsQuery) Clone() *PermissionsQuery

Clone returns a duplicate of the PermissionsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PermissionsQuery) Count

func (_q *PermissionsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PermissionsQuery) CountX

func (_q *PermissionsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PermissionsQuery) Exist

func (_q *PermissionsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PermissionsQuery) ExistX

func (_q *PermissionsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PermissionsQuery) First

func (_q *PermissionsQuery) First(ctx context.Context) (*Permissions, error)

First returns the first Permissions entity from the query. Returns a *NotFoundError when no Permissions was found.

func (*PermissionsQuery) FirstID

func (_q *PermissionsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Permissions ID from the query. Returns a *NotFoundError when no Permissions ID was found.

func (*PermissionsQuery) FirstIDX

func (_q *PermissionsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PermissionsQuery) FirstX

func (_q *PermissionsQuery) FirstX(ctx context.Context) *Permissions

FirstX is like First, but panics if an error occurs.

func (*PermissionsQuery) GroupBy

func (_q *PermissionsQuery) GroupBy(field string, fields ...string) *PermissionsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Permissions.Query().
	GroupBy(permissions.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*PermissionsQuery) IDs

func (_q *PermissionsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Permissions IDs.

func (*PermissionsQuery) IDsX

func (_q *PermissionsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PermissionsQuery) Limit

func (_q *PermissionsQuery) Limit(limit int) *PermissionsQuery

Limit the number of records to be returned by this query.

func (*PermissionsQuery) Offset

func (_q *PermissionsQuery) Offset(offset int) *PermissionsQuery

Offset to start from.

func (*PermissionsQuery) Only

func (_q *PermissionsQuery) Only(ctx context.Context) (*Permissions, error)

Only returns a single Permissions entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Permissions entity is found. Returns a *NotFoundError when no Permissions entities are found.

func (*PermissionsQuery) OnlyID

func (_q *PermissionsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Permissions ID in the query. Returns a *NotSingularError when more than one Permissions ID is found. Returns a *NotFoundError when no entities are found.

func (*PermissionsQuery) OnlyIDX

func (_q *PermissionsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PermissionsQuery) OnlyX

func (_q *PermissionsQuery) OnlyX(ctx context.Context) *Permissions

OnlyX is like Only, but panics if an error occurs.

func (*PermissionsQuery) Order

Order specifies how the records should be ordered.

func (*PermissionsQuery) QueryLionResources

func (_q *PermissionsQuery) QueryLionResources() *ResourcesQuery

QueryLionResources chains the current query on the "lion_resources" edge.

func (*PermissionsQuery) QueryLionRolePermissions

func (_q *PermissionsQuery) QueryLionRolePermissions() *RolePermissionsQuery

QueryLionRolePermissions chains the current query on the "lion_role_permissions" edge.

func (*PermissionsQuery) Select

func (_q *PermissionsQuery) Select(fields ...string) *PermissionsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Permissions.Query().
	Select(permissions.FieldCreatedAt).
	Scan(ctx, &v)

func (*PermissionsQuery) Unique

func (_q *PermissionsQuery) Unique(unique bool) *PermissionsQuery

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 (*PermissionsQuery) Where

Where adds a new predicate for the PermissionsQuery builder.

func (*PermissionsQuery) WithLionResources

func (_q *PermissionsQuery) WithLionResources(opts ...func(*ResourcesQuery)) *PermissionsQuery

WithLionResources tells the query-builder to eager-load the nodes that are connected to the "lion_resources" edge. The optional arguments are used to configure the query builder of the edge.

func (*PermissionsQuery) WithLionRolePermissions

func (_q *PermissionsQuery) WithLionRolePermissions(opts ...func(*RolePermissionsQuery)) *PermissionsQuery

WithLionRolePermissions tells the query-builder to eager-load the nodes that are connected to the "lion_role_permissions" edge. The optional arguments are used to configure the query builder of the edge.

type PermissionsSelect

type PermissionsSelect struct {
	*PermissionsQuery
	// contains filtered or unexported fields
}

PermissionsSelect is the builder for selecting fields of Permissions entities.

func (*PermissionsSelect) Aggregate

func (_s *PermissionsSelect) Aggregate(fns ...AggregateFunc) *PermissionsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PermissionsSelect) Bool

func (s *PermissionsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) BoolX

func (s *PermissionsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PermissionsSelect) Bools

func (s *PermissionsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) BoolsX

func (s *PermissionsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PermissionsSelect) Float64

func (s *PermissionsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) Float64X

func (s *PermissionsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PermissionsSelect) Float64s

func (s *PermissionsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) Float64sX

func (s *PermissionsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PermissionsSelect) Int

func (s *PermissionsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) IntX

func (s *PermissionsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PermissionsSelect) Ints

func (s *PermissionsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) IntsX

func (s *PermissionsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PermissionsSelect) Scan

func (_s *PermissionsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PermissionsSelect) ScanX

func (s *PermissionsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PermissionsSelect) String

func (s *PermissionsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) StringX

func (s *PermissionsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PermissionsSelect) Strings

func (s *PermissionsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PermissionsSelect) StringsX

func (s *PermissionsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PermissionsSlice

type PermissionsSlice []*Permissions

PermissionsSlice is a parsable slice of Permissions.

type PermissionsUpdate

type PermissionsUpdate struct {
	// contains filtered or unexported fields
}

PermissionsUpdate is the builder for updating Permissions entities.

func (*PermissionsUpdate) AddCreatedBy

func (_u *PermissionsUpdate) AddCreatedBy(v int64) *PermissionsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*PermissionsUpdate) AddLionRolePermissionIDs

func (_u *PermissionsUpdate) AddLionRolePermissionIDs(ids ...int) *PermissionsUpdate

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*PermissionsUpdate) AddLionRolePermissions

func (_u *PermissionsUpdate) AddLionRolePermissions(v ...*RolePermissions) *PermissionsUpdate

AddLionRolePermissions adds the "lion_role_permissions" edges to the RolePermissions entity.

func (*PermissionsUpdate) AddUpdatedBy

func (_u *PermissionsUpdate) AddUpdatedBy(v int64) *PermissionsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*PermissionsUpdate) ClearCreatedBy

func (_u *PermissionsUpdate) ClearCreatedBy() *PermissionsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*PermissionsUpdate) ClearLionResources

func (_u *PermissionsUpdate) ClearLionResources() *PermissionsUpdate

ClearLionResources clears the "lion_resources" edge to the Resources entity.

func (*PermissionsUpdate) ClearLionRolePermissions

func (_u *PermissionsUpdate) ClearLionRolePermissions() *PermissionsUpdate

ClearLionRolePermissions clears all "lion_role_permissions" edges to the RolePermissions entity.

func (*PermissionsUpdate) ClearUpdatedBy

func (_u *PermissionsUpdate) ClearUpdatedBy() *PermissionsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PermissionsUpdate) Exec

func (_u *PermissionsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PermissionsUpdate) ExecX

func (_u *PermissionsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PermissionsUpdate) Mutation

func (_u *PermissionsUpdate) Mutation() *PermissionsMutation

Mutation returns the PermissionsMutation object of the builder.

func (*PermissionsUpdate) RemoveLionRolePermissionIDs

func (_u *PermissionsUpdate) RemoveLionRolePermissionIDs(ids ...int) *PermissionsUpdate

RemoveLionRolePermissionIDs removes the "lion_role_permissions" edge to RolePermissions entities by IDs.

func (*PermissionsUpdate) RemoveLionRolePermissions

func (_u *PermissionsUpdate) RemoveLionRolePermissions(v ...*RolePermissions) *PermissionsUpdate

RemoveLionRolePermissions removes "lion_role_permissions" edges to RolePermissions entities.

func (*PermissionsUpdate) Save

func (_u *PermissionsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PermissionsUpdate) SaveX

func (_u *PermissionsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PermissionsUpdate) SetCreatedBy

func (_u *PermissionsUpdate) SetCreatedBy(v int64) *PermissionsUpdate

SetCreatedBy sets the "created_by" field.

func (*PermissionsUpdate) SetLionResources

func (_u *PermissionsUpdate) SetLionResources(v *Resources) *PermissionsUpdate

SetLionResources sets the "lion_resources" edge to the Resources entity.

func (*PermissionsUpdate) SetLionResourcesID

func (_u *PermissionsUpdate) SetLionResourcesID(id int) *PermissionsUpdate

SetLionResourcesID sets the "lion_resources" edge to the Resources entity by ID.

func (*PermissionsUpdate) SetNillableCreatedBy

func (_u *PermissionsUpdate) SetNillableCreatedBy(v *int64) *PermissionsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PermissionsUpdate) SetNillableResourceID

func (_u *PermissionsUpdate) SetNillableResourceID(v *int) *PermissionsUpdate

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*PermissionsUpdate) SetNillableUpdatedBy

func (_u *PermissionsUpdate) SetNillableUpdatedBy(v *int64) *PermissionsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PermissionsUpdate) SetResourceID

func (_u *PermissionsUpdate) SetResourceID(v int) *PermissionsUpdate

SetResourceID sets the "resource_id" field.

func (*PermissionsUpdate) SetUpdatedAt

func (_u *PermissionsUpdate) SetUpdatedAt(v time.Time) *PermissionsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PermissionsUpdate) SetUpdatedBy

func (_u *PermissionsUpdate) SetUpdatedBy(v int64) *PermissionsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*PermissionsUpdate) Where

Where appends a list predicates to the PermissionsUpdate builder.

type PermissionsUpdateOne

type PermissionsUpdateOne struct {
	// contains filtered or unexported fields
}

PermissionsUpdateOne is the builder for updating a single Permissions entity.

func (*PermissionsUpdateOne) AddCreatedBy

func (_u *PermissionsUpdateOne) AddCreatedBy(v int64) *PermissionsUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*PermissionsUpdateOne) AddLionRolePermissionIDs

func (_u *PermissionsUpdateOne) AddLionRolePermissionIDs(ids ...int) *PermissionsUpdateOne

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*PermissionsUpdateOne) AddLionRolePermissions

func (_u *PermissionsUpdateOne) AddLionRolePermissions(v ...*RolePermissions) *PermissionsUpdateOne

AddLionRolePermissions adds the "lion_role_permissions" edges to the RolePermissions entity.

func (*PermissionsUpdateOne) AddUpdatedBy

func (_u *PermissionsUpdateOne) AddUpdatedBy(v int64) *PermissionsUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*PermissionsUpdateOne) ClearCreatedBy

func (_u *PermissionsUpdateOne) ClearCreatedBy() *PermissionsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*PermissionsUpdateOne) ClearLionResources

func (_u *PermissionsUpdateOne) ClearLionResources() *PermissionsUpdateOne

ClearLionResources clears the "lion_resources" edge to the Resources entity.

func (*PermissionsUpdateOne) ClearLionRolePermissions

func (_u *PermissionsUpdateOne) ClearLionRolePermissions() *PermissionsUpdateOne

ClearLionRolePermissions clears all "lion_role_permissions" edges to the RolePermissions entity.

func (*PermissionsUpdateOne) ClearUpdatedBy

func (_u *PermissionsUpdateOne) ClearUpdatedBy() *PermissionsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PermissionsUpdateOne) Exec

func (_u *PermissionsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PermissionsUpdateOne) ExecX

func (_u *PermissionsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PermissionsUpdateOne) Mutation

func (_u *PermissionsUpdateOne) Mutation() *PermissionsMutation

Mutation returns the PermissionsMutation object of the builder.

func (*PermissionsUpdateOne) RemoveLionRolePermissionIDs

func (_u *PermissionsUpdateOne) RemoveLionRolePermissionIDs(ids ...int) *PermissionsUpdateOne

RemoveLionRolePermissionIDs removes the "lion_role_permissions" edge to RolePermissions entities by IDs.

func (*PermissionsUpdateOne) RemoveLionRolePermissions

func (_u *PermissionsUpdateOne) RemoveLionRolePermissions(v ...*RolePermissions) *PermissionsUpdateOne

RemoveLionRolePermissions removes "lion_role_permissions" edges to RolePermissions entities.

func (*PermissionsUpdateOne) Save

Save executes the query and returns the updated Permissions entity.

func (*PermissionsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PermissionsUpdateOne) Select

func (_u *PermissionsUpdateOne) Select(field string, fields ...string) *PermissionsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PermissionsUpdateOne) SetCreatedBy

func (_u *PermissionsUpdateOne) SetCreatedBy(v int64) *PermissionsUpdateOne

SetCreatedBy sets the "created_by" field.

func (*PermissionsUpdateOne) SetLionResources

func (_u *PermissionsUpdateOne) SetLionResources(v *Resources) *PermissionsUpdateOne

SetLionResources sets the "lion_resources" edge to the Resources entity.

func (*PermissionsUpdateOne) SetLionResourcesID

func (_u *PermissionsUpdateOne) SetLionResourcesID(id int) *PermissionsUpdateOne

SetLionResourcesID sets the "lion_resources" edge to the Resources entity by ID.

func (*PermissionsUpdateOne) SetNillableCreatedBy

func (_u *PermissionsUpdateOne) SetNillableCreatedBy(v *int64) *PermissionsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PermissionsUpdateOne) SetNillableResourceID

func (_u *PermissionsUpdateOne) SetNillableResourceID(v *int) *PermissionsUpdateOne

SetNillableResourceID sets the "resource_id" field if the given value is not nil.

func (*PermissionsUpdateOne) SetNillableUpdatedBy

func (_u *PermissionsUpdateOne) SetNillableUpdatedBy(v *int64) *PermissionsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PermissionsUpdateOne) SetResourceID

func (_u *PermissionsUpdateOne) SetResourceID(v int) *PermissionsUpdateOne

SetResourceID sets the "resource_id" field.

func (*PermissionsUpdateOne) SetUpdatedAt

func (_u *PermissionsUpdateOne) SetUpdatedAt(v time.Time) *PermissionsUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PermissionsUpdateOne) SetUpdatedBy

func (_u *PermissionsUpdateOne) SetUpdatedBy(v int64) *PermissionsUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*PermissionsUpdateOne) Where

Where appends a list predicates to the PermissionsUpdate builder.

type Policies

type Policies struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

Policies is the model entity for the Policies schema.

func (*Policies) String

func (_m *Policies) String() string

String implements the fmt.Stringer.

func (*Policies) Unwrap

func (_m *Policies) Unwrap() *Policies

Unwrap unwraps the Policies 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 (*Policies) Update

func (_m *Policies) Update() *PoliciesUpdateOne

Update returns a builder for updating this Policies. Note that you need to call Policies.Unwrap() before calling this method if this Policies was returned from a transaction, and the transaction was committed or rolled back.

func (*Policies) Value

func (_m *Policies) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Policies. This includes values selected through modifiers, order, etc.

type PoliciesClient

type PoliciesClient struct {
	// contains filtered or unexported fields
}

PoliciesClient is a client for the Policies schema.

func NewPoliciesClient

func NewPoliciesClient(c config) *PoliciesClient

NewPoliciesClient returns a client for the Policies from the given config.

func (*PoliciesClient) Create

func (c *PoliciesClient) Create() *PoliciesCreate

Create returns a builder for creating a Policies entity.

func (*PoliciesClient) CreateBulk

func (c *PoliciesClient) CreateBulk(builders ...*PoliciesCreate) *PoliciesCreateBulk

CreateBulk returns a builder for creating a bulk of Policies entities.

func (*PoliciesClient) Delete

func (c *PoliciesClient) Delete() *PoliciesDelete

Delete returns a delete builder for Policies.

func (*PoliciesClient) DeleteOne

func (c *PoliciesClient) DeleteOne(_m *Policies) *PoliciesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PoliciesClient) DeleteOneID

func (c *PoliciesClient) DeleteOneID(id int) *PoliciesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PoliciesClient) Get

func (c *PoliciesClient) Get(ctx context.Context, id int) (*Policies, error)

Get returns a Policies entity by its id.

func (*PoliciesClient) GetX

func (c *PoliciesClient) GetX(ctx context.Context, id int) *Policies

GetX is like Get, but panics if an error occurs.

func (*PoliciesClient) Hooks

func (c *PoliciesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PoliciesClient) Intercept

func (c *PoliciesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `policies.Intercept(f(g(h())))`.

func (*PoliciesClient) Interceptors

func (c *PoliciesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PoliciesClient) MapCreateBulk

func (c *PoliciesClient) MapCreateBulk(slice any, setFunc func(*PoliciesCreate, int)) *PoliciesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PoliciesClient) Query

func (c *PoliciesClient) Query() *PoliciesQuery

Query returns a query builder for Policies.

func (*PoliciesClient) Update

func (c *PoliciesClient) Update() *PoliciesUpdate

Update returns an update builder for Policies.

func (*PoliciesClient) UpdateOne

func (c *PoliciesClient) UpdateOne(_m *Policies) *PoliciesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PoliciesClient) UpdateOneID

func (c *PoliciesClient) UpdateOneID(id int) *PoliciesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PoliciesClient) Use

func (c *PoliciesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `policies.Hooks(f(g(h())))`.

type PoliciesCreate

type PoliciesCreate struct {
	// contains filtered or unexported fields
}

PoliciesCreate is the builder for creating a Policies entity.

func (*PoliciesCreate) Exec

func (_c *PoliciesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PoliciesCreate) ExecX

func (_c *PoliciesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PoliciesCreate) Mutation

func (_c *PoliciesCreate) Mutation() *PoliciesMutation

Mutation returns the PoliciesMutation object of the builder.

func (*PoliciesCreate) Save

func (_c *PoliciesCreate) Save(ctx context.Context) (*Policies, error)

Save creates the Policies in the database.

func (*PoliciesCreate) SaveX

func (_c *PoliciesCreate) SaveX(ctx context.Context) *Policies

SaveX calls Save and panics if Save returns an error.

func (*PoliciesCreate) SetCreatedAt

func (_c *PoliciesCreate) SetCreatedAt(v time.Time) *PoliciesCreate

SetCreatedAt sets the "created_at" field.

func (*PoliciesCreate) SetCreatedBy

func (_c *PoliciesCreate) SetCreatedBy(v int64) *PoliciesCreate

SetCreatedBy sets the "created_by" field.

func (*PoliciesCreate) SetDeletedAt

func (_c *PoliciesCreate) SetDeletedAt(v time.Time) *PoliciesCreate

SetDeletedAt sets the "deleted_at" field.

func (*PoliciesCreate) SetName

func (_c *PoliciesCreate) SetName(v string) *PoliciesCreate

SetName sets the "name" field.

func (*PoliciesCreate) SetNillableCreatedAt

func (_c *PoliciesCreate) SetNillableCreatedAt(v *time.Time) *PoliciesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PoliciesCreate) SetNillableCreatedBy

func (_c *PoliciesCreate) SetNillableCreatedBy(v *int64) *PoliciesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PoliciesCreate) SetNillableDeletedAt

func (_c *PoliciesCreate) SetNillableDeletedAt(v *time.Time) *PoliciesCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PoliciesCreate) SetNillableName

func (_c *PoliciesCreate) SetNillableName(v *string) *PoliciesCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*PoliciesCreate) SetNillableUpdatedAt

func (_c *PoliciesCreate) SetNillableUpdatedAt(v *time.Time) *PoliciesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PoliciesCreate) SetNillableUpdatedBy

func (_c *PoliciesCreate) SetNillableUpdatedBy(v *int64) *PoliciesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PoliciesCreate) SetUpdatedAt

func (_c *PoliciesCreate) SetUpdatedAt(v time.Time) *PoliciesCreate

SetUpdatedAt sets the "updated_at" field.

func (*PoliciesCreate) SetUpdatedBy

func (_c *PoliciesCreate) SetUpdatedBy(v int64) *PoliciesCreate

SetUpdatedBy sets the "updated_by" field.

type PoliciesCreateBulk

type PoliciesCreateBulk struct {
	// contains filtered or unexported fields
}

PoliciesCreateBulk is the builder for creating many Policies entities in bulk.

func (*PoliciesCreateBulk) Exec

func (_c *PoliciesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PoliciesCreateBulk) ExecX

func (_c *PoliciesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PoliciesCreateBulk) Save

func (_c *PoliciesCreateBulk) Save(ctx context.Context) ([]*Policies, error)

Save creates the Policies entities in the database.

func (*PoliciesCreateBulk) SaveX

func (_c *PoliciesCreateBulk) SaveX(ctx context.Context) []*Policies

SaveX is like Save, but panics if an error occurs.

type PoliciesDelete

type PoliciesDelete struct {
	// contains filtered or unexported fields
}

PoliciesDelete is the builder for deleting a Policies entity.

func (*PoliciesDelete) Exec

func (_d *PoliciesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PoliciesDelete) ExecX

func (_d *PoliciesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PoliciesDelete) Where

func (_d *PoliciesDelete) Where(ps ...predicate.Policies) *PoliciesDelete

Where appends a list predicates to the PoliciesDelete builder.

type PoliciesDeleteOne

type PoliciesDeleteOne struct {
	// contains filtered or unexported fields
}

PoliciesDeleteOne is the builder for deleting a single Policies entity.

func (*PoliciesDeleteOne) Exec

func (_d *PoliciesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PoliciesDeleteOne) ExecX

func (_d *PoliciesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PoliciesDeleteOne) Where

Where appends a list predicates to the PoliciesDelete builder.

type PoliciesGroupBy

type PoliciesGroupBy struct {
	// contains filtered or unexported fields
}

PoliciesGroupBy is the group-by builder for Policies entities.

func (*PoliciesGroupBy) Aggregate

func (_g *PoliciesGroupBy) Aggregate(fns ...AggregateFunc) *PoliciesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PoliciesGroupBy) Bool

func (s *PoliciesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) BoolX

func (s *PoliciesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PoliciesGroupBy) Bools

func (s *PoliciesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) BoolsX

func (s *PoliciesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PoliciesGroupBy) Float64

func (s *PoliciesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) Float64X

func (s *PoliciesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PoliciesGroupBy) Float64s

func (s *PoliciesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) Float64sX

func (s *PoliciesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PoliciesGroupBy) Int

func (s *PoliciesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) IntX

func (s *PoliciesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PoliciesGroupBy) Ints

func (s *PoliciesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) IntsX

func (s *PoliciesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PoliciesGroupBy) Scan

func (_g *PoliciesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PoliciesGroupBy) ScanX

func (s *PoliciesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PoliciesGroupBy) String

func (s *PoliciesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) StringX

func (s *PoliciesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PoliciesGroupBy) Strings

func (s *PoliciesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PoliciesGroupBy) StringsX

func (s *PoliciesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PoliciesMutation

type PoliciesMutation struct {
	// contains filtered or unexported fields
}

PoliciesMutation represents an operation that mutates the Policies nodes in the graph.

func (*PoliciesMutation) AddCreatedBy

func (m *PoliciesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*PoliciesMutation) AddField

func (m *PoliciesMutation) 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 (*PoliciesMutation) AddUpdatedBy

func (m *PoliciesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*PoliciesMutation) AddedCreatedBy

func (m *PoliciesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*PoliciesMutation) AddedEdges

func (m *PoliciesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PoliciesMutation) AddedField

func (m *PoliciesMutation) 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 (*PoliciesMutation) AddedFields

func (m *PoliciesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PoliciesMutation) AddedIDs

func (m *PoliciesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PoliciesMutation) AddedUpdatedBy

func (m *PoliciesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*PoliciesMutation) ClearCreatedBy

func (m *PoliciesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*PoliciesMutation) ClearDeletedAt

func (m *PoliciesMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PoliciesMutation) ClearEdge

func (m *PoliciesMutation) 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 (*PoliciesMutation) ClearField

func (m *PoliciesMutation) 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 (*PoliciesMutation) ClearUpdatedBy

func (m *PoliciesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PoliciesMutation) ClearedEdges

func (m *PoliciesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PoliciesMutation) ClearedFields

func (m *PoliciesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PoliciesMutation) Client

func (m PoliciesMutation) 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 (*PoliciesMutation) CreatedAt

func (m *PoliciesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PoliciesMutation) CreatedBy

func (m *PoliciesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*PoliciesMutation) CreatedByCleared

func (m *PoliciesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*PoliciesMutation) DeletedAt

func (m *PoliciesMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PoliciesMutation) DeletedAtCleared

func (m *PoliciesMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PoliciesMutation) EdgeCleared

func (m *PoliciesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PoliciesMutation) Field

func (m *PoliciesMutation) 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 (*PoliciesMutation) FieldCleared

func (m *PoliciesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PoliciesMutation) Fields

func (m *PoliciesMutation) 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 (*PoliciesMutation) ID

func (m *PoliciesMutation) 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 (*PoliciesMutation) IDs

func (m *PoliciesMutation) 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 (*PoliciesMutation) Name

func (m *PoliciesMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PoliciesMutation) OldCreatedAt

func (m *PoliciesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Policies entity. If the Policies 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 (*PoliciesMutation) OldCreatedBy

func (m *PoliciesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Policies entity. If the Policies 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 (*PoliciesMutation) OldDeletedAt

func (m *PoliciesMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Policies entity. If the Policies 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 (*PoliciesMutation) OldField

func (m *PoliciesMutation) 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 (*PoliciesMutation) OldName

func (m *PoliciesMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Policies entity. If the Policies 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 (*PoliciesMutation) OldUpdatedAt

func (m *PoliciesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Policies entity. If the Policies 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 (*PoliciesMutation) OldUpdatedBy

func (m *PoliciesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Policies entity. If the Policies 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 (*PoliciesMutation) Op

func (m *PoliciesMutation) Op() Op

Op returns the operation name.

func (*PoliciesMutation) RemovedEdges

func (m *PoliciesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PoliciesMutation) RemovedIDs

func (m *PoliciesMutation) 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 (*PoliciesMutation) ResetCreatedAt

func (m *PoliciesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PoliciesMutation) ResetCreatedBy

func (m *PoliciesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*PoliciesMutation) ResetDeletedAt

func (m *PoliciesMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PoliciesMutation) ResetEdge

func (m *PoliciesMutation) 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 (*PoliciesMutation) ResetField

func (m *PoliciesMutation) 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 (*PoliciesMutation) ResetName

func (m *PoliciesMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PoliciesMutation) ResetUpdatedAt

func (m *PoliciesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PoliciesMutation) ResetUpdatedBy

func (m *PoliciesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*PoliciesMutation) SetCreatedAt

func (m *PoliciesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PoliciesMutation) SetCreatedBy

func (m *PoliciesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*PoliciesMutation) SetDeletedAt

func (m *PoliciesMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PoliciesMutation) SetField

func (m *PoliciesMutation) 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 (*PoliciesMutation) SetName

func (m *PoliciesMutation) SetName(s string)

SetName sets the "name" field.

func (*PoliciesMutation) SetOp

func (m *PoliciesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PoliciesMutation) SetUpdatedAt

func (m *PoliciesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PoliciesMutation) SetUpdatedBy

func (m *PoliciesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (PoliciesMutation) Tx

func (m PoliciesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PoliciesMutation) Type

func (m *PoliciesMutation) Type() string

Type returns the node type of this mutation (Policies).

func (*PoliciesMutation) UpdatedAt

func (m *PoliciesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PoliciesMutation) UpdatedBy

func (m *PoliciesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*PoliciesMutation) UpdatedByCleared

func (m *PoliciesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*PoliciesMutation) Where

func (m *PoliciesMutation) Where(ps ...predicate.Policies)

Where appends a list predicates to the PoliciesMutation builder.

func (*PoliciesMutation) WhereP

func (m *PoliciesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PoliciesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PoliciesQuery

type PoliciesQuery struct {
	// contains filtered or unexported fields
}

PoliciesQuery is the builder for querying Policies entities.

func (*PoliciesQuery) Aggregate

func (_q *PoliciesQuery) Aggregate(fns ...AggregateFunc) *PoliciesSelect

Aggregate returns a PoliciesSelect configured with the given aggregations.

func (*PoliciesQuery) All

func (_q *PoliciesQuery) All(ctx context.Context) ([]*Policies, error)

All executes the query and returns a list of PoliciesSlice.

func (*PoliciesQuery) AllX

func (_q *PoliciesQuery) AllX(ctx context.Context) []*Policies

AllX is like All, but panics if an error occurs.

func (*PoliciesQuery) Clone

func (_q *PoliciesQuery) Clone() *PoliciesQuery

Clone returns a duplicate of the PoliciesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PoliciesQuery) Count

func (_q *PoliciesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PoliciesQuery) CountX

func (_q *PoliciesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PoliciesQuery) Exist

func (_q *PoliciesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PoliciesQuery) ExistX

func (_q *PoliciesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PoliciesQuery) First

func (_q *PoliciesQuery) First(ctx context.Context) (*Policies, error)

First returns the first Policies entity from the query. Returns a *NotFoundError when no Policies was found.

func (*PoliciesQuery) FirstID

func (_q *PoliciesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Policies ID from the query. Returns a *NotFoundError when no Policies ID was found.

func (*PoliciesQuery) FirstIDX

func (_q *PoliciesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PoliciesQuery) FirstX

func (_q *PoliciesQuery) FirstX(ctx context.Context) *Policies

FirstX is like First, but panics if an error occurs.

func (*PoliciesQuery) GroupBy

func (_q *PoliciesQuery) GroupBy(field string, fields ...string) *PoliciesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Policies.Query().
	GroupBy(policies.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*PoliciesQuery) IDs

func (_q *PoliciesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Policies IDs.

func (*PoliciesQuery) IDsX

func (_q *PoliciesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PoliciesQuery) Limit

func (_q *PoliciesQuery) Limit(limit int) *PoliciesQuery

Limit the number of records to be returned by this query.

func (*PoliciesQuery) Offset

func (_q *PoliciesQuery) Offset(offset int) *PoliciesQuery

Offset to start from.

func (*PoliciesQuery) Only

func (_q *PoliciesQuery) Only(ctx context.Context) (*Policies, error)

Only returns a single Policies entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Policies entity is found. Returns a *NotFoundError when no Policies entities are found.

func (*PoliciesQuery) OnlyID

func (_q *PoliciesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Policies ID in the query. Returns a *NotSingularError when more than one Policies ID is found. Returns a *NotFoundError when no entities are found.

func (*PoliciesQuery) OnlyIDX

func (_q *PoliciesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PoliciesQuery) OnlyX

func (_q *PoliciesQuery) OnlyX(ctx context.Context) *Policies

OnlyX is like Only, but panics if an error occurs.

func (*PoliciesQuery) Order

Order specifies how the records should be ordered.

func (*PoliciesQuery) Select

func (_q *PoliciesQuery) Select(fields ...string) *PoliciesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Policies.Query().
	Select(policies.FieldCreatedAt).
	Scan(ctx, &v)

func (*PoliciesQuery) Unique

func (_q *PoliciesQuery) Unique(unique bool) *PoliciesQuery

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 (*PoliciesQuery) Where

func (_q *PoliciesQuery) Where(ps ...predicate.Policies) *PoliciesQuery

Where adds a new predicate for the PoliciesQuery builder.

type PoliciesSelect

type PoliciesSelect struct {
	*PoliciesQuery
	// contains filtered or unexported fields
}

PoliciesSelect is the builder for selecting fields of Policies entities.

func (*PoliciesSelect) Aggregate

func (_s *PoliciesSelect) Aggregate(fns ...AggregateFunc) *PoliciesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PoliciesSelect) Bool

func (s *PoliciesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) BoolX

func (s *PoliciesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PoliciesSelect) Bools

func (s *PoliciesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) BoolsX

func (s *PoliciesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PoliciesSelect) Float64

func (s *PoliciesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) Float64X

func (s *PoliciesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PoliciesSelect) Float64s

func (s *PoliciesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) Float64sX

func (s *PoliciesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PoliciesSelect) Int

func (s *PoliciesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) IntX

func (s *PoliciesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PoliciesSelect) Ints

func (s *PoliciesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) IntsX

func (s *PoliciesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PoliciesSelect) Scan

func (_s *PoliciesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PoliciesSelect) ScanX

func (s *PoliciesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PoliciesSelect) String

func (s *PoliciesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) StringX

func (s *PoliciesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PoliciesSelect) Strings

func (s *PoliciesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PoliciesSelect) StringsX

func (s *PoliciesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PoliciesSlice

type PoliciesSlice []*Policies

PoliciesSlice is a parsable slice of Policies.

type PoliciesUpdate

type PoliciesUpdate struct {
	// contains filtered or unexported fields
}

PoliciesUpdate is the builder for updating Policies entities.

func (*PoliciesUpdate) AddCreatedBy

func (_u *PoliciesUpdate) AddCreatedBy(v int64) *PoliciesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*PoliciesUpdate) AddUpdatedBy

func (_u *PoliciesUpdate) AddUpdatedBy(v int64) *PoliciesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*PoliciesUpdate) ClearCreatedBy

func (_u *PoliciesUpdate) ClearCreatedBy() *PoliciesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*PoliciesUpdate) ClearDeletedAt

func (_u *PoliciesUpdate) ClearDeletedAt() *PoliciesUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PoliciesUpdate) ClearUpdatedBy

func (_u *PoliciesUpdate) ClearUpdatedBy() *PoliciesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PoliciesUpdate) Exec

func (_u *PoliciesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PoliciesUpdate) ExecX

func (_u *PoliciesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PoliciesUpdate) Mutation

func (_u *PoliciesUpdate) Mutation() *PoliciesMutation

Mutation returns the PoliciesMutation object of the builder.

func (*PoliciesUpdate) Save

func (_u *PoliciesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PoliciesUpdate) SaveX

func (_u *PoliciesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PoliciesUpdate) SetCreatedBy

func (_u *PoliciesUpdate) SetCreatedBy(v int64) *PoliciesUpdate

SetCreatedBy sets the "created_by" field.

func (*PoliciesUpdate) SetDeletedAt

func (_u *PoliciesUpdate) SetDeletedAt(v time.Time) *PoliciesUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PoliciesUpdate) SetName

func (_u *PoliciesUpdate) SetName(v string) *PoliciesUpdate

SetName sets the "name" field.

func (*PoliciesUpdate) SetNillableCreatedBy

func (_u *PoliciesUpdate) SetNillableCreatedBy(v *int64) *PoliciesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PoliciesUpdate) SetNillableDeletedAt

func (_u *PoliciesUpdate) SetNillableDeletedAt(v *time.Time) *PoliciesUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PoliciesUpdate) SetNillableName

func (_u *PoliciesUpdate) SetNillableName(v *string) *PoliciesUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PoliciesUpdate) SetNillableUpdatedBy

func (_u *PoliciesUpdate) SetNillableUpdatedBy(v *int64) *PoliciesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PoliciesUpdate) SetUpdatedAt

func (_u *PoliciesUpdate) SetUpdatedAt(v time.Time) *PoliciesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PoliciesUpdate) SetUpdatedBy

func (_u *PoliciesUpdate) SetUpdatedBy(v int64) *PoliciesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*PoliciesUpdate) Where

func (_u *PoliciesUpdate) Where(ps ...predicate.Policies) *PoliciesUpdate

Where appends a list predicates to the PoliciesUpdate builder.

type PoliciesUpdateOne

type PoliciesUpdateOne struct {
	// contains filtered or unexported fields
}

PoliciesUpdateOne is the builder for updating a single Policies entity.

func (*PoliciesUpdateOne) AddCreatedBy

func (_u *PoliciesUpdateOne) AddCreatedBy(v int64) *PoliciesUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*PoliciesUpdateOne) AddUpdatedBy

func (_u *PoliciesUpdateOne) AddUpdatedBy(v int64) *PoliciesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*PoliciesUpdateOne) ClearCreatedBy

func (_u *PoliciesUpdateOne) ClearCreatedBy() *PoliciesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*PoliciesUpdateOne) ClearDeletedAt

func (_u *PoliciesUpdateOne) ClearDeletedAt() *PoliciesUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PoliciesUpdateOne) ClearUpdatedBy

func (_u *PoliciesUpdateOne) ClearUpdatedBy() *PoliciesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PoliciesUpdateOne) Exec

func (_u *PoliciesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PoliciesUpdateOne) ExecX

func (_u *PoliciesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PoliciesUpdateOne) Mutation

func (_u *PoliciesUpdateOne) Mutation() *PoliciesMutation

Mutation returns the PoliciesMutation object of the builder.

func (*PoliciesUpdateOne) Save

func (_u *PoliciesUpdateOne) Save(ctx context.Context) (*Policies, error)

Save executes the query and returns the updated Policies entity.

func (*PoliciesUpdateOne) SaveX

func (_u *PoliciesUpdateOne) SaveX(ctx context.Context) *Policies

SaveX is like Save, but panics if an error occurs.

func (*PoliciesUpdateOne) Select

func (_u *PoliciesUpdateOne) Select(field string, fields ...string) *PoliciesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PoliciesUpdateOne) SetCreatedBy

func (_u *PoliciesUpdateOne) SetCreatedBy(v int64) *PoliciesUpdateOne

SetCreatedBy sets the "created_by" field.

func (*PoliciesUpdateOne) SetDeletedAt

func (_u *PoliciesUpdateOne) SetDeletedAt(v time.Time) *PoliciesUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PoliciesUpdateOne) SetName

func (_u *PoliciesUpdateOne) SetName(v string) *PoliciesUpdateOne

SetName sets the "name" field.

func (*PoliciesUpdateOne) SetNillableCreatedBy

func (_u *PoliciesUpdateOne) SetNillableCreatedBy(v *int64) *PoliciesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PoliciesUpdateOne) SetNillableDeletedAt

func (_u *PoliciesUpdateOne) SetNillableDeletedAt(v *time.Time) *PoliciesUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PoliciesUpdateOne) SetNillableName

func (_u *PoliciesUpdateOne) SetNillableName(v *string) *PoliciesUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PoliciesUpdateOne) SetNillableUpdatedBy

func (_u *PoliciesUpdateOne) SetNillableUpdatedBy(v *int64) *PoliciesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PoliciesUpdateOne) SetUpdatedAt

func (_u *PoliciesUpdateOne) SetUpdatedAt(v time.Time) *PoliciesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PoliciesUpdateOne) SetUpdatedBy

func (_u *PoliciesUpdateOne) SetUpdatedBy(v int64) *PoliciesUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*PoliciesUpdateOne) Where

Where appends a list predicates to the PoliciesUpdate builder.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Resources

type Resources struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 父资源 ID,为 0 表示顶级资源
	ParentID int `json:"parent_id,omitempty"`
	// 资源名称
	Name string `json:"name,omitempty"`
	// 资源排序顺序,用于同级资源的显示顺序,数值越小排序越靠前,建议使用 10 的倍数便于后续插入,默认值:100,范围:1-9999
	SortOrder int `json:"sort_order,omitempty"`
	// 用途类型,对应 api/known/admin/v1/common.proto 中定义
	ResourceType int `json:"resource_type,omitempty"`
	// 作用范围,对应 api/known/admin/v1/common.proto 中定义
	ResourceScope int `json:"resource_scope,omitempty"`
	// 是否启用该资源项,禁用后完全不可访问
	Enabled bool `json:"enabled,omitempty"`
	// 是否在资源列表中隐藏该节点
	Hidden bool `json:"hidden,omitempty"`
	// 是否隐藏该资源节点的子项
	HideChildren bool `json:"hide_children,omitempty"`
	// 资源路径
	Path string `json:"path,omitempty"`
	// 图标名称,如 UserOutlined
	Icon string `json:"icon,omitempty"`
	// 组件名称,如 UserOutlined
	Component string `json:"component,omitempty"`
	// 详细描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ResourcesQuery when eager-loading is set.
	Edges ResourcesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Resources is the model entity for the Resources schema.

func (*Resources) QueryLionPermissions

func (_m *Resources) QueryLionPermissions() *PermissionsQuery

QueryLionPermissions queries the "lion_permissions" edge of the Resources entity.

func (*Resources) String

func (_m *Resources) String() string

String implements the fmt.Stringer.

func (*Resources) Unwrap

func (_m *Resources) Unwrap() *Resources

Unwrap unwraps the Resources 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 (*Resources) Update

func (_m *Resources) Update() *ResourcesUpdateOne

Update returns a builder for updating this Resources. Note that you need to call Resources.Unwrap() before calling this method if this Resources was returned from a transaction, and the transaction was committed or rolled back.

func (*Resources) Value

func (_m *Resources) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Resources. This includes values selected through modifiers, order, etc.

type ResourcesClient

type ResourcesClient struct {
	// contains filtered or unexported fields
}

ResourcesClient is a client for the Resources schema.

func NewResourcesClient

func NewResourcesClient(c config) *ResourcesClient

NewResourcesClient returns a client for the Resources from the given config.

func (*ResourcesClient) Create

func (c *ResourcesClient) Create() *ResourcesCreate

Create returns a builder for creating a Resources entity.

func (*ResourcesClient) CreateBulk

func (c *ResourcesClient) CreateBulk(builders ...*ResourcesCreate) *ResourcesCreateBulk

CreateBulk returns a builder for creating a bulk of Resources entities.

func (*ResourcesClient) Delete

func (c *ResourcesClient) Delete() *ResourcesDelete

Delete returns a delete builder for Resources.

func (*ResourcesClient) DeleteOne

func (c *ResourcesClient) DeleteOne(_m *Resources) *ResourcesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResourcesClient) DeleteOneID

func (c *ResourcesClient) DeleteOneID(id int) *ResourcesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ResourcesClient) Get

func (c *ResourcesClient) Get(ctx context.Context, id int) (*Resources, error)

Get returns a Resources entity by its id.

func (*ResourcesClient) GetX

func (c *ResourcesClient) GetX(ctx context.Context, id int) *Resources

GetX is like Get, but panics if an error occurs.

func (*ResourcesClient) Hooks

func (c *ResourcesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ResourcesClient) Intercept

func (c *ResourcesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `resources.Intercept(f(g(h())))`.

func (*ResourcesClient) Interceptors

func (c *ResourcesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ResourcesClient) MapCreateBulk

func (c *ResourcesClient) MapCreateBulk(slice any, setFunc func(*ResourcesCreate, int)) *ResourcesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ResourcesClient) Query

func (c *ResourcesClient) Query() *ResourcesQuery

Query returns a query builder for Resources.

func (*ResourcesClient) QueryLionPermissions

func (c *ResourcesClient) QueryLionPermissions(_m *Resources) *PermissionsQuery

QueryLionPermissions queries the lion_permissions edge of a Resources.

func (*ResourcesClient) Update

func (c *ResourcesClient) Update() *ResourcesUpdate

Update returns an update builder for Resources.

func (*ResourcesClient) UpdateOne

func (c *ResourcesClient) UpdateOne(_m *Resources) *ResourcesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResourcesClient) UpdateOneID

func (c *ResourcesClient) UpdateOneID(id int) *ResourcesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResourcesClient) Use

func (c *ResourcesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `resources.Hooks(f(g(h())))`.

type ResourcesCreate

type ResourcesCreate struct {
	// contains filtered or unexported fields
}

ResourcesCreate is the builder for creating a Resources entity.

func (*ResourcesCreate) AddLionPermissionIDs

func (_c *ResourcesCreate) AddLionPermissionIDs(ids ...int) *ResourcesCreate

AddLionPermissionIDs adds the "lion_permissions" edge to the Permissions entity by IDs.

func (*ResourcesCreate) AddLionPermissions

func (_c *ResourcesCreate) AddLionPermissions(v ...*Permissions) *ResourcesCreate

AddLionPermissions adds the "lion_permissions" edges to the Permissions entity.

func (*ResourcesCreate) Exec

func (_c *ResourcesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourcesCreate) ExecX

func (_c *ResourcesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourcesCreate) Mutation

func (_c *ResourcesCreate) Mutation() *ResourcesMutation

Mutation returns the ResourcesMutation object of the builder.

func (*ResourcesCreate) Save

func (_c *ResourcesCreate) Save(ctx context.Context) (*Resources, error)

Save creates the Resources in the database.

func (*ResourcesCreate) SaveX

func (_c *ResourcesCreate) SaveX(ctx context.Context) *Resources

SaveX calls Save and panics if Save returns an error.

func (*ResourcesCreate) SetComponent

func (_c *ResourcesCreate) SetComponent(v string) *ResourcesCreate

SetComponent sets the "component" field.

func (*ResourcesCreate) SetCreatedAt

func (_c *ResourcesCreate) SetCreatedAt(v time.Time) *ResourcesCreate

SetCreatedAt sets the "created_at" field.

func (*ResourcesCreate) SetCreatedBy

func (_c *ResourcesCreate) SetCreatedBy(v int64) *ResourcesCreate

SetCreatedBy sets the "created_by" field.

func (*ResourcesCreate) SetDeletedAt

func (_c *ResourcesCreate) SetDeletedAt(v time.Time) *ResourcesCreate

SetDeletedAt sets the "deleted_at" field.

func (*ResourcesCreate) SetDescription

func (_c *ResourcesCreate) SetDescription(v string) *ResourcesCreate

SetDescription sets the "description" field.

func (*ResourcesCreate) SetEnabled

func (_c *ResourcesCreate) SetEnabled(v bool) *ResourcesCreate

SetEnabled sets the "enabled" field.

func (*ResourcesCreate) SetHidden

func (_c *ResourcesCreate) SetHidden(v bool) *ResourcesCreate

SetHidden sets the "hidden" field.

func (*ResourcesCreate) SetHideChildren

func (_c *ResourcesCreate) SetHideChildren(v bool) *ResourcesCreate

SetHideChildren sets the "hide_children" field.

func (*ResourcesCreate) SetIcon

func (_c *ResourcesCreate) SetIcon(v string) *ResourcesCreate

SetIcon sets the "icon" field.

func (*ResourcesCreate) SetName

func (_c *ResourcesCreate) SetName(v string) *ResourcesCreate

SetName sets the "name" field.

func (*ResourcesCreate) SetNillableComponent

func (_c *ResourcesCreate) SetNillableComponent(v *string) *ResourcesCreate

SetNillableComponent sets the "component" field if the given value is not nil.

func (*ResourcesCreate) SetNillableCreatedAt

func (_c *ResourcesCreate) SetNillableCreatedAt(v *time.Time) *ResourcesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ResourcesCreate) SetNillableCreatedBy

func (_c *ResourcesCreate) SetNillableCreatedBy(v *int64) *ResourcesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ResourcesCreate) SetNillableDeletedAt

func (_c *ResourcesCreate) SetNillableDeletedAt(v *time.Time) *ResourcesCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ResourcesCreate) SetNillableDescription

func (_c *ResourcesCreate) SetNillableDescription(v *string) *ResourcesCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ResourcesCreate) SetNillableEnabled

func (_c *ResourcesCreate) SetNillableEnabled(v *bool) *ResourcesCreate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ResourcesCreate) SetNillableHidden

func (_c *ResourcesCreate) SetNillableHidden(v *bool) *ResourcesCreate

SetNillableHidden sets the "hidden" field if the given value is not nil.

func (*ResourcesCreate) SetNillableHideChildren

func (_c *ResourcesCreate) SetNillableHideChildren(v *bool) *ResourcesCreate

SetNillableHideChildren sets the "hide_children" field if the given value is not nil.

func (*ResourcesCreate) SetNillableIcon

func (_c *ResourcesCreate) SetNillableIcon(v *string) *ResourcesCreate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*ResourcesCreate) SetNillableParentID

func (_c *ResourcesCreate) SetNillableParentID(v *int) *ResourcesCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*ResourcesCreate) SetNillablePath

func (_c *ResourcesCreate) SetNillablePath(v *string) *ResourcesCreate

SetNillablePath sets the "path" field if the given value is not nil.

func (*ResourcesCreate) SetNillableResourceScope

func (_c *ResourcesCreate) SetNillableResourceScope(v *int) *ResourcesCreate

SetNillableResourceScope sets the "resource_scope" field if the given value is not nil.

func (*ResourcesCreate) SetNillableResourceType

func (_c *ResourcesCreate) SetNillableResourceType(v *int) *ResourcesCreate

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*ResourcesCreate) SetNillableSortOrder

func (_c *ResourcesCreate) SetNillableSortOrder(v *int) *ResourcesCreate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*ResourcesCreate) SetNillableUpdatedAt

func (_c *ResourcesCreate) SetNillableUpdatedAt(v *time.Time) *ResourcesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ResourcesCreate) SetNillableUpdatedBy

func (_c *ResourcesCreate) SetNillableUpdatedBy(v *int64) *ResourcesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ResourcesCreate) SetParentID

func (_c *ResourcesCreate) SetParentID(v int) *ResourcesCreate

SetParentID sets the "parent_id" field.

func (*ResourcesCreate) SetPath

func (_c *ResourcesCreate) SetPath(v string) *ResourcesCreate

SetPath sets the "path" field.

func (*ResourcesCreate) SetResourceScope

func (_c *ResourcesCreate) SetResourceScope(v int) *ResourcesCreate

SetResourceScope sets the "resource_scope" field.

func (*ResourcesCreate) SetResourceType

func (_c *ResourcesCreate) SetResourceType(v int) *ResourcesCreate

SetResourceType sets the "resource_type" field.

func (*ResourcesCreate) SetSortOrder

func (_c *ResourcesCreate) SetSortOrder(v int) *ResourcesCreate

SetSortOrder sets the "sort_order" field.

func (*ResourcesCreate) SetUpdatedAt

func (_c *ResourcesCreate) SetUpdatedAt(v time.Time) *ResourcesCreate

SetUpdatedAt sets the "updated_at" field.

func (*ResourcesCreate) SetUpdatedBy

func (_c *ResourcesCreate) SetUpdatedBy(v int64) *ResourcesCreate

SetUpdatedBy sets the "updated_by" field.

type ResourcesCreateBulk

type ResourcesCreateBulk struct {
	// contains filtered or unexported fields
}

ResourcesCreateBulk is the builder for creating many Resources entities in bulk.

func (*ResourcesCreateBulk) Exec

func (_c *ResourcesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourcesCreateBulk) ExecX

func (_c *ResourcesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourcesCreateBulk) Save

func (_c *ResourcesCreateBulk) Save(ctx context.Context) ([]*Resources, error)

Save creates the Resources entities in the database.

func (*ResourcesCreateBulk) SaveX

func (_c *ResourcesCreateBulk) SaveX(ctx context.Context) []*Resources

SaveX is like Save, but panics if an error occurs.

type ResourcesDelete

type ResourcesDelete struct {
	// contains filtered or unexported fields
}

ResourcesDelete is the builder for deleting a Resources entity.

func (*ResourcesDelete) Exec

func (_d *ResourcesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ResourcesDelete) ExecX

func (_d *ResourcesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ResourcesDelete) Where

Where appends a list predicates to the ResourcesDelete builder.

type ResourcesDeleteOne

type ResourcesDeleteOne struct {
	// contains filtered or unexported fields
}

ResourcesDeleteOne is the builder for deleting a single Resources entity.

func (*ResourcesDeleteOne) Exec

func (_d *ResourcesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ResourcesDeleteOne) ExecX

func (_d *ResourcesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourcesDeleteOne) Where

Where appends a list predicates to the ResourcesDelete builder.

type ResourcesEdges

type ResourcesEdges struct {
	// LionPermissions holds the value of the lion_permissions edge.
	LionPermissions []*Permissions `json:"lion_permissions,omitempty"`
	// contains filtered or unexported fields
}

ResourcesEdges holds the relations/edges for other nodes in the graph.

func (ResourcesEdges) LionPermissionsOrErr

func (e ResourcesEdges) LionPermissionsOrErr() ([]*Permissions, error)

LionPermissionsOrErr returns the LionPermissions value or an error if the edge was not loaded in eager-loading.

type ResourcesGroupBy

type ResourcesGroupBy struct {
	// contains filtered or unexported fields
}

ResourcesGroupBy is the group-by builder for Resources entities.

func (*ResourcesGroupBy) Aggregate

func (_g *ResourcesGroupBy) Aggregate(fns ...AggregateFunc) *ResourcesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ResourcesGroupBy) Bool

func (s *ResourcesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) BoolX

func (s *ResourcesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResourcesGroupBy) Bools

func (s *ResourcesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) BoolsX

func (s *ResourcesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResourcesGroupBy) Float64

func (s *ResourcesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) Float64X

func (s *ResourcesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResourcesGroupBy) Float64s

func (s *ResourcesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) Float64sX

func (s *ResourcesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResourcesGroupBy) Int

func (s *ResourcesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) IntX

func (s *ResourcesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResourcesGroupBy) Ints

func (s *ResourcesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) IntsX

func (s *ResourcesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResourcesGroupBy) Scan

func (_g *ResourcesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResourcesGroupBy) ScanX

func (s *ResourcesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResourcesGroupBy) String

func (s *ResourcesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) StringX

func (s *ResourcesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResourcesGroupBy) Strings

func (s *ResourcesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResourcesGroupBy) StringsX

func (s *ResourcesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResourcesMutation

type ResourcesMutation struct {
	// contains filtered or unexported fields
}

ResourcesMutation represents an operation that mutates the Resources nodes in the graph.

func (*ResourcesMutation) AddCreatedBy

func (m *ResourcesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*ResourcesMutation) AddField

func (m *ResourcesMutation) 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 (*ResourcesMutation) AddLionPermissionIDs

func (m *ResourcesMutation) AddLionPermissionIDs(ids ...int)

AddLionPermissionIDs adds the "lion_permissions" edge to the Permissions entity by ids.

func (*ResourcesMutation) AddParentID

func (m *ResourcesMutation) AddParentID(i int)

AddParentID adds i to the "parent_id" field.

func (*ResourcesMutation) AddResourceScope

func (m *ResourcesMutation) AddResourceScope(i int)

AddResourceScope adds i to the "resource_scope" field.

func (*ResourcesMutation) AddResourceType

func (m *ResourcesMutation) AddResourceType(i int)

AddResourceType adds i to the "resource_type" field.

func (*ResourcesMutation) AddSortOrder

func (m *ResourcesMutation) AddSortOrder(i int)

AddSortOrder adds i to the "sort_order" field.

func (*ResourcesMutation) AddUpdatedBy

func (m *ResourcesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*ResourcesMutation) AddedCreatedBy

func (m *ResourcesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*ResourcesMutation) AddedEdges

func (m *ResourcesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ResourcesMutation) AddedField

func (m *ResourcesMutation) 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 (*ResourcesMutation) AddedFields

func (m *ResourcesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ResourcesMutation) AddedIDs

func (m *ResourcesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ResourcesMutation) AddedParentID

func (m *ResourcesMutation) AddedParentID() (r int, exists bool)

AddedParentID returns the value that was added to the "parent_id" field in this mutation.

func (*ResourcesMutation) AddedResourceScope

func (m *ResourcesMutation) AddedResourceScope() (r int, exists bool)

AddedResourceScope returns the value that was added to the "resource_scope" field in this mutation.

func (*ResourcesMutation) AddedResourceType

func (m *ResourcesMutation) AddedResourceType() (r int, exists bool)

AddedResourceType returns the value that was added to the "resource_type" field in this mutation.

func (*ResourcesMutation) AddedSortOrder

func (m *ResourcesMutation) AddedSortOrder() (r int, exists bool)

AddedSortOrder returns the value that was added to the "sort_order" field in this mutation.

func (*ResourcesMutation) AddedUpdatedBy

func (m *ResourcesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*ResourcesMutation) ClearCreatedBy

func (m *ResourcesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*ResourcesMutation) ClearDeletedAt

func (m *ResourcesMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ResourcesMutation) ClearEdge

func (m *ResourcesMutation) 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 (*ResourcesMutation) ClearField

func (m *ResourcesMutation) 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 (*ResourcesMutation) ClearLionPermissions

func (m *ResourcesMutation) ClearLionPermissions()

ClearLionPermissions clears the "lion_permissions" edge to the Permissions entity.

func (*ResourcesMutation) ClearUpdatedBy

func (m *ResourcesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ResourcesMutation) ClearedEdges

func (m *ResourcesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ResourcesMutation) ClearedFields

func (m *ResourcesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ResourcesMutation) Client

func (m ResourcesMutation) 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 (*ResourcesMutation) Component

func (m *ResourcesMutation) Component() (r string, exists bool)

Component returns the value of the "component" field in the mutation.

func (*ResourcesMutation) CreatedAt

func (m *ResourcesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ResourcesMutation) CreatedBy

func (m *ResourcesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*ResourcesMutation) CreatedByCleared

func (m *ResourcesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*ResourcesMutation) DeletedAt

func (m *ResourcesMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*ResourcesMutation) DeletedAtCleared

func (m *ResourcesMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*ResourcesMutation) Description

func (m *ResourcesMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ResourcesMutation) EdgeCleared

func (m *ResourcesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ResourcesMutation) Enabled

func (m *ResourcesMutation) Enabled() (r bool, exists bool)

Enabled returns the value of the "enabled" field in the mutation.

func (*ResourcesMutation) Field

func (m *ResourcesMutation) 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 (*ResourcesMutation) FieldCleared

func (m *ResourcesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ResourcesMutation) Fields

func (m *ResourcesMutation) 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 (*ResourcesMutation) Hidden

func (m *ResourcesMutation) Hidden() (r bool, exists bool)

Hidden returns the value of the "hidden" field in the mutation.

func (*ResourcesMutation) HideChildren

func (m *ResourcesMutation) HideChildren() (r bool, exists bool)

HideChildren returns the value of the "hide_children" field in the mutation.

func (*ResourcesMutation) ID

func (m *ResourcesMutation) 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 (*ResourcesMutation) IDs

func (m *ResourcesMutation) 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 (*ResourcesMutation) Icon

func (m *ResourcesMutation) Icon() (r string, exists bool)

Icon returns the value of the "icon" field in the mutation.

func (*ResourcesMutation) LionPermissionsCleared

func (m *ResourcesMutation) LionPermissionsCleared() bool

LionPermissionsCleared reports if the "lion_permissions" edge to the Permissions entity was cleared.

func (*ResourcesMutation) LionPermissionsIDs

func (m *ResourcesMutation) LionPermissionsIDs() (ids []int)

LionPermissionsIDs returns the "lion_permissions" edge IDs in the mutation.

func (*ResourcesMutation) Name

func (m *ResourcesMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ResourcesMutation) OldComponent

func (m *ResourcesMutation) OldComponent(ctx context.Context) (v string, err error)

OldComponent returns the old "component" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldCreatedAt

func (m *ResourcesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldCreatedBy

func (m *ResourcesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldDeletedAt

func (m *ResourcesMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldDescription

func (m *ResourcesMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldEnabled

func (m *ResourcesMutation) OldEnabled(ctx context.Context) (v bool, err error)

OldEnabled returns the old "enabled" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldField

func (m *ResourcesMutation) 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 (*ResourcesMutation) OldHidden

func (m *ResourcesMutation) OldHidden(ctx context.Context) (v bool, err error)

OldHidden returns the old "hidden" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldHideChildren

func (m *ResourcesMutation) OldHideChildren(ctx context.Context) (v bool, err error)

OldHideChildren returns the old "hide_children" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldIcon

func (m *ResourcesMutation) OldIcon(ctx context.Context) (v string, err error)

OldIcon returns the old "icon" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldName

func (m *ResourcesMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldParentID

func (m *ResourcesMutation) OldParentID(ctx context.Context) (v int, err error)

OldParentID returns the old "parent_id" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldPath

func (m *ResourcesMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldResourceScope

func (m *ResourcesMutation) OldResourceScope(ctx context.Context) (v int, err error)

OldResourceScope returns the old "resource_scope" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldResourceType

func (m *ResourcesMutation) OldResourceType(ctx context.Context) (v int, err error)

OldResourceType returns the old "resource_type" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldSortOrder

func (m *ResourcesMutation) OldSortOrder(ctx context.Context) (v int, err error)

OldSortOrder returns the old "sort_order" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldUpdatedAt

func (m *ResourcesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) OldUpdatedBy

func (m *ResourcesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Resources entity. If the Resources 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 (*ResourcesMutation) Op

func (m *ResourcesMutation) Op() Op

Op returns the operation name.

func (*ResourcesMutation) ParentID

func (m *ResourcesMutation) ParentID() (r int, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*ResourcesMutation) Path

func (m *ResourcesMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*ResourcesMutation) RemoveLionPermissionIDs

func (m *ResourcesMutation) RemoveLionPermissionIDs(ids ...int)

RemoveLionPermissionIDs removes the "lion_permissions" edge to the Permissions entity by IDs.

func (*ResourcesMutation) RemovedEdges

func (m *ResourcesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ResourcesMutation) RemovedIDs

func (m *ResourcesMutation) 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 (*ResourcesMutation) RemovedLionPermissionsIDs

func (m *ResourcesMutation) RemovedLionPermissionsIDs() (ids []int)

RemovedLionPermissions returns the removed IDs of the "lion_permissions" edge to the Permissions entity.

func (*ResourcesMutation) ResetComponent

func (m *ResourcesMutation) ResetComponent()

ResetComponent resets all changes to the "component" field.

func (*ResourcesMutation) ResetCreatedAt

func (m *ResourcesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ResourcesMutation) ResetCreatedBy

func (m *ResourcesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*ResourcesMutation) ResetDeletedAt

func (m *ResourcesMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*ResourcesMutation) ResetDescription

func (m *ResourcesMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ResourcesMutation) ResetEdge

func (m *ResourcesMutation) 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 (*ResourcesMutation) ResetEnabled

func (m *ResourcesMutation) ResetEnabled()

ResetEnabled resets all changes to the "enabled" field.

func (*ResourcesMutation) ResetField

func (m *ResourcesMutation) 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 (*ResourcesMutation) ResetHidden

func (m *ResourcesMutation) ResetHidden()

ResetHidden resets all changes to the "hidden" field.

func (*ResourcesMutation) ResetHideChildren

func (m *ResourcesMutation) ResetHideChildren()

ResetHideChildren resets all changes to the "hide_children" field.

func (*ResourcesMutation) ResetIcon

func (m *ResourcesMutation) ResetIcon()

ResetIcon resets all changes to the "icon" field.

func (*ResourcesMutation) ResetLionPermissions

func (m *ResourcesMutation) ResetLionPermissions()

ResetLionPermissions resets all changes to the "lion_permissions" edge.

func (*ResourcesMutation) ResetName

func (m *ResourcesMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ResourcesMutation) ResetParentID

func (m *ResourcesMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*ResourcesMutation) ResetPath

func (m *ResourcesMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*ResourcesMutation) ResetResourceScope

func (m *ResourcesMutation) ResetResourceScope()

ResetResourceScope resets all changes to the "resource_scope" field.

func (*ResourcesMutation) ResetResourceType

func (m *ResourcesMutation) ResetResourceType()

ResetResourceType resets all changes to the "resource_type" field.

func (*ResourcesMutation) ResetSortOrder

func (m *ResourcesMutation) ResetSortOrder()

ResetSortOrder resets all changes to the "sort_order" field.

func (*ResourcesMutation) ResetUpdatedAt

func (m *ResourcesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ResourcesMutation) ResetUpdatedBy

func (m *ResourcesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*ResourcesMutation) ResourceScope

func (m *ResourcesMutation) ResourceScope() (r int, exists bool)

ResourceScope returns the value of the "resource_scope" field in the mutation.

func (*ResourcesMutation) ResourceType

func (m *ResourcesMutation) ResourceType() (r int, exists bool)

ResourceType returns the value of the "resource_type" field in the mutation.

func (*ResourcesMutation) SetComponent

func (m *ResourcesMutation) SetComponent(s string)

SetComponent sets the "component" field.

func (*ResourcesMutation) SetCreatedAt

func (m *ResourcesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ResourcesMutation) SetCreatedBy

func (m *ResourcesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*ResourcesMutation) SetDeletedAt

func (m *ResourcesMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*ResourcesMutation) SetDescription

func (m *ResourcesMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ResourcesMutation) SetEnabled

func (m *ResourcesMutation) SetEnabled(b bool)

SetEnabled sets the "enabled" field.

func (*ResourcesMutation) SetField

func (m *ResourcesMutation) 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 (*ResourcesMutation) SetHidden

func (m *ResourcesMutation) SetHidden(b bool)

SetHidden sets the "hidden" field.

func (*ResourcesMutation) SetHideChildren

func (m *ResourcesMutation) SetHideChildren(b bool)

SetHideChildren sets the "hide_children" field.

func (*ResourcesMutation) SetIcon

func (m *ResourcesMutation) SetIcon(s string)

SetIcon sets the "icon" field.

func (*ResourcesMutation) SetName

func (m *ResourcesMutation) SetName(s string)

SetName sets the "name" field.

func (*ResourcesMutation) SetOp

func (m *ResourcesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ResourcesMutation) SetParentID

func (m *ResourcesMutation) SetParentID(i int)

SetParentID sets the "parent_id" field.

func (*ResourcesMutation) SetPath

func (m *ResourcesMutation) SetPath(s string)

SetPath sets the "path" field.

func (*ResourcesMutation) SetResourceScope

func (m *ResourcesMutation) SetResourceScope(i int)

SetResourceScope sets the "resource_scope" field.

func (*ResourcesMutation) SetResourceType

func (m *ResourcesMutation) SetResourceType(i int)

SetResourceType sets the "resource_type" field.

func (*ResourcesMutation) SetSortOrder

func (m *ResourcesMutation) SetSortOrder(i int)

SetSortOrder sets the "sort_order" field.

func (*ResourcesMutation) SetUpdatedAt

func (m *ResourcesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ResourcesMutation) SetUpdatedBy

func (m *ResourcesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*ResourcesMutation) SortOrder

func (m *ResourcesMutation) SortOrder() (r int, exists bool)

SortOrder returns the value of the "sort_order" field in the mutation.

func (ResourcesMutation) Tx

func (m ResourcesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ResourcesMutation) Type

func (m *ResourcesMutation) Type() string

Type returns the node type of this mutation (Resources).

func (*ResourcesMutation) UpdatedAt

func (m *ResourcesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ResourcesMutation) UpdatedBy

func (m *ResourcesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*ResourcesMutation) UpdatedByCleared

func (m *ResourcesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*ResourcesMutation) Where

func (m *ResourcesMutation) Where(ps ...predicate.Resources)

Where appends a list predicates to the ResourcesMutation builder.

func (*ResourcesMutation) WhereP

func (m *ResourcesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ResourcesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ResourcesQuery

type ResourcesQuery struct {
	// contains filtered or unexported fields
}

ResourcesQuery is the builder for querying Resources entities.

func (*ResourcesQuery) Aggregate

func (_q *ResourcesQuery) Aggregate(fns ...AggregateFunc) *ResourcesSelect

Aggregate returns a ResourcesSelect configured with the given aggregations.

func (*ResourcesQuery) All

func (_q *ResourcesQuery) All(ctx context.Context) ([]*Resources, error)

All executes the query and returns a list of ResourcesSlice.

func (*ResourcesQuery) AllX

func (_q *ResourcesQuery) AllX(ctx context.Context) []*Resources

AllX is like All, but panics if an error occurs.

func (*ResourcesQuery) Clone

func (_q *ResourcesQuery) Clone() *ResourcesQuery

Clone returns a duplicate of the ResourcesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ResourcesQuery) Count

func (_q *ResourcesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResourcesQuery) CountX

func (_q *ResourcesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ResourcesQuery) Exist

func (_q *ResourcesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ResourcesQuery) ExistX

func (_q *ResourcesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ResourcesQuery) First

func (_q *ResourcesQuery) First(ctx context.Context) (*Resources, error)

First returns the first Resources entity from the query. Returns a *NotFoundError when no Resources was found.

func (*ResourcesQuery) FirstID

func (_q *ResourcesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Resources ID from the query. Returns a *NotFoundError when no Resources ID was found.

func (*ResourcesQuery) FirstIDX

func (_q *ResourcesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ResourcesQuery) FirstX

func (_q *ResourcesQuery) FirstX(ctx context.Context) *Resources

FirstX is like First, but panics if an error occurs.

func (*ResourcesQuery) GroupBy

func (_q *ResourcesQuery) GroupBy(field string, fields ...string) *ResourcesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Resources.Query().
	GroupBy(resources.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*ResourcesQuery) IDs

func (_q *ResourcesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Resources IDs.

func (*ResourcesQuery) IDsX

func (_q *ResourcesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ResourcesQuery) Limit

func (_q *ResourcesQuery) Limit(limit int) *ResourcesQuery

Limit the number of records to be returned by this query.

func (*ResourcesQuery) Offset

func (_q *ResourcesQuery) Offset(offset int) *ResourcesQuery

Offset to start from.

func (*ResourcesQuery) Only

func (_q *ResourcesQuery) Only(ctx context.Context) (*Resources, error)

Only returns a single Resources entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Resources entity is found. Returns a *NotFoundError when no Resources entities are found.

func (*ResourcesQuery) OnlyID

func (_q *ResourcesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Resources ID in the query. Returns a *NotSingularError when more than one Resources ID is found. Returns a *NotFoundError when no entities are found.

func (*ResourcesQuery) OnlyIDX

func (_q *ResourcesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ResourcesQuery) OnlyX

func (_q *ResourcesQuery) OnlyX(ctx context.Context) *Resources

OnlyX is like Only, but panics if an error occurs.

func (*ResourcesQuery) Order

Order specifies how the records should be ordered.

func (*ResourcesQuery) QueryLionPermissions

func (_q *ResourcesQuery) QueryLionPermissions() *PermissionsQuery

QueryLionPermissions chains the current query on the "lion_permissions" edge.

func (*ResourcesQuery) Select

func (_q *ResourcesQuery) Select(fields ...string) *ResourcesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Resources.Query().
	Select(resources.FieldCreatedAt).
	Scan(ctx, &v)

func (*ResourcesQuery) Unique

func (_q *ResourcesQuery) Unique(unique bool) *ResourcesQuery

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 (*ResourcesQuery) Where

Where adds a new predicate for the ResourcesQuery builder.

func (*ResourcesQuery) WithLionPermissions

func (_q *ResourcesQuery) WithLionPermissions(opts ...func(*PermissionsQuery)) *ResourcesQuery

WithLionPermissions tells the query-builder to eager-load the nodes that are connected to the "lion_permissions" edge. The optional arguments are used to configure the query builder of the edge.

type ResourcesSelect

type ResourcesSelect struct {
	*ResourcesQuery
	// contains filtered or unexported fields
}

ResourcesSelect is the builder for selecting fields of Resources entities.

func (*ResourcesSelect) Aggregate

func (_s *ResourcesSelect) Aggregate(fns ...AggregateFunc) *ResourcesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ResourcesSelect) Bool

func (s *ResourcesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) BoolX

func (s *ResourcesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResourcesSelect) Bools

func (s *ResourcesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) BoolsX

func (s *ResourcesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResourcesSelect) Float64

func (s *ResourcesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) Float64X

func (s *ResourcesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResourcesSelect) Float64s

func (s *ResourcesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) Float64sX

func (s *ResourcesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResourcesSelect) Int

func (s *ResourcesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) IntX

func (s *ResourcesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResourcesSelect) Ints

func (s *ResourcesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) IntsX

func (s *ResourcesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResourcesSelect) Scan

func (_s *ResourcesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResourcesSelect) ScanX

func (s *ResourcesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResourcesSelect) String

func (s *ResourcesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) StringX

func (s *ResourcesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResourcesSelect) Strings

func (s *ResourcesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResourcesSelect) StringsX

func (s *ResourcesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResourcesSlice

type ResourcesSlice []*Resources

ResourcesSlice is a parsable slice of Resources.

type ResourcesUpdate

type ResourcesUpdate struct {
	// contains filtered or unexported fields
}

ResourcesUpdate is the builder for updating Resources entities.

func (*ResourcesUpdate) AddCreatedBy

func (_u *ResourcesUpdate) AddCreatedBy(v int64) *ResourcesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*ResourcesUpdate) AddLionPermissionIDs

func (_u *ResourcesUpdate) AddLionPermissionIDs(ids ...int) *ResourcesUpdate

AddLionPermissionIDs adds the "lion_permissions" edge to the Permissions entity by IDs.

func (*ResourcesUpdate) AddLionPermissions

func (_u *ResourcesUpdate) AddLionPermissions(v ...*Permissions) *ResourcesUpdate

AddLionPermissions adds the "lion_permissions" edges to the Permissions entity.

func (*ResourcesUpdate) AddParentID

func (_u *ResourcesUpdate) AddParentID(v int) *ResourcesUpdate

AddParentID adds value to the "parent_id" field.

func (*ResourcesUpdate) AddResourceScope

func (_u *ResourcesUpdate) AddResourceScope(v int) *ResourcesUpdate

AddResourceScope adds value to the "resource_scope" field.

func (*ResourcesUpdate) AddResourceType

func (_u *ResourcesUpdate) AddResourceType(v int) *ResourcesUpdate

AddResourceType adds value to the "resource_type" field.

func (*ResourcesUpdate) AddSortOrder

func (_u *ResourcesUpdate) AddSortOrder(v int) *ResourcesUpdate

AddSortOrder adds value to the "sort_order" field.

func (*ResourcesUpdate) AddUpdatedBy

func (_u *ResourcesUpdate) AddUpdatedBy(v int64) *ResourcesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*ResourcesUpdate) ClearCreatedBy

func (_u *ResourcesUpdate) ClearCreatedBy() *ResourcesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*ResourcesUpdate) ClearDeletedAt

func (_u *ResourcesUpdate) ClearDeletedAt() *ResourcesUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ResourcesUpdate) ClearLionPermissions

func (_u *ResourcesUpdate) ClearLionPermissions() *ResourcesUpdate

ClearLionPermissions clears all "lion_permissions" edges to the Permissions entity.

func (*ResourcesUpdate) ClearUpdatedBy

func (_u *ResourcesUpdate) ClearUpdatedBy() *ResourcesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ResourcesUpdate) Exec

func (_u *ResourcesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourcesUpdate) ExecX

func (_u *ResourcesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourcesUpdate) Mutation

func (_u *ResourcesUpdate) Mutation() *ResourcesMutation

Mutation returns the ResourcesMutation object of the builder.

func (*ResourcesUpdate) RemoveLionPermissionIDs

func (_u *ResourcesUpdate) RemoveLionPermissionIDs(ids ...int) *ResourcesUpdate

RemoveLionPermissionIDs removes the "lion_permissions" edge to Permissions entities by IDs.

func (*ResourcesUpdate) RemoveLionPermissions

func (_u *ResourcesUpdate) RemoveLionPermissions(v ...*Permissions) *ResourcesUpdate

RemoveLionPermissions removes "lion_permissions" edges to Permissions entities.

func (*ResourcesUpdate) Save

func (_u *ResourcesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ResourcesUpdate) SaveX

func (_u *ResourcesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ResourcesUpdate) SetComponent

func (_u *ResourcesUpdate) SetComponent(v string) *ResourcesUpdate

SetComponent sets the "component" field.

func (*ResourcesUpdate) SetCreatedBy

func (_u *ResourcesUpdate) SetCreatedBy(v int64) *ResourcesUpdate

SetCreatedBy sets the "created_by" field.

func (*ResourcesUpdate) SetDeletedAt

func (_u *ResourcesUpdate) SetDeletedAt(v time.Time) *ResourcesUpdate

SetDeletedAt sets the "deleted_at" field.

func (*ResourcesUpdate) SetDescription

func (_u *ResourcesUpdate) SetDescription(v string) *ResourcesUpdate

SetDescription sets the "description" field.

func (*ResourcesUpdate) SetEnabled

func (_u *ResourcesUpdate) SetEnabled(v bool) *ResourcesUpdate

SetEnabled sets the "enabled" field.

func (*ResourcesUpdate) SetHidden

func (_u *ResourcesUpdate) SetHidden(v bool) *ResourcesUpdate

SetHidden sets the "hidden" field.

func (*ResourcesUpdate) SetHideChildren

func (_u *ResourcesUpdate) SetHideChildren(v bool) *ResourcesUpdate

SetHideChildren sets the "hide_children" field.

func (*ResourcesUpdate) SetIcon

func (_u *ResourcesUpdate) SetIcon(v string) *ResourcesUpdate

SetIcon sets the "icon" field.

func (*ResourcesUpdate) SetName

func (_u *ResourcesUpdate) SetName(v string) *ResourcesUpdate

SetName sets the "name" field.

func (*ResourcesUpdate) SetNillableComponent

func (_u *ResourcesUpdate) SetNillableComponent(v *string) *ResourcesUpdate

SetNillableComponent sets the "component" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableCreatedBy

func (_u *ResourcesUpdate) SetNillableCreatedBy(v *int64) *ResourcesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableDeletedAt

func (_u *ResourcesUpdate) SetNillableDeletedAt(v *time.Time) *ResourcesUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableDescription

func (_u *ResourcesUpdate) SetNillableDescription(v *string) *ResourcesUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableEnabled

func (_u *ResourcesUpdate) SetNillableEnabled(v *bool) *ResourcesUpdate

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableHidden

func (_u *ResourcesUpdate) SetNillableHidden(v *bool) *ResourcesUpdate

SetNillableHidden sets the "hidden" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableHideChildren

func (_u *ResourcesUpdate) SetNillableHideChildren(v *bool) *ResourcesUpdate

SetNillableHideChildren sets the "hide_children" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableIcon

func (_u *ResourcesUpdate) SetNillableIcon(v *string) *ResourcesUpdate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableName

func (_u *ResourcesUpdate) SetNillableName(v *string) *ResourcesUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableParentID

func (_u *ResourcesUpdate) SetNillableParentID(v *int) *ResourcesUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*ResourcesUpdate) SetNillablePath

func (_u *ResourcesUpdate) SetNillablePath(v *string) *ResourcesUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableResourceScope

func (_u *ResourcesUpdate) SetNillableResourceScope(v *int) *ResourcesUpdate

SetNillableResourceScope sets the "resource_scope" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableResourceType

func (_u *ResourcesUpdate) SetNillableResourceType(v *int) *ResourcesUpdate

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableSortOrder

func (_u *ResourcesUpdate) SetNillableSortOrder(v *int) *ResourcesUpdate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*ResourcesUpdate) SetNillableUpdatedBy

func (_u *ResourcesUpdate) SetNillableUpdatedBy(v *int64) *ResourcesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ResourcesUpdate) SetParentID

func (_u *ResourcesUpdate) SetParentID(v int) *ResourcesUpdate

SetParentID sets the "parent_id" field.

func (*ResourcesUpdate) SetPath

func (_u *ResourcesUpdate) SetPath(v string) *ResourcesUpdate

SetPath sets the "path" field.

func (*ResourcesUpdate) SetResourceScope

func (_u *ResourcesUpdate) SetResourceScope(v int) *ResourcesUpdate

SetResourceScope sets the "resource_scope" field.

func (*ResourcesUpdate) SetResourceType

func (_u *ResourcesUpdate) SetResourceType(v int) *ResourcesUpdate

SetResourceType sets the "resource_type" field.

func (*ResourcesUpdate) SetSortOrder

func (_u *ResourcesUpdate) SetSortOrder(v int) *ResourcesUpdate

SetSortOrder sets the "sort_order" field.

func (*ResourcesUpdate) SetUpdatedAt

func (_u *ResourcesUpdate) SetUpdatedAt(v time.Time) *ResourcesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ResourcesUpdate) SetUpdatedBy

func (_u *ResourcesUpdate) SetUpdatedBy(v int64) *ResourcesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*ResourcesUpdate) Where

Where appends a list predicates to the ResourcesUpdate builder.

type ResourcesUpdateOne

type ResourcesUpdateOne struct {
	// contains filtered or unexported fields
}

ResourcesUpdateOne is the builder for updating a single Resources entity.

func (*ResourcesUpdateOne) AddCreatedBy

func (_u *ResourcesUpdateOne) AddCreatedBy(v int64) *ResourcesUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*ResourcesUpdateOne) AddLionPermissionIDs

func (_u *ResourcesUpdateOne) AddLionPermissionIDs(ids ...int) *ResourcesUpdateOne

AddLionPermissionIDs adds the "lion_permissions" edge to the Permissions entity by IDs.

func (*ResourcesUpdateOne) AddLionPermissions

func (_u *ResourcesUpdateOne) AddLionPermissions(v ...*Permissions) *ResourcesUpdateOne

AddLionPermissions adds the "lion_permissions" edges to the Permissions entity.

func (*ResourcesUpdateOne) AddParentID

func (_u *ResourcesUpdateOne) AddParentID(v int) *ResourcesUpdateOne

AddParentID adds value to the "parent_id" field.

func (*ResourcesUpdateOne) AddResourceScope

func (_u *ResourcesUpdateOne) AddResourceScope(v int) *ResourcesUpdateOne

AddResourceScope adds value to the "resource_scope" field.

func (*ResourcesUpdateOne) AddResourceType

func (_u *ResourcesUpdateOne) AddResourceType(v int) *ResourcesUpdateOne

AddResourceType adds value to the "resource_type" field.

func (*ResourcesUpdateOne) AddSortOrder

func (_u *ResourcesUpdateOne) AddSortOrder(v int) *ResourcesUpdateOne

AddSortOrder adds value to the "sort_order" field.

func (*ResourcesUpdateOne) AddUpdatedBy

func (_u *ResourcesUpdateOne) AddUpdatedBy(v int64) *ResourcesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*ResourcesUpdateOne) ClearCreatedBy

func (_u *ResourcesUpdateOne) ClearCreatedBy() *ResourcesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*ResourcesUpdateOne) ClearDeletedAt

func (_u *ResourcesUpdateOne) ClearDeletedAt() *ResourcesUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ResourcesUpdateOne) ClearLionPermissions

func (_u *ResourcesUpdateOne) ClearLionPermissions() *ResourcesUpdateOne

ClearLionPermissions clears all "lion_permissions" edges to the Permissions entity.

func (*ResourcesUpdateOne) ClearUpdatedBy

func (_u *ResourcesUpdateOne) ClearUpdatedBy() *ResourcesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ResourcesUpdateOne) Exec

func (_u *ResourcesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResourcesUpdateOne) ExecX

func (_u *ResourcesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourcesUpdateOne) Mutation

func (_u *ResourcesUpdateOne) Mutation() *ResourcesMutation

Mutation returns the ResourcesMutation object of the builder.

func (*ResourcesUpdateOne) RemoveLionPermissionIDs

func (_u *ResourcesUpdateOne) RemoveLionPermissionIDs(ids ...int) *ResourcesUpdateOne

RemoveLionPermissionIDs removes the "lion_permissions" edge to Permissions entities by IDs.

func (*ResourcesUpdateOne) RemoveLionPermissions

func (_u *ResourcesUpdateOne) RemoveLionPermissions(v ...*Permissions) *ResourcesUpdateOne

RemoveLionPermissions removes "lion_permissions" edges to Permissions entities.

func (*ResourcesUpdateOne) Save

func (_u *ResourcesUpdateOne) Save(ctx context.Context) (*Resources, error)

Save executes the query and returns the updated Resources entity.

func (*ResourcesUpdateOne) SaveX

func (_u *ResourcesUpdateOne) SaveX(ctx context.Context) *Resources

SaveX is like Save, but panics if an error occurs.

func (*ResourcesUpdateOne) Select

func (_u *ResourcesUpdateOne) Select(field string, fields ...string) *ResourcesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ResourcesUpdateOne) SetComponent

func (_u *ResourcesUpdateOne) SetComponent(v string) *ResourcesUpdateOne

SetComponent sets the "component" field.

func (*ResourcesUpdateOne) SetCreatedBy

func (_u *ResourcesUpdateOne) SetCreatedBy(v int64) *ResourcesUpdateOne

SetCreatedBy sets the "created_by" field.

func (*ResourcesUpdateOne) SetDeletedAt

func (_u *ResourcesUpdateOne) SetDeletedAt(v time.Time) *ResourcesUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*ResourcesUpdateOne) SetDescription

func (_u *ResourcesUpdateOne) SetDescription(v string) *ResourcesUpdateOne

SetDescription sets the "description" field.

func (*ResourcesUpdateOne) SetEnabled

func (_u *ResourcesUpdateOne) SetEnabled(v bool) *ResourcesUpdateOne

SetEnabled sets the "enabled" field.

func (*ResourcesUpdateOne) SetHidden

func (_u *ResourcesUpdateOne) SetHidden(v bool) *ResourcesUpdateOne

SetHidden sets the "hidden" field.

func (*ResourcesUpdateOne) SetHideChildren

func (_u *ResourcesUpdateOne) SetHideChildren(v bool) *ResourcesUpdateOne

SetHideChildren sets the "hide_children" field.

func (*ResourcesUpdateOne) SetIcon

SetIcon sets the "icon" field.

func (*ResourcesUpdateOne) SetName

SetName sets the "name" field.

func (*ResourcesUpdateOne) SetNillableComponent

func (_u *ResourcesUpdateOne) SetNillableComponent(v *string) *ResourcesUpdateOne

SetNillableComponent sets the "component" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableCreatedBy

func (_u *ResourcesUpdateOne) SetNillableCreatedBy(v *int64) *ResourcesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableDeletedAt

func (_u *ResourcesUpdateOne) SetNillableDeletedAt(v *time.Time) *ResourcesUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableDescription

func (_u *ResourcesUpdateOne) SetNillableDescription(v *string) *ResourcesUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableEnabled

func (_u *ResourcesUpdateOne) SetNillableEnabled(v *bool) *ResourcesUpdateOne

SetNillableEnabled sets the "enabled" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableHidden

func (_u *ResourcesUpdateOne) SetNillableHidden(v *bool) *ResourcesUpdateOne

SetNillableHidden sets the "hidden" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableHideChildren

func (_u *ResourcesUpdateOne) SetNillableHideChildren(v *bool) *ResourcesUpdateOne

SetNillableHideChildren sets the "hide_children" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableIcon

func (_u *ResourcesUpdateOne) SetNillableIcon(v *string) *ResourcesUpdateOne

SetNillableIcon sets the "icon" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableName

func (_u *ResourcesUpdateOne) SetNillableName(v *string) *ResourcesUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableParentID

func (_u *ResourcesUpdateOne) SetNillableParentID(v *int) *ResourcesUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillablePath

func (_u *ResourcesUpdateOne) SetNillablePath(v *string) *ResourcesUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableResourceScope

func (_u *ResourcesUpdateOne) SetNillableResourceScope(v *int) *ResourcesUpdateOne

SetNillableResourceScope sets the "resource_scope" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableResourceType

func (_u *ResourcesUpdateOne) SetNillableResourceType(v *int) *ResourcesUpdateOne

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableSortOrder

func (_u *ResourcesUpdateOne) SetNillableSortOrder(v *int) *ResourcesUpdateOne

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*ResourcesUpdateOne) SetNillableUpdatedBy

func (_u *ResourcesUpdateOne) SetNillableUpdatedBy(v *int64) *ResourcesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ResourcesUpdateOne) SetParentID

func (_u *ResourcesUpdateOne) SetParentID(v int) *ResourcesUpdateOne

SetParentID sets the "parent_id" field.

func (*ResourcesUpdateOne) SetPath

SetPath sets the "path" field.

func (*ResourcesUpdateOne) SetResourceScope

func (_u *ResourcesUpdateOne) SetResourceScope(v int) *ResourcesUpdateOne

SetResourceScope sets the "resource_scope" field.

func (*ResourcesUpdateOne) SetResourceType

func (_u *ResourcesUpdateOne) SetResourceType(v int) *ResourcesUpdateOne

SetResourceType sets the "resource_type" field.

func (*ResourcesUpdateOne) SetSortOrder

func (_u *ResourcesUpdateOne) SetSortOrder(v int) *ResourcesUpdateOne

SetSortOrder sets the "sort_order" field.

func (*ResourcesUpdateOne) SetUpdatedAt

func (_u *ResourcesUpdateOne) SetUpdatedAt(v time.Time) *ResourcesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ResourcesUpdateOne) SetUpdatedBy

func (_u *ResourcesUpdateOne) SetUpdatedBy(v int64) *ResourcesUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*ResourcesUpdateOne) Where

Where appends a list predicates to the ResourcesUpdate builder.

type RolePermissions

type RolePermissions struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 关联 lion_roles 表的角色 ID
	RoleID int `json:"role_id,omitempty"`
	// 关联 lion_permissions 表的菜单 ID
	PermissionID int `json:"permission_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RolePermissionsQuery when eager-loading is set.
	Edges RolePermissionsEdges `json:"edges"`
	// contains filtered or unexported fields
}

RolePermissions is the model entity for the RolePermissions schema.

func (*RolePermissions) QueryLionPermissions

func (_m *RolePermissions) QueryLionPermissions() *PermissionsQuery

QueryLionPermissions queries the "lion_permissions" edge of the RolePermissions entity.

func (*RolePermissions) QueryLionRoles

func (_m *RolePermissions) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the RolePermissions entity.

func (*RolePermissions) String

func (_m *RolePermissions) String() string

String implements the fmt.Stringer.

func (*RolePermissions) Unwrap

func (_m *RolePermissions) Unwrap() *RolePermissions

Unwrap unwraps the RolePermissions 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 (*RolePermissions) Update

Update returns a builder for updating this RolePermissions. Note that you need to call RolePermissions.Unwrap() before calling this method if this RolePermissions was returned from a transaction, and the transaction was committed or rolled back.

func (*RolePermissions) Value

func (_m *RolePermissions) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the RolePermissions. This includes values selected through modifiers, order, etc.

type RolePermissionsClient

type RolePermissionsClient struct {
	// contains filtered or unexported fields
}

RolePermissionsClient is a client for the RolePermissions schema.

func NewRolePermissionsClient

func NewRolePermissionsClient(c config) *RolePermissionsClient

NewRolePermissionsClient returns a client for the RolePermissions from the given config.

func (*RolePermissionsClient) Create

Create returns a builder for creating a RolePermissions entity.

func (*RolePermissionsClient) CreateBulk

CreateBulk returns a builder for creating a bulk of RolePermissions entities.

func (*RolePermissionsClient) Delete

Delete returns a delete builder for RolePermissions.

func (*RolePermissionsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RolePermissionsClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RolePermissionsClient) Get

Get returns a RolePermissions entity by its id.

func (*RolePermissionsClient) GetX

GetX is like Get, but panics if an error occurs.

func (*RolePermissionsClient) Hooks

func (c *RolePermissionsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RolePermissionsClient) Intercept

func (c *RolePermissionsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `rolepermissions.Intercept(f(g(h())))`.

func (*RolePermissionsClient) Interceptors

func (c *RolePermissionsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RolePermissionsClient) MapCreateBulk

func (c *RolePermissionsClient) MapCreateBulk(slice any, setFunc func(*RolePermissionsCreate, int)) *RolePermissionsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*RolePermissionsClient) Query

Query returns a query builder for RolePermissions.

func (*RolePermissionsClient) QueryLionPermissions

func (c *RolePermissionsClient) QueryLionPermissions(_m *RolePermissions) *PermissionsQuery

QueryLionPermissions queries the lion_permissions edge of a RolePermissions.

func (*RolePermissionsClient) QueryLionRoles

func (c *RolePermissionsClient) QueryLionRoles(_m *RolePermissions) *RolesQuery

QueryLionRoles queries the lion_roles edge of a RolePermissions.

func (*RolePermissionsClient) Update

Update returns an update builder for RolePermissions.

func (*RolePermissionsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RolePermissionsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RolePermissionsClient) Use

func (c *RolePermissionsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rolepermissions.Hooks(f(g(h())))`.

type RolePermissionsCreate

type RolePermissionsCreate struct {
	// contains filtered or unexported fields
}

RolePermissionsCreate is the builder for creating a RolePermissions entity.

func (*RolePermissionsCreate) Exec

Exec executes the query.

func (*RolePermissionsCreate) ExecX

func (_c *RolePermissionsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePermissionsCreate) Mutation

Mutation returns the RolePermissionsMutation object of the builder.

func (*RolePermissionsCreate) Save

Save creates the RolePermissions in the database.

func (*RolePermissionsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RolePermissionsCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*RolePermissionsCreate) SetCreatedBy

func (_c *RolePermissionsCreate) SetCreatedBy(v int64) *RolePermissionsCreate

SetCreatedBy sets the "created_by" field.

func (*RolePermissionsCreate) SetLionPermissions

func (_c *RolePermissionsCreate) SetLionPermissions(v *Permissions) *RolePermissionsCreate

SetLionPermissions sets the "lion_permissions" edge to the Permissions entity.

func (*RolePermissionsCreate) SetLionPermissionsID

func (_c *RolePermissionsCreate) SetLionPermissionsID(id int) *RolePermissionsCreate

SetLionPermissionsID sets the "lion_permissions" edge to the Permissions entity by ID.

func (*RolePermissionsCreate) SetLionRoles

func (_c *RolePermissionsCreate) SetLionRoles(v *Roles) *RolePermissionsCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RolePermissionsCreate) SetLionRolesID

func (_c *RolePermissionsCreate) SetLionRolesID(id int) *RolePermissionsCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RolePermissionsCreate) SetNillableCreatedAt

func (_c *RolePermissionsCreate) SetNillableCreatedAt(v *time.Time) *RolePermissionsCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RolePermissionsCreate) SetNillableCreatedBy

func (_c *RolePermissionsCreate) SetNillableCreatedBy(v *int64) *RolePermissionsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolePermissionsCreate) SetNillableUpdatedAt

func (_c *RolePermissionsCreate) SetNillableUpdatedAt(v *time.Time) *RolePermissionsCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RolePermissionsCreate) SetNillableUpdatedBy

func (_c *RolePermissionsCreate) SetNillableUpdatedBy(v *int64) *RolePermissionsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolePermissionsCreate) SetPermissionID

func (_c *RolePermissionsCreate) SetPermissionID(v int) *RolePermissionsCreate

SetPermissionID sets the "permission_id" field.

func (*RolePermissionsCreate) SetRoleID

SetRoleID sets the "role_id" field.

func (*RolePermissionsCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*RolePermissionsCreate) SetUpdatedBy

func (_c *RolePermissionsCreate) SetUpdatedBy(v int64) *RolePermissionsCreate

SetUpdatedBy sets the "updated_by" field.

type RolePermissionsCreateBulk

type RolePermissionsCreateBulk struct {
	// contains filtered or unexported fields
}

RolePermissionsCreateBulk is the builder for creating many RolePermissions entities in bulk.

func (*RolePermissionsCreateBulk) Exec

Exec executes the query.

func (*RolePermissionsCreateBulk) ExecX

func (_c *RolePermissionsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePermissionsCreateBulk) Save

Save creates the RolePermissions entities in the database.

func (*RolePermissionsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type RolePermissionsDelete

type RolePermissionsDelete struct {
	// contains filtered or unexported fields
}

RolePermissionsDelete is the builder for deleting a RolePermissions entity.

func (*RolePermissionsDelete) Exec

func (_d *RolePermissionsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RolePermissionsDelete) ExecX

func (_d *RolePermissionsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RolePermissionsDelete) Where

Where appends a list predicates to the RolePermissionsDelete builder.

type RolePermissionsDeleteOne

type RolePermissionsDeleteOne struct {
	// contains filtered or unexported fields
}

RolePermissionsDeleteOne is the builder for deleting a single RolePermissions entity.

func (*RolePermissionsDeleteOne) Exec

Exec executes the deletion query.

func (*RolePermissionsDeleteOne) ExecX

func (_d *RolePermissionsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePermissionsDeleteOne) Where

Where appends a list predicates to the RolePermissionsDelete builder.

type RolePermissionsEdges

type RolePermissionsEdges struct {
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// LionPermissions holds the value of the lion_permissions edge.
	LionPermissions *Permissions `json:"lion_permissions,omitempty"`
	// contains filtered or unexported fields
}

RolePermissionsEdges holds the relations/edges for other nodes in the graph.

func (RolePermissionsEdges) LionPermissionsOrErr

func (e RolePermissionsEdges) LionPermissionsOrErr() (*Permissions, error)

LionPermissionsOrErr returns the LionPermissions value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RolePermissionsEdges) LionRolesOrErr

func (e RolePermissionsEdges) LionRolesOrErr() (*Roles, error)

LionRolesOrErr returns the LionRoles value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RolePermissionsGroupBy

type RolePermissionsGroupBy struct {
	// contains filtered or unexported fields
}

RolePermissionsGroupBy is the group-by builder for RolePermissions entities.

func (*RolePermissionsGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*RolePermissionsGroupBy) Bool

func (s *RolePermissionsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) BoolX

func (s *RolePermissionsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RolePermissionsGroupBy) Bools

func (s *RolePermissionsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) BoolsX

func (s *RolePermissionsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RolePermissionsGroupBy) Float64

func (s *RolePermissionsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) Float64X

func (s *RolePermissionsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RolePermissionsGroupBy) Float64s

func (s *RolePermissionsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) Float64sX

func (s *RolePermissionsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RolePermissionsGroupBy) Int

func (s *RolePermissionsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) IntX

func (s *RolePermissionsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RolePermissionsGroupBy) Ints

func (s *RolePermissionsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) IntsX

func (s *RolePermissionsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RolePermissionsGroupBy) Scan

func (_g *RolePermissionsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RolePermissionsGroupBy) ScanX

func (s *RolePermissionsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RolePermissionsGroupBy) String

func (s *RolePermissionsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) StringX

func (s *RolePermissionsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RolePermissionsGroupBy) Strings

func (s *RolePermissionsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RolePermissionsGroupBy) StringsX

func (s *RolePermissionsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RolePermissionsMutation

type RolePermissionsMutation struct {
	// contains filtered or unexported fields
}

RolePermissionsMutation represents an operation that mutates the RolePermissions nodes in the graph.

func (*RolePermissionsMutation) AddCreatedBy

func (m *RolePermissionsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RolePermissionsMutation) AddField

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) AddUpdatedBy

func (m *RolePermissionsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RolePermissionsMutation) AddedCreatedBy

func (m *RolePermissionsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RolePermissionsMutation) AddedEdges

func (m *RolePermissionsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RolePermissionsMutation) AddedField

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) AddedFields

func (m *RolePermissionsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RolePermissionsMutation) AddedIDs

func (m *RolePermissionsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RolePermissionsMutation) AddedUpdatedBy

func (m *RolePermissionsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RolePermissionsMutation) ClearCreatedBy

func (m *RolePermissionsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*RolePermissionsMutation) ClearEdge

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) ClearField

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) ClearLionPermissions

func (m *RolePermissionsMutation) ClearLionPermissions()

ClearLionPermissions clears the "lion_permissions" edge to the Permissions entity.

func (*RolePermissionsMutation) ClearLionRoles

func (m *RolePermissionsMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RolePermissionsMutation) ClearUpdatedBy

func (m *RolePermissionsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolePermissionsMutation) ClearedEdges

func (m *RolePermissionsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RolePermissionsMutation) ClearedFields

func (m *RolePermissionsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RolePermissionsMutation) Client

func (m RolePermissionsMutation) 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 (*RolePermissionsMutation) CreatedAt

func (m *RolePermissionsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RolePermissionsMutation) CreatedBy

func (m *RolePermissionsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RolePermissionsMutation) CreatedByCleared

func (m *RolePermissionsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*RolePermissionsMutation) EdgeCleared

func (m *RolePermissionsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RolePermissionsMutation) Field

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) FieldCleared

func (m *RolePermissionsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RolePermissionsMutation) Fields

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) ID

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) IDs

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) LionPermissionsCleared

func (m *RolePermissionsMutation) LionPermissionsCleared() bool

LionPermissionsCleared reports if the "lion_permissions" edge to the Permissions entity was cleared.

func (*RolePermissionsMutation) LionPermissionsID

func (m *RolePermissionsMutation) LionPermissionsID() (id int, exists bool)

LionPermissionsID returns the "lion_permissions" edge ID in the mutation.

func (*RolePermissionsMutation) LionPermissionsIDs

func (m *RolePermissionsMutation) LionPermissionsIDs() (ids []int)

LionPermissionsIDs returns the "lion_permissions" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionPermissionsID instead. It exists only for internal usage by the builders.

func (*RolePermissionsMutation) LionRolesCleared

func (m *RolePermissionsMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*RolePermissionsMutation) LionRolesID

func (m *RolePermissionsMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*RolePermissionsMutation) LionRolesIDs

func (m *RolePermissionsMutation) LionRolesIDs() (ids []int)

LionRolesIDs returns the "lion_roles" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionRolesID instead. It exists only for internal usage by the builders.

func (*RolePermissionsMutation) OldCreatedAt

func (m *RolePermissionsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the RolePermissions entity. If the RolePermissions 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 (*RolePermissionsMutation) OldCreatedBy

func (m *RolePermissionsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the RolePermissions entity. If the RolePermissions 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 (*RolePermissionsMutation) OldField

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) OldPermissionID

func (m *RolePermissionsMutation) OldPermissionID(ctx context.Context) (v int, err error)

OldPermissionID returns the old "permission_id" field's value of the RolePermissions entity. If the RolePermissions 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 (*RolePermissionsMutation) OldRoleID

func (m *RolePermissionsMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the RolePermissions entity. If the RolePermissions 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 (*RolePermissionsMutation) OldUpdatedAt

func (m *RolePermissionsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the RolePermissions entity. If the RolePermissions 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 (*RolePermissionsMutation) OldUpdatedBy

func (m *RolePermissionsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the RolePermissions entity. If the RolePermissions 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 (*RolePermissionsMutation) Op

func (m *RolePermissionsMutation) Op() Op

Op returns the operation name.

func (*RolePermissionsMutation) PermissionID

func (m *RolePermissionsMutation) PermissionID() (r int, exists bool)

PermissionID returns the value of the "permission_id" field in the mutation.

func (*RolePermissionsMutation) RemovedEdges

func (m *RolePermissionsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RolePermissionsMutation) RemovedIDs

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) ResetCreatedAt

func (m *RolePermissionsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RolePermissionsMutation) ResetCreatedBy

func (m *RolePermissionsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RolePermissionsMutation) ResetEdge

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) ResetField

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) ResetLionPermissions

func (m *RolePermissionsMutation) ResetLionPermissions()

ResetLionPermissions resets all changes to the "lion_permissions" edge.

func (*RolePermissionsMutation) ResetLionRoles

func (m *RolePermissionsMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*RolePermissionsMutation) ResetPermissionID

func (m *RolePermissionsMutation) ResetPermissionID()

ResetPermissionID resets all changes to the "permission_id" field.

func (*RolePermissionsMutation) ResetRoleID

func (m *RolePermissionsMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*RolePermissionsMutation) ResetUpdatedAt

func (m *RolePermissionsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RolePermissionsMutation) ResetUpdatedBy

func (m *RolePermissionsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RolePermissionsMutation) RoleID

func (m *RolePermissionsMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*RolePermissionsMutation) SetCreatedAt

func (m *RolePermissionsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RolePermissionsMutation) SetCreatedBy

func (m *RolePermissionsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RolePermissionsMutation) SetField

func (m *RolePermissionsMutation) 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 (*RolePermissionsMutation) SetLionPermissionsID

func (m *RolePermissionsMutation) SetLionPermissionsID(id int)

SetLionPermissionsID sets the "lion_permissions" edge to the Permissions entity by id.

func (*RolePermissionsMutation) SetLionRolesID

func (m *RolePermissionsMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*RolePermissionsMutation) SetOp

func (m *RolePermissionsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RolePermissionsMutation) SetPermissionID

func (m *RolePermissionsMutation) SetPermissionID(i int)

SetPermissionID sets the "permission_id" field.

func (*RolePermissionsMutation) SetRoleID

func (m *RolePermissionsMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*RolePermissionsMutation) SetUpdatedAt

func (m *RolePermissionsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RolePermissionsMutation) SetUpdatedBy

func (m *RolePermissionsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (RolePermissionsMutation) Tx

func (m RolePermissionsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RolePermissionsMutation) Type

func (m *RolePermissionsMutation) Type() string

Type returns the node type of this mutation (RolePermissions).

func (*RolePermissionsMutation) UpdatedAt

func (m *RolePermissionsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RolePermissionsMutation) UpdatedBy

func (m *RolePermissionsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RolePermissionsMutation) UpdatedByCleared

func (m *RolePermissionsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*RolePermissionsMutation) Where

Where appends a list predicates to the RolePermissionsMutation builder.

func (*RolePermissionsMutation) WhereP

func (m *RolePermissionsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RolePermissionsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RolePermissionsQuery

type RolePermissionsQuery struct {
	// contains filtered or unexported fields
}

RolePermissionsQuery is the builder for querying RolePermissions entities.

func (*RolePermissionsQuery) Aggregate

Aggregate returns a RolePermissionsSelect configured with the given aggregations.

func (*RolePermissionsQuery) All

All executes the query and returns a list of RolePermissionsSlice.

func (*RolePermissionsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*RolePermissionsQuery) Clone

Clone returns a duplicate of the RolePermissionsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RolePermissionsQuery) Count

func (_q *RolePermissionsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RolePermissionsQuery) CountX

func (_q *RolePermissionsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RolePermissionsQuery) Exist

func (_q *RolePermissionsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RolePermissionsQuery) ExistX

func (_q *RolePermissionsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RolePermissionsQuery) First

First returns the first RolePermissions entity from the query. Returns a *NotFoundError when no RolePermissions was found.

func (*RolePermissionsQuery) FirstID

func (_q *RolePermissionsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first RolePermissions ID from the query. Returns a *NotFoundError when no RolePermissions ID was found.

func (*RolePermissionsQuery) FirstIDX

func (_q *RolePermissionsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RolePermissionsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*RolePermissionsQuery) GroupBy

func (_q *RolePermissionsQuery) GroupBy(field string, fields ...string) *RolePermissionsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RolePermissions.Query().
	GroupBy(rolepermissions.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*RolePermissionsQuery) IDs

func (_q *RolePermissionsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of RolePermissions IDs.

func (*RolePermissionsQuery) IDsX

func (_q *RolePermissionsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RolePermissionsQuery) Limit

func (_q *RolePermissionsQuery) Limit(limit int) *RolePermissionsQuery

Limit the number of records to be returned by this query.

func (*RolePermissionsQuery) Offset

func (_q *RolePermissionsQuery) Offset(offset int) *RolePermissionsQuery

Offset to start from.

func (*RolePermissionsQuery) Only

Only returns a single RolePermissions entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RolePermissions entity is found. Returns a *NotFoundError when no RolePermissions entities are found.

func (*RolePermissionsQuery) OnlyID

func (_q *RolePermissionsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only RolePermissions ID in the query. Returns a *NotSingularError when more than one RolePermissions ID is found. Returns a *NotFoundError when no entities are found.

func (*RolePermissionsQuery) OnlyIDX

func (_q *RolePermissionsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RolePermissionsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*RolePermissionsQuery) Order

Order specifies how the records should be ordered.

func (*RolePermissionsQuery) QueryLionPermissions

func (_q *RolePermissionsQuery) QueryLionPermissions() *PermissionsQuery

QueryLionPermissions chains the current query on the "lion_permissions" edge.

func (*RolePermissionsQuery) QueryLionRoles

func (_q *RolePermissionsQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*RolePermissionsQuery) Select

func (_q *RolePermissionsQuery) Select(fields ...string) *RolePermissionsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.RolePermissions.Query().
	Select(rolepermissions.FieldCreatedAt).
	Scan(ctx, &v)

func (*RolePermissionsQuery) Unique

func (_q *RolePermissionsQuery) Unique(unique bool) *RolePermissionsQuery

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 (*RolePermissionsQuery) Where

Where adds a new predicate for the RolePermissionsQuery builder.

func (*RolePermissionsQuery) WithLionPermissions

func (_q *RolePermissionsQuery) WithLionPermissions(opts ...func(*PermissionsQuery)) *RolePermissionsQuery

WithLionPermissions tells the query-builder to eager-load the nodes that are connected to the "lion_permissions" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolePermissionsQuery) WithLionRoles

func (_q *RolePermissionsQuery) WithLionRoles(opts ...func(*RolesQuery)) *RolePermissionsQuery

WithLionRoles tells the query-builder to eager-load the nodes that are connected to the "lion_roles" edge. The optional arguments are used to configure the query builder of the edge.

type RolePermissionsSelect

type RolePermissionsSelect struct {
	*RolePermissionsQuery
	// contains filtered or unexported fields
}

RolePermissionsSelect is the builder for selecting fields of RolePermissions entities.

func (*RolePermissionsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*RolePermissionsSelect) Bool

func (s *RolePermissionsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) BoolX

func (s *RolePermissionsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RolePermissionsSelect) Bools

func (s *RolePermissionsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) BoolsX

func (s *RolePermissionsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RolePermissionsSelect) Float64

func (s *RolePermissionsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) Float64X

func (s *RolePermissionsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RolePermissionsSelect) Float64s

func (s *RolePermissionsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) Float64sX

func (s *RolePermissionsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RolePermissionsSelect) Int

func (s *RolePermissionsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) IntX

func (s *RolePermissionsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RolePermissionsSelect) Ints

func (s *RolePermissionsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) IntsX

func (s *RolePermissionsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RolePermissionsSelect) Scan

func (_s *RolePermissionsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RolePermissionsSelect) ScanX

func (s *RolePermissionsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RolePermissionsSelect) String

func (s *RolePermissionsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) StringX

func (s *RolePermissionsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RolePermissionsSelect) Strings

func (s *RolePermissionsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RolePermissionsSelect) StringsX

func (s *RolePermissionsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RolePermissionsSlice

type RolePermissionsSlice []*RolePermissions

RolePermissionsSlice is a parsable slice of RolePermissions.

type RolePermissionsUpdate

type RolePermissionsUpdate struct {
	// contains filtered or unexported fields
}

RolePermissionsUpdate is the builder for updating RolePermissions entities.

func (*RolePermissionsUpdate) AddCreatedBy

func (_u *RolePermissionsUpdate) AddCreatedBy(v int64) *RolePermissionsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*RolePermissionsUpdate) AddUpdatedBy

func (_u *RolePermissionsUpdate) AddUpdatedBy(v int64) *RolePermissionsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*RolePermissionsUpdate) ClearCreatedBy

func (_u *RolePermissionsUpdate) ClearCreatedBy() *RolePermissionsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*RolePermissionsUpdate) ClearLionPermissions

func (_u *RolePermissionsUpdate) ClearLionPermissions() *RolePermissionsUpdate

ClearLionPermissions clears the "lion_permissions" edge to the Permissions entity.

func (*RolePermissionsUpdate) ClearLionRoles

func (_u *RolePermissionsUpdate) ClearLionRoles() *RolePermissionsUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RolePermissionsUpdate) ClearUpdatedBy

func (_u *RolePermissionsUpdate) ClearUpdatedBy() *RolePermissionsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolePermissionsUpdate) Exec

Exec executes the query.

func (*RolePermissionsUpdate) ExecX

func (_u *RolePermissionsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePermissionsUpdate) Mutation

Mutation returns the RolePermissionsMutation object of the builder.

func (*RolePermissionsUpdate) Save

func (_u *RolePermissionsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RolePermissionsUpdate) SaveX

func (_u *RolePermissionsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RolePermissionsUpdate) SetCreatedBy

func (_u *RolePermissionsUpdate) SetCreatedBy(v int64) *RolePermissionsUpdate

SetCreatedBy sets the "created_by" field.

func (*RolePermissionsUpdate) SetLionPermissions

func (_u *RolePermissionsUpdate) SetLionPermissions(v *Permissions) *RolePermissionsUpdate

SetLionPermissions sets the "lion_permissions" edge to the Permissions entity.

func (*RolePermissionsUpdate) SetLionPermissionsID

func (_u *RolePermissionsUpdate) SetLionPermissionsID(id int) *RolePermissionsUpdate

SetLionPermissionsID sets the "lion_permissions" edge to the Permissions entity by ID.

func (*RolePermissionsUpdate) SetLionRoles

func (_u *RolePermissionsUpdate) SetLionRoles(v *Roles) *RolePermissionsUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RolePermissionsUpdate) SetLionRolesID

func (_u *RolePermissionsUpdate) SetLionRolesID(id int) *RolePermissionsUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RolePermissionsUpdate) SetNillableCreatedBy

func (_u *RolePermissionsUpdate) SetNillableCreatedBy(v *int64) *RolePermissionsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolePermissionsUpdate) SetNillablePermissionID

func (_u *RolePermissionsUpdate) SetNillablePermissionID(v *int) *RolePermissionsUpdate

SetNillablePermissionID sets the "permission_id" field if the given value is not nil.

func (*RolePermissionsUpdate) SetNillableRoleID

func (_u *RolePermissionsUpdate) SetNillableRoleID(v *int) *RolePermissionsUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*RolePermissionsUpdate) SetNillableUpdatedBy

func (_u *RolePermissionsUpdate) SetNillableUpdatedBy(v *int64) *RolePermissionsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolePermissionsUpdate) SetPermissionID

func (_u *RolePermissionsUpdate) SetPermissionID(v int) *RolePermissionsUpdate

SetPermissionID sets the "permission_id" field.

func (*RolePermissionsUpdate) SetRoleID

SetRoleID sets the "role_id" field.

func (*RolePermissionsUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*RolePermissionsUpdate) SetUpdatedBy

func (_u *RolePermissionsUpdate) SetUpdatedBy(v int64) *RolePermissionsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RolePermissionsUpdate) Where

Where appends a list predicates to the RolePermissionsUpdate builder.

type RolePermissionsUpdateOne

type RolePermissionsUpdateOne struct {
	// contains filtered or unexported fields
}

RolePermissionsUpdateOne is the builder for updating a single RolePermissions entity.

func (*RolePermissionsUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*RolePermissionsUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*RolePermissionsUpdateOne) ClearCreatedBy

func (_u *RolePermissionsUpdateOne) ClearCreatedBy() *RolePermissionsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*RolePermissionsUpdateOne) ClearLionPermissions

func (_u *RolePermissionsUpdateOne) ClearLionPermissions() *RolePermissionsUpdateOne

ClearLionPermissions clears the "lion_permissions" edge to the Permissions entity.

func (*RolePermissionsUpdateOne) ClearLionRoles

func (_u *RolePermissionsUpdateOne) ClearLionRoles() *RolePermissionsUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RolePermissionsUpdateOne) ClearUpdatedBy

func (_u *RolePermissionsUpdateOne) ClearUpdatedBy() *RolePermissionsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolePermissionsUpdateOne) Exec

Exec executes the query on the entity.

func (*RolePermissionsUpdateOne) ExecX

func (_u *RolePermissionsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePermissionsUpdateOne) Mutation

Mutation returns the RolePermissionsMutation object of the builder.

func (*RolePermissionsUpdateOne) Save

Save executes the query and returns the updated RolePermissions entity.

func (*RolePermissionsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*RolePermissionsUpdateOne) Select

func (_u *RolePermissionsUpdateOne) Select(field string, fields ...string) *RolePermissionsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RolePermissionsUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*RolePermissionsUpdateOne) SetLionPermissions

SetLionPermissions sets the "lion_permissions" edge to the Permissions entity.

func (*RolePermissionsUpdateOne) SetLionPermissionsID

func (_u *RolePermissionsUpdateOne) SetLionPermissionsID(id int) *RolePermissionsUpdateOne

SetLionPermissionsID sets the "lion_permissions" edge to the Permissions entity by ID.

func (*RolePermissionsUpdateOne) SetLionRoles

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RolePermissionsUpdateOne) SetLionRolesID

func (_u *RolePermissionsUpdateOne) SetLionRolesID(id int) *RolePermissionsUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RolePermissionsUpdateOne) SetNillableCreatedBy

func (_u *RolePermissionsUpdateOne) SetNillableCreatedBy(v *int64) *RolePermissionsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolePermissionsUpdateOne) SetNillablePermissionID

func (_u *RolePermissionsUpdateOne) SetNillablePermissionID(v *int) *RolePermissionsUpdateOne

SetNillablePermissionID sets the "permission_id" field if the given value is not nil.

func (*RolePermissionsUpdateOne) SetNillableRoleID

func (_u *RolePermissionsUpdateOne) SetNillableRoleID(v *int) *RolePermissionsUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*RolePermissionsUpdateOne) SetNillableUpdatedBy

func (_u *RolePermissionsUpdateOne) SetNillableUpdatedBy(v *int64) *RolePermissionsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolePermissionsUpdateOne) SetPermissionID

func (_u *RolePermissionsUpdateOne) SetPermissionID(v int) *RolePermissionsUpdateOne

SetPermissionID sets the "permission_id" field.

func (*RolePermissionsUpdateOne) SetRoleID

SetRoleID sets the "role_id" field.

func (*RolePermissionsUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*RolePermissionsUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*RolePermissionsUpdateOne) Where

Where appends a list predicates to the RolePermissionsUpdate builder.

type Roles

type Roles struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 角色名称,用于系统内部显示和业务逻辑
	Name string `json:"name,omitempty"`
	// 角色类型:TYPE_SYSTEM=系统内置角色,TYPE_CUSTOM=自定义角色,TYPE_TEMPLATE=模板角色
	RoleType int `json:"role_type,omitempty"`
	// 角色状态:STATUS_ACTIVE=正常启用,STATUS_DISABLED=禁用状态
	RoleStatus int `json:"role_status,omitempty"`
	// 角色排序顺序,用于同级角色的显示顺序,数值越小排序越靠前,建议使用 10 的倍数便于后续插入,默认值:100,范围:1-9999
	SortOrder int `json:"sort_order,omitempty"`
	// 用途详细描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RolesQuery when eager-loading is set.
	Edges RolesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Roles is the model entity for the Roles schema.

func (*Roles) QueryLionDepartmentRoles

func (_m *Roles) QueryLionDepartmentRoles() *DepartmentRolesQuery

QueryLionDepartmentRoles queries the "lion_department_roles" edge of the Roles entity.

func (*Roles) QueryLionRoleGroups

func (_m *Roles) QueryLionRoleGroups() *GroupRolesQuery

QueryLionRoleGroups queries the "lion_role_groups" edge of the Roles entity.

func (*Roles) QueryLionRolePermissions

func (_m *Roles) QueryLionRolePermissions() *RolePermissionsQuery

QueryLionRolePermissions queries the "lion_role_permissions" edge of the Roles entity.

func (*Roles) QueryLionUserRoles

func (_m *Roles) QueryLionUserRoles() *UserRolesQuery

QueryLionUserRoles queries the "lion_user_roles" edge of the Roles entity.

func (*Roles) String

func (_m *Roles) String() string

String implements the fmt.Stringer.

func (*Roles) Unwrap

func (_m *Roles) Unwrap() *Roles

Unwrap unwraps the Roles 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 (*Roles) Update

func (_m *Roles) Update() *RolesUpdateOne

Update returns a builder for updating this Roles. Note that you need to call Roles.Unwrap() before calling this method if this Roles was returned from a transaction, and the transaction was committed or rolled back.

func (*Roles) Value

func (_m *Roles) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Roles. This includes values selected through modifiers, order, etc.

type RolesClient

type RolesClient struct {
	// contains filtered or unexported fields
}

RolesClient is a client for the Roles schema.

func NewRolesClient

func NewRolesClient(c config) *RolesClient

NewRolesClient returns a client for the Roles from the given config.

func (*RolesClient) Create

func (c *RolesClient) Create() *RolesCreate

Create returns a builder for creating a Roles entity.

func (*RolesClient) CreateBulk

func (c *RolesClient) CreateBulk(builders ...*RolesCreate) *RolesCreateBulk

CreateBulk returns a builder for creating a bulk of Roles entities.

func (*RolesClient) Delete

func (c *RolesClient) Delete() *RolesDelete

Delete returns a delete builder for Roles.

func (*RolesClient) DeleteOne

func (c *RolesClient) DeleteOne(_m *Roles) *RolesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RolesClient) DeleteOneID

func (c *RolesClient) DeleteOneID(id int) *RolesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RolesClient) Get

func (c *RolesClient) Get(ctx context.Context, id int) (*Roles, error)

Get returns a Roles entity by its id.

func (*RolesClient) GetX

func (c *RolesClient) GetX(ctx context.Context, id int) *Roles

GetX is like Get, but panics if an error occurs.

func (*RolesClient) Hooks

func (c *RolesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RolesClient) Intercept

func (c *RolesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `roles.Intercept(f(g(h())))`.

func (*RolesClient) Interceptors

func (c *RolesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RolesClient) MapCreateBulk

func (c *RolesClient) MapCreateBulk(slice any, setFunc func(*RolesCreate, int)) *RolesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*RolesClient) Query

func (c *RolesClient) Query() *RolesQuery

Query returns a query builder for Roles.

func (*RolesClient) QueryLionDepartmentRoles

func (c *RolesClient) QueryLionDepartmentRoles(_m *Roles) *DepartmentRolesQuery

QueryLionDepartmentRoles queries the lion_department_roles edge of a Roles.

func (*RolesClient) QueryLionRoleGroups

func (c *RolesClient) QueryLionRoleGroups(_m *Roles) *GroupRolesQuery

QueryLionRoleGroups queries the lion_role_groups edge of a Roles.

func (*RolesClient) QueryLionRolePermissions

func (c *RolesClient) QueryLionRolePermissions(_m *Roles) *RolePermissionsQuery

QueryLionRolePermissions queries the lion_role_permissions edge of a Roles.

func (*RolesClient) QueryLionUserRoles

func (c *RolesClient) QueryLionUserRoles(_m *Roles) *UserRolesQuery

QueryLionUserRoles queries the lion_user_roles edge of a Roles.

func (*RolesClient) Update

func (c *RolesClient) Update() *RolesUpdate

Update returns an update builder for Roles.

func (*RolesClient) UpdateOne

func (c *RolesClient) UpdateOne(_m *Roles) *RolesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RolesClient) UpdateOneID

func (c *RolesClient) UpdateOneID(id int) *RolesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RolesClient) Use

func (c *RolesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `roles.Hooks(f(g(h())))`.

type RolesCreate

type RolesCreate struct {
	// contains filtered or unexported fields
}

RolesCreate is the builder for creating a Roles entity.

func (*RolesCreate) AddLionDepartmentRoleIDs

func (_c *RolesCreate) AddLionDepartmentRoleIDs(ids ...int) *RolesCreate

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*RolesCreate) AddLionDepartmentRoles

func (_c *RolesCreate) AddLionDepartmentRoles(v ...*DepartmentRoles) *RolesCreate

AddLionDepartmentRoles adds the "lion_department_roles" edges to the DepartmentRoles entity.

func (*RolesCreate) AddLionRoleGroupIDs

func (_c *RolesCreate) AddLionRoleGroupIDs(ids ...int) *RolesCreate

AddLionRoleGroupIDs adds the "lion_role_groups" edge to the GroupRoles entity by IDs.

func (*RolesCreate) AddLionRoleGroups

func (_c *RolesCreate) AddLionRoleGroups(v ...*GroupRoles) *RolesCreate

AddLionRoleGroups adds the "lion_role_groups" edges to the GroupRoles entity.

func (*RolesCreate) AddLionRolePermissionIDs

func (_c *RolesCreate) AddLionRolePermissionIDs(ids ...int) *RolesCreate

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*RolesCreate) AddLionRolePermissions

func (_c *RolesCreate) AddLionRolePermissions(v ...*RolePermissions) *RolesCreate

AddLionRolePermissions adds the "lion_role_permissions" edges to the RolePermissions entity.

func (*RolesCreate) AddLionUserRoleIDs

func (_c *RolesCreate) AddLionUserRoleIDs(ids ...int) *RolesCreate

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*RolesCreate) AddLionUserRoles

func (_c *RolesCreate) AddLionUserRoles(v ...*UserRoles) *RolesCreate

AddLionUserRoles adds the "lion_user_roles" edges to the UserRoles entity.

func (*RolesCreate) Exec

func (_c *RolesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RolesCreate) ExecX

func (_c *RolesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolesCreate) Mutation

func (_c *RolesCreate) Mutation() *RolesMutation

Mutation returns the RolesMutation object of the builder.

func (*RolesCreate) Save

func (_c *RolesCreate) Save(ctx context.Context) (*Roles, error)

Save creates the Roles in the database.

func (*RolesCreate) SaveX

func (_c *RolesCreate) SaveX(ctx context.Context) *Roles

SaveX calls Save and panics if Save returns an error.

func (*RolesCreate) SetCreatedAt

func (_c *RolesCreate) SetCreatedAt(v time.Time) *RolesCreate

SetCreatedAt sets the "created_at" field.

func (*RolesCreate) SetCreatedBy

func (_c *RolesCreate) SetCreatedBy(v int64) *RolesCreate

SetCreatedBy sets the "created_by" field.

func (*RolesCreate) SetDeletedAt

func (_c *RolesCreate) SetDeletedAt(v time.Time) *RolesCreate

SetDeletedAt sets the "deleted_at" field.

func (*RolesCreate) SetDescription

func (_c *RolesCreate) SetDescription(v string) *RolesCreate

SetDescription sets the "description" field.

func (*RolesCreate) SetName

func (_c *RolesCreate) SetName(v string) *RolesCreate

SetName sets the "name" field.

func (*RolesCreate) SetNillableCreatedAt

func (_c *RolesCreate) SetNillableCreatedAt(v *time.Time) *RolesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RolesCreate) SetNillableCreatedBy

func (_c *RolesCreate) SetNillableCreatedBy(v *int64) *RolesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolesCreate) SetNillableDeletedAt

func (_c *RolesCreate) SetNillableDeletedAt(v *time.Time) *RolesCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RolesCreate) SetNillableDescription

func (_c *RolesCreate) SetNillableDescription(v *string) *RolesCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RolesCreate) SetNillableRoleStatus

func (_c *RolesCreate) SetNillableRoleStatus(v *int) *RolesCreate

SetNillableRoleStatus sets the "role_status" field if the given value is not nil.

func (*RolesCreate) SetNillableRoleType

func (_c *RolesCreate) SetNillableRoleType(v *int) *RolesCreate

SetNillableRoleType sets the "role_type" field if the given value is not nil.

func (*RolesCreate) SetNillableSortOrder

func (_c *RolesCreate) SetNillableSortOrder(v *int) *RolesCreate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*RolesCreate) SetNillableUpdatedAt

func (_c *RolesCreate) SetNillableUpdatedAt(v *time.Time) *RolesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RolesCreate) SetNillableUpdatedBy

func (_c *RolesCreate) SetNillableUpdatedBy(v *int64) *RolesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolesCreate) SetRoleStatus

func (_c *RolesCreate) SetRoleStatus(v int) *RolesCreate

SetRoleStatus sets the "role_status" field.

func (*RolesCreate) SetRoleType

func (_c *RolesCreate) SetRoleType(v int) *RolesCreate

SetRoleType sets the "role_type" field.

func (*RolesCreate) SetSortOrder

func (_c *RolesCreate) SetSortOrder(v int) *RolesCreate

SetSortOrder sets the "sort_order" field.

func (*RolesCreate) SetUpdatedAt

func (_c *RolesCreate) SetUpdatedAt(v time.Time) *RolesCreate

SetUpdatedAt sets the "updated_at" field.

func (*RolesCreate) SetUpdatedBy

func (_c *RolesCreate) SetUpdatedBy(v int64) *RolesCreate

SetUpdatedBy sets the "updated_by" field.

type RolesCreateBulk

type RolesCreateBulk struct {
	// contains filtered or unexported fields
}

RolesCreateBulk is the builder for creating many Roles entities in bulk.

func (*RolesCreateBulk) Exec

func (_c *RolesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RolesCreateBulk) ExecX

func (_c *RolesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolesCreateBulk) Save

func (_c *RolesCreateBulk) Save(ctx context.Context) ([]*Roles, error)

Save creates the Roles entities in the database.

func (*RolesCreateBulk) SaveX

func (_c *RolesCreateBulk) SaveX(ctx context.Context) []*Roles

SaveX is like Save, but panics if an error occurs.

type RolesDelete

type RolesDelete struct {
	// contains filtered or unexported fields
}

RolesDelete is the builder for deleting a Roles entity.

func (*RolesDelete) Exec

func (_d *RolesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RolesDelete) ExecX

func (_d *RolesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RolesDelete) Where

func (_d *RolesDelete) Where(ps ...predicate.Roles) *RolesDelete

Where appends a list predicates to the RolesDelete builder.

type RolesDeleteOne

type RolesDeleteOne struct {
	// contains filtered or unexported fields
}

RolesDeleteOne is the builder for deleting a single Roles entity.

func (*RolesDeleteOne) Exec

func (_d *RolesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RolesDeleteOne) ExecX

func (_d *RolesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolesDeleteOne) Where

func (_d *RolesDeleteOne) Where(ps ...predicate.Roles) *RolesDeleteOne

Where appends a list predicates to the RolesDelete builder.

type RolesEdges

type RolesEdges struct {
	// LionRolePermissions holds the value of the lion_role_permissions edge.
	LionRolePermissions []*RolePermissions `json:"lion_role_permissions,omitempty"`
	// LionUserRoles holds the value of the lion_user_roles edge.
	LionUserRoles []*UserRoles `json:"lion_user_roles,omitempty"`
	// LionRoleGroups holds the value of the lion_role_groups edge.
	LionRoleGroups []*GroupRoles `json:"lion_role_groups,omitempty"`
	// LionDepartmentRoles holds the value of the lion_department_roles edge.
	LionDepartmentRoles []*DepartmentRoles `json:"lion_department_roles,omitempty"`
	// contains filtered or unexported fields
}

RolesEdges holds the relations/edges for other nodes in the graph.

func (RolesEdges) LionDepartmentRolesOrErr

func (e RolesEdges) LionDepartmentRolesOrErr() ([]*DepartmentRoles, error)

LionDepartmentRolesOrErr returns the LionDepartmentRoles value or an error if the edge was not loaded in eager-loading.

func (RolesEdges) LionRoleGroupsOrErr

func (e RolesEdges) LionRoleGroupsOrErr() ([]*GroupRoles, error)

LionRoleGroupsOrErr returns the LionRoleGroups value or an error if the edge was not loaded in eager-loading.

func (RolesEdges) LionRolePermissionsOrErr

func (e RolesEdges) LionRolePermissionsOrErr() ([]*RolePermissions, error)

LionRolePermissionsOrErr returns the LionRolePermissions value or an error if the edge was not loaded in eager-loading.

func (RolesEdges) LionUserRolesOrErr

func (e RolesEdges) LionUserRolesOrErr() ([]*UserRoles, error)

LionUserRolesOrErr returns the LionUserRoles value or an error if the edge was not loaded in eager-loading.

type RolesGroupBy

type RolesGroupBy struct {
	// contains filtered or unexported fields
}

RolesGroupBy is the group-by builder for Roles entities.

func (*RolesGroupBy) Aggregate

func (_g *RolesGroupBy) Aggregate(fns ...AggregateFunc) *RolesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RolesGroupBy) Bool

func (s *RolesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) BoolX

func (s *RolesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RolesGroupBy) Bools

func (s *RolesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) BoolsX

func (s *RolesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RolesGroupBy) Float64

func (s *RolesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) Float64X

func (s *RolesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RolesGroupBy) Float64s

func (s *RolesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) Float64sX

func (s *RolesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RolesGroupBy) Int

func (s *RolesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) IntX

func (s *RolesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RolesGroupBy) Ints

func (s *RolesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) IntsX

func (s *RolesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RolesGroupBy) Scan

func (_g *RolesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RolesGroupBy) ScanX

func (s *RolesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RolesGroupBy) String

func (s *RolesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) StringX

func (s *RolesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RolesGroupBy) Strings

func (s *RolesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RolesGroupBy) StringsX

func (s *RolesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RolesMutation

type RolesMutation struct {
	// contains filtered or unexported fields
}

RolesMutation represents an operation that mutates the Roles nodes in the graph.

func (*RolesMutation) AddCreatedBy

func (m *RolesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RolesMutation) AddField

func (m *RolesMutation) 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 (*RolesMutation) AddLionDepartmentRoleIDs

func (m *RolesMutation) AddLionDepartmentRoleIDs(ids ...int)

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by ids.

func (*RolesMutation) AddLionRoleGroupIDs

func (m *RolesMutation) AddLionRoleGroupIDs(ids ...int)

AddLionRoleGroupIDs adds the "lion_role_groups" edge to the GroupRoles entity by ids.

func (*RolesMutation) AddLionRolePermissionIDs

func (m *RolesMutation) AddLionRolePermissionIDs(ids ...int)

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by ids.

func (*RolesMutation) AddLionUserRoleIDs

func (m *RolesMutation) AddLionUserRoleIDs(ids ...int)

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by ids.

func (*RolesMutation) AddRoleStatus

func (m *RolesMutation) AddRoleStatus(i int)

AddRoleStatus adds i to the "role_status" field.

func (*RolesMutation) AddRoleType

func (m *RolesMutation) AddRoleType(i int)

AddRoleType adds i to the "role_type" field.

func (*RolesMutation) AddSortOrder

func (m *RolesMutation) AddSortOrder(i int)

AddSortOrder adds i to the "sort_order" field.

func (*RolesMutation) AddUpdatedBy

func (m *RolesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RolesMutation) AddedCreatedBy

func (m *RolesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RolesMutation) AddedEdges

func (m *RolesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RolesMutation) AddedField

func (m *RolesMutation) 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 (*RolesMutation) AddedFields

func (m *RolesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RolesMutation) AddedIDs

func (m *RolesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RolesMutation) AddedRoleStatus

func (m *RolesMutation) AddedRoleStatus() (r int, exists bool)

AddedRoleStatus returns the value that was added to the "role_status" field in this mutation.

func (*RolesMutation) AddedRoleType

func (m *RolesMutation) AddedRoleType() (r int, exists bool)

AddedRoleType returns the value that was added to the "role_type" field in this mutation.

func (*RolesMutation) AddedSortOrder

func (m *RolesMutation) AddedSortOrder() (r int, exists bool)

AddedSortOrder returns the value that was added to the "sort_order" field in this mutation.

func (*RolesMutation) AddedUpdatedBy

func (m *RolesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RolesMutation) ClearCreatedBy

func (m *RolesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*RolesMutation) ClearDeletedAt

func (m *RolesMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RolesMutation) ClearEdge

func (m *RolesMutation) 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 (*RolesMutation) ClearField

func (m *RolesMutation) 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 (*RolesMutation) ClearLionDepartmentRoles

func (m *RolesMutation) ClearLionDepartmentRoles()

ClearLionDepartmentRoles clears the "lion_department_roles" edge to the DepartmentRoles entity.

func (*RolesMutation) ClearLionRoleGroups

func (m *RolesMutation) ClearLionRoleGroups()

ClearLionRoleGroups clears the "lion_role_groups" edge to the GroupRoles entity.

func (*RolesMutation) ClearLionRolePermissions

func (m *RolesMutation) ClearLionRolePermissions()

ClearLionRolePermissions clears the "lion_role_permissions" edge to the RolePermissions entity.

func (*RolesMutation) ClearLionUserRoles

func (m *RolesMutation) ClearLionUserRoles()

ClearLionUserRoles clears the "lion_user_roles" edge to the UserRoles entity.

func (*RolesMutation) ClearUpdatedBy

func (m *RolesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolesMutation) ClearedEdges

func (m *RolesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RolesMutation) ClearedFields

func (m *RolesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RolesMutation) Client

func (m RolesMutation) 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 (*RolesMutation) CreatedAt

func (m *RolesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RolesMutation) CreatedBy

func (m *RolesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RolesMutation) CreatedByCleared

func (m *RolesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*RolesMutation) DeletedAt

func (m *RolesMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*RolesMutation) DeletedAtCleared

func (m *RolesMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*RolesMutation) Description

func (m *RolesMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*RolesMutation) EdgeCleared

func (m *RolesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RolesMutation) Field

func (m *RolesMutation) 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 (*RolesMutation) FieldCleared

func (m *RolesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RolesMutation) Fields

func (m *RolesMutation) 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 (*RolesMutation) ID

func (m *RolesMutation) 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 (*RolesMutation) IDs

func (m *RolesMutation) 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 (*RolesMutation) LionDepartmentRolesCleared

func (m *RolesMutation) LionDepartmentRolesCleared() bool

LionDepartmentRolesCleared reports if the "lion_department_roles" edge to the DepartmentRoles entity was cleared.

func (*RolesMutation) LionDepartmentRolesIDs

func (m *RolesMutation) LionDepartmentRolesIDs() (ids []int)

LionDepartmentRolesIDs returns the "lion_department_roles" edge IDs in the mutation.

func (*RolesMutation) LionRoleGroupsCleared

func (m *RolesMutation) LionRoleGroupsCleared() bool

LionRoleGroupsCleared reports if the "lion_role_groups" edge to the GroupRoles entity was cleared.

func (*RolesMutation) LionRoleGroupsIDs

func (m *RolesMutation) LionRoleGroupsIDs() (ids []int)

LionRoleGroupsIDs returns the "lion_role_groups" edge IDs in the mutation.

func (*RolesMutation) LionRolePermissionsCleared

func (m *RolesMutation) LionRolePermissionsCleared() bool

LionRolePermissionsCleared reports if the "lion_role_permissions" edge to the RolePermissions entity was cleared.

func (*RolesMutation) LionRolePermissionsIDs

func (m *RolesMutation) LionRolePermissionsIDs() (ids []int)

LionRolePermissionsIDs returns the "lion_role_permissions" edge IDs in the mutation.

func (*RolesMutation) LionUserRolesCleared

func (m *RolesMutation) LionUserRolesCleared() bool

LionUserRolesCleared reports if the "lion_user_roles" edge to the UserRoles entity was cleared.

func (*RolesMutation) LionUserRolesIDs

func (m *RolesMutation) LionUserRolesIDs() (ids []int)

LionUserRolesIDs returns the "lion_user_roles" edge IDs in the mutation.

func (*RolesMutation) Name

func (m *RolesMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*RolesMutation) OldCreatedAt

func (m *RolesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldCreatedBy

func (m *RolesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldDeletedAt

func (m *RolesMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldDescription

func (m *RolesMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldField

func (m *RolesMutation) 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 (*RolesMutation) OldName

func (m *RolesMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldRoleStatus

func (m *RolesMutation) OldRoleStatus(ctx context.Context) (v int, err error)

OldRoleStatus returns the old "role_status" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldRoleType

func (m *RolesMutation) OldRoleType(ctx context.Context) (v int, err error)

OldRoleType returns the old "role_type" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldSortOrder

func (m *RolesMutation) OldSortOrder(ctx context.Context) (v int, err error)

OldSortOrder returns the old "sort_order" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldUpdatedAt

func (m *RolesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Roles entity. If the Roles 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 (*RolesMutation) OldUpdatedBy

func (m *RolesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Roles entity. If the Roles 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 (*RolesMutation) Op

func (m *RolesMutation) Op() Op

Op returns the operation name.

func (*RolesMutation) RemoveLionDepartmentRoleIDs

func (m *RolesMutation) RemoveLionDepartmentRoleIDs(ids ...int)

RemoveLionDepartmentRoleIDs removes the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*RolesMutation) RemoveLionRoleGroupIDs

func (m *RolesMutation) RemoveLionRoleGroupIDs(ids ...int)

RemoveLionRoleGroupIDs removes the "lion_role_groups" edge to the GroupRoles entity by IDs.

func (*RolesMutation) RemoveLionRolePermissionIDs

func (m *RolesMutation) RemoveLionRolePermissionIDs(ids ...int)

RemoveLionRolePermissionIDs removes the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*RolesMutation) RemoveLionUserRoleIDs

func (m *RolesMutation) RemoveLionUserRoleIDs(ids ...int)

RemoveLionUserRoleIDs removes the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*RolesMutation) RemovedEdges

func (m *RolesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RolesMutation) RemovedIDs

func (m *RolesMutation) 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 (*RolesMutation) RemovedLionDepartmentRolesIDs

func (m *RolesMutation) RemovedLionDepartmentRolesIDs() (ids []int)

RemovedLionDepartmentRoles returns the removed IDs of the "lion_department_roles" edge to the DepartmentRoles entity.

func (*RolesMutation) RemovedLionRoleGroupsIDs

func (m *RolesMutation) RemovedLionRoleGroupsIDs() (ids []int)

RemovedLionRoleGroups returns the removed IDs of the "lion_role_groups" edge to the GroupRoles entity.

func (*RolesMutation) RemovedLionRolePermissionsIDs

func (m *RolesMutation) RemovedLionRolePermissionsIDs() (ids []int)

RemovedLionRolePermissions returns the removed IDs of the "lion_role_permissions" edge to the RolePermissions entity.

func (*RolesMutation) RemovedLionUserRolesIDs

func (m *RolesMutation) RemovedLionUserRolesIDs() (ids []int)

RemovedLionUserRoles returns the removed IDs of the "lion_user_roles" edge to the UserRoles entity.

func (*RolesMutation) ResetCreatedAt

func (m *RolesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RolesMutation) ResetCreatedBy

func (m *RolesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RolesMutation) ResetDeletedAt

func (m *RolesMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*RolesMutation) ResetDescription

func (m *RolesMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RolesMutation) ResetEdge

func (m *RolesMutation) 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 (*RolesMutation) ResetField

func (m *RolesMutation) 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 (*RolesMutation) ResetLionDepartmentRoles

func (m *RolesMutation) ResetLionDepartmentRoles()

ResetLionDepartmentRoles resets all changes to the "lion_department_roles" edge.

func (*RolesMutation) ResetLionRoleGroups

func (m *RolesMutation) ResetLionRoleGroups()

ResetLionRoleGroups resets all changes to the "lion_role_groups" edge.

func (*RolesMutation) ResetLionRolePermissions

func (m *RolesMutation) ResetLionRolePermissions()

ResetLionRolePermissions resets all changes to the "lion_role_permissions" edge.

func (*RolesMutation) ResetLionUserRoles

func (m *RolesMutation) ResetLionUserRoles()

ResetLionUserRoles resets all changes to the "lion_user_roles" edge.

func (*RolesMutation) ResetName

func (m *RolesMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RolesMutation) ResetRoleStatus

func (m *RolesMutation) ResetRoleStatus()

ResetRoleStatus resets all changes to the "role_status" field.

func (*RolesMutation) ResetRoleType

func (m *RolesMutation) ResetRoleType()

ResetRoleType resets all changes to the "role_type" field.

func (*RolesMutation) ResetSortOrder

func (m *RolesMutation) ResetSortOrder()

ResetSortOrder resets all changes to the "sort_order" field.

func (*RolesMutation) ResetUpdatedAt

func (m *RolesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RolesMutation) ResetUpdatedBy

func (m *RolesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RolesMutation) RoleStatus

func (m *RolesMutation) RoleStatus() (r int, exists bool)

RoleStatus returns the value of the "role_status" field in the mutation.

func (*RolesMutation) RoleType

func (m *RolesMutation) RoleType() (r int, exists bool)

RoleType returns the value of the "role_type" field in the mutation.

func (*RolesMutation) SetCreatedAt

func (m *RolesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RolesMutation) SetCreatedBy

func (m *RolesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RolesMutation) SetDeletedAt

func (m *RolesMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*RolesMutation) SetDescription

func (m *RolesMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RolesMutation) SetField

func (m *RolesMutation) 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 (*RolesMutation) SetName

func (m *RolesMutation) SetName(s string)

SetName sets the "name" field.

func (*RolesMutation) SetOp

func (m *RolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RolesMutation) SetRoleStatus

func (m *RolesMutation) SetRoleStatus(i int)

SetRoleStatus sets the "role_status" field.

func (*RolesMutation) SetRoleType

func (m *RolesMutation) SetRoleType(i int)

SetRoleType sets the "role_type" field.

func (*RolesMutation) SetSortOrder

func (m *RolesMutation) SetSortOrder(i int)

SetSortOrder sets the "sort_order" field.

func (*RolesMutation) SetUpdatedAt

func (m *RolesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RolesMutation) SetUpdatedBy

func (m *RolesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*RolesMutation) SortOrder

func (m *RolesMutation) SortOrder() (r int, exists bool)

SortOrder returns the value of the "sort_order" field in the mutation.

func (RolesMutation) Tx

func (m RolesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RolesMutation) Type

func (m *RolesMutation) Type() string

Type returns the node type of this mutation (Roles).

func (*RolesMutation) UpdatedAt

func (m *RolesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RolesMutation) UpdatedBy

func (m *RolesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RolesMutation) UpdatedByCleared

func (m *RolesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*RolesMutation) Where

func (m *RolesMutation) Where(ps ...predicate.Roles)

Where appends a list predicates to the RolesMutation builder.

func (*RolesMutation) WhereP

func (m *RolesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RolesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RolesQuery

type RolesQuery struct {
	// contains filtered or unexported fields
}

RolesQuery is the builder for querying Roles entities.

func (*RolesQuery) Aggregate

func (_q *RolesQuery) Aggregate(fns ...AggregateFunc) *RolesSelect

Aggregate returns a RolesSelect configured with the given aggregations.

func (*RolesQuery) All

func (_q *RolesQuery) All(ctx context.Context) ([]*Roles, error)

All executes the query and returns a list of RolesSlice.

func (*RolesQuery) AllX

func (_q *RolesQuery) AllX(ctx context.Context) []*Roles

AllX is like All, but panics if an error occurs.

func (*RolesQuery) Clone

func (_q *RolesQuery) Clone() *RolesQuery

Clone returns a duplicate of the RolesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RolesQuery) Count

func (_q *RolesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RolesQuery) CountX

func (_q *RolesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RolesQuery) Exist

func (_q *RolesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RolesQuery) ExistX

func (_q *RolesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RolesQuery) First

func (_q *RolesQuery) First(ctx context.Context) (*Roles, error)

First returns the first Roles entity from the query. Returns a *NotFoundError when no Roles was found.

func (*RolesQuery) FirstID

func (_q *RolesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Roles ID from the query. Returns a *NotFoundError when no Roles ID was found.

func (*RolesQuery) FirstIDX

func (_q *RolesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RolesQuery) FirstX

func (_q *RolesQuery) FirstX(ctx context.Context) *Roles

FirstX is like First, but panics if an error occurs.

func (*RolesQuery) GroupBy

func (_q *RolesQuery) GroupBy(field string, fields ...string) *RolesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Roles.Query().
	GroupBy(roles.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*RolesQuery) IDs

func (_q *RolesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Roles IDs.

func (*RolesQuery) IDsX

func (_q *RolesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RolesQuery) Limit

func (_q *RolesQuery) Limit(limit int) *RolesQuery

Limit the number of records to be returned by this query.

func (*RolesQuery) Offset

func (_q *RolesQuery) Offset(offset int) *RolesQuery

Offset to start from.

func (*RolesQuery) Only

func (_q *RolesQuery) Only(ctx context.Context) (*Roles, error)

Only returns a single Roles entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Roles entity is found. Returns a *NotFoundError when no Roles entities are found.

func (*RolesQuery) OnlyID

func (_q *RolesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Roles ID in the query. Returns a *NotSingularError when more than one Roles ID is found. Returns a *NotFoundError when no entities are found.

func (*RolesQuery) OnlyIDX

func (_q *RolesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RolesQuery) OnlyX

func (_q *RolesQuery) OnlyX(ctx context.Context) *Roles

OnlyX is like Only, but panics if an error occurs.

func (*RolesQuery) Order

func (_q *RolesQuery) Order(o ...roles.OrderOption) *RolesQuery

Order specifies how the records should be ordered.

func (*RolesQuery) QueryLionDepartmentRoles

func (_q *RolesQuery) QueryLionDepartmentRoles() *DepartmentRolesQuery

QueryLionDepartmentRoles chains the current query on the "lion_department_roles" edge.

func (*RolesQuery) QueryLionRoleGroups

func (_q *RolesQuery) QueryLionRoleGroups() *GroupRolesQuery

QueryLionRoleGroups chains the current query on the "lion_role_groups" edge.

func (*RolesQuery) QueryLionRolePermissions

func (_q *RolesQuery) QueryLionRolePermissions() *RolePermissionsQuery

QueryLionRolePermissions chains the current query on the "lion_role_permissions" edge.

func (*RolesQuery) QueryLionUserRoles

func (_q *RolesQuery) QueryLionUserRoles() *UserRolesQuery

QueryLionUserRoles chains the current query on the "lion_user_roles" edge.

func (*RolesQuery) Select

func (_q *RolesQuery) Select(fields ...string) *RolesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Roles.Query().
	Select(roles.FieldCreatedAt).
	Scan(ctx, &v)

func (*RolesQuery) Unique

func (_q *RolesQuery) Unique(unique bool) *RolesQuery

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 (*RolesQuery) Where

func (_q *RolesQuery) Where(ps ...predicate.Roles) *RolesQuery

Where adds a new predicate for the RolesQuery builder.

func (*RolesQuery) WithLionDepartmentRoles

func (_q *RolesQuery) WithLionDepartmentRoles(opts ...func(*DepartmentRolesQuery)) *RolesQuery

WithLionDepartmentRoles tells the query-builder to eager-load the nodes that are connected to the "lion_department_roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolesQuery) WithLionRoleGroups

func (_q *RolesQuery) WithLionRoleGroups(opts ...func(*GroupRolesQuery)) *RolesQuery

WithLionRoleGroups tells the query-builder to eager-load the nodes that are connected to the "lion_role_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolesQuery) WithLionRolePermissions

func (_q *RolesQuery) WithLionRolePermissions(opts ...func(*RolePermissionsQuery)) *RolesQuery

WithLionRolePermissions tells the query-builder to eager-load the nodes that are connected to the "lion_role_permissions" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolesQuery) WithLionUserRoles

func (_q *RolesQuery) WithLionUserRoles(opts ...func(*UserRolesQuery)) *RolesQuery

WithLionUserRoles tells the query-builder to eager-load the nodes that are connected to the "lion_user_roles" edge. The optional arguments are used to configure the query builder of the edge.

type RolesSelect

type RolesSelect struct {
	*RolesQuery
	// contains filtered or unexported fields
}

RolesSelect is the builder for selecting fields of Roles entities.

func (*RolesSelect) Aggregate

func (_s *RolesSelect) Aggregate(fns ...AggregateFunc) *RolesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RolesSelect) Bool

func (s *RolesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RolesSelect) BoolX

func (s *RolesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RolesSelect) Bools

func (s *RolesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RolesSelect) BoolsX

func (s *RolesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RolesSelect) Float64

func (s *RolesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RolesSelect) Float64X

func (s *RolesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RolesSelect) Float64s

func (s *RolesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RolesSelect) Float64sX

func (s *RolesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RolesSelect) Int

func (s *RolesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RolesSelect) IntX

func (s *RolesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RolesSelect) Ints

func (s *RolesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RolesSelect) IntsX

func (s *RolesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RolesSelect) Scan

func (_s *RolesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RolesSelect) ScanX

func (s *RolesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RolesSelect) String

func (s *RolesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RolesSelect) StringX

func (s *RolesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RolesSelect) Strings

func (s *RolesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RolesSelect) StringsX

func (s *RolesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RolesSlice

type RolesSlice []*Roles

RolesSlice is a parsable slice of Roles.

type RolesUpdate

type RolesUpdate struct {
	// contains filtered or unexported fields
}

RolesUpdate is the builder for updating Roles entities.

func (*RolesUpdate) AddCreatedBy

func (_u *RolesUpdate) AddCreatedBy(v int64) *RolesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*RolesUpdate) AddLionDepartmentRoleIDs

func (_u *RolesUpdate) AddLionDepartmentRoleIDs(ids ...int) *RolesUpdate

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*RolesUpdate) AddLionDepartmentRoles

func (_u *RolesUpdate) AddLionDepartmentRoles(v ...*DepartmentRoles) *RolesUpdate

AddLionDepartmentRoles adds the "lion_department_roles" edges to the DepartmentRoles entity.

func (*RolesUpdate) AddLionRoleGroupIDs

func (_u *RolesUpdate) AddLionRoleGroupIDs(ids ...int) *RolesUpdate

AddLionRoleGroupIDs adds the "lion_role_groups" edge to the GroupRoles entity by IDs.

func (*RolesUpdate) AddLionRoleGroups

func (_u *RolesUpdate) AddLionRoleGroups(v ...*GroupRoles) *RolesUpdate

AddLionRoleGroups adds the "lion_role_groups" edges to the GroupRoles entity.

func (*RolesUpdate) AddLionRolePermissionIDs

func (_u *RolesUpdate) AddLionRolePermissionIDs(ids ...int) *RolesUpdate

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*RolesUpdate) AddLionRolePermissions

func (_u *RolesUpdate) AddLionRolePermissions(v ...*RolePermissions) *RolesUpdate

AddLionRolePermissions adds the "lion_role_permissions" edges to the RolePermissions entity.

func (*RolesUpdate) AddLionUserRoleIDs

func (_u *RolesUpdate) AddLionUserRoleIDs(ids ...int) *RolesUpdate

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*RolesUpdate) AddLionUserRoles

func (_u *RolesUpdate) AddLionUserRoles(v ...*UserRoles) *RolesUpdate

AddLionUserRoles adds the "lion_user_roles" edges to the UserRoles entity.

func (*RolesUpdate) AddRoleStatus

func (_u *RolesUpdate) AddRoleStatus(v int) *RolesUpdate

AddRoleStatus adds value to the "role_status" field.

func (*RolesUpdate) AddRoleType

func (_u *RolesUpdate) AddRoleType(v int) *RolesUpdate

AddRoleType adds value to the "role_type" field.

func (*RolesUpdate) AddSortOrder

func (_u *RolesUpdate) AddSortOrder(v int) *RolesUpdate

AddSortOrder adds value to the "sort_order" field.

func (*RolesUpdate) AddUpdatedBy

func (_u *RolesUpdate) AddUpdatedBy(v int64) *RolesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*RolesUpdate) ClearCreatedBy

func (_u *RolesUpdate) ClearCreatedBy() *RolesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*RolesUpdate) ClearDeletedAt

func (_u *RolesUpdate) ClearDeletedAt() *RolesUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RolesUpdate) ClearLionDepartmentRoles

func (_u *RolesUpdate) ClearLionDepartmentRoles() *RolesUpdate

ClearLionDepartmentRoles clears all "lion_department_roles" edges to the DepartmentRoles entity.

func (*RolesUpdate) ClearLionRoleGroups

func (_u *RolesUpdate) ClearLionRoleGroups() *RolesUpdate

ClearLionRoleGroups clears all "lion_role_groups" edges to the GroupRoles entity.

func (*RolesUpdate) ClearLionRolePermissions

func (_u *RolesUpdate) ClearLionRolePermissions() *RolesUpdate

ClearLionRolePermissions clears all "lion_role_permissions" edges to the RolePermissions entity.

func (*RolesUpdate) ClearLionUserRoles

func (_u *RolesUpdate) ClearLionUserRoles() *RolesUpdate

ClearLionUserRoles clears all "lion_user_roles" edges to the UserRoles entity.

func (*RolesUpdate) ClearUpdatedBy

func (_u *RolesUpdate) ClearUpdatedBy() *RolesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolesUpdate) Exec

func (_u *RolesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RolesUpdate) ExecX

func (_u *RolesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolesUpdate) Mutation

func (_u *RolesUpdate) Mutation() *RolesMutation

Mutation returns the RolesMutation object of the builder.

func (*RolesUpdate) RemoveLionDepartmentRoleIDs

func (_u *RolesUpdate) RemoveLionDepartmentRoleIDs(ids ...int) *RolesUpdate

RemoveLionDepartmentRoleIDs removes the "lion_department_roles" edge to DepartmentRoles entities by IDs.

func (*RolesUpdate) RemoveLionDepartmentRoles

func (_u *RolesUpdate) RemoveLionDepartmentRoles(v ...*DepartmentRoles) *RolesUpdate

RemoveLionDepartmentRoles removes "lion_department_roles" edges to DepartmentRoles entities.

func (*RolesUpdate) RemoveLionRoleGroupIDs

func (_u *RolesUpdate) RemoveLionRoleGroupIDs(ids ...int) *RolesUpdate

RemoveLionRoleGroupIDs removes the "lion_role_groups" edge to GroupRoles entities by IDs.

func (*RolesUpdate) RemoveLionRoleGroups

func (_u *RolesUpdate) RemoveLionRoleGroups(v ...*GroupRoles) *RolesUpdate

RemoveLionRoleGroups removes "lion_role_groups" edges to GroupRoles entities.

func (*RolesUpdate) RemoveLionRolePermissionIDs

func (_u *RolesUpdate) RemoveLionRolePermissionIDs(ids ...int) *RolesUpdate

RemoveLionRolePermissionIDs removes the "lion_role_permissions" edge to RolePermissions entities by IDs.

func (*RolesUpdate) RemoveLionRolePermissions

func (_u *RolesUpdate) RemoveLionRolePermissions(v ...*RolePermissions) *RolesUpdate

RemoveLionRolePermissions removes "lion_role_permissions" edges to RolePermissions entities.

func (*RolesUpdate) RemoveLionUserRoleIDs

func (_u *RolesUpdate) RemoveLionUserRoleIDs(ids ...int) *RolesUpdate

RemoveLionUserRoleIDs removes the "lion_user_roles" edge to UserRoles entities by IDs.

func (*RolesUpdate) RemoveLionUserRoles

func (_u *RolesUpdate) RemoveLionUserRoles(v ...*UserRoles) *RolesUpdate

RemoveLionUserRoles removes "lion_user_roles" edges to UserRoles entities.

func (*RolesUpdate) Save

func (_u *RolesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RolesUpdate) SaveX

func (_u *RolesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RolesUpdate) SetCreatedBy

func (_u *RolesUpdate) SetCreatedBy(v int64) *RolesUpdate

SetCreatedBy sets the "created_by" field.

func (*RolesUpdate) SetDeletedAt

func (_u *RolesUpdate) SetDeletedAt(v time.Time) *RolesUpdate

SetDeletedAt sets the "deleted_at" field.

func (*RolesUpdate) SetDescription

func (_u *RolesUpdate) SetDescription(v string) *RolesUpdate

SetDescription sets the "description" field.

func (*RolesUpdate) SetName

func (_u *RolesUpdate) SetName(v string) *RolesUpdate

SetName sets the "name" field.

func (*RolesUpdate) SetNillableCreatedBy

func (_u *RolesUpdate) SetNillableCreatedBy(v *int64) *RolesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolesUpdate) SetNillableDeletedAt

func (_u *RolesUpdate) SetNillableDeletedAt(v *time.Time) *RolesUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RolesUpdate) SetNillableDescription

func (_u *RolesUpdate) SetNillableDescription(v *string) *RolesUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RolesUpdate) SetNillableName

func (_u *RolesUpdate) SetNillableName(v *string) *RolesUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*RolesUpdate) SetNillableRoleStatus

func (_u *RolesUpdate) SetNillableRoleStatus(v *int) *RolesUpdate

SetNillableRoleStatus sets the "role_status" field if the given value is not nil.

func (*RolesUpdate) SetNillableRoleType

func (_u *RolesUpdate) SetNillableRoleType(v *int) *RolesUpdate

SetNillableRoleType sets the "role_type" field if the given value is not nil.

func (*RolesUpdate) SetNillableSortOrder

func (_u *RolesUpdate) SetNillableSortOrder(v *int) *RolesUpdate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*RolesUpdate) SetNillableUpdatedBy

func (_u *RolesUpdate) SetNillableUpdatedBy(v *int64) *RolesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolesUpdate) SetRoleStatus

func (_u *RolesUpdate) SetRoleStatus(v int) *RolesUpdate

SetRoleStatus sets the "role_status" field.

func (*RolesUpdate) SetRoleType

func (_u *RolesUpdate) SetRoleType(v int) *RolesUpdate

SetRoleType sets the "role_type" field.

func (*RolesUpdate) SetSortOrder

func (_u *RolesUpdate) SetSortOrder(v int) *RolesUpdate

SetSortOrder sets the "sort_order" field.

func (*RolesUpdate) SetUpdatedAt

func (_u *RolesUpdate) SetUpdatedAt(v time.Time) *RolesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RolesUpdate) SetUpdatedBy

func (_u *RolesUpdate) SetUpdatedBy(v int64) *RolesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RolesUpdate) Where

func (_u *RolesUpdate) Where(ps ...predicate.Roles) *RolesUpdate

Where appends a list predicates to the RolesUpdate builder.

type RolesUpdateOne

type RolesUpdateOne struct {
	// contains filtered or unexported fields
}

RolesUpdateOne is the builder for updating a single Roles entity.

func (*RolesUpdateOne) AddCreatedBy

func (_u *RolesUpdateOne) AddCreatedBy(v int64) *RolesUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*RolesUpdateOne) AddLionDepartmentRoleIDs

func (_u *RolesUpdateOne) AddLionDepartmentRoleIDs(ids ...int) *RolesUpdateOne

AddLionDepartmentRoleIDs adds the "lion_department_roles" edge to the DepartmentRoles entity by IDs.

func (*RolesUpdateOne) AddLionDepartmentRoles

func (_u *RolesUpdateOne) AddLionDepartmentRoles(v ...*DepartmentRoles) *RolesUpdateOne

AddLionDepartmentRoles adds the "lion_department_roles" edges to the DepartmentRoles entity.

func (*RolesUpdateOne) AddLionRoleGroupIDs

func (_u *RolesUpdateOne) AddLionRoleGroupIDs(ids ...int) *RolesUpdateOne

AddLionRoleGroupIDs adds the "lion_role_groups" edge to the GroupRoles entity by IDs.

func (*RolesUpdateOne) AddLionRoleGroups

func (_u *RolesUpdateOne) AddLionRoleGroups(v ...*GroupRoles) *RolesUpdateOne

AddLionRoleGroups adds the "lion_role_groups" edges to the GroupRoles entity.

func (*RolesUpdateOne) AddLionRolePermissionIDs

func (_u *RolesUpdateOne) AddLionRolePermissionIDs(ids ...int) *RolesUpdateOne

AddLionRolePermissionIDs adds the "lion_role_permissions" edge to the RolePermissions entity by IDs.

func (*RolesUpdateOne) AddLionRolePermissions

func (_u *RolesUpdateOne) AddLionRolePermissions(v ...*RolePermissions) *RolesUpdateOne

AddLionRolePermissions adds the "lion_role_permissions" edges to the RolePermissions entity.

func (*RolesUpdateOne) AddLionUserRoleIDs

func (_u *RolesUpdateOne) AddLionUserRoleIDs(ids ...int) *RolesUpdateOne

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*RolesUpdateOne) AddLionUserRoles

func (_u *RolesUpdateOne) AddLionUserRoles(v ...*UserRoles) *RolesUpdateOne

AddLionUserRoles adds the "lion_user_roles" edges to the UserRoles entity.

func (*RolesUpdateOne) AddRoleStatus

func (_u *RolesUpdateOne) AddRoleStatus(v int) *RolesUpdateOne

AddRoleStatus adds value to the "role_status" field.

func (*RolesUpdateOne) AddRoleType

func (_u *RolesUpdateOne) AddRoleType(v int) *RolesUpdateOne

AddRoleType adds value to the "role_type" field.

func (*RolesUpdateOne) AddSortOrder

func (_u *RolesUpdateOne) AddSortOrder(v int) *RolesUpdateOne

AddSortOrder adds value to the "sort_order" field.

func (*RolesUpdateOne) AddUpdatedBy

func (_u *RolesUpdateOne) AddUpdatedBy(v int64) *RolesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*RolesUpdateOne) ClearCreatedBy

func (_u *RolesUpdateOne) ClearCreatedBy() *RolesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*RolesUpdateOne) ClearDeletedAt

func (_u *RolesUpdateOne) ClearDeletedAt() *RolesUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RolesUpdateOne) ClearLionDepartmentRoles

func (_u *RolesUpdateOne) ClearLionDepartmentRoles() *RolesUpdateOne

ClearLionDepartmentRoles clears all "lion_department_roles" edges to the DepartmentRoles entity.

func (*RolesUpdateOne) ClearLionRoleGroups

func (_u *RolesUpdateOne) ClearLionRoleGroups() *RolesUpdateOne

ClearLionRoleGroups clears all "lion_role_groups" edges to the GroupRoles entity.

func (*RolesUpdateOne) ClearLionRolePermissions

func (_u *RolesUpdateOne) ClearLionRolePermissions() *RolesUpdateOne

ClearLionRolePermissions clears all "lion_role_permissions" edges to the RolePermissions entity.

func (*RolesUpdateOne) ClearLionUserRoles

func (_u *RolesUpdateOne) ClearLionUserRoles() *RolesUpdateOne

ClearLionUserRoles clears all "lion_user_roles" edges to the UserRoles entity.

func (*RolesUpdateOne) ClearUpdatedBy

func (_u *RolesUpdateOne) ClearUpdatedBy() *RolesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolesUpdateOne) Exec

func (_u *RolesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RolesUpdateOne) ExecX

func (_u *RolesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolesUpdateOne) Mutation

func (_u *RolesUpdateOne) Mutation() *RolesMutation

Mutation returns the RolesMutation object of the builder.

func (*RolesUpdateOne) RemoveLionDepartmentRoleIDs

func (_u *RolesUpdateOne) RemoveLionDepartmentRoleIDs(ids ...int) *RolesUpdateOne

RemoveLionDepartmentRoleIDs removes the "lion_department_roles" edge to DepartmentRoles entities by IDs.

func (*RolesUpdateOne) RemoveLionDepartmentRoles

func (_u *RolesUpdateOne) RemoveLionDepartmentRoles(v ...*DepartmentRoles) *RolesUpdateOne

RemoveLionDepartmentRoles removes "lion_department_roles" edges to DepartmentRoles entities.

func (*RolesUpdateOne) RemoveLionRoleGroupIDs

func (_u *RolesUpdateOne) RemoveLionRoleGroupIDs(ids ...int) *RolesUpdateOne

RemoveLionRoleGroupIDs removes the "lion_role_groups" edge to GroupRoles entities by IDs.

func (*RolesUpdateOne) RemoveLionRoleGroups

func (_u *RolesUpdateOne) RemoveLionRoleGroups(v ...*GroupRoles) *RolesUpdateOne

RemoveLionRoleGroups removes "lion_role_groups" edges to GroupRoles entities.

func (*RolesUpdateOne) RemoveLionRolePermissionIDs

func (_u *RolesUpdateOne) RemoveLionRolePermissionIDs(ids ...int) *RolesUpdateOne

RemoveLionRolePermissionIDs removes the "lion_role_permissions" edge to RolePermissions entities by IDs.

func (*RolesUpdateOne) RemoveLionRolePermissions

func (_u *RolesUpdateOne) RemoveLionRolePermissions(v ...*RolePermissions) *RolesUpdateOne

RemoveLionRolePermissions removes "lion_role_permissions" edges to RolePermissions entities.

func (*RolesUpdateOne) RemoveLionUserRoleIDs

func (_u *RolesUpdateOne) RemoveLionUserRoleIDs(ids ...int) *RolesUpdateOne

RemoveLionUserRoleIDs removes the "lion_user_roles" edge to UserRoles entities by IDs.

func (*RolesUpdateOne) RemoveLionUserRoles

func (_u *RolesUpdateOne) RemoveLionUserRoles(v ...*UserRoles) *RolesUpdateOne

RemoveLionUserRoles removes "lion_user_roles" edges to UserRoles entities.

func (*RolesUpdateOne) Save

func (_u *RolesUpdateOne) Save(ctx context.Context) (*Roles, error)

Save executes the query and returns the updated Roles entity.

func (*RolesUpdateOne) SaveX

func (_u *RolesUpdateOne) SaveX(ctx context.Context) *Roles

SaveX is like Save, but panics if an error occurs.

func (*RolesUpdateOne) Select

func (_u *RolesUpdateOne) Select(field string, fields ...string) *RolesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RolesUpdateOne) SetCreatedBy

func (_u *RolesUpdateOne) SetCreatedBy(v int64) *RolesUpdateOne

SetCreatedBy sets the "created_by" field.

func (*RolesUpdateOne) SetDeletedAt

func (_u *RolesUpdateOne) SetDeletedAt(v time.Time) *RolesUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*RolesUpdateOne) SetDescription

func (_u *RolesUpdateOne) SetDescription(v string) *RolesUpdateOne

SetDescription sets the "description" field.

func (*RolesUpdateOne) SetName

func (_u *RolesUpdateOne) SetName(v string) *RolesUpdateOne

SetName sets the "name" field.

func (*RolesUpdateOne) SetNillableCreatedBy

func (_u *RolesUpdateOne) SetNillableCreatedBy(v *int64) *RolesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableDeletedAt

func (_u *RolesUpdateOne) SetNillableDeletedAt(v *time.Time) *RolesUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableDescription

func (_u *RolesUpdateOne) SetNillableDescription(v *string) *RolesUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableName

func (_u *RolesUpdateOne) SetNillableName(v *string) *RolesUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableRoleStatus

func (_u *RolesUpdateOne) SetNillableRoleStatus(v *int) *RolesUpdateOne

SetNillableRoleStatus sets the "role_status" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableRoleType

func (_u *RolesUpdateOne) SetNillableRoleType(v *int) *RolesUpdateOne

SetNillableRoleType sets the "role_type" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableSortOrder

func (_u *RolesUpdateOne) SetNillableSortOrder(v *int) *RolesUpdateOne

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableUpdatedBy

func (_u *RolesUpdateOne) SetNillableUpdatedBy(v *int64) *RolesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolesUpdateOne) SetRoleStatus

func (_u *RolesUpdateOne) SetRoleStatus(v int) *RolesUpdateOne

SetRoleStatus sets the "role_status" field.

func (*RolesUpdateOne) SetRoleType

func (_u *RolesUpdateOne) SetRoleType(v int) *RolesUpdateOne

SetRoleType sets the "role_type" field.

func (*RolesUpdateOne) SetSortOrder

func (_u *RolesUpdateOne) SetSortOrder(v int) *RolesUpdateOne

SetSortOrder sets the "sort_order" field.

func (*RolesUpdateOne) SetUpdatedAt

func (_u *RolesUpdateOne) SetUpdatedAt(v time.Time) *RolesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RolesUpdateOne) SetUpdatedBy

func (_u *RolesUpdateOne) SetUpdatedBy(v int64) *RolesUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*RolesUpdateOne) Where

func (_u *RolesUpdateOne) Where(ps ...predicate.Roles) *RolesUpdateOne

Where appends a list predicates to the RolesUpdate builder.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// AuthProviders is the client for interacting with the AuthProviders builders.
	AuthProviders *AuthProvidersClient
	// Credentials is the client for interacting with the Credentials builders.
	Credentials *CredentialsClient
	// Demo is the client for interacting with the Demo builders.
	Demo *DemoClient
	// DepartmentRoles is the client for interacting with the DepartmentRoles builders.
	DepartmentRoles *DepartmentRolesClient
	// Departments is the client for interacting with the Departments builders.
	Departments *DepartmentsClient
	// GroupRoles is the client for interacting with the GroupRoles builders.
	GroupRoles *GroupRolesClient
	// Groups is the client for interacting with the Groups builders.
	Groups *GroupsClient
	// Permissions is the client for interacting with the Permissions builders.
	Permissions *PermissionsClient
	// Policies is the client for interacting with the Policies builders.
	Policies *PoliciesClient
	// Resources is the client for interacting with the Resources builders.
	Resources *ResourcesClient
	// RolePermissions is the client for interacting with the RolePermissions builders.
	RolePermissions *RolePermissionsClient
	// Roles is the client for interacting with the Roles builders.
	Roles *RolesClient
	// UserDepartments is the client for interacting with the UserDepartments builders.
	UserDepartments *UserDepartmentsClient
	// UserGroups is the client for interacting with the UserGroups builders.
	UserGroups *UserGroupsClient
	// UserIdentities is the client for interacting with the UserIdentities builders.
	UserIdentities *UserIdentitiesClient
	// UserProfiles is the client for interacting with the UserProfiles builders.
	UserProfiles *UserProfilesClient
	// UserRoles is the client for interacting with the UserRoles builders.
	UserRoles *UserRolesClient
	// Users is the client for interacting with the Users builders.
	Users *UsersClient
	// 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 UserDepartments

type UserDepartments struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 部门 ID
	DepartmentID int `json:"department_id,omitempty"`
	// 用户 ID
	UserID int `json:"user_id,omitempty"`
	// 用户在群组中的角色:0-未指定,1-所有者,2-管理员,3-普通成员,4-访客
	MemberRole int `json:"member_role,omitempty"`
	// 用户群组关系状态:0-未知状态,1-待激活,2-正常启用,3-被邀请,4-禁用,5-被拒绝,6-已退出
	MemberStatus int `json:"member_status,omitempty"`
	// 成员关系类型,区分主部门和兼职部门
	MemberType int `json:"member_type,omitempty"`
	// 关系有效期,用于临时成员管理,0表示永久有效
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// 元数据,用于存储自定义属性,支持业务扩展,JSON 格式存储
	Metadata string `json:"metadata,omitempty"`
	// 用户组描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserDepartmentsQuery when eager-loading is set.
	Edges UserDepartmentsEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserDepartments is the model entity for the UserDepartments schema.

func (*UserDepartments) QueryLionDepartments

func (_m *UserDepartments) QueryLionDepartments() *DepartmentsQuery

QueryLionDepartments queries the "lion_departments" edge of the UserDepartments entity.

func (*UserDepartments) QueryLionUsers

func (_m *UserDepartments) QueryLionUsers() *UsersQuery

QueryLionUsers queries the "lion_users" edge of the UserDepartments entity.

func (*UserDepartments) String

func (_m *UserDepartments) String() string

String implements the fmt.Stringer.

func (*UserDepartments) Unwrap

func (_m *UserDepartments) Unwrap() *UserDepartments

Unwrap unwraps the UserDepartments 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 (*UserDepartments) Update

Update returns a builder for updating this UserDepartments. Note that you need to call UserDepartments.Unwrap() before calling this method if this UserDepartments was returned from a transaction, and the transaction was committed or rolled back.

func (*UserDepartments) Value

func (_m *UserDepartments) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserDepartments. This includes values selected through modifiers, order, etc.

type UserDepartmentsClient

type UserDepartmentsClient struct {
	// contains filtered or unexported fields
}

UserDepartmentsClient is a client for the UserDepartments schema.

func NewUserDepartmentsClient

func NewUserDepartmentsClient(c config) *UserDepartmentsClient

NewUserDepartmentsClient returns a client for the UserDepartments from the given config.

func (*UserDepartmentsClient) Create

Create returns a builder for creating a UserDepartments entity.

func (*UserDepartmentsClient) CreateBulk

CreateBulk returns a builder for creating a bulk of UserDepartments entities.

func (*UserDepartmentsClient) Delete

Delete returns a delete builder for UserDepartments.

func (*UserDepartmentsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserDepartmentsClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserDepartmentsClient) Get

Get returns a UserDepartments entity by its id.

func (*UserDepartmentsClient) GetX

GetX is like Get, but panics if an error occurs.

func (*UserDepartmentsClient) Hooks

func (c *UserDepartmentsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserDepartmentsClient) Intercept

func (c *UserDepartmentsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userdepartments.Intercept(f(g(h())))`.

func (*UserDepartmentsClient) Interceptors

func (c *UserDepartmentsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserDepartmentsClient) MapCreateBulk

func (c *UserDepartmentsClient) MapCreateBulk(slice any, setFunc func(*UserDepartmentsCreate, int)) *UserDepartmentsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserDepartmentsClient) Query

Query returns a query builder for UserDepartments.

func (*UserDepartmentsClient) QueryLionDepartments

func (c *UserDepartmentsClient) QueryLionDepartments(_m *UserDepartments) *DepartmentsQuery

QueryLionDepartments queries the lion_departments edge of a UserDepartments.

func (*UserDepartmentsClient) QueryLionUsers

func (c *UserDepartmentsClient) QueryLionUsers(_m *UserDepartments) *UsersQuery

QueryLionUsers queries the lion_users edge of a UserDepartments.

func (*UserDepartmentsClient) Update

Update returns an update builder for UserDepartments.

func (*UserDepartmentsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserDepartmentsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*UserDepartmentsClient) Use

func (c *UserDepartmentsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userdepartments.Hooks(f(g(h())))`.

type UserDepartmentsCreate

type UserDepartmentsCreate struct {
	// contains filtered or unexported fields
}

UserDepartmentsCreate is the builder for creating a UserDepartments entity.

func (*UserDepartmentsCreate) Exec

Exec executes the query.

func (*UserDepartmentsCreate) ExecX

func (_c *UserDepartmentsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDepartmentsCreate) Mutation

Mutation returns the UserDepartmentsMutation object of the builder.

func (*UserDepartmentsCreate) Save

Save creates the UserDepartments in the database.

func (*UserDepartmentsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserDepartmentsCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*UserDepartmentsCreate) SetCreatedBy

func (_c *UserDepartmentsCreate) SetCreatedBy(v int64) *UserDepartmentsCreate

SetCreatedBy sets the "created_by" field.

func (*UserDepartmentsCreate) SetDepartmentID

func (_c *UserDepartmentsCreate) SetDepartmentID(v int) *UserDepartmentsCreate

SetDepartmentID sets the "department_id" field.

func (*UserDepartmentsCreate) SetDescription

func (_c *UserDepartmentsCreate) SetDescription(v string) *UserDepartmentsCreate

SetDescription sets the "description" field.

func (*UserDepartmentsCreate) SetExpiredAt

SetExpiredAt sets the "expired_at" field.

func (*UserDepartmentsCreate) SetLionDepartments

func (_c *UserDepartmentsCreate) SetLionDepartments(v *Departments) *UserDepartmentsCreate

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*UserDepartmentsCreate) SetLionDepartmentsID

func (_c *UserDepartmentsCreate) SetLionDepartmentsID(id int) *UserDepartmentsCreate

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*UserDepartmentsCreate) SetLionUsers

func (_c *UserDepartmentsCreate) SetLionUsers(v *Users) *UserDepartmentsCreate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserDepartmentsCreate) SetLionUsersID

func (_c *UserDepartmentsCreate) SetLionUsersID(id int) *UserDepartmentsCreate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserDepartmentsCreate) SetMemberRole

func (_c *UserDepartmentsCreate) SetMemberRole(v int) *UserDepartmentsCreate

SetMemberRole sets the "member_role" field.

func (*UserDepartmentsCreate) SetMemberStatus

func (_c *UserDepartmentsCreate) SetMemberStatus(v int) *UserDepartmentsCreate

SetMemberStatus sets the "member_status" field.

func (*UserDepartmentsCreate) SetMemberType

func (_c *UserDepartmentsCreate) SetMemberType(v int) *UserDepartmentsCreate

SetMemberType sets the "member_type" field.

func (*UserDepartmentsCreate) SetMetadata

SetMetadata sets the "metadata" field.

func (*UserDepartmentsCreate) SetNillableCreatedAt

func (_c *UserDepartmentsCreate) SetNillableCreatedAt(v *time.Time) *UserDepartmentsCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableCreatedBy

func (_c *UserDepartmentsCreate) SetNillableCreatedBy(v *int64) *UserDepartmentsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableDescription

func (_c *UserDepartmentsCreate) SetNillableDescription(v *string) *UserDepartmentsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableExpiredAt

func (_c *UserDepartmentsCreate) SetNillableExpiredAt(v *time.Time) *UserDepartmentsCreate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableMemberRole

func (_c *UserDepartmentsCreate) SetNillableMemberRole(v *int) *UserDepartmentsCreate

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableMemberStatus

func (_c *UserDepartmentsCreate) SetNillableMemberStatus(v *int) *UserDepartmentsCreate

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableMemberType

func (_c *UserDepartmentsCreate) SetNillableMemberType(v *int) *UserDepartmentsCreate

SetNillableMemberType sets the "member_type" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableMetadata

func (_c *UserDepartmentsCreate) SetNillableMetadata(v *string) *UserDepartmentsCreate

SetNillableMetadata sets the "metadata" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableUpdatedAt

func (_c *UserDepartmentsCreate) SetNillableUpdatedAt(v *time.Time) *UserDepartmentsCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserDepartmentsCreate) SetNillableUpdatedBy

func (_c *UserDepartmentsCreate) SetNillableUpdatedBy(v *int64) *UserDepartmentsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserDepartmentsCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserDepartmentsCreate) SetUpdatedBy

func (_c *UserDepartmentsCreate) SetUpdatedBy(v int64) *UserDepartmentsCreate

SetUpdatedBy sets the "updated_by" field.

func (*UserDepartmentsCreate) SetUserID

SetUserID sets the "user_id" field.

type UserDepartmentsCreateBulk

type UserDepartmentsCreateBulk struct {
	// contains filtered or unexported fields
}

UserDepartmentsCreateBulk is the builder for creating many UserDepartments entities in bulk.

func (*UserDepartmentsCreateBulk) Exec

Exec executes the query.

func (*UserDepartmentsCreateBulk) ExecX

func (_c *UserDepartmentsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDepartmentsCreateBulk) Save

Save creates the UserDepartments entities in the database.

func (*UserDepartmentsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type UserDepartmentsDelete

type UserDepartmentsDelete struct {
	// contains filtered or unexported fields
}

UserDepartmentsDelete is the builder for deleting a UserDepartments entity.

func (*UserDepartmentsDelete) Exec

func (_d *UserDepartmentsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDepartmentsDelete) ExecX

func (_d *UserDepartmentsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDepartmentsDelete) Where

Where appends a list predicates to the UserDepartmentsDelete builder.

type UserDepartmentsDeleteOne

type UserDepartmentsDeleteOne struct {
	// contains filtered or unexported fields
}

UserDepartmentsDeleteOne is the builder for deleting a single UserDepartments entity.

func (*UserDepartmentsDeleteOne) Exec

Exec executes the deletion query.

func (*UserDepartmentsDeleteOne) ExecX

func (_d *UserDepartmentsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDepartmentsDeleteOne) Where

Where appends a list predicates to the UserDepartmentsDelete builder.

type UserDepartmentsEdges

type UserDepartmentsEdges struct {
	// LionDepartments holds the value of the lion_departments edge.
	LionDepartments *Departments `json:"lion_departments,omitempty"`
	// LionUsers holds the value of the lion_users edge.
	LionUsers *Users `json:"lion_users,omitempty"`
	// contains filtered or unexported fields
}

UserDepartmentsEdges holds the relations/edges for other nodes in the graph.

func (UserDepartmentsEdges) LionDepartmentsOrErr

func (e UserDepartmentsEdges) LionDepartmentsOrErr() (*Departments, error)

LionDepartmentsOrErr returns the LionDepartments value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserDepartmentsEdges) LionUsersOrErr

func (e UserDepartmentsEdges) LionUsersOrErr() (*Users, error)

LionUsersOrErr returns the LionUsers value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserDepartmentsGroupBy

type UserDepartmentsGroupBy struct {
	// contains filtered or unexported fields
}

UserDepartmentsGroupBy is the group-by builder for UserDepartments entities.

func (*UserDepartmentsGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*UserDepartmentsGroupBy) Bool

func (s *UserDepartmentsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) BoolX

func (s *UserDepartmentsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Bools

func (s *UserDepartmentsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) BoolsX

func (s *UserDepartmentsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Float64

func (s *UserDepartmentsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) Float64X

func (s *UserDepartmentsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Float64s

func (s *UserDepartmentsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) Float64sX

func (s *UserDepartmentsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Int

func (s *UserDepartmentsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) IntX

func (s *UserDepartmentsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Ints

func (s *UserDepartmentsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) IntsX

func (s *UserDepartmentsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Scan

func (_g *UserDepartmentsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserDepartmentsGroupBy) ScanX

func (s *UserDepartmentsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserDepartmentsGroupBy) String

func (s *UserDepartmentsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) StringX

func (s *UserDepartmentsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserDepartmentsGroupBy) Strings

func (s *UserDepartmentsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsGroupBy) StringsX

func (s *UserDepartmentsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserDepartmentsMutation

type UserDepartmentsMutation struct {
	// contains filtered or unexported fields
}

UserDepartmentsMutation represents an operation that mutates the UserDepartments nodes in the graph.

func (*UserDepartmentsMutation) AddCreatedBy

func (m *UserDepartmentsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*UserDepartmentsMutation) AddField

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) AddMemberRole

func (m *UserDepartmentsMutation) AddMemberRole(i int)

AddMemberRole adds i to the "member_role" field.

func (*UserDepartmentsMutation) AddMemberStatus

func (m *UserDepartmentsMutation) AddMemberStatus(i int)

AddMemberStatus adds i to the "member_status" field.

func (*UserDepartmentsMutation) AddMemberType

func (m *UserDepartmentsMutation) AddMemberType(i int)

AddMemberType adds i to the "member_type" field.

func (*UserDepartmentsMutation) AddUpdatedBy

func (m *UserDepartmentsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*UserDepartmentsMutation) AddedCreatedBy

func (m *UserDepartmentsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*UserDepartmentsMutation) AddedEdges

func (m *UserDepartmentsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserDepartmentsMutation) AddedField

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) AddedFields

func (m *UserDepartmentsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserDepartmentsMutation) AddedIDs

func (m *UserDepartmentsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserDepartmentsMutation) AddedMemberRole

func (m *UserDepartmentsMutation) AddedMemberRole() (r int, exists bool)

AddedMemberRole returns the value that was added to the "member_role" field in this mutation.

func (*UserDepartmentsMutation) AddedMemberStatus

func (m *UserDepartmentsMutation) AddedMemberStatus() (r int, exists bool)

AddedMemberStatus returns the value that was added to the "member_status" field in this mutation.

func (*UserDepartmentsMutation) AddedMemberType

func (m *UserDepartmentsMutation) AddedMemberType() (r int, exists bool)

AddedMemberType returns the value that was added to the "member_type" field in this mutation.

func (*UserDepartmentsMutation) AddedUpdatedBy

func (m *UserDepartmentsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*UserDepartmentsMutation) ClearCreatedBy

func (m *UserDepartmentsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*UserDepartmentsMutation) ClearEdge

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) ClearExpiredAt

func (m *UserDepartmentsMutation) ClearExpiredAt()

ClearExpiredAt clears the value of the "expired_at" field.

func (*UserDepartmentsMutation) ClearField

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) ClearLionDepartments

func (m *UserDepartmentsMutation) ClearLionDepartments()

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*UserDepartmentsMutation) ClearLionUsers

func (m *UserDepartmentsMutation) ClearLionUsers()

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserDepartmentsMutation) ClearMetadata

func (m *UserDepartmentsMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*UserDepartmentsMutation) ClearUpdatedBy

func (m *UserDepartmentsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserDepartmentsMutation) ClearedEdges

func (m *UserDepartmentsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserDepartmentsMutation) ClearedFields

func (m *UserDepartmentsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserDepartmentsMutation) Client

func (m UserDepartmentsMutation) 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 (*UserDepartmentsMutation) CreatedAt

func (m *UserDepartmentsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserDepartmentsMutation) CreatedBy

func (m *UserDepartmentsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UserDepartmentsMutation) CreatedByCleared

func (m *UserDepartmentsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*UserDepartmentsMutation) DepartmentID

func (m *UserDepartmentsMutation) DepartmentID() (r int, exists bool)

DepartmentID returns the value of the "department_id" field in the mutation.

func (*UserDepartmentsMutation) Description

func (m *UserDepartmentsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*UserDepartmentsMutation) EdgeCleared

func (m *UserDepartmentsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserDepartmentsMutation) ExpiredAt

func (m *UserDepartmentsMutation) ExpiredAt() (r time.Time, exists bool)

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*UserDepartmentsMutation) ExpiredAtCleared

func (m *UserDepartmentsMutation) ExpiredAtCleared() bool

ExpiredAtCleared returns if the "expired_at" field was cleared in this mutation.

func (*UserDepartmentsMutation) Field

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) FieldCleared

func (m *UserDepartmentsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserDepartmentsMutation) Fields

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) ID

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) IDs

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) LionDepartmentsCleared

func (m *UserDepartmentsMutation) LionDepartmentsCleared() bool

LionDepartmentsCleared reports if the "lion_departments" edge to the Departments entity was cleared.

func (*UserDepartmentsMutation) LionDepartmentsID

func (m *UserDepartmentsMutation) LionDepartmentsID() (id int, exists bool)

LionDepartmentsID returns the "lion_departments" edge ID in the mutation.

func (*UserDepartmentsMutation) LionDepartmentsIDs

func (m *UserDepartmentsMutation) LionDepartmentsIDs() (ids []int)

LionDepartmentsIDs returns the "lion_departments" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionDepartmentsID instead. It exists only for internal usage by the builders.

func (*UserDepartmentsMutation) LionUsersCleared

func (m *UserDepartmentsMutation) LionUsersCleared() bool

LionUsersCleared reports if the "lion_users" edge to the Users entity was cleared.

func (*UserDepartmentsMutation) LionUsersID

func (m *UserDepartmentsMutation) LionUsersID() (id int, exists bool)

LionUsersID returns the "lion_users" edge ID in the mutation.

func (*UserDepartmentsMutation) LionUsersIDs

func (m *UserDepartmentsMutation) LionUsersIDs() (ids []int)

LionUsersIDs returns the "lion_users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionUsersID instead. It exists only for internal usage by the builders.

func (*UserDepartmentsMutation) MemberRole

func (m *UserDepartmentsMutation) MemberRole() (r int, exists bool)

MemberRole returns the value of the "member_role" field in the mutation.

func (*UserDepartmentsMutation) MemberStatus

func (m *UserDepartmentsMutation) MemberStatus() (r int, exists bool)

MemberStatus returns the value of the "member_status" field in the mutation.

func (*UserDepartmentsMutation) MemberType

func (m *UserDepartmentsMutation) MemberType() (r int, exists bool)

MemberType returns the value of the "member_type" field in the mutation.

func (*UserDepartmentsMutation) Metadata

func (m *UserDepartmentsMutation) Metadata() (r string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*UserDepartmentsMutation) MetadataCleared

func (m *UserDepartmentsMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*UserDepartmentsMutation) OldCreatedAt

func (m *UserDepartmentsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldCreatedBy

func (m *UserDepartmentsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldDepartmentID

func (m *UserDepartmentsMutation) OldDepartmentID(ctx context.Context) (v int, err error)

OldDepartmentID returns the old "department_id" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldDescription

func (m *UserDepartmentsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldExpiredAt

func (m *UserDepartmentsMutation) OldExpiredAt(ctx context.Context) (v time.Time, err error)

OldExpiredAt returns the old "expired_at" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldField

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) OldMemberRole

func (m *UserDepartmentsMutation) OldMemberRole(ctx context.Context) (v int, err error)

OldMemberRole returns the old "member_role" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldMemberStatus

func (m *UserDepartmentsMutation) OldMemberStatus(ctx context.Context) (v int, err error)

OldMemberStatus returns the old "member_status" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldMemberType

func (m *UserDepartmentsMutation) OldMemberType(ctx context.Context) (v int, err error)

OldMemberType returns the old "member_type" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldMetadata

func (m *UserDepartmentsMutation) OldMetadata(ctx context.Context) (v string, err error)

OldMetadata returns the old "metadata" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldUpdatedAt

func (m *UserDepartmentsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldUpdatedBy

func (m *UserDepartmentsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) OldUserID

func (m *UserDepartmentsMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserDepartments entity. If the UserDepartments 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 (*UserDepartmentsMutation) Op

func (m *UserDepartmentsMutation) Op() Op

Op returns the operation name.

func (*UserDepartmentsMutation) RemovedEdges

func (m *UserDepartmentsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserDepartmentsMutation) RemovedIDs

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) ResetCreatedAt

func (m *UserDepartmentsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserDepartmentsMutation) ResetCreatedBy

func (m *UserDepartmentsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UserDepartmentsMutation) ResetDepartmentID

func (m *UserDepartmentsMutation) ResetDepartmentID()

ResetDepartmentID resets all changes to the "department_id" field.

func (*UserDepartmentsMutation) ResetDescription

func (m *UserDepartmentsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*UserDepartmentsMutation) ResetEdge

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) ResetExpiredAt

func (m *UserDepartmentsMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" field.

func (*UserDepartmentsMutation) ResetField

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) ResetLionDepartments

func (m *UserDepartmentsMutation) ResetLionDepartments()

ResetLionDepartments resets all changes to the "lion_departments" edge.

func (*UserDepartmentsMutation) ResetLionUsers

func (m *UserDepartmentsMutation) ResetLionUsers()

ResetLionUsers resets all changes to the "lion_users" edge.

func (*UserDepartmentsMutation) ResetMemberRole

func (m *UserDepartmentsMutation) ResetMemberRole()

ResetMemberRole resets all changes to the "member_role" field.

func (*UserDepartmentsMutation) ResetMemberStatus

func (m *UserDepartmentsMutation) ResetMemberStatus()

ResetMemberStatus resets all changes to the "member_status" field.

func (*UserDepartmentsMutation) ResetMemberType

func (m *UserDepartmentsMutation) ResetMemberType()

ResetMemberType resets all changes to the "member_type" field.

func (*UserDepartmentsMutation) ResetMetadata

func (m *UserDepartmentsMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*UserDepartmentsMutation) ResetUpdatedAt

func (m *UserDepartmentsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserDepartmentsMutation) ResetUpdatedBy

func (m *UserDepartmentsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UserDepartmentsMutation) ResetUserID

func (m *UserDepartmentsMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserDepartmentsMutation) SetCreatedAt

func (m *UserDepartmentsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserDepartmentsMutation) SetCreatedBy

func (m *UserDepartmentsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*UserDepartmentsMutation) SetDepartmentID

func (m *UserDepartmentsMutation) SetDepartmentID(i int)

SetDepartmentID sets the "department_id" field.

func (*UserDepartmentsMutation) SetDescription

func (m *UserDepartmentsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*UserDepartmentsMutation) SetExpiredAt

func (m *UserDepartmentsMutation) SetExpiredAt(t time.Time)

SetExpiredAt sets the "expired_at" field.

func (*UserDepartmentsMutation) SetField

func (m *UserDepartmentsMutation) 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 (*UserDepartmentsMutation) SetLionDepartmentsID

func (m *UserDepartmentsMutation) SetLionDepartmentsID(id int)

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by id.

func (*UserDepartmentsMutation) SetLionUsersID

func (m *UserDepartmentsMutation) SetLionUsersID(id int)

SetLionUsersID sets the "lion_users" edge to the Users entity by id.

func (*UserDepartmentsMutation) SetMemberRole

func (m *UserDepartmentsMutation) SetMemberRole(i int)

SetMemberRole sets the "member_role" field.

func (*UserDepartmentsMutation) SetMemberStatus

func (m *UserDepartmentsMutation) SetMemberStatus(i int)

SetMemberStatus sets the "member_status" field.

func (*UserDepartmentsMutation) SetMemberType

func (m *UserDepartmentsMutation) SetMemberType(i int)

SetMemberType sets the "member_type" field.

func (*UserDepartmentsMutation) SetMetadata

func (m *UserDepartmentsMutation) SetMetadata(s string)

SetMetadata sets the "metadata" field.

func (*UserDepartmentsMutation) SetOp

func (m *UserDepartmentsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserDepartmentsMutation) SetUpdatedAt

func (m *UserDepartmentsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserDepartmentsMutation) SetUpdatedBy

func (m *UserDepartmentsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*UserDepartmentsMutation) SetUserID

func (m *UserDepartmentsMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserDepartmentsMutation) Tx

func (m UserDepartmentsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserDepartmentsMutation) Type

func (m *UserDepartmentsMutation) Type() string

Type returns the node type of this mutation (UserDepartments).

func (*UserDepartmentsMutation) UpdatedAt

func (m *UserDepartmentsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserDepartmentsMutation) UpdatedBy

func (m *UserDepartmentsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UserDepartmentsMutation) UpdatedByCleared

func (m *UserDepartmentsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UserDepartmentsMutation) UserID

func (m *UserDepartmentsMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserDepartmentsMutation) Where

Where appends a list predicates to the UserDepartmentsMutation builder.

func (*UserDepartmentsMutation) WhereP

func (m *UserDepartmentsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserDepartmentsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserDepartmentsQuery

type UserDepartmentsQuery struct {
	// contains filtered or unexported fields
}

UserDepartmentsQuery is the builder for querying UserDepartments entities.

func (*UserDepartmentsQuery) Aggregate

Aggregate returns a UserDepartmentsSelect configured with the given aggregations.

func (*UserDepartmentsQuery) All

All executes the query and returns a list of UserDepartmentsSlice.

func (*UserDepartmentsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*UserDepartmentsQuery) Clone

Clone returns a duplicate of the UserDepartmentsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserDepartmentsQuery) Count

func (_q *UserDepartmentsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserDepartmentsQuery) CountX

func (_q *UserDepartmentsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserDepartmentsQuery) Exist

func (_q *UserDepartmentsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserDepartmentsQuery) ExistX

func (_q *UserDepartmentsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserDepartmentsQuery) First

First returns the first UserDepartments entity from the query. Returns a *NotFoundError when no UserDepartments was found.

func (*UserDepartmentsQuery) FirstID

func (_q *UserDepartmentsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserDepartments ID from the query. Returns a *NotFoundError when no UserDepartments ID was found.

func (*UserDepartmentsQuery) FirstIDX

func (_q *UserDepartmentsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserDepartmentsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*UserDepartmentsQuery) GroupBy

func (_q *UserDepartmentsQuery) GroupBy(field string, fields ...string) *UserDepartmentsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserDepartments.Query().
	GroupBy(userdepartments.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UserDepartmentsQuery) IDs

func (_q *UserDepartmentsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserDepartments IDs.

func (*UserDepartmentsQuery) IDsX

func (_q *UserDepartmentsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserDepartmentsQuery) Limit

func (_q *UserDepartmentsQuery) Limit(limit int) *UserDepartmentsQuery

Limit the number of records to be returned by this query.

func (*UserDepartmentsQuery) Offset

func (_q *UserDepartmentsQuery) Offset(offset int) *UserDepartmentsQuery

Offset to start from.

func (*UserDepartmentsQuery) Only

Only returns a single UserDepartments entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserDepartments entity is found. Returns a *NotFoundError when no UserDepartments entities are found.

func (*UserDepartmentsQuery) OnlyID

func (_q *UserDepartmentsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserDepartments ID in the query. Returns a *NotSingularError when more than one UserDepartments ID is found. Returns a *NotFoundError when no entities are found.

func (*UserDepartmentsQuery) OnlyIDX

func (_q *UserDepartmentsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserDepartmentsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*UserDepartmentsQuery) Order

Order specifies how the records should be ordered.

func (*UserDepartmentsQuery) QueryLionDepartments

func (_q *UserDepartmentsQuery) QueryLionDepartments() *DepartmentsQuery

QueryLionDepartments chains the current query on the "lion_departments" edge.

func (*UserDepartmentsQuery) QueryLionUsers

func (_q *UserDepartmentsQuery) QueryLionUsers() *UsersQuery

QueryLionUsers chains the current query on the "lion_users" edge.

func (*UserDepartmentsQuery) Select

func (_q *UserDepartmentsQuery) Select(fields ...string) *UserDepartmentsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserDepartments.Query().
	Select(userdepartments.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserDepartmentsQuery) Unique

func (_q *UserDepartmentsQuery) Unique(unique bool) *UserDepartmentsQuery

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 (*UserDepartmentsQuery) Where

Where adds a new predicate for the UserDepartmentsQuery builder.

func (*UserDepartmentsQuery) WithLionDepartments

func (_q *UserDepartmentsQuery) WithLionDepartments(opts ...func(*DepartmentsQuery)) *UserDepartmentsQuery

WithLionDepartments tells the query-builder to eager-load the nodes that are connected to the "lion_departments" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserDepartmentsQuery) WithLionUsers

func (_q *UserDepartmentsQuery) WithLionUsers(opts ...func(*UsersQuery)) *UserDepartmentsQuery

WithLionUsers tells the query-builder to eager-load the nodes that are connected to the "lion_users" edge. The optional arguments are used to configure the query builder of the edge.

type UserDepartmentsSelect

type UserDepartmentsSelect struct {
	*UserDepartmentsQuery
	// contains filtered or unexported fields
}

UserDepartmentsSelect is the builder for selecting fields of UserDepartments entities.

func (*UserDepartmentsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*UserDepartmentsSelect) Bool

func (s *UserDepartmentsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) BoolX

func (s *UserDepartmentsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserDepartmentsSelect) Bools

func (s *UserDepartmentsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) BoolsX

func (s *UserDepartmentsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserDepartmentsSelect) Float64

func (s *UserDepartmentsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) Float64X

func (s *UserDepartmentsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserDepartmentsSelect) Float64s

func (s *UserDepartmentsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) Float64sX

func (s *UserDepartmentsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserDepartmentsSelect) Int

func (s *UserDepartmentsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) IntX

func (s *UserDepartmentsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserDepartmentsSelect) Ints

func (s *UserDepartmentsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) IntsX

func (s *UserDepartmentsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserDepartmentsSelect) Scan

func (_s *UserDepartmentsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserDepartmentsSelect) ScanX

func (s *UserDepartmentsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserDepartmentsSelect) String

func (s *UserDepartmentsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) StringX

func (s *UserDepartmentsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserDepartmentsSelect) Strings

func (s *UserDepartmentsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserDepartmentsSelect) StringsX

func (s *UserDepartmentsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserDepartmentsSlice

type UserDepartmentsSlice []*UserDepartments

UserDepartmentsSlice is a parsable slice of UserDepartments.

type UserDepartmentsUpdate

type UserDepartmentsUpdate struct {
	// contains filtered or unexported fields
}

UserDepartmentsUpdate is the builder for updating UserDepartments entities.

func (*UserDepartmentsUpdate) AddCreatedBy

func (_u *UserDepartmentsUpdate) AddCreatedBy(v int64) *UserDepartmentsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*UserDepartmentsUpdate) AddMemberRole

func (_u *UserDepartmentsUpdate) AddMemberRole(v int) *UserDepartmentsUpdate

AddMemberRole adds value to the "member_role" field.

func (*UserDepartmentsUpdate) AddMemberStatus

func (_u *UserDepartmentsUpdate) AddMemberStatus(v int) *UserDepartmentsUpdate

AddMemberStatus adds value to the "member_status" field.

func (*UserDepartmentsUpdate) AddMemberType

func (_u *UserDepartmentsUpdate) AddMemberType(v int) *UserDepartmentsUpdate

AddMemberType adds value to the "member_type" field.

func (*UserDepartmentsUpdate) AddUpdatedBy

func (_u *UserDepartmentsUpdate) AddUpdatedBy(v int64) *UserDepartmentsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*UserDepartmentsUpdate) ClearCreatedBy

func (_u *UserDepartmentsUpdate) ClearCreatedBy() *UserDepartmentsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*UserDepartmentsUpdate) ClearExpiredAt

func (_u *UserDepartmentsUpdate) ClearExpiredAt() *UserDepartmentsUpdate

ClearExpiredAt clears the value of the "expired_at" field.

func (*UserDepartmentsUpdate) ClearLionDepartments

func (_u *UserDepartmentsUpdate) ClearLionDepartments() *UserDepartmentsUpdate

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*UserDepartmentsUpdate) ClearLionUsers

func (_u *UserDepartmentsUpdate) ClearLionUsers() *UserDepartmentsUpdate

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserDepartmentsUpdate) ClearMetadata

func (_u *UserDepartmentsUpdate) ClearMetadata() *UserDepartmentsUpdate

ClearMetadata clears the value of the "metadata" field.

func (*UserDepartmentsUpdate) ClearUpdatedBy

func (_u *UserDepartmentsUpdate) ClearUpdatedBy() *UserDepartmentsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserDepartmentsUpdate) Exec

Exec executes the query.

func (*UserDepartmentsUpdate) ExecX

func (_u *UserDepartmentsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDepartmentsUpdate) Mutation

Mutation returns the UserDepartmentsMutation object of the builder.

func (*UserDepartmentsUpdate) Save

func (_u *UserDepartmentsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserDepartmentsUpdate) SaveX

func (_u *UserDepartmentsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserDepartmentsUpdate) SetCreatedBy

func (_u *UserDepartmentsUpdate) SetCreatedBy(v int64) *UserDepartmentsUpdate

SetCreatedBy sets the "created_by" field.

func (*UserDepartmentsUpdate) SetDepartmentID

func (_u *UserDepartmentsUpdate) SetDepartmentID(v int) *UserDepartmentsUpdate

SetDepartmentID sets the "department_id" field.

func (*UserDepartmentsUpdate) SetDescription

func (_u *UserDepartmentsUpdate) SetDescription(v string) *UserDepartmentsUpdate

SetDescription sets the "description" field.

func (*UserDepartmentsUpdate) SetExpiredAt

SetExpiredAt sets the "expired_at" field.

func (*UserDepartmentsUpdate) SetLionDepartments

func (_u *UserDepartmentsUpdate) SetLionDepartments(v *Departments) *UserDepartmentsUpdate

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*UserDepartmentsUpdate) SetLionDepartmentsID

func (_u *UserDepartmentsUpdate) SetLionDepartmentsID(id int) *UserDepartmentsUpdate

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*UserDepartmentsUpdate) SetLionUsers

func (_u *UserDepartmentsUpdate) SetLionUsers(v *Users) *UserDepartmentsUpdate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserDepartmentsUpdate) SetLionUsersID

func (_u *UserDepartmentsUpdate) SetLionUsersID(id int) *UserDepartmentsUpdate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserDepartmentsUpdate) SetMemberRole

func (_u *UserDepartmentsUpdate) SetMemberRole(v int) *UserDepartmentsUpdate

SetMemberRole sets the "member_role" field.

func (*UserDepartmentsUpdate) SetMemberStatus

func (_u *UserDepartmentsUpdate) SetMemberStatus(v int) *UserDepartmentsUpdate

SetMemberStatus sets the "member_status" field.

func (*UserDepartmentsUpdate) SetMemberType

func (_u *UserDepartmentsUpdate) SetMemberType(v int) *UserDepartmentsUpdate

SetMemberType sets the "member_type" field.

func (*UserDepartmentsUpdate) SetMetadata

SetMetadata sets the "metadata" field.

func (*UserDepartmentsUpdate) SetNillableCreatedBy

func (_u *UserDepartmentsUpdate) SetNillableCreatedBy(v *int64) *UserDepartmentsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableDepartmentID

func (_u *UserDepartmentsUpdate) SetNillableDepartmentID(v *int) *UserDepartmentsUpdate

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableDescription

func (_u *UserDepartmentsUpdate) SetNillableDescription(v *string) *UserDepartmentsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableExpiredAt

func (_u *UserDepartmentsUpdate) SetNillableExpiredAt(v *time.Time) *UserDepartmentsUpdate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableMemberRole

func (_u *UserDepartmentsUpdate) SetNillableMemberRole(v *int) *UserDepartmentsUpdate

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableMemberStatus

func (_u *UserDepartmentsUpdate) SetNillableMemberStatus(v *int) *UserDepartmentsUpdate

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableMemberType

func (_u *UserDepartmentsUpdate) SetNillableMemberType(v *int) *UserDepartmentsUpdate

SetNillableMemberType sets the "member_type" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableMetadata

func (_u *UserDepartmentsUpdate) SetNillableMetadata(v *string) *UserDepartmentsUpdate

SetNillableMetadata sets the "metadata" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableUpdatedBy

func (_u *UserDepartmentsUpdate) SetNillableUpdatedBy(v *int64) *UserDepartmentsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetNillableUserID

func (_u *UserDepartmentsUpdate) SetNillableUserID(v *int) *UserDepartmentsUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserDepartmentsUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserDepartmentsUpdate) SetUpdatedBy

func (_u *UserDepartmentsUpdate) SetUpdatedBy(v int64) *UserDepartmentsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*UserDepartmentsUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*UserDepartmentsUpdate) Where

Where appends a list predicates to the UserDepartmentsUpdate builder.

type UserDepartmentsUpdateOne

type UserDepartmentsUpdateOne struct {
	// contains filtered or unexported fields
}

UserDepartmentsUpdateOne is the builder for updating a single UserDepartments entity.

func (*UserDepartmentsUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*UserDepartmentsUpdateOne) AddMemberRole

AddMemberRole adds value to the "member_role" field.

func (*UserDepartmentsUpdateOne) AddMemberStatus

func (_u *UserDepartmentsUpdateOne) AddMemberStatus(v int) *UserDepartmentsUpdateOne

AddMemberStatus adds value to the "member_status" field.

func (*UserDepartmentsUpdateOne) AddMemberType

AddMemberType adds value to the "member_type" field.

func (*UserDepartmentsUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*UserDepartmentsUpdateOne) ClearCreatedBy

func (_u *UserDepartmentsUpdateOne) ClearCreatedBy() *UserDepartmentsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*UserDepartmentsUpdateOne) ClearExpiredAt

func (_u *UserDepartmentsUpdateOne) ClearExpiredAt() *UserDepartmentsUpdateOne

ClearExpiredAt clears the value of the "expired_at" field.

func (*UserDepartmentsUpdateOne) ClearLionDepartments

func (_u *UserDepartmentsUpdateOne) ClearLionDepartments() *UserDepartmentsUpdateOne

ClearLionDepartments clears the "lion_departments" edge to the Departments entity.

func (*UserDepartmentsUpdateOne) ClearLionUsers

func (_u *UserDepartmentsUpdateOne) ClearLionUsers() *UserDepartmentsUpdateOne

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserDepartmentsUpdateOne) ClearMetadata

ClearMetadata clears the value of the "metadata" field.

func (*UserDepartmentsUpdateOne) ClearUpdatedBy

func (_u *UserDepartmentsUpdateOne) ClearUpdatedBy() *UserDepartmentsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserDepartmentsUpdateOne) Exec

Exec executes the query on the entity.

func (*UserDepartmentsUpdateOne) ExecX

func (_u *UserDepartmentsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDepartmentsUpdateOne) Mutation

Mutation returns the UserDepartmentsMutation object of the builder.

func (*UserDepartmentsUpdateOne) Save

Save executes the query and returns the updated UserDepartments entity.

func (*UserDepartmentsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*UserDepartmentsUpdateOne) Select

func (_u *UserDepartmentsUpdateOne) Select(field string, fields ...string) *UserDepartmentsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserDepartmentsUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*UserDepartmentsUpdateOne) SetDepartmentID

func (_u *UserDepartmentsUpdateOne) SetDepartmentID(v int) *UserDepartmentsUpdateOne

SetDepartmentID sets the "department_id" field.

func (*UserDepartmentsUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*UserDepartmentsUpdateOne) SetExpiredAt

SetExpiredAt sets the "expired_at" field.

func (*UserDepartmentsUpdateOne) SetLionDepartments

SetLionDepartments sets the "lion_departments" edge to the Departments entity.

func (*UserDepartmentsUpdateOne) SetLionDepartmentsID

func (_u *UserDepartmentsUpdateOne) SetLionDepartmentsID(id int) *UserDepartmentsUpdateOne

SetLionDepartmentsID sets the "lion_departments" edge to the Departments entity by ID.

func (*UserDepartmentsUpdateOne) SetLionUsers

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserDepartmentsUpdateOne) SetLionUsersID

func (_u *UserDepartmentsUpdateOne) SetLionUsersID(id int) *UserDepartmentsUpdateOne

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserDepartmentsUpdateOne) SetMemberRole

SetMemberRole sets the "member_role" field.

func (*UserDepartmentsUpdateOne) SetMemberStatus

func (_u *UserDepartmentsUpdateOne) SetMemberStatus(v int) *UserDepartmentsUpdateOne

SetMemberStatus sets the "member_status" field.

func (*UserDepartmentsUpdateOne) SetMemberType

SetMemberType sets the "member_type" field.

func (*UserDepartmentsUpdateOne) SetMetadata

SetMetadata sets the "metadata" field.

func (*UserDepartmentsUpdateOne) SetNillableCreatedBy

func (_u *UserDepartmentsUpdateOne) SetNillableCreatedBy(v *int64) *UserDepartmentsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableDepartmentID

func (_u *UserDepartmentsUpdateOne) SetNillableDepartmentID(v *int) *UserDepartmentsUpdateOne

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableDescription

func (_u *UserDepartmentsUpdateOne) SetNillableDescription(v *string) *UserDepartmentsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableExpiredAt

func (_u *UserDepartmentsUpdateOne) SetNillableExpiredAt(v *time.Time) *UserDepartmentsUpdateOne

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableMemberRole

func (_u *UserDepartmentsUpdateOne) SetNillableMemberRole(v *int) *UserDepartmentsUpdateOne

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableMemberStatus

func (_u *UserDepartmentsUpdateOne) SetNillableMemberStatus(v *int) *UserDepartmentsUpdateOne

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableMemberType

func (_u *UserDepartmentsUpdateOne) SetNillableMemberType(v *int) *UserDepartmentsUpdateOne

SetNillableMemberType sets the "member_type" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableMetadata

func (_u *UserDepartmentsUpdateOne) SetNillableMetadata(v *string) *UserDepartmentsUpdateOne

SetNillableMetadata sets the "metadata" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableUpdatedBy

func (_u *UserDepartmentsUpdateOne) SetNillableUpdatedBy(v *int64) *UserDepartmentsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetNillableUserID

func (_u *UserDepartmentsUpdateOne) SetNillableUserID(v *int) *UserDepartmentsUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserDepartmentsUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserDepartmentsUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*UserDepartmentsUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*UserDepartmentsUpdateOne) Where

Where appends a list predicates to the UserDepartmentsUpdate builder.

type UserGroups

type UserGroups struct {

	// ID of the ent.
	// 用户群组关系 ID,全局唯一标识
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 用户 ID,关联用户表
	UserID int `json:"user_id,omitempty"`
	// 群组 ID,关联群组表
	GroupID int `json:"group_id,omitempty"`
	// 用户在群组中的角色:0-未指定,1-所有者,2-管理员,3-普通成员,4-访客
	MemberRole int `json:"member_role,omitempty"`
	// 用户群组关系状态:0-未知状态,1-待激活,2-正常启用,3-被邀请,4-禁用,5-被拒绝,6-已退出
	MemberStatus int `json:"member_status,omitempty"`
	// 用户加入群组的时间
	JoinedAt time.Time `json:"joined_at,omitempty"`
	// 关系有效期,用于临时成员管理,0表示永久有效
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// 元数据,用于存储自定义属性,支持业务扩展
	Metadata map[string]string `json:"metadata,omitempty"`
	// 用户组描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserGroupsQuery when eager-loading is set.
	Edges UserGroupsEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserGroups is the model entity for the UserGroups schema.

func (*UserGroups) QueryLionGroups

func (_m *UserGroups) QueryLionGroups() *GroupsQuery

QueryLionGroups queries the "lion_groups" edge of the UserGroups entity.

func (*UserGroups) QueryLionUsers

func (_m *UserGroups) QueryLionUsers() *UsersQuery

QueryLionUsers queries the "lion_users" edge of the UserGroups entity.

func (*UserGroups) String

func (_m *UserGroups) String() string

String implements the fmt.Stringer.

func (*UserGroups) Unwrap

func (_m *UserGroups) Unwrap() *UserGroups

Unwrap unwraps the UserGroups 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 (*UserGroups) Update

func (_m *UserGroups) Update() *UserGroupsUpdateOne

Update returns a builder for updating this UserGroups. Note that you need to call UserGroups.Unwrap() before calling this method if this UserGroups was returned from a transaction, and the transaction was committed or rolled back.

func (*UserGroups) Value

func (_m *UserGroups) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserGroups. This includes values selected through modifiers, order, etc.

type UserGroupsClient

type UserGroupsClient struct {
	// contains filtered or unexported fields
}

UserGroupsClient is a client for the UserGroups schema.

func NewUserGroupsClient

func NewUserGroupsClient(c config) *UserGroupsClient

NewUserGroupsClient returns a client for the UserGroups from the given config.

func (*UserGroupsClient) Create

func (c *UserGroupsClient) Create() *UserGroupsCreate

Create returns a builder for creating a UserGroups entity.

func (*UserGroupsClient) CreateBulk

func (c *UserGroupsClient) CreateBulk(builders ...*UserGroupsCreate) *UserGroupsCreateBulk

CreateBulk returns a builder for creating a bulk of UserGroups entities.

func (*UserGroupsClient) Delete

func (c *UserGroupsClient) Delete() *UserGroupsDelete

Delete returns a delete builder for UserGroups.

func (*UserGroupsClient) DeleteOne

func (c *UserGroupsClient) DeleteOne(_m *UserGroups) *UserGroupsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserGroupsClient) DeleteOneID

func (c *UserGroupsClient) DeleteOneID(id int) *UserGroupsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserGroupsClient) Get

func (c *UserGroupsClient) Get(ctx context.Context, id int) (*UserGroups, error)

Get returns a UserGroups entity by its id.

func (*UserGroupsClient) GetX

func (c *UserGroupsClient) GetX(ctx context.Context, id int) *UserGroups

GetX is like Get, but panics if an error occurs.

func (*UserGroupsClient) Hooks

func (c *UserGroupsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserGroupsClient) Intercept

func (c *UserGroupsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usergroups.Intercept(f(g(h())))`.

func (*UserGroupsClient) Interceptors

func (c *UserGroupsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserGroupsClient) MapCreateBulk

func (c *UserGroupsClient) MapCreateBulk(slice any, setFunc func(*UserGroupsCreate, int)) *UserGroupsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserGroupsClient) Query

func (c *UserGroupsClient) Query() *UserGroupsQuery

Query returns a query builder for UserGroups.

func (*UserGroupsClient) QueryLionGroups

func (c *UserGroupsClient) QueryLionGroups(_m *UserGroups) *GroupsQuery

QueryLionGroups queries the lion_groups edge of a UserGroups.

func (*UserGroupsClient) QueryLionUsers

func (c *UserGroupsClient) QueryLionUsers(_m *UserGroups) *UsersQuery

QueryLionUsers queries the lion_users edge of a UserGroups.

func (*UserGroupsClient) Update

func (c *UserGroupsClient) Update() *UserGroupsUpdate

Update returns an update builder for UserGroups.

func (*UserGroupsClient) UpdateOne

func (c *UserGroupsClient) UpdateOne(_m *UserGroups) *UserGroupsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserGroupsClient) UpdateOneID

func (c *UserGroupsClient) UpdateOneID(id int) *UserGroupsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserGroupsClient) Use

func (c *UserGroupsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usergroups.Hooks(f(g(h())))`.

type UserGroupsCreate

type UserGroupsCreate struct {
	// contains filtered or unexported fields
}

UserGroupsCreate is the builder for creating a UserGroups entity.

func (*UserGroupsCreate) Exec

func (_c *UserGroupsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupsCreate) ExecX

func (_c *UserGroupsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupsCreate) Mutation

func (_c *UserGroupsCreate) Mutation() *UserGroupsMutation

Mutation returns the UserGroupsMutation object of the builder.

func (*UserGroupsCreate) Save

func (_c *UserGroupsCreate) Save(ctx context.Context) (*UserGroups, error)

Save creates the UserGroups in the database.

func (*UserGroupsCreate) SaveX

func (_c *UserGroupsCreate) SaveX(ctx context.Context) *UserGroups

SaveX calls Save and panics if Save returns an error.

func (*UserGroupsCreate) SetCreatedAt

func (_c *UserGroupsCreate) SetCreatedAt(v time.Time) *UserGroupsCreate

SetCreatedAt sets the "created_at" field.

func (*UserGroupsCreate) SetCreatedBy

func (_c *UserGroupsCreate) SetCreatedBy(v int64) *UserGroupsCreate

SetCreatedBy sets the "created_by" field.

func (*UserGroupsCreate) SetDescription

func (_c *UserGroupsCreate) SetDescription(v string) *UserGroupsCreate

SetDescription sets the "description" field.

func (*UserGroupsCreate) SetExpiredAt

func (_c *UserGroupsCreate) SetExpiredAt(v time.Time) *UserGroupsCreate

SetExpiredAt sets the "expired_at" field.

func (*UserGroupsCreate) SetGroupID

func (_c *UserGroupsCreate) SetGroupID(v int) *UserGroupsCreate

SetGroupID sets the "group_id" field.

func (*UserGroupsCreate) SetID

func (_c *UserGroupsCreate) SetID(v int) *UserGroupsCreate

SetID sets the "id" field.

func (*UserGroupsCreate) SetJoinedAt

func (_c *UserGroupsCreate) SetJoinedAt(v time.Time) *UserGroupsCreate

SetJoinedAt sets the "joined_at" field.

func (*UserGroupsCreate) SetLionGroups

func (_c *UserGroupsCreate) SetLionGroups(v *Groups) *UserGroupsCreate

SetLionGroups sets the "lion_groups" edge to the Groups entity.

func (*UserGroupsCreate) SetLionGroupsID

func (_c *UserGroupsCreate) SetLionGroupsID(id int) *UserGroupsCreate

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by ID.

func (*UserGroupsCreate) SetLionUsers

func (_c *UserGroupsCreate) SetLionUsers(v *Users) *UserGroupsCreate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserGroupsCreate) SetLionUsersID

func (_c *UserGroupsCreate) SetLionUsersID(id int) *UserGroupsCreate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserGroupsCreate) SetMemberRole

func (_c *UserGroupsCreate) SetMemberRole(v int) *UserGroupsCreate

SetMemberRole sets the "member_role" field.

func (*UserGroupsCreate) SetMemberStatus

func (_c *UserGroupsCreate) SetMemberStatus(v int) *UserGroupsCreate

SetMemberStatus sets the "member_status" field.

func (*UserGroupsCreate) SetMetadata

func (_c *UserGroupsCreate) SetMetadata(v map[string]string) *UserGroupsCreate

SetMetadata sets the "metadata" field.

func (*UserGroupsCreate) SetNillableCreatedAt

func (_c *UserGroupsCreate) SetNillableCreatedAt(v *time.Time) *UserGroupsCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableCreatedBy

func (_c *UserGroupsCreate) SetNillableCreatedBy(v *int64) *UserGroupsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableDescription

func (_c *UserGroupsCreate) SetNillableDescription(v *string) *UserGroupsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableExpiredAt

func (_c *UserGroupsCreate) SetNillableExpiredAt(v *time.Time) *UserGroupsCreate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableJoinedAt

func (_c *UserGroupsCreate) SetNillableJoinedAt(v *time.Time) *UserGroupsCreate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableMemberRole

func (_c *UserGroupsCreate) SetNillableMemberRole(v *int) *UserGroupsCreate

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableMemberStatus

func (_c *UserGroupsCreate) SetNillableMemberStatus(v *int) *UserGroupsCreate

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableUpdatedAt

func (_c *UserGroupsCreate) SetNillableUpdatedAt(v *time.Time) *UserGroupsCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserGroupsCreate) SetNillableUpdatedBy

func (_c *UserGroupsCreate) SetNillableUpdatedBy(v *int64) *UserGroupsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserGroupsCreate) SetUpdatedAt

func (_c *UserGroupsCreate) SetUpdatedAt(v time.Time) *UserGroupsCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserGroupsCreate) SetUpdatedBy

func (_c *UserGroupsCreate) SetUpdatedBy(v int64) *UserGroupsCreate

SetUpdatedBy sets the "updated_by" field.

func (*UserGroupsCreate) SetUserID

func (_c *UserGroupsCreate) SetUserID(v int) *UserGroupsCreate

SetUserID sets the "user_id" field.

type UserGroupsCreateBulk

type UserGroupsCreateBulk struct {
	// contains filtered or unexported fields
}

UserGroupsCreateBulk is the builder for creating many UserGroups entities in bulk.

func (*UserGroupsCreateBulk) Exec

func (_c *UserGroupsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupsCreateBulk) ExecX

func (_c *UserGroupsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupsCreateBulk) Save

func (_c *UserGroupsCreateBulk) Save(ctx context.Context) ([]*UserGroups, error)

Save creates the UserGroups entities in the database.

func (*UserGroupsCreateBulk) SaveX

func (_c *UserGroupsCreateBulk) SaveX(ctx context.Context) []*UserGroups

SaveX is like Save, but panics if an error occurs.

type UserGroupsDelete

type UserGroupsDelete struct {
	// contains filtered or unexported fields
}

UserGroupsDelete is the builder for deleting a UserGroups entity.

func (*UserGroupsDelete) Exec

func (_d *UserGroupsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserGroupsDelete) ExecX

func (_d *UserGroupsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupsDelete) Where

Where appends a list predicates to the UserGroupsDelete builder.

type UserGroupsDeleteOne

type UserGroupsDeleteOne struct {
	// contains filtered or unexported fields
}

UserGroupsDeleteOne is the builder for deleting a single UserGroups entity.

func (*UserGroupsDeleteOne) Exec

func (_d *UserGroupsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserGroupsDeleteOne) ExecX

func (_d *UserGroupsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupsDeleteOne) Where

Where appends a list predicates to the UserGroupsDelete builder.

type UserGroupsEdges

type UserGroupsEdges struct {
	// LionUsers holds the value of the lion_users edge.
	LionUsers *Users `json:"lion_users,omitempty"`
	// LionGroups holds the value of the lion_groups edge.
	LionGroups *Groups `json:"lion_groups,omitempty"`
	// contains filtered or unexported fields
}

UserGroupsEdges holds the relations/edges for other nodes in the graph.

func (UserGroupsEdges) LionGroupsOrErr

func (e UserGroupsEdges) LionGroupsOrErr() (*Groups, error)

LionGroupsOrErr returns the LionGroups value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserGroupsEdges) LionUsersOrErr

func (e UserGroupsEdges) LionUsersOrErr() (*Users, error)

LionUsersOrErr returns the LionUsers value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupsGroupBy

type UserGroupsGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupsGroupBy is the group-by builder for UserGroups entities.

func (*UserGroupsGroupBy) Aggregate

func (_g *UserGroupsGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupsGroupBy) Bool

func (s *UserGroupsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) BoolX

func (s *UserGroupsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupsGroupBy) Bools

func (s *UserGroupsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) BoolsX

func (s *UserGroupsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupsGroupBy) Float64

func (s *UserGroupsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) Float64X

func (s *UserGroupsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupsGroupBy) Float64s

func (s *UserGroupsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) Float64sX

func (s *UserGroupsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupsGroupBy) Int

func (s *UserGroupsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) IntX

func (s *UserGroupsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupsGroupBy) Ints

func (s *UserGroupsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) IntsX

func (s *UserGroupsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupsGroupBy) Scan

func (_g *UserGroupsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupsGroupBy) ScanX

func (s *UserGroupsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupsGroupBy) String

func (s *UserGroupsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) StringX

func (s *UserGroupsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupsGroupBy) Strings

func (s *UserGroupsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupsGroupBy) StringsX

func (s *UserGroupsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserGroupsMutation

type UserGroupsMutation struct {
	// contains filtered or unexported fields
}

UserGroupsMutation represents an operation that mutates the UserGroups nodes in the graph.

func (*UserGroupsMutation) AddCreatedBy

func (m *UserGroupsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*UserGroupsMutation) AddField

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) AddMemberRole

func (m *UserGroupsMutation) AddMemberRole(i int)

AddMemberRole adds i to the "member_role" field.

func (*UserGroupsMutation) AddMemberStatus

func (m *UserGroupsMutation) AddMemberStatus(i int)

AddMemberStatus adds i to the "member_status" field.

func (*UserGroupsMutation) AddUpdatedBy

func (m *UserGroupsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*UserGroupsMutation) AddedCreatedBy

func (m *UserGroupsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*UserGroupsMutation) AddedEdges

func (m *UserGroupsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserGroupsMutation) AddedField

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) AddedFields

func (m *UserGroupsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserGroupsMutation) AddedIDs

func (m *UserGroupsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserGroupsMutation) AddedMemberRole

func (m *UserGroupsMutation) AddedMemberRole() (r int, exists bool)

AddedMemberRole returns the value that was added to the "member_role" field in this mutation.

func (*UserGroupsMutation) AddedMemberStatus

func (m *UserGroupsMutation) AddedMemberStatus() (r int, exists bool)

AddedMemberStatus returns the value that was added to the "member_status" field in this mutation.

func (*UserGroupsMutation) AddedUpdatedBy

func (m *UserGroupsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*UserGroupsMutation) ClearCreatedBy

func (m *UserGroupsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*UserGroupsMutation) ClearEdge

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) ClearExpiredAt

func (m *UserGroupsMutation) ClearExpiredAt()

ClearExpiredAt clears the value of the "expired_at" field.

func (*UserGroupsMutation) ClearField

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) ClearJoinedAt

func (m *UserGroupsMutation) ClearJoinedAt()

ClearJoinedAt clears the value of the "joined_at" field.

func (*UserGroupsMutation) ClearLionGroups

func (m *UserGroupsMutation) ClearLionGroups()

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*UserGroupsMutation) ClearLionUsers

func (m *UserGroupsMutation) ClearLionUsers()

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserGroupsMutation) ClearMetadata

func (m *UserGroupsMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*UserGroupsMutation) ClearUpdatedBy

func (m *UserGroupsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserGroupsMutation) ClearedEdges

func (m *UserGroupsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserGroupsMutation) ClearedFields

func (m *UserGroupsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserGroupsMutation) Client

func (m UserGroupsMutation) 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 (*UserGroupsMutation) CreatedAt

func (m *UserGroupsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserGroupsMutation) CreatedBy

func (m *UserGroupsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UserGroupsMutation) CreatedByCleared

func (m *UserGroupsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*UserGroupsMutation) Description

func (m *UserGroupsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*UserGroupsMutation) EdgeCleared

func (m *UserGroupsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserGroupsMutation) ExpiredAt

func (m *UserGroupsMutation) ExpiredAt() (r time.Time, exists bool)

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*UserGroupsMutation) ExpiredAtCleared

func (m *UserGroupsMutation) ExpiredAtCleared() bool

ExpiredAtCleared returns if the "expired_at" field was cleared in this mutation.

func (*UserGroupsMutation) Field

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) FieldCleared

func (m *UserGroupsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserGroupsMutation) Fields

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) GroupID

func (m *UserGroupsMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*UserGroupsMutation) ID

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) IDs

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) JoinedAt

func (m *UserGroupsMutation) JoinedAt() (r time.Time, exists bool)

JoinedAt returns the value of the "joined_at" field in the mutation.

func (*UserGroupsMutation) JoinedAtCleared

func (m *UserGroupsMutation) JoinedAtCleared() bool

JoinedAtCleared returns if the "joined_at" field was cleared in this mutation.

func (*UserGroupsMutation) LionGroupsCleared

func (m *UserGroupsMutation) LionGroupsCleared() bool

LionGroupsCleared reports if the "lion_groups" edge to the Groups entity was cleared.

func (*UserGroupsMutation) LionGroupsID

func (m *UserGroupsMutation) LionGroupsID() (id int, exists bool)

LionGroupsID returns the "lion_groups" edge ID in the mutation.

func (*UserGroupsMutation) LionGroupsIDs

func (m *UserGroupsMutation) LionGroupsIDs() (ids []int)

LionGroupsIDs returns the "lion_groups" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionGroupsID instead. It exists only for internal usage by the builders.

func (*UserGroupsMutation) LionUsersCleared

func (m *UserGroupsMutation) LionUsersCleared() bool

LionUsersCleared reports if the "lion_users" edge to the Users entity was cleared.

func (*UserGroupsMutation) LionUsersID

func (m *UserGroupsMutation) LionUsersID() (id int, exists bool)

LionUsersID returns the "lion_users" edge ID in the mutation.

func (*UserGroupsMutation) LionUsersIDs

func (m *UserGroupsMutation) LionUsersIDs() (ids []int)

LionUsersIDs returns the "lion_users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionUsersID instead. It exists only for internal usage by the builders.

func (*UserGroupsMutation) MemberRole

func (m *UserGroupsMutation) MemberRole() (r int, exists bool)

MemberRole returns the value of the "member_role" field in the mutation.

func (*UserGroupsMutation) MemberStatus

func (m *UserGroupsMutation) MemberStatus() (r int, exists bool)

MemberStatus returns the value of the "member_status" field in the mutation.

func (*UserGroupsMutation) Metadata

func (m *UserGroupsMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*UserGroupsMutation) MetadataCleared

func (m *UserGroupsMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*UserGroupsMutation) OldCreatedAt

func (m *UserGroupsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldCreatedBy

func (m *UserGroupsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldDescription

func (m *UserGroupsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldExpiredAt

func (m *UserGroupsMutation) OldExpiredAt(ctx context.Context) (v time.Time, err error)

OldExpiredAt returns the old "expired_at" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldField

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) OldGroupID

func (m *UserGroupsMutation) OldGroupID(ctx context.Context) (v int, err error)

OldGroupID returns the old "group_id" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldJoinedAt

func (m *UserGroupsMutation) OldJoinedAt(ctx context.Context) (v time.Time, err error)

OldJoinedAt returns the old "joined_at" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldMemberRole

func (m *UserGroupsMutation) OldMemberRole(ctx context.Context) (v int, err error)

OldMemberRole returns the old "member_role" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldMemberStatus

func (m *UserGroupsMutation) OldMemberStatus(ctx context.Context) (v int, err error)

OldMemberStatus returns the old "member_status" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldMetadata

func (m *UserGroupsMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldUpdatedAt

func (m *UserGroupsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldUpdatedBy

func (m *UserGroupsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) OldUserID

func (m *UserGroupsMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserGroups entity. If the UserGroups 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 (*UserGroupsMutation) Op

func (m *UserGroupsMutation) Op() Op

Op returns the operation name.

func (*UserGroupsMutation) RemovedEdges

func (m *UserGroupsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserGroupsMutation) RemovedIDs

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) ResetCreatedAt

func (m *UserGroupsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserGroupsMutation) ResetCreatedBy

func (m *UserGroupsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UserGroupsMutation) ResetDescription

func (m *UserGroupsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*UserGroupsMutation) ResetEdge

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) ResetExpiredAt

func (m *UserGroupsMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" field.

func (*UserGroupsMutation) ResetField

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) ResetGroupID

func (m *UserGroupsMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*UserGroupsMutation) ResetJoinedAt

func (m *UserGroupsMutation) ResetJoinedAt()

ResetJoinedAt resets all changes to the "joined_at" field.

func (*UserGroupsMutation) ResetLionGroups

func (m *UserGroupsMutation) ResetLionGroups()

ResetLionGroups resets all changes to the "lion_groups" edge.

func (*UserGroupsMutation) ResetLionUsers

func (m *UserGroupsMutation) ResetLionUsers()

ResetLionUsers resets all changes to the "lion_users" edge.

func (*UserGroupsMutation) ResetMemberRole

func (m *UserGroupsMutation) ResetMemberRole()

ResetMemberRole resets all changes to the "member_role" field.

func (*UserGroupsMutation) ResetMemberStatus

func (m *UserGroupsMutation) ResetMemberStatus()

ResetMemberStatus resets all changes to the "member_status" field.

func (*UserGroupsMutation) ResetMetadata

func (m *UserGroupsMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*UserGroupsMutation) ResetUpdatedAt

func (m *UserGroupsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserGroupsMutation) ResetUpdatedBy

func (m *UserGroupsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UserGroupsMutation) ResetUserID

func (m *UserGroupsMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserGroupsMutation) SetCreatedAt

func (m *UserGroupsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserGroupsMutation) SetCreatedBy

func (m *UserGroupsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*UserGroupsMutation) SetDescription

func (m *UserGroupsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*UserGroupsMutation) SetExpiredAt

func (m *UserGroupsMutation) SetExpiredAt(t time.Time)

SetExpiredAt sets the "expired_at" field.

func (*UserGroupsMutation) SetField

func (m *UserGroupsMutation) 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 (*UserGroupsMutation) SetGroupID

func (m *UserGroupsMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*UserGroupsMutation) SetID

func (m *UserGroupsMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of UserGroups entities.

func (*UserGroupsMutation) SetJoinedAt

func (m *UserGroupsMutation) SetJoinedAt(t time.Time)

SetJoinedAt sets the "joined_at" field.

func (*UserGroupsMutation) SetLionGroupsID

func (m *UserGroupsMutation) SetLionGroupsID(id int)

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by id.

func (*UserGroupsMutation) SetLionUsersID

func (m *UserGroupsMutation) SetLionUsersID(id int)

SetLionUsersID sets the "lion_users" edge to the Users entity by id.

func (*UserGroupsMutation) SetMemberRole

func (m *UserGroupsMutation) SetMemberRole(i int)

SetMemberRole sets the "member_role" field.

func (*UserGroupsMutation) SetMemberStatus

func (m *UserGroupsMutation) SetMemberStatus(i int)

SetMemberStatus sets the "member_status" field.

func (*UserGroupsMutation) SetMetadata

func (m *UserGroupsMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*UserGroupsMutation) SetOp

func (m *UserGroupsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserGroupsMutation) SetUpdatedAt

func (m *UserGroupsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserGroupsMutation) SetUpdatedBy

func (m *UserGroupsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*UserGroupsMutation) SetUserID

func (m *UserGroupsMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserGroupsMutation) Tx

func (m UserGroupsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserGroupsMutation) Type

func (m *UserGroupsMutation) Type() string

Type returns the node type of this mutation (UserGroups).

func (*UserGroupsMutation) UpdatedAt

func (m *UserGroupsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserGroupsMutation) UpdatedBy

func (m *UserGroupsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UserGroupsMutation) UpdatedByCleared

func (m *UserGroupsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UserGroupsMutation) UserID

func (m *UserGroupsMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserGroupsMutation) Where

func (m *UserGroupsMutation) Where(ps ...predicate.UserGroups)

Where appends a list predicates to the UserGroupsMutation builder.

func (*UserGroupsMutation) WhereP

func (m *UserGroupsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserGroupsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserGroupsQuery

type UserGroupsQuery struct {
	// contains filtered or unexported fields
}

UserGroupsQuery is the builder for querying UserGroups entities.

func (*UserGroupsQuery) Aggregate

func (_q *UserGroupsQuery) Aggregate(fns ...AggregateFunc) *UserGroupsSelect

Aggregate returns a UserGroupsSelect configured with the given aggregations.

func (*UserGroupsQuery) All

func (_q *UserGroupsQuery) All(ctx context.Context) ([]*UserGroups, error)

All executes the query and returns a list of UserGroupsSlice.

func (*UserGroupsQuery) AllX

func (_q *UserGroupsQuery) AllX(ctx context.Context) []*UserGroups

AllX is like All, but panics if an error occurs.

func (*UserGroupsQuery) Clone

func (_q *UserGroupsQuery) Clone() *UserGroupsQuery

Clone returns a duplicate of the UserGroupsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserGroupsQuery) Count

func (_q *UserGroupsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserGroupsQuery) CountX

func (_q *UserGroupsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserGroupsQuery) Exist

func (_q *UserGroupsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserGroupsQuery) ExistX

func (_q *UserGroupsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserGroupsQuery) First

func (_q *UserGroupsQuery) First(ctx context.Context) (*UserGroups, error)

First returns the first UserGroups entity from the query. Returns a *NotFoundError when no UserGroups was found.

func (*UserGroupsQuery) FirstID

func (_q *UserGroupsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserGroups ID from the query. Returns a *NotFoundError when no UserGroups ID was found.

func (*UserGroupsQuery) FirstIDX

func (_q *UserGroupsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserGroupsQuery) FirstX

func (_q *UserGroupsQuery) FirstX(ctx context.Context) *UserGroups

FirstX is like First, but panics if an error occurs.

func (*UserGroupsQuery) GroupBy

func (_q *UserGroupsQuery) GroupBy(field string, fields ...string) *UserGroupsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserGroups.Query().
	GroupBy(usergroups.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UserGroupsQuery) IDs

func (_q *UserGroupsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserGroups IDs.

func (*UserGroupsQuery) IDsX

func (_q *UserGroupsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserGroupsQuery) Limit

func (_q *UserGroupsQuery) Limit(limit int) *UserGroupsQuery

Limit the number of records to be returned by this query.

func (*UserGroupsQuery) Offset

func (_q *UserGroupsQuery) Offset(offset int) *UserGroupsQuery

Offset to start from.

func (*UserGroupsQuery) Only

func (_q *UserGroupsQuery) Only(ctx context.Context) (*UserGroups, error)

Only returns a single UserGroups entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserGroups entity is found. Returns a *NotFoundError when no UserGroups entities are found.

func (*UserGroupsQuery) OnlyID

func (_q *UserGroupsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserGroups ID in the query. Returns a *NotSingularError when more than one UserGroups ID is found. Returns a *NotFoundError when no entities are found.

func (*UserGroupsQuery) OnlyIDX

func (_q *UserGroupsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserGroupsQuery) OnlyX

func (_q *UserGroupsQuery) OnlyX(ctx context.Context) *UserGroups

OnlyX is like Only, but panics if an error occurs.

func (*UserGroupsQuery) Order

Order specifies how the records should be ordered.

func (*UserGroupsQuery) QueryLionGroups

func (_q *UserGroupsQuery) QueryLionGroups() *GroupsQuery

QueryLionGroups chains the current query on the "lion_groups" edge.

func (*UserGroupsQuery) QueryLionUsers

func (_q *UserGroupsQuery) QueryLionUsers() *UsersQuery

QueryLionUsers chains the current query on the "lion_users" edge.

func (*UserGroupsQuery) Select

func (_q *UserGroupsQuery) Select(fields ...string) *UserGroupsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserGroups.Query().
	Select(usergroups.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserGroupsQuery) Unique

func (_q *UserGroupsQuery) Unique(unique bool) *UserGroupsQuery

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 (*UserGroupsQuery) Where

Where adds a new predicate for the UserGroupsQuery builder.

func (*UserGroupsQuery) WithLionGroups

func (_q *UserGroupsQuery) WithLionGroups(opts ...func(*GroupsQuery)) *UserGroupsQuery

WithLionGroups tells the query-builder to eager-load the nodes that are connected to the "lion_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserGroupsQuery) WithLionUsers

func (_q *UserGroupsQuery) WithLionUsers(opts ...func(*UsersQuery)) *UserGroupsQuery

WithLionUsers tells the query-builder to eager-load the nodes that are connected to the "lion_users" edge. The optional arguments are used to configure the query builder of the edge.

type UserGroupsSelect

type UserGroupsSelect struct {
	*UserGroupsQuery
	// contains filtered or unexported fields
}

UserGroupsSelect is the builder for selecting fields of UserGroups entities.

func (*UserGroupsSelect) Aggregate

func (_s *UserGroupsSelect) Aggregate(fns ...AggregateFunc) *UserGroupsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserGroupsSelect) Bool

func (s *UserGroupsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) BoolX

func (s *UserGroupsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupsSelect) Bools

func (s *UserGroupsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) BoolsX

func (s *UserGroupsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupsSelect) Float64

func (s *UserGroupsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) Float64X

func (s *UserGroupsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupsSelect) Float64s

func (s *UserGroupsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) Float64sX

func (s *UserGroupsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupsSelect) Int

func (s *UserGroupsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) IntX

func (s *UserGroupsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupsSelect) Ints

func (s *UserGroupsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) IntsX

func (s *UserGroupsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupsSelect) Scan

func (_s *UserGroupsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupsSelect) ScanX

func (s *UserGroupsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupsSelect) String

func (s *UserGroupsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) StringX

func (s *UserGroupsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupsSelect) Strings

func (s *UserGroupsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupsSelect) StringsX

func (s *UserGroupsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserGroupsSlice

type UserGroupsSlice []*UserGroups

UserGroupsSlice is a parsable slice of UserGroups.

type UserGroupsUpdate

type UserGroupsUpdate struct {
	// contains filtered or unexported fields
}

UserGroupsUpdate is the builder for updating UserGroups entities.

func (*UserGroupsUpdate) AddCreatedBy

func (_u *UserGroupsUpdate) AddCreatedBy(v int64) *UserGroupsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*UserGroupsUpdate) AddMemberRole

func (_u *UserGroupsUpdate) AddMemberRole(v int) *UserGroupsUpdate

AddMemberRole adds value to the "member_role" field.

func (*UserGroupsUpdate) AddMemberStatus

func (_u *UserGroupsUpdate) AddMemberStatus(v int) *UserGroupsUpdate

AddMemberStatus adds value to the "member_status" field.

func (*UserGroupsUpdate) AddUpdatedBy

func (_u *UserGroupsUpdate) AddUpdatedBy(v int64) *UserGroupsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*UserGroupsUpdate) ClearCreatedBy

func (_u *UserGroupsUpdate) ClearCreatedBy() *UserGroupsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*UserGroupsUpdate) ClearExpiredAt

func (_u *UserGroupsUpdate) ClearExpiredAt() *UserGroupsUpdate

ClearExpiredAt clears the value of the "expired_at" field.

func (*UserGroupsUpdate) ClearJoinedAt

func (_u *UserGroupsUpdate) ClearJoinedAt() *UserGroupsUpdate

ClearJoinedAt clears the value of the "joined_at" field.

func (*UserGroupsUpdate) ClearLionGroups

func (_u *UserGroupsUpdate) ClearLionGroups() *UserGroupsUpdate

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*UserGroupsUpdate) ClearLionUsers

func (_u *UserGroupsUpdate) ClearLionUsers() *UserGroupsUpdate

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserGroupsUpdate) ClearMetadata

func (_u *UserGroupsUpdate) ClearMetadata() *UserGroupsUpdate

ClearMetadata clears the value of the "metadata" field.

func (*UserGroupsUpdate) ClearUpdatedBy

func (_u *UserGroupsUpdate) ClearUpdatedBy() *UserGroupsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserGroupsUpdate) Exec

func (_u *UserGroupsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserGroupsUpdate) ExecX

func (_u *UserGroupsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupsUpdate) Mutation

func (_u *UserGroupsUpdate) Mutation() *UserGroupsMutation

Mutation returns the UserGroupsMutation object of the builder.

func (*UserGroupsUpdate) Save

func (_u *UserGroupsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserGroupsUpdate) SaveX

func (_u *UserGroupsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserGroupsUpdate) SetCreatedBy

func (_u *UserGroupsUpdate) SetCreatedBy(v int64) *UserGroupsUpdate

SetCreatedBy sets the "created_by" field.

func (*UserGroupsUpdate) SetDescription

func (_u *UserGroupsUpdate) SetDescription(v string) *UserGroupsUpdate

SetDescription sets the "description" field.

func (*UserGroupsUpdate) SetExpiredAt

func (_u *UserGroupsUpdate) SetExpiredAt(v time.Time) *UserGroupsUpdate

SetExpiredAt sets the "expired_at" field.

func (*UserGroupsUpdate) SetGroupID

func (_u *UserGroupsUpdate) SetGroupID(v int) *UserGroupsUpdate

SetGroupID sets the "group_id" field.

func (*UserGroupsUpdate) SetJoinedAt

func (_u *UserGroupsUpdate) SetJoinedAt(v time.Time) *UserGroupsUpdate

SetJoinedAt sets the "joined_at" field.

func (*UserGroupsUpdate) SetLionGroups

func (_u *UserGroupsUpdate) SetLionGroups(v *Groups) *UserGroupsUpdate

SetLionGroups sets the "lion_groups" edge to the Groups entity.

func (*UserGroupsUpdate) SetLionGroupsID

func (_u *UserGroupsUpdate) SetLionGroupsID(id int) *UserGroupsUpdate

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by ID.

func (*UserGroupsUpdate) SetLionUsers

func (_u *UserGroupsUpdate) SetLionUsers(v *Users) *UserGroupsUpdate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserGroupsUpdate) SetLionUsersID

func (_u *UserGroupsUpdate) SetLionUsersID(id int) *UserGroupsUpdate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserGroupsUpdate) SetMemberRole

func (_u *UserGroupsUpdate) SetMemberRole(v int) *UserGroupsUpdate

SetMemberRole sets the "member_role" field.

func (*UserGroupsUpdate) SetMemberStatus

func (_u *UserGroupsUpdate) SetMemberStatus(v int) *UserGroupsUpdate

SetMemberStatus sets the "member_status" field.

func (*UserGroupsUpdate) SetMetadata

func (_u *UserGroupsUpdate) SetMetadata(v map[string]string) *UserGroupsUpdate

SetMetadata sets the "metadata" field.

func (*UserGroupsUpdate) SetNillableCreatedBy

func (_u *UserGroupsUpdate) SetNillableCreatedBy(v *int64) *UserGroupsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableDescription

func (_u *UserGroupsUpdate) SetNillableDescription(v *string) *UserGroupsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableExpiredAt

func (_u *UserGroupsUpdate) SetNillableExpiredAt(v *time.Time) *UserGroupsUpdate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableGroupID

func (_u *UserGroupsUpdate) SetNillableGroupID(v *int) *UserGroupsUpdate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableJoinedAt

func (_u *UserGroupsUpdate) SetNillableJoinedAt(v *time.Time) *UserGroupsUpdate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableMemberRole

func (_u *UserGroupsUpdate) SetNillableMemberRole(v *int) *UserGroupsUpdate

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableMemberStatus

func (_u *UserGroupsUpdate) SetNillableMemberStatus(v *int) *UserGroupsUpdate

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableUpdatedBy

func (_u *UserGroupsUpdate) SetNillableUpdatedBy(v *int64) *UserGroupsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserGroupsUpdate) SetNillableUserID

func (_u *UserGroupsUpdate) SetNillableUserID(v *int) *UserGroupsUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserGroupsUpdate) SetUpdatedAt

func (_u *UserGroupsUpdate) SetUpdatedAt(v time.Time) *UserGroupsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserGroupsUpdate) SetUpdatedBy

func (_u *UserGroupsUpdate) SetUpdatedBy(v int64) *UserGroupsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*UserGroupsUpdate) SetUserID

func (_u *UserGroupsUpdate) SetUserID(v int) *UserGroupsUpdate

SetUserID sets the "user_id" field.

func (*UserGroupsUpdate) Where

Where appends a list predicates to the UserGroupsUpdate builder.

type UserGroupsUpdateOne

type UserGroupsUpdateOne struct {
	// contains filtered or unexported fields
}

UserGroupsUpdateOne is the builder for updating a single UserGroups entity.

func (*UserGroupsUpdateOne) AddCreatedBy

func (_u *UserGroupsUpdateOne) AddCreatedBy(v int64) *UserGroupsUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*UserGroupsUpdateOne) AddMemberRole

func (_u *UserGroupsUpdateOne) AddMemberRole(v int) *UserGroupsUpdateOne

AddMemberRole adds value to the "member_role" field.

func (*UserGroupsUpdateOne) AddMemberStatus

func (_u *UserGroupsUpdateOne) AddMemberStatus(v int) *UserGroupsUpdateOne

AddMemberStatus adds value to the "member_status" field.

func (*UserGroupsUpdateOne) AddUpdatedBy

func (_u *UserGroupsUpdateOne) AddUpdatedBy(v int64) *UserGroupsUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*UserGroupsUpdateOne) ClearCreatedBy

func (_u *UserGroupsUpdateOne) ClearCreatedBy() *UserGroupsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*UserGroupsUpdateOne) ClearExpiredAt

func (_u *UserGroupsUpdateOne) ClearExpiredAt() *UserGroupsUpdateOne

ClearExpiredAt clears the value of the "expired_at" field.

func (*UserGroupsUpdateOne) ClearJoinedAt

func (_u *UserGroupsUpdateOne) ClearJoinedAt() *UserGroupsUpdateOne

ClearJoinedAt clears the value of the "joined_at" field.

func (*UserGroupsUpdateOne) ClearLionGroups

func (_u *UserGroupsUpdateOne) ClearLionGroups() *UserGroupsUpdateOne

ClearLionGroups clears the "lion_groups" edge to the Groups entity.

func (*UserGroupsUpdateOne) ClearLionUsers

func (_u *UserGroupsUpdateOne) ClearLionUsers() *UserGroupsUpdateOne

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserGroupsUpdateOne) ClearMetadata

func (_u *UserGroupsUpdateOne) ClearMetadata() *UserGroupsUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*UserGroupsUpdateOne) ClearUpdatedBy

func (_u *UserGroupsUpdateOne) ClearUpdatedBy() *UserGroupsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserGroupsUpdateOne) Exec

func (_u *UserGroupsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserGroupsUpdateOne) ExecX

func (_u *UserGroupsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserGroupsUpdateOne) Mutation

func (_u *UserGroupsUpdateOne) Mutation() *UserGroupsMutation

Mutation returns the UserGroupsMutation object of the builder.

func (*UserGroupsUpdateOne) Save

Save executes the query and returns the updated UserGroups entity.

func (*UserGroupsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*UserGroupsUpdateOne) Select

func (_u *UserGroupsUpdateOne) Select(field string, fields ...string) *UserGroupsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserGroupsUpdateOne) SetCreatedBy

func (_u *UserGroupsUpdateOne) SetCreatedBy(v int64) *UserGroupsUpdateOne

SetCreatedBy sets the "created_by" field.

func (*UserGroupsUpdateOne) SetDescription

func (_u *UserGroupsUpdateOne) SetDescription(v string) *UserGroupsUpdateOne

SetDescription sets the "description" field.

func (*UserGroupsUpdateOne) SetExpiredAt

func (_u *UserGroupsUpdateOne) SetExpiredAt(v time.Time) *UserGroupsUpdateOne

SetExpiredAt sets the "expired_at" field.

func (*UserGroupsUpdateOne) SetGroupID

func (_u *UserGroupsUpdateOne) SetGroupID(v int) *UserGroupsUpdateOne

SetGroupID sets the "group_id" field.

func (*UserGroupsUpdateOne) SetJoinedAt

func (_u *UserGroupsUpdateOne) SetJoinedAt(v time.Time) *UserGroupsUpdateOne

SetJoinedAt sets the "joined_at" field.

func (*UserGroupsUpdateOne) SetLionGroups

func (_u *UserGroupsUpdateOne) SetLionGroups(v *Groups) *UserGroupsUpdateOne

SetLionGroups sets the "lion_groups" edge to the Groups entity.

func (*UserGroupsUpdateOne) SetLionGroupsID

func (_u *UserGroupsUpdateOne) SetLionGroupsID(id int) *UserGroupsUpdateOne

SetLionGroupsID sets the "lion_groups" edge to the Groups entity by ID.

func (*UserGroupsUpdateOne) SetLionUsers

func (_u *UserGroupsUpdateOne) SetLionUsers(v *Users) *UserGroupsUpdateOne

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserGroupsUpdateOne) SetLionUsersID

func (_u *UserGroupsUpdateOne) SetLionUsersID(id int) *UserGroupsUpdateOne

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserGroupsUpdateOne) SetMemberRole

func (_u *UserGroupsUpdateOne) SetMemberRole(v int) *UserGroupsUpdateOne

SetMemberRole sets the "member_role" field.

func (*UserGroupsUpdateOne) SetMemberStatus

func (_u *UserGroupsUpdateOne) SetMemberStatus(v int) *UserGroupsUpdateOne

SetMemberStatus sets the "member_status" field.

func (*UserGroupsUpdateOne) SetMetadata

func (_u *UserGroupsUpdateOne) SetMetadata(v map[string]string) *UserGroupsUpdateOne

SetMetadata sets the "metadata" field.

func (*UserGroupsUpdateOne) SetNillableCreatedBy

func (_u *UserGroupsUpdateOne) SetNillableCreatedBy(v *int64) *UserGroupsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableDescription

func (_u *UserGroupsUpdateOne) SetNillableDescription(v *string) *UserGroupsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableExpiredAt

func (_u *UserGroupsUpdateOne) SetNillableExpiredAt(v *time.Time) *UserGroupsUpdateOne

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableGroupID

func (_u *UserGroupsUpdateOne) SetNillableGroupID(v *int) *UserGroupsUpdateOne

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableJoinedAt

func (_u *UserGroupsUpdateOne) SetNillableJoinedAt(v *time.Time) *UserGroupsUpdateOne

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableMemberRole

func (_u *UserGroupsUpdateOne) SetNillableMemberRole(v *int) *UserGroupsUpdateOne

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableMemberStatus

func (_u *UserGroupsUpdateOne) SetNillableMemberStatus(v *int) *UserGroupsUpdateOne

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableUpdatedBy

func (_u *UserGroupsUpdateOne) SetNillableUpdatedBy(v *int64) *UserGroupsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetNillableUserID

func (_u *UserGroupsUpdateOne) SetNillableUserID(v *int) *UserGroupsUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserGroupsUpdateOne) SetUpdatedAt

func (_u *UserGroupsUpdateOne) SetUpdatedAt(v time.Time) *UserGroupsUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserGroupsUpdateOne) SetUpdatedBy

func (_u *UserGroupsUpdateOne) SetUpdatedBy(v int64) *UserGroupsUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*UserGroupsUpdateOne) SetUserID

func (_u *UserGroupsUpdateOne) SetUserID(v int) *UserGroupsUpdateOne

SetUserID sets the "user_id" field.

func (*UserGroupsUpdateOne) Where

Where appends a list predicates to the UserGroupsUpdate builder.

type UserIdentities

type UserIdentities struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 用户ID,关联 lion_users 表
	UserID int `json:"user_id,omitempty"`
	// 认证提供方,来自 lion_oauth_providers 表 id 属性
	ProviderID int `json:"provider_id,omitempty"`
	// 第三方平台用户唯一标识,如微信的 OpenID
	ProviderUserID string `json:"provider_user_id,omitempty"`
	// 第三方平台统一标识,如微信的 UnionID
	ProviderUnionID string `json:"provider_union_id,omitempty"`
	// 使用 bcrypt 哈希后的密码
	PasswordHash string `json:"-"`
	// 是否启用 MFA
	MfaEnabled bool `json:"mfa_enabled,omitempty"`
	// 加密后的 MFA 密钥
	MfaSecretEncrypted []byte `json:"-"`
	// 加密后的访问令牌
	AccessTokenEncrypted []byte `json:"-"`
	// 加密后的刷新令牌
	RefreshTokenEncrypted []byte `json:"-"`
	// 密码最后一次更改时间
	PasswordChangedAt *time.Time `json:"password_changed_at,omitempty"`
	// 密码过期时间
	PasswordExpiresAt *time.Time `json:"password_expires_at,omitempty"`
	// 访问令牌的过期时间
	TokenExpiresAt time.Time `json:"token_expires_at,omitempty"`
	// 最后登录时间
	LastLoginAt *time.Time `json:"last_login_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserIdentitiesQuery when eager-loading is set.
	Edges UserIdentitiesEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserIdentities is the model entity for the UserIdentities schema.

func (*UserIdentities) QueryLionAuthProviders

func (_m *UserIdentities) QueryLionAuthProviders() *AuthProvidersQuery

QueryLionAuthProviders queries the "lion_auth_providers" edge of the UserIdentities entity.

func (*UserIdentities) QueryLionUsers

func (_m *UserIdentities) QueryLionUsers() *UsersQuery

QueryLionUsers queries the "lion_users" edge of the UserIdentities entity.

func (*UserIdentities) String

func (_m *UserIdentities) String() string

String implements the fmt.Stringer.

func (*UserIdentities) Unwrap

func (_m *UserIdentities) Unwrap() *UserIdentities

Unwrap unwraps the UserIdentities 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 (*UserIdentities) Update

Update returns a builder for updating this UserIdentities. Note that you need to call UserIdentities.Unwrap() before calling this method if this UserIdentities was returned from a transaction, and the transaction was committed or rolled back.

func (*UserIdentities) Value

func (_m *UserIdentities) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserIdentities. This includes values selected through modifiers, order, etc.

type UserIdentitiesClient

type UserIdentitiesClient struct {
	// contains filtered or unexported fields
}

UserIdentitiesClient is a client for the UserIdentities schema.

func NewUserIdentitiesClient

func NewUserIdentitiesClient(c config) *UserIdentitiesClient

NewUserIdentitiesClient returns a client for the UserIdentities from the given config.

func (*UserIdentitiesClient) Create

Create returns a builder for creating a UserIdentities entity.

func (*UserIdentitiesClient) CreateBulk

CreateBulk returns a builder for creating a bulk of UserIdentities entities.

func (*UserIdentitiesClient) Delete

Delete returns a delete builder for UserIdentities.

func (*UserIdentitiesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserIdentitiesClient) DeleteOneID

func (c *UserIdentitiesClient) DeleteOneID(id int) *UserIdentitiesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserIdentitiesClient) Get

Get returns a UserIdentities entity by its id.

func (*UserIdentitiesClient) GetX

GetX is like Get, but panics if an error occurs.

func (*UserIdentitiesClient) Hooks

func (c *UserIdentitiesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserIdentitiesClient) Intercept

func (c *UserIdentitiesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `useridentities.Intercept(f(g(h())))`.

func (*UserIdentitiesClient) Interceptors

func (c *UserIdentitiesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserIdentitiesClient) MapCreateBulk

func (c *UserIdentitiesClient) MapCreateBulk(slice any, setFunc func(*UserIdentitiesCreate, int)) *UserIdentitiesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserIdentitiesClient) Query

Query returns a query builder for UserIdentities.

func (*UserIdentitiesClient) QueryLionAuthProviders

func (c *UserIdentitiesClient) QueryLionAuthProviders(_m *UserIdentities) *AuthProvidersQuery

QueryLionAuthProviders queries the lion_auth_providers edge of a UserIdentities.

func (*UserIdentitiesClient) QueryLionUsers

func (c *UserIdentitiesClient) QueryLionUsers(_m *UserIdentities) *UsersQuery

QueryLionUsers queries the lion_users edge of a UserIdentities.

func (*UserIdentitiesClient) Update

Update returns an update builder for UserIdentities.

func (*UserIdentitiesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserIdentitiesClient) UpdateOneID

func (c *UserIdentitiesClient) UpdateOneID(id int) *UserIdentitiesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserIdentitiesClient) Use

func (c *UserIdentitiesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `useridentities.Hooks(f(g(h())))`.

type UserIdentitiesCreate

type UserIdentitiesCreate struct {
	// contains filtered or unexported fields
}

UserIdentitiesCreate is the builder for creating a UserIdentities entity.

func (*UserIdentitiesCreate) Exec

func (_c *UserIdentitiesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserIdentitiesCreate) ExecX

func (_c *UserIdentitiesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserIdentitiesCreate) Mutation

Mutation returns the UserIdentitiesMutation object of the builder.

func (*UserIdentitiesCreate) Save

Save creates the UserIdentities in the database.

func (*UserIdentitiesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserIdentitiesCreate) SetAccessTokenEncrypted

func (_c *UserIdentitiesCreate) SetAccessTokenEncrypted(v []byte) *UserIdentitiesCreate

SetAccessTokenEncrypted sets the "access_token_encrypted" field.

func (*UserIdentitiesCreate) SetCreatedAt

func (_c *UserIdentitiesCreate) SetCreatedAt(v time.Time) *UserIdentitiesCreate

SetCreatedAt sets the "created_at" field.

func (*UserIdentitiesCreate) SetCreatedBy

func (_c *UserIdentitiesCreate) SetCreatedBy(v int64) *UserIdentitiesCreate

SetCreatedBy sets the "created_by" field.

func (*UserIdentitiesCreate) SetLastLoginAt

func (_c *UserIdentitiesCreate) SetLastLoginAt(v time.Time) *UserIdentitiesCreate

SetLastLoginAt sets the "last_login_at" field.

func (*UserIdentitiesCreate) SetLionAuthProviders

func (_c *UserIdentitiesCreate) SetLionAuthProviders(v *AuthProviders) *UserIdentitiesCreate

SetLionAuthProviders sets the "lion_auth_providers" edge to the AuthProviders entity.

func (*UserIdentitiesCreate) SetLionAuthProvidersID

func (_c *UserIdentitiesCreate) SetLionAuthProvidersID(id int) *UserIdentitiesCreate

SetLionAuthProvidersID sets the "lion_auth_providers" edge to the AuthProviders entity by ID.

func (*UserIdentitiesCreate) SetLionUsers

func (_c *UserIdentitiesCreate) SetLionUsers(v *Users) *UserIdentitiesCreate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserIdentitiesCreate) SetLionUsersID

func (_c *UserIdentitiesCreate) SetLionUsersID(id int) *UserIdentitiesCreate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserIdentitiesCreate) SetMfaEnabled

func (_c *UserIdentitiesCreate) SetMfaEnabled(v bool) *UserIdentitiesCreate

SetMfaEnabled sets the "mfa_enabled" field.

func (*UserIdentitiesCreate) SetMfaSecretEncrypted

func (_c *UserIdentitiesCreate) SetMfaSecretEncrypted(v []byte) *UserIdentitiesCreate

SetMfaSecretEncrypted sets the "mfa_secret_encrypted" field.

func (*UserIdentitiesCreate) SetNillableCreatedAt

func (_c *UserIdentitiesCreate) SetNillableCreatedAt(v *time.Time) *UserIdentitiesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableCreatedBy

func (_c *UserIdentitiesCreate) SetNillableCreatedBy(v *int64) *UserIdentitiesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableLastLoginAt

func (_c *UserIdentitiesCreate) SetNillableLastLoginAt(v *time.Time) *UserIdentitiesCreate

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableMfaEnabled

func (_c *UserIdentitiesCreate) SetNillableMfaEnabled(v *bool) *UserIdentitiesCreate

SetNillableMfaEnabled sets the "mfa_enabled" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillablePasswordChangedAt

func (_c *UserIdentitiesCreate) SetNillablePasswordChangedAt(v *time.Time) *UserIdentitiesCreate

SetNillablePasswordChangedAt sets the "password_changed_at" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillablePasswordExpiresAt

func (_c *UserIdentitiesCreate) SetNillablePasswordExpiresAt(v *time.Time) *UserIdentitiesCreate

SetNillablePasswordExpiresAt sets the "password_expires_at" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillablePasswordHash

func (_c *UserIdentitiesCreate) SetNillablePasswordHash(v *string) *UserIdentitiesCreate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableProviderUnionID

func (_c *UserIdentitiesCreate) SetNillableProviderUnionID(v *string) *UserIdentitiesCreate

SetNillableProviderUnionID sets the "provider_union_id" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableTokenExpiresAt

func (_c *UserIdentitiesCreate) SetNillableTokenExpiresAt(v *time.Time) *UserIdentitiesCreate

SetNillableTokenExpiresAt sets the "token_expires_at" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableUpdatedAt

func (_c *UserIdentitiesCreate) SetNillableUpdatedAt(v *time.Time) *UserIdentitiesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserIdentitiesCreate) SetNillableUpdatedBy

func (_c *UserIdentitiesCreate) SetNillableUpdatedBy(v *int64) *UserIdentitiesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserIdentitiesCreate) SetPasswordChangedAt

func (_c *UserIdentitiesCreate) SetPasswordChangedAt(v time.Time) *UserIdentitiesCreate

SetPasswordChangedAt sets the "password_changed_at" field.

func (*UserIdentitiesCreate) SetPasswordExpiresAt

func (_c *UserIdentitiesCreate) SetPasswordExpiresAt(v time.Time) *UserIdentitiesCreate

SetPasswordExpiresAt sets the "password_expires_at" field.

func (*UserIdentitiesCreate) SetPasswordHash

func (_c *UserIdentitiesCreate) SetPasswordHash(v string) *UserIdentitiesCreate

SetPasswordHash sets the "password_hash" field.

func (*UserIdentitiesCreate) SetProviderID

func (_c *UserIdentitiesCreate) SetProviderID(v int) *UserIdentitiesCreate

SetProviderID sets the "provider_id" field.

func (*UserIdentitiesCreate) SetProviderUnionID

func (_c *UserIdentitiesCreate) SetProviderUnionID(v string) *UserIdentitiesCreate

SetProviderUnionID sets the "provider_union_id" field.

func (*UserIdentitiesCreate) SetProviderUserID

func (_c *UserIdentitiesCreate) SetProviderUserID(v string) *UserIdentitiesCreate

SetProviderUserID sets the "provider_user_id" field.

func (*UserIdentitiesCreate) SetRefreshTokenEncrypted

func (_c *UserIdentitiesCreate) SetRefreshTokenEncrypted(v []byte) *UserIdentitiesCreate

SetRefreshTokenEncrypted sets the "refresh_token_encrypted" field.

func (*UserIdentitiesCreate) SetTokenExpiresAt

func (_c *UserIdentitiesCreate) SetTokenExpiresAt(v time.Time) *UserIdentitiesCreate

SetTokenExpiresAt sets the "token_expires_at" field.

func (*UserIdentitiesCreate) SetUpdatedAt

func (_c *UserIdentitiesCreate) SetUpdatedAt(v time.Time) *UserIdentitiesCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserIdentitiesCreate) SetUpdatedBy

func (_c *UserIdentitiesCreate) SetUpdatedBy(v int64) *UserIdentitiesCreate

SetUpdatedBy sets the "updated_by" field.

func (*UserIdentitiesCreate) SetUserID

func (_c *UserIdentitiesCreate) SetUserID(v int) *UserIdentitiesCreate

SetUserID sets the "user_id" field.

type UserIdentitiesCreateBulk

type UserIdentitiesCreateBulk struct {
	// contains filtered or unexported fields
}

UserIdentitiesCreateBulk is the builder for creating many UserIdentities entities in bulk.

func (*UserIdentitiesCreateBulk) Exec

Exec executes the query.

func (*UserIdentitiesCreateBulk) ExecX

func (_c *UserIdentitiesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserIdentitiesCreateBulk) Save

Save creates the UserIdentities entities in the database.

func (*UserIdentitiesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type UserIdentitiesDelete

type UserIdentitiesDelete struct {
	// contains filtered or unexported fields
}

UserIdentitiesDelete is the builder for deleting a UserIdentities entity.

func (*UserIdentitiesDelete) Exec

func (_d *UserIdentitiesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserIdentitiesDelete) ExecX

func (_d *UserIdentitiesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserIdentitiesDelete) Where

Where appends a list predicates to the UserIdentitiesDelete builder.

type UserIdentitiesDeleteOne

type UserIdentitiesDeleteOne struct {
	// contains filtered or unexported fields
}

UserIdentitiesDeleteOne is the builder for deleting a single UserIdentities entity.

func (*UserIdentitiesDeleteOne) Exec

Exec executes the deletion query.

func (*UserIdentitiesDeleteOne) ExecX

func (_d *UserIdentitiesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserIdentitiesDeleteOne) Where

Where appends a list predicates to the UserIdentitiesDelete builder.

type UserIdentitiesEdges

type UserIdentitiesEdges struct {
	// LionUsers holds the value of the lion_users edge.
	LionUsers *Users `json:"lion_users,omitempty"`
	// LionAuthProviders holds the value of the lion_auth_providers edge.
	LionAuthProviders *AuthProviders `json:"lion_auth_providers,omitempty"`
	// contains filtered or unexported fields
}

UserIdentitiesEdges holds the relations/edges for other nodes in the graph.

func (UserIdentitiesEdges) LionAuthProvidersOrErr

func (e UserIdentitiesEdges) LionAuthProvidersOrErr() (*AuthProviders, error)

LionAuthProvidersOrErr returns the LionAuthProviders value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserIdentitiesEdges) LionUsersOrErr

func (e UserIdentitiesEdges) LionUsersOrErr() (*Users, error)

LionUsersOrErr returns the LionUsers value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserIdentitiesGroupBy

type UserIdentitiesGroupBy struct {
	// contains filtered or unexported fields
}

UserIdentitiesGroupBy is the group-by builder for UserIdentities entities.

func (*UserIdentitiesGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*UserIdentitiesGroupBy) Bool

func (s *UserIdentitiesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) BoolX

func (s *UserIdentitiesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Bools

func (s *UserIdentitiesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) BoolsX

func (s *UserIdentitiesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Float64

func (s *UserIdentitiesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) Float64X

func (s *UserIdentitiesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Float64s

func (s *UserIdentitiesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) Float64sX

func (s *UserIdentitiesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Int

func (s *UserIdentitiesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) IntX

func (s *UserIdentitiesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Ints

func (s *UserIdentitiesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) IntsX

func (s *UserIdentitiesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Scan

func (_g *UserIdentitiesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserIdentitiesGroupBy) ScanX

func (s *UserIdentitiesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserIdentitiesGroupBy) String

func (s *UserIdentitiesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) StringX

func (s *UserIdentitiesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserIdentitiesGroupBy) Strings

func (s *UserIdentitiesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesGroupBy) StringsX

func (s *UserIdentitiesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserIdentitiesMutation

type UserIdentitiesMutation struct {
	// contains filtered or unexported fields
}

UserIdentitiesMutation represents an operation that mutates the UserIdentities nodes in the graph.

func (*UserIdentitiesMutation) AccessTokenEncrypted

func (m *UserIdentitiesMutation) AccessTokenEncrypted() (r []byte, exists bool)

AccessTokenEncrypted returns the value of the "access_token_encrypted" field in the mutation.

func (*UserIdentitiesMutation) AccessTokenEncryptedCleared

func (m *UserIdentitiesMutation) AccessTokenEncryptedCleared() bool

AccessTokenEncryptedCleared returns if the "access_token_encrypted" field was cleared in this mutation.

func (*UserIdentitiesMutation) AddCreatedBy

func (m *UserIdentitiesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*UserIdentitiesMutation) AddField

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) AddUpdatedBy

func (m *UserIdentitiesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*UserIdentitiesMutation) AddedCreatedBy

func (m *UserIdentitiesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*UserIdentitiesMutation) AddedEdges

func (m *UserIdentitiesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserIdentitiesMutation) AddedField

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) AddedFields

func (m *UserIdentitiesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserIdentitiesMutation) AddedIDs

func (m *UserIdentitiesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserIdentitiesMutation) AddedUpdatedBy

func (m *UserIdentitiesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*UserIdentitiesMutation) ClearAccessTokenEncrypted

func (m *UserIdentitiesMutation) ClearAccessTokenEncrypted()

ClearAccessTokenEncrypted clears the value of the "access_token_encrypted" field.

func (*UserIdentitiesMutation) ClearCreatedBy

func (m *UserIdentitiesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*UserIdentitiesMutation) ClearEdge

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) ClearField

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) ClearLastLoginAt

func (m *UserIdentitiesMutation) ClearLastLoginAt()

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserIdentitiesMutation) ClearLionAuthProviders

func (m *UserIdentitiesMutation) ClearLionAuthProviders()

ClearLionAuthProviders clears the "lion_auth_providers" edge to the AuthProviders entity.

func (*UserIdentitiesMutation) ClearLionUsers

func (m *UserIdentitiesMutation) ClearLionUsers()

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserIdentitiesMutation) ClearPasswordChangedAt

func (m *UserIdentitiesMutation) ClearPasswordChangedAt()

ClearPasswordChangedAt clears the value of the "password_changed_at" field.

func (*UserIdentitiesMutation) ClearPasswordExpiresAt

func (m *UserIdentitiesMutation) ClearPasswordExpiresAt()

ClearPasswordExpiresAt clears the value of the "password_expires_at" field.

func (*UserIdentitiesMutation) ClearProviderUnionID

func (m *UserIdentitiesMutation) ClearProviderUnionID()

ClearProviderUnionID clears the value of the "provider_union_id" field.

func (*UserIdentitiesMutation) ClearRefreshTokenEncrypted

func (m *UserIdentitiesMutation) ClearRefreshTokenEncrypted()

ClearRefreshTokenEncrypted clears the value of the "refresh_token_encrypted" field.

func (*UserIdentitiesMutation) ClearTokenExpiresAt

func (m *UserIdentitiesMutation) ClearTokenExpiresAt()

ClearTokenExpiresAt clears the value of the "token_expires_at" field.

func (*UserIdentitiesMutation) ClearUpdatedBy

func (m *UserIdentitiesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserIdentitiesMutation) ClearedEdges

func (m *UserIdentitiesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserIdentitiesMutation) ClearedFields

func (m *UserIdentitiesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserIdentitiesMutation) Client

func (m UserIdentitiesMutation) 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 (*UserIdentitiesMutation) CreatedAt

func (m *UserIdentitiesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserIdentitiesMutation) CreatedBy

func (m *UserIdentitiesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UserIdentitiesMutation) CreatedByCleared

func (m *UserIdentitiesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*UserIdentitiesMutation) EdgeCleared

func (m *UserIdentitiesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserIdentitiesMutation) Field

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) FieldCleared

func (m *UserIdentitiesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserIdentitiesMutation) Fields

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) ID

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) IDs

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) LastLoginAt

func (m *UserIdentitiesMutation) LastLoginAt() (r time.Time, exists bool)

LastLoginAt returns the value of the "last_login_at" field in the mutation.

func (*UserIdentitiesMutation) LastLoginAtCleared

func (m *UserIdentitiesMutation) LastLoginAtCleared() bool

LastLoginAtCleared returns if the "last_login_at" field was cleared in this mutation.

func (*UserIdentitiesMutation) LionAuthProvidersCleared

func (m *UserIdentitiesMutation) LionAuthProvidersCleared() bool

LionAuthProvidersCleared reports if the "lion_auth_providers" edge to the AuthProviders entity was cleared.

func (*UserIdentitiesMutation) LionAuthProvidersID

func (m *UserIdentitiesMutation) LionAuthProvidersID() (id int, exists bool)

LionAuthProvidersID returns the "lion_auth_providers" edge ID in the mutation.

func (*UserIdentitiesMutation) LionAuthProvidersIDs

func (m *UserIdentitiesMutation) LionAuthProvidersIDs() (ids []int)

LionAuthProvidersIDs returns the "lion_auth_providers" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionAuthProvidersID instead. It exists only for internal usage by the builders.

func (*UserIdentitiesMutation) LionUsersCleared

func (m *UserIdentitiesMutation) LionUsersCleared() bool

LionUsersCleared reports if the "lion_users" edge to the Users entity was cleared.

func (*UserIdentitiesMutation) LionUsersID

func (m *UserIdentitiesMutation) LionUsersID() (id int, exists bool)

LionUsersID returns the "lion_users" edge ID in the mutation.

func (*UserIdentitiesMutation) LionUsersIDs

func (m *UserIdentitiesMutation) LionUsersIDs() (ids []int)

LionUsersIDs returns the "lion_users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionUsersID instead. It exists only for internal usage by the builders.

func (*UserIdentitiesMutation) MfaEnabled

func (m *UserIdentitiesMutation) MfaEnabled() (r bool, exists bool)

MfaEnabled returns the value of the "mfa_enabled" field in the mutation.

func (*UserIdentitiesMutation) MfaSecretEncrypted

func (m *UserIdentitiesMutation) MfaSecretEncrypted() (r []byte, exists bool)

MfaSecretEncrypted returns the value of the "mfa_secret_encrypted" field in the mutation.

func (*UserIdentitiesMutation) OldAccessTokenEncrypted

func (m *UserIdentitiesMutation) OldAccessTokenEncrypted(ctx context.Context) (v []byte, err error)

OldAccessTokenEncrypted returns the old "access_token_encrypted" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldCreatedAt

func (m *UserIdentitiesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldCreatedBy

func (m *UserIdentitiesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldField

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) OldLastLoginAt

func (m *UserIdentitiesMutation) OldLastLoginAt(ctx context.Context) (v *time.Time, err error)

OldLastLoginAt returns the old "last_login_at" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldMfaEnabled

func (m *UserIdentitiesMutation) OldMfaEnabled(ctx context.Context) (v bool, err error)

OldMfaEnabled returns the old "mfa_enabled" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldMfaSecretEncrypted

func (m *UserIdentitiesMutation) OldMfaSecretEncrypted(ctx context.Context) (v []byte, err error)

OldMfaSecretEncrypted returns the old "mfa_secret_encrypted" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldPasswordChangedAt

func (m *UserIdentitiesMutation) OldPasswordChangedAt(ctx context.Context) (v *time.Time, err error)

OldPasswordChangedAt returns the old "password_changed_at" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldPasswordExpiresAt

func (m *UserIdentitiesMutation) OldPasswordExpiresAt(ctx context.Context) (v *time.Time, err error)

OldPasswordExpiresAt returns the old "password_expires_at" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldPasswordHash

func (m *UserIdentitiesMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldProviderID

func (m *UserIdentitiesMutation) OldProviderID(ctx context.Context) (v int, err error)

OldProviderID returns the old "provider_id" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldProviderUnionID

func (m *UserIdentitiesMutation) OldProviderUnionID(ctx context.Context) (v string, err error)

OldProviderUnionID returns the old "provider_union_id" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldProviderUserID

func (m *UserIdentitiesMutation) OldProviderUserID(ctx context.Context) (v string, err error)

OldProviderUserID returns the old "provider_user_id" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldRefreshTokenEncrypted

func (m *UserIdentitiesMutation) OldRefreshTokenEncrypted(ctx context.Context) (v []byte, err error)

OldRefreshTokenEncrypted returns the old "refresh_token_encrypted" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldTokenExpiresAt

func (m *UserIdentitiesMutation) OldTokenExpiresAt(ctx context.Context) (v time.Time, err error)

OldTokenExpiresAt returns the old "token_expires_at" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldUpdatedAt

func (m *UserIdentitiesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldUpdatedBy

func (m *UserIdentitiesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) OldUserID

func (m *UserIdentitiesMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserIdentities entity. If the UserIdentities 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 (*UserIdentitiesMutation) Op

func (m *UserIdentitiesMutation) Op() Op

Op returns the operation name.

func (*UserIdentitiesMutation) PasswordChangedAt

func (m *UserIdentitiesMutation) PasswordChangedAt() (r time.Time, exists bool)

PasswordChangedAt returns the value of the "password_changed_at" field in the mutation.

func (*UserIdentitiesMutation) PasswordChangedAtCleared

func (m *UserIdentitiesMutation) PasswordChangedAtCleared() bool

PasswordChangedAtCleared returns if the "password_changed_at" field was cleared in this mutation.

func (*UserIdentitiesMutation) PasswordExpiresAt

func (m *UserIdentitiesMutation) PasswordExpiresAt() (r time.Time, exists bool)

PasswordExpiresAt returns the value of the "password_expires_at" field in the mutation.

func (*UserIdentitiesMutation) PasswordExpiresAtCleared

func (m *UserIdentitiesMutation) PasswordExpiresAtCleared() bool

PasswordExpiresAtCleared returns if the "password_expires_at" field was cleared in this mutation.

func (*UserIdentitiesMutation) PasswordHash

func (m *UserIdentitiesMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*UserIdentitiesMutation) ProviderID

func (m *UserIdentitiesMutation) ProviderID() (r int, exists bool)

ProviderID returns the value of the "provider_id" field in the mutation.

func (*UserIdentitiesMutation) ProviderUnionID

func (m *UserIdentitiesMutation) ProviderUnionID() (r string, exists bool)

ProviderUnionID returns the value of the "provider_union_id" field in the mutation.

func (*UserIdentitiesMutation) ProviderUnionIDCleared

func (m *UserIdentitiesMutation) ProviderUnionIDCleared() bool

ProviderUnionIDCleared returns if the "provider_union_id" field was cleared in this mutation.

func (*UserIdentitiesMutation) ProviderUserID

func (m *UserIdentitiesMutation) ProviderUserID() (r string, exists bool)

ProviderUserID returns the value of the "provider_user_id" field in the mutation.

func (*UserIdentitiesMutation) RefreshTokenEncrypted

func (m *UserIdentitiesMutation) RefreshTokenEncrypted() (r []byte, exists bool)

RefreshTokenEncrypted returns the value of the "refresh_token_encrypted" field in the mutation.

func (*UserIdentitiesMutation) RefreshTokenEncryptedCleared

func (m *UserIdentitiesMutation) RefreshTokenEncryptedCleared() bool

RefreshTokenEncryptedCleared returns if the "refresh_token_encrypted" field was cleared in this mutation.

func (*UserIdentitiesMutation) RemovedEdges

func (m *UserIdentitiesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserIdentitiesMutation) RemovedIDs

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) ResetAccessTokenEncrypted

func (m *UserIdentitiesMutation) ResetAccessTokenEncrypted()

ResetAccessTokenEncrypted resets all changes to the "access_token_encrypted" field.

func (*UserIdentitiesMutation) ResetCreatedAt

func (m *UserIdentitiesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserIdentitiesMutation) ResetCreatedBy

func (m *UserIdentitiesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UserIdentitiesMutation) ResetEdge

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) ResetField

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) ResetLastLoginAt

func (m *UserIdentitiesMutation) ResetLastLoginAt()

ResetLastLoginAt resets all changes to the "last_login_at" field.

func (*UserIdentitiesMutation) ResetLionAuthProviders

func (m *UserIdentitiesMutation) ResetLionAuthProviders()

ResetLionAuthProviders resets all changes to the "lion_auth_providers" edge.

func (*UserIdentitiesMutation) ResetLionUsers

func (m *UserIdentitiesMutation) ResetLionUsers()

ResetLionUsers resets all changes to the "lion_users" edge.

func (*UserIdentitiesMutation) ResetMfaEnabled

func (m *UserIdentitiesMutation) ResetMfaEnabled()

ResetMfaEnabled resets all changes to the "mfa_enabled" field.

func (*UserIdentitiesMutation) ResetMfaSecretEncrypted

func (m *UserIdentitiesMutation) ResetMfaSecretEncrypted()

ResetMfaSecretEncrypted resets all changes to the "mfa_secret_encrypted" field.

func (*UserIdentitiesMutation) ResetPasswordChangedAt

func (m *UserIdentitiesMutation) ResetPasswordChangedAt()

ResetPasswordChangedAt resets all changes to the "password_changed_at" field.

func (*UserIdentitiesMutation) ResetPasswordExpiresAt

func (m *UserIdentitiesMutation) ResetPasswordExpiresAt()

ResetPasswordExpiresAt resets all changes to the "password_expires_at" field.

func (*UserIdentitiesMutation) ResetPasswordHash

func (m *UserIdentitiesMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*UserIdentitiesMutation) ResetProviderID

func (m *UserIdentitiesMutation) ResetProviderID()

ResetProviderID resets all changes to the "provider_id" field.

func (*UserIdentitiesMutation) ResetProviderUnionID

func (m *UserIdentitiesMutation) ResetProviderUnionID()

ResetProviderUnionID resets all changes to the "provider_union_id" field.

func (*UserIdentitiesMutation) ResetProviderUserID

func (m *UserIdentitiesMutation) ResetProviderUserID()

ResetProviderUserID resets all changes to the "provider_user_id" field.

func (*UserIdentitiesMutation) ResetRefreshTokenEncrypted

func (m *UserIdentitiesMutation) ResetRefreshTokenEncrypted()

ResetRefreshTokenEncrypted resets all changes to the "refresh_token_encrypted" field.

func (*UserIdentitiesMutation) ResetTokenExpiresAt

func (m *UserIdentitiesMutation) ResetTokenExpiresAt()

ResetTokenExpiresAt resets all changes to the "token_expires_at" field.

func (*UserIdentitiesMutation) ResetUpdatedAt

func (m *UserIdentitiesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserIdentitiesMutation) ResetUpdatedBy

func (m *UserIdentitiesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UserIdentitiesMutation) ResetUserID

func (m *UserIdentitiesMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserIdentitiesMutation) SetAccessTokenEncrypted

func (m *UserIdentitiesMutation) SetAccessTokenEncrypted(b []byte)

SetAccessTokenEncrypted sets the "access_token_encrypted" field.

func (*UserIdentitiesMutation) SetCreatedAt

func (m *UserIdentitiesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserIdentitiesMutation) SetCreatedBy

func (m *UserIdentitiesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*UserIdentitiesMutation) SetField

func (m *UserIdentitiesMutation) 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 (*UserIdentitiesMutation) SetLastLoginAt

func (m *UserIdentitiesMutation) SetLastLoginAt(t time.Time)

SetLastLoginAt sets the "last_login_at" field.

func (*UserIdentitiesMutation) SetLionAuthProvidersID

func (m *UserIdentitiesMutation) SetLionAuthProvidersID(id int)

SetLionAuthProvidersID sets the "lion_auth_providers" edge to the AuthProviders entity by id.

func (*UserIdentitiesMutation) SetLionUsersID

func (m *UserIdentitiesMutation) SetLionUsersID(id int)

SetLionUsersID sets the "lion_users" edge to the Users entity by id.

func (*UserIdentitiesMutation) SetMfaEnabled

func (m *UserIdentitiesMutation) SetMfaEnabled(b bool)

SetMfaEnabled sets the "mfa_enabled" field.

func (*UserIdentitiesMutation) SetMfaSecretEncrypted

func (m *UserIdentitiesMutation) SetMfaSecretEncrypted(b []byte)

SetMfaSecretEncrypted sets the "mfa_secret_encrypted" field.

func (*UserIdentitiesMutation) SetOp

func (m *UserIdentitiesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserIdentitiesMutation) SetPasswordChangedAt

func (m *UserIdentitiesMutation) SetPasswordChangedAt(t time.Time)

SetPasswordChangedAt sets the "password_changed_at" field.

func (*UserIdentitiesMutation) SetPasswordExpiresAt

func (m *UserIdentitiesMutation) SetPasswordExpiresAt(t time.Time)

SetPasswordExpiresAt sets the "password_expires_at" field.

func (*UserIdentitiesMutation) SetPasswordHash

func (m *UserIdentitiesMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (*UserIdentitiesMutation) SetProviderID

func (m *UserIdentitiesMutation) SetProviderID(i int)

SetProviderID sets the "provider_id" field.

func (*UserIdentitiesMutation) SetProviderUnionID

func (m *UserIdentitiesMutation) SetProviderUnionID(s string)

SetProviderUnionID sets the "provider_union_id" field.

func (*UserIdentitiesMutation) SetProviderUserID

func (m *UserIdentitiesMutation) SetProviderUserID(s string)

SetProviderUserID sets the "provider_user_id" field.

func (*UserIdentitiesMutation) SetRefreshTokenEncrypted

func (m *UserIdentitiesMutation) SetRefreshTokenEncrypted(b []byte)

SetRefreshTokenEncrypted sets the "refresh_token_encrypted" field.

func (*UserIdentitiesMutation) SetTokenExpiresAt

func (m *UserIdentitiesMutation) SetTokenExpiresAt(t time.Time)

SetTokenExpiresAt sets the "token_expires_at" field.

func (*UserIdentitiesMutation) SetUpdatedAt

func (m *UserIdentitiesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserIdentitiesMutation) SetUpdatedBy

func (m *UserIdentitiesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*UserIdentitiesMutation) SetUserID

func (m *UserIdentitiesMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*UserIdentitiesMutation) TokenExpiresAt

func (m *UserIdentitiesMutation) TokenExpiresAt() (r time.Time, exists bool)

TokenExpiresAt returns the value of the "token_expires_at" field in the mutation.

func (*UserIdentitiesMutation) TokenExpiresAtCleared

func (m *UserIdentitiesMutation) TokenExpiresAtCleared() bool

TokenExpiresAtCleared returns if the "token_expires_at" field was cleared in this mutation.

func (UserIdentitiesMutation) Tx

func (m UserIdentitiesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserIdentitiesMutation) Type

func (m *UserIdentitiesMutation) Type() string

Type returns the node type of this mutation (UserIdentities).

func (*UserIdentitiesMutation) UpdatedAt

func (m *UserIdentitiesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserIdentitiesMutation) UpdatedBy

func (m *UserIdentitiesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UserIdentitiesMutation) UpdatedByCleared

func (m *UserIdentitiesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UserIdentitiesMutation) UserID

func (m *UserIdentitiesMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserIdentitiesMutation) Where

Where appends a list predicates to the UserIdentitiesMutation builder.

func (*UserIdentitiesMutation) WhereP

func (m *UserIdentitiesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserIdentitiesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserIdentitiesQuery

type UserIdentitiesQuery struct {
	// contains filtered or unexported fields
}

UserIdentitiesQuery is the builder for querying UserIdentities entities.

func (*UserIdentitiesQuery) Aggregate

Aggregate returns a UserIdentitiesSelect configured with the given aggregations.

func (*UserIdentitiesQuery) All

All executes the query and returns a list of UserIdentitiesSlice.

func (*UserIdentitiesQuery) AllX

AllX is like All, but panics if an error occurs.

func (*UserIdentitiesQuery) Clone

Clone returns a duplicate of the UserIdentitiesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserIdentitiesQuery) Count

func (_q *UserIdentitiesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserIdentitiesQuery) CountX

func (_q *UserIdentitiesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserIdentitiesQuery) Exist

func (_q *UserIdentitiesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserIdentitiesQuery) ExistX

func (_q *UserIdentitiesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserIdentitiesQuery) First

First returns the first UserIdentities entity from the query. Returns a *NotFoundError when no UserIdentities was found.

func (*UserIdentitiesQuery) FirstID

func (_q *UserIdentitiesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserIdentities ID from the query. Returns a *NotFoundError when no UserIdentities ID was found.

func (*UserIdentitiesQuery) FirstIDX

func (_q *UserIdentitiesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserIdentitiesQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*UserIdentitiesQuery) GroupBy

func (_q *UserIdentitiesQuery) GroupBy(field string, fields ...string) *UserIdentitiesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserIdentities.Query().
	GroupBy(useridentities.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UserIdentitiesQuery) IDs

func (_q *UserIdentitiesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserIdentities IDs.

func (*UserIdentitiesQuery) IDsX

func (_q *UserIdentitiesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserIdentitiesQuery) Limit

func (_q *UserIdentitiesQuery) Limit(limit int) *UserIdentitiesQuery

Limit the number of records to be returned by this query.

func (*UserIdentitiesQuery) Offset

func (_q *UserIdentitiesQuery) Offset(offset int) *UserIdentitiesQuery

Offset to start from.

func (*UserIdentitiesQuery) Only

Only returns a single UserIdentities entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserIdentities entity is found. Returns a *NotFoundError when no UserIdentities entities are found.

func (*UserIdentitiesQuery) OnlyID

func (_q *UserIdentitiesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserIdentities ID in the query. Returns a *NotSingularError when more than one UserIdentities ID is found. Returns a *NotFoundError when no entities are found.

func (*UserIdentitiesQuery) OnlyIDX

func (_q *UserIdentitiesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserIdentitiesQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*UserIdentitiesQuery) Order

Order specifies how the records should be ordered.

func (*UserIdentitiesQuery) QueryLionAuthProviders

func (_q *UserIdentitiesQuery) QueryLionAuthProviders() *AuthProvidersQuery

QueryLionAuthProviders chains the current query on the "lion_auth_providers" edge.

func (*UserIdentitiesQuery) QueryLionUsers

func (_q *UserIdentitiesQuery) QueryLionUsers() *UsersQuery

QueryLionUsers chains the current query on the "lion_users" edge.

func (*UserIdentitiesQuery) Select

func (_q *UserIdentitiesQuery) Select(fields ...string) *UserIdentitiesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserIdentities.Query().
	Select(useridentities.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserIdentitiesQuery) Unique

func (_q *UserIdentitiesQuery) Unique(unique bool) *UserIdentitiesQuery

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 (*UserIdentitiesQuery) Where

Where adds a new predicate for the UserIdentitiesQuery builder.

func (*UserIdentitiesQuery) WithLionAuthProviders

func (_q *UserIdentitiesQuery) WithLionAuthProviders(opts ...func(*AuthProvidersQuery)) *UserIdentitiesQuery

WithLionAuthProviders tells the query-builder to eager-load the nodes that are connected to the "lion_auth_providers" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserIdentitiesQuery) WithLionUsers

func (_q *UserIdentitiesQuery) WithLionUsers(opts ...func(*UsersQuery)) *UserIdentitiesQuery

WithLionUsers tells the query-builder to eager-load the nodes that are connected to the "lion_users" edge. The optional arguments are used to configure the query builder of the edge.

type UserIdentitiesSelect

type UserIdentitiesSelect struct {
	*UserIdentitiesQuery
	// contains filtered or unexported fields
}

UserIdentitiesSelect is the builder for selecting fields of UserIdentities entities.

func (*UserIdentitiesSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*UserIdentitiesSelect) Bool

func (s *UserIdentitiesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) BoolX

func (s *UserIdentitiesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserIdentitiesSelect) Bools

func (s *UserIdentitiesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) BoolsX

func (s *UserIdentitiesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserIdentitiesSelect) Float64

func (s *UserIdentitiesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) Float64X

func (s *UserIdentitiesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserIdentitiesSelect) Float64s

func (s *UserIdentitiesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) Float64sX

func (s *UserIdentitiesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserIdentitiesSelect) Int

func (s *UserIdentitiesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) IntX

func (s *UserIdentitiesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserIdentitiesSelect) Ints

func (s *UserIdentitiesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) IntsX

func (s *UserIdentitiesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserIdentitiesSelect) Scan

func (_s *UserIdentitiesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserIdentitiesSelect) ScanX

func (s *UserIdentitiesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserIdentitiesSelect) String

func (s *UserIdentitiesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) StringX

func (s *UserIdentitiesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserIdentitiesSelect) Strings

func (s *UserIdentitiesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserIdentitiesSelect) StringsX

func (s *UserIdentitiesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserIdentitiesSlice

type UserIdentitiesSlice []*UserIdentities

UserIdentitiesSlice is a parsable slice of UserIdentities.

type UserIdentitiesUpdate

type UserIdentitiesUpdate struct {
	// contains filtered or unexported fields
}

UserIdentitiesUpdate is the builder for updating UserIdentities entities.

func (*UserIdentitiesUpdate) AddCreatedBy

func (_u *UserIdentitiesUpdate) AddCreatedBy(v int64) *UserIdentitiesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*UserIdentitiesUpdate) AddUpdatedBy

func (_u *UserIdentitiesUpdate) AddUpdatedBy(v int64) *UserIdentitiesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*UserIdentitiesUpdate) ClearAccessTokenEncrypted

func (_u *UserIdentitiesUpdate) ClearAccessTokenEncrypted() *UserIdentitiesUpdate

ClearAccessTokenEncrypted clears the value of the "access_token_encrypted" field.

func (*UserIdentitiesUpdate) ClearCreatedBy

func (_u *UserIdentitiesUpdate) ClearCreatedBy() *UserIdentitiesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*UserIdentitiesUpdate) ClearLastLoginAt

func (_u *UserIdentitiesUpdate) ClearLastLoginAt() *UserIdentitiesUpdate

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserIdentitiesUpdate) ClearLionAuthProviders

func (_u *UserIdentitiesUpdate) ClearLionAuthProviders() *UserIdentitiesUpdate

ClearLionAuthProviders clears the "lion_auth_providers" edge to the AuthProviders entity.

func (*UserIdentitiesUpdate) ClearLionUsers

func (_u *UserIdentitiesUpdate) ClearLionUsers() *UserIdentitiesUpdate

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserIdentitiesUpdate) ClearPasswordChangedAt

func (_u *UserIdentitiesUpdate) ClearPasswordChangedAt() *UserIdentitiesUpdate

ClearPasswordChangedAt clears the value of the "password_changed_at" field.

func (*UserIdentitiesUpdate) ClearPasswordExpiresAt

func (_u *UserIdentitiesUpdate) ClearPasswordExpiresAt() *UserIdentitiesUpdate

ClearPasswordExpiresAt clears the value of the "password_expires_at" field.

func (*UserIdentitiesUpdate) ClearProviderUnionID

func (_u *UserIdentitiesUpdate) ClearProviderUnionID() *UserIdentitiesUpdate

ClearProviderUnionID clears the value of the "provider_union_id" field.

func (*UserIdentitiesUpdate) ClearRefreshTokenEncrypted

func (_u *UserIdentitiesUpdate) ClearRefreshTokenEncrypted() *UserIdentitiesUpdate

ClearRefreshTokenEncrypted clears the value of the "refresh_token_encrypted" field.

func (*UserIdentitiesUpdate) ClearTokenExpiresAt

func (_u *UserIdentitiesUpdate) ClearTokenExpiresAt() *UserIdentitiesUpdate

ClearTokenExpiresAt clears the value of the "token_expires_at" field.

func (*UserIdentitiesUpdate) ClearUpdatedBy

func (_u *UserIdentitiesUpdate) ClearUpdatedBy() *UserIdentitiesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserIdentitiesUpdate) Exec

func (_u *UserIdentitiesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserIdentitiesUpdate) ExecX

func (_u *UserIdentitiesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserIdentitiesUpdate) Mutation

Mutation returns the UserIdentitiesMutation object of the builder.

func (*UserIdentitiesUpdate) Save

func (_u *UserIdentitiesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserIdentitiesUpdate) SaveX

func (_u *UserIdentitiesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserIdentitiesUpdate) SetAccessTokenEncrypted

func (_u *UserIdentitiesUpdate) SetAccessTokenEncrypted(v []byte) *UserIdentitiesUpdate

SetAccessTokenEncrypted sets the "access_token_encrypted" field.

func (*UserIdentitiesUpdate) SetCreatedBy

func (_u *UserIdentitiesUpdate) SetCreatedBy(v int64) *UserIdentitiesUpdate

SetCreatedBy sets the "created_by" field.

func (*UserIdentitiesUpdate) SetLastLoginAt

func (_u *UserIdentitiesUpdate) SetLastLoginAt(v time.Time) *UserIdentitiesUpdate

SetLastLoginAt sets the "last_login_at" field.

func (*UserIdentitiesUpdate) SetLionAuthProviders

func (_u *UserIdentitiesUpdate) SetLionAuthProviders(v *AuthProviders) *UserIdentitiesUpdate

SetLionAuthProviders sets the "lion_auth_providers" edge to the AuthProviders entity.

func (*UserIdentitiesUpdate) SetLionAuthProvidersID

func (_u *UserIdentitiesUpdate) SetLionAuthProvidersID(id int) *UserIdentitiesUpdate

SetLionAuthProvidersID sets the "lion_auth_providers" edge to the AuthProviders entity by ID.

func (*UserIdentitiesUpdate) SetLionUsers

func (_u *UserIdentitiesUpdate) SetLionUsers(v *Users) *UserIdentitiesUpdate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserIdentitiesUpdate) SetLionUsersID

func (_u *UserIdentitiesUpdate) SetLionUsersID(id int) *UserIdentitiesUpdate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserIdentitiesUpdate) SetMfaEnabled

func (_u *UserIdentitiesUpdate) SetMfaEnabled(v bool) *UserIdentitiesUpdate

SetMfaEnabled sets the "mfa_enabled" field.

func (*UserIdentitiesUpdate) SetMfaSecretEncrypted

func (_u *UserIdentitiesUpdate) SetMfaSecretEncrypted(v []byte) *UserIdentitiesUpdate

SetMfaSecretEncrypted sets the "mfa_secret_encrypted" field.

func (*UserIdentitiesUpdate) SetNillableCreatedBy

func (_u *UserIdentitiesUpdate) SetNillableCreatedBy(v *int64) *UserIdentitiesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableLastLoginAt

func (_u *UserIdentitiesUpdate) SetNillableLastLoginAt(v *time.Time) *UserIdentitiesUpdate

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableMfaEnabled

func (_u *UserIdentitiesUpdate) SetNillableMfaEnabled(v *bool) *UserIdentitiesUpdate

SetNillableMfaEnabled sets the "mfa_enabled" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillablePasswordChangedAt

func (_u *UserIdentitiesUpdate) SetNillablePasswordChangedAt(v *time.Time) *UserIdentitiesUpdate

SetNillablePasswordChangedAt sets the "password_changed_at" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillablePasswordExpiresAt

func (_u *UserIdentitiesUpdate) SetNillablePasswordExpiresAt(v *time.Time) *UserIdentitiesUpdate

SetNillablePasswordExpiresAt sets the "password_expires_at" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillablePasswordHash

func (_u *UserIdentitiesUpdate) SetNillablePasswordHash(v *string) *UserIdentitiesUpdate

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableProviderID

func (_u *UserIdentitiesUpdate) SetNillableProviderID(v *int) *UserIdentitiesUpdate

SetNillableProviderID sets the "provider_id" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableProviderUnionID

func (_u *UserIdentitiesUpdate) SetNillableProviderUnionID(v *string) *UserIdentitiesUpdate

SetNillableProviderUnionID sets the "provider_union_id" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableProviderUserID

func (_u *UserIdentitiesUpdate) SetNillableProviderUserID(v *string) *UserIdentitiesUpdate

SetNillableProviderUserID sets the "provider_user_id" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableTokenExpiresAt

func (_u *UserIdentitiesUpdate) SetNillableTokenExpiresAt(v *time.Time) *UserIdentitiesUpdate

SetNillableTokenExpiresAt sets the "token_expires_at" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableUpdatedBy

func (_u *UserIdentitiesUpdate) SetNillableUpdatedBy(v *int64) *UserIdentitiesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetNillableUserID

func (_u *UserIdentitiesUpdate) SetNillableUserID(v *int) *UserIdentitiesUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserIdentitiesUpdate) SetPasswordChangedAt

func (_u *UserIdentitiesUpdate) SetPasswordChangedAt(v time.Time) *UserIdentitiesUpdate

SetPasswordChangedAt sets the "password_changed_at" field.

func (*UserIdentitiesUpdate) SetPasswordExpiresAt

func (_u *UserIdentitiesUpdate) SetPasswordExpiresAt(v time.Time) *UserIdentitiesUpdate

SetPasswordExpiresAt sets the "password_expires_at" field.

func (*UserIdentitiesUpdate) SetPasswordHash

func (_u *UserIdentitiesUpdate) SetPasswordHash(v string) *UserIdentitiesUpdate

SetPasswordHash sets the "password_hash" field.

func (*UserIdentitiesUpdate) SetProviderID

func (_u *UserIdentitiesUpdate) SetProviderID(v int) *UserIdentitiesUpdate

SetProviderID sets the "provider_id" field.

func (*UserIdentitiesUpdate) SetProviderUnionID

func (_u *UserIdentitiesUpdate) SetProviderUnionID(v string) *UserIdentitiesUpdate

SetProviderUnionID sets the "provider_union_id" field.

func (*UserIdentitiesUpdate) SetProviderUserID

func (_u *UserIdentitiesUpdate) SetProviderUserID(v string) *UserIdentitiesUpdate

SetProviderUserID sets the "provider_user_id" field.

func (*UserIdentitiesUpdate) SetRefreshTokenEncrypted

func (_u *UserIdentitiesUpdate) SetRefreshTokenEncrypted(v []byte) *UserIdentitiesUpdate

SetRefreshTokenEncrypted sets the "refresh_token_encrypted" field.

func (*UserIdentitiesUpdate) SetTokenExpiresAt

func (_u *UserIdentitiesUpdate) SetTokenExpiresAt(v time.Time) *UserIdentitiesUpdate

SetTokenExpiresAt sets the "token_expires_at" field.

func (*UserIdentitiesUpdate) SetUpdatedAt

func (_u *UserIdentitiesUpdate) SetUpdatedAt(v time.Time) *UserIdentitiesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserIdentitiesUpdate) SetUpdatedBy

func (_u *UserIdentitiesUpdate) SetUpdatedBy(v int64) *UserIdentitiesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*UserIdentitiesUpdate) SetUserID

func (_u *UserIdentitiesUpdate) SetUserID(v int) *UserIdentitiesUpdate

SetUserID sets the "user_id" field.

func (*UserIdentitiesUpdate) Where

Where appends a list predicates to the UserIdentitiesUpdate builder.

type UserIdentitiesUpdateOne

type UserIdentitiesUpdateOne struct {
	// contains filtered or unexported fields
}

UserIdentitiesUpdateOne is the builder for updating a single UserIdentities entity.

func (*UserIdentitiesUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*UserIdentitiesUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*UserIdentitiesUpdateOne) ClearAccessTokenEncrypted

func (_u *UserIdentitiesUpdateOne) ClearAccessTokenEncrypted() *UserIdentitiesUpdateOne

ClearAccessTokenEncrypted clears the value of the "access_token_encrypted" field.

func (*UserIdentitiesUpdateOne) ClearCreatedBy

func (_u *UserIdentitiesUpdateOne) ClearCreatedBy() *UserIdentitiesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*UserIdentitiesUpdateOne) ClearLastLoginAt

func (_u *UserIdentitiesUpdateOne) ClearLastLoginAt() *UserIdentitiesUpdateOne

ClearLastLoginAt clears the value of the "last_login_at" field.

func (*UserIdentitiesUpdateOne) ClearLionAuthProviders

func (_u *UserIdentitiesUpdateOne) ClearLionAuthProviders() *UserIdentitiesUpdateOne

ClearLionAuthProviders clears the "lion_auth_providers" edge to the AuthProviders entity.

func (*UserIdentitiesUpdateOne) ClearLionUsers

func (_u *UserIdentitiesUpdateOne) ClearLionUsers() *UserIdentitiesUpdateOne

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserIdentitiesUpdateOne) ClearPasswordChangedAt

func (_u *UserIdentitiesUpdateOne) ClearPasswordChangedAt() *UserIdentitiesUpdateOne

ClearPasswordChangedAt clears the value of the "password_changed_at" field.

func (*UserIdentitiesUpdateOne) ClearPasswordExpiresAt

func (_u *UserIdentitiesUpdateOne) ClearPasswordExpiresAt() *UserIdentitiesUpdateOne

ClearPasswordExpiresAt clears the value of the "password_expires_at" field.

func (*UserIdentitiesUpdateOne) ClearProviderUnionID

func (_u *UserIdentitiesUpdateOne) ClearProviderUnionID() *UserIdentitiesUpdateOne

ClearProviderUnionID clears the value of the "provider_union_id" field.

func (*UserIdentitiesUpdateOne) ClearRefreshTokenEncrypted

func (_u *UserIdentitiesUpdateOne) ClearRefreshTokenEncrypted() *UserIdentitiesUpdateOne

ClearRefreshTokenEncrypted clears the value of the "refresh_token_encrypted" field.

func (*UserIdentitiesUpdateOne) ClearTokenExpiresAt

func (_u *UserIdentitiesUpdateOne) ClearTokenExpiresAt() *UserIdentitiesUpdateOne

ClearTokenExpiresAt clears the value of the "token_expires_at" field.

func (*UserIdentitiesUpdateOne) ClearUpdatedBy

func (_u *UserIdentitiesUpdateOne) ClearUpdatedBy() *UserIdentitiesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserIdentitiesUpdateOne) Exec

Exec executes the query on the entity.

func (*UserIdentitiesUpdateOne) ExecX

func (_u *UserIdentitiesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserIdentitiesUpdateOne) Mutation

Mutation returns the UserIdentitiesMutation object of the builder.

func (*UserIdentitiesUpdateOne) Save

Save executes the query and returns the updated UserIdentities entity.

func (*UserIdentitiesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*UserIdentitiesUpdateOne) Select

func (_u *UserIdentitiesUpdateOne) Select(field string, fields ...string) *UserIdentitiesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserIdentitiesUpdateOne) SetAccessTokenEncrypted

func (_u *UserIdentitiesUpdateOne) SetAccessTokenEncrypted(v []byte) *UserIdentitiesUpdateOne

SetAccessTokenEncrypted sets the "access_token_encrypted" field.

func (*UserIdentitiesUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*UserIdentitiesUpdateOne) SetLastLoginAt

SetLastLoginAt sets the "last_login_at" field.

func (*UserIdentitiesUpdateOne) SetLionAuthProviders

func (_u *UserIdentitiesUpdateOne) SetLionAuthProviders(v *AuthProviders) *UserIdentitiesUpdateOne

SetLionAuthProviders sets the "lion_auth_providers" edge to the AuthProviders entity.

func (*UserIdentitiesUpdateOne) SetLionAuthProvidersID

func (_u *UserIdentitiesUpdateOne) SetLionAuthProvidersID(id int) *UserIdentitiesUpdateOne

SetLionAuthProvidersID sets the "lion_auth_providers" edge to the AuthProviders entity by ID.

func (*UserIdentitiesUpdateOne) SetLionUsers

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserIdentitiesUpdateOne) SetLionUsersID

func (_u *UserIdentitiesUpdateOne) SetLionUsersID(id int) *UserIdentitiesUpdateOne

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserIdentitiesUpdateOne) SetMfaEnabled

SetMfaEnabled sets the "mfa_enabled" field.

func (*UserIdentitiesUpdateOne) SetMfaSecretEncrypted

func (_u *UserIdentitiesUpdateOne) SetMfaSecretEncrypted(v []byte) *UserIdentitiesUpdateOne

SetMfaSecretEncrypted sets the "mfa_secret_encrypted" field.

func (*UserIdentitiesUpdateOne) SetNillableCreatedBy

func (_u *UserIdentitiesUpdateOne) SetNillableCreatedBy(v *int64) *UserIdentitiesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableLastLoginAt

func (_u *UserIdentitiesUpdateOne) SetNillableLastLoginAt(v *time.Time) *UserIdentitiesUpdateOne

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableMfaEnabled

func (_u *UserIdentitiesUpdateOne) SetNillableMfaEnabled(v *bool) *UserIdentitiesUpdateOne

SetNillableMfaEnabled sets the "mfa_enabled" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillablePasswordChangedAt

func (_u *UserIdentitiesUpdateOne) SetNillablePasswordChangedAt(v *time.Time) *UserIdentitiesUpdateOne

SetNillablePasswordChangedAt sets the "password_changed_at" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillablePasswordExpiresAt

func (_u *UserIdentitiesUpdateOne) SetNillablePasswordExpiresAt(v *time.Time) *UserIdentitiesUpdateOne

SetNillablePasswordExpiresAt sets the "password_expires_at" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillablePasswordHash

func (_u *UserIdentitiesUpdateOne) SetNillablePasswordHash(v *string) *UserIdentitiesUpdateOne

SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableProviderID

func (_u *UserIdentitiesUpdateOne) SetNillableProviderID(v *int) *UserIdentitiesUpdateOne

SetNillableProviderID sets the "provider_id" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableProviderUnionID

func (_u *UserIdentitiesUpdateOne) SetNillableProviderUnionID(v *string) *UserIdentitiesUpdateOne

SetNillableProviderUnionID sets the "provider_union_id" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableProviderUserID

func (_u *UserIdentitiesUpdateOne) SetNillableProviderUserID(v *string) *UserIdentitiesUpdateOne

SetNillableProviderUserID sets the "provider_user_id" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableTokenExpiresAt

func (_u *UserIdentitiesUpdateOne) SetNillableTokenExpiresAt(v *time.Time) *UserIdentitiesUpdateOne

SetNillableTokenExpiresAt sets the "token_expires_at" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableUpdatedBy

func (_u *UserIdentitiesUpdateOne) SetNillableUpdatedBy(v *int64) *UserIdentitiesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetNillableUserID

func (_u *UserIdentitiesUpdateOne) SetNillableUserID(v *int) *UserIdentitiesUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserIdentitiesUpdateOne) SetPasswordChangedAt

func (_u *UserIdentitiesUpdateOne) SetPasswordChangedAt(v time.Time) *UserIdentitiesUpdateOne

SetPasswordChangedAt sets the "password_changed_at" field.

func (*UserIdentitiesUpdateOne) SetPasswordExpiresAt

func (_u *UserIdentitiesUpdateOne) SetPasswordExpiresAt(v time.Time) *UserIdentitiesUpdateOne

SetPasswordExpiresAt sets the "password_expires_at" field.

func (*UserIdentitiesUpdateOne) SetPasswordHash

func (_u *UserIdentitiesUpdateOne) SetPasswordHash(v string) *UserIdentitiesUpdateOne

SetPasswordHash sets the "password_hash" field.

func (*UserIdentitiesUpdateOne) SetProviderID

func (_u *UserIdentitiesUpdateOne) SetProviderID(v int) *UserIdentitiesUpdateOne

SetProviderID sets the "provider_id" field.

func (*UserIdentitiesUpdateOne) SetProviderUnionID

func (_u *UserIdentitiesUpdateOne) SetProviderUnionID(v string) *UserIdentitiesUpdateOne

SetProviderUnionID sets the "provider_union_id" field.

func (*UserIdentitiesUpdateOne) SetProviderUserID

func (_u *UserIdentitiesUpdateOne) SetProviderUserID(v string) *UserIdentitiesUpdateOne

SetProviderUserID sets the "provider_user_id" field.

func (*UserIdentitiesUpdateOne) SetRefreshTokenEncrypted

func (_u *UserIdentitiesUpdateOne) SetRefreshTokenEncrypted(v []byte) *UserIdentitiesUpdateOne

SetRefreshTokenEncrypted sets the "refresh_token_encrypted" field.

func (*UserIdentitiesUpdateOne) SetTokenExpiresAt

func (_u *UserIdentitiesUpdateOne) SetTokenExpiresAt(v time.Time) *UserIdentitiesUpdateOne

SetTokenExpiresAt sets the "token_expires_at" field.

func (*UserIdentitiesUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserIdentitiesUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*UserIdentitiesUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*UserIdentitiesUpdateOne) Where

Where appends a list predicates to the UserIdentitiesUpdate builder.

type UserProfiles

type UserProfiles struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 用户ID,关联 lion_users 表
	UserID int `json:"user_id,omitempty"`
	// 属性键
	AttrKey string `json:"attr_key,omitempty"`
	// 属性值
	AttrValue string `json:"attr_value,omitempty"`
	// contains filtered or unexported fields
}

UserProfiles is the model entity for the UserProfiles schema.

func (*UserProfiles) String

func (_m *UserProfiles) String() string

String implements the fmt.Stringer.

func (*UserProfiles) Unwrap

func (_m *UserProfiles) Unwrap() *UserProfiles

Unwrap unwraps the UserProfiles 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 (*UserProfiles) Update

func (_m *UserProfiles) Update() *UserProfilesUpdateOne

Update returns a builder for updating this UserProfiles. Note that you need to call UserProfiles.Unwrap() before calling this method if this UserProfiles was returned from a transaction, and the transaction was committed or rolled back.

func (*UserProfiles) Value

func (_m *UserProfiles) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserProfiles. This includes values selected through modifiers, order, etc.

type UserProfilesClient

type UserProfilesClient struct {
	// contains filtered or unexported fields
}

UserProfilesClient is a client for the UserProfiles schema.

func NewUserProfilesClient

func NewUserProfilesClient(c config) *UserProfilesClient

NewUserProfilesClient returns a client for the UserProfiles from the given config.

func (*UserProfilesClient) Create

Create returns a builder for creating a UserProfiles entity.

func (*UserProfilesClient) CreateBulk

func (c *UserProfilesClient) CreateBulk(builders ...*UserProfilesCreate) *UserProfilesCreateBulk

CreateBulk returns a builder for creating a bulk of UserProfiles entities.

func (*UserProfilesClient) Delete

Delete returns a delete builder for UserProfiles.

func (*UserProfilesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserProfilesClient) DeleteOneID

func (c *UserProfilesClient) DeleteOneID(id int) *UserProfilesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserProfilesClient) Get

Get returns a UserProfiles entity by its id.

func (*UserProfilesClient) GetX

GetX is like Get, but panics if an error occurs.

func (*UserProfilesClient) Hooks

func (c *UserProfilesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserProfilesClient) Intercept

func (c *UserProfilesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userprofiles.Intercept(f(g(h())))`.

func (*UserProfilesClient) Interceptors

func (c *UserProfilesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserProfilesClient) MapCreateBulk

func (c *UserProfilesClient) MapCreateBulk(slice any, setFunc func(*UserProfilesCreate, int)) *UserProfilesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserProfilesClient) Query

Query returns a query builder for UserProfiles.

func (*UserProfilesClient) Update

Update returns an update builder for UserProfiles.

func (*UserProfilesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserProfilesClient) UpdateOneID

func (c *UserProfilesClient) UpdateOneID(id int) *UserProfilesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserProfilesClient) Use

func (c *UserProfilesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userprofiles.Hooks(f(g(h())))`.

type UserProfilesCreate

type UserProfilesCreate struct {
	// contains filtered or unexported fields
}

UserProfilesCreate is the builder for creating a UserProfiles entity.

func (*UserProfilesCreate) Exec

func (_c *UserProfilesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserProfilesCreate) ExecX

func (_c *UserProfilesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserProfilesCreate) Mutation

func (_c *UserProfilesCreate) Mutation() *UserProfilesMutation

Mutation returns the UserProfilesMutation object of the builder.

func (*UserProfilesCreate) Save

Save creates the UserProfiles in the database.

func (*UserProfilesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserProfilesCreate) SetAttrKey

func (_c *UserProfilesCreate) SetAttrKey(v string) *UserProfilesCreate

SetAttrKey sets the "attr_key" field.

func (*UserProfilesCreate) SetAttrValue

func (_c *UserProfilesCreate) SetAttrValue(v string) *UserProfilesCreate

SetAttrValue sets the "attr_value" field.

func (*UserProfilesCreate) SetCreatedAt

func (_c *UserProfilesCreate) SetCreatedAt(v time.Time) *UserProfilesCreate

SetCreatedAt sets the "created_at" field.

func (*UserProfilesCreate) SetDeletedAt

func (_c *UserProfilesCreate) SetDeletedAt(v time.Time) *UserProfilesCreate

SetDeletedAt sets the "deleted_at" field.

func (*UserProfilesCreate) SetNillableCreatedAt

func (_c *UserProfilesCreate) SetNillableCreatedAt(v *time.Time) *UserProfilesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserProfilesCreate) SetNillableDeletedAt

func (_c *UserProfilesCreate) SetNillableDeletedAt(v *time.Time) *UserProfilesCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserProfilesCreate) SetNillableUpdatedAt

func (_c *UserProfilesCreate) SetNillableUpdatedAt(v *time.Time) *UserProfilesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserProfilesCreate) SetUpdatedAt

func (_c *UserProfilesCreate) SetUpdatedAt(v time.Time) *UserProfilesCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserProfilesCreate) SetUserID

func (_c *UserProfilesCreate) SetUserID(v int) *UserProfilesCreate

SetUserID sets the "user_id" field.

type UserProfilesCreateBulk

type UserProfilesCreateBulk struct {
	// contains filtered or unexported fields
}

UserProfilesCreateBulk is the builder for creating many UserProfiles entities in bulk.

func (*UserProfilesCreateBulk) Exec

Exec executes the query.

func (*UserProfilesCreateBulk) ExecX

func (_c *UserProfilesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserProfilesCreateBulk) Save

Save creates the UserProfiles entities in the database.

func (*UserProfilesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type UserProfilesDelete

type UserProfilesDelete struct {
	// contains filtered or unexported fields
}

UserProfilesDelete is the builder for deleting a UserProfiles entity.

func (*UserProfilesDelete) Exec

func (_d *UserProfilesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserProfilesDelete) ExecX

func (_d *UserProfilesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserProfilesDelete) Where

Where appends a list predicates to the UserProfilesDelete builder.

type UserProfilesDeleteOne

type UserProfilesDeleteOne struct {
	// contains filtered or unexported fields
}

UserProfilesDeleteOne is the builder for deleting a single UserProfiles entity.

func (*UserProfilesDeleteOne) Exec

Exec executes the deletion query.

func (*UserProfilesDeleteOne) ExecX

func (_d *UserProfilesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserProfilesDeleteOne) Where

Where appends a list predicates to the UserProfilesDelete builder.

type UserProfilesGroupBy

type UserProfilesGroupBy struct {
	// contains filtered or unexported fields
}

UserProfilesGroupBy is the group-by builder for UserProfiles entities.

func (*UserProfilesGroupBy) Aggregate

func (_g *UserProfilesGroupBy) Aggregate(fns ...AggregateFunc) *UserProfilesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserProfilesGroupBy) Bool

func (s *UserProfilesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) BoolX

func (s *UserProfilesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserProfilesGroupBy) Bools

func (s *UserProfilesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) BoolsX

func (s *UserProfilesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserProfilesGroupBy) Float64

func (s *UserProfilesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) Float64X

func (s *UserProfilesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserProfilesGroupBy) Float64s

func (s *UserProfilesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) Float64sX

func (s *UserProfilesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserProfilesGroupBy) Int

func (s *UserProfilesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) IntX

func (s *UserProfilesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserProfilesGroupBy) Ints

func (s *UserProfilesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) IntsX

func (s *UserProfilesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserProfilesGroupBy) Scan

func (_g *UserProfilesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserProfilesGroupBy) ScanX

func (s *UserProfilesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserProfilesGroupBy) String

func (s *UserProfilesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) StringX

func (s *UserProfilesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserProfilesGroupBy) Strings

func (s *UserProfilesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserProfilesGroupBy) StringsX

func (s *UserProfilesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserProfilesMutation

type UserProfilesMutation struct {
	// contains filtered or unexported fields
}

UserProfilesMutation represents an operation that mutates the UserProfiles nodes in the graph.

func (*UserProfilesMutation) AddField

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) AddUserID

func (m *UserProfilesMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*UserProfilesMutation) AddedEdges

func (m *UserProfilesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserProfilesMutation) AddedField

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) AddedFields

func (m *UserProfilesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserProfilesMutation) AddedIDs

func (m *UserProfilesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserProfilesMutation) AddedUserID

func (m *UserProfilesMutation) AddedUserID() (r int, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*UserProfilesMutation) AttrKey

func (m *UserProfilesMutation) AttrKey() (r string, exists bool)

AttrKey returns the value of the "attr_key" field in the mutation.

func (*UserProfilesMutation) AttrValue

func (m *UserProfilesMutation) AttrValue() (r string, exists bool)

AttrValue returns the value of the "attr_value" field in the mutation.

func (*UserProfilesMutation) ClearDeletedAt

func (m *UserProfilesMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserProfilesMutation) ClearEdge

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) ClearField

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) ClearedEdges

func (m *UserProfilesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserProfilesMutation) ClearedFields

func (m *UserProfilesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserProfilesMutation) Client

func (m UserProfilesMutation) 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 (*UserProfilesMutation) CreatedAt

func (m *UserProfilesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserProfilesMutation) DeletedAt

func (m *UserProfilesMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UserProfilesMutation) DeletedAtCleared

func (m *UserProfilesMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UserProfilesMutation) EdgeCleared

func (m *UserProfilesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserProfilesMutation) Field

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) FieldCleared

func (m *UserProfilesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserProfilesMutation) Fields

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) ID

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) IDs

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) OldAttrKey

func (m *UserProfilesMutation) OldAttrKey(ctx context.Context) (v string, err error)

OldAttrKey returns the old "attr_key" field's value of the UserProfiles entity. If the UserProfiles 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 (*UserProfilesMutation) OldAttrValue

func (m *UserProfilesMutation) OldAttrValue(ctx context.Context) (v string, err error)

OldAttrValue returns the old "attr_value" field's value of the UserProfiles entity. If the UserProfiles 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 (*UserProfilesMutation) OldCreatedAt

func (m *UserProfilesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserProfiles entity. If the UserProfiles 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 (*UserProfilesMutation) OldDeletedAt

func (m *UserProfilesMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the UserProfiles entity. If the UserProfiles 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 (*UserProfilesMutation) OldField

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) OldUpdatedAt

func (m *UserProfilesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserProfiles entity. If the UserProfiles 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 (*UserProfilesMutation) OldUserID

func (m *UserProfilesMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserProfiles entity. If the UserProfiles 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 (*UserProfilesMutation) Op

func (m *UserProfilesMutation) Op() Op

Op returns the operation name.

func (*UserProfilesMutation) RemovedEdges

func (m *UserProfilesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserProfilesMutation) RemovedIDs

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) ResetAttrKey

func (m *UserProfilesMutation) ResetAttrKey()

ResetAttrKey resets all changes to the "attr_key" field.

func (*UserProfilesMutation) ResetAttrValue

func (m *UserProfilesMutation) ResetAttrValue()

ResetAttrValue resets all changes to the "attr_value" field.

func (*UserProfilesMutation) ResetCreatedAt

func (m *UserProfilesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserProfilesMutation) ResetDeletedAt

func (m *UserProfilesMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*UserProfilesMutation) ResetEdge

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) ResetField

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) ResetUpdatedAt

func (m *UserProfilesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserProfilesMutation) ResetUserID

func (m *UserProfilesMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserProfilesMutation) SetAttrKey

func (m *UserProfilesMutation) SetAttrKey(s string)

SetAttrKey sets the "attr_key" field.

func (*UserProfilesMutation) SetAttrValue

func (m *UserProfilesMutation) SetAttrValue(s string)

SetAttrValue sets the "attr_value" field.

func (*UserProfilesMutation) SetCreatedAt

func (m *UserProfilesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserProfilesMutation) SetDeletedAt

func (m *UserProfilesMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*UserProfilesMutation) SetField

func (m *UserProfilesMutation) 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 (*UserProfilesMutation) SetOp

func (m *UserProfilesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserProfilesMutation) SetUpdatedAt

func (m *UserProfilesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserProfilesMutation) SetUserID

func (m *UserProfilesMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserProfilesMutation) Tx

func (m UserProfilesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserProfilesMutation) Type

func (m *UserProfilesMutation) Type() string

Type returns the node type of this mutation (UserProfiles).

func (*UserProfilesMutation) UpdatedAt

func (m *UserProfilesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserProfilesMutation) UserID

func (m *UserProfilesMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserProfilesMutation) Where

Where appends a list predicates to the UserProfilesMutation builder.

func (*UserProfilesMutation) WhereP

func (m *UserProfilesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserProfilesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserProfilesQuery

type UserProfilesQuery struct {
	// contains filtered or unexported fields
}

UserProfilesQuery is the builder for querying UserProfiles entities.

func (*UserProfilesQuery) Aggregate

func (_q *UserProfilesQuery) Aggregate(fns ...AggregateFunc) *UserProfilesSelect

Aggregate returns a UserProfilesSelect configured with the given aggregations.

func (*UserProfilesQuery) All

func (_q *UserProfilesQuery) All(ctx context.Context) ([]*UserProfiles, error)

All executes the query and returns a list of UserProfilesSlice.

func (*UserProfilesQuery) AllX

func (_q *UserProfilesQuery) AllX(ctx context.Context) []*UserProfiles

AllX is like All, but panics if an error occurs.

func (*UserProfilesQuery) Clone

func (_q *UserProfilesQuery) Clone() *UserProfilesQuery

Clone returns a duplicate of the UserProfilesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserProfilesQuery) Count

func (_q *UserProfilesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserProfilesQuery) CountX

func (_q *UserProfilesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserProfilesQuery) Exist

func (_q *UserProfilesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserProfilesQuery) ExistX

func (_q *UserProfilesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserProfilesQuery) First

func (_q *UserProfilesQuery) First(ctx context.Context) (*UserProfiles, error)

First returns the first UserProfiles entity from the query. Returns a *NotFoundError when no UserProfiles was found.

func (*UserProfilesQuery) FirstID

func (_q *UserProfilesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserProfiles ID from the query. Returns a *NotFoundError when no UserProfiles ID was found.

func (*UserProfilesQuery) FirstIDX

func (_q *UserProfilesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserProfilesQuery) FirstX

func (_q *UserProfilesQuery) FirstX(ctx context.Context) *UserProfiles

FirstX is like First, but panics if an error occurs.

func (*UserProfilesQuery) GroupBy

func (_q *UserProfilesQuery) GroupBy(field string, fields ...string) *UserProfilesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserProfiles.Query().
	GroupBy(userprofiles.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UserProfilesQuery) IDs

func (_q *UserProfilesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserProfiles IDs.

func (*UserProfilesQuery) IDsX

func (_q *UserProfilesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserProfilesQuery) Limit

func (_q *UserProfilesQuery) Limit(limit int) *UserProfilesQuery

Limit the number of records to be returned by this query.

func (*UserProfilesQuery) Offset

func (_q *UserProfilesQuery) Offset(offset int) *UserProfilesQuery

Offset to start from.

func (*UserProfilesQuery) Only

Only returns a single UserProfiles entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserProfiles entity is found. Returns a *NotFoundError when no UserProfiles entities are found.

func (*UserProfilesQuery) OnlyID

func (_q *UserProfilesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserProfiles ID in the query. Returns a *NotSingularError when more than one UserProfiles ID is found. Returns a *NotFoundError when no entities are found.

func (*UserProfilesQuery) OnlyIDX

func (_q *UserProfilesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserProfilesQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*UserProfilesQuery) Order

Order specifies how the records should be ordered.

func (*UserProfilesQuery) Select

func (_q *UserProfilesQuery) Select(fields ...string) *UserProfilesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserProfiles.Query().
	Select(userprofiles.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserProfilesQuery) Unique

func (_q *UserProfilesQuery) Unique(unique bool) *UserProfilesQuery

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 (*UserProfilesQuery) Where

Where adds a new predicate for the UserProfilesQuery builder.

type UserProfilesSelect

type UserProfilesSelect struct {
	*UserProfilesQuery
	// contains filtered or unexported fields
}

UserProfilesSelect is the builder for selecting fields of UserProfiles entities.

func (*UserProfilesSelect) Aggregate

func (_s *UserProfilesSelect) Aggregate(fns ...AggregateFunc) *UserProfilesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserProfilesSelect) Bool

func (s *UserProfilesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) BoolX

func (s *UserProfilesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserProfilesSelect) Bools

func (s *UserProfilesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) BoolsX

func (s *UserProfilesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserProfilesSelect) Float64

func (s *UserProfilesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) Float64X

func (s *UserProfilesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserProfilesSelect) Float64s

func (s *UserProfilesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) Float64sX

func (s *UserProfilesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserProfilesSelect) Int

func (s *UserProfilesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) IntX

func (s *UserProfilesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserProfilesSelect) Ints

func (s *UserProfilesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) IntsX

func (s *UserProfilesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserProfilesSelect) Scan

func (_s *UserProfilesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserProfilesSelect) ScanX

func (s *UserProfilesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserProfilesSelect) String

func (s *UserProfilesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) StringX

func (s *UserProfilesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserProfilesSelect) Strings

func (s *UserProfilesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserProfilesSelect) StringsX

func (s *UserProfilesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserProfilesSlice

type UserProfilesSlice []*UserProfiles

UserProfilesSlice is a parsable slice of UserProfiles.

type UserProfilesUpdate

type UserProfilesUpdate struct {
	// contains filtered or unexported fields
}

UserProfilesUpdate is the builder for updating UserProfiles entities.

func (*UserProfilesUpdate) ClearDeletedAt

func (_u *UserProfilesUpdate) ClearDeletedAt() *UserProfilesUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserProfilesUpdate) Exec

func (_u *UserProfilesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserProfilesUpdate) ExecX

func (_u *UserProfilesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserProfilesUpdate) Mutation

func (_u *UserProfilesUpdate) Mutation() *UserProfilesMutation

Mutation returns the UserProfilesMutation object of the builder.

func (*UserProfilesUpdate) Save

func (_u *UserProfilesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserProfilesUpdate) SaveX

func (_u *UserProfilesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserProfilesUpdate) SetAttrKey

func (_u *UserProfilesUpdate) SetAttrKey(v string) *UserProfilesUpdate

SetAttrKey sets the "attr_key" field.

func (*UserProfilesUpdate) SetAttrValue

func (_u *UserProfilesUpdate) SetAttrValue(v string) *UserProfilesUpdate

SetAttrValue sets the "attr_value" field.

func (*UserProfilesUpdate) SetDeletedAt

func (_u *UserProfilesUpdate) SetDeletedAt(v time.Time) *UserProfilesUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UserProfilesUpdate) SetNillableAttrKey

func (_u *UserProfilesUpdate) SetNillableAttrKey(v *string) *UserProfilesUpdate

SetNillableAttrKey sets the "attr_key" field if the given value is not nil.

func (*UserProfilesUpdate) SetNillableAttrValue

func (_u *UserProfilesUpdate) SetNillableAttrValue(v *string) *UserProfilesUpdate

SetNillableAttrValue sets the "attr_value" field if the given value is not nil.

func (*UserProfilesUpdate) SetNillableDeletedAt

func (_u *UserProfilesUpdate) SetNillableDeletedAt(v *time.Time) *UserProfilesUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserProfilesUpdate) SetUpdatedAt

func (_u *UserProfilesUpdate) SetUpdatedAt(v time.Time) *UserProfilesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserProfilesUpdate) Where

Where appends a list predicates to the UserProfilesUpdate builder.

type UserProfilesUpdateOne

type UserProfilesUpdateOne struct {
	// contains filtered or unexported fields
}

UserProfilesUpdateOne is the builder for updating a single UserProfiles entity.

func (*UserProfilesUpdateOne) ClearDeletedAt

func (_u *UserProfilesUpdateOne) ClearDeletedAt() *UserProfilesUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserProfilesUpdateOne) Exec

Exec executes the query on the entity.

func (*UserProfilesUpdateOne) ExecX

func (_u *UserProfilesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserProfilesUpdateOne) Mutation

Mutation returns the UserProfilesMutation object of the builder.

func (*UserProfilesUpdateOne) Save

Save executes the query and returns the updated UserProfiles entity.

func (*UserProfilesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*UserProfilesUpdateOne) Select

func (_u *UserProfilesUpdateOne) Select(field string, fields ...string) *UserProfilesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserProfilesUpdateOne) SetAttrKey

SetAttrKey sets the "attr_key" field.

func (*UserProfilesUpdateOne) SetAttrValue

func (_u *UserProfilesUpdateOne) SetAttrValue(v string) *UserProfilesUpdateOne

SetAttrValue sets the "attr_value" field.

func (*UserProfilesUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*UserProfilesUpdateOne) SetNillableAttrKey

func (_u *UserProfilesUpdateOne) SetNillableAttrKey(v *string) *UserProfilesUpdateOne

SetNillableAttrKey sets the "attr_key" field if the given value is not nil.

func (*UserProfilesUpdateOne) SetNillableAttrValue

func (_u *UserProfilesUpdateOne) SetNillableAttrValue(v *string) *UserProfilesUpdateOne

SetNillableAttrValue sets the "attr_value" field if the given value is not nil.

func (*UserProfilesUpdateOne) SetNillableDeletedAt

func (_u *UserProfilesUpdateOne) SetNillableDeletedAt(v *time.Time) *UserProfilesUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserProfilesUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserProfilesUpdateOne) Where

Where appends a list predicates to the UserProfilesUpdate builder.

type UserRoles

type UserRoles struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 关联 lion_users 表的菜单 ID
	UserID int `json:"user_id,omitempty"`
	// 关联 lion_roles 表的用户组 ID
	RoleID int `json:"role_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserRolesQuery when eager-loading is set.
	Edges UserRolesEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserRoles is the model entity for the UserRoles schema.

func (*UserRoles) QueryLionRoles

func (_m *UserRoles) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the UserRoles entity.

func (*UserRoles) QueryLionUsers

func (_m *UserRoles) QueryLionUsers() *UsersQuery

QueryLionUsers queries the "lion_users" edge of the UserRoles entity.

func (*UserRoles) String

func (_m *UserRoles) String() string

String implements the fmt.Stringer.

func (*UserRoles) Unwrap

func (_m *UserRoles) Unwrap() *UserRoles

Unwrap unwraps the UserRoles 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 (*UserRoles) Update

func (_m *UserRoles) Update() *UserRolesUpdateOne

Update returns a builder for updating this UserRoles. Note that you need to call UserRoles.Unwrap() before calling this method if this UserRoles was returned from a transaction, and the transaction was committed or rolled back.

func (*UserRoles) Value

func (_m *UserRoles) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserRoles. This includes values selected through modifiers, order, etc.

type UserRolesClient

type UserRolesClient struct {
	// contains filtered or unexported fields
}

UserRolesClient is a client for the UserRoles schema.

func NewUserRolesClient

func NewUserRolesClient(c config) *UserRolesClient

NewUserRolesClient returns a client for the UserRoles from the given config.

func (*UserRolesClient) Create

func (c *UserRolesClient) Create() *UserRolesCreate

Create returns a builder for creating a UserRoles entity.

func (*UserRolesClient) CreateBulk

func (c *UserRolesClient) CreateBulk(builders ...*UserRolesCreate) *UserRolesCreateBulk

CreateBulk returns a builder for creating a bulk of UserRoles entities.

func (*UserRolesClient) Delete

func (c *UserRolesClient) Delete() *UserRolesDelete

Delete returns a delete builder for UserRoles.

func (*UserRolesClient) DeleteOne

func (c *UserRolesClient) DeleteOne(_m *UserRoles) *UserRolesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserRolesClient) DeleteOneID

func (c *UserRolesClient) DeleteOneID(id int) *UserRolesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserRolesClient) Get

func (c *UserRolesClient) Get(ctx context.Context, id int) (*UserRoles, error)

Get returns a UserRoles entity by its id.

func (*UserRolesClient) GetX

func (c *UserRolesClient) GetX(ctx context.Context, id int) *UserRoles

GetX is like Get, but panics if an error occurs.

func (*UserRolesClient) Hooks

func (c *UserRolesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserRolesClient) Intercept

func (c *UserRolesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userroles.Intercept(f(g(h())))`.

func (*UserRolesClient) Interceptors

func (c *UserRolesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserRolesClient) MapCreateBulk

func (c *UserRolesClient) MapCreateBulk(slice any, setFunc func(*UserRolesCreate, int)) *UserRolesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserRolesClient) Query

func (c *UserRolesClient) Query() *UserRolesQuery

Query returns a query builder for UserRoles.

func (*UserRolesClient) QueryLionRoles

func (c *UserRolesClient) QueryLionRoles(_m *UserRoles) *RolesQuery

QueryLionRoles queries the lion_roles edge of a UserRoles.

func (*UserRolesClient) QueryLionUsers

func (c *UserRolesClient) QueryLionUsers(_m *UserRoles) *UsersQuery

QueryLionUsers queries the lion_users edge of a UserRoles.

func (*UserRolesClient) Update

func (c *UserRolesClient) Update() *UserRolesUpdate

Update returns an update builder for UserRoles.

func (*UserRolesClient) UpdateOne

func (c *UserRolesClient) UpdateOne(_m *UserRoles) *UserRolesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserRolesClient) UpdateOneID

func (c *UserRolesClient) UpdateOneID(id int) *UserRolesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserRolesClient) Use

func (c *UserRolesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userroles.Hooks(f(g(h())))`.

type UserRolesCreate

type UserRolesCreate struct {
	// contains filtered or unexported fields
}

UserRolesCreate is the builder for creating a UserRoles entity.

func (*UserRolesCreate) Exec

func (_c *UserRolesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserRolesCreate) ExecX

func (_c *UserRolesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserRolesCreate) Mutation

func (_c *UserRolesCreate) Mutation() *UserRolesMutation

Mutation returns the UserRolesMutation object of the builder.

func (*UserRolesCreate) Save

func (_c *UserRolesCreate) Save(ctx context.Context) (*UserRoles, error)

Save creates the UserRoles in the database.

func (*UserRolesCreate) SaveX

func (_c *UserRolesCreate) SaveX(ctx context.Context) *UserRoles

SaveX calls Save and panics if Save returns an error.

func (*UserRolesCreate) SetCreatedAt

func (_c *UserRolesCreate) SetCreatedAt(v time.Time) *UserRolesCreate

SetCreatedAt sets the "created_at" field.

func (*UserRolesCreate) SetCreatedBy

func (_c *UserRolesCreate) SetCreatedBy(v int64) *UserRolesCreate

SetCreatedBy sets the "created_by" field.

func (*UserRolesCreate) SetLionRoles

func (_c *UserRolesCreate) SetLionRoles(v *Roles) *UserRolesCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*UserRolesCreate) SetLionRolesID

func (_c *UserRolesCreate) SetLionRolesID(id int) *UserRolesCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*UserRolesCreate) SetLionUsers

func (_c *UserRolesCreate) SetLionUsers(v *Users) *UserRolesCreate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserRolesCreate) SetLionUsersID

func (_c *UserRolesCreate) SetLionUsersID(id int) *UserRolesCreate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserRolesCreate) SetNillableCreatedAt

func (_c *UserRolesCreate) SetNillableCreatedAt(v *time.Time) *UserRolesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserRolesCreate) SetNillableCreatedBy

func (_c *UserRolesCreate) SetNillableCreatedBy(v *int64) *UserRolesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserRolesCreate) SetNillableUpdatedAt

func (_c *UserRolesCreate) SetNillableUpdatedAt(v *time.Time) *UserRolesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserRolesCreate) SetNillableUpdatedBy

func (_c *UserRolesCreate) SetNillableUpdatedBy(v *int64) *UserRolesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserRolesCreate) SetRoleID

func (_c *UserRolesCreate) SetRoleID(v int) *UserRolesCreate

SetRoleID sets the "role_id" field.

func (*UserRolesCreate) SetUpdatedAt

func (_c *UserRolesCreate) SetUpdatedAt(v time.Time) *UserRolesCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserRolesCreate) SetUpdatedBy

func (_c *UserRolesCreate) SetUpdatedBy(v int64) *UserRolesCreate

SetUpdatedBy sets the "updated_by" field.

func (*UserRolesCreate) SetUserID

func (_c *UserRolesCreate) SetUserID(v int) *UserRolesCreate

SetUserID sets the "user_id" field.

type UserRolesCreateBulk

type UserRolesCreateBulk struct {
	// contains filtered or unexported fields
}

UserRolesCreateBulk is the builder for creating many UserRoles entities in bulk.

func (*UserRolesCreateBulk) Exec

func (_c *UserRolesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserRolesCreateBulk) ExecX

func (_c *UserRolesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserRolesCreateBulk) Save

func (_c *UserRolesCreateBulk) Save(ctx context.Context) ([]*UserRoles, error)

Save creates the UserRoles entities in the database.

func (*UserRolesCreateBulk) SaveX

func (_c *UserRolesCreateBulk) SaveX(ctx context.Context) []*UserRoles

SaveX is like Save, but panics if an error occurs.

type UserRolesDelete

type UserRolesDelete struct {
	// contains filtered or unexported fields
}

UserRolesDelete is the builder for deleting a UserRoles entity.

func (*UserRolesDelete) Exec

func (_d *UserRolesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserRolesDelete) ExecX

func (_d *UserRolesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserRolesDelete) Where

Where appends a list predicates to the UserRolesDelete builder.

type UserRolesDeleteOne

type UserRolesDeleteOne struct {
	// contains filtered or unexported fields
}

UserRolesDeleteOne is the builder for deleting a single UserRoles entity.

func (*UserRolesDeleteOne) Exec

func (_d *UserRolesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserRolesDeleteOne) ExecX

func (_d *UserRolesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserRolesDeleteOne) Where

Where appends a list predicates to the UserRolesDelete builder.

type UserRolesEdges

type UserRolesEdges struct {
	// LionUsers holds the value of the lion_users edge.
	LionUsers *Users `json:"lion_users,omitempty"`
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// contains filtered or unexported fields
}

UserRolesEdges holds the relations/edges for other nodes in the graph.

func (UserRolesEdges) LionRolesOrErr

func (e UserRolesEdges) LionRolesOrErr() (*Roles, error)

LionRolesOrErr returns the LionRoles value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserRolesEdges) LionUsersOrErr

func (e UserRolesEdges) LionUsersOrErr() (*Users, error)

LionUsersOrErr returns the LionUsers value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserRolesGroupBy

type UserRolesGroupBy struct {
	// contains filtered or unexported fields
}

UserRolesGroupBy is the group-by builder for UserRoles entities.

func (*UserRolesGroupBy) Aggregate

func (_g *UserRolesGroupBy) Aggregate(fns ...AggregateFunc) *UserRolesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserRolesGroupBy) Bool

func (s *UserRolesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) BoolX

func (s *UserRolesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserRolesGroupBy) Bools

func (s *UserRolesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) BoolsX

func (s *UserRolesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserRolesGroupBy) Float64

func (s *UserRolesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) Float64X

func (s *UserRolesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserRolesGroupBy) Float64s

func (s *UserRolesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) Float64sX

func (s *UserRolesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserRolesGroupBy) Int

func (s *UserRolesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) IntX

func (s *UserRolesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserRolesGroupBy) Ints

func (s *UserRolesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) IntsX

func (s *UserRolesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserRolesGroupBy) Scan

func (_g *UserRolesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserRolesGroupBy) ScanX

func (s *UserRolesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserRolesGroupBy) String

func (s *UserRolesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) StringX

func (s *UserRolesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserRolesGroupBy) Strings

func (s *UserRolesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserRolesGroupBy) StringsX

func (s *UserRolesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserRolesMutation

type UserRolesMutation struct {
	// contains filtered or unexported fields
}

UserRolesMutation represents an operation that mutates the UserRoles nodes in the graph.

func (*UserRolesMutation) AddCreatedBy

func (m *UserRolesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*UserRolesMutation) AddField

func (m *UserRolesMutation) 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 (*UserRolesMutation) AddUpdatedBy

func (m *UserRolesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*UserRolesMutation) AddedCreatedBy

func (m *UserRolesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*UserRolesMutation) AddedEdges

func (m *UserRolesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserRolesMutation) AddedField

func (m *UserRolesMutation) 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 (*UserRolesMutation) AddedFields

func (m *UserRolesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserRolesMutation) AddedIDs

func (m *UserRolesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserRolesMutation) AddedUpdatedBy

func (m *UserRolesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*UserRolesMutation) ClearCreatedBy

func (m *UserRolesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*UserRolesMutation) ClearEdge

func (m *UserRolesMutation) 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 (*UserRolesMutation) ClearField

func (m *UserRolesMutation) 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 (*UserRolesMutation) ClearLionRoles

func (m *UserRolesMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*UserRolesMutation) ClearLionUsers

func (m *UserRolesMutation) ClearLionUsers()

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserRolesMutation) ClearUpdatedBy

func (m *UserRolesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserRolesMutation) ClearedEdges

func (m *UserRolesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserRolesMutation) ClearedFields

func (m *UserRolesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserRolesMutation) Client

func (m UserRolesMutation) 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 (*UserRolesMutation) CreatedAt

func (m *UserRolesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserRolesMutation) CreatedBy

func (m *UserRolesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UserRolesMutation) CreatedByCleared

func (m *UserRolesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*UserRolesMutation) EdgeCleared

func (m *UserRolesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserRolesMutation) Field

func (m *UserRolesMutation) 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 (*UserRolesMutation) FieldCleared

func (m *UserRolesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserRolesMutation) Fields

func (m *UserRolesMutation) 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 (*UserRolesMutation) ID

func (m *UserRolesMutation) 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 (*UserRolesMutation) IDs

func (m *UserRolesMutation) 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 (*UserRolesMutation) LionRolesCleared

func (m *UserRolesMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*UserRolesMutation) LionRolesID

func (m *UserRolesMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*UserRolesMutation) LionRolesIDs

func (m *UserRolesMutation) LionRolesIDs() (ids []int)

LionRolesIDs returns the "lion_roles" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionRolesID instead. It exists only for internal usage by the builders.

func (*UserRolesMutation) LionUsersCleared

func (m *UserRolesMutation) LionUsersCleared() bool

LionUsersCleared reports if the "lion_users" edge to the Users entity was cleared.

func (*UserRolesMutation) LionUsersID

func (m *UserRolesMutation) LionUsersID() (id int, exists bool)

LionUsersID returns the "lion_users" edge ID in the mutation.

func (*UserRolesMutation) LionUsersIDs

func (m *UserRolesMutation) LionUsersIDs() (ids []int)

LionUsersIDs returns the "lion_users" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionUsersID instead. It exists only for internal usage by the builders.

func (*UserRolesMutation) OldCreatedAt

func (m *UserRolesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserRoles entity. If the UserRoles 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 (*UserRolesMutation) OldCreatedBy

func (m *UserRolesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the UserRoles entity. If the UserRoles 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 (*UserRolesMutation) OldField

func (m *UserRolesMutation) 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 (*UserRolesMutation) OldRoleID

func (m *UserRolesMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the UserRoles entity. If the UserRoles 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 (*UserRolesMutation) OldUpdatedAt

func (m *UserRolesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserRoles entity. If the UserRoles 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 (*UserRolesMutation) OldUpdatedBy

func (m *UserRolesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the UserRoles entity. If the UserRoles 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 (*UserRolesMutation) OldUserID

func (m *UserRolesMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserRoles entity. If the UserRoles 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 (*UserRolesMutation) Op

func (m *UserRolesMutation) Op() Op

Op returns the operation name.

func (*UserRolesMutation) RemovedEdges

func (m *UserRolesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserRolesMutation) RemovedIDs

func (m *UserRolesMutation) 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 (*UserRolesMutation) ResetCreatedAt

func (m *UserRolesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserRolesMutation) ResetCreatedBy

func (m *UserRolesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UserRolesMutation) ResetEdge

func (m *UserRolesMutation) 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 (*UserRolesMutation) ResetField

func (m *UserRolesMutation) 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 (*UserRolesMutation) ResetLionRoles

func (m *UserRolesMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*UserRolesMutation) ResetLionUsers

func (m *UserRolesMutation) ResetLionUsers()

ResetLionUsers resets all changes to the "lion_users" edge.

func (*UserRolesMutation) ResetRoleID

func (m *UserRolesMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*UserRolesMutation) ResetUpdatedAt

func (m *UserRolesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserRolesMutation) ResetUpdatedBy

func (m *UserRolesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UserRolesMutation) ResetUserID

func (m *UserRolesMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserRolesMutation) RoleID

func (m *UserRolesMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*UserRolesMutation) SetCreatedAt

func (m *UserRolesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserRolesMutation) SetCreatedBy

func (m *UserRolesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*UserRolesMutation) SetField

func (m *UserRolesMutation) 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 (*UserRolesMutation) SetLionRolesID

func (m *UserRolesMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*UserRolesMutation) SetLionUsersID

func (m *UserRolesMutation) SetLionUsersID(id int)

SetLionUsersID sets the "lion_users" edge to the Users entity by id.

func (*UserRolesMutation) SetOp

func (m *UserRolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserRolesMutation) SetRoleID

func (m *UserRolesMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*UserRolesMutation) SetUpdatedAt

func (m *UserRolesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserRolesMutation) SetUpdatedBy

func (m *UserRolesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*UserRolesMutation) SetUserID

func (m *UserRolesMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserRolesMutation) Tx

func (m UserRolesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserRolesMutation) Type

func (m *UserRolesMutation) Type() string

Type returns the node type of this mutation (UserRoles).

func (*UserRolesMutation) UpdatedAt

func (m *UserRolesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserRolesMutation) UpdatedBy

func (m *UserRolesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UserRolesMutation) UpdatedByCleared

func (m *UserRolesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UserRolesMutation) UserID

func (m *UserRolesMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserRolesMutation) Where

func (m *UserRolesMutation) Where(ps ...predicate.UserRoles)

Where appends a list predicates to the UserRolesMutation builder.

func (*UserRolesMutation) WhereP

func (m *UserRolesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserRolesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserRolesQuery

type UserRolesQuery struct {
	// contains filtered or unexported fields
}

UserRolesQuery is the builder for querying UserRoles entities.

func (*UserRolesQuery) Aggregate

func (_q *UserRolesQuery) Aggregate(fns ...AggregateFunc) *UserRolesSelect

Aggregate returns a UserRolesSelect configured with the given aggregations.

func (*UserRolesQuery) All

func (_q *UserRolesQuery) All(ctx context.Context) ([]*UserRoles, error)

All executes the query and returns a list of UserRolesSlice.

func (*UserRolesQuery) AllX

func (_q *UserRolesQuery) AllX(ctx context.Context) []*UserRoles

AllX is like All, but panics if an error occurs.

func (*UserRolesQuery) Clone

func (_q *UserRolesQuery) Clone() *UserRolesQuery

Clone returns a duplicate of the UserRolesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserRolesQuery) Count

func (_q *UserRolesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserRolesQuery) CountX

func (_q *UserRolesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserRolesQuery) Exist

func (_q *UserRolesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserRolesQuery) ExistX

func (_q *UserRolesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserRolesQuery) First

func (_q *UserRolesQuery) First(ctx context.Context) (*UserRoles, error)

First returns the first UserRoles entity from the query. Returns a *NotFoundError when no UserRoles was found.

func (*UserRolesQuery) FirstID

func (_q *UserRolesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserRoles ID from the query. Returns a *NotFoundError when no UserRoles ID was found.

func (*UserRolesQuery) FirstIDX

func (_q *UserRolesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserRolesQuery) FirstX

func (_q *UserRolesQuery) FirstX(ctx context.Context) *UserRoles

FirstX is like First, but panics if an error occurs.

func (*UserRolesQuery) GroupBy

func (_q *UserRolesQuery) GroupBy(field string, fields ...string) *UserRolesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserRoles.Query().
	GroupBy(userroles.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UserRolesQuery) IDs

func (_q *UserRolesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserRoles IDs.

func (*UserRolesQuery) IDsX

func (_q *UserRolesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserRolesQuery) Limit

func (_q *UserRolesQuery) Limit(limit int) *UserRolesQuery

Limit the number of records to be returned by this query.

func (*UserRolesQuery) Offset

func (_q *UserRolesQuery) Offset(offset int) *UserRolesQuery

Offset to start from.

func (*UserRolesQuery) Only

func (_q *UserRolesQuery) Only(ctx context.Context) (*UserRoles, error)

Only returns a single UserRoles entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserRoles entity is found. Returns a *NotFoundError when no UserRoles entities are found.

func (*UserRolesQuery) OnlyID

func (_q *UserRolesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserRoles ID in the query. Returns a *NotSingularError when more than one UserRoles ID is found. Returns a *NotFoundError when no entities are found.

func (*UserRolesQuery) OnlyIDX

func (_q *UserRolesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserRolesQuery) OnlyX

func (_q *UserRolesQuery) OnlyX(ctx context.Context) *UserRoles

OnlyX is like Only, but panics if an error occurs.

func (*UserRolesQuery) Order

Order specifies how the records should be ordered.

func (*UserRolesQuery) QueryLionRoles

func (_q *UserRolesQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*UserRolesQuery) QueryLionUsers

func (_q *UserRolesQuery) QueryLionUsers() *UsersQuery

QueryLionUsers chains the current query on the "lion_users" edge.

func (*UserRolesQuery) Select

func (_q *UserRolesQuery) Select(fields ...string) *UserRolesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.UserRoles.Query().
	Select(userroles.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserRolesQuery) Unique

func (_q *UserRolesQuery) Unique(unique bool) *UserRolesQuery

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 (*UserRolesQuery) Where

Where adds a new predicate for the UserRolesQuery builder.

func (*UserRolesQuery) WithLionRoles

func (_q *UserRolesQuery) WithLionRoles(opts ...func(*RolesQuery)) *UserRolesQuery

WithLionRoles tells the query-builder to eager-load the nodes that are connected to the "lion_roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserRolesQuery) WithLionUsers

func (_q *UserRolesQuery) WithLionUsers(opts ...func(*UsersQuery)) *UserRolesQuery

WithLionUsers tells the query-builder to eager-load the nodes that are connected to the "lion_users" edge. The optional arguments are used to configure the query builder of the edge.

type UserRolesSelect

type UserRolesSelect struct {
	*UserRolesQuery
	// contains filtered or unexported fields
}

UserRolesSelect is the builder for selecting fields of UserRoles entities.

func (*UserRolesSelect) Aggregate

func (_s *UserRolesSelect) Aggregate(fns ...AggregateFunc) *UserRolesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserRolesSelect) Bool

func (s *UserRolesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) BoolX

func (s *UserRolesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserRolesSelect) Bools

func (s *UserRolesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) BoolsX

func (s *UserRolesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserRolesSelect) Float64

func (s *UserRolesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) Float64X

func (s *UserRolesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserRolesSelect) Float64s

func (s *UserRolesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) Float64sX

func (s *UserRolesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserRolesSelect) Int

func (s *UserRolesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) IntX

func (s *UserRolesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserRolesSelect) Ints

func (s *UserRolesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) IntsX

func (s *UserRolesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserRolesSelect) Scan

func (_s *UserRolesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserRolesSelect) ScanX

func (s *UserRolesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserRolesSelect) String

func (s *UserRolesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) StringX

func (s *UserRolesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserRolesSelect) Strings

func (s *UserRolesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserRolesSelect) StringsX

func (s *UserRolesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserRolesSlice

type UserRolesSlice []*UserRoles

UserRolesSlice is a parsable slice of UserRoles.

type UserRolesUpdate

type UserRolesUpdate struct {
	// contains filtered or unexported fields
}

UserRolesUpdate is the builder for updating UserRoles entities.

func (*UserRolesUpdate) AddCreatedBy

func (_u *UserRolesUpdate) AddCreatedBy(v int64) *UserRolesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*UserRolesUpdate) AddUpdatedBy

func (_u *UserRolesUpdate) AddUpdatedBy(v int64) *UserRolesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*UserRolesUpdate) ClearCreatedBy

func (_u *UserRolesUpdate) ClearCreatedBy() *UserRolesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*UserRolesUpdate) ClearLionRoles

func (_u *UserRolesUpdate) ClearLionRoles() *UserRolesUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*UserRolesUpdate) ClearLionUsers

func (_u *UserRolesUpdate) ClearLionUsers() *UserRolesUpdate

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserRolesUpdate) ClearUpdatedBy

func (_u *UserRolesUpdate) ClearUpdatedBy() *UserRolesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserRolesUpdate) Exec

func (_u *UserRolesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserRolesUpdate) ExecX

func (_u *UserRolesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserRolesUpdate) Mutation

func (_u *UserRolesUpdate) Mutation() *UserRolesMutation

Mutation returns the UserRolesMutation object of the builder.

func (*UserRolesUpdate) Save

func (_u *UserRolesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserRolesUpdate) SaveX

func (_u *UserRolesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserRolesUpdate) SetCreatedBy

func (_u *UserRolesUpdate) SetCreatedBy(v int64) *UserRolesUpdate

SetCreatedBy sets the "created_by" field.

func (*UserRolesUpdate) SetLionRoles

func (_u *UserRolesUpdate) SetLionRoles(v *Roles) *UserRolesUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*UserRolesUpdate) SetLionRolesID

func (_u *UserRolesUpdate) SetLionRolesID(id int) *UserRolesUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*UserRolesUpdate) SetLionUsers

func (_u *UserRolesUpdate) SetLionUsers(v *Users) *UserRolesUpdate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserRolesUpdate) SetLionUsersID

func (_u *UserRolesUpdate) SetLionUsersID(id int) *UserRolesUpdate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserRolesUpdate) SetNillableCreatedBy

func (_u *UserRolesUpdate) SetNillableCreatedBy(v *int64) *UserRolesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserRolesUpdate) SetNillableRoleID

func (_u *UserRolesUpdate) SetNillableRoleID(v *int) *UserRolesUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*UserRolesUpdate) SetNillableUpdatedBy

func (_u *UserRolesUpdate) SetNillableUpdatedBy(v *int64) *UserRolesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserRolesUpdate) SetNillableUserID

func (_u *UserRolesUpdate) SetNillableUserID(v *int) *UserRolesUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserRolesUpdate) SetRoleID

func (_u *UserRolesUpdate) SetRoleID(v int) *UserRolesUpdate

SetRoleID sets the "role_id" field.

func (*UserRolesUpdate) SetUpdatedAt

func (_u *UserRolesUpdate) SetUpdatedAt(v time.Time) *UserRolesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserRolesUpdate) SetUpdatedBy

func (_u *UserRolesUpdate) SetUpdatedBy(v int64) *UserRolesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*UserRolesUpdate) SetUserID

func (_u *UserRolesUpdate) SetUserID(v int) *UserRolesUpdate

SetUserID sets the "user_id" field.

func (*UserRolesUpdate) Where

Where appends a list predicates to the UserRolesUpdate builder.

type UserRolesUpdateOne

type UserRolesUpdateOne struct {
	// contains filtered or unexported fields
}

UserRolesUpdateOne is the builder for updating a single UserRoles entity.

func (*UserRolesUpdateOne) AddCreatedBy

func (_u *UserRolesUpdateOne) AddCreatedBy(v int64) *UserRolesUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*UserRolesUpdateOne) AddUpdatedBy

func (_u *UserRolesUpdateOne) AddUpdatedBy(v int64) *UserRolesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*UserRolesUpdateOne) ClearCreatedBy

func (_u *UserRolesUpdateOne) ClearCreatedBy() *UserRolesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*UserRolesUpdateOne) ClearLionRoles

func (_u *UserRolesUpdateOne) ClearLionRoles() *UserRolesUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*UserRolesUpdateOne) ClearLionUsers

func (_u *UserRolesUpdateOne) ClearLionUsers() *UserRolesUpdateOne

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserRolesUpdateOne) ClearUpdatedBy

func (_u *UserRolesUpdateOne) ClearUpdatedBy() *UserRolesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserRolesUpdateOne) Exec

func (_u *UserRolesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserRolesUpdateOne) ExecX

func (_u *UserRolesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserRolesUpdateOne) Mutation

func (_u *UserRolesUpdateOne) Mutation() *UserRolesMutation

Mutation returns the UserRolesMutation object of the builder.

func (*UserRolesUpdateOne) Save

func (_u *UserRolesUpdateOne) Save(ctx context.Context) (*UserRoles, error)

Save executes the query and returns the updated UserRoles entity.

func (*UserRolesUpdateOne) SaveX

func (_u *UserRolesUpdateOne) SaveX(ctx context.Context) *UserRoles

SaveX is like Save, but panics if an error occurs.

func (*UserRolesUpdateOne) Select

func (_u *UserRolesUpdateOne) Select(field string, fields ...string) *UserRolesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserRolesUpdateOne) SetCreatedBy

func (_u *UserRolesUpdateOne) SetCreatedBy(v int64) *UserRolesUpdateOne

SetCreatedBy sets the "created_by" field.

func (*UserRolesUpdateOne) SetLionRoles

func (_u *UserRolesUpdateOne) SetLionRoles(v *Roles) *UserRolesUpdateOne

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*UserRolesUpdateOne) SetLionRolesID

func (_u *UserRolesUpdateOne) SetLionRolesID(id int) *UserRolesUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*UserRolesUpdateOne) SetLionUsers

func (_u *UserRolesUpdateOne) SetLionUsers(v *Users) *UserRolesUpdateOne

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserRolesUpdateOne) SetLionUsersID

func (_u *UserRolesUpdateOne) SetLionUsersID(id int) *UserRolesUpdateOne

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserRolesUpdateOne) SetNillableCreatedBy

func (_u *UserRolesUpdateOne) SetNillableCreatedBy(v *int64) *UserRolesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserRolesUpdateOne) SetNillableRoleID

func (_u *UserRolesUpdateOne) SetNillableRoleID(v *int) *UserRolesUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*UserRolesUpdateOne) SetNillableUpdatedBy

func (_u *UserRolesUpdateOne) SetNillableUpdatedBy(v *int64) *UserRolesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserRolesUpdateOne) SetNillableUserID

func (_u *UserRolesUpdateOne) SetNillableUserID(v *int) *UserRolesUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserRolesUpdateOne) SetRoleID

func (_u *UserRolesUpdateOne) SetRoleID(v int) *UserRolesUpdateOne

SetRoleID sets the "role_id" field.

func (*UserRolesUpdateOne) SetUpdatedAt

func (_u *UserRolesUpdateOne) SetUpdatedAt(v time.Time) *UserRolesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserRolesUpdateOne) SetUpdatedBy

func (_u *UserRolesUpdateOne) SetUpdatedBy(v int64) *UserRolesUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*UserRolesUpdateOne) SetUserID

func (_u *UserRolesUpdateOne) SetUserID(v int) *UserRolesUpdateOne

SetUserID sets the "user_id" field.

func (*UserRolesUpdateOne) Where

Where appends a list predicates to the UserRolesUpdate builder.

type Users

type Users struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// 首选用户名,用于系统识别与登录,仅支持字母、数字、下划线、点号
	Username string `json:"username,omitempty"`
	// 用户的真实姓名
	RealnameEncrypted []byte `json:"-"`
	// 用户类型
	UserType int `json:"user_type,omitempty"`
	// 用户状态
	UserStatus int `json:"user_status,omitempty"`
	// 用户身份证号码
	NationalIDEncrypted []byte `json:"-"`
	// 用户的身份证号码哈希,用于唯一值判断
	NationalIDHash string `json:"national_id_hash,omitempty"`
	// 用户的昵称,用于页面展示
	Nickname string `json:"nickname,omitempty"`
	// 用户个人简介等
	Profile string `json:"profile,omitempty"`
	// 用户头像的 URL
	Picture string `json:"picture,omitempty"`
	// 用户的个人网站 URL
	Website string `json:"website,omitempty"`
	// 用户的邮箱地址
	EmailEncrypted []byte `json:"-"`
	// 用户的邮箱地址哈希,用于唯一值判断
	EmailHash string `json:"email_hash,omitempty"`
	// 邮箱是否验证过
	EmailVerified bool `json:"email_verified,omitempty"`
	// 用户的性别:0-未知,1-男性,2-女性
	Gender int `json:"gender,omitempty"`
	// 用户的出生日期,格式为 YYYY-MM-DD,如 1990-12-31
	Birthdate *time.Time `json:"birthdate,omitempty"`
	// 用户的时区信息,如:Asia/Shanghai
	Timezone string `json:"timezone,omitempty"`
	// 用户的语言/地区偏好,如:zh-CN
	Locale string `json:"locale,omitempty"`
	// 用户的手机号码,加密存储
	PhoneNumberEncrypted []byte `json:"-"`
	// 用户的手机号哈希,用于唯一值判断
	PhoneNumberHash string `json:"phone_number_hash,omitempty"`
	// 手机号是否验证过
	PhoneNumberVerified bool `json:"phone_number_verified,omitempty"`
	// 用户的地址信息
	AddressEncrypted []byte `json:"-"`
	// 用户详细描述
	Description string `json:"description,omitempty"`
	// 自定义元数据,用于存储额外的用户信息,对应 proto 中的 map<string, string> metadata
	Metadata map[string]string `json:"metadata,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UsersQuery when eager-loading is set.
	Edges UsersEdges `json:"edges"`
	// contains filtered or unexported fields
}

Users is the model entity for the Users schema.

func (*Users) QueryLionUserDepartments

func (_m *Users) QueryLionUserDepartments() *UserDepartmentsQuery

QueryLionUserDepartments queries the "lion_user_departments" edge of the Users entity.

func (*Users) QueryLionUserGroups

func (_m *Users) QueryLionUserGroups() *UserGroupsQuery

QueryLionUserGroups queries the "lion_user_groups" edge of the Users entity.

func (*Users) QueryLionUserIdentities

func (_m *Users) QueryLionUserIdentities() *UserIdentitiesQuery

QueryLionUserIdentities queries the "lion_user_identities" edge of the Users entity.

func (*Users) QueryLionUserRoles

func (_m *Users) QueryLionUserRoles() *UserRolesQuery

QueryLionUserRoles queries the "lion_user_roles" edge of the Users entity.

func (*Users) String

func (_m *Users) String() string

String implements the fmt.Stringer.

func (*Users) Unwrap

func (_m *Users) Unwrap() *Users

Unwrap unwraps the Users 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 (*Users) Update

func (_m *Users) Update() *UsersUpdateOne

Update returns a builder for updating this Users. Note that you need to call Users.Unwrap() before calling this method if this Users was returned from a transaction, and the transaction was committed or rolled back.

func (*Users) Value

func (_m *Users) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Users. This includes values selected through modifiers, order, etc.

type UsersClient

type UsersClient struct {
	// contains filtered or unexported fields
}

UsersClient is a client for the Users schema.

func NewUsersClient

func NewUsersClient(c config) *UsersClient

NewUsersClient returns a client for the Users from the given config.

func (*UsersClient) Create

func (c *UsersClient) Create() *UsersCreate

Create returns a builder for creating a Users entity.

func (*UsersClient) CreateBulk

func (c *UsersClient) CreateBulk(builders ...*UsersCreate) *UsersCreateBulk

CreateBulk returns a builder for creating a bulk of Users entities.

func (*UsersClient) Delete

func (c *UsersClient) Delete() *UsersDelete

Delete returns a delete builder for Users.

func (*UsersClient) DeleteOne

func (c *UsersClient) DeleteOne(_m *Users) *UsersDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UsersClient) DeleteOneID

func (c *UsersClient) DeleteOneID(id int) *UsersDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UsersClient) Get

func (c *UsersClient) Get(ctx context.Context, id int) (*Users, error)

Get returns a Users entity by its id.

func (*UsersClient) GetX

func (c *UsersClient) GetX(ctx context.Context, id int) *Users

GetX is like Get, but panics if an error occurs.

func (*UsersClient) Hooks

func (c *UsersClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UsersClient) Intercept

func (c *UsersClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `users.Intercept(f(g(h())))`.

func (*UsersClient) Interceptors

func (c *UsersClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UsersClient) MapCreateBulk

func (c *UsersClient) MapCreateBulk(slice any, setFunc func(*UsersCreate, int)) *UsersCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UsersClient) Query

func (c *UsersClient) Query() *UsersQuery

Query returns a query builder for Users.

func (*UsersClient) QueryLionUserDepartments

func (c *UsersClient) QueryLionUserDepartments(_m *Users) *UserDepartmentsQuery

QueryLionUserDepartments queries the lion_user_departments edge of a Users.

func (*UsersClient) QueryLionUserGroups

func (c *UsersClient) QueryLionUserGroups(_m *Users) *UserGroupsQuery

QueryLionUserGroups queries the lion_user_groups edge of a Users.

func (*UsersClient) QueryLionUserIdentities

func (c *UsersClient) QueryLionUserIdentities(_m *Users) *UserIdentitiesQuery

QueryLionUserIdentities queries the lion_user_identities edge of a Users.

func (*UsersClient) QueryLionUserRoles

func (c *UsersClient) QueryLionUserRoles(_m *Users) *UserRolesQuery

QueryLionUserRoles queries the lion_user_roles edge of a Users.

func (*UsersClient) Update

func (c *UsersClient) Update() *UsersUpdate

Update returns an update builder for Users.

func (*UsersClient) UpdateOne

func (c *UsersClient) UpdateOne(_m *Users) *UsersUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UsersClient) UpdateOneID

func (c *UsersClient) UpdateOneID(id int) *UsersUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UsersClient) Use

func (c *UsersClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `users.Hooks(f(g(h())))`.

type UsersCreate

type UsersCreate struct {
	// contains filtered or unexported fields
}

UsersCreate is the builder for creating a Users entity.

func (*UsersCreate) AddLionUserDepartmentIDs

func (_c *UsersCreate) AddLionUserDepartmentIDs(ids ...int) *UsersCreate

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*UsersCreate) AddLionUserDepartments

func (_c *UsersCreate) AddLionUserDepartments(v ...*UserDepartments) *UsersCreate

AddLionUserDepartments adds the "lion_user_departments" edges to the UserDepartments entity.

func (*UsersCreate) AddLionUserGroupIDs

func (_c *UsersCreate) AddLionUserGroupIDs(ids ...int) *UsersCreate

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*UsersCreate) AddLionUserGroups

func (_c *UsersCreate) AddLionUserGroups(v ...*UserGroups) *UsersCreate

AddLionUserGroups adds the "lion_user_groups" edges to the UserGroups entity.

func (*UsersCreate) AddLionUserIdentities

func (_c *UsersCreate) AddLionUserIdentities(v ...*UserIdentities) *UsersCreate

AddLionUserIdentities adds the "lion_user_identities" edges to the UserIdentities entity.

func (*UsersCreate) AddLionUserIdentityIDs

func (_c *UsersCreate) AddLionUserIdentityIDs(ids ...int) *UsersCreate

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*UsersCreate) AddLionUserRoleIDs

func (_c *UsersCreate) AddLionUserRoleIDs(ids ...int) *UsersCreate

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*UsersCreate) AddLionUserRoles

func (_c *UsersCreate) AddLionUserRoles(v ...*UserRoles) *UsersCreate

AddLionUserRoles adds the "lion_user_roles" edges to the UserRoles entity.

func (*UsersCreate) Exec

func (_c *UsersCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UsersCreate) ExecX

func (_c *UsersCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersCreate) Mutation

func (_c *UsersCreate) Mutation() *UsersMutation

Mutation returns the UsersMutation object of the builder.

func (*UsersCreate) Save

func (_c *UsersCreate) Save(ctx context.Context) (*Users, error)

Save creates the Users in the database.

func (*UsersCreate) SaveX

func (_c *UsersCreate) SaveX(ctx context.Context) *Users

SaveX calls Save and panics if Save returns an error.

func (*UsersCreate) SetAddressEncrypted

func (_c *UsersCreate) SetAddressEncrypted(v []byte) *UsersCreate

SetAddressEncrypted sets the "address_encrypted" field.

func (*UsersCreate) SetBirthdate

func (_c *UsersCreate) SetBirthdate(v time.Time) *UsersCreate

SetBirthdate sets the "birthdate" field.

func (*UsersCreate) SetCreatedAt

func (_c *UsersCreate) SetCreatedAt(v time.Time) *UsersCreate

SetCreatedAt sets the "created_at" field.

func (*UsersCreate) SetCreatedBy

func (_c *UsersCreate) SetCreatedBy(v int64) *UsersCreate

SetCreatedBy sets the "created_by" field.

func (*UsersCreate) SetDeletedAt

func (_c *UsersCreate) SetDeletedAt(v time.Time) *UsersCreate

SetDeletedAt sets the "deleted_at" field.

func (*UsersCreate) SetDescription

func (_c *UsersCreate) SetDescription(v string) *UsersCreate

SetDescription sets the "description" field.

func (*UsersCreate) SetEmailEncrypted

func (_c *UsersCreate) SetEmailEncrypted(v []byte) *UsersCreate

SetEmailEncrypted sets the "email_encrypted" field.

func (*UsersCreate) SetEmailHash

func (_c *UsersCreate) SetEmailHash(v string) *UsersCreate

SetEmailHash sets the "email_hash" field.

func (*UsersCreate) SetEmailVerified

func (_c *UsersCreate) SetEmailVerified(v bool) *UsersCreate

SetEmailVerified sets the "email_verified" field.

func (*UsersCreate) SetGender

func (_c *UsersCreate) SetGender(v int) *UsersCreate

SetGender sets the "gender" field.

func (*UsersCreate) SetLocale

func (_c *UsersCreate) SetLocale(v string) *UsersCreate

SetLocale sets the "locale" field.

func (*UsersCreate) SetMetadata

func (_c *UsersCreate) SetMetadata(v map[string]string) *UsersCreate

SetMetadata sets the "metadata" field.

func (*UsersCreate) SetNationalIDEncrypted

func (_c *UsersCreate) SetNationalIDEncrypted(v []byte) *UsersCreate

SetNationalIDEncrypted sets the "national_id_encrypted" field.

func (*UsersCreate) SetNationalIDHash

func (_c *UsersCreate) SetNationalIDHash(v string) *UsersCreate

SetNationalIDHash sets the "national_id_hash" field.

func (*UsersCreate) SetNickname

func (_c *UsersCreate) SetNickname(v string) *UsersCreate

SetNickname sets the "nickname" field.

func (*UsersCreate) SetNillableBirthdate

func (_c *UsersCreate) SetNillableBirthdate(v *time.Time) *UsersCreate

SetNillableBirthdate sets the "birthdate" field if the given value is not nil.

func (*UsersCreate) SetNillableCreatedAt

func (_c *UsersCreate) SetNillableCreatedAt(v *time.Time) *UsersCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UsersCreate) SetNillableCreatedBy

func (_c *UsersCreate) SetNillableCreatedBy(v *int64) *UsersCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UsersCreate) SetNillableDeletedAt

func (_c *UsersCreate) SetNillableDeletedAt(v *time.Time) *UsersCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UsersCreate) SetNillableDescription

func (_c *UsersCreate) SetNillableDescription(v *string) *UsersCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UsersCreate) SetNillableEmailHash

func (_c *UsersCreate) SetNillableEmailHash(v *string) *UsersCreate

SetNillableEmailHash sets the "email_hash" field if the given value is not nil.

func (*UsersCreate) SetNillableEmailVerified

func (_c *UsersCreate) SetNillableEmailVerified(v *bool) *UsersCreate

SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.

func (*UsersCreate) SetNillableGender

func (_c *UsersCreate) SetNillableGender(v *int) *UsersCreate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UsersCreate) SetNillableLocale

func (_c *UsersCreate) SetNillableLocale(v *string) *UsersCreate

SetNillableLocale sets the "locale" field if the given value is not nil.

func (*UsersCreate) SetNillableNationalIDHash

func (_c *UsersCreate) SetNillableNationalIDHash(v *string) *UsersCreate

SetNillableNationalIDHash sets the "national_id_hash" field if the given value is not nil.

func (*UsersCreate) SetNillableNickname

func (_c *UsersCreate) SetNillableNickname(v *string) *UsersCreate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UsersCreate) SetNillablePhoneNumberHash

func (_c *UsersCreate) SetNillablePhoneNumberHash(v *string) *UsersCreate

SetNillablePhoneNumberHash sets the "phone_number_hash" field if the given value is not nil.

func (*UsersCreate) SetNillablePhoneNumberVerified

func (_c *UsersCreate) SetNillablePhoneNumberVerified(v *bool) *UsersCreate

SetNillablePhoneNumberVerified sets the "phone_number_verified" field if the given value is not nil.

func (*UsersCreate) SetNillablePicture

func (_c *UsersCreate) SetNillablePicture(v *string) *UsersCreate

SetNillablePicture sets the "picture" field if the given value is not nil.

func (*UsersCreate) SetNillableProfile

func (_c *UsersCreate) SetNillableProfile(v *string) *UsersCreate

SetNillableProfile sets the "profile" field if the given value is not nil.

func (*UsersCreate) SetNillableTimezone

func (_c *UsersCreate) SetNillableTimezone(v *string) *UsersCreate

SetNillableTimezone sets the "timezone" field if the given value is not nil.

func (*UsersCreate) SetNillableUpdatedAt

func (_c *UsersCreate) SetNillableUpdatedAt(v *time.Time) *UsersCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UsersCreate) SetNillableUpdatedBy

func (_c *UsersCreate) SetNillableUpdatedBy(v *int64) *UsersCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UsersCreate) SetNillableUserStatus

func (_c *UsersCreate) SetNillableUserStatus(v *int) *UsersCreate

SetNillableUserStatus sets the "user_status" field if the given value is not nil.

func (*UsersCreate) SetNillableUserType

func (_c *UsersCreate) SetNillableUserType(v *int) *UsersCreate

SetNillableUserType sets the "user_type" field if the given value is not nil.

func (*UsersCreate) SetNillableWebsite

func (_c *UsersCreate) SetNillableWebsite(v *string) *UsersCreate

SetNillableWebsite sets the "website" field if the given value is not nil.

func (*UsersCreate) SetPhoneNumberEncrypted

func (_c *UsersCreate) SetPhoneNumberEncrypted(v []byte) *UsersCreate

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*UsersCreate) SetPhoneNumberHash

func (_c *UsersCreate) SetPhoneNumberHash(v string) *UsersCreate

SetPhoneNumberHash sets the "phone_number_hash" field.

func (*UsersCreate) SetPhoneNumberVerified

func (_c *UsersCreate) SetPhoneNumberVerified(v bool) *UsersCreate

SetPhoneNumberVerified sets the "phone_number_verified" field.

func (*UsersCreate) SetPicture

func (_c *UsersCreate) SetPicture(v string) *UsersCreate

SetPicture sets the "picture" field.

func (*UsersCreate) SetProfile

func (_c *UsersCreate) SetProfile(v string) *UsersCreate

SetProfile sets the "profile" field.

func (*UsersCreate) SetRealnameEncrypted

func (_c *UsersCreate) SetRealnameEncrypted(v []byte) *UsersCreate

SetRealnameEncrypted sets the "realname_encrypted" field.

func (*UsersCreate) SetTimezone

func (_c *UsersCreate) SetTimezone(v string) *UsersCreate

SetTimezone sets the "timezone" field.

func (*UsersCreate) SetUpdatedAt

func (_c *UsersCreate) SetUpdatedAt(v time.Time) *UsersCreate

SetUpdatedAt sets the "updated_at" field.

func (*UsersCreate) SetUpdatedBy

func (_c *UsersCreate) SetUpdatedBy(v int64) *UsersCreate

SetUpdatedBy sets the "updated_by" field.

func (*UsersCreate) SetUserStatus

func (_c *UsersCreate) SetUserStatus(v int) *UsersCreate

SetUserStatus sets the "user_status" field.

func (*UsersCreate) SetUserType

func (_c *UsersCreate) SetUserType(v int) *UsersCreate

SetUserType sets the "user_type" field.

func (*UsersCreate) SetUsername

func (_c *UsersCreate) SetUsername(v string) *UsersCreate

SetUsername sets the "username" field.

func (*UsersCreate) SetWebsite

func (_c *UsersCreate) SetWebsite(v string) *UsersCreate

SetWebsite sets the "website" field.

type UsersCreateBulk

type UsersCreateBulk struct {
	// contains filtered or unexported fields
}

UsersCreateBulk is the builder for creating many Users entities in bulk.

func (*UsersCreateBulk) Exec

func (_c *UsersCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UsersCreateBulk) ExecX

func (_c *UsersCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersCreateBulk) Save

func (_c *UsersCreateBulk) Save(ctx context.Context) ([]*Users, error)

Save creates the Users entities in the database.

func (*UsersCreateBulk) SaveX

func (_c *UsersCreateBulk) SaveX(ctx context.Context) []*Users

SaveX is like Save, but panics if an error occurs.

type UsersDelete

type UsersDelete struct {
	// contains filtered or unexported fields
}

UsersDelete is the builder for deleting a Users entity.

func (*UsersDelete) Exec

func (_d *UsersDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UsersDelete) ExecX

func (_d *UsersDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UsersDelete) Where

func (_d *UsersDelete) Where(ps ...predicate.Users) *UsersDelete

Where appends a list predicates to the UsersDelete builder.

type UsersDeleteOne

type UsersDeleteOne struct {
	// contains filtered or unexported fields
}

UsersDeleteOne is the builder for deleting a single Users entity.

func (*UsersDeleteOne) Exec

func (_d *UsersDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UsersDeleteOne) ExecX

func (_d *UsersDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersDeleteOne) Where

func (_d *UsersDeleteOne) Where(ps ...predicate.Users) *UsersDeleteOne

Where appends a list predicates to the UsersDelete builder.

type UsersEdges

type UsersEdges struct {
	// LionUserRoles holds the value of the lion_user_roles edge.
	LionUserRoles []*UserRoles `json:"lion_user_roles,omitempty"`
	// LionUserGroups holds the value of the lion_user_groups edge.
	LionUserGroups []*UserGroups `json:"lion_user_groups,omitempty"`
	// LionUserIdentities holds the value of the lion_user_identities edge.
	LionUserIdentities []*UserIdentities `json:"lion_user_identities,omitempty"`
	// LionUserDepartments holds the value of the lion_user_departments edge.
	LionUserDepartments []*UserDepartments `json:"lion_user_departments,omitempty"`
	// contains filtered or unexported fields
}

UsersEdges holds the relations/edges for other nodes in the graph.

func (UsersEdges) LionUserDepartmentsOrErr

func (e UsersEdges) LionUserDepartmentsOrErr() ([]*UserDepartments, error)

LionUserDepartmentsOrErr returns the LionUserDepartments value or an error if the edge was not loaded in eager-loading.

func (UsersEdges) LionUserGroupsOrErr

func (e UsersEdges) LionUserGroupsOrErr() ([]*UserGroups, error)

LionUserGroupsOrErr returns the LionUserGroups value or an error if the edge was not loaded in eager-loading.

func (UsersEdges) LionUserIdentitiesOrErr

func (e UsersEdges) LionUserIdentitiesOrErr() ([]*UserIdentities, error)

LionUserIdentitiesOrErr returns the LionUserIdentities value or an error if the edge was not loaded in eager-loading.

func (UsersEdges) LionUserRolesOrErr

func (e UsersEdges) LionUserRolesOrErr() ([]*UserRoles, error)

LionUserRolesOrErr returns the LionUserRoles value or an error if the edge was not loaded in eager-loading.

type UsersGroupBy

type UsersGroupBy struct {
	// contains filtered or unexported fields
}

UsersGroupBy is the group-by builder for Users entities.

func (*UsersGroupBy) Aggregate

func (_g *UsersGroupBy) Aggregate(fns ...AggregateFunc) *UsersGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UsersGroupBy) Bool

func (s *UsersGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) BoolX

func (s *UsersGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UsersGroupBy) Bools

func (s *UsersGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) BoolsX

func (s *UsersGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UsersGroupBy) Float64

func (s *UsersGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) Float64X

func (s *UsersGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UsersGroupBy) Float64s

func (s *UsersGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) Float64sX

func (s *UsersGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UsersGroupBy) Int

func (s *UsersGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) IntX

func (s *UsersGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UsersGroupBy) Ints

func (s *UsersGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) IntsX

func (s *UsersGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UsersGroupBy) Scan

func (_g *UsersGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UsersGroupBy) ScanX

func (s *UsersGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UsersGroupBy) String

func (s *UsersGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) StringX

func (s *UsersGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UsersGroupBy) Strings

func (s *UsersGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) StringsX

func (s *UsersGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UsersMutation

type UsersMutation struct {
	// contains filtered or unexported fields
}

UsersMutation represents an operation that mutates the Users nodes in the graph.

func (*UsersMutation) AddCreatedBy

func (m *UsersMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*UsersMutation) AddField

func (m *UsersMutation) 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 (*UsersMutation) AddGender

func (m *UsersMutation) AddGender(i int)

AddGender adds i to the "gender" field.

func (*UsersMutation) AddLionUserDepartmentIDs

func (m *UsersMutation) AddLionUserDepartmentIDs(ids ...int)

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by ids.

func (*UsersMutation) AddLionUserGroupIDs

func (m *UsersMutation) AddLionUserGroupIDs(ids ...int)

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by ids.

func (*UsersMutation) AddLionUserIdentityIDs

func (m *UsersMutation) AddLionUserIdentityIDs(ids ...int)

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by ids.

func (*UsersMutation) AddLionUserRoleIDs

func (m *UsersMutation) AddLionUserRoleIDs(ids ...int)

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by ids.

func (*UsersMutation) AddUpdatedBy

func (m *UsersMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*UsersMutation) AddUserStatus

func (m *UsersMutation) AddUserStatus(i int)

AddUserStatus adds i to the "user_status" field.

func (*UsersMutation) AddUserType

func (m *UsersMutation) AddUserType(i int)

AddUserType adds i to the "user_type" field.

func (*UsersMutation) AddedCreatedBy

func (m *UsersMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*UsersMutation) AddedEdges

func (m *UsersMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UsersMutation) AddedField

func (m *UsersMutation) 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 (*UsersMutation) AddedFields

func (m *UsersMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UsersMutation) AddedGender

func (m *UsersMutation) AddedGender() (r int, exists bool)

AddedGender returns the value that was added to the "gender" field in this mutation.

func (*UsersMutation) AddedIDs

func (m *UsersMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UsersMutation) AddedUpdatedBy

func (m *UsersMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*UsersMutation) AddedUserStatus

func (m *UsersMutation) AddedUserStatus() (r int, exists bool)

AddedUserStatus returns the value that was added to the "user_status" field in this mutation.

func (*UsersMutation) AddedUserType

func (m *UsersMutation) AddedUserType() (r int, exists bool)

AddedUserType returns the value that was added to the "user_type" field in this mutation.

func (*UsersMutation) AddressEncrypted

func (m *UsersMutation) AddressEncrypted() (r []byte, exists bool)

AddressEncrypted returns the value of the "address_encrypted" field in the mutation.

func (*UsersMutation) AddressEncryptedCleared

func (m *UsersMutation) AddressEncryptedCleared() bool

AddressEncryptedCleared returns if the "address_encrypted" field was cleared in this mutation.

func (*UsersMutation) Birthdate

func (m *UsersMutation) Birthdate() (r time.Time, exists bool)

Birthdate returns the value of the "birthdate" field in the mutation.

func (*UsersMutation) BirthdateCleared

func (m *UsersMutation) BirthdateCleared() bool

BirthdateCleared returns if the "birthdate" field was cleared in this mutation.

func (*UsersMutation) ClearAddressEncrypted

func (m *UsersMutation) ClearAddressEncrypted()

ClearAddressEncrypted clears the value of the "address_encrypted" field.

func (*UsersMutation) ClearBirthdate

func (m *UsersMutation) ClearBirthdate()

ClearBirthdate clears the value of the "birthdate" field.

func (*UsersMutation) ClearCreatedBy

func (m *UsersMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*UsersMutation) ClearDeletedAt

func (m *UsersMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsersMutation) ClearDescription

func (m *UsersMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*UsersMutation) ClearEdge

func (m *UsersMutation) 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 (*UsersMutation) ClearEmailEncrypted

func (m *UsersMutation) ClearEmailEncrypted()

ClearEmailEncrypted clears the value of the "email_encrypted" field.

func (*UsersMutation) ClearEmailHash

func (m *UsersMutation) ClearEmailHash()

ClearEmailHash clears the value of the "email_hash" field.

func (*UsersMutation) ClearField

func (m *UsersMutation) 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 (*UsersMutation) ClearLionUserDepartments

func (m *UsersMutation) ClearLionUserDepartments()

ClearLionUserDepartments clears the "lion_user_departments" edge to the UserDepartments entity.

func (*UsersMutation) ClearLionUserGroups

func (m *UsersMutation) ClearLionUserGroups()

ClearLionUserGroups clears the "lion_user_groups" edge to the UserGroups entity.

func (*UsersMutation) ClearLionUserIdentities

func (m *UsersMutation) ClearLionUserIdentities()

ClearLionUserIdentities clears the "lion_user_identities" edge to the UserIdentities entity.

func (*UsersMutation) ClearLionUserRoles

func (m *UsersMutation) ClearLionUserRoles()

ClearLionUserRoles clears the "lion_user_roles" edge to the UserRoles entity.

func (*UsersMutation) ClearLocale

func (m *UsersMutation) ClearLocale()

ClearLocale clears the value of the "locale" field.

func (*UsersMutation) ClearMetadata

func (m *UsersMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*UsersMutation) ClearNationalIDEncrypted

func (m *UsersMutation) ClearNationalIDEncrypted()

ClearNationalIDEncrypted clears the value of the "national_id_encrypted" field.

func (*UsersMutation) ClearNationalIDHash

func (m *UsersMutation) ClearNationalIDHash()

ClearNationalIDHash clears the value of the "national_id_hash" field.

func (*UsersMutation) ClearNickname

func (m *UsersMutation) ClearNickname()

ClearNickname clears the value of the "nickname" field.

func (*UsersMutation) ClearPhoneNumberEncrypted

func (m *UsersMutation) ClearPhoneNumberEncrypted()

ClearPhoneNumberEncrypted clears the value of the "phone_number_encrypted" field.

func (*UsersMutation) ClearPhoneNumberHash

func (m *UsersMutation) ClearPhoneNumberHash()

ClearPhoneNumberHash clears the value of the "phone_number_hash" field.

func (*UsersMutation) ClearPicture

func (m *UsersMutation) ClearPicture()

ClearPicture clears the value of the "picture" field.

func (*UsersMutation) ClearProfile

func (m *UsersMutation) ClearProfile()

ClearProfile clears the value of the "profile" field.

func (*UsersMutation) ClearRealnameEncrypted

func (m *UsersMutation) ClearRealnameEncrypted()

ClearRealnameEncrypted clears the value of the "realname_encrypted" field.

func (*UsersMutation) ClearTimezone

func (m *UsersMutation) ClearTimezone()

ClearTimezone clears the value of the "timezone" field.

func (*UsersMutation) ClearUpdatedBy

func (m *UsersMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UsersMutation) ClearWebsite

func (m *UsersMutation) ClearWebsite()

ClearWebsite clears the value of the "website" field.

func (*UsersMutation) ClearedEdges

func (m *UsersMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UsersMutation) ClearedFields

func (m *UsersMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UsersMutation) Client

func (m UsersMutation) 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 (*UsersMutation) CreatedAt

func (m *UsersMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UsersMutation) CreatedBy

func (m *UsersMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UsersMutation) CreatedByCleared

func (m *UsersMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*UsersMutation) DeletedAt

func (m *UsersMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UsersMutation) DeletedAtCleared

func (m *UsersMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UsersMutation) Description

func (m *UsersMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*UsersMutation) DescriptionCleared

func (m *UsersMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*UsersMutation) EdgeCleared

func (m *UsersMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UsersMutation) EmailEncrypted

func (m *UsersMutation) EmailEncrypted() (r []byte, exists bool)

EmailEncrypted returns the value of the "email_encrypted" field in the mutation.

func (*UsersMutation) EmailEncryptedCleared

func (m *UsersMutation) EmailEncryptedCleared() bool

EmailEncryptedCleared returns if the "email_encrypted" field was cleared in this mutation.

func (*UsersMutation) EmailHash

func (m *UsersMutation) EmailHash() (r string, exists bool)

EmailHash returns the value of the "email_hash" field in the mutation.

func (*UsersMutation) EmailHashCleared

func (m *UsersMutation) EmailHashCleared() bool

EmailHashCleared returns if the "email_hash" field was cleared in this mutation.

func (*UsersMutation) EmailVerified

func (m *UsersMutation) EmailVerified() (r bool, exists bool)

EmailVerified returns the value of the "email_verified" field in the mutation.

func (*UsersMutation) Field

func (m *UsersMutation) 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 (*UsersMutation) FieldCleared

func (m *UsersMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UsersMutation) Fields

func (m *UsersMutation) 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 (*UsersMutation) Gender

func (m *UsersMutation) Gender() (r int, exists bool)

Gender returns the value of the "gender" field in the mutation.

func (*UsersMutation) ID

func (m *UsersMutation) 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 (*UsersMutation) IDs

func (m *UsersMutation) 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 (*UsersMutation) LionUserDepartmentsCleared

func (m *UsersMutation) LionUserDepartmentsCleared() bool

LionUserDepartmentsCleared reports if the "lion_user_departments" edge to the UserDepartments entity was cleared.

func (*UsersMutation) LionUserDepartmentsIDs

func (m *UsersMutation) LionUserDepartmentsIDs() (ids []int)

LionUserDepartmentsIDs returns the "lion_user_departments" edge IDs in the mutation.

func (*UsersMutation) LionUserGroupsCleared

func (m *UsersMutation) LionUserGroupsCleared() bool

LionUserGroupsCleared reports if the "lion_user_groups" edge to the UserGroups entity was cleared.

func (*UsersMutation) LionUserGroupsIDs

func (m *UsersMutation) LionUserGroupsIDs() (ids []int)

LionUserGroupsIDs returns the "lion_user_groups" edge IDs in the mutation.

func (*UsersMutation) LionUserIdentitiesCleared

func (m *UsersMutation) LionUserIdentitiesCleared() bool

LionUserIdentitiesCleared reports if the "lion_user_identities" edge to the UserIdentities entity was cleared.

func (*UsersMutation) LionUserIdentitiesIDs

func (m *UsersMutation) LionUserIdentitiesIDs() (ids []int)

LionUserIdentitiesIDs returns the "lion_user_identities" edge IDs in the mutation.

func (*UsersMutation) LionUserRolesCleared

func (m *UsersMutation) LionUserRolesCleared() bool

LionUserRolesCleared reports if the "lion_user_roles" edge to the UserRoles entity was cleared.

func (*UsersMutation) LionUserRolesIDs

func (m *UsersMutation) LionUserRolesIDs() (ids []int)

LionUserRolesIDs returns the "lion_user_roles" edge IDs in the mutation.

func (*UsersMutation) Locale

func (m *UsersMutation) Locale() (r string, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*UsersMutation) LocaleCleared

func (m *UsersMutation) LocaleCleared() bool

LocaleCleared returns if the "locale" field was cleared in this mutation.

func (*UsersMutation) Metadata

func (m *UsersMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*UsersMutation) MetadataCleared

func (m *UsersMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*UsersMutation) NationalIDEncrypted

func (m *UsersMutation) NationalIDEncrypted() (r []byte, exists bool)

NationalIDEncrypted returns the value of the "national_id_encrypted" field in the mutation.

func (*UsersMutation) NationalIDEncryptedCleared

func (m *UsersMutation) NationalIDEncryptedCleared() bool

NationalIDEncryptedCleared returns if the "national_id_encrypted" field was cleared in this mutation.

func (*UsersMutation) NationalIDHash

func (m *UsersMutation) NationalIDHash() (r string, exists bool)

NationalIDHash returns the value of the "national_id_hash" field in the mutation.

func (*UsersMutation) NationalIDHashCleared

func (m *UsersMutation) NationalIDHashCleared() bool

NationalIDHashCleared returns if the "national_id_hash" field was cleared in this mutation.

func (*UsersMutation) Nickname

func (m *UsersMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*UsersMutation) NicknameCleared

func (m *UsersMutation) NicknameCleared() bool

NicknameCleared returns if the "nickname" field was cleared in this mutation.

func (*UsersMutation) OldAddressEncrypted

func (m *UsersMutation) OldAddressEncrypted(ctx context.Context) (v []byte, err error)

OldAddressEncrypted returns the old "address_encrypted" field's value of the Users entity. If the Users 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 (*UsersMutation) OldBirthdate

func (m *UsersMutation) OldBirthdate(ctx context.Context) (v *time.Time, err error)

OldBirthdate returns the old "birthdate" field's value of the Users entity. If the Users 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 (*UsersMutation) OldCreatedAt

func (m *UsersMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Users entity. If the Users 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 (*UsersMutation) OldCreatedBy

func (m *UsersMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Users entity. If the Users 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 (*UsersMutation) OldDeletedAt

func (m *UsersMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Users entity. If the Users 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 (*UsersMutation) OldDescription

func (m *UsersMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Users entity. If the Users 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 (*UsersMutation) OldEmailEncrypted

func (m *UsersMutation) OldEmailEncrypted(ctx context.Context) (v []byte, err error)

OldEmailEncrypted returns the old "email_encrypted" field's value of the Users entity. If the Users 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 (*UsersMutation) OldEmailHash

func (m *UsersMutation) OldEmailHash(ctx context.Context) (v string, err error)

OldEmailHash returns the old "email_hash" field's value of the Users entity. If the Users 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 (*UsersMutation) OldEmailVerified

func (m *UsersMutation) OldEmailVerified(ctx context.Context) (v bool, err error)

OldEmailVerified returns the old "email_verified" field's value of the Users entity. If the Users 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 (*UsersMutation) OldField

func (m *UsersMutation) 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 (*UsersMutation) OldGender

func (m *UsersMutation) OldGender(ctx context.Context) (v int, err error)

OldGender returns the old "gender" field's value of the Users entity. If the Users 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 (*UsersMutation) OldLocale

func (m *UsersMutation) OldLocale(ctx context.Context) (v string, err error)

OldLocale returns the old "locale" field's value of the Users entity. If the Users 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 (*UsersMutation) OldMetadata

func (m *UsersMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the Users entity. If the Users 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 (*UsersMutation) OldNationalIDEncrypted

func (m *UsersMutation) OldNationalIDEncrypted(ctx context.Context) (v []byte, err error)

OldNationalIDEncrypted returns the old "national_id_encrypted" field's value of the Users entity. If the Users 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 (*UsersMutation) OldNationalIDHash

func (m *UsersMutation) OldNationalIDHash(ctx context.Context) (v string, err error)

OldNationalIDHash returns the old "national_id_hash" field's value of the Users entity. If the Users 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 (*UsersMutation) OldNickname

func (m *UsersMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the Users entity. If the Users 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 (*UsersMutation) OldPhoneNumberEncrypted

func (m *UsersMutation) OldPhoneNumberEncrypted(ctx context.Context) (v []byte, err error)

OldPhoneNumberEncrypted returns the old "phone_number_encrypted" field's value of the Users entity. If the Users 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 (*UsersMutation) OldPhoneNumberHash

func (m *UsersMutation) OldPhoneNumberHash(ctx context.Context) (v string, err error)

OldPhoneNumberHash returns the old "phone_number_hash" field's value of the Users entity. If the Users 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 (*UsersMutation) OldPhoneNumberVerified

func (m *UsersMutation) OldPhoneNumberVerified(ctx context.Context) (v bool, err error)

OldPhoneNumberVerified returns the old "phone_number_verified" field's value of the Users entity. If the Users 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 (*UsersMutation) OldPicture

func (m *UsersMutation) OldPicture(ctx context.Context) (v string, err error)

OldPicture returns the old "picture" field's value of the Users entity. If the Users 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 (*UsersMutation) OldProfile

func (m *UsersMutation) OldProfile(ctx context.Context) (v string, err error)

OldProfile returns the old "profile" field's value of the Users entity. If the Users 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 (*UsersMutation) OldRealnameEncrypted

func (m *UsersMutation) OldRealnameEncrypted(ctx context.Context) (v []byte, err error)

OldRealnameEncrypted returns the old "realname_encrypted" field's value of the Users entity. If the Users 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 (*UsersMutation) OldTimezone

func (m *UsersMutation) OldTimezone(ctx context.Context) (v string, err error)

OldTimezone returns the old "timezone" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUpdatedAt

func (m *UsersMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUpdatedBy

func (m *UsersMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUserStatus

func (m *UsersMutation) OldUserStatus(ctx context.Context) (v int, err error)

OldUserStatus returns the old "user_status" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUserType

func (m *UsersMutation) OldUserType(ctx context.Context) (v int, err error)

OldUserType returns the old "user_type" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUsername

func (m *UsersMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Users entity. If the Users 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 (*UsersMutation) OldWebsite

func (m *UsersMutation) OldWebsite(ctx context.Context) (v string, err error)

OldWebsite returns the old "website" field's value of the Users entity. If the Users 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 (*UsersMutation) Op

func (m *UsersMutation) Op() Op

Op returns the operation name.

func (*UsersMutation) PhoneNumberEncrypted

func (m *UsersMutation) PhoneNumberEncrypted() (r []byte, exists bool)

PhoneNumberEncrypted returns the value of the "phone_number_encrypted" field in the mutation.

func (*UsersMutation) PhoneNumberEncryptedCleared

func (m *UsersMutation) PhoneNumberEncryptedCleared() bool

PhoneNumberEncryptedCleared returns if the "phone_number_encrypted" field was cleared in this mutation.

func (*UsersMutation) PhoneNumberHash

func (m *UsersMutation) PhoneNumberHash() (r string, exists bool)

PhoneNumberHash returns the value of the "phone_number_hash" field in the mutation.

func (*UsersMutation) PhoneNumberHashCleared

func (m *UsersMutation) PhoneNumberHashCleared() bool

PhoneNumberHashCleared returns if the "phone_number_hash" field was cleared in this mutation.

func (*UsersMutation) PhoneNumberVerified

func (m *UsersMutation) PhoneNumberVerified() (r bool, exists bool)

PhoneNumberVerified returns the value of the "phone_number_verified" field in the mutation.

func (*UsersMutation) Picture

func (m *UsersMutation) Picture() (r string, exists bool)

Picture returns the value of the "picture" field in the mutation.

func (*UsersMutation) PictureCleared

func (m *UsersMutation) PictureCleared() bool

PictureCleared returns if the "picture" field was cleared in this mutation.

func (*UsersMutation) Profile

func (m *UsersMutation) Profile() (r string, exists bool)

Profile returns the value of the "profile" field in the mutation.

func (*UsersMutation) ProfileCleared

func (m *UsersMutation) ProfileCleared() bool

ProfileCleared returns if the "profile" field was cleared in this mutation.

func (*UsersMutation) RealnameEncrypted

func (m *UsersMutation) RealnameEncrypted() (r []byte, exists bool)

RealnameEncrypted returns the value of the "realname_encrypted" field in the mutation.

func (*UsersMutation) RealnameEncryptedCleared

func (m *UsersMutation) RealnameEncryptedCleared() bool

RealnameEncryptedCleared returns if the "realname_encrypted" field was cleared in this mutation.

func (*UsersMutation) RemoveLionUserDepartmentIDs

func (m *UsersMutation) RemoveLionUserDepartmentIDs(ids ...int)

RemoveLionUserDepartmentIDs removes the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*UsersMutation) RemoveLionUserGroupIDs

func (m *UsersMutation) RemoveLionUserGroupIDs(ids ...int)

RemoveLionUserGroupIDs removes the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*UsersMutation) RemoveLionUserIdentityIDs

func (m *UsersMutation) RemoveLionUserIdentityIDs(ids ...int)

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*UsersMutation) RemoveLionUserRoleIDs

func (m *UsersMutation) RemoveLionUserRoleIDs(ids ...int)

RemoveLionUserRoleIDs removes the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*UsersMutation) RemovedEdges

func (m *UsersMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UsersMutation) RemovedIDs

func (m *UsersMutation) 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 (*UsersMutation) RemovedLionUserDepartmentsIDs

func (m *UsersMutation) RemovedLionUserDepartmentsIDs() (ids []int)

RemovedLionUserDepartments returns the removed IDs of the "lion_user_departments" edge to the UserDepartments entity.

func (*UsersMutation) RemovedLionUserGroupsIDs

func (m *UsersMutation) RemovedLionUserGroupsIDs() (ids []int)

RemovedLionUserGroups returns the removed IDs of the "lion_user_groups" edge to the UserGroups entity.

func (*UsersMutation) RemovedLionUserIdentitiesIDs

func (m *UsersMutation) RemovedLionUserIdentitiesIDs() (ids []int)

RemovedLionUserIdentities returns the removed IDs of the "lion_user_identities" edge to the UserIdentities entity.

func (*UsersMutation) RemovedLionUserRolesIDs

func (m *UsersMutation) RemovedLionUserRolesIDs() (ids []int)

RemovedLionUserRoles returns the removed IDs of the "lion_user_roles" edge to the UserRoles entity.

func (*UsersMutation) ResetAddressEncrypted

func (m *UsersMutation) ResetAddressEncrypted()

ResetAddressEncrypted resets all changes to the "address_encrypted" field.

func (*UsersMutation) ResetBirthdate

func (m *UsersMutation) ResetBirthdate()

ResetBirthdate resets all changes to the "birthdate" field.

func (*UsersMutation) ResetCreatedAt

func (m *UsersMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UsersMutation) ResetCreatedBy

func (m *UsersMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UsersMutation) ResetDeletedAt

func (m *UsersMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*UsersMutation) ResetDescription

func (m *UsersMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*UsersMutation) ResetEdge

func (m *UsersMutation) 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 (*UsersMutation) ResetEmailEncrypted

func (m *UsersMutation) ResetEmailEncrypted()

ResetEmailEncrypted resets all changes to the "email_encrypted" field.

func (*UsersMutation) ResetEmailHash

func (m *UsersMutation) ResetEmailHash()

ResetEmailHash resets all changes to the "email_hash" field.

func (*UsersMutation) ResetEmailVerified

func (m *UsersMutation) ResetEmailVerified()

ResetEmailVerified resets all changes to the "email_verified" field.

func (*UsersMutation) ResetField

func (m *UsersMutation) 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 (*UsersMutation) ResetGender

func (m *UsersMutation) ResetGender()

ResetGender resets all changes to the "gender" field.

func (*UsersMutation) ResetLionUserDepartments

func (m *UsersMutation) ResetLionUserDepartments()

ResetLionUserDepartments resets all changes to the "lion_user_departments" edge.

func (*UsersMutation) ResetLionUserGroups

func (m *UsersMutation) ResetLionUserGroups()

ResetLionUserGroups resets all changes to the "lion_user_groups" edge.

func (*UsersMutation) ResetLionUserIdentities

func (m *UsersMutation) ResetLionUserIdentities()

ResetLionUserIdentities resets all changes to the "lion_user_identities" edge.

func (*UsersMutation) ResetLionUserRoles

func (m *UsersMutation) ResetLionUserRoles()

ResetLionUserRoles resets all changes to the "lion_user_roles" edge.

func (*UsersMutation) ResetLocale

func (m *UsersMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*UsersMutation) ResetMetadata

func (m *UsersMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*UsersMutation) ResetNationalIDEncrypted

func (m *UsersMutation) ResetNationalIDEncrypted()

ResetNationalIDEncrypted resets all changes to the "national_id_encrypted" field.

func (*UsersMutation) ResetNationalIDHash

func (m *UsersMutation) ResetNationalIDHash()

ResetNationalIDHash resets all changes to the "national_id_hash" field.

func (*UsersMutation) ResetNickname

func (m *UsersMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*UsersMutation) ResetPhoneNumberEncrypted

func (m *UsersMutation) ResetPhoneNumberEncrypted()

ResetPhoneNumberEncrypted resets all changes to the "phone_number_encrypted" field.

func (*UsersMutation) ResetPhoneNumberHash

func (m *UsersMutation) ResetPhoneNumberHash()

ResetPhoneNumberHash resets all changes to the "phone_number_hash" field.

func (*UsersMutation) ResetPhoneNumberVerified

func (m *UsersMutation) ResetPhoneNumberVerified()

ResetPhoneNumberVerified resets all changes to the "phone_number_verified" field.

func (*UsersMutation) ResetPicture

func (m *UsersMutation) ResetPicture()

ResetPicture resets all changes to the "picture" field.

func (*UsersMutation) ResetProfile

func (m *UsersMutation) ResetProfile()

ResetProfile resets all changes to the "profile" field.

func (*UsersMutation) ResetRealnameEncrypted

func (m *UsersMutation) ResetRealnameEncrypted()

ResetRealnameEncrypted resets all changes to the "realname_encrypted" field.

func (*UsersMutation) ResetTimezone

func (m *UsersMutation) ResetTimezone()

ResetTimezone resets all changes to the "timezone" field.

func (*UsersMutation) ResetUpdatedAt

func (m *UsersMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UsersMutation) ResetUpdatedBy

func (m *UsersMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UsersMutation) ResetUserStatus

func (m *UsersMutation) ResetUserStatus()

ResetUserStatus resets all changes to the "user_status" field.

func (*UsersMutation) ResetUserType

func (m *UsersMutation) ResetUserType()

ResetUserType resets all changes to the "user_type" field.

func (*UsersMutation) ResetUsername

func (m *UsersMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UsersMutation) ResetWebsite

func (m *UsersMutation) ResetWebsite()

ResetWebsite resets all changes to the "website" field.

func (*UsersMutation) SetAddressEncrypted

func (m *UsersMutation) SetAddressEncrypted(b []byte)

SetAddressEncrypted sets the "address_encrypted" field.

func (*UsersMutation) SetBirthdate

func (m *UsersMutation) SetBirthdate(t time.Time)

SetBirthdate sets the "birthdate" field.

func (*UsersMutation) SetCreatedAt

func (m *UsersMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UsersMutation) SetCreatedBy

func (m *UsersMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*UsersMutation) SetDeletedAt

func (m *UsersMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*UsersMutation) SetDescription

func (m *UsersMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*UsersMutation) SetEmailEncrypted

func (m *UsersMutation) SetEmailEncrypted(b []byte)

SetEmailEncrypted sets the "email_encrypted" field.

func (*UsersMutation) SetEmailHash

func (m *UsersMutation) SetEmailHash(s string)

SetEmailHash sets the "email_hash" field.

func (*UsersMutation) SetEmailVerified

func (m *UsersMutation) SetEmailVerified(b bool)

SetEmailVerified sets the "email_verified" field.

func (*UsersMutation) SetField

func (m *UsersMutation) 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 (*UsersMutation) SetGender

func (m *UsersMutation) SetGender(i int)

SetGender sets the "gender" field.

func (*UsersMutation) SetLocale

func (m *UsersMutation) SetLocale(s string)

SetLocale sets the "locale" field.

func (*UsersMutation) SetMetadata

func (m *UsersMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*UsersMutation) SetNationalIDEncrypted

func (m *UsersMutation) SetNationalIDEncrypted(b []byte)

SetNationalIDEncrypted sets the "national_id_encrypted" field.

func (*UsersMutation) SetNationalIDHash

func (m *UsersMutation) SetNationalIDHash(s string)

SetNationalIDHash sets the "national_id_hash" field.

func (*UsersMutation) SetNickname

func (m *UsersMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*UsersMutation) SetOp

func (m *UsersMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UsersMutation) SetPhoneNumberEncrypted

func (m *UsersMutation) SetPhoneNumberEncrypted(b []byte)

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*UsersMutation) SetPhoneNumberHash

func (m *UsersMutation) SetPhoneNumberHash(s string)

SetPhoneNumberHash sets the "phone_number_hash" field.

func (*UsersMutation) SetPhoneNumberVerified

func (m *UsersMutation) SetPhoneNumberVerified(b bool)

SetPhoneNumberVerified sets the "phone_number_verified" field.

func (*UsersMutation) SetPicture

func (m *UsersMutation) SetPicture(s string)

SetPicture sets the "picture" field.

func (*UsersMutation) SetProfile

func (m *UsersMutation) SetProfile(s string)

SetProfile sets the "profile" field.

func (*UsersMutation) SetRealnameEncrypted

func (m *UsersMutation) SetRealnameEncrypted(b []byte)

SetRealnameEncrypted sets the "realname_encrypted" field.

func (*UsersMutation) SetTimezone

func (m *UsersMutation) SetTimezone(s string)

SetTimezone sets the "timezone" field.

func (*UsersMutation) SetUpdatedAt

func (m *UsersMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UsersMutation) SetUpdatedBy

func (m *UsersMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*UsersMutation) SetUserStatus

func (m *UsersMutation) SetUserStatus(i int)

SetUserStatus sets the "user_status" field.

func (*UsersMutation) SetUserType

func (m *UsersMutation) SetUserType(i int)

SetUserType sets the "user_type" field.

func (*UsersMutation) SetUsername

func (m *UsersMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UsersMutation) SetWebsite

func (m *UsersMutation) SetWebsite(s string)

SetWebsite sets the "website" field.

func (*UsersMutation) Timezone

func (m *UsersMutation) Timezone() (r string, exists bool)

Timezone returns the value of the "timezone" field in the mutation.

func (*UsersMutation) TimezoneCleared

func (m *UsersMutation) TimezoneCleared() bool

TimezoneCleared returns if the "timezone" field was cleared in this mutation.

func (UsersMutation) Tx

func (m UsersMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UsersMutation) Type

func (m *UsersMutation) Type() string

Type returns the node type of this mutation (Users).

func (*UsersMutation) UpdatedAt

func (m *UsersMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UsersMutation) UpdatedBy

func (m *UsersMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UsersMutation) UpdatedByCleared

func (m *UsersMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UsersMutation) UserStatus

func (m *UsersMutation) UserStatus() (r int, exists bool)

UserStatus returns the value of the "user_status" field in the mutation.

func (*UsersMutation) UserType

func (m *UsersMutation) UserType() (r int, exists bool)

UserType returns the value of the "user_type" field in the mutation.

func (*UsersMutation) Username

func (m *UsersMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UsersMutation) Website

func (m *UsersMutation) Website() (r string, exists bool)

Website returns the value of the "website" field in the mutation.

func (*UsersMutation) WebsiteCleared

func (m *UsersMutation) WebsiteCleared() bool

WebsiteCleared returns if the "website" field was cleared in this mutation.

func (*UsersMutation) Where

func (m *UsersMutation) Where(ps ...predicate.Users)

Where appends a list predicates to the UsersMutation builder.

func (*UsersMutation) WhereP

func (m *UsersMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UsersMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UsersQuery

type UsersQuery struct {
	// contains filtered or unexported fields
}

UsersQuery is the builder for querying Users entities.

func (*UsersQuery) Aggregate

func (_q *UsersQuery) Aggregate(fns ...AggregateFunc) *UsersSelect

Aggregate returns a UsersSelect configured with the given aggregations.

func (*UsersQuery) All

func (_q *UsersQuery) All(ctx context.Context) ([]*Users, error)

All executes the query and returns a list of UsersSlice.

func (*UsersQuery) AllX

func (_q *UsersQuery) AllX(ctx context.Context) []*Users

AllX is like All, but panics if an error occurs.

func (*UsersQuery) Clone

func (_q *UsersQuery) Clone() *UsersQuery

Clone returns a duplicate of the UsersQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UsersQuery) Count

func (_q *UsersQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UsersQuery) CountX

func (_q *UsersQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UsersQuery) Exist

func (_q *UsersQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UsersQuery) ExistX

func (_q *UsersQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UsersQuery) First

func (_q *UsersQuery) First(ctx context.Context) (*Users, error)

First returns the first Users entity from the query. Returns a *NotFoundError when no Users was found.

func (*UsersQuery) FirstID

func (_q *UsersQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Users ID from the query. Returns a *NotFoundError when no Users ID was found.

func (*UsersQuery) FirstIDX

func (_q *UsersQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UsersQuery) FirstX

func (_q *UsersQuery) FirstX(ctx context.Context) *Users

FirstX is like First, but panics if an error occurs.

func (*UsersQuery) GroupBy

func (_q *UsersQuery) GroupBy(field string, fields ...string) *UsersGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Users.Query().
	GroupBy(users.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UsersQuery) IDs

func (_q *UsersQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Users IDs.

func (*UsersQuery) IDsX

func (_q *UsersQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UsersQuery) Limit

func (_q *UsersQuery) Limit(limit int) *UsersQuery

Limit the number of records to be returned by this query.

func (*UsersQuery) Offset

func (_q *UsersQuery) Offset(offset int) *UsersQuery

Offset to start from.

func (*UsersQuery) Only

func (_q *UsersQuery) Only(ctx context.Context) (*Users, error)

Only returns a single Users entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Users entity is found. Returns a *NotFoundError when no Users entities are found.

func (*UsersQuery) OnlyID

func (_q *UsersQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Users ID in the query. Returns a *NotSingularError when more than one Users ID is found. Returns a *NotFoundError when no entities are found.

func (*UsersQuery) OnlyIDX

func (_q *UsersQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UsersQuery) OnlyX

func (_q *UsersQuery) OnlyX(ctx context.Context) *Users

OnlyX is like Only, but panics if an error occurs.

func (*UsersQuery) Order

func (_q *UsersQuery) Order(o ...users.OrderOption) *UsersQuery

Order specifies how the records should be ordered.

func (*UsersQuery) QueryLionUserDepartments

func (_q *UsersQuery) QueryLionUserDepartments() *UserDepartmentsQuery

QueryLionUserDepartments chains the current query on the "lion_user_departments" edge.

func (*UsersQuery) QueryLionUserGroups

func (_q *UsersQuery) QueryLionUserGroups() *UserGroupsQuery

QueryLionUserGroups chains the current query on the "lion_user_groups" edge.

func (*UsersQuery) QueryLionUserIdentities

func (_q *UsersQuery) QueryLionUserIdentities() *UserIdentitiesQuery

QueryLionUserIdentities chains the current query on the "lion_user_identities" edge.

func (*UsersQuery) QueryLionUserRoles

func (_q *UsersQuery) QueryLionUserRoles() *UserRolesQuery

QueryLionUserRoles chains the current query on the "lion_user_roles" edge.

func (*UsersQuery) Select

func (_q *UsersQuery) Select(fields ...string) *UsersSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Users.Query().
	Select(users.FieldCreatedAt).
	Scan(ctx, &v)

func (*UsersQuery) Unique

func (_q *UsersQuery) Unique(unique bool) *UsersQuery

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 (*UsersQuery) Where

func (_q *UsersQuery) Where(ps ...predicate.Users) *UsersQuery

Where adds a new predicate for the UsersQuery builder.

func (*UsersQuery) WithLionUserDepartments

func (_q *UsersQuery) WithLionUserDepartments(opts ...func(*UserDepartmentsQuery)) *UsersQuery

WithLionUserDepartments tells the query-builder to eager-load the nodes that are connected to the "lion_user_departments" edge. The optional arguments are used to configure the query builder of the edge.

func (*UsersQuery) WithLionUserGroups

func (_q *UsersQuery) WithLionUserGroups(opts ...func(*UserGroupsQuery)) *UsersQuery

WithLionUserGroups tells the query-builder to eager-load the nodes that are connected to the "lion_user_groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*UsersQuery) WithLionUserIdentities

func (_q *UsersQuery) WithLionUserIdentities(opts ...func(*UserIdentitiesQuery)) *UsersQuery

WithLionUserIdentities tells the query-builder to eager-load the nodes that are connected to the "lion_user_identities" edge. The optional arguments are used to configure the query builder of the edge.

func (*UsersQuery) WithLionUserRoles

func (_q *UsersQuery) WithLionUserRoles(opts ...func(*UserRolesQuery)) *UsersQuery

WithLionUserRoles tells the query-builder to eager-load the nodes that are connected to the "lion_user_roles" edge. The optional arguments are used to configure the query builder of the edge.

type UsersSelect

type UsersSelect struct {
	*UsersQuery
	// contains filtered or unexported fields
}

UsersSelect is the builder for selecting fields of Users entities.

func (*UsersSelect) Aggregate

func (_s *UsersSelect) Aggregate(fns ...AggregateFunc) *UsersSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UsersSelect) Bool

func (s *UsersSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UsersSelect) BoolX

func (s *UsersSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UsersSelect) Bools

func (s *UsersSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UsersSelect) BoolsX

func (s *UsersSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UsersSelect) Float64

func (s *UsersSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UsersSelect) Float64X

func (s *UsersSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UsersSelect) Float64s

func (s *UsersSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UsersSelect) Float64sX

func (s *UsersSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UsersSelect) Int

func (s *UsersSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UsersSelect) IntX

func (s *UsersSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UsersSelect) Ints

func (s *UsersSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UsersSelect) IntsX

func (s *UsersSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UsersSelect) Scan

func (_s *UsersSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UsersSelect) ScanX

func (s *UsersSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UsersSelect) String

func (s *UsersSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UsersSelect) StringX

func (s *UsersSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UsersSelect) Strings

func (s *UsersSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UsersSelect) StringsX

func (s *UsersSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UsersSlice

type UsersSlice []*Users

UsersSlice is a parsable slice of Users.

type UsersUpdate

type UsersUpdate struct {
	// contains filtered or unexported fields
}

UsersUpdate is the builder for updating Users entities.

func (*UsersUpdate) AddCreatedBy

func (_u *UsersUpdate) AddCreatedBy(v int64) *UsersUpdate

AddCreatedBy adds value to the "created_by" field.

func (*UsersUpdate) AddGender

func (_u *UsersUpdate) AddGender(v int) *UsersUpdate

AddGender adds value to the "gender" field.

func (*UsersUpdate) AddLionUserDepartmentIDs

func (_u *UsersUpdate) AddLionUserDepartmentIDs(ids ...int) *UsersUpdate

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*UsersUpdate) AddLionUserDepartments

func (_u *UsersUpdate) AddLionUserDepartments(v ...*UserDepartments) *UsersUpdate

AddLionUserDepartments adds the "lion_user_departments" edges to the UserDepartments entity.

func (*UsersUpdate) AddLionUserGroupIDs

func (_u *UsersUpdate) AddLionUserGroupIDs(ids ...int) *UsersUpdate

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*UsersUpdate) AddLionUserGroups

func (_u *UsersUpdate) AddLionUserGroups(v ...*UserGroups) *UsersUpdate

AddLionUserGroups adds the "lion_user_groups" edges to the UserGroups entity.

func (*UsersUpdate) AddLionUserIdentities

func (_u *UsersUpdate) AddLionUserIdentities(v ...*UserIdentities) *UsersUpdate

AddLionUserIdentities adds the "lion_user_identities" edges to the UserIdentities entity.

func (*UsersUpdate) AddLionUserIdentityIDs

func (_u *UsersUpdate) AddLionUserIdentityIDs(ids ...int) *UsersUpdate

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*UsersUpdate) AddLionUserRoleIDs

func (_u *UsersUpdate) AddLionUserRoleIDs(ids ...int) *UsersUpdate

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*UsersUpdate) AddLionUserRoles

func (_u *UsersUpdate) AddLionUserRoles(v ...*UserRoles) *UsersUpdate

AddLionUserRoles adds the "lion_user_roles" edges to the UserRoles entity.

func (*UsersUpdate) AddUpdatedBy

func (_u *UsersUpdate) AddUpdatedBy(v int64) *UsersUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*UsersUpdate) AddUserStatus

func (_u *UsersUpdate) AddUserStatus(v int) *UsersUpdate

AddUserStatus adds value to the "user_status" field.

func (*UsersUpdate) AddUserType

func (_u *UsersUpdate) AddUserType(v int) *UsersUpdate

AddUserType adds value to the "user_type" field.

func (*UsersUpdate) ClearAddressEncrypted

func (_u *UsersUpdate) ClearAddressEncrypted() *UsersUpdate

ClearAddressEncrypted clears the value of the "address_encrypted" field.

func (*UsersUpdate) ClearBirthdate

func (_u *UsersUpdate) ClearBirthdate() *UsersUpdate

ClearBirthdate clears the value of the "birthdate" field.

func (*UsersUpdate) ClearCreatedBy

func (_u *UsersUpdate) ClearCreatedBy() *UsersUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*UsersUpdate) ClearDeletedAt

func (_u *UsersUpdate) ClearDeletedAt() *UsersUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsersUpdate) ClearDescription

func (_u *UsersUpdate) ClearDescription() *UsersUpdate

ClearDescription clears the value of the "description" field.

func (*UsersUpdate) ClearEmailEncrypted

func (_u *UsersUpdate) ClearEmailEncrypted() *UsersUpdate

ClearEmailEncrypted clears the value of the "email_encrypted" field.

func (*UsersUpdate) ClearEmailHash

func (_u *UsersUpdate) ClearEmailHash() *UsersUpdate

ClearEmailHash clears the value of the "email_hash" field.

func (*UsersUpdate) ClearLionUserDepartments

func (_u *UsersUpdate) ClearLionUserDepartments() *UsersUpdate

ClearLionUserDepartments clears all "lion_user_departments" edges to the UserDepartments entity.

func (*UsersUpdate) ClearLionUserGroups

func (_u *UsersUpdate) ClearLionUserGroups() *UsersUpdate

ClearLionUserGroups clears all "lion_user_groups" edges to the UserGroups entity.

func (*UsersUpdate) ClearLionUserIdentities

func (_u *UsersUpdate) ClearLionUserIdentities() *UsersUpdate

ClearLionUserIdentities clears all "lion_user_identities" edges to the UserIdentities entity.

func (*UsersUpdate) ClearLionUserRoles

func (_u *UsersUpdate) ClearLionUserRoles() *UsersUpdate

ClearLionUserRoles clears all "lion_user_roles" edges to the UserRoles entity.

func (*UsersUpdate) ClearLocale

func (_u *UsersUpdate) ClearLocale() *UsersUpdate

ClearLocale clears the value of the "locale" field.

func (*UsersUpdate) ClearMetadata

func (_u *UsersUpdate) ClearMetadata() *UsersUpdate

ClearMetadata clears the value of the "metadata" field.

func (*UsersUpdate) ClearNationalIDEncrypted

func (_u *UsersUpdate) ClearNationalIDEncrypted() *UsersUpdate

ClearNationalIDEncrypted clears the value of the "national_id_encrypted" field.

func (*UsersUpdate) ClearNationalIDHash

func (_u *UsersUpdate) ClearNationalIDHash() *UsersUpdate

ClearNationalIDHash clears the value of the "national_id_hash" field.

func (*UsersUpdate) ClearNickname

func (_u *UsersUpdate) ClearNickname() *UsersUpdate

ClearNickname clears the value of the "nickname" field.

func (*UsersUpdate) ClearPhoneNumberEncrypted

func (_u *UsersUpdate) ClearPhoneNumberEncrypted() *UsersUpdate

ClearPhoneNumberEncrypted clears the value of the "phone_number_encrypted" field.

func (*UsersUpdate) ClearPhoneNumberHash

func (_u *UsersUpdate) ClearPhoneNumberHash() *UsersUpdate

ClearPhoneNumberHash clears the value of the "phone_number_hash" field.

func (*UsersUpdate) ClearPicture

func (_u *UsersUpdate) ClearPicture() *UsersUpdate

ClearPicture clears the value of the "picture" field.

func (*UsersUpdate) ClearProfile

func (_u *UsersUpdate) ClearProfile() *UsersUpdate

ClearProfile clears the value of the "profile" field.

func (*UsersUpdate) ClearRealnameEncrypted

func (_u *UsersUpdate) ClearRealnameEncrypted() *UsersUpdate

ClearRealnameEncrypted clears the value of the "realname_encrypted" field.

func (*UsersUpdate) ClearTimezone

func (_u *UsersUpdate) ClearTimezone() *UsersUpdate

ClearTimezone clears the value of the "timezone" field.

func (*UsersUpdate) ClearUpdatedBy

func (_u *UsersUpdate) ClearUpdatedBy() *UsersUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UsersUpdate) ClearWebsite

func (_u *UsersUpdate) ClearWebsite() *UsersUpdate

ClearWebsite clears the value of the "website" field.

func (*UsersUpdate) Exec

func (_u *UsersUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UsersUpdate) ExecX

func (_u *UsersUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersUpdate) Mutation

func (_u *UsersUpdate) Mutation() *UsersMutation

Mutation returns the UsersMutation object of the builder.

func (*UsersUpdate) RemoveLionUserDepartmentIDs

func (_u *UsersUpdate) RemoveLionUserDepartmentIDs(ids ...int) *UsersUpdate

RemoveLionUserDepartmentIDs removes the "lion_user_departments" edge to UserDepartments entities by IDs.

func (*UsersUpdate) RemoveLionUserDepartments

func (_u *UsersUpdate) RemoveLionUserDepartments(v ...*UserDepartments) *UsersUpdate

RemoveLionUserDepartments removes "lion_user_departments" edges to UserDepartments entities.

func (*UsersUpdate) RemoveLionUserGroupIDs

func (_u *UsersUpdate) RemoveLionUserGroupIDs(ids ...int) *UsersUpdate

RemoveLionUserGroupIDs removes the "lion_user_groups" edge to UserGroups entities by IDs.

func (*UsersUpdate) RemoveLionUserGroups

func (_u *UsersUpdate) RemoveLionUserGroups(v ...*UserGroups) *UsersUpdate

RemoveLionUserGroups removes "lion_user_groups" edges to UserGroups entities.

func (*UsersUpdate) RemoveLionUserIdentities

func (_u *UsersUpdate) RemoveLionUserIdentities(v ...*UserIdentities) *UsersUpdate

RemoveLionUserIdentities removes "lion_user_identities" edges to UserIdentities entities.

func (*UsersUpdate) RemoveLionUserIdentityIDs

func (_u *UsersUpdate) RemoveLionUserIdentityIDs(ids ...int) *UsersUpdate

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to UserIdentities entities by IDs.

func (*UsersUpdate) RemoveLionUserRoleIDs

func (_u *UsersUpdate) RemoveLionUserRoleIDs(ids ...int) *UsersUpdate

RemoveLionUserRoleIDs removes the "lion_user_roles" edge to UserRoles entities by IDs.

func (*UsersUpdate) RemoveLionUserRoles

func (_u *UsersUpdate) RemoveLionUserRoles(v ...*UserRoles) *UsersUpdate

RemoveLionUserRoles removes "lion_user_roles" edges to UserRoles entities.

func (*UsersUpdate) Save

func (_u *UsersUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UsersUpdate) SaveX

func (_u *UsersUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UsersUpdate) SetAddressEncrypted

func (_u *UsersUpdate) SetAddressEncrypted(v []byte) *UsersUpdate

SetAddressEncrypted sets the "address_encrypted" field.

func (*UsersUpdate) SetBirthdate

func (_u *UsersUpdate) SetBirthdate(v time.Time) *UsersUpdate

SetBirthdate sets the "birthdate" field.

func (*UsersUpdate) SetCreatedBy

func (_u *UsersUpdate) SetCreatedBy(v int64) *UsersUpdate

SetCreatedBy sets the "created_by" field.

func (*UsersUpdate) SetDeletedAt

func (_u *UsersUpdate) SetDeletedAt(v time.Time) *UsersUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UsersUpdate) SetDescription

func (_u *UsersUpdate) SetDescription(v string) *UsersUpdate

SetDescription sets the "description" field.

func (*UsersUpdate) SetEmailEncrypted

func (_u *UsersUpdate) SetEmailEncrypted(v []byte) *UsersUpdate

SetEmailEncrypted sets the "email_encrypted" field.

func (*UsersUpdate) SetEmailHash

func (_u *UsersUpdate) SetEmailHash(v string) *UsersUpdate

SetEmailHash sets the "email_hash" field.

func (*UsersUpdate) SetEmailVerified

func (_u *UsersUpdate) SetEmailVerified(v bool) *UsersUpdate

SetEmailVerified sets the "email_verified" field.

func (*UsersUpdate) SetGender

func (_u *UsersUpdate) SetGender(v int) *UsersUpdate

SetGender sets the "gender" field.

func (*UsersUpdate) SetLocale

func (_u *UsersUpdate) SetLocale(v string) *UsersUpdate

SetLocale sets the "locale" field.

func (*UsersUpdate) SetMetadata

func (_u *UsersUpdate) SetMetadata(v map[string]string) *UsersUpdate

SetMetadata sets the "metadata" field.

func (*UsersUpdate) SetNationalIDEncrypted

func (_u *UsersUpdate) SetNationalIDEncrypted(v []byte) *UsersUpdate

SetNationalIDEncrypted sets the "national_id_encrypted" field.

func (*UsersUpdate) SetNationalIDHash

func (_u *UsersUpdate) SetNationalIDHash(v string) *UsersUpdate

SetNationalIDHash sets the "national_id_hash" field.

func (*UsersUpdate) SetNickname

func (_u *UsersUpdate) SetNickname(v string) *UsersUpdate

SetNickname sets the "nickname" field.

func (*UsersUpdate) SetNillableBirthdate

func (_u *UsersUpdate) SetNillableBirthdate(v *time.Time) *UsersUpdate

SetNillableBirthdate sets the "birthdate" field if the given value is not nil.

func (*UsersUpdate) SetNillableCreatedBy

func (_u *UsersUpdate) SetNillableCreatedBy(v *int64) *UsersUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UsersUpdate) SetNillableDeletedAt

func (_u *UsersUpdate) SetNillableDeletedAt(v *time.Time) *UsersUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UsersUpdate) SetNillableDescription

func (_u *UsersUpdate) SetNillableDescription(v *string) *UsersUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UsersUpdate) SetNillableEmailHash

func (_u *UsersUpdate) SetNillableEmailHash(v *string) *UsersUpdate

SetNillableEmailHash sets the "email_hash" field if the given value is not nil.

func (*UsersUpdate) SetNillableEmailVerified

func (_u *UsersUpdate) SetNillableEmailVerified(v *bool) *UsersUpdate

SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.

func (*UsersUpdate) SetNillableGender

func (_u *UsersUpdate) SetNillableGender(v *int) *UsersUpdate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UsersUpdate) SetNillableLocale

func (_u *UsersUpdate) SetNillableLocale(v *string) *UsersUpdate

SetNillableLocale sets the "locale" field if the given value is not nil.

func (*UsersUpdate) SetNillableNationalIDHash

func (_u *UsersUpdate) SetNillableNationalIDHash(v *string) *UsersUpdate

SetNillableNationalIDHash sets the "national_id_hash" field if the given value is not nil.

func (*UsersUpdate) SetNillableNickname

func (_u *UsersUpdate) SetNillableNickname(v *string) *UsersUpdate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UsersUpdate) SetNillablePhoneNumberHash

func (_u *UsersUpdate) SetNillablePhoneNumberHash(v *string) *UsersUpdate

SetNillablePhoneNumberHash sets the "phone_number_hash" field if the given value is not nil.

func (*UsersUpdate) SetNillablePhoneNumberVerified

func (_u *UsersUpdate) SetNillablePhoneNumberVerified(v *bool) *UsersUpdate

SetNillablePhoneNumberVerified sets the "phone_number_verified" field if the given value is not nil.

func (*UsersUpdate) SetNillablePicture

func (_u *UsersUpdate) SetNillablePicture(v *string) *UsersUpdate

SetNillablePicture sets the "picture" field if the given value is not nil.

func (*UsersUpdate) SetNillableProfile

func (_u *UsersUpdate) SetNillableProfile(v *string) *UsersUpdate

SetNillableProfile sets the "profile" field if the given value is not nil.

func (*UsersUpdate) SetNillableTimezone

func (_u *UsersUpdate) SetNillableTimezone(v *string) *UsersUpdate

SetNillableTimezone sets the "timezone" field if the given value is not nil.

func (*UsersUpdate) SetNillableUpdatedBy

func (_u *UsersUpdate) SetNillableUpdatedBy(v *int64) *UsersUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UsersUpdate) SetNillableUserStatus

func (_u *UsersUpdate) SetNillableUserStatus(v *int) *UsersUpdate

SetNillableUserStatus sets the "user_status" field if the given value is not nil.

func (*UsersUpdate) SetNillableUserType

func (_u *UsersUpdate) SetNillableUserType(v *int) *UsersUpdate

SetNillableUserType sets the "user_type" field if the given value is not nil.

func (*UsersUpdate) SetNillableUsername

func (_u *UsersUpdate) SetNillableUsername(v *string) *UsersUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UsersUpdate) SetNillableWebsite

func (_u *UsersUpdate) SetNillableWebsite(v *string) *UsersUpdate

SetNillableWebsite sets the "website" field if the given value is not nil.

func (*UsersUpdate) SetPhoneNumberEncrypted

func (_u *UsersUpdate) SetPhoneNumberEncrypted(v []byte) *UsersUpdate

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*UsersUpdate) SetPhoneNumberHash

func (_u *UsersUpdate) SetPhoneNumberHash(v string) *UsersUpdate

SetPhoneNumberHash sets the "phone_number_hash" field.

func (*UsersUpdate) SetPhoneNumberVerified

func (_u *UsersUpdate) SetPhoneNumberVerified(v bool) *UsersUpdate

SetPhoneNumberVerified sets the "phone_number_verified" field.

func (*UsersUpdate) SetPicture

func (_u *UsersUpdate) SetPicture(v string) *UsersUpdate

SetPicture sets the "picture" field.

func (*UsersUpdate) SetProfile

func (_u *UsersUpdate) SetProfile(v string) *UsersUpdate

SetProfile sets the "profile" field.

func (*UsersUpdate) SetRealnameEncrypted

func (_u *UsersUpdate) SetRealnameEncrypted(v []byte) *UsersUpdate

SetRealnameEncrypted sets the "realname_encrypted" field.

func (*UsersUpdate) SetTimezone

func (_u *UsersUpdate) SetTimezone(v string) *UsersUpdate

SetTimezone sets the "timezone" field.

func (*UsersUpdate) SetUpdatedAt

func (_u *UsersUpdate) SetUpdatedAt(v time.Time) *UsersUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UsersUpdate) SetUpdatedBy

func (_u *UsersUpdate) SetUpdatedBy(v int64) *UsersUpdate

SetUpdatedBy sets the "updated_by" field.

func (*UsersUpdate) SetUserStatus

func (_u *UsersUpdate) SetUserStatus(v int) *UsersUpdate

SetUserStatus sets the "user_status" field.

func (*UsersUpdate) SetUserType

func (_u *UsersUpdate) SetUserType(v int) *UsersUpdate

SetUserType sets the "user_type" field.

func (*UsersUpdate) SetUsername

func (_u *UsersUpdate) SetUsername(v string) *UsersUpdate

SetUsername sets the "username" field.

func (*UsersUpdate) SetWebsite

func (_u *UsersUpdate) SetWebsite(v string) *UsersUpdate

SetWebsite sets the "website" field.

func (*UsersUpdate) Where

func (_u *UsersUpdate) Where(ps ...predicate.Users) *UsersUpdate

Where appends a list predicates to the UsersUpdate builder.

type UsersUpdateOne

type UsersUpdateOne struct {
	// contains filtered or unexported fields
}

UsersUpdateOne is the builder for updating a single Users entity.

func (*UsersUpdateOne) AddCreatedBy

func (_u *UsersUpdateOne) AddCreatedBy(v int64) *UsersUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*UsersUpdateOne) AddGender

func (_u *UsersUpdateOne) AddGender(v int) *UsersUpdateOne

AddGender adds value to the "gender" field.

func (*UsersUpdateOne) AddLionUserDepartmentIDs

func (_u *UsersUpdateOne) AddLionUserDepartmentIDs(ids ...int) *UsersUpdateOne

AddLionUserDepartmentIDs adds the "lion_user_departments" edge to the UserDepartments entity by IDs.

func (*UsersUpdateOne) AddLionUserDepartments

func (_u *UsersUpdateOne) AddLionUserDepartments(v ...*UserDepartments) *UsersUpdateOne

AddLionUserDepartments adds the "lion_user_departments" edges to the UserDepartments entity.

func (*UsersUpdateOne) AddLionUserGroupIDs

func (_u *UsersUpdateOne) AddLionUserGroupIDs(ids ...int) *UsersUpdateOne

AddLionUserGroupIDs adds the "lion_user_groups" edge to the UserGroups entity by IDs.

func (*UsersUpdateOne) AddLionUserGroups

func (_u *UsersUpdateOne) AddLionUserGroups(v ...*UserGroups) *UsersUpdateOne

AddLionUserGroups adds the "lion_user_groups" edges to the UserGroups entity.

func (*UsersUpdateOne) AddLionUserIdentities

func (_u *UsersUpdateOne) AddLionUserIdentities(v ...*UserIdentities) *UsersUpdateOne

AddLionUserIdentities adds the "lion_user_identities" edges to the UserIdentities entity.

func (*UsersUpdateOne) AddLionUserIdentityIDs

func (_u *UsersUpdateOne) AddLionUserIdentityIDs(ids ...int) *UsersUpdateOne

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*UsersUpdateOne) AddLionUserRoleIDs

func (_u *UsersUpdateOne) AddLionUserRoleIDs(ids ...int) *UsersUpdateOne

AddLionUserRoleIDs adds the "lion_user_roles" edge to the UserRoles entity by IDs.

func (*UsersUpdateOne) AddLionUserRoles

func (_u *UsersUpdateOne) AddLionUserRoles(v ...*UserRoles) *UsersUpdateOne

AddLionUserRoles adds the "lion_user_roles" edges to the UserRoles entity.

func (*UsersUpdateOne) AddUpdatedBy

func (_u *UsersUpdateOne) AddUpdatedBy(v int64) *UsersUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*UsersUpdateOne) AddUserStatus

func (_u *UsersUpdateOne) AddUserStatus(v int) *UsersUpdateOne

AddUserStatus adds value to the "user_status" field.

func (*UsersUpdateOne) AddUserType

func (_u *UsersUpdateOne) AddUserType(v int) *UsersUpdateOne

AddUserType adds value to the "user_type" field.

func (*UsersUpdateOne) ClearAddressEncrypted

func (_u *UsersUpdateOne) ClearAddressEncrypted() *UsersUpdateOne

ClearAddressEncrypted clears the value of the "address_encrypted" field.

func (*UsersUpdateOne) ClearBirthdate

func (_u *UsersUpdateOne) ClearBirthdate() *UsersUpdateOne

ClearBirthdate clears the value of the "birthdate" field.

func (*UsersUpdateOne) ClearCreatedBy

func (_u *UsersUpdateOne) ClearCreatedBy() *UsersUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*UsersUpdateOne) ClearDeletedAt

func (_u *UsersUpdateOne) ClearDeletedAt() *UsersUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UsersUpdateOne) ClearDescription

func (_u *UsersUpdateOne) ClearDescription() *UsersUpdateOne

ClearDescription clears the value of the "description" field.

func (*UsersUpdateOne) ClearEmailEncrypted

func (_u *UsersUpdateOne) ClearEmailEncrypted() *UsersUpdateOne

ClearEmailEncrypted clears the value of the "email_encrypted" field.

func (*UsersUpdateOne) ClearEmailHash

func (_u *UsersUpdateOne) ClearEmailHash() *UsersUpdateOne

ClearEmailHash clears the value of the "email_hash" field.

func (*UsersUpdateOne) ClearLionUserDepartments

func (_u *UsersUpdateOne) ClearLionUserDepartments() *UsersUpdateOne

ClearLionUserDepartments clears all "lion_user_departments" edges to the UserDepartments entity.

func (*UsersUpdateOne) ClearLionUserGroups

func (_u *UsersUpdateOne) ClearLionUserGroups() *UsersUpdateOne

ClearLionUserGroups clears all "lion_user_groups" edges to the UserGroups entity.

func (*UsersUpdateOne) ClearLionUserIdentities

func (_u *UsersUpdateOne) ClearLionUserIdentities() *UsersUpdateOne

ClearLionUserIdentities clears all "lion_user_identities" edges to the UserIdentities entity.

func (*UsersUpdateOne) ClearLionUserRoles

func (_u *UsersUpdateOne) ClearLionUserRoles() *UsersUpdateOne

ClearLionUserRoles clears all "lion_user_roles" edges to the UserRoles entity.

func (*UsersUpdateOne) ClearLocale

func (_u *UsersUpdateOne) ClearLocale() *UsersUpdateOne

ClearLocale clears the value of the "locale" field.

func (*UsersUpdateOne) ClearMetadata

func (_u *UsersUpdateOne) ClearMetadata() *UsersUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*UsersUpdateOne) ClearNationalIDEncrypted

func (_u *UsersUpdateOne) ClearNationalIDEncrypted() *UsersUpdateOne

ClearNationalIDEncrypted clears the value of the "national_id_encrypted" field.

func (*UsersUpdateOne) ClearNationalIDHash

func (_u *UsersUpdateOne) ClearNationalIDHash() *UsersUpdateOne

ClearNationalIDHash clears the value of the "national_id_hash" field.

func (*UsersUpdateOne) ClearNickname

func (_u *UsersUpdateOne) ClearNickname() *UsersUpdateOne

ClearNickname clears the value of the "nickname" field.

func (*UsersUpdateOne) ClearPhoneNumberEncrypted

func (_u *UsersUpdateOne) ClearPhoneNumberEncrypted() *UsersUpdateOne

ClearPhoneNumberEncrypted clears the value of the "phone_number_encrypted" field.

func (*UsersUpdateOne) ClearPhoneNumberHash

func (_u *UsersUpdateOne) ClearPhoneNumberHash() *UsersUpdateOne

ClearPhoneNumberHash clears the value of the "phone_number_hash" field.

func (*UsersUpdateOne) ClearPicture

func (_u *UsersUpdateOne) ClearPicture() *UsersUpdateOne

ClearPicture clears the value of the "picture" field.

func (*UsersUpdateOne) ClearProfile

func (_u *UsersUpdateOne) ClearProfile() *UsersUpdateOne

ClearProfile clears the value of the "profile" field.

func (*UsersUpdateOne) ClearRealnameEncrypted

func (_u *UsersUpdateOne) ClearRealnameEncrypted() *UsersUpdateOne

ClearRealnameEncrypted clears the value of the "realname_encrypted" field.

func (*UsersUpdateOne) ClearTimezone

func (_u *UsersUpdateOne) ClearTimezone() *UsersUpdateOne

ClearTimezone clears the value of the "timezone" field.

func (*UsersUpdateOne) ClearUpdatedBy

func (_u *UsersUpdateOne) ClearUpdatedBy() *UsersUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UsersUpdateOne) ClearWebsite

func (_u *UsersUpdateOne) ClearWebsite() *UsersUpdateOne

ClearWebsite clears the value of the "website" field.

func (*UsersUpdateOne) Exec

func (_u *UsersUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UsersUpdateOne) ExecX

func (_u *UsersUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersUpdateOne) Mutation

func (_u *UsersUpdateOne) Mutation() *UsersMutation

Mutation returns the UsersMutation object of the builder.

func (*UsersUpdateOne) RemoveLionUserDepartmentIDs

func (_u *UsersUpdateOne) RemoveLionUserDepartmentIDs(ids ...int) *UsersUpdateOne

RemoveLionUserDepartmentIDs removes the "lion_user_departments" edge to UserDepartments entities by IDs.

func (*UsersUpdateOne) RemoveLionUserDepartments

func (_u *UsersUpdateOne) RemoveLionUserDepartments(v ...*UserDepartments) *UsersUpdateOne

RemoveLionUserDepartments removes "lion_user_departments" edges to UserDepartments entities.

func (*UsersUpdateOne) RemoveLionUserGroupIDs

func (_u *UsersUpdateOne) RemoveLionUserGroupIDs(ids ...int) *UsersUpdateOne

RemoveLionUserGroupIDs removes the "lion_user_groups" edge to UserGroups entities by IDs.

func (*UsersUpdateOne) RemoveLionUserGroups

func (_u *UsersUpdateOne) RemoveLionUserGroups(v ...*UserGroups) *UsersUpdateOne

RemoveLionUserGroups removes "lion_user_groups" edges to UserGroups entities.

func (*UsersUpdateOne) RemoveLionUserIdentities

func (_u *UsersUpdateOne) RemoveLionUserIdentities(v ...*UserIdentities) *UsersUpdateOne

RemoveLionUserIdentities removes "lion_user_identities" edges to UserIdentities entities.

func (*UsersUpdateOne) RemoveLionUserIdentityIDs

func (_u *UsersUpdateOne) RemoveLionUserIdentityIDs(ids ...int) *UsersUpdateOne

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to UserIdentities entities by IDs.

func (*UsersUpdateOne) RemoveLionUserRoleIDs

func (_u *UsersUpdateOne) RemoveLionUserRoleIDs(ids ...int) *UsersUpdateOne

RemoveLionUserRoleIDs removes the "lion_user_roles" edge to UserRoles entities by IDs.

func (*UsersUpdateOne) RemoveLionUserRoles

func (_u *UsersUpdateOne) RemoveLionUserRoles(v ...*UserRoles) *UsersUpdateOne

RemoveLionUserRoles removes "lion_user_roles" edges to UserRoles entities.

func (*UsersUpdateOne) Save

func (_u *UsersUpdateOne) Save(ctx context.Context) (*Users, error)

Save executes the query and returns the updated Users entity.

func (*UsersUpdateOne) SaveX

func (_u *UsersUpdateOne) SaveX(ctx context.Context) *Users

SaveX is like Save, but panics if an error occurs.

func (*UsersUpdateOne) Select

func (_u *UsersUpdateOne) Select(field string, fields ...string) *UsersUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UsersUpdateOne) SetAddressEncrypted

func (_u *UsersUpdateOne) SetAddressEncrypted(v []byte) *UsersUpdateOne

SetAddressEncrypted sets the "address_encrypted" field.

func (*UsersUpdateOne) SetBirthdate

func (_u *UsersUpdateOne) SetBirthdate(v time.Time) *UsersUpdateOne

SetBirthdate sets the "birthdate" field.

func (*UsersUpdateOne) SetCreatedBy

func (_u *UsersUpdateOne) SetCreatedBy(v int64) *UsersUpdateOne

SetCreatedBy sets the "created_by" field.

func (*UsersUpdateOne) SetDeletedAt

func (_u *UsersUpdateOne) SetDeletedAt(v time.Time) *UsersUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*UsersUpdateOne) SetDescription

func (_u *UsersUpdateOne) SetDescription(v string) *UsersUpdateOne

SetDescription sets the "description" field.

func (*UsersUpdateOne) SetEmailEncrypted

func (_u *UsersUpdateOne) SetEmailEncrypted(v []byte) *UsersUpdateOne

SetEmailEncrypted sets the "email_encrypted" field.

func (*UsersUpdateOne) SetEmailHash

func (_u *UsersUpdateOne) SetEmailHash(v string) *UsersUpdateOne

SetEmailHash sets the "email_hash" field.

func (*UsersUpdateOne) SetEmailVerified

func (_u *UsersUpdateOne) SetEmailVerified(v bool) *UsersUpdateOne

SetEmailVerified sets the "email_verified" field.

func (*UsersUpdateOne) SetGender

func (_u *UsersUpdateOne) SetGender(v int) *UsersUpdateOne

SetGender sets the "gender" field.

func (*UsersUpdateOne) SetLocale

func (_u *UsersUpdateOne) SetLocale(v string) *UsersUpdateOne

SetLocale sets the "locale" field.

func (*UsersUpdateOne) SetMetadata

func (_u *UsersUpdateOne) SetMetadata(v map[string]string) *UsersUpdateOne

SetMetadata sets the "metadata" field.

func (*UsersUpdateOne) SetNationalIDEncrypted

func (_u *UsersUpdateOne) SetNationalIDEncrypted(v []byte) *UsersUpdateOne

SetNationalIDEncrypted sets the "national_id_encrypted" field.

func (*UsersUpdateOne) SetNationalIDHash

func (_u *UsersUpdateOne) SetNationalIDHash(v string) *UsersUpdateOne

SetNationalIDHash sets the "national_id_hash" field.

func (*UsersUpdateOne) SetNickname

func (_u *UsersUpdateOne) SetNickname(v string) *UsersUpdateOne

SetNickname sets the "nickname" field.

func (*UsersUpdateOne) SetNillableBirthdate

func (_u *UsersUpdateOne) SetNillableBirthdate(v *time.Time) *UsersUpdateOne

SetNillableBirthdate sets the "birthdate" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableCreatedBy

func (_u *UsersUpdateOne) SetNillableCreatedBy(v *int64) *UsersUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableDeletedAt

func (_u *UsersUpdateOne) SetNillableDeletedAt(v *time.Time) *UsersUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableDescription

func (_u *UsersUpdateOne) SetNillableDescription(v *string) *UsersUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableEmailHash

func (_u *UsersUpdateOne) SetNillableEmailHash(v *string) *UsersUpdateOne

SetNillableEmailHash sets the "email_hash" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableEmailVerified

func (_u *UsersUpdateOne) SetNillableEmailVerified(v *bool) *UsersUpdateOne

SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableGender

func (_u *UsersUpdateOne) SetNillableGender(v *int) *UsersUpdateOne

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableLocale

func (_u *UsersUpdateOne) SetNillableLocale(v *string) *UsersUpdateOne

SetNillableLocale sets the "locale" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableNationalIDHash

func (_u *UsersUpdateOne) SetNillableNationalIDHash(v *string) *UsersUpdateOne

SetNillableNationalIDHash sets the "national_id_hash" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableNickname

func (_u *UsersUpdateOne) SetNillableNickname(v *string) *UsersUpdateOne

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UsersUpdateOne) SetNillablePhoneNumberHash

func (_u *UsersUpdateOne) SetNillablePhoneNumberHash(v *string) *UsersUpdateOne

SetNillablePhoneNumberHash sets the "phone_number_hash" field if the given value is not nil.

func (*UsersUpdateOne) SetNillablePhoneNumberVerified

func (_u *UsersUpdateOne) SetNillablePhoneNumberVerified(v *bool) *UsersUpdateOne

SetNillablePhoneNumberVerified sets the "phone_number_verified" field if the given value is not nil.

func (*UsersUpdateOne) SetNillablePicture

func (_u *UsersUpdateOne) SetNillablePicture(v *string) *UsersUpdateOne

SetNillablePicture sets the "picture" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableProfile

func (_u *UsersUpdateOne) SetNillableProfile(v *string) *UsersUpdateOne

SetNillableProfile sets the "profile" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableTimezone

func (_u *UsersUpdateOne) SetNillableTimezone(v *string) *UsersUpdateOne

SetNillableTimezone sets the "timezone" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableUpdatedBy

func (_u *UsersUpdateOne) SetNillableUpdatedBy(v *int64) *UsersUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableUserStatus

func (_u *UsersUpdateOne) SetNillableUserStatus(v *int) *UsersUpdateOne

SetNillableUserStatus sets the "user_status" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableUserType

func (_u *UsersUpdateOne) SetNillableUserType(v *int) *UsersUpdateOne

SetNillableUserType sets the "user_type" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableUsername

func (_u *UsersUpdateOne) SetNillableUsername(v *string) *UsersUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableWebsite

func (_u *UsersUpdateOne) SetNillableWebsite(v *string) *UsersUpdateOne

SetNillableWebsite sets the "website" field if the given value is not nil.

func (*UsersUpdateOne) SetPhoneNumberEncrypted

func (_u *UsersUpdateOne) SetPhoneNumberEncrypted(v []byte) *UsersUpdateOne

SetPhoneNumberEncrypted sets the "phone_number_encrypted" field.

func (*UsersUpdateOne) SetPhoneNumberHash

func (_u *UsersUpdateOne) SetPhoneNumberHash(v string) *UsersUpdateOne

SetPhoneNumberHash sets the "phone_number_hash" field.

func (*UsersUpdateOne) SetPhoneNumberVerified

func (_u *UsersUpdateOne) SetPhoneNumberVerified(v bool) *UsersUpdateOne

SetPhoneNumberVerified sets the "phone_number_verified" field.

func (*UsersUpdateOne) SetPicture

func (_u *UsersUpdateOne) SetPicture(v string) *UsersUpdateOne

SetPicture sets the "picture" field.

func (*UsersUpdateOne) SetProfile

func (_u *UsersUpdateOne) SetProfile(v string) *UsersUpdateOne

SetProfile sets the "profile" field.

func (*UsersUpdateOne) SetRealnameEncrypted

func (_u *UsersUpdateOne) SetRealnameEncrypted(v []byte) *UsersUpdateOne

SetRealnameEncrypted sets the "realname_encrypted" field.

func (*UsersUpdateOne) SetTimezone

func (_u *UsersUpdateOne) SetTimezone(v string) *UsersUpdateOne

SetTimezone sets the "timezone" field.

func (*UsersUpdateOne) SetUpdatedAt

func (_u *UsersUpdateOne) SetUpdatedAt(v time.Time) *UsersUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UsersUpdateOne) SetUpdatedBy

func (_u *UsersUpdateOne) SetUpdatedBy(v int64) *UsersUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*UsersUpdateOne) SetUserStatus

func (_u *UsersUpdateOne) SetUserStatus(v int) *UsersUpdateOne

SetUserStatus sets the "user_status" field.

func (*UsersUpdateOne) SetUserType

func (_u *UsersUpdateOne) SetUserType(v int) *UsersUpdateOne

SetUserType sets the "user_type" field.

func (*UsersUpdateOne) SetUsername

func (_u *UsersUpdateOne) SetUsername(v string) *UsersUpdateOne

SetUsername sets the "username" field.

func (*UsersUpdateOne) SetWebsite

func (_u *UsersUpdateOne) SetWebsite(v string) *UsersUpdateOne

SetWebsite sets the "website" field.

func (*UsersUpdateOne) Where

func (_u *UsersUpdateOne) Where(ps ...predicate.Users) *UsersUpdateOne

Where appends a list predicates to the UsersUpdate builder.

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