lion

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 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"
	TypeDepartments     = "Departments"
	TypeGlobalSettings  = "GlobalSettings"
	TypeGroups          = "Groups"
	TypeMenus           = "Menus"
	TypeOAuth2Clients   = "OAuth2Clients"
	TypeOAuth2Codes     = "OAuth2Codes"
	TypePolicies        = "Policies"
	TypePrincipalRoles  = "PrincipalRoles"
	TypeRoleMenus       = "RoleMenus"
	TypeRolePolicies    = "RolePolicies"
	TypeRoles           = "Roles"
	TypeUserIdentities  = "UserIdentities"
	TypeUserMemberships = "UserMemberships"
	TypeUserProfiles    = "UserProfiles"
	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"`
	// 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"`
	// 系统标识符,创建后不可修改
	Code string `json:"code,omitempty"`
	// 提供商类型: 0=未指定, 1=LOCAL, 2=LDAP, 3=OIDC, 4=OAUTH2, 5=GITHUB, 6=GOOGLE, 7=WECHAT
	ProviderType int `json:"provider_type,omitempty"`
	// 提供商状态: 0=未指定, 1=启用, 2=禁用, 3=待配置
	ProviderStatus int `json:"provider_status,omitempty"`
	// 展示名称,用于登录界面等用户可见场景
	DisplayName string `json:"display_name,omitempty"`
	// 提供商描述信息
	Description string `json:"description,omitempty"`
	// 排序权重,数值越小排序越靠前,默认 100,范围 1-9999
	SortOrder int `json:"sort_order,omitempty"`
	// 提供商图标地址
	IconURL string `json:"icon_url,omitempty"`
	// 类型特有的非敏感配置,JSON 格式,根据 provider_type 解析为对应结构
	Config json.RawMessage `json:"config,omitempty"`
	// 加密存储的敏感凭证:LDAP 为 bind_password,OAuth2 系为 client_secret
	SecretEncrypted []byte `json:"-"`
	// 是否为保护资源,保护资源不能被删除,描述等可更改
	Protected bool `json:"protected,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) SetCode

SetCode sets the "code" field.

func (*AuthProvidersCreate) SetConfig

SetConfig sets the "config" 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) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AuthProvidersCreate) SetDescription

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

SetDescription sets the "description" field.

func (*AuthProvidersCreate) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*AuthProvidersCreate) SetIconURL

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

SetIconURL sets the "icon_url" field.

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

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

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableDescription

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

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

func (*AuthProvidersCreate) SetNillableDisplayName

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

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableIconURL

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

SetNillableIconURL sets the "icon_url" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableProtected

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

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableProviderStatus

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

SetNillableProviderStatus sets the "provider_status" field if the given value is not nil.

func (*AuthProvidersCreate) SetNillableSortOrder

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

SetNillableSortOrder sets the "sort_order" 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) SetProtected

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

SetProtected sets the "protected" field.

func (*AuthProvidersCreate) SetProviderStatus

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

SetProviderStatus sets the "provider_status" field.

func (*AuthProvidersCreate) SetProviderType

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

SetProviderType sets the "provider_type" field.

func (*AuthProvidersCreate) SetSecretEncrypted

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

SetSecretEncrypted sets the "secret_encrypted" field.

func (*AuthProvidersCreate) SetSortOrder

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

SetSortOrder sets the "sort_order" 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.

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

func (m *AuthProvidersMutation) AddProviderStatus(i int)

AddProviderStatus adds i to the "provider_status" field.

func (*AuthProvidersMutation) AddProviderType

func (m *AuthProvidersMutation) AddProviderType(i int)

AddProviderType adds i to the "provider_type" field.

func (*AuthProvidersMutation) AddSortOrder

func (m *AuthProvidersMutation) AddSortOrder(i int)

AddSortOrder adds i to the "sort_order" 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) AddedProviderStatus

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

AddedProviderStatus returns the value that was added to the "provider_status" field 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) AddedSortOrder

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

AddedSortOrder returns the value that was added to the "sort_order" 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) AppendConfig

func (m *AuthProvidersMutation) AppendConfig(jm json.RawMessage)

AppendConfig adds jm to the "config" field.

func (*AuthProvidersMutation) AppendedConfig

func (m *AuthProvidersMutation) AppendedConfig() (json.RawMessage, bool)

AppendedConfig returns the list of values that were appended to the "config" field in this mutation.

func (*AuthProvidersMutation) ClearConfig

func (m *AuthProvidersMutation) ClearConfig()

ClearConfig clears the value of the "config" field.

func (*AuthProvidersMutation) ClearCreatedBy

func (m *AuthProvidersMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*AuthProvidersMutation) ClearDeletedAt

func (m *AuthProvidersMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" 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) ClearSecretEncrypted

func (m *AuthProvidersMutation) ClearSecretEncrypted()

ClearSecretEncrypted clears the value of the "secret_encrypted" field.

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

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

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

func (*AuthProvidersMutation) Config

func (m *AuthProvidersMutation) Config() (r json.RawMessage, exists bool)

Config returns the value of the "config" field in the mutation.

func (*AuthProvidersMutation) ConfigCleared

func (m *AuthProvidersMutation) ConfigCleared() bool

ConfigCleared returns if the "config" field was cleared in this 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) DeletedAt

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

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*AuthProvidersMutation) DeletedAtCleared

func (m *AuthProvidersMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*AuthProvidersMutation) Description

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

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

func (*AuthProvidersMutation) DisplayName

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

DisplayName returns the value of the "display_name" field in the 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) 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) IconURL

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

IconURL returns the value of the "icon_url" 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) OldCode

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

OldCode returns the old "code" 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) OldConfig

func (m *AuthProvidersMutation) OldConfig(ctx context.Context) (v json.RawMessage, err error)

OldConfig returns the old "config" 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) OldDeletedAt

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

OldDeletedAt returns the old "deleted_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) OldDescription

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

OldDescription returns the old "description" 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) OldDisplayName

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

OldDisplayName returns the old "display_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) 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) OldIconURL

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

OldIconURL returns the old "icon_url" 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) OldProtected

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

OldProtected returns the old "protected" 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) OldProviderStatus

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

OldProviderStatus returns the old "provider_status" 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) OldSecretEncrypted

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

OldSecretEncrypted returns the old "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) OldSortOrder

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

OldSortOrder returns the old "sort_order" 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) Op

func (m *AuthProvidersMutation) Op() Op

Op returns the operation name.

func (*AuthProvidersMutation) Protected

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

Protected returns the value of the "protected" field in the mutation.

func (*AuthProvidersMutation) ProviderStatus

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

ProviderStatus returns the value of the "provider_status" field in the mutation.

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

func (m *AuthProvidersMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*AuthProvidersMutation) ResetConfig

func (m *AuthProvidersMutation) ResetConfig()

ResetConfig resets all changes to the "config" 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) ResetDeletedAt

func (m *AuthProvidersMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*AuthProvidersMutation) ResetDescription

func (m *AuthProvidersMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AuthProvidersMutation) ResetDisplayName

func (m *AuthProvidersMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) 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) ResetIconURL

func (m *AuthProvidersMutation) ResetIconURL()

ResetIconURL resets all changes to the "icon_url" field.

func (*AuthProvidersMutation) ResetLionUserIdentities

func (m *AuthProvidersMutation) ResetLionUserIdentities()

ResetLionUserIdentities resets all changes to the "lion_user_identities" edge.

func (*AuthProvidersMutation) ResetProtected

func (m *AuthProvidersMutation) ResetProtected()

ResetProtected resets all changes to the "protected" field.

func (*AuthProvidersMutation) ResetProviderStatus

func (m *AuthProvidersMutation) ResetProviderStatus()

ResetProviderStatus resets all changes to the "provider_status" field.

func (*AuthProvidersMutation) ResetProviderType

func (m *AuthProvidersMutation) ResetProviderType()

ResetProviderType resets all changes to the "provider_type" field.

func (*AuthProvidersMutation) ResetSecretEncrypted

func (m *AuthProvidersMutation) ResetSecretEncrypted()

ResetSecretEncrypted resets all changes to the "secret_encrypted" field.

func (*AuthProvidersMutation) ResetSortOrder

func (m *AuthProvidersMutation) ResetSortOrder()

ResetSortOrder resets all changes to the "sort_order" 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) SecretEncrypted

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

SecretEncrypted returns the value of the "secret_encrypted" field in the mutation.

func (*AuthProvidersMutation) SecretEncryptedCleared

func (m *AuthProvidersMutation) SecretEncryptedCleared() bool

SecretEncryptedCleared returns if the "secret_encrypted" field was cleared in this mutation.

func (*AuthProvidersMutation) SetCode

func (m *AuthProvidersMutation) SetCode(s string)

SetCode sets the "code" field.

func (*AuthProvidersMutation) SetConfig

func (m *AuthProvidersMutation) SetConfig(jm json.RawMessage)

SetConfig sets the "config" 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) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AuthProvidersMutation) SetDescription

func (m *AuthProvidersMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AuthProvidersMutation) SetDisplayName

func (m *AuthProvidersMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) SetIconURL

func (m *AuthProvidersMutation) SetIconURL(s string)

SetIconURL sets the "icon_url" field.

func (*AuthProvidersMutation) SetOp

func (m *AuthProvidersMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthProvidersMutation) SetProtected

func (m *AuthProvidersMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

func (*AuthProvidersMutation) SetProviderStatus

func (m *AuthProvidersMutation) SetProviderStatus(i int)

SetProviderStatus sets the "provider_status" field.

func (*AuthProvidersMutation) SetProviderType

func (m *AuthProvidersMutation) SetProviderType(i int)

SetProviderType sets the "provider_type" field.

func (*AuthProvidersMutation) SetSecretEncrypted

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

SetSecretEncrypted sets the "secret_encrypted" field.

func (*AuthProvidersMutation) SetSortOrder

func (m *AuthProvidersMutation) SetSortOrder(i int)

SetSortOrder sets the "sort_order" 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) SortOrder

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

SortOrder returns the value of the "sort_order" 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) 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) AddProviderStatus

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

AddProviderStatus adds value to the "provider_status" field.

func (*AuthProvidersUpdate) AddProviderType

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

AddProviderType adds value to the "provider_type" field.

func (*AuthProvidersUpdate) AddSortOrder

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

AddSortOrder adds value to the "sort_order" field.

func (*AuthProvidersUpdate) AddUpdatedBy

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

AddUpdatedBy adds value to the "updated_by" field.

func (*AuthProvidersUpdate) AppendConfig

AppendConfig appends value to the "config" field.

func (*AuthProvidersUpdate) ClearConfig

func (_u *AuthProvidersUpdate) ClearConfig() *AuthProvidersUpdate

ClearConfig clears the value of the "config" field.

func (*AuthProvidersUpdate) ClearCreatedBy

func (_u *AuthProvidersUpdate) ClearCreatedBy() *AuthProvidersUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*AuthProvidersUpdate) ClearDeletedAt

func (_u *AuthProvidersUpdate) ClearDeletedAt() *AuthProvidersUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AuthProvidersUpdate) ClearLionUserIdentities

func (_u *AuthProvidersUpdate) ClearLionUserIdentities() *AuthProvidersUpdate

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

func (*AuthProvidersUpdate) ClearSecretEncrypted

func (_u *AuthProvidersUpdate) ClearSecretEncrypted() *AuthProvidersUpdate

ClearSecretEncrypted clears the value of the "secret_encrypted" field.

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

SetCode sets the "code" field.

func (*AuthProvidersUpdate) SetConfig

SetConfig sets the "config" field.

func (*AuthProvidersUpdate) SetCreatedBy

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

SetCreatedBy sets the "created_by" field.

func (*AuthProvidersUpdate) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AuthProvidersUpdate) SetDescription

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

SetDescription sets the "description" field.

func (*AuthProvidersUpdate) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*AuthProvidersUpdate) SetIconURL

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

SetIconURL sets the "icon_url" field.

func (*AuthProvidersUpdate) SetNillableCode

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

SetNillableCode sets the "code" 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) SetNillableDeletedAt

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

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableDescription

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

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

func (*AuthProvidersUpdate) SetNillableDisplayName

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

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableIconURL

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

SetNillableIconURL sets the "icon_url" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableProtected

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

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*AuthProvidersUpdate) SetNillableProviderStatus

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

SetNillableProviderStatus sets the "provider_status" 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) SetNillableSortOrder

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

SetNillableSortOrder sets the "sort_order" 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) SetProtected

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

SetProtected sets the "protected" field.

func (*AuthProvidersUpdate) SetProviderStatus

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

SetProviderStatus sets the "provider_status" field.

func (*AuthProvidersUpdate) SetProviderType

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

SetProviderType sets the "provider_type" field.

func (*AuthProvidersUpdate) SetSecretEncrypted

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

SetSecretEncrypted sets the "secret_encrypted" field.

func (*AuthProvidersUpdate) SetSortOrder

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

SetSortOrder sets the "sort_order" 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) 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) AddProviderStatus

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

AddProviderStatus adds value to the "provider_status" field.

func (*AuthProvidersUpdateOne) AddProviderType

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

AddProviderType adds value to the "provider_type" field.

func (*AuthProvidersUpdateOne) AddSortOrder

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

AddSortOrder adds value to the "sort_order" field.

func (*AuthProvidersUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*AuthProvidersUpdateOne) AppendConfig

AppendConfig appends value to the "config" field.

func (*AuthProvidersUpdateOne) ClearConfig

ClearConfig clears the value of the "config" field.

func (*AuthProvidersUpdateOne) ClearCreatedBy

func (_u *AuthProvidersUpdateOne) ClearCreatedBy() *AuthProvidersUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*AuthProvidersUpdateOne) ClearDeletedAt

func (_u *AuthProvidersUpdateOne) ClearDeletedAt() *AuthProvidersUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AuthProvidersUpdateOne) ClearLionUserIdentities

func (_u *AuthProvidersUpdateOne) ClearLionUserIdentities() *AuthProvidersUpdateOne

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

func (*AuthProvidersUpdateOne) ClearSecretEncrypted

func (_u *AuthProvidersUpdateOne) ClearSecretEncrypted() *AuthProvidersUpdateOne

ClearSecretEncrypted clears the value of the "secret_encrypted" field.

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

SetCode sets the "code" field.

func (*AuthProvidersUpdateOne) SetConfig

SetConfig sets the "config" field.

func (*AuthProvidersUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*AuthProvidersUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*AuthProvidersUpdateOne) SetDescription

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

SetDescription sets the "description" field.

func (*AuthProvidersUpdateOne) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*AuthProvidersUpdateOne) SetIconURL

SetIconURL sets the "icon_url" field.

func (*AuthProvidersUpdateOne) SetNillableCode

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

SetNillableCode sets the "code" 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) SetNillableDeletedAt

func (_u *AuthProvidersUpdateOne) SetNillableDeletedAt(v *time.Time) *AuthProvidersUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableDescription

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

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

func (*AuthProvidersUpdateOne) SetNillableDisplayName

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

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableIconURL

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

SetNillableIconURL sets the "icon_url" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableProtected

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

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*AuthProvidersUpdateOne) SetNillableProviderStatus

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

SetNillableProviderStatus sets the "provider_status" 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) SetNillableSortOrder

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

SetNillableSortOrder sets the "sort_order" 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) SetProtected

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

SetProtected sets the "protected" field.

func (*AuthProvidersUpdateOne) SetProviderStatus

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

SetProviderStatus sets the "provider_status" field.

func (*AuthProvidersUpdateOne) SetProviderType

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

SetProviderType sets the "provider_type" field.

func (*AuthProvidersUpdateOne) SetSecretEncrypted

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

SetSecretEncrypted sets the "secret_encrypted" field.

func (*AuthProvidersUpdateOne) SetSortOrder

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

SetSortOrder sets the "sort_order" field.

func (*AuthProvidersUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*AuthProvidersUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" 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
	// Departments is the client for interacting with the Departments builders.
	Departments *DepartmentsClient
	// GlobalSettings is the client for interacting with the GlobalSettings builders.
	GlobalSettings *GlobalSettingsClient
	// Groups is the client for interacting with the Groups builders.
	Groups *GroupsClient
	// Menus is the client for interacting with the Menus builders.
	Menus *MenusClient
	// OAuth2Clients is the client for interacting with the OAuth2Clients builders.
	OAuth2Clients *OAuth2ClientsClient
	// OAuth2Codes is the client for interacting with the OAuth2Codes builders.
	OAuth2Codes *OAuth2CodesClient
	// Policies is the client for interacting with the Policies builders.
	Policies *PoliciesClient
	// PrincipalRoles is the client for interacting with the PrincipalRoles builders.
	PrincipalRoles *PrincipalRolesClient
	// RoleMenus is the client for interacting with the RoleMenus builders.
	RoleMenus *RoleMenusClient
	// RolePolicies is the client for interacting with the RolePolicies builders.
	RolePolicies *RolePoliciesClient
	// Roles is the client for interacting with the Roles builders.
	Roles *RolesClient
	// UserIdentities is the client for interacting with the UserIdentities builders.
	UserIdentities *UserIdentitiesClient
	// UserMemberships is the client for interacting with the UserMemberships builders.
	UserMemberships *UserMembershipsClient
	// UserProfiles is the client for interacting with the UserProfiles builders.
	UserProfiles *UserProfilesClient
	// 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"`
	// 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"`
	// 凭证唯一编码,创建后不可修改(2-32字符,小写字母开头)
	Code string `json:"code,omitempty"`
	// 前端展示名称,用于凭证列表、详情页等用户可见场景
	DisplayName string `json:"display_name,omitempty"`
	// 凭证说明或备注
	Description string `json:"description,omitempty"`
	// 凭证类型: 0=未指定, 1=API_KEY, 2=SYMMETRIC_KEY, 3=KEY_PAIR, 4=X509, 5=LICENSE, 6=SECRET
	CredentialType int `json:"credential_type,omitempty"`
	// 算法类型: 0=未指定, 1=RSA, 2=ECDSA, 3=ED25519, 4=HMAC, 5=AES, 6=CHACHA20_POLY1305, 10=SM2, 11=SM4, 12=SM9, 99=CUSTOM
	CredentialAlgorithm int `json:"credential_algorithm,omitempty"`
	// 凭证用途: 0=未指定, 1=SIGNING, 2=ENCRYPTION, 10=AUTH, 11=OTP, 12=JWKS
	CredentialUsage int `json:"credential_usage,omitempty"`
	// 可见性: 0=未指定, 1=GLOBAL, 2=SUBTREE, 3=LOCAL, 4=RESTRICTED, 5=SPECIFIC
	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"`
	// 是否受保护(受保护记录不可删除,如内置签名密钥)
	Protected bool `json:"protected,omitempty"`
	// 密钥指纹(SHA-256 摘要,64 字符 hex),用于幂等去重。生成策略因类型而异:API_KEY=api_key SHA-256, SYMMETRIC_KEY=密钥 SHA-256, KEY_PAIR=公钥 SHA-256, X509=证书 SHA-256, LICENSE=license_key SHA-256, SECRET=密文 SHA-256
	Fingerprint string `json:"fingerprint,omitempty"`
	// API Key 的公有标识
	APIKey string `json:"api_key,omitempty"`
	// API Secret / 私密部分,敏感数据
	APISecretEncrypted []byte `json:"-"`
	// 公钥内容(PEM/DER 格式)
	PublicKey []byte `json:"public_key,omitempty"`
	// 私钥内容(PEM/DER 格式),敏感数据;KEY_PAIR 类型为密钥对私钥,X509 类型为证书对应私钥
	PrivateKeyEncrypted []byte `json:"-"`
	// 私钥加密口令,可选;同时服务于 KEY_PAIR 和 X509 类型
	PassphraseEncrypted []byte `json:"-"`
	// 主证书(PEM/DER 格式)
	Certificate []byte `json:"certificate,omitempty"`
	// 可选 CA 证书链(顺序从根到中间证书)
	CaChain [][]uint8 `json:"ca_chain,omitempty"`
	// 许可证密钥或主体内容,敏感数据
	LicenseKeyEncrypted []byte `json:"-"`
	// 许可证数字签名,用于验证完整性
	Signature []byte `json:"signature,omitempty"`
	// 对称密钥 / HMAC / JWT / AES-GCM 加密后的完整 Token(可解密还原);SECRET 类型复用此字段存储非密钥类密文
	SymmetricKeyEncrypted []byte `json:"-"`
	// 生效时间(Not Before)
	NotBefore *time.Time `json:"not_before,omitempty"`
	// 过期时间
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
	// 自定义业务属性,许可证附加信息,如授权范围、用户数、有效期等
	Metadata map[string]string `json:"metadata,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) SetCode

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

SetCode sets the "code" 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) SetDeletedAt added in v0.4.1

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

SetDeletedAt sets the "deleted_at" field.

func (*CredentialsCreate) SetDescription

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

SetDescription sets the "description" field.

func (*CredentialsCreate) SetDisplayName added in v0.4.1

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

SetDisplayName sets the "display_name" field.

func (*CredentialsCreate) SetExpiresAt

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

SetExpiresAt sets the "expires_at" field.

func (*CredentialsCreate) SetFingerprint added in v0.4.1

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

SetFingerprint sets the "fingerprint" field.

func (*CredentialsCreate) SetLicenseKeyEncrypted

func (_c *CredentialsCreate) SetLicenseKeyEncrypted(v []byte) *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) 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) SetNillableDeletedAt added in v0.4.1

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

SetNillableDeletedAt sets the "deleted_at" 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) SetNillableDisplayName added in v0.4.1

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

SetNillableDisplayName sets the "display_name" 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) SetNillableFingerprint added in v0.4.1

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

SetNillableFingerprint sets the "fingerprint" 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) SetNillableProtected added in v0.4.1

func (_c *CredentialsCreate) SetNillableProtected(v *bool) *CredentialsCreate

SetNillableProtected sets the "protected" 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) SetProtected added in v0.4.1

func (_c *CredentialsCreate) SetProtected(v bool) *CredentialsCreate

SetProtected sets the "protected" field.

func (*CredentialsCreate) SetPublicKey

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

SetPublicKey sets the "public_key" field.

func (*CredentialsCreate) SetSignature

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

SetSignature sets the "signature" field.

func (*CredentialsCreate) SetSymmetricKeyEncrypted added in v0.4.1

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

SetSymmetricKeyEncrypted sets the "symmetric_key_encrypted" 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) ClearDeletedAt added in v0.4.1

func (m *CredentialsMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" 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) ClearFingerprint added in v0.4.1

func (m *CredentialsMutation) ClearFingerprint()

ClearFingerprint clears the value of the "fingerprint" 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) ClearSymmetricKeyEncrypted added in v0.4.1

func (m *CredentialsMutation) ClearSymmetricKeyEncrypted()

ClearSymmetricKeyEncrypted clears the value of the "symmetric_key_encrypted" 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) Code

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

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

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) DeletedAt added in v0.4.1

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

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*CredentialsMutation) DeletedAtCleared added in v0.4.1

func (m *CredentialsMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this 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) DisplayName added in v0.4.1

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

DisplayName returns the value of the "display_name" field in the 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) Fingerprint added in v0.4.1

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

Fingerprint returns the value of the "fingerprint" field in the mutation.

func (*CredentialsMutation) FingerprintCleared added in v0.4.1

func (m *CredentialsMutation) FingerprintCleared() bool

FingerprintCleared returns if the "fingerprint" field was cleared in this mutation.

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

func (m *CredentialsMutation) LicenseKeyEncrypted() (r []byte, 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) 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) OldCode

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

OldCode returns the old "code" 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) OldDeletedAt added in v0.4.1

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

OldDeletedAt returns the old "deleted_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) 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) OldDisplayName added in v0.4.1

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

OldDisplayName returns the old "display_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) 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) OldFingerprint added in v0.4.1

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

OldFingerprint returns the old "fingerprint" 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 []byte, 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) 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) OldProtected added in v0.4.1

func (m *CredentialsMutation) OldProtected(ctx context.Context) (v bool, err error)

OldProtected returns the old "protected" 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 []byte, 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 []byte, 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) OldSymmetricKeyEncrypted added in v0.4.1

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

OldSymmetricKeyEncrypted returns the old "symmetric_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) 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) Protected added in v0.4.1

func (m *CredentialsMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (*CredentialsMutation) PublicKey

func (m *CredentialsMutation) PublicKey() (r []byte, 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) ResetCode

func (m *CredentialsMutation) ResetCode()

ResetCode resets all changes to the "code" 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) ResetDeletedAt added in v0.4.1

func (m *CredentialsMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CredentialsMutation) ResetDescription

func (m *CredentialsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*CredentialsMutation) ResetDisplayName added in v0.4.1

func (m *CredentialsMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) ResetFingerprint added in v0.4.1

func (m *CredentialsMutation) ResetFingerprint()

ResetFingerprint resets all changes to the "fingerprint" 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) 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) ResetProtected added in v0.4.1

func (m *CredentialsMutation) ResetProtected()

ResetProtected resets all changes to the "protected" 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) ResetSymmetricKeyEncrypted added in v0.4.1

func (m *CredentialsMutation) ResetSymmetricKeyEncrypted()

ResetSymmetricKeyEncrypted resets all changes to the "symmetric_key_encrypted" 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) SetCode

func (m *CredentialsMutation) SetCode(s string)

SetCode sets the "code" 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) SetDeletedAt added in v0.4.1

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

SetDeletedAt sets the "deleted_at" field.

func (*CredentialsMutation) SetDescription

func (m *CredentialsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*CredentialsMutation) SetDisplayName added in v0.4.1

func (m *CredentialsMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) SetFingerprint added in v0.4.1

func (m *CredentialsMutation) SetFingerprint(s string)

SetFingerprint sets the "fingerprint" field.

func (*CredentialsMutation) SetLicenseKeyEncrypted

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

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) 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) SetProtected added in v0.4.1

func (m *CredentialsMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

func (*CredentialsMutation) SetPublicKey

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

SetPublicKey sets the "public_key" field.

func (*CredentialsMutation) SetSignature

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

SetSignature sets the "signature" field.

func (*CredentialsMutation) SetSymmetricKeyEncrypted added in v0.4.1

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

SetSymmetricKeyEncrypted sets the "symmetric_key_encrypted" 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 []byte, 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) SymmetricKeyEncrypted added in v0.4.1

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

SymmetricKeyEncrypted returns the value of the "symmetric_key_encrypted" field in the mutation.

func (*CredentialsMutation) SymmetricKeyEncryptedCleared added in v0.4.1

func (m *CredentialsMutation) SymmetricKeyEncryptedCleared() bool

SymmetricKeyEncryptedCleared returns if the "symmetric_key_encrypted" 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) ClearDeletedAt added in v0.4.1

func (_u *CredentialsUpdate) ClearDeletedAt() *CredentialsUpdate

ClearDeletedAt clears the value of the "deleted_at" 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) ClearFingerprint added in v0.4.1

func (_u *CredentialsUpdate) ClearFingerprint() *CredentialsUpdate

ClearFingerprint clears the value of the "fingerprint" 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) ClearSymmetricKeyEncrypted added in v0.4.1

func (_u *CredentialsUpdate) ClearSymmetricKeyEncrypted() *CredentialsUpdate

ClearSymmetricKeyEncrypted clears the value of the "symmetric_key_encrypted" 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) SetCode

func (_u *CredentialsUpdate) SetCode(v string) *CredentialsUpdate

SetCode sets the "code" 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) SetDeletedAt added in v0.4.1

func (_u *CredentialsUpdate) SetDeletedAt(v time.Time) *CredentialsUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CredentialsUpdate) SetDescription

func (_u *CredentialsUpdate) SetDescription(v string) *CredentialsUpdate

SetDescription sets the "description" field.

func (*CredentialsUpdate) SetDisplayName added in v0.4.1

func (_u *CredentialsUpdate) SetDisplayName(v string) *CredentialsUpdate

SetDisplayName sets the "display_name" field.

func (*CredentialsUpdate) SetExpiresAt

func (_u *CredentialsUpdate) SetExpiresAt(v time.Time) *CredentialsUpdate

SetExpiresAt sets the "expires_at" field.

func (*CredentialsUpdate) SetFingerprint added in v0.4.1

func (_u *CredentialsUpdate) SetFingerprint(v string) *CredentialsUpdate

SetFingerprint sets the "fingerprint" field.

func (*CredentialsUpdate) SetLicenseKeyEncrypted

func (_u *CredentialsUpdate) SetLicenseKeyEncrypted(v []byte) *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) SetNillableAPIKey

func (_u *CredentialsUpdate) SetNillableAPIKey(v *string) *CredentialsUpdate

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

func (*CredentialsUpdate) SetNillableCode

func (_u *CredentialsUpdate) SetNillableCode(v *string) *CredentialsUpdate

SetNillableCode sets the "code" 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) SetNillableDeletedAt added in v0.4.1

func (_u *CredentialsUpdate) SetNillableDeletedAt(v *time.Time) *CredentialsUpdate

SetNillableDeletedAt sets the "deleted_at" 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) SetNillableDisplayName added in v0.4.1

func (_u *CredentialsUpdate) SetNillableDisplayName(v *string) *CredentialsUpdate

SetNillableDisplayName sets the "display_name" 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) SetNillableFingerprint added in v0.4.1

func (_u *CredentialsUpdate) SetNillableFingerprint(v *string) *CredentialsUpdate

SetNillableFingerprint sets the "fingerprint" 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) SetNillableProtected added in v0.4.1

func (_u *CredentialsUpdate) SetNillableProtected(v *bool) *CredentialsUpdate

SetNillableProtected sets the "protected" 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) SetProtected added in v0.4.1

func (_u *CredentialsUpdate) SetProtected(v bool) *CredentialsUpdate

SetProtected sets the "protected" field.

func (*CredentialsUpdate) SetPublicKey

func (_u *CredentialsUpdate) SetPublicKey(v []byte) *CredentialsUpdate

SetPublicKey sets the "public_key" field.

func (*CredentialsUpdate) SetSignature

func (_u *CredentialsUpdate) SetSignature(v []byte) *CredentialsUpdate

SetSignature sets the "signature" field.

func (*CredentialsUpdate) SetSymmetricKeyEncrypted added in v0.4.1

func (_u *CredentialsUpdate) SetSymmetricKeyEncrypted(v []byte) *CredentialsUpdate

SetSymmetricKeyEncrypted sets the "symmetric_key_encrypted" 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) ClearDeletedAt added in v0.4.1

func (_u *CredentialsUpdateOne) ClearDeletedAt() *CredentialsUpdateOne

ClearDeletedAt clears the value of the "deleted_at" 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) ClearFingerprint added in v0.4.1

func (_u *CredentialsUpdateOne) ClearFingerprint() *CredentialsUpdateOne

ClearFingerprint clears the value of the "fingerprint" 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) ClearSymmetricKeyEncrypted added in v0.4.1

func (_u *CredentialsUpdateOne) ClearSymmetricKeyEncrypted() *CredentialsUpdateOne

ClearSymmetricKeyEncrypted clears the value of the "symmetric_key_encrypted" 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) SetCode

SetCode sets the "code" 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) SetDeletedAt added in v0.4.1

func (_u *CredentialsUpdateOne) SetDeletedAt(v time.Time) *CredentialsUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*CredentialsUpdateOne) SetDescription

func (_u *CredentialsUpdateOne) SetDescription(v string) *CredentialsUpdateOne

SetDescription sets the "description" field.

func (*CredentialsUpdateOne) SetDisplayName added in v0.4.1

func (_u *CredentialsUpdateOne) SetDisplayName(v string) *CredentialsUpdateOne

SetDisplayName sets the "display_name" field.

func (*CredentialsUpdateOne) SetExpiresAt

func (_u *CredentialsUpdateOne) SetExpiresAt(v time.Time) *CredentialsUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*CredentialsUpdateOne) SetFingerprint added in v0.4.1

func (_u *CredentialsUpdateOne) SetFingerprint(v string) *CredentialsUpdateOne

SetFingerprint sets the "fingerprint" field.

func (*CredentialsUpdateOne) SetLicenseKeyEncrypted

func (_u *CredentialsUpdateOne) SetLicenseKeyEncrypted(v []byte) *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) SetNillableAPIKey

func (_u *CredentialsUpdateOne) SetNillableAPIKey(v *string) *CredentialsUpdateOne

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

func (*CredentialsUpdateOne) SetNillableCode

func (_u *CredentialsUpdateOne) SetNillableCode(v *string) *CredentialsUpdateOne

SetNillableCode sets the "code" 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) SetNillableDeletedAt added in v0.4.1

func (_u *CredentialsUpdateOne) SetNillableDeletedAt(v *time.Time) *CredentialsUpdateOne

SetNillableDeletedAt sets the "deleted_at" 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) SetNillableDisplayName added in v0.4.1

func (_u *CredentialsUpdateOne) SetNillableDisplayName(v *string) *CredentialsUpdateOne

SetNillableDisplayName sets the "display_name" 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) SetNillableFingerprint added in v0.4.1

func (_u *CredentialsUpdateOne) SetNillableFingerprint(v *string) *CredentialsUpdateOne

SetNillableFingerprint sets the "fingerprint" 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) SetNillableProtected added in v0.4.1

func (_u *CredentialsUpdateOne) SetNillableProtected(v *bool) *CredentialsUpdateOne

SetNillableProtected sets the "protected" 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) SetProtected added in v0.4.1

func (_u *CredentialsUpdateOne) SetProtected(v bool) *CredentialsUpdateOne

SetProtected sets the "protected" field.

func (*CredentialsUpdateOne) SetPublicKey

func (_u *CredentialsUpdateOne) SetPublicKey(v []byte) *CredentialsUpdateOne

SetPublicKey sets the "public_key" field.

func (*CredentialsUpdateOne) SetSignature

func (_u *CredentialsUpdateOne) SetSignature(v []byte) *CredentialsUpdateOne

SetSignature sets the "signature" field.

func (*CredentialsUpdateOne) SetSymmetricKeyEncrypted added in v0.4.1

func (_u *CredentialsUpdateOne) SetSymmetricKeyEncrypted(v []byte) *CredentialsUpdateOne

SetSymmetricKeyEncrypted sets the "symmetric_key_encrypted" 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 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"`
	// 部门代号,用于系统内部显示和业务逻辑
	Code string `json:"code,omitempty"`
	// 部门名称,用于系统内部显示和业务逻辑
	DisplayName string `json:"display_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"`
	// 可见性定义,对应 api/known/admin/v1/common.proto 中定义
	Visibility int `json:"visibility,omitempty"`
	// 扩展元数据,存储自定义业务属性
	Metadata map[string]string `json:"metadata,omitempty"`
	// 部门描述信息,详细说明部门职责和业务范围
	Description string `json:"description,omitempty"`
	// 是否为保护资源,保护资源不能被删除,描述等可更改
	Protected bool `json:"protected,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) QueryLionGroups

func (_m *Departments) QueryLionGroups() *GroupsQuery

QueryLionGroups queries the "lion_groups" 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) QueryLionGroups

func (c *DepartmentsClient) QueryLionGroups(_m *Departments) *GroupsQuery

QueryLionGroups queries the lion_groups 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) 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) 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) SetCode

func (_c *DepartmentsCreate) SetCode(v string) *DepartmentsCreate

SetCode sets the "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) SetDisplayName

func (_c *DepartmentsCreate) SetDisplayName(v string) *DepartmentsCreate

SetDisplayName sets the "display_name" 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) 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) SetNillableProtected

func (_c *DepartmentsCreate) SetNillableProtected(v *bool) *DepartmentsCreate

SetNillableProtected sets the "protected" 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) SetNillableVisibility

func (_c *DepartmentsCreate) SetNillableVisibility(v *int) *DepartmentsCreate

SetNillableVisibility sets the "visibility" 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) SetProtected

func (_c *DepartmentsCreate) SetProtected(v bool) *DepartmentsCreate

SetProtected sets the "protected" 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.

func (*DepartmentsCreate) SetVisibility

func (_c *DepartmentsCreate) SetVisibility(v int) *DepartmentsCreate

SetVisibility sets the "visibility" 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 {
	// 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) LionGroupsOrErr

func (e DepartmentsEdges) LionGroupsOrErr() ([]*Groups, error)

LionGroupsOrErr returns the LionGroups 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) AddLionGroupIDs

func (m *DepartmentsMutation) AddLionGroupIDs(ids ...int)

AddLionGroupIDs adds the "lion_groups" edge to the Groups 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) AddVisibility

func (m *DepartmentsMutation) AddVisibility(i int)

AddVisibility adds i to the "visibility" 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) AddedVisibility

func (m *DepartmentsMutation) AddedVisibility() (r int, exists bool)

AddedVisibility returns the value that was added to the "visibility" 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) ClearLionGroups

func (m *DepartmentsMutation) ClearLionGroups()

ClearLionGroups clears the "lion_groups" edge to the Groups 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) Code

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

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

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

func (m *DepartmentsMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" 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) 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) 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) 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) OldCode

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

OldCode returns the old "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) OldDisplayName

func (m *DepartmentsMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_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) 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) 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) OldProtected

func (m *DepartmentsMutation) OldProtected(ctx context.Context) (v bool, err error)

OldProtected returns the old "protected" 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) OldVisibility

func (m *DepartmentsMutation) OldVisibility(ctx context.Context) (v int, err error)

OldVisibility returns the old "visibility" 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) Protected

func (m *DepartmentsMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (*DepartmentsMutation) RemoveLionGroupIDs

func (m *DepartmentsMutation) RemoveLionGroupIDs(ids ...int)

RemoveLionGroupIDs removes the "lion_groups" edge to the Groups 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) RemovedLionGroupsIDs

func (m *DepartmentsMutation) RemovedLionGroupsIDs() (ids []int)

RemovedLionGroups returns the removed IDs of the "lion_groups" edge to the Groups 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) ResetCode

func (m *DepartmentsMutation) ResetCode()

ResetCode resets all changes to the "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) ResetDisplayName

func (m *DepartmentsMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) ResetLionGroups

func (m *DepartmentsMutation) ResetLionGroups()

ResetLionGroups resets all changes to the "lion_groups" 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) 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) ResetProtected

func (m *DepartmentsMutation) ResetProtected()

ResetProtected resets all changes to the "protected" 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) ResetVisibility

func (m *DepartmentsMutation) ResetVisibility()

ResetVisibility resets all changes to the "visibility" 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) SetCode

func (m *DepartmentsMutation) SetCode(s string)

SetCode sets the "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) SetDisplayName

func (m *DepartmentsMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) 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) SetProtected

func (m *DepartmentsMutation) SetProtected(b bool)

SetProtected sets the "protected" 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) SetVisibility

func (m *DepartmentsMutation) SetVisibility(i int)

SetVisibility sets the "visibility" 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) Visibility

func (m *DepartmentsMutation) Visibility() (r int, exists bool)

Visibility returns the value of the "visibility" field in the 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) QueryLionGroups

func (_q *DepartmentsQuery) QueryLionGroups() *GroupsQuery

QueryLionGroups chains the current query on the "lion_groups" 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) 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.

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

func (_u *DepartmentsUpdate) AddVisibility(v int) *DepartmentsUpdate

AddVisibility adds value to the "visibility" 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) ClearLionGroups

func (_u *DepartmentsUpdate) ClearLionGroups() *DepartmentsUpdate

ClearLionGroups clears all "lion_groups" edges to the Groups 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) 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) 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) SetCode

func (_u *DepartmentsUpdate) SetCode(v string) *DepartmentsUpdate

SetCode sets the "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) SetDisplayName

func (_u *DepartmentsUpdate) SetDisplayName(v string) *DepartmentsUpdate

SetDisplayName sets the "display_name" 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) SetNillableBudgetItemCode

func (_u *DepartmentsUpdate) SetNillableBudgetItemCode(v *string) *DepartmentsUpdate

SetNillableBudgetItemCode sets the "budget_item_code" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableCode

func (_u *DepartmentsUpdate) SetNillableCode(v *string) *DepartmentsUpdate

SetNillableCode sets the "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) SetNillableDisplayName

func (_u *DepartmentsUpdate) SetNillableDisplayName(v *string) *DepartmentsUpdate

SetNillableDisplayName sets the "display_name" 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) SetNillableParentID

func (_u *DepartmentsUpdate) SetNillableParentID(v *int) *DepartmentsUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentsUpdate) SetNillableProtected

func (_u *DepartmentsUpdate) SetNillableProtected(v *bool) *DepartmentsUpdate

SetNillableProtected sets the "protected" 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) SetNillableVisibility

func (_u *DepartmentsUpdate) SetNillableVisibility(v *int) *DepartmentsUpdate

SetNillableVisibility sets the "visibility" 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) SetProtected

func (_u *DepartmentsUpdate) SetProtected(v bool) *DepartmentsUpdate

SetProtected sets the "protected" 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) SetVisibility

func (_u *DepartmentsUpdate) SetVisibility(v int) *DepartmentsUpdate

SetVisibility sets the "visibility" 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) 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) 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) AddVisibility

func (_u *DepartmentsUpdateOne) AddVisibility(v int) *DepartmentsUpdateOne

AddVisibility adds value to the "visibility" 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) ClearLionGroups

func (_u *DepartmentsUpdateOne) ClearLionGroups() *DepartmentsUpdateOne

ClearLionGroups clears all "lion_groups" edges to the Groups 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) 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) 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) SetCode

SetCode sets the "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) SetDisplayName

func (_u *DepartmentsUpdateOne) SetDisplayName(v string) *DepartmentsUpdateOne

SetDisplayName sets the "display_name" 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) SetNillableBudgetItemCode

func (_u *DepartmentsUpdateOne) SetNillableBudgetItemCode(v *string) *DepartmentsUpdateOne

SetNillableBudgetItemCode sets the "budget_item_code" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableCode

func (_u *DepartmentsUpdateOne) SetNillableCode(v *string) *DepartmentsUpdateOne

SetNillableCode sets the "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) SetNillableDisplayName

func (_u *DepartmentsUpdateOne) SetNillableDisplayName(v *string) *DepartmentsUpdateOne

SetNillableDisplayName sets the "display_name" 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) SetNillableParentID

func (_u *DepartmentsUpdateOne) SetNillableParentID(v *int) *DepartmentsUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentsUpdateOne) SetNillableProtected

func (_u *DepartmentsUpdateOne) SetNillableProtected(v *bool) *DepartmentsUpdateOne

SetNillableProtected sets the "protected" 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) SetNillableVisibility

func (_u *DepartmentsUpdateOne) SetNillableVisibility(v *int) *DepartmentsUpdateOne

SetNillableVisibility sets the "visibility" 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) SetProtected

func (_u *DepartmentsUpdateOne) SetProtected(v bool) *DepartmentsUpdateOne

SetProtected sets the "protected" 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) SetVisibility

func (_u *DepartmentsUpdateOne) SetVisibility(v int) *DepartmentsUpdateOne

SetVisibility sets the "visibility" field.

func (*DepartmentsUpdateOne) Where

Where appends a list predicates to the DepartmentsUpdate builder.

type GlobalSettings

type GlobalSettings 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"`
	// Category holds the value of the "category" field.
	Category string `json:"category,omitempty"`
	// SettingKey holds the value of the "setting_key" field.
	SettingKey string `json:"setting_key,omitempty"`
	// SettingValue holds the value of the "setting_value" field.
	SettingValue string `json:"setting_value,omitempty"`
	// ValueType holds the value of the "value_type" field.
	ValueType string `json:"value_type,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Protected holds the value of the "protected" field.
	Protected bool `json:"protected,omitempty"`
	// contains filtered or unexported fields
}

GlobalSettings is the model entity for the GlobalSettings schema.

func (*GlobalSettings) String

func (_m *GlobalSettings) String() string

String implements the fmt.Stringer.

func (*GlobalSettings) Unwrap

func (_m *GlobalSettings) Unwrap() *GlobalSettings

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

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

func (*GlobalSettings) Value

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

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

type GlobalSettingsClient

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

GlobalSettingsClient is a client for the GlobalSettings schema.

func NewGlobalSettingsClient

func NewGlobalSettingsClient(c config) *GlobalSettingsClient

NewGlobalSettingsClient returns a client for the GlobalSettings from the given config.

func (*GlobalSettingsClient) Create

Create returns a builder for creating a GlobalSettings entity.

func (*GlobalSettingsClient) CreateBulk

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

func (*GlobalSettingsClient) Delete

Delete returns a delete builder for GlobalSettings.

func (*GlobalSettingsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GlobalSettingsClient) DeleteOneID

func (c *GlobalSettingsClient) DeleteOneID(id int) *GlobalSettingsDeleteOne

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

func (*GlobalSettingsClient) Get

Get returns a GlobalSettings entity by its id.

func (*GlobalSettingsClient) GetX

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

func (*GlobalSettingsClient) Hooks

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

Hooks returns the client hooks.

func (*GlobalSettingsClient) Intercept

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

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

func (*GlobalSettingsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GlobalSettingsClient) MapCreateBulk

func (c *GlobalSettingsClient) MapCreateBulk(slice any, setFunc func(*GlobalSettingsCreate, int)) *GlobalSettingsCreateBulk

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 (*GlobalSettingsClient) Query

Query returns a query builder for GlobalSettings.

func (*GlobalSettingsClient) Update

Update returns an update builder for GlobalSettings.

func (*GlobalSettingsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GlobalSettingsClient) UpdateOneID

func (c *GlobalSettingsClient) UpdateOneID(id int) *GlobalSettingsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GlobalSettingsClient) Use

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

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

type GlobalSettingsCreate

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

GlobalSettingsCreate is the builder for creating a GlobalSettings entity.

func (*GlobalSettingsCreate) Exec

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

Exec executes the query.

func (*GlobalSettingsCreate) ExecX

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

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

func (*GlobalSettingsCreate) Mutation

Mutation returns the GlobalSettingsMutation object of the builder.

func (*GlobalSettingsCreate) Save

Save creates the GlobalSettings in the database.

func (*GlobalSettingsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GlobalSettingsCreate) SetCategory

func (_c *GlobalSettingsCreate) SetCategory(v string) *GlobalSettingsCreate

SetCategory sets the "category" field.

func (*GlobalSettingsCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GlobalSettingsCreate) SetCreatedBy

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

SetCreatedBy sets the "created_by" field.

func (*GlobalSettingsCreate) SetDescription

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

SetDescription sets the "description" field.

func (*GlobalSettingsCreate) SetNillableCreatedAt

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

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

func (*GlobalSettingsCreate) SetNillableCreatedBy

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

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

func (*GlobalSettingsCreate) SetNillableDescription

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

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

func (*GlobalSettingsCreate) SetNillableProtected

func (_c *GlobalSettingsCreate) SetNillableProtected(v *bool) *GlobalSettingsCreate

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*GlobalSettingsCreate) SetNillableSettingValue

func (_c *GlobalSettingsCreate) SetNillableSettingValue(v *string) *GlobalSettingsCreate

SetNillableSettingValue sets the "setting_value" field if the given value is not nil.

func (*GlobalSettingsCreate) SetNillableUpdatedAt

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

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

func (*GlobalSettingsCreate) SetNillableUpdatedBy

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

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

func (*GlobalSettingsCreate) SetNillableValueType

func (_c *GlobalSettingsCreate) SetNillableValueType(v *string) *GlobalSettingsCreate

SetNillableValueType sets the "value_type" field if the given value is not nil.

func (*GlobalSettingsCreate) SetProtected

func (_c *GlobalSettingsCreate) SetProtected(v bool) *GlobalSettingsCreate

SetProtected sets the "protected" field.

func (*GlobalSettingsCreate) SetSettingKey

func (_c *GlobalSettingsCreate) SetSettingKey(v string) *GlobalSettingsCreate

SetSettingKey sets the "setting_key" field.

func (*GlobalSettingsCreate) SetSettingValue

func (_c *GlobalSettingsCreate) SetSettingValue(v string) *GlobalSettingsCreate

SetSettingValue sets the "setting_value" field.

func (*GlobalSettingsCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GlobalSettingsCreate) SetUpdatedBy

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

SetUpdatedBy sets the "updated_by" field.

func (*GlobalSettingsCreate) SetValueType

func (_c *GlobalSettingsCreate) SetValueType(v string) *GlobalSettingsCreate

SetValueType sets the "value_type" field.

type GlobalSettingsCreateBulk

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

GlobalSettingsCreateBulk is the builder for creating many GlobalSettings entities in bulk.

func (*GlobalSettingsCreateBulk) Exec

Exec executes the query.

func (*GlobalSettingsCreateBulk) ExecX

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

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

func (*GlobalSettingsCreateBulk) Save

Save creates the GlobalSettings entities in the database.

func (*GlobalSettingsCreateBulk) SaveX

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

type GlobalSettingsDelete

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

GlobalSettingsDelete is the builder for deleting a GlobalSettings entity.

func (*GlobalSettingsDelete) Exec

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

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

func (*GlobalSettingsDelete) ExecX

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

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

func (*GlobalSettingsDelete) Where

Where appends a list predicates to the GlobalSettingsDelete builder.

type GlobalSettingsDeleteOne

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

GlobalSettingsDeleteOne is the builder for deleting a single GlobalSettings entity.

func (*GlobalSettingsDeleteOne) Exec

Exec executes the deletion query.

func (*GlobalSettingsDeleteOne) ExecX

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

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

func (*GlobalSettingsDeleteOne) Where

Where appends a list predicates to the GlobalSettingsDelete builder.

type GlobalSettingsGroupBy

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

GlobalSettingsGroupBy is the group-by builder for GlobalSettings entities.

func (*GlobalSettingsGroupBy) Aggregate

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

func (*GlobalSettingsGroupBy) Bool

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

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

func (*GlobalSettingsGroupBy) BoolX

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

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

func (*GlobalSettingsGroupBy) Bools

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

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

func (*GlobalSettingsGroupBy) BoolsX

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

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

func (*GlobalSettingsGroupBy) Float64

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

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

func (*GlobalSettingsGroupBy) Float64X

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

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

func (*GlobalSettingsGroupBy) Float64s

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

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

func (*GlobalSettingsGroupBy) Float64sX

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

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

func (*GlobalSettingsGroupBy) Int

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

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

func (*GlobalSettingsGroupBy) IntX

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

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

func (*GlobalSettingsGroupBy) Ints

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

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

func (*GlobalSettingsGroupBy) IntsX

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

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

func (*GlobalSettingsGroupBy) Scan

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

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

func (*GlobalSettingsGroupBy) ScanX

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

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

func (*GlobalSettingsGroupBy) String

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

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

func (*GlobalSettingsGroupBy) StringX

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

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

func (*GlobalSettingsGroupBy) Strings

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

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

func (*GlobalSettingsGroupBy) StringsX

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

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

type GlobalSettingsMutation

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

GlobalSettingsMutation represents an operation that mutates the GlobalSettings nodes in the graph.

func (*GlobalSettingsMutation) AddCreatedBy

func (m *GlobalSettingsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*GlobalSettingsMutation) AddField

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

func (m *GlobalSettingsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*GlobalSettingsMutation) AddedCreatedBy

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

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

func (*GlobalSettingsMutation) AddedEdges

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

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

func (*GlobalSettingsMutation) AddedField

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

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

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

func (*GlobalSettingsMutation) AddedIDs

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

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

func (*GlobalSettingsMutation) AddedUpdatedBy

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

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

func (*GlobalSettingsMutation) Category

func (m *GlobalSettingsMutation) Category() (r string, exists bool)

Category returns the value of the "category" field in the mutation.

func (*GlobalSettingsMutation) ClearCreatedBy

func (m *GlobalSettingsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*GlobalSettingsMutation) ClearEdge

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

func (m *GlobalSettingsMutation) 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 (*GlobalSettingsMutation) ClearUpdatedBy

func (m *GlobalSettingsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GlobalSettingsMutation) ClearedEdges

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

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

func (*GlobalSettingsMutation) ClearedFields

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

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

func (GlobalSettingsMutation) Client

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

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

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

func (*GlobalSettingsMutation) CreatedBy

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

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

func (*GlobalSettingsMutation) CreatedByCleared

func (m *GlobalSettingsMutation) CreatedByCleared() bool

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

func (*GlobalSettingsMutation) Description

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

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

func (*GlobalSettingsMutation) EdgeCleared

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

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

func (*GlobalSettingsMutation) Field

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

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

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

func (*GlobalSettingsMutation) Fields

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

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

func (m *GlobalSettingsMutation) 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 (*GlobalSettingsMutation) OldCategory

func (m *GlobalSettingsMutation) OldCategory(ctx context.Context) (v string, err error)

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

func (*GlobalSettingsMutation) OldCreatedAt

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

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

func (*GlobalSettingsMutation) OldCreatedBy

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

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

func (*GlobalSettingsMutation) OldDescription

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

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

func (*GlobalSettingsMutation) OldField

func (m *GlobalSettingsMutation) 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 (*GlobalSettingsMutation) OldProtected

func (m *GlobalSettingsMutation) OldProtected(ctx context.Context) (v bool, err error)

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

func (*GlobalSettingsMutation) OldSettingKey

func (m *GlobalSettingsMutation) OldSettingKey(ctx context.Context) (v string, err error)

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

func (*GlobalSettingsMutation) OldSettingValue

func (m *GlobalSettingsMutation) OldSettingValue(ctx context.Context) (v string, err error)

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

func (*GlobalSettingsMutation) OldUpdatedAt

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

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

func (*GlobalSettingsMutation) OldUpdatedBy

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

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

func (*GlobalSettingsMutation) OldValueType

func (m *GlobalSettingsMutation) OldValueType(ctx context.Context) (v string, err error)

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

func (*GlobalSettingsMutation) Op

func (m *GlobalSettingsMutation) Op() Op

Op returns the operation name.

func (*GlobalSettingsMutation) Protected

func (m *GlobalSettingsMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (*GlobalSettingsMutation) RemovedEdges

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

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

func (*GlobalSettingsMutation) RemovedIDs

func (m *GlobalSettingsMutation) 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 (*GlobalSettingsMutation) ResetCategory

func (m *GlobalSettingsMutation) ResetCategory()

ResetCategory resets all changes to the "category" field.

func (*GlobalSettingsMutation) ResetCreatedAt

func (m *GlobalSettingsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GlobalSettingsMutation) ResetCreatedBy

func (m *GlobalSettingsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GlobalSettingsMutation) ResetDescription

func (m *GlobalSettingsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GlobalSettingsMutation) ResetEdge

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

func (m *GlobalSettingsMutation) 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 (*GlobalSettingsMutation) ResetProtected

func (m *GlobalSettingsMutation) ResetProtected()

ResetProtected resets all changes to the "protected" field.

func (*GlobalSettingsMutation) ResetSettingKey

func (m *GlobalSettingsMutation) ResetSettingKey()

ResetSettingKey resets all changes to the "setting_key" field.

func (*GlobalSettingsMutation) ResetSettingValue

func (m *GlobalSettingsMutation) ResetSettingValue()

ResetSettingValue resets all changes to the "setting_value" field.

func (*GlobalSettingsMutation) ResetUpdatedAt

func (m *GlobalSettingsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GlobalSettingsMutation) ResetUpdatedBy

func (m *GlobalSettingsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GlobalSettingsMutation) ResetValueType

func (m *GlobalSettingsMutation) ResetValueType()

ResetValueType resets all changes to the "value_type" field.

func (*GlobalSettingsMutation) SetCategory

func (m *GlobalSettingsMutation) SetCategory(s string)

SetCategory sets the "category" field.

func (*GlobalSettingsMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GlobalSettingsMutation) SetCreatedBy

func (m *GlobalSettingsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*GlobalSettingsMutation) SetDescription

func (m *GlobalSettingsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GlobalSettingsMutation) SetField

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

func (m *GlobalSettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GlobalSettingsMutation) SetProtected

func (m *GlobalSettingsMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

func (*GlobalSettingsMutation) SetSettingKey

func (m *GlobalSettingsMutation) SetSettingKey(s string)

SetSettingKey sets the "setting_key" field.

func (*GlobalSettingsMutation) SetSettingValue

func (m *GlobalSettingsMutation) SetSettingValue(s string)

SetSettingValue sets the "setting_value" field.

func (*GlobalSettingsMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GlobalSettingsMutation) SetUpdatedBy

func (m *GlobalSettingsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*GlobalSettingsMutation) SetValueType

func (m *GlobalSettingsMutation) SetValueType(s string)

SetValueType sets the "value_type" field.

func (*GlobalSettingsMutation) SettingKey

func (m *GlobalSettingsMutation) SettingKey() (r string, exists bool)

SettingKey returns the value of the "setting_key" field in the mutation.

func (*GlobalSettingsMutation) SettingValue

func (m *GlobalSettingsMutation) SettingValue() (r string, exists bool)

SettingValue returns the value of the "setting_value" field in the mutation.

func (GlobalSettingsMutation) Tx

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

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

func (*GlobalSettingsMutation) Type

func (m *GlobalSettingsMutation) Type() string

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

func (*GlobalSettingsMutation) UpdatedAt

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

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

func (*GlobalSettingsMutation) UpdatedBy

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

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

func (*GlobalSettingsMutation) UpdatedByCleared

func (m *GlobalSettingsMutation) UpdatedByCleared() bool

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

func (*GlobalSettingsMutation) ValueType

func (m *GlobalSettingsMutation) ValueType() (r string, exists bool)

ValueType returns the value of the "value_type" field in the mutation.

func (*GlobalSettingsMutation) Where

Where appends a list predicates to the GlobalSettingsMutation builder.

func (*GlobalSettingsMutation) WhereP

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

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

type GlobalSettingsQuery

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

GlobalSettingsQuery is the builder for querying GlobalSettings entities.

func (*GlobalSettingsQuery) Aggregate

Aggregate returns a GlobalSettingsSelect configured with the given aggregations.

func (*GlobalSettingsQuery) All

All executes the query and returns a list of GlobalSettingsSlice.

func (*GlobalSettingsQuery) AllX

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

func (*GlobalSettingsQuery) Clone

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

func (*GlobalSettingsQuery) Count

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

Count returns the count of the given query.

func (*GlobalSettingsQuery) CountX

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

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

func (*GlobalSettingsQuery) Exist

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

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

func (*GlobalSettingsQuery) ExistX

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

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

func (*GlobalSettingsQuery) First

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

func (*GlobalSettingsQuery) FirstID

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

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

func (*GlobalSettingsQuery) FirstIDX

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

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

func (*GlobalSettingsQuery) FirstX

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

func (*GlobalSettingsQuery) GroupBy

func (_q *GlobalSettingsQuery) GroupBy(field string, fields ...string) *GlobalSettingsGroupBy

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.GlobalSettings.Query().
	GroupBy(globalsettings.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*GlobalSettingsQuery) IDs

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

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

func (*GlobalSettingsQuery) IDsX

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

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

func (*GlobalSettingsQuery) Limit

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

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

func (*GlobalSettingsQuery) Offset

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

Offset to start from.

func (*GlobalSettingsQuery) Only

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

func (*GlobalSettingsQuery) OnlyID

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

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

func (*GlobalSettingsQuery) OnlyIDX

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

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

func (*GlobalSettingsQuery) OnlyX

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

func (*GlobalSettingsQuery) Order

Order specifies how the records should be ordered.

func (*GlobalSettingsQuery) Select

func (_q *GlobalSettingsQuery) Select(fields ...string) *GlobalSettingsSelect

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.GlobalSettings.Query().
	Select(globalsettings.FieldCreatedAt).
	Scan(ctx, &v)

func (*GlobalSettingsQuery) Unique

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

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

Where adds a new predicate for the GlobalSettingsQuery builder.

type GlobalSettingsSelect

type GlobalSettingsSelect struct {
	*GlobalSettingsQuery
	// contains filtered or unexported fields
}

GlobalSettingsSelect is the builder for selecting fields of GlobalSettings entities.

func (*GlobalSettingsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GlobalSettingsSelect) Bool

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

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

func (*GlobalSettingsSelect) BoolX

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

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

func (*GlobalSettingsSelect) Bools

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

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

func (*GlobalSettingsSelect) BoolsX

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

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

func (*GlobalSettingsSelect) Float64

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

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

func (*GlobalSettingsSelect) Float64X

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

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

func (*GlobalSettingsSelect) Float64s

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

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

func (*GlobalSettingsSelect) Float64sX

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

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

func (*GlobalSettingsSelect) Int

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

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

func (*GlobalSettingsSelect) IntX

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

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

func (*GlobalSettingsSelect) Ints

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

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

func (*GlobalSettingsSelect) IntsX

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

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

func (*GlobalSettingsSelect) Scan

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

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

func (*GlobalSettingsSelect) ScanX

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

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

func (*GlobalSettingsSelect) String

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

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

func (*GlobalSettingsSelect) StringX

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

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

func (*GlobalSettingsSelect) Strings

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

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

func (*GlobalSettingsSelect) StringsX

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

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

type GlobalSettingsSlice

type GlobalSettingsSlice []*GlobalSettings

GlobalSettingsSlice is a parsable slice of GlobalSettings.

type GlobalSettingsUpdate

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

GlobalSettingsUpdate is the builder for updating GlobalSettings entities.

func (*GlobalSettingsUpdate) AddCreatedBy

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

AddCreatedBy adds value to the "created_by" field.

func (*GlobalSettingsUpdate) AddUpdatedBy

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

AddUpdatedBy adds value to the "updated_by" field.

func (*GlobalSettingsUpdate) ClearCreatedBy

func (_u *GlobalSettingsUpdate) ClearCreatedBy() *GlobalSettingsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*GlobalSettingsUpdate) ClearUpdatedBy

func (_u *GlobalSettingsUpdate) ClearUpdatedBy() *GlobalSettingsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GlobalSettingsUpdate) Exec

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

Exec executes the query.

func (*GlobalSettingsUpdate) ExecX

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

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

func (*GlobalSettingsUpdate) Mutation

Mutation returns the GlobalSettingsMutation object of the builder.

func (*GlobalSettingsUpdate) Save

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

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

func (*GlobalSettingsUpdate) SaveX

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

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

func (*GlobalSettingsUpdate) SetCategory

func (_u *GlobalSettingsUpdate) SetCategory(v string) *GlobalSettingsUpdate

SetCategory sets the "category" field.

func (*GlobalSettingsUpdate) SetCreatedBy

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

SetCreatedBy sets the "created_by" field.

func (*GlobalSettingsUpdate) SetDescription

func (_u *GlobalSettingsUpdate) SetDescription(v string) *GlobalSettingsUpdate

SetDescription sets the "description" field.

func (*GlobalSettingsUpdate) SetNillableCategory

func (_u *GlobalSettingsUpdate) SetNillableCategory(v *string) *GlobalSettingsUpdate

SetNillableCategory sets the "category" field if the given value is not nil.

func (*GlobalSettingsUpdate) SetNillableCreatedBy

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

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

func (*GlobalSettingsUpdate) SetNillableDescription

func (_u *GlobalSettingsUpdate) SetNillableDescription(v *string) *GlobalSettingsUpdate

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

func (*GlobalSettingsUpdate) SetNillableProtected

func (_u *GlobalSettingsUpdate) SetNillableProtected(v *bool) *GlobalSettingsUpdate

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*GlobalSettingsUpdate) SetNillableSettingKey

func (_u *GlobalSettingsUpdate) SetNillableSettingKey(v *string) *GlobalSettingsUpdate

SetNillableSettingKey sets the "setting_key" field if the given value is not nil.

func (*GlobalSettingsUpdate) SetNillableSettingValue

func (_u *GlobalSettingsUpdate) SetNillableSettingValue(v *string) *GlobalSettingsUpdate

SetNillableSettingValue sets the "setting_value" field if the given value is not nil.

func (*GlobalSettingsUpdate) SetNillableUpdatedBy

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

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

func (*GlobalSettingsUpdate) SetNillableValueType

func (_u *GlobalSettingsUpdate) SetNillableValueType(v *string) *GlobalSettingsUpdate

SetNillableValueType sets the "value_type" field if the given value is not nil.

func (*GlobalSettingsUpdate) SetProtected

func (_u *GlobalSettingsUpdate) SetProtected(v bool) *GlobalSettingsUpdate

SetProtected sets the "protected" field.

func (*GlobalSettingsUpdate) SetSettingKey

func (_u *GlobalSettingsUpdate) SetSettingKey(v string) *GlobalSettingsUpdate

SetSettingKey sets the "setting_key" field.

func (*GlobalSettingsUpdate) SetSettingValue

func (_u *GlobalSettingsUpdate) SetSettingValue(v string) *GlobalSettingsUpdate

SetSettingValue sets the "setting_value" field.

func (*GlobalSettingsUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GlobalSettingsUpdate) SetUpdatedBy

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

SetUpdatedBy sets the "updated_by" field.

func (*GlobalSettingsUpdate) SetValueType

func (_u *GlobalSettingsUpdate) SetValueType(v string) *GlobalSettingsUpdate

SetValueType sets the "value_type" field.

func (*GlobalSettingsUpdate) Where

Where appends a list predicates to the GlobalSettingsUpdate builder.

type GlobalSettingsUpdateOne

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

GlobalSettingsUpdateOne is the builder for updating a single GlobalSettings entity.

func (*GlobalSettingsUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*GlobalSettingsUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*GlobalSettingsUpdateOne) ClearCreatedBy

func (_u *GlobalSettingsUpdateOne) ClearCreatedBy() *GlobalSettingsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*GlobalSettingsUpdateOne) ClearUpdatedBy

func (_u *GlobalSettingsUpdateOne) ClearUpdatedBy() *GlobalSettingsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GlobalSettingsUpdateOne) Exec

Exec executes the query on the entity.

func (*GlobalSettingsUpdateOne) ExecX

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

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

func (*GlobalSettingsUpdateOne) Mutation

Mutation returns the GlobalSettingsMutation object of the builder.

func (*GlobalSettingsUpdateOne) Save

Save executes the query and returns the updated GlobalSettings entity.

func (*GlobalSettingsUpdateOne) SaveX

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

func (*GlobalSettingsUpdateOne) Select

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

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

func (*GlobalSettingsUpdateOne) SetCategory

SetCategory sets the "category" field.

func (*GlobalSettingsUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*GlobalSettingsUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*GlobalSettingsUpdateOne) SetNillableCategory

func (_u *GlobalSettingsUpdateOne) SetNillableCategory(v *string) *GlobalSettingsUpdateOne

SetNillableCategory sets the "category" field if the given value is not nil.

func (*GlobalSettingsUpdateOne) SetNillableCreatedBy

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

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

func (*GlobalSettingsUpdateOne) SetNillableDescription

func (_u *GlobalSettingsUpdateOne) SetNillableDescription(v *string) *GlobalSettingsUpdateOne

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

func (*GlobalSettingsUpdateOne) SetNillableProtected

func (_u *GlobalSettingsUpdateOne) SetNillableProtected(v *bool) *GlobalSettingsUpdateOne

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*GlobalSettingsUpdateOne) SetNillableSettingKey

func (_u *GlobalSettingsUpdateOne) SetNillableSettingKey(v *string) *GlobalSettingsUpdateOne

SetNillableSettingKey sets the "setting_key" field if the given value is not nil.

func (*GlobalSettingsUpdateOne) SetNillableSettingValue

func (_u *GlobalSettingsUpdateOne) SetNillableSettingValue(v *string) *GlobalSettingsUpdateOne

SetNillableSettingValue sets the "setting_value" field if the given value is not nil.

func (*GlobalSettingsUpdateOne) SetNillableUpdatedBy

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

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

func (*GlobalSettingsUpdateOne) SetNillableValueType

func (_u *GlobalSettingsUpdateOne) SetNillableValueType(v *string) *GlobalSettingsUpdateOne

SetNillableValueType sets the "value_type" field if the given value is not nil.

func (*GlobalSettingsUpdateOne) SetProtected

SetProtected sets the "protected" field.

func (*GlobalSettingsUpdateOne) SetSettingKey

SetSettingKey sets the "setting_key" field.

func (*GlobalSettingsUpdateOne) SetSettingValue

func (_u *GlobalSettingsUpdateOne) SetSettingValue(v string) *GlobalSettingsUpdateOne

SetSettingValue sets the "setting_value" field.

func (*GlobalSettingsUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GlobalSettingsUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*GlobalSettingsUpdateOne) SetValueType

SetValueType sets the "value_type" field.

func (*GlobalSettingsUpdateOne) Where

Where appends a list predicates to the GlobalSettingsUpdate 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"`
	// 用户组名
	Code string `json:"code,omitempty"`
	// 部门名称,用于系统内部显示和业务逻辑
	DisplayName string `json:"display_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:DEPARTMENT→部门ID,ROLE→角色ID;其他类型为0
	RefID int `json:"ref_id,omitempty"`
	// 类型关联表达式:DYNAMIC→成员过滤规则,EXTERNAL→外部源描述(JSON);其他类型为空
	RefExpr string `json:"ref_expr,omitempty"`
	// 可见性定义,对应 api/known/admin/v1/common.proto 中定义
	Visibility int `json:"visibility,omitempty"`
	// 用户组描述
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

Groups is the model entity for the Groups schema.

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

func (_c *GroupsCreate) SetCode(v string) *GroupsCreate

SetCode sets the "code" field.

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

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

SetDescription sets the "description" field.

func (*GroupsCreate) SetDisplayName

func (_c *GroupsCreate) SetDisplayName(v string) *GroupsCreate

SetDisplayName sets the "display_name" 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) 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) 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) SetNillableDescription

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

SetNillableDescription sets the "description" 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) SetNillableRefExpr

func (_c *GroupsCreate) SetNillableRefExpr(v *string) *GroupsCreate

SetNillableRefExpr sets the "ref_expr" field if the given value is not nil.

func (*GroupsCreate) SetNillableRefID

func (_c *GroupsCreate) SetNillableRefID(v *int) *GroupsCreate

SetNillableRefID sets the "ref_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) SetNillableVisibility

func (_c *GroupsCreate) SetNillableVisibility(v *int) *GroupsCreate

SetNillableVisibility sets the "visibility" 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) SetRefExpr

func (_c *GroupsCreate) SetRefExpr(v string) *GroupsCreate

SetRefExpr sets the "ref_expr" field.

func (*GroupsCreate) SetRefID

func (_c *GroupsCreate) SetRefID(v int) *GroupsCreate

SetRefID sets the "ref_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.

func (*GroupsCreate) SetVisibility

func (_c *GroupsCreate) SetVisibility(v int) *GroupsCreate

SetVisibility sets the "visibility" 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 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) 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) AddRefID

func (m *GroupsMutation) AddRefID(i int)

AddRefID adds i to the "ref_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) AddVisibility

func (m *GroupsMutation) AddVisibility(i int)

AddVisibility adds i to the "visibility" 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) AddedRefID

func (m *GroupsMutation) AddedRefID() (r int, exists bool)

AddedRefID returns the value that was added to the "ref_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) AddedVisibility

func (m *GroupsMutation) AddedVisibility() (r int, exists bool)

AddedVisibility returns the value that was added to the "visibility" 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) 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) Code

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

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

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

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

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

func (*GroupsMutation) DisplayName

func (m *GroupsMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" 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) 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) 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) OldCode

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

OldCode returns the old "code" 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) 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) 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) OldDisplayName

func (m *GroupsMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_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) 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) 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) OldRefExpr

func (m *GroupsMutation) OldRefExpr(ctx context.Context) (v string, err error)

OldRefExpr returns the old "ref_expr" 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) OldRefID

func (m *GroupsMutation) OldRefID(ctx context.Context) (v int, err error)

OldRefID returns the old "ref_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) OldVisibility

func (m *GroupsMutation) OldVisibility(ctx context.Context) (v int, err error)

OldVisibility returns the old "visibility" 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) RefExpr

func (m *GroupsMutation) RefExpr() (r string, exists bool)

RefExpr returns the value of the "ref_expr" field in the mutation.

func (*GroupsMutation) RefID

func (m *GroupsMutation) RefID() (r int, exists bool)

RefID returns the value of the "ref_id" field in the mutation.

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

func (m *GroupsMutation) ResetCode()

ResetCode resets all changes to the "code" field.

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

func (m *GroupsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GroupsMutation) ResetDisplayName

func (m *GroupsMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) 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) 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) ResetParentID

func (m *GroupsMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*GroupsMutation) ResetRefExpr

func (m *GroupsMutation) ResetRefExpr()

ResetRefExpr resets all changes to the "ref_expr" field.

func (*GroupsMutation) ResetRefID

func (m *GroupsMutation) ResetRefID()

ResetRefID resets all changes to the "ref_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) ResetVisibility

func (m *GroupsMutation) ResetVisibility()

ResetVisibility resets all changes to the "visibility" field.

func (*GroupsMutation) SetCode

func (m *GroupsMutation) SetCode(s string)

SetCode sets the "code" 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) SetDescription

func (m *GroupsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GroupsMutation) SetDisplayName

func (m *GroupsMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) 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) 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) SetRefExpr

func (m *GroupsMutation) SetRefExpr(s string)

SetRefExpr sets the "ref_expr" field.

func (*GroupsMutation) SetRefID

func (m *GroupsMutation) SetRefID(i int)

SetRefID sets the "ref_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) SetVisibility

func (m *GroupsMutation) SetVisibility(i int)

SetVisibility sets the "visibility" 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) Visibility

func (m *GroupsMutation) Visibility() (r int, exists bool)

Visibility returns the value of the "visibility" field in the 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) 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.

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

func (_u *GroupsUpdate) AddRefID(v int) *GroupsUpdate

AddRefID adds value to the "ref_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) AddVisibility

func (_u *GroupsUpdate) AddVisibility(v int) *GroupsUpdate

AddVisibility adds value to the "visibility" 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) 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) 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) SetCode

func (_u *GroupsUpdate) SetCode(v string) *GroupsUpdate

SetCode sets the "code" field.

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

func (_u *GroupsUpdate) SetDescription(v string) *GroupsUpdate

SetDescription sets the "description" field.

func (*GroupsUpdate) SetDisplayName

func (_u *GroupsUpdate) SetDisplayName(v string) *GroupsUpdate

SetDisplayName sets the "display_name" 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) 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) SetNillableCode

func (_u *GroupsUpdate) SetNillableCode(v *string) *GroupsUpdate

SetNillableCode sets the "code" field if the given value is not nil.

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

func (_u *GroupsUpdate) SetNillableDescription(v *string) *GroupsUpdate

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

func (*GroupsUpdate) SetNillableDisplayName

func (_u *GroupsUpdate) SetNillableDisplayName(v *string) *GroupsUpdate

SetNillableDisplayName sets the "display_name" 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) SetNillableParentID

func (_u *GroupsUpdate) SetNillableParentID(v *int) *GroupsUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*GroupsUpdate) SetNillableRefExpr

func (_u *GroupsUpdate) SetNillableRefExpr(v *string) *GroupsUpdate

SetNillableRefExpr sets the "ref_expr" field if the given value is not nil.

func (*GroupsUpdate) SetNillableRefID

func (_u *GroupsUpdate) SetNillableRefID(v *int) *GroupsUpdate

SetNillableRefID sets the "ref_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) SetNillableVisibility

func (_u *GroupsUpdate) SetNillableVisibility(v *int) *GroupsUpdate

SetNillableVisibility sets the "visibility" 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) SetRefExpr

func (_u *GroupsUpdate) SetRefExpr(v string) *GroupsUpdate

SetRefExpr sets the "ref_expr" field.

func (*GroupsUpdate) SetRefID

func (_u *GroupsUpdate) SetRefID(v int) *GroupsUpdate

SetRefID sets the "ref_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) SetVisibility

func (_u *GroupsUpdate) SetVisibility(v int) *GroupsUpdate

SetVisibility sets the "visibility" 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) 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) AddRefID

func (_u *GroupsUpdateOne) AddRefID(v int) *GroupsUpdateOne

AddRefID adds value to the "ref_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) AddVisibility

func (_u *GroupsUpdateOne) AddVisibility(v int) *GroupsUpdateOne

AddVisibility adds value to the "visibility" 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) 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) 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) SetCode

func (_u *GroupsUpdateOne) SetCode(v string) *GroupsUpdateOne

SetCode sets the "code" field.

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

func (_u *GroupsUpdateOne) SetDescription(v string) *GroupsUpdateOne

SetDescription sets the "description" field.

func (*GroupsUpdateOne) SetDisplayName

func (_u *GroupsUpdateOne) SetDisplayName(v string) *GroupsUpdateOne

SetDisplayName sets the "display_name" 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) 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) SetNillableCode

func (_u *GroupsUpdateOne) SetNillableCode(v *string) *GroupsUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

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

func (_u *GroupsUpdateOne) SetNillableDescription(v *string) *GroupsUpdateOne

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

func (*GroupsUpdateOne) SetNillableDisplayName

func (_u *GroupsUpdateOne) SetNillableDisplayName(v *string) *GroupsUpdateOne

SetNillableDisplayName sets the "display_name" 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) SetNillableParentID

func (_u *GroupsUpdateOne) SetNillableParentID(v *int) *GroupsUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableRefExpr

func (_u *GroupsUpdateOne) SetNillableRefExpr(v *string) *GroupsUpdateOne

SetNillableRefExpr sets the "ref_expr" field if the given value is not nil.

func (*GroupsUpdateOne) SetNillableRefID

func (_u *GroupsUpdateOne) SetNillableRefID(v *int) *GroupsUpdateOne

SetNillableRefID sets the "ref_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) SetNillableVisibility

func (_u *GroupsUpdateOne) SetNillableVisibility(v *int) *GroupsUpdateOne

SetNillableVisibility sets the "visibility" 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) SetRefExpr

func (_u *GroupsUpdateOne) SetRefExpr(v string) *GroupsUpdateOne

SetRefExpr sets the "ref_expr" field.

func (*GroupsUpdateOne) SetRefID

func (_u *GroupsUpdateOne) SetRefID(v int) *GroupsUpdateOne

SetRefID sets the "ref_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) SetVisibility

func (_u *GroupsUpdateOne) SetVisibility(v int) *GroupsUpdateOne

SetVisibility sets the "visibility" 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 Menus 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,为 0 表示顶级菜单
	ParentID int64 `json:"parent_id,omitempty"`
	// 菜单代码
	Code string `json:"code,omitempty"`
	// 菜单展示名称
	DisplayName string `json:"display_name,omitempty"`
	// 前端路由路径
	RoutePath string `json:"route_path,omitempty"`
	// 前端组件名
	Component string `json:"component,omitempty"`
	// 图标名称
	Icon string `json:"icon,omitempty"`
	// 菜单排序顺序
	SortOrder int `json:"sort_order,omitempty"`
	// 菜单可见性;当前主授权仍由角色菜单关联决定,visibility 仅作为附加属性/过滤条件
	Visibility string `json:"visibility,omitempty"`
	// 菜单状态
	MenuStatus string `json:"menu_status,omitempty"`
	// 前端元数据
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	// 详细描述
	Description string `json:"description,omitempty"`
	// 是否为系统内置保护项,内置项不可删除且关键字段不可修改
	Protected bool `json:"protected,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MenusQuery when eager-loading is set.
	Edges MenusEdges `json:"edges"`
	// contains filtered or unexported fields
}

Menus is the model entity for the Menus schema.

func (_m *Menus) QueryLionRoleMenus() *RoleMenusQuery

QueryLionRoleMenus queries the "lion_role_menus" edge of the Menus entity.

func (_m *Menus) String() string

String implements the fmt.Stringer.

func (_m *Menus) Unwrap() *Menus

Unwrap unwraps the Menus 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 (_m *Menus) Update() *MenusUpdateOne

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

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

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

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

MenusClient is a client for the Menus schema.

func NewMenusClient

func NewMenusClient(c config) *MenusClient

NewMenusClient returns a client for the Menus from the given config.

func (c *MenusClient) Create() *MenusCreate

Create returns a builder for creating a Menus entity.

func (c *MenusClient) CreateBulk(builders ...*MenusCreate) *MenusCreateBulk

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

func (c *MenusClient) Delete() *MenusDelete

Delete returns a delete builder for Menus.

func (c *MenusClient) DeleteOne(_m *Menus) *MenusDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (c *MenusClient) DeleteOneID(id int) *MenusDeleteOne

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

func (c *MenusClient) Get(ctx context.Context, id int) (*Menus, error)

Get returns a Menus entity by its id.

func (c *MenusClient) GetX(ctx context.Context, id int) *Menus

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

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

Hooks returns the client hooks.

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

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

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

Interceptors returns the client interceptors.

func (c *MenusClient) MapCreateBulk(slice any, setFunc func(*MenusCreate, int)) *MenusCreateBulk

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 (c *MenusClient) Query() *MenusQuery

Query returns a query builder for Menus.

func (c *MenusClient) QueryLionRoleMenus(_m *Menus) *RoleMenusQuery

QueryLionRoleMenus queries the lion_role_menus edge of a Menus.

func (c *MenusClient) Update() *MenusUpdate

Update returns an update builder for Menus.

func (c *MenusClient) UpdateOne(_m *Menus) *MenusUpdateOne

UpdateOne returns an update builder for the given entity.

func (c *MenusClient) UpdateOneID(id int) *MenusUpdateOne

UpdateOneID returns an update builder for the given id.

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

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

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

MenusCreate is the builder for creating a Menus entity.

func (_c *MenusCreate) AddLionRoleMenuIDs(ids ...int) *MenusCreate

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (_c *MenusCreate) AddLionRoleMenus(v ...*RoleMenus) *MenusCreate

AddLionRoleMenus adds the "lion_role_menus" edges to the RoleMenus entity.

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

Exec executes the query.

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

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

func (_c *MenusCreate) Mutation() *MenusMutation

Mutation returns the MenusMutation object of the builder.

func (_c *MenusCreate) Save(ctx context.Context) (*Menus, error)

Save creates the Menus in the database.

func (_c *MenusCreate) SaveX(ctx context.Context) *Menus

SaveX calls Save and panics if Save returns an error.

func (_c *MenusCreate) SetCode(v string) *MenusCreate

SetCode sets the "code" field.

func (_c *MenusCreate) SetComponent(v string) *MenusCreate

SetComponent sets the "component" field.

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

SetCreatedAt sets the "created_at" field.

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

SetCreatedBy sets the "created_by" field.

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

SetDescription sets the "description" field.

func (_c *MenusCreate) SetDisplayName(v string) *MenusCreate

SetDisplayName sets the "display_name" field.

func (_c *MenusCreate) SetIcon(v string) *MenusCreate

SetIcon sets the "icon" field.

func (_c *MenusCreate) SetMenuStatus(v string) *MenusCreate

SetMenuStatus sets the "menu_status" field.

func (_c *MenusCreate) SetMetadata(v map[string]interface{}) *MenusCreate

SetMetadata sets the "metadata" field.

func (_c *MenusCreate) SetNillableComponent(v *string) *MenusCreate

SetNillableComponent sets the "component" field if the given value is not nil.

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

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

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

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

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

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

func (_c *MenusCreate) SetNillableDisplayName(v *string) *MenusCreate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (_c *MenusCreate) SetNillableIcon(v *string) *MenusCreate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (_c *MenusCreate) SetNillableMenuStatus(v *string) *MenusCreate

SetNillableMenuStatus sets the "menu_status" field if the given value is not nil.

func (_c *MenusCreate) SetNillableParentID(v *int64) *MenusCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (_c *MenusCreate) SetNillableProtected(v *bool) *MenusCreate

SetNillableProtected sets the "protected" field if the given value is not nil.

func (_c *MenusCreate) SetNillableRoutePath(v *string) *MenusCreate

SetNillableRoutePath sets the "route_path" field if the given value is not nil.

func (_c *MenusCreate) SetNillableSortOrder(v *int) *MenusCreate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

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

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

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

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

func (_c *MenusCreate) SetNillableVisibility(v *string) *MenusCreate

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (_c *MenusCreate) SetParentID(v int64) *MenusCreate

SetParentID sets the "parent_id" field.

func (_c *MenusCreate) SetProtected(v bool) *MenusCreate

SetProtected sets the "protected" field.

func (_c *MenusCreate) SetRoutePath(v string) *MenusCreate

SetRoutePath sets the "route_path" field.

func (_c *MenusCreate) SetSortOrder(v int) *MenusCreate

SetSortOrder sets the "sort_order" field.

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

SetUpdatedAt sets the "updated_at" field.

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

SetUpdatedBy sets the "updated_by" field.

func (_c *MenusCreate) SetVisibility(v string) *MenusCreate

SetVisibility sets the "visibility" field.

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

MenusCreateBulk is the builder for creating many Menus entities in bulk.

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

Exec executes the query.

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

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

func (_c *MenusCreateBulk) Save(ctx context.Context) ([]*Menus, error)

Save creates the Menus entities in the database.

func (_c *MenusCreateBulk) SaveX(ctx context.Context) []*Menus

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

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

MenusDelete is the builder for deleting a Menus entity.

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

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

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

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

func (_d *MenusDelete) Where(ps ...predicate.Menus) *MenusDelete

Where appends a list predicates to the MenusDelete builder.

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

MenusDeleteOne is the builder for deleting a single Menus entity.

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

Exec executes the deletion query.

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

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

func (_d *MenusDeleteOne) Where(ps ...predicate.Menus) *MenusDeleteOne

Where appends a list predicates to the MenusDelete builder.

type MenusEdges struct {
	// LionRoleMenus holds the value of the lion_role_menus edge.
	LionRoleMenus []*RoleMenus `json:"lion_role_menus,omitempty"`
	// contains filtered or unexported fields
}

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

func (e MenusEdges) LionRoleMenusOrErr() ([]*RoleMenus, error)

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

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

MenusGroupBy is the group-by builder for Menus entities.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

MenusMutation represents an operation that mutates the Menus nodes in the graph.

func (m *MenusMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (m *MenusMutation) 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 (m *MenusMutation) AddLionRoleMenuIDs(ids ...int)

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by ids.

func (m *MenusMutation) AddParentID(i int64)

AddParentID adds i to the "parent_id" field.

func (m *MenusMutation) AddSortOrder(i int)

AddSortOrder adds i to the "sort_order" field.

func (m *MenusMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

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

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

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

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

func (m *MenusMutation) 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 (m *MenusMutation) AddedFields() []string

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

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

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

func (m *MenusMutation) AddedParentID() (r int64, exists bool)

AddedParentID returns the value that was added to the "parent_id" field in this mutation.

func (m *MenusMutation) AddedSortOrder() (r int, exists bool)

AddedSortOrder returns the value that was added to the "sort_order" field in this mutation.

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

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

func (m *MenusMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (m *MenusMutation) 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 (m *MenusMutation) 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 (m *MenusMutation) ClearLionRoleMenus()

ClearLionRoleMenus clears the "lion_role_menus" edge to the RoleMenus entity.

func (m *MenusMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (m *MenusMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

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

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

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

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

func (m MenusMutation) 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 (m *MenusMutation) Code() (r string, exists bool)

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

func (m *MenusMutation) Component() (r string, exists bool)

Component returns the value of the "component" field in the mutation.

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

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

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

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

func (m *MenusMutation) CreatedByCleared() bool

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

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

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

func (m *MenusMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

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

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

func (m *MenusMutation) 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 (m *MenusMutation) FieldCleared(name string) bool

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

func (m *MenusMutation) 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 (m *MenusMutation) 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 (m *MenusMutation) 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 (m *MenusMutation) Icon() (r string, exists bool)

Icon returns the value of the "icon" field in the mutation.

func (m *MenusMutation) LionRoleMenusCleared() bool

LionRoleMenusCleared reports if the "lion_role_menus" edge to the RoleMenus entity was cleared.

func (m *MenusMutation) LionRoleMenusIDs() (ids []int)

LionRoleMenusIDs returns the "lion_role_menus" edge IDs in the mutation.

func (m *MenusMutation) MenuStatus() (r string, exists bool)

MenuStatus returns the value of the "menu_status" field in the mutation.

func (m *MenusMutation) Metadata() (r map[string]interface{}, exists bool)

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

func (m *MenusMutation) MetadataCleared() bool

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

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

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

func (m *MenusMutation) OldComponent(ctx context.Context) (v string, err error)

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

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

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

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

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

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

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

func (m *MenusMutation) OldDisplayName(ctx context.Context) (v string, err error)

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

func (m *MenusMutation) 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 (m *MenusMutation) OldIcon(ctx context.Context) (v string, err error)

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

func (m *MenusMutation) OldMenuStatus(ctx context.Context) (v string, err error)

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

func (m *MenusMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

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

func (m *MenusMutation) OldParentID(ctx context.Context) (v int64, err error)

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

func (m *MenusMutation) OldProtected(ctx context.Context) (v bool, err error)

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

func (m *MenusMutation) OldRoutePath(ctx context.Context) (v string, err error)

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

func (m *MenusMutation) OldSortOrder(ctx context.Context) (v int, err error)

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

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

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

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

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

func (m *MenusMutation) OldVisibility(ctx context.Context) (v string, err error)

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

func (m *MenusMutation) Op() Op

Op returns the operation name.

func (m *MenusMutation) ParentID() (r int64, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (m *MenusMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (m *MenusMutation) RemoveLionRoleMenuIDs(ids ...int)

RemoveLionRoleMenuIDs removes the "lion_role_menus" edge to the RoleMenus entity by IDs.

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

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

func (m *MenusMutation) 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 (m *MenusMutation) RemovedLionRoleMenusIDs() (ids []int)

RemovedLionRoleMenus returns the removed IDs of the "lion_role_menus" edge to the RoleMenus entity.

func (m *MenusMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (m *MenusMutation) ResetComponent()

ResetComponent resets all changes to the "component" field.

func (m *MenusMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (m *MenusMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (m *MenusMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (m *MenusMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (m *MenusMutation) 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 (m *MenusMutation) 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 (m *MenusMutation) ResetIcon()

ResetIcon resets all changes to the "icon" field.

func (m *MenusMutation) ResetLionRoleMenus()

ResetLionRoleMenus resets all changes to the "lion_role_menus" edge.

func (m *MenusMutation) ResetMenuStatus()

ResetMenuStatus resets all changes to the "menu_status" field.

func (m *MenusMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (m *MenusMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (m *MenusMutation) ResetProtected()

ResetProtected resets all changes to the "protected" field.

func (m *MenusMutation) ResetRoutePath()

ResetRoutePath resets all changes to the "route_path" field.

func (m *MenusMutation) ResetSortOrder()

ResetSortOrder resets all changes to the "sort_order" field.

func (m *MenusMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (m *MenusMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (m *MenusMutation) ResetVisibility()

ResetVisibility resets all changes to the "visibility" field.

func (m *MenusMutation) RoutePath() (r string, exists bool)

RoutePath returns the value of the "route_path" field in the mutation.

func (m *MenusMutation) SetCode(s string)

SetCode sets the "code" field.

func (m *MenusMutation) SetComponent(s string)

SetComponent sets the "component" field.

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

SetCreatedAt sets the "created_at" field.

func (m *MenusMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (m *MenusMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (m *MenusMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (m *MenusMutation) 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 (m *MenusMutation) SetIcon(s string)

SetIcon sets the "icon" field.

func (m *MenusMutation) SetMenuStatus(s string)

SetMenuStatus sets the "menu_status" field.

func (m *MenusMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (m *MenusMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (m *MenusMutation) SetParentID(i int64)

SetParentID sets the "parent_id" field.

func (m *MenusMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

func (m *MenusMutation) SetRoutePath(s string)

SetRoutePath sets the "route_path" field.

func (m *MenusMutation) SetSortOrder(i int)

SetSortOrder sets the "sort_order" field.

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

SetUpdatedAt sets the "updated_at" field.

func (m *MenusMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (m *MenusMutation) SetVisibility(s string)

SetVisibility sets the "visibility" field.

func (m *MenusMutation) SortOrder() (r int, exists bool)

SortOrder returns the value of the "sort_order" field in the mutation.

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

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

func (m *MenusMutation) Type() string

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

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

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

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

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

func (m *MenusMutation) UpdatedByCleared() bool

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

func (m *MenusMutation) Visibility() (r string, exists bool)

Visibility returns the value of the "visibility" field in the mutation.

func (m *MenusMutation) Where(ps ...predicate.Menus)

Where appends a list predicates to the MenusMutation builder.

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

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

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

MenusQuery is the builder for querying Menus entities.

func (_q *MenusQuery) Aggregate(fns ...AggregateFunc) *MenusSelect

Aggregate returns a MenusSelect configured with the given aggregations.

func (_q *MenusQuery) All(ctx context.Context) ([]*Menus, error)

All executes the query and returns a list of MenusSlice.

func (_q *MenusQuery) AllX(ctx context.Context) []*Menus

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

func (_q *MenusQuery) Clone() *MenusQuery

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

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

Count returns the count of the given query.

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

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

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

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

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

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

func (_q *MenusQuery) First(ctx context.Context) (*Menus, error)

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

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

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

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

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

func (_q *MenusQuery) FirstX(ctx context.Context) *Menus

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

func (_q *MenusQuery) GroupBy(field string, fields ...string) *MenusGroupBy

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.Menus.Query().
	GroupBy(menus.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)
func (_q *MenusQuery) IDs(ctx context.Context) (ids []int, err error)

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

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

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

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

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

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

Offset to start from.

func (_q *MenusQuery) Only(ctx context.Context) (*Menus, error)

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

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

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

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

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

func (_q *MenusQuery) OnlyX(ctx context.Context) *Menus

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

func (_q *MenusQuery) Order(o ...menus.OrderOption) *MenusQuery

Order specifies how the records should be ordered.

func (_q *MenusQuery) QueryLionRoleMenus() *RoleMenusQuery

QueryLionRoleMenus chains the current query on the "lion_role_menus" edge.

func (_q *MenusQuery) Select(fields ...string) *MenusSelect

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.Menus.Query().
	Select(menus.FieldCreatedAt).
	Scan(ctx, &v)
func (_q *MenusQuery) Unique(unique bool) *MenusQuery

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 (_q *MenusQuery) Where(ps ...predicate.Menus) *MenusQuery

Where adds a new predicate for the MenusQuery builder.

func (_q *MenusQuery) WithLionRoleMenus(opts ...func(*RoleMenusQuery)) *MenusQuery

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

type MenusSelect struct {
	*MenusQuery
	// contains filtered or unexported fields
}

MenusSelect is the builder for selecting fields of Menus entities.

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

Aggregate adds the given aggregation functions to the selector query.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

type MenusSlice []*Menus

MenusSlice is a parsable slice of Menus.

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

MenusUpdate is the builder for updating Menus entities.

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

AddCreatedBy adds value to the "created_by" field.

func (_u *MenusUpdate) AddLionRoleMenuIDs(ids ...int) *MenusUpdate

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (_u *MenusUpdate) AddLionRoleMenus(v ...*RoleMenus) *MenusUpdate

AddLionRoleMenus adds the "lion_role_menus" edges to the RoleMenus entity.

func (_u *MenusUpdate) AddParentID(v int64) *MenusUpdate

AddParentID adds value to the "parent_id" field.

func (_u *MenusUpdate) AddSortOrder(v int) *MenusUpdate

AddSortOrder adds value to the "sort_order" field.

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

AddUpdatedBy adds value to the "updated_by" field.

func (_u *MenusUpdate) ClearCreatedBy() *MenusUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (_u *MenusUpdate) ClearLionRoleMenus() *MenusUpdate

ClearLionRoleMenus clears all "lion_role_menus" edges to the RoleMenus entity.

func (_u *MenusUpdate) ClearMetadata() *MenusUpdate

ClearMetadata clears the value of the "metadata" field.

func (_u *MenusUpdate) ClearUpdatedBy() *MenusUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

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

Exec executes the query.

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

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

func (_u *MenusUpdate) Mutation() *MenusMutation

Mutation returns the MenusMutation object of the builder.

func (_u *MenusUpdate) RemoveLionRoleMenuIDs(ids ...int) *MenusUpdate

RemoveLionRoleMenuIDs removes the "lion_role_menus" edge to RoleMenus entities by IDs.

func (_u *MenusUpdate) RemoveLionRoleMenus(v ...*RoleMenus) *MenusUpdate

RemoveLionRoleMenus removes "lion_role_menus" edges to RoleMenus entities.

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

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

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

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

func (_u *MenusUpdate) SetCode(v string) *MenusUpdate

SetCode sets the "code" field.

func (_u *MenusUpdate) SetComponent(v string) *MenusUpdate

SetComponent sets the "component" field.

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

SetCreatedBy sets the "created_by" field.

func (_u *MenusUpdate) SetDescription(v string) *MenusUpdate

SetDescription sets the "description" field.

func (_u *MenusUpdate) SetDisplayName(v string) *MenusUpdate

SetDisplayName sets the "display_name" field.

func (_u *MenusUpdate) SetIcon(v string) *MenusUpdate

SetIcon sets the "icon" field.

func (_u *MenusUpdate) SetMenuStatus(v string) *MenusUpdate

SetMenuStatus sets the "menu_status" field.

func (_u *MenusUpdate) SetMetadata(v map[string]interface{}) *MenusUpdate

SetMetadata sets the "metadata" field.

func (_u *MenusUpdate) SetNillableCode(v *string) *MenusUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableComponent(v *string) *MenusUpdate

SetNillableComponent sets the "component" field if the given value is not nil.

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

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

func (_u *MenusUpdate) SetNillableDescription(v *string) *MenusUpdate

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

func (_u *MenusUpdate) SetNillableDisplayName(v *string) *MenusUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableIcon(v *string) *MenusUpdate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableMenuStatus(v *string) *MenusUpdate

SetNillableMenuStatus sets the "menu_status" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableParentID(v *int64) *MenusUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableProtected(v *bool) *MenusUpdate

SetNillableProtected sets the "protected" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableRoutePath(v *string) *MenusUpdate

SetNillableRoutePath sets the "route_path" field if the given value is not nil.

func (_u *MenusUpdate) SetNillableSortOrder(v *int) *MenusUpdate

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

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

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

func (_u *MenusUpdate) SetNillableVisibility(v *string) *MenusUpdate

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (_u *MenusUpdate) SetParentID(v int64) *MenusUpdate

SetParentID sets the "parent_id" field.

func (_u *MenusUpdate) SetProtected(v bool) *MenusUpdate

SetProtected sets the "protected" field.

func (_u *MenusUpdate) SetRoutePath(v string) *MenusUpdate

SetRoutePath sets the "route_path" field.

func (_u *MenusUpdate) SetSortOrder(v int) *MenusUpdate

SetSortOrder sets the "sort_order" field.

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

SetUpdatedAt sets the "updated_at" field.

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

SetUpdatedBy sets the "updated_by" field.

func (_u *MenusUpdate) SetVisibility(v string) *MenusUpdate

SetVisibility sets the "visibility" field.

func (_u *MenusUpdate) Where(ps ...predicate.Menus) *MenusUpdate

Where appends a list predicates to the MenusUpdate builder.

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

MenusUpdateOne is the builder for updating a single Menus entity.

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

AddCreatedBy adds value to the "created_by" field.

func (_u *MenusUpdateOne) AddLionRoleMenuIDs(ids ...int) *MenusUpdateOne

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (_u *MenusUpdateOne) AddLionRoleMenus(v ...*RoleMenus) *MenusUpdateOne

AddLionRoleMenus adds the "lion_role_menus" edges to the RoleMenus entity.

func (_u *MenusUpdateOne) AddParentID(v int64) *MenusUpdateOne

AddParentID adds value to the "parent_id" field.

func (_u *MenusUpdateOne) AddSortOrder(v int) *MenusUpdateOne

AddSortOrder adds value to the "sort_order" field.

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

AddUpdatedBy adds value to the "updated_by" field.

func (_u *MenusUpdateOne) ClearCreatedBy() *MenusUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (_u *MenusUpdateOne) ClearLionRoleMenus() *MenusUpdateOne

ClearLionRoleMenus clears all "lion_role_menus" edges to the RoleMenus entity.

func (_u *MenusUpdateOne) ClearMetadata() *MenusUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (_u *MenusUpdateOne) ClearUpdatedBy() *MenusUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

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

Exec executes the query on the entity.

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

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

func (_u *MenusUpdateOne) Mutation() *MenusMutation

Mutation returns the MenusMutation object of the builder.

func (_u *MenusUpdateOne) RemoveLionRoleMenuIDs(ids ...int) *MenusUpdateOne

RemoveLionRoleMenuIDs removes the "lion_role_menus" edge to RoleMenus entities by IDs.

func (_u *MenusUpdateOne) RemoveLionRoleMenus(v ...*RoleMenus) *MenusUpdateOne

RemoveLionRoleMenus removes "lion_role_menus" edges to RoleMenus entities.

func (_u *MenusUpdateOne) Save(ctx context.Context) (*Menus, error)

Save executes the query and returns the updated Menus entity.

func (_u *MenusUpdateOne) SaveX(ctx context.Context) *Menus

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

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

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

func (_u *MenusUpdateOne) SetCode(v string) *MenusUpdateOne

SetCode sets the "code" field.

func (_u *MenusUpdateOne) SetComponent(v string) *MenusUpdateOne

SetComponent sets the "component" field.

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

SetCreatedBy sets the "created_by" field.

func (_u *MenusUpdateOne) SetDescription(v string) *MenusUpdateOne

SetDescription sets the "description" field.

func (_u *MenusUpdateOne) SetDisplayName(v string) *MenusUpdateOne

SetDisplayName sets the "display_name" field.

func (_u *MenusUpdateOne) SetIcon(v string) *MenusUpdateOne

SetIcon sets the "icon" field.

func (_u *MenusUpdateOne) SetMenuStatus(v string) *MenusUpdateOne

SetMenuStatus sets the "menu_status" field.

func (_u *MenusUpdateOne) SetMetadata(v map[string]interface{}) *MenusUpdateOne

SetMetadata sets the "metadata" field.

func (_u *MenusUpdateOne) SetNillableCode(v *string) *MenusUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableComponent(v *string) *MenusUpdateOne

SetNillableComponent sets the "component" field if the given value is not nil.

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

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

func (_u *MenusUpdateOne) SetNillableDescription(v *string) *MenusUpdateOne

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

func (_u *MenusUpdateOne) SetNillableDisplayName(v *string) *MenusUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableIcon(v *string) *MenusUpdateOne

SetNillableIcon sets the "icon" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableMenuStatus(v *string) *MenusUpdateOne

SetNillableMenuStatus sets the "menu_status" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableParentID(v *int64) *MenusUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableProtected(v *bool) *MenusUpdateOne

SetNillableProtected sets the "protected" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableRoutePath(v *string) *MenusUpdateOne

SetNillableRoutePath sets the "route_path" field if the given value is not nil.

func (_u *MenusUpdateOne) SetNillableSortOrder(v *int) *MenusUpdateOne

SetNillableSortOrder sets the "sort_order" field if the given value is not nil.

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

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

func (_u *MenusUpdateOne) SetNillableVisibility(v *string) *MenusUpdateOne

SetNillableVisibility sets the "visibility" field if the given value is not nil.

func (_u *MenusUpdateOne) SetParentID(v int64) *MenusUpdateOne

SetParentID sets the "parent_id" field.

func (_u *MenusUpdateOne) SetProtected(v bool) *MenusUpdateOne

SetProtected sets the "protected" field.

func (_u *MenusUpdateOne) SetRoutePath(v string) *MenusUpdateOne

SetRoutePath sets the "route_path" field.

func (_u *MenusUpdateOne) SetSortOrder(v int) *MenusUpdateOne

SetSortOrder sets the "sort_order" field.

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

SetUpdatedAt sets the "updated_at" field.

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

SetUpdatedBy sets the "updated_by" field.

func (_u *MenusUpdateOne) SetVisibility(v string) *MenusUpdateOne

SetVisibility sets the "visibility" field.

func (_u *MenusUpdateOne) Where(ps ...predicate.Menus) *MenusUpdateOne

Where appends a list predicates to the MenusUpdate builder.

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 OAuth2Clients

type OAuth2Clients 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"`
	// OAuth2 客户端 ID,创建后不可修改,关联 lion_oauth2_clients 表唯一标识
	ClientID string `json:"client_id,omitempty"`
	// 客户端密钥的 bcrypt 哈希值
	ClientSecretHash string `json:"-"`
	// 客户端显示名称
	DisplayName string `json:"display_name,omitempty"`
	// 回调地址列表(支持多个)
	RedirectUris []string `json:"redirect_uris,omitempty"`
	// 状态: 1=启用, 2=禁用, 3=已吊销
	ClientStatus int `json:"client_status,omitempty"`
	// 支持的授权类型,如 authorization_code, refresh_token
	GrantTypes []string `json:"grant_types,omitempty"`
	// 授权范围列表
	Scopes []string `json:"scopes,omitempty"`
	// 客户端 Logo URL
	LogoURL string `json:"logo_url,omitempty"`
	// 客户端描述
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

OAuth2Clients is the model entity for the OAuth2Clients schema.

func (*OAuth2Clients) String

func (_m *OAuth2Clients) String() string

String implements the fmt.Stringer.

func (*OAuth2Clients) Unwrap

func (_m *OAuth2Clients) Unwrap() *OAuth2Clients

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

func (_m *OAuth2Clients) Update() *OAuth2ClientsUpdateOne

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

func (*OAuth2Clients) Value

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

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

type OAuth2ClientsClient

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

OAuth2ClientsClient is a client for the OAuth2Clients schema.

func NewOAuth2ClientsClient

func NewOAuth2ClientsClient(c config) *OAuth2ClientsClient

NewOAuth2ClientsClient returns a client for the OAuth2Clients from the given config.

func (*OAuth2ClientsClient) Create

Create returns a builder for creating a OAuth2Clients entity.

func (*OAuth2ClientsClient) CreateBulk

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

func (*OAuth2ClientsClient) Delete

Delete returns a delete builder for OAuth2Clients.

func (*OAuth2ClientsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuth2ClientsClient) DeleteOneID

func (c *OAuth2ClientsClient) DeleteOneID(id int) *OAuth2ClientsDeleteOne

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

func (*OAuth2ClientsClient) Get

Get returns a OAuth2Clients entity by its id.

func (*OAuth2ClientsClient) GetX

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

func (*OAuth2ClientsClient) Hooks

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

Hooks returns the client hooks.

func (*OAuth2ClientsClient) Intercept

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

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

func (*OAuth2ClientsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OAuth2ClientsClient) MapCreateBulk

func (c *OAuth2ClientsClient) MapCreateBulk(slice any, setFunc func(*OAuth2ClientsCreate, int)) *OAuth2ClientsCreateBulk

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 (*OAuth2ClientsClient) Query

Query returns a query builder for OAuth2Clients.

func (*OAuth2ClientsClient) Update

Update returns an update builder for OAuth2Clients.

func (*OAuth2ClientsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuth2ClientsClient) UpdateOneID

func (c *OAuth2ClientsClient) UpdateOneID(id int) *OAuth2ClientsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OAuth2ClientsClient) Use

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

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

type OAuth2ClientsCreate

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

OAuth2ClientsCreate is the builder for creating a OAuth2Clients entity.

func (*OAuth2ClientsCreate) Exec

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

Exec executes the query.

func (*OAuth2ClientsCreate) ExecX

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

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

func (*OAuth2ClientsCreate) Mutation

Mutation returns the OAuth2ClientsMutation object of the builder.

func (*OAuth2ClientsCreate) Save

Save creates the OAuth2Clients in the database.

func (*OAuth2ClientsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OAuth2ClientsCreate) SetClientID

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

SetClientID sets the "client_id" field.

func (*OAuth2ClientsCreate) SetClientSecretHash

func (_c *OAuth2ClientsCreate) SetClientSecretHash(v string) *OAuth2ClientsCreate

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuth2ClientsCreate) SetClientStatus

func (_c *OAuth2ClientsCreate) SetClientStatus(v int) *OAuth2ClientsCreate

SetClientStatus sets the "client_status" field.

func (*OAuth2ClientsCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*OAuth2ClientsCreate) SetCreatedBy

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

SetCreatedBy sets the "created_by" field.

func (*OAuth2ClientsCreate) SetDeletedAt

func (_c *OAuth2ClientsCreate) SetDeletedAt(v time.Time) *OAuth2ClientsCreate

SetDeletedAt sets the "deleted_at" field.

func (*OAuth2ClientsCreate) SetDescription

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

SetDescription sets the "description" field.

func (*OAuth2ClientsCreate) SetDisplayName

func (_c *OAuth2ClientsCreate) SetDisplayName(v string) *OAuth2ClientsCreate

SetDisplayName sets the "display_name" field.

func (*OAuth2ClientsCreate) SetGrantTypes

func (_c *OAuth2ClientsCreate) SetGrantTypes(v []string) *OAuth2ClientsCreate

SetGrantTypes sets the "grant_types" field.

func (*OAuth2ClientsCreate) SetLogoURL

func (_c *OAuth2ClientsCreate) SetLogoURL(v string) *OAuth2ClientsCreate

SetLogoURL sets the "logo_url" field.

func (*OAuth2ClientsCreate) SetNillableClientStatus

func (_c *OAuth2ClientsCreate) SetNillableClientStatus(v *int) *OAuth2ClientsCreate

SetNillableClientStatus sets the "client_status" field if the given value is not nil.

func (*OAuth2ClientsCreate) SetNillableCreatedAt

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

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

func (*OAuth2ClientsCreate) SetNillableCreatedBy

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

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

func (*OAuth2ClientsCreate) SetNillableDeletedAt

func (_c *OAuth2ClientsCreate) SetNillableDeletedAt(v *time.Time) *OAuth2ClientsCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*OAuth2ClientsCreate) SetNillableDescription

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

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

func (*OAuth2ClientsCreate) SetNillableDisplayName

func (_c *OAuth2ClientsCreate) SetNillableDisplayName(v *string) *OAuth2ClientsCreate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*OAuth2ClientsCreate) SetNillableLogoURL

func (_c *OAuth2ClientsCreate) SetNillableLogoURL(v *string) *OAuth2ClientsCreate

SetNillableLogoURL sets the "logo_url" field if the given value is not nil.

func (*OAuth2ClientsCreate) SetNillableUpdatedAt

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

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

func (*OAuth2ClientsCreate) SetNillableUpdatedBy

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

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

func (*OAuth2ClientsCreate) SetRedirectUris

func (_c *OAuth2ClientsCreate) SetRedirectUris(v []string) *OAuth2ClientsCreate

SetRedirectUris sets the "redirect_uris" field.

func (*OAuth2ClientsCreate) SetScopes

func (_c *OAuth2ClientsCreate) SetScopes(v []string) *OAuth2ClientsCreate

SetScopes sets the "scopes" field.

func (*OAuth2ClientsCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2ClientsCreate) SetUpdatedBy

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

SetUpdatedBy sets the "updated_by" field.

type OAuth2ClientsCreateBulk

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

OAuth2ClientsCreateBulk is the builder for creating many OAuth2Clients entities in bulk.

func (*OAuth2ClientsCreateBulk) Exec

Exec executes the query.

func (*OAuth2ClientsCreateBulk) ExecX

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

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

func (*OAuth2ClientsCreateBulk) Save

Save creates the OAuth2Clients entities in the database.

func (*OAuth2ClientsCreateBulk) SaveX

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

type OAuth2ClientsDelete

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

OAuth2ClientsDelete is the builder for deleting a OAuth2Clients entity.

func (*OAuth2ClientsDelete) Exec

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

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

func (*OAuth2ClientsDelete) ExecX

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

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

func (*OAuth2ClientsDelete) Where

Where appends a list predicates to the OAuth2ClientsDelete builder.

type OAuth2ClientsDeleteOne

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

OAuth2ClientsDeleteOne is the builder for deleting a single OAuth2Clients entity.

func (*OAuth2ClientsDeleteOne) Exec

Exec executes the deletion query.

func (*OAuth2ClientsDeleteOne) ExecX

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

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

func (*OAuth2ClientsDeleteOne) Where

Where appends a list predicates to the OAuth2ClientsDelete builder.

type OAuth2ClientsGroupBy

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

OAuth2ClientsGroupBy is the group-by builder for OAuth2Clients entities.

func (*OAuth2ClientsGroupBy) Aggregate

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

func (*OAuth2ClientsGroupBy) Bool

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

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

func (*OAuth2ClientsGroupBy) BoolX

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

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

func (*OAuth2ClientsGroupBy) Bools

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

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

func (*OAuth2ClientsGroupBy) BoolsX

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

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

func (*OAuth2ClientsGroupBy) Float64

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

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

func (*OAuth2ClientsGroupBy) Float64X

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

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

func (*OAuth2ClientsGroupBy) Float64s

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

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

func (*OAuth2ClientsGroupBy) Float64sX

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

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

func (*OAuth2ClientsGroupBy) Int

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

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

func (*OAuth2ClientsGroupBy) IntX

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

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

func (*OAuth2ClientsGroupBy) Ints

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

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

func (*OAuth2ClientsGroupBy) IntsX

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

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

func (*OAuth2ClientsGroupBy) Scan

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

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

func (*OAuth2ClientsGroupBy) ScanX

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

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

func (*OAuth2ClientsGroupBy) String

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

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

func (*OAuth2ClientsGroupBy) StringX

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

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

func (*OAuth2ClientsGroupBy) Strings

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

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

func (*OAuth2ClientsGroupBy) StringsX

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

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

type OAuth2ClientsMutation

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

OAuth2ClientsMutation represents an operation that mutates the OAuth2Clients nodes in the graph.

func (*OAuth2ClientsMutation) AddClientStatus

func (m *OAuth2ClientsMutation) AddClientStatus(i int)

AddClientStatus adds i to the "client_status" field.

func (*OAuth2ClientsMutation) AddCreatedBy

func (m *OAuth2ClientsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*OAuth2ClientsMutation) AddField

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

func (m *OAuth2ClientsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*OAuth2ClientsMutation) AddedClientStatus

func (m *OAuth2ClientsMutation) AddedClientStatus() (r int, exists bool)

AddedClientStatus returns the value that was added to the "client_status" field in this mutation.

func (*OAuth2ClientsMutation) AddedCreatedBy

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

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

func (*OAuth2ClientsMutation) AddedEdges

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

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

func (*OAuth2ClientsMutation) AddedField

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

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

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

func (*OAuth2ClientsMutation) AddedIDs

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

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

func (*OAuth2ClientsMutation) AddedUpdatedBy

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

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

func (*OAuth2ClientsMutation) AppendGrantTypes

func (m *OAuth2ClientsMutation) AppendGrantTypes(s []string)

AppendGrantTypes adds s to the "grant_types" field.

func (*OAuth2ClientsMutation) AppendRedirectUris

func (m *OAuth2ClientsMutation) AppendRedirectUris(s []string)

AppendRedirectUris adds s to the "redirect_uris" field.

func (*OAuth2ClientsMutation) AppendScopes

func (m *OAuth2ClientsMutation) AppendScopes(s []string)

AppendScopes adds s to the "scopes" field.

func (*OAuth2ClientsMutation) AppendedGrantTypes

func (m *OAuth2ClientsMutation) AppendedGrantTypes() ([]string, bool)

AppendedGrantTypes returns the list of values that were appended to the "grant_types" field in this mutation.

func (*OAuth2ClientsMutation) AppendedRedirectUris

func (m *OAuth2ClientsMutation) AppendedRedirectUris() ([]string, bool)

AppendedRedirectUris returns the list of values that were appended to the "redirect_uris" field in this mutation.

func (*OAuth2ClientsMutation) AppendedScopes

func (m *OAuth2ClientsMutation) AppendedScopes() ([]string, bool)

AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation.

func (*OAuth2ClientsMutation) ClearCreatedBy

func (m *OAuth2ClientsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*OAuth2ClientsMutation) ClearDeletedAt

func (m *OAuth2ClientsMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*OAuth2ClientsMutation) ClearEdge

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

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) ClearGrantTypes

func (m *OAuth2ClientsMutation) ClearGrantTypes()

ClearGrantTypes clears the value of the "grant_types" field.

func (*OAuth2ClientsMutation) ClearRedirectUris

func (m *OAuth2ClientsMutation) ClearRedirectUris()

ClearRedirectUris clears the value of the "redirect_uris" field.

func (*OAuth2ClientsMutation) ClearScopes

func (m *OAuth2ClientsMutation) ClearScopes()

ClearScopes clears the value of the "scopes" field.

func (*OAuth2ClientsMutation) ClearUpdatedBy

func (m *OAuth2ClientsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*OAuth2ClientsMutation) ClearedEdges

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

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

func (*OAuth2ClientsMutation) ClearedFields

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

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

func (OAuth2ClientsMutation) Client

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

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

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

func (*OAuth2ClientsMutation) ClientSecretHash

func (m *OAuth2ClientsMutation) ClientSecretHash() (r string, exists bool)

ClientSecretHash returns the value of the "client_secret_hash" field in the mutation.

func (*OAuth2ClientsMutation) ClientStatus

func (m *OAuth2ClientsMutation) ClientStatus() (r int, exists bool)

ClientStatus returns the value of the "client_status" field in the mutation.

func (*OAuth2ClientsMutation) CreatedAt

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

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

func (*OAuth2ClientsMutation) CreatedBy

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

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

func (*OAuth2ClientsMutation) CreatedByCleared

func (m *OAuth2ClientsMutation) CreatedByCleared() bool

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

func (*OAuth2ClientsMutation) DeletedAt

func (m *OAuth2ClientsMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*OAuth2ClientsMutation) DeletedAtCleared

func (m *OAuth2ClientsMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*OAuth2ClientsMutation) Description

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

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

func (*OAuth2ClientsMutation) DisplayName

func (m *OAuth2ClientsMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*OAuth2ClientsMutation) EdgeCleared

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

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

func (*OAuth2ClientsMutation) Field

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

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

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

func (*OAuth2ClientsMutation) Fields

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) GrantTypes

func (m *OAuth2ClientsMutation) GrantTypes() (r []string, exists bool)

GrantTypes returns the value of the "grant_types" field in the mutation.

func (*OAuth2ClientsMutation) GrantTypesCleared

func (m *OAuth2ClientsMutation) GrantTypesCleared() bool

GrantTypesCleared returns if the "grant_types" field was cleared in this mutation.

func (*OAuth2ClientsMutation) ID

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

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) LogoURL

func (m *OAuth2ClientsMutation) LogoURL() (r string, exists bool)

LogoURL returns the value of the "logo_url" field in the mutation.

func (*OAuth2ClientsMutation) OldClientID

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

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

func (*OAuth2ClientsMutation) OldClientSecretHash

func (m *OAuth2ClientsMutation) OldClientSecretHash(ctx context.Context) (v string, err error)

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

func (*OAuth2ClientsMutation) OldClientStatus

func (m *OAuth2ClientsMutation) OldClientStatus(ctx context.Context) (v int, err error)

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

func (*OAuth2ClientsMutation) OldCreatedAt

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

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

func (*OAuth2ClientsMutation) OldCreatedBy

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

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

func (*OAuth2ClientsMutation) OldDeletedAt

func (m *OAuth2ClientsMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

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

func (*OAuth2ClientsMutation) OldDescription

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

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

func (*OAuth2ClientsMutation) OldDisplayName

func (m *OAuth2ClientsMutation) OldDisplayName(ctx context.Context) (v string, err error)

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

func (*OAuth2ClientsMutation) OldField

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) OldGrantTypes

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

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

func (*OAuth2ClientsMutation) OldLogoURL

func (m *OAuth2ClientsMutation) OldLogoURL(ctx context.Context) (v string, err error)

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

func (*OAuth2ClientsMutation) OldRedirectUris

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

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

func (*OAuth2ClientsMutation) OldScopes

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

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

func (*OAuth2ClientsMutation) OldUpdatedAt

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

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

func (*OAuth2ClientsMutation) OldUpdatedBy

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

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

func (*OAuth2ClientsMutation) Op

func (m *OAuth2ClientsMutation) Op() Op

Op returns the operation name.

func (*OAuth2ClientsMutation) RedirectUris

func (m *OAuth2ClientsMutation) RedirectUris() (r []string, exists bool)

RedirectUris returns the value of the "redirect_uris" field in the mutation.

func (*OAuth2ClientsMutation) RedirectUrisCleared

func (m *OAuth2ClientsMutation) RedirectUrisCleared() bool

RedirectUrisCleared returns if the "redirect_uris" field was cleared in this mutation.

func (*OAuth2ClientsMutation) RemovedEdges

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

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

func (*OAuth2ClientsMutation) RemovedIDs

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) ResetClientID

func (m *OAuth2ClientsMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OAuth2ClientsMutation) ResetClientSecretHash

func (m *OAuth2ClientsMutation) ResetClientSecretHash()

ResetClientSecretHash resets all changes to the "client_secret_hash" field.

func (*OAuth2ClientsMutation) ResetClientStatus

func (m *OAuth2ClientsMutation) ResetClientStatus()

ResetClientStatus resets all changes to the "client_status" field.

func (*OAuth2ClientsMutation) ResetCreatedAt

func (m *OAuth2ClientsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OAuth2ClientsMutation) ResetCreatedBy

func (m *OAuth2ClientsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*OAuth2ClientsMutation) ResetDeletedAt

func (m *OAuth2ClientsMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*OAuth2ClientsMutation) ResetDescription

func (m *OAuth2ClientsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*OAuth2ClientsMutation) ResetDisplayName

func (m *OAuth2ClientsMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*OAuth2ClientsMutation) ResetEdge

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

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) ResetGrantTypes

func (m *OAuth2ClientsMutation) ResetGrantTypes()

ResetGrantTypes resets all changes to the "grant_types" field.

func (*OAuth2ClientsMutation) ResetLogoURL

func (m *OAuth2ClientsMutation) ResetLogoURL()

ResetLogoURL resets all changes to the "logo_url" field.

func (*OAuth2ClientsMutation) ResetRedirectUris

func (m *OAuth2ClientsMutation) ResetRedirectUris()

ResetRedirectUris resets all changes to the "redirect_uris" field.

func (*OAuth2ClientsMutation) ResetScopes

func (m *OAuth2ClientsMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OAuth2ClientsMutation) ResetUpdatedAt

func (m *OAuth2ClientsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OAuth2ClientsMutation) ResetUpdatedBy

func (m *OAuth2ClientsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*OAuth2ClientsMutation) Scopes

func (m *OAuth2ClientsMutation) Scopes() (r []string, exists bool)

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

func (*OAuth2ClientsMutation) ScopesCleared

func (m *OAuth2ClientsMutation) ScopesCleared() bool

ScopesCleared returns if the "scopes" field was cleared in this mutation.

func (*OAuth2ClientsMutation) SetClientID

func (m *OAuth2ClientsMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OAuth2ClientsMutation) SetClientSecretHash

func (m *OAuth2ClientsMutation) SetClientSecretHash(s string)

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuth2ClientsMutation) SetClientStatus

func (m *OAuth2ClientsMutation) SetClientStatus(i int)

SetClientStatus sets the "client_status" field.

func (*OAuth2ClientsMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*OAuth2ClientsMutation) SetCreatedBy

func (m *OAuth2ClientsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*OAuth2ClientsMutation) SetDeletedAt

func (m *OAuth2ClientsMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*OAuth2ClientsMutation) SetDescription

func (m *OAuth2ClientsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*OAuth2ClientsMutation) SetDisplayName

func (m *OAuth2ClientsMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*OAuth2ClientsMutation) SetField

func (m *OAuth2ClientsMutation) 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 (*OAuth2ClientsMutation) SetGrantTypes

func (m *OAuth2ClientsMutation) SetGrantTypes(s []string)

SetGrantTypes sets the "grant_types" field.

func (*OAuth2ClientsMutation) SetLogoURL

func (m *OAuth2ClientsMutation) SetLogoURL(s string)

SetLogoURL sets the "logo_url" field.

func (*OAuth2ClientsMutation) SetOp

func (m *OAuth2ClientsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuth2ClientsMutation) SetRedirectUris

func (m *OAuth2ClientsMutation) SetRedirectUris(s []string)

SetRedirectUris sets the "redirect_uris" field.

func (*OAuth2ClientsMutation) SetScopes

func (m *OAuth2ClientsMutation) SetScopes(s []string)

SetScopes sets the "scopes" field.

func (*OAuth2ClientsMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2ClientsMutation) SetUpdatedBy

func (m *OAuth2ClientsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (OAuth2ClientsMutation) Tx

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

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

func (*OAuth2ClientsMutation) Type

func (m *OAuth2ClientsMutation) Type() string

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

func (*OAuth2ClientsMutation) UpdatedAt

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

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

func (*OAuth2ClientsMutation) UpdatedBy

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

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

func (*OAuth2ClientsMutation) UpdatedByCleared

func (m *OAuth2ClientsMutation) UpdatedByCleared() bool

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

func (*OAuth2ClientsMutation) Where

Where appends a list predicates to the OAuth2ClientsMutation builder.

func (*OAuth2ClientsMutation) WhereP

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

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

type OAuth2ClientsQuery

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

OAuth2ClientsQuery is the builder for querying OAuth2Clients entities.

func (*OAuth2ClientsQuery) Aggregate

func (_q *OAuth2ClientsQuery) Aggregate(fns ...AggregateFunc) *OAuth2ClientsSelect

Aggregate returns a OAuth2ClientsSelect configured with the given aggregations.

func (*OAuth2ClientsQuery) All

All executes the query and returns a list of OAuth2ClientsSlice.

func (*OAuth2ClientsQuery) AllX

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

func (*OAuth2ClientsQuery) Clone

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

func (*OAuth2ClientsQuery) Count

func (_q *OAuth2ClientsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OAuth2ClientsQuery) CountX

func (_q *OAuth2ClientsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OAuth2ClientsQuery) Exist

func (_q *OAuth2ClientsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OAuth2ClientsQuery) ExistX

func (_q *OAuth2ClientsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OAuth2ClientsQuery) First

First returns the first OAuth2Clients entity from the query. Returns a *NotFoundError when no OAuth2Clients was found.

func (*OAuth2ClientsQuery) FirstID

func (_q *OAuth2ClientsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first OAuth2Clients ID from the query. Returns a *NotFoundError when no OAuth2Clients ID was found.

func (*OAuth2ClientsQuery) FirstIDX

func (_q *OAuth2ClientsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*OAuth2ClientsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*OAuth2ClientsQuery) GroupBy

func (_q *OAuth2ClientsQuery) GroupBy(field string, fields ...string) *OAuth2ClientsGroupBy

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.OAuth2Clients.Query().
	GroupBy(oauth2clients.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*OAuth2ClientsQuery) IDs

func (_q *OAuth2ClientsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of OAuth2Clients IDs.

func (*OAuth2ClientsQuery) IDsX

func (_q *OAuth2ClientsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*OAuth2ClientsQuery) Limit

func (_q *OAuth2ClientsQuery) Limit(limit int) *OAuth2ClientsQuery

Limit the number of records to be returned by this query.

func (*OAuth2ClientsQuery) Offset

func (_q *OAuth2ClientsQuery) Offset(offset int) *OAuth2ClientsQuery

Offset to start from.

func (*OAuth2ClientsQuery) Only

Only returns a single OAuth2Clients entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OAuth2Clients entity is found. Returns a *NotFoundError when no OAuth2Clients entities are found.

func (*OAuth2ClientsQuery) OnlyID

func (_q *OAuth2ClientsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only OAuth2Clients ID in the query. Returns a *NotSingularError when more than one OAuth2Clients ID is found. Returns a *NotFoundError when no entities are found.

func (*OAuth2ClientsQuery) OnlyIDX

func (_q *OAuth2ClientsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OAuth2ClientsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*OAuth2ClientsQuery) Order

Order specifies how the records should be ordered.

func (*OAuth2ClientsQuery) Select

func (_q *OAuth2ClientsQuery) Select(fields ...string) *OAuth2ClientsSelect

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.OAuth2Clients.Query().
	Select(oauth2clients.FieldCreatedAt).
	Scan(ctx, &v)

func (*OAuth2ClientsQuery) Unique

func (_q *OAuth2ClientsQuery) Unique(unique bool) *OAuth2ClientsQuery

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 (*OAuth2ClientsQuery) Where

Where adds a new predicate for the OAuth2ClientsQuery builder.

type OAuth2ClientsSelect

type OAuth2ClientsSelect struct {
	*OAuth2ClientsQuery
	// contains filtered or unexported fields
}

OAuth2ClientsSelect is the builder for selecting fields of OAuth2Clients entities.

func (*OAuth2ClientsSelect) Aggregate

func (_s *OAuth2ClientsSelect) Aggregate(fns ...AggregateFunc) *OAuth2ClientsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OAuth2ClientsSelect) Bool

func (s *OAuth2ClientsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) BoolX

func (s *OAuth2ClientsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OAuth2ClientsSelect) Bools

func (s *OAuth2ClientsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) BoolsX

func (s *OAuth2ClientsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OAuth2ClientsSelect) Float64

func (s *OAuth2ClientsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) Float64X

func (s *OAuth2ClientsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OAuth2ClientsSelect) Float64s

func (s *OAuth2ClientsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) Float64sX

func (s *OAuth2ClientsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OAuth2ClientsSelect) Int

func (s *OAuth2ClientsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) IntX

func (s *OAuth2ClientsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OAuth2ClientsSelect) Ints

func (s *OAuth2ClientsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) IntsX

func (s *OAuth2ClientsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OAuth2ClientsSelect) Scan

func (_s *OAuth2ClientsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OAuth2ClientsSelect) ScanX

func (s *OAuth2ClientsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OAuth2ClientsSelect) String

func (s *OAuth2ClientsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) StringX

func (s *OAuth2ClientsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OAuth2ClientsSelect) Strings

func (s *OAuth2ClientsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OAuth2ClientsSelect) StringsX

func (s *OAuth2ClientsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OAuth2ClientsSlice

type OAuth2ClientsSlice []*OAuth2Clients

OAuth2ClientsSlice is a parsable slice of OAuth2Clients.

type OAuth2ClientsUpdate

type OAuth2ClientsUpdate struct {
	// contains filtered or unexported fields
}

OAuth2ClientsUpdate is the builder for updating OAuth2Clients entities.

func (*OAuth2ClientsUpdate) AddClientStatus

func (_u *OAuth2ClientsUpdate) AddClientStatus(v int) *OAuth2ClientsUpdate

AddClientStatus adds value to the "client_status" field.

func (*OAuth2ClientsUpdate) AddCreatedBy

func (_u *OAuth2ClientsUpdate) AddCreatedBy(v int64) *OAuth2ClientsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*OAuth2ClientsUpdate) AddUpdatedBy

func (_u *OAuth2ClientsUpdate) AddUpdatedBy(v int64) *OAuth2ClientsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*OAuth2ClientsUpdate) AppendGrantTypes

func (_u *OAuth2ClientsUpdate) AppendGrantTypes(v []string) *OAuth2ClientsUpdate

AppendGrantTypes appends value to the "grant_types" field.

func (*OAuth2ClientsUpdate) AppendRedirectUris

func (_u *OAuth2ClientsUpdate) AppendRedirectUris(v []string) *OAuth2ClientsUpdate

AppendRedirectUris appends value to the "redirect_uris" field.

func (*OAuth2ClientsUpdate) AppendScopes

func (_u *OAuth2ClientsUpdate) AppendScopes(v []string) *OAuth2ClientsUpdate

AppendScopes appends value to the "scopes" field.

func (*OAuth2ClientsUpdate) ClearCreatedBy

func (_u *OAuth2ClientsUpdate) ClearCreatedBy() *OAuth2ClientsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*OAuth2ClientsUpdate) ClearDeletedAt

func (_u *OAuth2ClientsUpdate) ClearDeletedAt() *OAuth2ClientsUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*OAuth2ClientsUpdate) ClearGrantTypes

func (_u *OAuth2ClientsUpdate) ClearGrantTypes() *OAuth2ClientsUpdate

ClearGrantTypes clears the value of the "grant_types" field.

func (*OAuth2ClientsUpdate) ClearRedirectUris

func (_u *OAuth2ClientsUpdate) ClearRedirectUris() *OAuth2ClientsUpdate

ClearRedirectUris clears the value of the "redirect_uris" field.

func (*OAuth2ClientsUpdate) ClearScopes

func (_u *OAuth2ClientsUpdate) ClearScopes() *OAuth2ClientsUpdate

ClearScopes clears the value of the "scopes" field.

func (*OAuth2ClientsUpdate) ClearUpdatedBy

func (_u *OAuth2ClientsUpdate) ClearUpdatedBy() *OAuth2ClientsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*OAuth2ClientsUpdate) Exec

func (_u *OAuth2ClientsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OAuth2ClientsUpdate) ExecX

func (_u *OAuth2ClientsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2ClientsUpdate) Mutation

Mutation returns the OAuth2ClientsMutation object of the builder.

func (*OAuth2ClientsUpdate) Save

func (_u *OAuth2ClientsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OAuth2ClientsUpdate) SaveX

func (_u *OAuth2ClientsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OAuth2ClientsUpdate) SetClientID

func (_u *OAuth2ClientsUpdate) SetClientID(v string) *OAuth2ClientsUpdate

SetClientID sets the "client_id" field.

func (*OAuth2ClientsUpdate) SetClientSecretHash

func (_u *OAuth2ClientsUpdate) SetClientSecretHash(v string) *OAuth2ClientsUpdate

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuth2ClientsUpdate) SetClientStatus

func (_u *OAuth2ClientsUpdate) SetClientStatus(v int) *OAuth2ClientsUpdate

SetClientStatus sets the "client_status" field.

func (*OAuth2ClientsUpdate) SetCreatedBy

func (_u *OAuth2ClientsUpdate) SetCreatedBy(v int64) *OAuth2ClientsUpdate

SetCreatedBy sets the "created_by" field.

func (*OAuth2ClientsUpdate) SetDeletedAt

func (_u *OAuth2ClientsUpdate) SetDeletedAt(v time.Time) *OAuth2ClientsUpdate

SetDeletedAt sets the "deleted_at" field.

func (*OAuth2ClientsUpdate) SetDescription

func (_u *OAuth2ClientsUpdate) SetDescription(v string) *OAuth2ClientsUpdate

SetDescription sets the "description" field.

func (*OAuth2ClientsUpdate) SetDisplayName

func (_u *OAuth2ClientsUpdate) SetDisplayName(v string) *OAuth2ClientsUpdate

SetDisplayName sets the "display_name" field.

func (*OAuth2ClientsUpdate) SetGrantTypes

func (_u *OAuth2ClientsUpdate) SetGrantTypes(v []string) *OAuth2ClientsUpdate

SetGrantTypes sets the "grant_types" field.

func (*OAuth2ClientsUpdate) SetLogoURL

func (_u *OAuth2ClientsUpdate) SetLogoURL(v string) *OAuth2ClientsUpdate

SetLogoURL sets the "logo_url" field.

func (*OAuth2ClientsUpdate) SetNillableClientID

func (_u *OAuth2ClientsUpdate) SetNillableClientID(v *string) *OAuth2ClientsUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableClientSecretHash

func (_u *OAuth2ClientsUpdate) SetNillableClientSecretHash(v *string) *OAuth2ClientsUpdate

SetNillableClientSecretHash sets the "client_secret_hash" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableClientStatus

func (_u *OAuth2ClientsUpdate) SetNillableClientStatus(v *int) *OAuth2ClientsUpdate

SetNillableClientStatus sets the "client_status" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableCreatedBy

func (_u *OAuth2ClientsUpdate) SetNillableCreatedBy(v *int64) *OAuth2ClientsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableDeletedAt

func (_u *OAuth2ClientsUpdate) SetNillableDeletedAt(v *time.Time) *OAuth2ClientsUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableDescription

func (_u *OAuth2ClientsUpdate) SetNillableDescription(v *string) *OAuth2ClientsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableDisplayName

func (_u *OAuth2ClientsUpdate) SetNillableDisplayName(v *string) *OAuth2ClientsUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableLogoURL

func (_u *OAuth2ClientsUpdate) SetNillableLogoURL(v *string) *OAuth2ClientsUpdate

SetNillableLogoURL sets the "logo_url" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetNillableUpdatedBy

func (_u *OAuth2ClientsUpdate) SetNillableUpdatedBy(v *int64) *OAuth2ClientsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*OAuth2ClientsUpdate) SetRedirectUris

func (_u *OAuth2ClientsUpdate) SetRedirectUris(v []string) *OAuth2ClientsUpdate

SetRedirectUris sets the "redirect_uris" field.

func (*OAuth2ClientsUpdate) SetScopes

func (_u *OAuth2ClientsUpdate) SetScopes(v []string) *OAuth2ClientsUpdate

SetScopes sets the "scopes" field.

func (*OAuth2ClientsUpdate) SetUpdatedAt

func (_u *OAuth2ClientsUpdate) SetUpdatedAt(v time.Time) *OAuth2ClientsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2ClientsUpdate) SetUpdatedBy

func (_u *OAuth2ClientsUpdate) SetUpdatedBy(v int64) *OAuth2ClientsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*OAuth2ClientsUpdate) Where

Where appends a list predicates to the OAuth2ClientsUpdate builder.

type OAuth2ClientsUpdateOne

type OAuth2ClientsUpdateOne struct {
	// contains filtered or unexported fields
}

OAuth2ClientsUpdateOne is the builder for updating a single OAuth2Clients entity.

func (*OAuth2ClientsUpdateOne) AddClientStatus

func (_u *OAuth2ClientsUpdateOne) AddClientStatus(v int) *OAuth2ClientsUpdateOne

AddClientStatus adds value to the "client_status" field.

func (*OAuth2ClientsUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*OAuth2ClientsUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*OAuth2ClientsUpdateOne) AppendGrantTypes

func (_u *OAuth2ClientsUpdateOne) AppendGrantTypes(v []string) *OAuth2ClientsUpdateOne

AppendGrantTypes appends value to the "grant_types" field.

func (*OAuth2ClientsUpdateOne) AppendRedirectUris

func (_u *OAuth2ClientsUpdateOne) AppendRedirectUris(v []string) *OAuth2ClientsUpdateOne

AppendRedirectUris appends value to the "redirect_uris" field.

func (*OAuth2ClientsUpdateOne) AppendScopes

func (_u *OAuth2ClientsUpdateOne) AppendScopes(v []string) *OAuth2ClientsUpdateOne

AppendScopes appends value to the "scopes" field.

func (*OAuth2ClientsUpdateOne) ClearCreatedBy

func (_u *OAuth2ClientsUpdateOne) ClearCreatedBy() *OAuth2ClientsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*OAuth2ClientsUpdateOne) ClearDeletedAt

func (_u *OAuth2ClientsUpdateOne) ClearDeletedAt() *OAuth2ClientsUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*OAuth2ClientsUpdateOne) ClearGrantTypes

func (_u *OAuth2ClientsUpdateOne) ClearGrantTypes() *OAuth2ClientsUpdateOne

ClearGrantTypes clears the value of the "grant_types" field.

func (*OAuth2ClientsUpdateOne) ClearRedirectUris

func (_u *OAuth2ClientsUpdateOne) ClearRedirectUris() *OAuth2ClientsUpdateOne

ClearRedirectUris clears the value of the "redirect_uris" field.

func (*OAuth2ClientsUpdateOne) ClearScopes

ClearScopes clears the value of the "scopes" field.

func (*OAuth2ClientsUpdateOne) ClearUpdatedBy

func (_u *OAuth2ClientsUpdateOne) ClearUpdatedBy() *OAuth2ClientsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*OAuth2ClientsUpdateOne) Exec

Exec executes the query on the entity.

func (*OAuth2ClientsUpdateOne) ExecX

func (_u *OAuth2ClientsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2ClientsUpdateOne) Mutation

Mutation returns the OAuth2ClientsMutation object of the builder.

func (*OAuth2ClientsUpdateOne) Save

Save executes the query and returns the updated OAuth2Clients entity.

func (*OAuth2ClientsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OAuth2ClientsUpdateOne) Select

func (_u *OAuth2ClientsUpdateOne) Select(field string, fields ...string) *OAuth2ClientsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OAuth2ClientsUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*OAuth2ClientsUpdateOne) SetClientSecretHash

func (_u *OAuth2ClientsUpdateOne) SetClientSecretHash(v string) *OAuth2ClientsUpdateOne

SetClientSecretHash sets the "client_secret_hash" field.

func (*OAuth2ClientsUpdateOne) SetClientStatus

func (_u *OAuth2ClientsUpdateOne) SetClientStatus(v int) *OAuth2ClientsUpdateOne

SetClientStatus sets the "client_status" field.

func (*OAuth2ClientsUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*OAuth2ClientsUpdateOne) SetDeletedAt

SetDeletedAt sets the "deleted_at" field.

func (*OAuth2ClientsUpdateOne) SetDescription

func (_u *OAuth2ClientsUpdateOne) SetDescription(v string) *OAuth2ClientsUpdateOne

SetDescription sets the "description" field.

func (*OAuth2ClientsUpdateOne) SetDisplayName

func (_u *OAuth2ClientsUpdateOne) SetDisplayName(v string) *OAuth2ClientsUpdateOne

SetDisplayName sets the "display_name" field.

func (*OAuth2ClientsUpdateOne) SetGrantTypes

func (_u *OAuth2ClientsUpdateOne) SetGrantTypes(v []string) *OAuth2ClientsUpdateOne

SetGrantTypes sets the "grant_types" field.

func (*OAuth2ClientsUpdateOne) SetLogoURL

SetLogoURL sets the "logo_url" field.

func (*OAuth2ClientsUpdateOne) SetNillableClientID

func (_u *OAuth2ClientsUpdateOne) SetNillableClientID(v *string) *OAuth2ClientsUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableClientSecretHash

func (_u *OAuth2ClientsUpdateOne) SetNillableClientSecretHash(v *string) *OAuth2ClientsUpdateOne

SetNillableClientSecretHash sets the "client_secret_hash" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableClientStatus

func (_u *OAuth2ClientsUpdateOne) SetNillableClientStatus(v *int) *OAuth2ClientsUpdateOne

SetNillableClientStatus sets the "client_status" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableCreatedBy

func (_u *OAuth2ClientsUpdateOne) SetNillableCreatedBy(v *int64) *OAuth2ClientsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableDeletedAt

func (_u *OAuth2ClientsUpdateOne) SetNillableDeletedAt(v *time.Time) *OAuth2ClientsUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableDescription

func (_u *OAuth2ClientsUpdateOne) SetNillableDescription(v *string) *OAuth2ClientsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableDisplayName

func (_u *OAuth2ClientsUpdateOne) SetNillableDisplayName(v *string) *OAuth2ClientsUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableLogoURL

func (_u *OAuth2ClientsUpdateOne) SetNillableLogoURL(v *string) *OAuth2ClientsUpdateOne

SetNillableLogoURL sets the "logo_url" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetNillableUpdatedBy

func (_u *OAuth2ClientsUpdateOne) SetNillableUpdatedBy(v *int64) *OAuth2ClientsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*OAuth2ClientsUpdateOne) SetRedirectUris

func (_u *OAuth2ClientsUpdateOne) SetRedirectUris(v []string) *OAuth2ClientsUpdateOne

SetRedirectUris sets the "redirect_uris" field.

func (*OAuth2ClientsUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OAuth2ClientsUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2ClientsUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*OAuth2ClientsUpdateOne) Where

Where appends a list predicates to the OAuth2ClientsUpdate builder.

type OAuth2Codes

type OAuth2Codes 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"`
	// 授权码的 SHA-256 哈希值,不存储明文
	CodeHash string `json:"-"`
	// OAuth2 客户端 ID,关联 lion_oauth2_clients.client_id
	ClientID string `json:"client_id,omitempty"`
	// 回调地址(签发时精确匹配)
	RedirectURI string `json:"redirect_uri,omitempty"`
	// 用户 ID,关联 lion_users 表
	UserID int `json:"user_id,omitempty"`
	// 用户名(用于 email 实时查 DB 的查询键)
	Username string `json:"username,omitempty"`
	// 授权范围列表
	Scopes []string `json:"scopes,omitempty"`
	// state 参数,防 CSRF
	State string `json:"state,omitempty"`
	// OIDC nonce 参数,用于防重放
	Nonce string `json:"nonce,omitempty"`
	// PKCE code_challenge 值
	CodeChallenge string `json:"code_challenge,omitempty"`
	// PKCE code_challenge_method: S256 或 plain
	CodeChallengeMethod string `json:"code_challenge_method,omitempty"`
	// 授权码过期时间
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// 授权码消费时间,NULL 表示未使用;非 NULL 表示已消费(替代 used bool,可审计消费时间)
	ConsumedAt *time.Time `json:"consumed_at,omitempty"`
	// contains filtered or unexported fields
}

OAuth2Codes is the model entity for the OAuth2Codes schema.

func (*OAuth2Codes) String

func (_m *OAuth2Codes) String() string

String implements the fmt.Stringer.

func (*OAuth2Codes) Unwrap

func (_m *OAuth2Codes) Unwrap() *OAuth2Codes

Unwrap unwraps the OAuth2Codes 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 (*OAuth2Codes) Update

func (_m *OAuth2Codes) Update() *OAuth2CodesUpdateOne

Update returns a builder for updating this OAuth2Codes. Note that you need to call OAuth2Codes.Unwrap() before calling this method if this OAuth2Codes was returned from a transaction, and the transaction was committed or rolled back.

func (*OAuth2Codes) Value

func (_m *OAuth2Codes) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OAuth2Codes. This includes values selected through modifiers, order, etc.

type OAuth2CodesClient

type OAuth2CodesClient struct {
	// contains filtered or unexported fields
}

OAuth2CodesClient is a client for the OAuth2Codes schema.

func NewOAuth2CodesClient

func NewOAuth2CodesClient(c config) *OAuth2CodesClient

NewOAuth2CodesClient returns a client for the OAuth2Codes from the given config.

func (*OAuth2CodesClient) Create

func (c *OAuth2CodesClient) Create() *OAuth2CodesCreate

Create returns a builder for creating a OAuth2Codes entity.

func (*OAuth2CodesClient) CreateBulk

func (c *OAuth2CodesClient) CreateBulk(builders ...*OAuth2CodesCreate) *OAuth2CodesCreateBulk

CreateBulk returns a builder for creating a bulk of OAuth2Codes entities.

func (*OAuth2CodesClient) Delete

func (c *OAuth2CodesClient) Delete() *OAuth2CodesDelete

Delete returns a delete builder for OAuth2Codes.

func (*OAuth2CodesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OAuth2CodesClient) DeleteOneID

func (c *OAuth2CodesClient) DeleteOneID(id int) *OAuth2CodesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OAuth2CodesClient) Get

func (c *OAuth2CodesClient) Get(ctx context.Context, id int) (*OAuth2Codes, error)

Get returns a OAuth2Codes entity by its id.

func (*OAuth2CodesClient) GetX

func (c *OAuth2CodesClient) GetX(ctx context.Context, id int) *OAuth2Codes

GetX is like Get, but panics if an error occurs.

func (*OAuth2CodesClient) Hooks

func (c *OAuth2CodesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OAuth2CodesClient) Intercept

func (c *OAuth2CodesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `oauth2codes.Intercept(f(g(h())))`.

func (*OAuth2CodesClient) Interceptors

func (c *OAuth2CodesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OAuth2CodesClient) MapCreateBulk

func (c *OAuth2CodesClient) MapCreateBulk(slice any, setFunc func(*OAuth2CodesCreate, int)) *OAuth2CodesCreateBulk

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 (*OAuth2CodesClient) Query

func (c *OAuth2CodesClient) Query() *OAuth2CodesQuery

Query returns a query builder for OAuth2Codes.

func (*OAuth2CodesClient) Update

func (c *OAuth2CodesClient) Update() *OAuth2CodesUpdate

Update returns an update builder for OAuth2Codes.

func (*OAuth2CodesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OAuth2CodesClient) UpdateOneID

func (c *OAuth2CodesClient) UpdateOneID(id int) *OAuth2CodesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OAuth2CodesClient) Use

func (c *OAuth2CodesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `oauth2codes.Hooks(f(g(h())))`.

type OAuth2CodesCreate

type OAuth2CodesCreate struct {
	// contains filtered or unexported fields
}

OAuth2CodesCreate is the builder for creating a OAuth2Codes entity.

func (*OAuth2CodesCreate) Exec

func (_c *OAuth2CodesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OAuth2CodesCreate) ExecX

func (_c *OAuth2CodesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2CodesCreate) Mutation

func (_c *OAuth2CodesCreate) Mutation() *OAuth2CodesMutation

Mutation returns the OAuth2CodesMutation object of the builder.

func (*OAuth2CodesCreate) Save

Save creates the OAuth2Codes in the database.

func (*OAuth2CodesCreate) SaveX

func (_c *OAuth2CodesCreate) SaveX(ctx context.Context) *OAuth2Codes

SaveX calls Save and panics if Save returns an error.

func (*OAuth2CodesCreate) SetClientID

func (_c *OAuth2CodesCreate) SetClientID(v string) *OAuth2CodesCreate

SetClientID sets the "client_id" field.

func (*OAuth2CodesCreate) SetCodeChallenge

func (_c *OAuth2CodesCreate) SetCodeChallenge(v string) *OAuth2CodesCreate

SetCodeChallenge sets the "code_challenge" field.

func (*OAuth2CodesCreate) SetCodeChallengeMethod

func (_c *OAuth2CodesCreate) SetCodeChallengeMethod(v string) *OAuth2CodesCreate

SetCodeChallengeMethod sets the "code_challenge_method" field.

func (*OAuth2CodesCreate) SetCodeHash

func (_c *OAuth2CodesCreate) SetCodeHash(v string) *OAuth2CodesCreate

SetCodeHash sets the "code_hash" field.

func (*OAuth2CodesCreate) SetConsumedAt

func (_c *OAuth2CodesCreate) SetConsumedAt(v time.Time) *OAuth2CodesCreate

SetConsumedAt sets the "consumed_at" field.

func (*OAuth2CodesCreate) SetCreatedAt

func (_c *OAuth2CodesCreate) SetCreatedAt(v time.Time) *OAuth2CodesCreate

SetCreatedAt sets the "created_at" field.

func (*OAuth2CodesCreate) SetExpiresAt

func (_c *OAuth2CodesCreate) SetExpiresAt(v time.Time) *OAuth2CodesCreate

SetExpiresAt sets the "expires_at" field.

func (*OAuth2CodesCreate) SetNillableCodeChallenge

func (_c *OAuth2CodesCreate) SetNillableCodeChallenge(v *string) *OAuth2CodesCreate

SetNillableCodeChallenge sets the "code_challenge" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableCodeChallengeMethod

func (_c *OAuth2CodesCreate) SetNillableCodeChallengeMethod(v *string) *OAuth2CodesCreate

SetNillableCodeChallengeMethod sets the "code_challenge_method" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableConsumedAt

func (_c *OAuth2CodesCreate) SetNillableConsumedAt(v *time.Time) *OAuth2CodesCreate

SetNillableConsumedAt sets the "consumed_at" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableCreatedAt

func (_c *OAuth2CodesCreate) SetNillableCreatedAt(v *time.Time) *OAuth2CodesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableNonce

func (_c *OAuth2CodesCreate) SetNillableNonce(v *string) *OAuth2CodesCreate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableState

func (_c *OAuth2CodesCreate) SetNillableState(v *string) *OAuth2CodesCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableUpdatedAt

func (_c *OAuth2CodesCreate) SetNillableUpdatedAt(v *time.Time) *OAuth2CodesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableUserID

func (_c *OAuth2CodesCreate) SetNillableUserID(v *int) *OAuth2CodesCreate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNillableUsername

func (_c *OAuth2CodesCreate) SetNillableUsername(v *string) *OAuth2CodesCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*OAuth2CodesCreate) SetNonce

func (_c *OAuth2CodesCreate) SetNonce(v string) *OAuth2CodesCreate

SetNonce sets the "nonce" field.

func (*OAuth2CodesCreate) SetRedirectURI

func (_c *OAuth2CodesCreate) SetRedirectURI(v string) *OAuth2CodesCreate

SetRedirectURI sets the "redirect_uri" field.

func (*OAuth2CodesCreate) SetScopes

func (_c *OAuth2CodesCreate) SetScopes(v []string) *OAuth2CodesCreate

SetScopes sets the "scopes" field.

func (*OAuth2CodesCreate) SetState

func (_c *OAuth2CodesCreate) SetState(v string) *OAuth2CodesCreate

SetState sets the "state" field.

func (*OAuth2CodesCreate) SetUpdatedAt

func (_c *OAuth2CodesCreate) SetUpdatedAt(v time.Time) *OAuth2CodesCreate

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2CodesCreate) SetUserID

func (_c *OAuth2CodesCreate) SetUserID(v int) *OAuth2CodesCreate

SetUserID sets the "user_id" field.

func (*OAuth2CodesCreate) SetUsername

func (_c *OAuth2CodesCreate) SetUsername(v string) *OAuth2CodesCreate

SetUsername sets the "username" field.

type OAuth2CodesCreateBulk

type OAuth2CodesCreateBulk struct {
	// contains filtered or unexported fields
}

OAuth2CodesCreateBulk is the builder for creating many OAuth2Codes entities in bulk.

func (*OAuth2CodesCreateBulk) Exec

Exec executes the query.

func (*OAuth2CodesCreateBulk) ExecX

func (_c *OAuth2CodesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2CodesCreateBulk) Save

Save creates the OAuth2Codes entities in the database.

func (*OAuth2CodesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type OAuth2CodesDelete

type OAuth2CodesDelete struct {
	// contains filtered or unexported fields
}

OAuth2CodesDelete is the builder for deleting a OAuth2Codes entity.

func (*OAuth2CodesDelete) Exec

func (_d *OAuth2CodesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OAuth2CodesDelete) ExecX

func (_d *OAuth2CodesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2CodesDelete) Where

Where appends a list predicates to the OAuth2CodesDelete builder.

type OAuth2CodesDeleteOne

type OAuth2CodesDeleteOne struct {
	// contains filtered or unexported fields
}

OAuth2CodesDeleteOne is the builder for deleting a single OAuth2Codes entity.

func (*OAuth2CodesDeleteOne) Exec

func (_d *OAuth2CodesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OAuth2CodesDeleteOne) ExecX

func (_d *OAuth2CodesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2CodesDeleteOne) Where

Where appends a list predicates to the OAuth2CodesDelete builder.

type OAuth2CodesGroupBy

type OAuth2CodesGroupBy struct {
	// contains filtered or unexported fields
}

OAuth2CodesGroupBy is the group-by builder for OAuth2Codes entities.

func (*OAuth2CodesGroupBy) Aggregate

func (_g *OAuth2CodesGroupBy) Aggregate(fns ...AggregateFunc) *OAuth2CodesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OAuth2CodesGroupBy) Bool

func (s *OAuth2CodesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) BoolX

func (s *OAuth2CodesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Bools

func (s *OAuth2CodesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) BoolsX

func (s *OAuth2CodesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Float64

func (s *OAuth2CodesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) Float64X

func (s *OAuth2CodesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Float64s

func (s *OAuth2CodesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) Float64sX

func (s *OAuth2CodesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Int

func (s *OAuth2CodesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) IntX

func (s *OAuth2CodesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Ints

func (s *OAuth2CodesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) IntsX

func (s *OAuth2CodesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Scan

func (_g *OAuth2CodesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OAuth2CodesGroupBy) ScanX

func (s *OAuth2CodesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OAuth2CodesGroupBy) String

func (s *OAuth2CodesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) StringX

func (s *OAuth2CodesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OAuth2CodesGroupBy) Strings

func (s *OAuth2CodesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesGroupBy) StringsX

func (s *OAuth2CodesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OAuth2CodesMutation

type OAuth2CodesMutation struct {
	// contains filtered or unexported fields
}

OAuth2CodesMutation represents an operation that mutates the OAuth2Codes nodes in the graph.

func (*OAuth2CodesMutation) AddField

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) AddUserID

func (m *OAuth2CodesMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*OAuth2CodesMutation) AddedEdges

func (m *OAuth2CodesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OAuth2CodesMutation) AddedField

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) AddedFields

func (m *OAuth2CodesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OAuth2CodesMutation) AddedIDs

func (m *OAuth2CodesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OAuth2CodesMutation) AddedUserID

func (m *OAuth2CodesMutation) AddedUserID() (r int, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*OAuth2CodesMutation) AppendScopes

func (m *OAuth2CodesMutation) AppendScopes(s []string)

AppendScopes adds s to the "scopes" field.

func (*OAuth2CodesMutation) AppendedScopes

func (m *OAuth2CodesMutation) AppendedScopes() ([]string, bool)

AppendedScopes returns the list of values that were appended to the "scopes" field in this mutation.

func (*OAuth2CodesMutation) ClearConsumedAt

func (m *OAuth2CodesMutation) ClearConsumedAt()

ClearConsumedAt clears the value of the "consumed_at" field.

func (*OAuth2CodesMutation) ClearEdge

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ClearField

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ClearScopes

func (m *OAuth2CodesMutation) ClearScopes()

ClearScopes clears the value of the "scopes" field.

func (*OAuth2CodesMutation) ClearedEdges

func (m *OAuth2CodesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OAuth2CodesMutation) ClearedFields

func (m *OAuth2CodesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OAuth2CodesMutation) Client

func (m OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ClientID

func (m *OAuth2CodesMutation) ClientID() (r string, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*OAuth2CodesMutation) CodeChallenge

func (m *OAuth2CodesMutation) CodeChallenge() (r string, exists bool)

CodeChallenge returns the value of the "code_challenge" field in the mutation.

func (*OAuth2CodesMutation) CodeChallengeMethod

func (m *OAuth2CodesMutation) CodeChallengeMethod() (r string, exists bool)

CodeChallengeMethod returns the value of the "code_challenge_method" field in the mutation.

func (*OAuth2CodesMutation) CodeHash

func (m *OAuth2CodesMutation) CodeHash() (r string, exists bool)

CodeHash returns the value of the "code_hash" field in the mutation.

func (*OAuth2CodesMutation) ConsumedAt

func (m *OAuth2CodesMutation) ConsumedAt() (r time.Time, exists bool)

ConsumedAt returns the value of the "consumed_at" field in the mutation.

func (*OAuth2CodesMutation) ConsumedAtCleared

func (m *OAuth2CodesMutation) ConsumedAtCleared() bool

ConsumedAtCleared returns if the "consumed_at" field was cleared in this mutation.

func (*OAuth2CodesMutation) CreatedAt

func (m *OAuth2CodesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OAuth2CodesMutation) EdgeCleared

func (m *OAuth2CodesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OAuth2CodesMutation) ExpiresAt

func (m *OAuth2CodesMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*OAuth2CodesMutation) Field

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) FieldCleared

func (m *OAuth2CodesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OAuth2CodesMutation) Fields

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ID

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) IDs

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) Nonce

func (m *OAuth2CodesMutation) Nonce() (r string, exists bool)

Nonce returns the value of the "nonce" field in the mutation.

func (*OAuth2CodesMutation) OldClientID

func (m *OAuth2CodesMutation) OldClientID(ctx context.Context) (v string, err error)

OldClientID returns the old "client_id" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldCodeChallenge

func (m *OAuth2CodesMutation) OldCodeChallenge(ctx context.Context) (v string, err error)

OldCodeChallenge returns the old "code_challenge" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldCodeChallengeMethod

func (m *OAuth2CodesMutation) OldCodeChallengeMethod(ctx context.Context) (v string, err error)

OldCodeChallengeMethod returns the old "code_challenge_method" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldCodeHash

func (m *OAuth2CodesMutation) OldCodeHash(ctx context.Context) (v string, err error)

OldCodeHash returns the old "code_hash" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldConsumedAt

func (m *OAuth2CodesMutation) OldConsumedAt(ctx context.Context) (v *time.Time, err error)

OldConsumedAt returns the old "consumed_at" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldCreatedAt

func (m *OAuth2CodesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldExpiresAt

func (m *OAuth2CodesMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldField

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) OldNonce

func (m *OAuth2CodesMutation) OldNonce(ctx context.Context) (v string, err error)

OldNonce returns the old "nonce" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldRedirectURI

func (m *OAuth2CodesMutation) OldRedirectURI(ctx context.Context) (v string, err error)

OldRedirectURI returns the old "redirect_uri" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldScopes

func (m *OAuth2CodesMutation) OldScopes(ctx context.Context) (v []string, err error)

OldScopes returns the old "scopes" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldState

func (m *OAuth2CodesMutation) OldState(ctx context.Context) (v string, err error)

OldState returns the old "state" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldUpdatedAt

func (m *OAuth2CodesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldUserID

func (m *OAuth2CodesMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) OldUsername

func (m *OAuth2CodesMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the OAuth2Codes entity. If the OAuth2Codes object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OAuth2CodesMutation) Op

func (m *OAuth2CodesMutation) Op() Op

Op returns the operation name.

func (*OAuth2CodesMutation) RedirectURI

func (m *OAuth2CodesMutation) RedirectURI() (r string, exists bool)

RedirectURI returns the value of the "redirect_uri" field in the mutation.

func (*OAuth2CodesMutation) RemovedEdges

func (m *OAuth2CodesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OAuth2CodesMutation) RemovedIDs

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ResetClientID

func (m *OAuth2CodesMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OAuth2CodesMutation) ResetCodeChallenge

func (m *OAuth2CodesMutation) ResetCodeChallenge()

ResetCodeChallenge resets all changes to the "code_challenge" field.

func (*OAuth2CodesMutation) ResetCodeChallengeMethod

func (m *OAuth2CodesMutation) ResetCodeChallengeMethod()

ResetCodeChallengeMethod resets all changes to the "code_challenge_method" field.

func (*OAuth2CodesMutation) ResetCodeHash

func (m *OAuth2CodesMutation) ResetCodeHash()

ResetCodeHash resets all changes to the "code_hash" field.

func (*OAuth2CodesMutation) ResetConsumedAt

func (m *OAuth2CodesMutation) ResetConsumedAt()

ResetConsumedAt resets all changes to the "consumed_at" field.

func (*OAuth2CodesMutation) ResetCreatedAt

func (m *OAuth2CodesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OAuth2CodesMutation) ResetEdge

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ResetExpiresAt

func (m *OAuth2CodesMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*OAuth2CodesMutation) ResetField

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) ResetNonce

func (m *OAuth2CodesMutation) ResetNonce()

ResetNonce resets all changes to the "nonce" field.

func (*OAuth2CodesMutation) ResetRedirectURI

func (m *OAuth2CodesMutation) ResetRedirectURI()

ResetRedirectURI resets all changes to the "redirect_uri" field.

func (*OAuth2CodesMutation) ResetScopes

func (m *OAuth2CodesMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OAuth2CodesMutation) ResetState

func (m *OAuth2CodesMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*OAuth2CodesMutation) ResetUpdatedAt

func (m *OAuth2CodesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OAuth2CodesMutation) ResetUserID

func (m *OAuth2CodesMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*OAuth2CodesMutation) ResetUsername

func (m *OAuth2CodesMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*OAuth2CodesMutation) Scopes

func (m *OAuth2CodesMutation) Scopes() (r []string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OAuth2CodesMutation) ScopesCleared

func (m *OAuth2CodesMutation) ScopesCleared() bool

ScopesCleared returns if the "scopes" field was cleared in this mutation.

func (*OAuth2CodesMutation) SetClientID

func (m *OAuth2CodesMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OAuth2CodesMutation) SetCodeChallenge

func (m *OAuth2CodesMutation) SetCodeChallenge(s string)

SetCodeChallenge sets the "code_challenge" field.

func (*OAuth2CodesMutation) SetCodeChallengeMethod

func (m *OAuth2CodesMutation) SetCodeChallengeMethod(s string)

SetCodeChallengeMethod sets the "code_challenge_method" field.

func (*OAuth2CodesMutation) SetCodeHash

func (m *OAuth2CodesMutation) SetCodeHash(s string)

SetCodeHash sets the "code_hash" field.

func (*OAuth2CodesMutation) SetConsumedAt

func (m *OAuth2CodesMutation) SetConsumedAt(t time.Time)

SetConsumedAt sets the "consumed_at" field.

func (*OAuth2CodesMutation) SetCreatedAt

func (m *OAuth2CodesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OAuth2CodesMutation) SetExpiresAt

func (m *OAuth2CodesMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*OAuth2CodesMutation) SetField

func (m *OAuth2CodesMutation) 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 (*OAuth2CodesMutation) SetNonce

func (m *OAuth2CodesMutation) SetNonce(s string)

SetNonce sets the "nonce" field.

func (*OAuth2CodesMutation) SetOp

func (m *OAuth2CodesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OAuth2CodesMutation) SetRedirectURI

func (m *OAuth2CodesMutation) SetRedirectURI(s string)

SetRedirectURI sets the "redirect_uri" field.

func (*OAuth2CodesMutation) SetScopes

func (m *OAuth2CodesMutation) SetScopes(s []string)

SetScopes sets the "scopes" field.

func (*OAuth2CodesMutation) SetState

func (m *OAuth2CodesMutation) SetState(s string)

SetState sets the "state" field.

func (*OAuth2CodesMutation) SetUpdatedAt

func (m *OAuth2CodesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2CodesMutation) SetUserID

func (m *OAuth2CodesMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*OAuth2CodesMutation) SetUsername

func (m *OAuth2CodesMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*OAuth2CodesMutation) State

func (m *OAuth2CodesMutation) State() (r string, exists bool)

State returns the value of the "state" field in the mutation.

func (OAuth2CodesMutation) Tx

func (m OAuth2CodesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OAuth2CodesMutation) Type

func (m *OAuth2CodesMutation) Type() string

Type returns the node type of this mutation (OAuth2Codes).

func (*OAuth2CodesMutation) UpdatedAt

func (m *OAuth2CodesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OAuth2CodesMutation) UserID

func (m *OAuth2CodesMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*OAuth2CodesMutation) Username

func (m *OAuth2CodesMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*OAuth2CodesMutation) Where

func (m *OAuth2CodesMutation) Where(ps ...predicate.OAuth2Codes)

Where appends a list predicates to the OAuth2CodesMutation builder.

func (*OAuth2CodesMutation) WhereP

func (m *OAuth2CodesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OAuth2CodesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OAuth2CodesQuery

type OAuth2CodesQuery struct {
	// contains filtered or unexported fields
}

OAuth2CodesQuery is the builder for querying OAuth2Codes entities.

func (*OAuth2CodesQuery) Aggregate

func (_q *OAuth2CodesQuery) Aggregate(fns ...AggregateFunc) *OAuth2CodesSelect

Aggregate returns a OAuth2CodesSelect configured with the given aggregations.

func (*OAuth2CodesQuery) All

func (_q *OAuth2CodesQuery) All(ctx context.Context) ([]*OAuth2Codes, error)

All executes the query and returns a list of OAuth2CodesSlice.

func (*OAuth2CodesQuery) AllX

func (_q *OAuth2CodesQuery) AllX(ctx context.Context) []*OAuth2Codes

AllX is like All, but panics if an error occurs.

func (*OAuth2CodesQuery) Clone

func (_q *OAuth2CodesQuery) Clone() *OAuth2CodesQuery

Clone returns a duplicate of the OAuth2CodesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OAuth2CodesQuery) Count

func (_q *OAuth2CodesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OAuth2CodesQuery) CountX

func (_q *OAuth2CodesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OAuth2CodesQuery) Exist

func (_q *OAuth2CodesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OAuth2CodesQuery) ExistX

func (_q *OAuth2CodesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OAuth2CodesQuery) First

func (_q *OAuth2CodesQuery) First(ctx context.Context) (*OAuth2Codes, error)

First returns the first OAuth2Codes entity from the query. Returns a *NotFoundError when no OAuth2Codes was found.

func (*OAuth2CodesQuery) FirstID

func (_q *OAuth2CodesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first OAuth2Codes ID from the query. Returns a *NotFoundError when no OAuth2Codes ID was found.

func (*OAuth2CodesQuery) FirstIDX

func (_q *OAuth2CodesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*OAuth2CodesQuery) FirstX

func (_q *OAuth2CodesQuery) FirstX(ctx context.Context) *OAuth2Codes

FirstX is like First, but panics if an error occurs.

func (*OAuth2CodesQuery) GroupBy

func (_q *OAuth2CodesQuery) GroupBy(field string, fields ...string) *OAuth2CodesGroupBy

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.OAuth2Codes.Query().
	GroupBy(oauth2codes.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*OAuth2CodesQuery) IDs

func (_q *OAuth2CodesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of OAuth2Codes IDs.

func (*OAuth2CodesQuery) IDsX

func (_q *OAuth2CodesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*OAuth2CodesQuery) Limit

func (_q *OAuth2CodesQuery) Limit(limit int) *OAuth2CodesQuery

Limit the number of records to be returned by this query.

func (*OAuth2CodesQuery) Offset

func (_q *OAuth2CodesQuery) Offset(offset int) *OAuth2CodesQuery

Offset to start from.

func (*OAuth2CodesQuery) Only

func (_q *OAuth2CodesQuery) Only(ctx context.Context) (*OAuth2Codes, error)

Only returns a single OAuth2Codes entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OAuth2Codes entity is found. Returns a *NotFoundError when no OAuth2Codes entities are found.

func (*OAuth2CodesQuery) OnlyID

func (_q *OAuth2CodesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only OAuth2Codes ID in the query. Returns a *NotSingularError when more than one OAuth2Codes ID is found. Returns a *NotFoundError when no entities are found.

func (*OAuth2CodesQuery) OnlyIDX

func (_q *OAuth2CodesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OAuth2CodesQuery) OnlyX

func (_q *OAuth2CodesQuery) OnlyX(ctx context.Context) *OAuth2Codes

OnlyX is like Only, but panics if an error occurs.

func (*OAuth2CodesQuery) Order

Order specifies how the records should be ordered.

func (*OAuth2CodesQuery) Select

func (_q *OAuth2CodesQuery) Select(fields ...string) *OAuth2CodesSelect

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.OAuth2Codes.Query().
	Select(oauth2codes.FieldCreatedAt).
	Scan(ctx, &v)

func (*OAuth2CodesQuery) Unique

func (_q *OAuth2CodesQuery) Unique(unique bool) *OAuth2CodesQuery

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 (*OAuth2CodesQuery) Where

Where adds a new predicate for the OAuth2CodesQuery builder.

type OAuth2CodesSelect

type OAuth2CodesSelect struct {
	*OAuth2CodesQuery
	// contains filtered or unexported fields
}

OAuth2CodesSelect is the builder for selecting fields of OAuth2Codes entities.

func (*OAuth2CodesSelect) Aggregate

func (_s *OAuth2CodesSelect) Aggregate(fns ...AggregateFunc) *OAuth2CodesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OAuth2CodesSelect) Bool

func (s *OAuth2CodesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) BoolX

func (s *OAuth2CodesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OAuth2CodesSelect) Bools

func (s *OAuth2CodesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) BoolsX

func (s *OAuth2CodesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OAuth2CodesSelect) Float64

func (s *OAuth2CodesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) Float64X

func (s *OAuth2CodesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OAuth2CodesSelect) Float64s

func (s *OAuth2CodesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) Float64sX

func (s *OAuth2CodesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OAuth2CodesSelect) Int

func (s *OAuth2CodesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) IntX

func (s *OAuth2CodesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OAuth2CodesSelect) Ints

func (s *OAuth2CodesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) IntsX

func (s *OAuth2CodesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OAuth2CodesSelect) Scan

func (_s *OAuth2CodesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OAuth2CodesSelect) ScanX

func (s *OAuth2CodesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OAuth2CodesSelect) String

func (s *OAuth2CodesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) StringX

func (s *OAuth2CodesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OAuth2CodesSelect) Strings

func (s *OAuth2CodesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OAuth2CodesSelect) StringsX

func (s *OAuth2CodesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OAuth2CodesSlice

type OAuth2CodesSlice []*OAuth2Codes

OAuth2CodesSlice is a parsable slice of OAuth2Codes.

type OAuth2CodesUpdate

type OAuth2CodesUpdate struct {
	// contains filtered or unexported fields
}

OAuth2CodesUpdate is the builder for updating OAuth2Codes entities.

func (*OAuth2CodesUpdate) AddUserID

func (_u *OAuth2CodesUpdate) AddUserID(v int) *OAuth2CodesUpdate

AddUserID adds value to the "user_id" field.

func (*OAuth2CodesUpdate) AppendScopes

func (_u *OAuth2CodesUpdate) AppendScopes(v []string) *OAuth2CodesUpdate

AppendScopes appends value to the "scopes" field.

func (*OAuth2CodesUpdate) ClearConsumedAt

func (_u *OAuth2CodesUpdate) ClearConsumedAt() *OAuth2CodesUpdate

ClearConsumedAt clears the value of the "consumed_at" field.

func (*OAuth2CodesUpdate) ClearScopes

func (_u *OAuth2CodesUpdate) ClearScopes() *OAuth2CodesUpdate

ClearScopes clears the value of the "scopes" field.

func (*OAuth2CodesUpdate) Exec

func (_u *OAuth2CodesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OAuth2CodesUpdate) ExecX

func (_u *OAuth2CodesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2CodesUpdate) Mutation

func (_u *OAuth2CodesUpdate) Mutation() *OAuth2CodesMutation

Mutation returns the OAuth2CodesMutation object of the builder.

func (*OAuth2CodesUpdate) Save

func (_u *OAuth2CodesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OAuth2CodesUpdate) SaveX

func (_u *OAuth2CodesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OAuth2CodesUpdate) SetClientID

func (_u *OAuth2CodesUpdate) SetClientID(v string) *OAuth2CodesUpdate

SetClientID sets the "client_id" field.

func (*OAuth2CodesUpdate) SetCodeChallenge

func (_u *OAuth2CodesUpdate) SetCodeChallenge(v string) *OAuth2CodesUpdate

SetCodeChallenge sets the "code_challenge" field.

func (*OAuth2CodesUpdate) SetCodeChallengeMethod

func (_u *OAuth2CodesUpdate) SetCodeChallengeMethod(v string) *OAuth2CodesUpdate

SetCodeChallengeMethod sets the "code_challenge_method" field.

func (*OAuth2CodesUpdate) SetCodeHash

func (_u *OAuth2CodesUpdate) SetCodeHash(v string) *OAuth2CodesUpdate

SetCodeHash sets the "code_hash" field.

func (*OAuth2CodesUpdate) SetConsumedAt

func (_u *OAuth2CodesUpdate) SetConsumedAt(v time.Time) *OAuth2CodesUpdate

SetConsumedAt sets the "consumed_at" field.

func (*OAuth2CodesUpdate) SetExpiresAt

func (_u *OAuth2CodesUpdate) SetExpiresAt(v time.Time) *OAuth2CodesUpdate

SetExpiresAt sets the "expires_at" field.

func (*OAuth2CodesUpdate) SetNillableClientID

func (_u *OAuth2CodesUpdate) SetNillableClientID(v *string) *OAuth2CodesUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableCodeChallenge

func (_u *OAuth2CodesUpdate) SetNillableCodeChallenge(v *string) *OAuth2CodesUpdate

SetNillableCodeChallenge sets the "code_challenge" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableCodeChallengeMethod

func (_u *OAuth2CodesUpdate) SetNillableCodeChallengeMethod(v *string) *OAuth2CodesUpdate

SetNillableCodeChallengeMethod sets the "code_challenge_method" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableCodeHash

func (_u *OAuth2CodesUpdate) SetNillableCodeHash(v *string) *OAuth2CodesUpdate

SetNillableCodeHash sets the "code_hash" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableConsumedAt

func (_u *OAuth2CodesUpdate) SetNillableConsumedAt(v *time.Time) *OAuth2CodesUpdate

SetNillableConsumedAt sets the "consumed_at" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableExpiresAt

func (_u *OAuth2CodesUpdate) SetNillableExpiresAt(v *time.Time) *OAuth2CodesUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableNonce

func (_u *OAuth2CodesUpdate) SetNillableNonce(v *string) *OAuth2CodesUpdate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableRedirectURI

func (_u *OAuth2CodesUpdate) SetNillableRedirectURI(v *string) *OAuth2CodesUpdate

SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableState

func (_u *OAuth2CodesUpdate) SetNillableState(v *string) *OAuth2CodesUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableUserID

func (_u *OAuth2CodesUpdate) SetNillableUserID(v *int) *OAuth2CodesUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNillableUsername

func (_u *OAuth2CodesUpdate) SetNillableUsername(v *string) *OAuth2CodesUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*OAuth2CodesUpdate) SetNonce

func (_u *OAuth2CodesUpdate) SetNonce(v string) *OAuth2CodesUpdate

SetNonce sets the "nonce" field.

func (*OAuth2CodesUpdate) SetRedirectURI

func (_u *OAuth2CodesUpdate) SetRedirectURI(v string) *OAuth2CodesUpdate

SetRedirectURI sets the "redirect_uri" field.

func (*OAuth2CodesUpdate) SetScopes

func (_u *OAuth2CodesUpdate) SetScopes(v []string) *OAuth2CodesUpdate

SetScopes sets the "scopes" field.

func (*OAuth2CodesUpdate) SetState

func (_u *OAuth2CodesUpdate) SetState(v string) *OAuth2CodesUpdate

SetState sets the "state" field.

func (*OAuth2CodesUpdate) SetUpdatedAt

func (_u *OAuth2CodesUpdate) SetUpdatedAt(v time.Time) *OAuth2CodesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2CodesUpdate) SetUserID

func (_u *OAuth2CodesUpdate) SetUserID(v int) *OAuth2CodesUpdate

SetUserID sets the "user_id" field.

func (*OAuth2CodesUpdate) SetUsername

func (_u *OAuth2CodesUpdate) SetUsername(v string) *OAuth2CodesUpdate

SetUsername sets the "username" field.

func (*OAuth2CodesUpdate) Where

Where appends a list predicates to the OAuth2CodesUpdate builder.

type OAuth2CodesUpdateOne

type OAuth2CodesUpdateOne struct {
	// contains filtered or unexported fields
}

OAuth2CodesUpdateOne is the builder for updating a single OAuth2Codes entity.

func (*OAuth2CodesUpdateOne) AddUserID

func (_u *OAuth2CodesUpdateOne) AddUserID(v int) *OAuth2CodesUpdateOne

AddUserID adds value to the "user_id" field.

func (*OAuth2CodesUpdateOne) AppendScopes

func (_u *OAuth2CodesUpdateOne) AppendScopes(v []string) *OAuth2CodesUpdateOne

AppendScopes appends value to the "scopes" field.

func (*OAuth2CodesUpdateOne) ClearConsumedAt

func (_u *OAuth2CodesUpdateOne) ClearConsumedAt() *OAuth2CodesUpdateOne

ClearConsumedAt clears the value of the "consumed_at" field.

func (*OAuth2CodesUpdateOne) ClearScopes

func (_u *OAuth2CodesUpdateOne) ClearScopes() *OAuth2CodesUpdateOne

ClearScopes clears the value of the "scopes" field.

func (*OAuth2CodesUpdateOne) Exec

func (_u *OAuth2CodesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OAuth2CodesUpdateOne) ExecX

func (_u *OAuth2CodesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OAuth2CodesUpdateOne) Mutation

func (_u *OAuth2CodesUpdateOne) Mutation() *OAuth2CodesMutation

Mutation returns the OAuth2CodesMutation object of the builder.

func (*OAuth2CodesUpdateOne) Save

Save executes the query and returns the updated OAuth2Codes entity.

func (*OAuth2CodesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OAuth2CodesUpdateOne) Select

func (_u *OAuth2CodesUpdateOne) Select(field string, fields ...string) *OAuth2CodesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OAuth2CodesUpdateOne) SetClientID

func (_u *OAuth2CodesUpdateOne) SetClientID(v string) *OAuth2CodesUpdateOne

SetClientID sets the "client_id" field.

func (*OAuth2CodesUpdateOne) SetCodeChallenge

func (_u *OAuth2CodesUpdateOne) SetCodeChallenge(v string) *OAuth2CodesUpdateOne

SetCodeChallenge sets the "code_challenge" field.

func (*OAuth2CodesUpdateOne) SetCodeChallengeMethod

func (_u *OAuth2CodesUpdateOne) SetCodeChallengeMethod(v string) *OAuth2CodesUpdateOne

SetCodeChallengeMethod sets the "code_challenge_method" field.

func (*OAuth2CodesUpdateOne) SetCodeHash

func (_u *OAuth2CodesUpdateOne) SetCodeHash(v string) *OAuth2CodesUpdateOne

SetCodeHash sets the "code_hash" field.

func (*OAuth2CodesUpdateOne) SetConsumedAt

func (_u *OAuth2CodesUpdateOne) SetConsumedAt(v time.Time) *OAuth2CodesUpdateOne

SetConsumedAt sets the "consumed_at" field.

func (*OAuth2CodesUpdateOne) SetExpiresAt

func (_u *OAuth2CodesUpdateOne) SetExpiresAt(v time.Time) *OAuth2CodesUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*OAuth2CodesUpdateOne) SetNillableClientID

func (_u *OAuth2CodesUpdateOne) SetNillableClientID(v *string) *OAuth2CodesUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableCodeChallenge

func (_u *OAuth2CodesUpdateOne) SetNillableCodeChallenge(v *string) *OAuth2CodesUpdateOne

SetNillableCodeChallenge sets the "code_challenge" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableCodeChallengeMethod

func (_u *OAuth2CodesUpdateOne) SetNillableCodeChallengeMethod(v *string) *OAuth2CodesUpdateOne

SetNillableCodeChallengeMethod sets the "code_challenge_method" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableCodeHash

func (_u *OAuth2CodesUpdateOne) SetNillableCodeHash(v *string) *OAuth2CodesUpdateOne

SetNillableCodeHash sets the "code_hash" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableConsumedAt

func (_u *OAuth2CodesUpdateOne) SetNillableConsumedAt(v *time.Time) *OAuth2CodesUpdateOne

SetNillableConsumedAt sets the "consumed_at" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableExpiresAt

func (_u *OAuth2CodesUpdateOne) SetNillableExpiresAt(v *time.Time) *OAuth2CodesUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableNonce

func (_u *OAuth2CodesUpdateOne) SetNillableNonce(v *string) *OAuth2CodesUpdateOne

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableRedirectURI

func (_u *OAuth2CodesUpdateOne) SetNillableRedirectURI(v *string) *OAuth2CodesUpdateOne

SetNillableRedirectURI sets the "redirect_uri" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableState

func (_u *OAuth2CodesUpdateOne) SetNillableState(v *string) *OAuth2CodesUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableUserID

func (_u *OAuth2CodesUpdateOne) SetNillableUserID(v *int) *OAuth2CodesUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNillableUsername

func (_u *OAuth2CodesUpdateOne) SetNillableUsername(v *string) *OAuth2CodesUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*OAuth2CodesUpdateOne) SetNonce

SetNonce sets the "nonce" field.

func (*OAuth2CodesUpdateOne) SetRedirectURI

func (_u *OAuth2CodesUpdateOne) SetRedirectURI(v string) *OAuth2CodesUpdateOne

SetRedirectURI sets the "redirect_uri" field.

func (*OAuth2CodesUpdateOne) SetScopes

func (_u *OAuth2CodesUpdateOne) SetScopes(v []string) *OAuth2CodesUpdateOne

SetScopes sets the "scopes" field.

func (*OAuth2CodesUpdateOne) SetState

SetState sets the "state" field.

func (*OAuth2CodesUpdateOne) SetUpdatedAt

func (_u *OAuth2CodesUpdateOne) SetUpdatedAt(v time.Time) *OAuth2CodesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OAuth2CodesUpdateOne) SetUserID

func (_u *OAuth2CodesUpdateOne) SetUserID(v int) *OAuth2CodesUpdateOne

SetUserID sets the "user_id" field.

func (*OAuth2CodesUpdateOne) SetUsername

func (_u *OAuth2CodesUpdateOne) SetUsername(v string) *OAuth2CodesUpdateOne

SetUsername sets the "username" field.

func (*OAuth2CodesUpdateOne) Where

Where appends a list predicates to the OAuth2CodesUpdate builder.

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 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"`
	// 对我展示的权限名称,如:管理用户列表
	Code string `json:"code,omitempty"`
	// 国际化键值,用于前端多语言显示的标识符
	DisplayName string `json:"display_name,omitempty"`
	// 是否启用该资源项,禁用后完全不可访问
	PolicyStatus int `json:"policy_status,omitempty"`
	// 策略内容
	Statements []*adminv1.PolicyStatement `json:"statements,omitempty"`
	// 是否系统内置/受保护的策略,受保护的策略不可删除
	Protected bool `json:"protected,omitempty"`
	// 详细描述
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PoliciesQuery when eager-loading is set.
	Edges PoliciesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Policies is the model entity for the Policies schema.

func (*Policies) QueryLionRolePolicies

func (_m *Policies) QueryLionRolePolicies() *RolePoliciesQuery

QueryLionRolePolicies queries the "lion_role_policies" edge of the Policies entity.

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) QueryLionRolePolicies

func (c *PoliciesClient) QueryLionRolePolicies(_m *Policies) *RolePoliciesQuery

QueryLionRolePolicies queries the lion_role_policies edge of a 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) AddLionRolePolicies

func (_c *PoliciesCreate) AddLionRolePolicies(v ...*RolePolicies) *PoliciesCreate

AddLionRolePolicies adds the "lion_role_policies" edges to the RolePolicies entity.

func (*PoliciesCreate) AddLionRolePolicyIDs

func (_c *PoliciesCreate) AddLionRolePolicyIDs(ids ...int) *PoliciesCreate

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by IDs.

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) SetCode

func (_c *PoliciesCreate) SetCode(v string) *PoliciesCreate

SetCode sets the "code" field.

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) SetDescription

func (_c *PoliciesCreate) SetDescription(v string) *PoliciesCreate

SetDescription sets the "description" field.

func (*PoliciesCreate) SetDisplayName

func (_c *PoliciesCreate) SetDisplayName(v string) *PoliciesCreate

SetDisplayName sets the "display_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) SetNillableDescription

func (_c *PoliciesCreate) SetNillableDescription(v *string) *PoliciesCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PoliciesCreate) SetNillablePolicyStatus

func (_c *PoliciesCreate) SetNillablePolicyStatus(v *int) *PoliciesCreate

SetNillablePolicyStatus sets the "policy_status" field if the given value is not nil.

func (*PoliciesCreate) SetNillableProtected

func (_c *PoliciesCreate) SetNillableProtected(v *bool) *PoliciesCreate

SetNillableProtected sets the "protected" 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) SetPolicyStatus

func (_c *PoliciesCreate) SetPolicyStatus(v int) *PoliciesCreate

SetPolicyStatus sets the "policy_status" field.

func (*PoliciesCreate) SetProtected

func (_c *PoliciesCreate) SetProtected(v bool) *PoliciesCreate

SetProtected sets the "protected" field.

func (*PoliciesCreate) SetStatements

func (_c *PoliciesCreate) SetStatements(v []*adminv1.PolicyStatement) *PoliciesCreate

SetStatements sets the "statements" field.

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 PoliciesEdges

type PoliciesEdges struct {
	// LionRolePolicies holds the value of the lion_role_policies edge.
	LionRolePolicies []*RolePolicies `json:"lion_role_policies,omitempty"`
	// contains filtered or unexported fields
}

PoliciesEdges holds the relations/edges for other nodes in the graph.

func (PoliciesEdges) LionRolePoliciesOrErr

func (e PoliciesEdges) LionRolePoliciesOrErr() ([]*RolePolicies, error)

LionRolePoliciesOrErr returns the LionRolePolicies value or an error if the edge was not loaded in eager-loading.

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) AddLionRolePolicyIDs

func (m *PoliciesMutation) AddLionRolePolicyIDs(ids ...int)

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by ids.

func (*PoliciesMutation) AddPolicyStatus

func (m *PoliciesMutation) AddPolicyStatus(i int)

AddPolicyStatus adds i to the "policy_status" field.

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) AddedPolicyStatus

func (m *PoliciesMutation) AddedPolicyStatus() (r int, exists bool)

AddedPolicyStatus returns the value that was added to the "policy_status" field 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) AppendStatements

func (m *PoliciesMutation) AppendStatements(as []*adminv1.PolicyStatement)

AppendStatements adds as to the "statements" field.

func (*PoliciesMutation) AppendedStatements

func (m *PoliciesMutation) AppendedStatements() ([]*adminv1.PolicyStatement, bool)

AppendedStatements returns the list of values that were appended to the "statements" 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) ClearLionRolePolicies

func (m *PoliciesMutation) ClearLionRolePolicies()

ClearLionRolePolicies clears the "lion_role_policies" edge to the RolePolicies entity.

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) Code

func (m *PoliciesMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

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) Description

func (m *PoliciesMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*PoliciesMutation) DisplayName

func (m *PoliciesMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the 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) LionRolePoliciesCleared

func (m *PoliciesMutation) LionRolePoliciesCleared() bool

LionRolePoliciesCleared reports if the "lion_role_policies" edge to the RolePolicies entity was cleared.

func (*PoliciesMutation) LionRolePoliciesIDs

func (m *PoliciesMutation) LionRolePoliciesIDs() (ids []int)

LionRolePoliciesIDs returns the "lion_role_policies" edge IDs in the mutation.

func (*PoliciesMutation) OldCode

func (m *PoliciesMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" 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) 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) OldDescription

func (m *PoliciesMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" 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) OldDisplayName

func (m *PoliciesMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_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) 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) OldPolicyStatus

func (m *PoliciesMutation) OldPolicyStatus(ctx context.Context) (v int, err error)

OldPolicyStatus returns the old "policy_status" 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) OldProtected

func (m *PoliciesMutation) OldProtected(ctx context.Context) (v bool, err error)

OldProtected returns the old "protected" 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) OldStatements

func (m *PoliciesMutation) OldStatements(ctx context.Context) (v []*adminv1.PolicyStatement, err error)

OldStatements returns the old "statements" 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) PolicyStatus

func (m *PoliciesMutation) PolicyStatus() (r int, exists bool)

PolicyStatus returns the value of the "policy_status" field in the mutation.

func (*PoliciesMutation) Protected

func (m *PoliciesMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (*PoliciesMutation) RemoveLionRolePolicyIDs

func (m *PoliciesMutation) RemoveLionRolePolicyIDs(ids ...int)

RemoveLionRolePolicyIDs removes the "lion_role_policies" edge to the RolePolicies entity by IDs.

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) RemovedLionRolePoliciesIDs

func (m *PoliciesMutation) RemovedLionRolePoliciesIDs() (ids []int)

RemovedLionRolePolicies returns the removed IDs of the "lion_role_policies" edge to the RolePolicies entity.

func (*PoliciesMutation) ResetCode

func (m *PoliciesMutation) ResetCode()

ResetCode resets all changes to the "code" field.

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) ResetDescription

func (m *PoliciesMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*PoliciesMutation) ResetDisplayName

func (m *PoliciesMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) ResetLionRolePolicies

func (m *PoliciesMutation) ResetLionRolePolicies()

ResetLionRolePolicies resets all changes to the "lion_role_policies" edge.

func (*PoliciesMutation) ResetPolicyStatus

func (m *PoliciesMutation) ResetPolicyStatus()

ResetPolicyStatus resets all changes to the "policy_status" field.

func (*PoliciesMutation) ResetProtected

func (m *PoliciesMutation) ResetProtected()

ResetProtected resets all changes to the "protected" field.

func (*PoliciesMutation) ResetStatements

func (m *PoliciesMutation) ResetStatements()

ResetStatements resets all changes to the "statements" 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) SetCode

func (m *PoliciesMutation) SetCode(s string)

SetCode sets the "code" 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) SetDescription

func (m *PoliciesMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*PoliciesMutation) SetDisplayName

func (m *PoliciesMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) SetOp

func (m *PoliciesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PoliciesMutation) SetPolicyStatus

func (m *PoliciesMutation) SetPolicyStatus(i int)

SetPolicyStatus sets the "policy_status" field.

func (*PoliciesMutation) SetProtected

func (m *PoliciesMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

func (*PoliciesMutation) SetStatements

func (m *PoliciesMutation) SetStatements(as []*adminv1.PolicyStatement)

SetStatements sets the "statements" field.

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) Statements

func (m *PoliciesMutation) Statements() (r []*adminv1.PolicyStatement, exists bool)

Statements returns the value of the "statements" field in the mutation.

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) QueryLionRolePolicies

func (_q *PoliciesQuery) QueryLionRolePolicies() *RolePoliciesQuery

QueryLionRolePolicies chains the current query on the "lion_role_policies" edge.

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.

func (*PoliciesQuery) WithLionRolePolicies

func (_q *PoliciesQuery) WithLionRolePolicies(opts ...func(*RolePoliciesQuery)) *PoliciesQuery

WithLionRolePolicies tells the query-builder to eager-load the nodes that are connected to the "lion_role_policies" edge. The optional arguments are used to configure the query builder of the edge.

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) AddLionRolePolicies

func (_u *PoliciesUpdate) AddLionRolePolicies(v ...*RolePolicies) *PoliciesUpdate

AddLionRolePolicies adds the "lion_role_policies" edges to the RolePolicies entity.

func (*PoliciesUpdate) AddLionRolePolicyIDs

func (_u *PoliciesUpdate) AddLionRolePolicyIDs(ids ...int) *PoliciesUpdate

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by IDs.

func (*PoliciesUpdate) AddPolicyStatus

func (_u *PoliciesUpdate) AddPolicyStatus(v int) *PoliciesUpdate

AddPolicyStatus adds value to the "policy_status" field.

func (*PoliciesUpdate) AddUpdatedBy

func (_u *PoliciesUpdate) AddUpdatedBy(v int64) *PoliciesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*PoliciesUpdate) AppendStatements

func (_u *PoliciesUpdate) AppendStatements(v []*adminv1.PolicyStatement) *PoliciesUpdate

AppendStatements appends value to the "statements" 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) ClearLionRolePolicies

func (_u *PoliciesUpdate) ClearLionRolePolicies() *PoliciesUpdate

ClearLionRolePolicies clears all "lion_role_policies" edges to the RolePolicies entity.

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) RemoveLionRolePolicies

func (_u *PoliciesUpdate) RemoveLionRolePolicies(v ...*RolePolicies) *PoliciesUpdate

RemoveLionRolePolicies removes "lion_role_policies" edges to RolePolicies entities.

func (*PoliciesUpdate) RemoveLionRolePolicyIDs

func (_u *PoliciesUpdate) RemoveLionRolePolicyIDs(ids ...int) *PoliciesUpdate

RemoveLionRolePolicyIDs removes the "lion_role_policies" edge to RolePolicies entities by IDs.

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) SetCode

func (_u *PoliciesUpdate) SetCode(v string) *PoliciesUpdate

SetCode sets the "code" field.

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) SetDescription

func (_u *PoliciesUpdate) SetDescription(v string) *PoliciesUpdate

SetDescription sets the "description" field.

func (*PoliciesUpdate) SetDisplayName

func (_u *PoliciesUpdate) SetDisplayName(v string) *PoliciesUpdate

SetDisplayName sets the "display_name" field.

func (*PoliciesUpdate) SetNillableCode

func (_u *PoliciesUpdate) SetNillableCode(v *string) *PoliciesUpdate

SetNillableCode sets the "code" field if the given value is not nil.

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) SetNillableDescription

func (_u *PoliciesUpdate) SetNillableDescription(v *string) *PoliciesUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PoliciesUpdate) SetNillableDisplayName

func (_u *PoliciesUpdate) SetNillableDisplayName(v *string) *PoliciesUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*PoliciesUpdate) SetNillablePolicyStatus

func (_u *PoliciesUpdate) SetNillablePolicyStatus(v *int) *PoliciesUpdate

SetNillablePolicyStatus sets the "policy_status" field if the given value is not nil.

func (*PoliciesUpdate) SetNillableProtected

func (_u *PoliciesUpdate) SetNillableProtected(v *bool) *PoliciesUpdate

SetNillableProtected sets the "protected" 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) SetPolicyStatus

func (_u *PoliciesUpdate) SetPolicyStatus(v int) *PoliciesUpdate

SetPolicyStatus sets the "policy_status" field.

func (*PoliciesUpdate) SetProtected

func (_u *PoliciesUpdate) SetProtected(v bool) *PoliciesUpdate

SetProtected sets the "protected" field.

func (*PoliciesUpdate) SetStatements

func (_u *PoliciesUpdate) SetStatements(v []*adminv1.PolicyStatement) *PoliciesUpdate

SetStatements sets the "statements" field.

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) AddLionRolePolicies

func (_u *PoliciesUpdateOne) AddLionRolePolicies(v ...*RolePolicies) *PoliciesUpdateOne

AddLionRolePolicies adds the "lion_role_policies" edges to the RolePolicies entity.

func (*PoliciesUpdateOne) AddLionRolePolicyIDs

func (_u *PoliciesUpdateOne) AddLionRolePolicyIDs(ids ...int) *PoliciesUpdateOne

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by IDs.

func (*PoliciesUpdateOne) AddPolicyStatus

func (_u *PoliciesUpdateOne) AddPolicyStatus(v int) *PoliciesUpdateOne

AddPolicyStatus adds value to the "policy_status" field.

func (*PoliciesUpdateOne) AddUpdatedBy

func (_u *PoliciesUpdateOne) AddUpdatedBy(v int64) *PoliciesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*PoliciesUpdateOne) AppendStatements

func (_u *PoliciesUpdateOne) AppendStatements(v []*adminv1.PolicyStatement) *PoliciesUpdateOne

AppendStatements appends value to the "statements" 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) ClearLionRolePolicies

func (_u *PoliciesUpdateOne) ClearLionRolePolicies() *PoliciesUpdateOne

ClearLionRolePolicies clears all "lion_role_policies" edges to the RolePolicies entity.

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) RemoveLionRolePolicies

func (_u *PoliciesUpdateOne) RemoveLionRolePolicies(v ...*RolePolicies) *PoliciesUpdateOne

RemoveLionRolePolicies removes "lion_role_policies" edges to RolePolicies entities.

func (*PoliciesUpdateOne) RemoveLionRolePolicyIDs

func (_u *PoliciesUpdateOne) RemoveLionRolePolicyIDs(ids ...int) *PoliciesUpdateOne

RemoveLionRolePolicyIDs removes the "lion_role_policies" edge to RolePolicies entities by IDs.

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) SetCode

func (_u *PoliciesUpdateOne) SetCode(v string) *PoliciesUpdateOne

SetCode sets the "code" field.

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) SetDescription

func (_u *PoliciesUpdateOne) SetDescription(v string) *PoliciesUpdateOne

SetDescription sets the "description" field.

func (*PoliciesUpdateOne) SetDisplayName

func (_u *PoliciesUpdateOne) SetDisplayName(v string) *PoliciesUpdateOne

SetDisplayName sets the "display_name" field.

func (*PoliciesUpdateOne) SetNillableCode

func (_u *PoliciesUpdateOne) SetNillableCode(v *string) *PoliciesUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

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) SetNillableDescription

func (_u *PoliciesUpdateOne) SetNillableDescription(v *string) *PoliciesUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PoliciesUpdateOne) SetNillableDisplayName

func (_u *PoliciesUpdateOne) SetNillableDisplayName(v *string) *PoliciesUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*PoliciesUpdateOne) SetNillablePolicyStatus

func (_u *PoliciesUpdateOne) SetNillablePolicyStatus(v *int) *PoliciesUpdateOne

SetNillablePolicyStatus sets the "policy_status" field if the given value is not nil.

func (*PoliciesUpdateOne) SetNillableProtected

func (_u *PoliciesUpdateOne) SetNillableProtected(v *bool) *PoliciesUpdateOne

SetNillableProtected sets the "protected" 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) SetPolicyStatus

func (_u *PoliciesUpdateOne) SetPolicyStatus(v int) *PoliciesUpdateOne

SetPolicyStatus sets the "policy_status" field.

func (*PoliciesUpdateOne) SetProtected

func (_u *PoliciesUpdateOne) SetProtected(v bool) *PoliciesUpdateOne

SetProtected sets the "protected" field.

func (*PoliciesUpdateOne) SetStatements

SetStatements sets the "statements" field.

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 PrincipalRoles

type PrincipalRoles 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"`
	// 主体类型:0-未指定,1-用户,2-群组,3-部门
	PrincipalType int `json:"principal_type,omitempty"`
	// 主体 ID,与 principal_type 配合使用
	PrincipalID int `json:"principal_id,omitempty"`
	// 角色 ID,关联 lion_roles
	RoleID int `json:"role_id,omitempty"`
	// 绑定状态:1-生效,2-禁用
	BindingStatus int `json:"binding_status,omitempty"`
	// 绑定有效期,空表示永久有效
	ExpiresAt time.Time `json:"expires_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 PrincipalRolesQuery when eager-loading is set.
	Edges PrincipalRolesEdges `json:"edges"`
	// contains filtered or unexported fields
}

PrincipalRoles is the model entity for the PrincipalRoles schema.

func (*PrincipalRoles) QueryLionRoles

func (_m *PrincipalRoles) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the PrincipalRoles entity.

func (*PrincipalRoles) String

func (_m *PrincipalRoles) String() string

String implements the fmt.Stringer.

func (*PrincipalRoles) Unwrap

func (_m *PrincipalRoles) Unwrap() *PrincipalRoles

Unwrap unwraps the PrincipalRoles 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 (*PrincipalRoles) Update

Update returns a builder for updating this PrincipalRoles. Note that you need to call PrincipalRoles.Unwrap() before calling this method if this PrincipalRoles was returned from a transaction, and the transaction was committed or rolled back.

func (*PrincipalRoles) Value

func (_m *PrincipalRoles) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PrincipalRoles. This includes values selected through modifiers, order, etc.

type PrincipalRolesClient

type PrincipalRolesClient struct {
	// contains filtered or unexported fields
}

PrincipalRolesClient is a client for the PrincipalRoles schema.

func NewPrincipalRolesClient

func NewPrincipalRolesClient(c config) *PrincipalRolesClient

NewPrincipalRolesClient returns a client for the PrincipalRoles from the given config.

func (*PrincipalRolesClient) Create

Create returns a builder for creating a PrincipalRoles entity.

func (*PrincipalRolesClient) CreateBulk

CreateBulk returns a builder for creating a bulk of PrincipalRoles entities.

func (*PrincipalRolesClient) Delete

Delete returns a delete builder for PrincipalRoles.

func (*PrincipalRolesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PrincipalRolesClient) DeleteOneID

func (c *PrincipalRolesClient) DeleteOneID(id int) *PrincipalRolesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PrincipalRolesClient) Get

Get returns a PrincipalRoles entity by its id.

func (*PrincipalRolesClient) GetX

GetX is like Get, but panics if an error occurs.

func (*PrincipalRolesClient) Hooks

func (c *PrincipalRolesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PrincipalRolesClient) Intercept

func (c *PrincipalRolesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `principalroles.Intercept(f(g(h())))`.

func (*PrincipalRolesClient) Interceptors

func (c *PrincipalRolesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PrincipalRolesClient) MapCreateBulk

func (c *PrincipalRolesClient) MapCreateBulk(slice any, setFunc func(*PrincipalRolesCreate, int)) *PrincipalRolesCreateBulk

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 (*PrincipalRolesClient) Query

Query returns a query builder for PrincipalRoles.

func (*PrincipalRolesClient) QueryLionRoles

func (c *PrincipalRolesClient) QueryLionRoles(_m *PrincipalRoles) *RolesQuery

QueryLionRoles queries the lion_roles edge of a PrincipalRoles.

func (*PrincipalRolesClient) Update

Update returns an update builder for PrincipalRoles.

func (*PrincipalRolesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PrincipalRolesClient) UpdateOneID

func (c *PrincipalRolesClient) UpdateOneID(id int) *PrincipalRolesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PrincipalRolesClient) Use

func (c *PrincipalRolesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `principalroles.Hooks(f(g(h())))`.

type PrincipalRolesCreate

type PrincipalRolesCreate struct {
	// contains filtered or unexported fields
}

PrincipalRolesCreate is the builder for creating a PrincipalRoles entity.

func (*PrincipalRolesCreate) Exec

func (_c *PrincipalRolesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PrincipalRolesCreate) ExecX

func (_c *PrincipalRolesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PrincipalRolesCreate) Mutation

Mutation returns the PrincipalRolesMutation object of the builder.

func (*PrincipalRolesCreate) Save

Save creates the PrincipalRoles in the database.

func (*PrincipalRolesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PrincipalRolesCreate) SetBindingStatus

func (_c *PrincipalRolesCreate) SetBindingStatus(v int) *PrincipalRolesCreate

SetBindingStatus sets the "binding_status" field.

func (*PrincipalRolesCreate) SetCreatedAt

func (_c *PrincipalRolesCreate) SetCreatedAt(v time.Time) *PrincipalRolesCreate

SetCreatedAt sets the "created_at" field.

func (*PrincipalRolesCreate) SetCreatedBy

func (_c *PrincipalRolesCreate) SetCreatedBy(v int64) *PrincipalRolesCreate

SetCreatedBy sets the "created_by" field.

func (*PrincipalRolesCreate) SetDescription

func (_c *PrincipalRolesCreate) SetDescription(v string) *PrincipalRolesCreate

SetDescription sets the "description" field.

func (*PrincipalRolesCreate) SetExpiresAt

func (_c *PrincipalRolesCreate) SetExpiresAt(v time.Time) *PrincipalRolesCreate

SetExpiresAt sets the "expires_at" field.

func (*PrincipalRolesCreate) SetLionRoles

func (_c *PrincipalRolesCreate) SetLionRoles(v *Roles) *PrincipalRolesCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*PrincipalRolesCreate) SetLionRolesID

func (_c *PrincipalRolesCreate) SetLionRolesID(id int) *PrincipalRolesCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*PrincipalRolesCreate) SetMetadata

func (_c *PrincipalRolesCreate) SetMetadata(v map[string]string) *PrincipalRolesCreate

SetMetadata sets the "metadata" field.

func (*PrincipalRolesCreate) SetNillableBindingStatus

func (_c *PrincipalRolesCreate) SetNillableBindingStatus(v *int) *PrincipalRolesCreate

SetNillableBindingStatus sets the "binding_status" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillableCreatedAt

func (_c *PrincipalRolesCreate) SetNillableCreatedAt(v *time.Time) *PrincipalRolesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillableCreatedBy

func (_c *PrincipalRolesCreate) SetNillableCreatedBy(v *int64) *PrincipalRolesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillableDescription

func (_c *PrincipalRolesCreate) SetNillableDescription(v *string) *PrincipalRolesCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillableExpiresAt

func (_c *PrincipalRolesCreate) SetNillableExpiresAt(v *time.Time) *PrincipalRolesCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillablePrincipalType

func (_c *PrincipalRolesCreate) SetNillablePrincipalType(v *int) *PrincipalRolesCreate

SetNillablePrincipalType sets the "principal_type" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillableUpdatedAt

func (_c *PrincipalRolesCreate) SetNillableUpdatedAt(v *time.Time) *PrincipalRolesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PrincipalRolesCreate) SetNillableUpdatedBy

func (_c *PrincipalRolesCreate) SetNillableUpdatedBy(v *int64) *PrincipalRolesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PrincipalRolesCreate) SetPrincipalID

func (_c *PrincipalRolesCreate) SetPrincipalID(v int) *PrincipalRolesCreate

SetPrincipalID sets the "principal_id" field.

func (*PrincipalRolesCreate) SetPrincipalType

func (_c *PrincipalRolesCreate) SetPrincipalType(v int) *PrincipalRolesCreate

SetPrincipalType sets the "principal_type" field.

func (*PrincipalRolesCreate) SetRoleID

func (_c *PrincipalRolesCreate) SetRoleID(v int) *PrincipalRolesCreate

SetRoleID sets the "role_id" field.

func (*PrincipalRolesCreate) SetUpdatedAt

func (_c *PrincipalRolesCreate) SetUpdatedAt(v time.Time) *PrincipalRolesCreate

SetUpdatedAt sets the "updated_at" field.

func (*PrincipalRolesCreate) SetUpdatedBy

func (_c *PrincipalRolesCreate) SetUpdatedBy(v int64) *PrincipalRolesCreate

SetUpdatedBy sets the "updated_by" field.

type PrincipalRolesCreateBulk

type PrincipalRolesCreateBulk struct {
	// contains filtered or unexported fields
}

PrincipalRolesCreateBulk is the builder for creating many PrincipalRoles entities in bulk.

func (*PrincipalRolesCreateBulk) Exec

Exec executes the query.

func (*PrincipalRolesCreateBulk) ExecX

func (_c *PrincipalRolesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PrincipalRolesCreateBulk) Save

Save creates the PrincipalRoles entities in the database.

func (*PrincipalRolesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type PrincipalRolesDelete

type PrincipalRolesDelete struct {
	// contains filtered or unexported fields
}

PrincipalRolesDelete is the builder for deleting a PrincipalRoles entity.

func (*PrincipalRolesDelete) Exec

func (_d *PrincipalRolesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PrincipalRolesDelete) ExecX

func (_d *PrincipalRolesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PrincipalRolesDelete) Where

Where appends a list predicates to the PrincipalRolesDelete builder.

type PrincipalRolesDeleteOne

type PrincipalRolesDeleteOne struct {
	// contains filtered or unexported fields
}

PrincipalRolesDeleteOne is the builder for deleting a single PrincipalRoles entity.

func (*PrincipalRolesDeleteOne) Exec

Exec executes the deletion query.

func (*PrincipalRolesDeleteOne) ExecX

func (_d *PrincipalRolesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PrincipalRolesDeleteOne) Where

Where appends a list predicates to the PrincipalRolesDelete builder.

type PrincipalRolesEdges

type PrincipalRolesEdges struct {
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// contains filtered or unexported fields
}

PrincipalRolesEdges holds the relations/edges for other nodes in the graph.

func (PrincipalRolesEdges) LionRolesOrErr

func (e PrincipalRolesEdges) 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 PrincipalRolesGroupBy

type PrincipalRolesGroupBy struct {
	// contains filtered or unexported fields
}

PrincipalRolesGroupBy is the group-by builder for PrincipalRoles entities.

func (*PrincipalRolesGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*PrincipalRolesGroupBy) Bool

func (s *PrincipalRolesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) BoolX

func (s *PrincipalRolesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Bools

func (s *PrincipalRolesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) BoolsX

func (s *PrincipalRolesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Float64

func (s *PrincipalRolesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) Float64X

func (s *PrincipalRolesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Float64s

func (s *PrincipalRolesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) Float64sX

func (s *PrincipalRolesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Int

func (s *PrincipalRolesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) IntX

func (s *PrincipalRolesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Ints

func (s *PrincipalRolesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) IntsX

func (s *PrincipalRolesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Scan

func (_g *PrincipalRolesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PrincipalRolesGroupBy) ScanX

func (s *PrincipalRolesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PrincipalRolesGroupBy) String

func (s *PrincipalRolesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) StringX

func (s *PrincipalRolesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PrincipalRolesGroupBy) Strings

func (s *PrincipalRolesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesGroupBy) StringsX

func (s *PrincipalRolesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PrincipalRolesMutation

type PrincipalRolesMutation struct {
	// contains filtered or unexported fields
}

PrincipalRolesMutation represents an operation that mutates the PrincipalRoles nodes in the graph.

func (*PrincipalRolesMutation) AddBindingStatus

func (m *PrincipalRolesMutation) AddBindingStatus(i int)

AddBindingStatus adds i to the "binding_status" field.

func (*PrincipalRolesMutation) AddCreatedBy

func (m *PrincipalRolesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*PrincipalRolesMutation) AddField

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) AddPrincipalID

func (m *PrincipalRolesMutation) AddPrincipalID(i int)

AddPrincipalID adds i to the "principal_id" field.

func (*PrincipalRolesMutation) AddPrincipalType

func (m *PrincipalRolesMutation) AddPrincipalType(i int)

AddPrincipalType adds i to the "principal_type" field.

func (*PrincipalRolesMutation) AddUpdatedBy

func (m *PrincipalRolesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*PrincipalRolesMutation) AddedBindingStatus

func (m *PrincipalRolesMutation) AddedBindingStatus() (r int, exists bool)

AddedBindingStatus returns the value that was added to the "binding_status" field in this mutation.

func (*PrincipalRolesMutation) AddedCreatedBy

func (m *PrincipalRolesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*PrincipalRolesMutation) AddedEdges

func (m *PrincipalRolesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PrincipalRolesMutation) AddedField

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) AddedFields

func (m *PrincipalRolesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PrincipalRolesMutation) AddedIDs

func (m *PrincipalRolesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PrincipalRolesMutation) AddedPrincipalID

func (m *PrincipalRolesMutation) AddedPrincipalID() (r int, exists bool)

AddedPrincipalID returns the value that was added to the "principal_id" field in this mutation.

func (*PrincipalRolesMutation) AddedPrincipalType

func (m *PrincipalRolesMutation) AddedPrincipalType() (r int, exists bool)

AddedPrincipalType returns the value that was added to the "principal_type" field in this mutation.

func (*PrincipalRolesMutation) AddedUpdatedBy

func (m *PrincipalRolesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*PrincipalRolesMutation) BindingStatus

func (m *PrincipalRolesMutation) BindingStatus() (r int, exists bool)

BindingStatus returns the value of the "binding_status" field in the mutation.

func (*PrincipalRolesMutation) ClearCreatedBy

func (m *PrincipalRolesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*PrincipalRolesMutation) ClearEdge

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) ClearExpiresAt

func (m *PrincipalRolesMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*PrincipalRolesMutation) ClearField

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) ClearLionRoles

func (m *PrincipalRolesMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*PrincipalRolesMutation) ClearMetadata

func (m *PrincipalRolesMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*PrincipalRolesMutation) ClearUpdatedBy

func (m *PrincipalRolesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PrincipalRolesMutation) ClearedEdges

func (m *PrincipalRolesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PrincipalRolesMutation) ClearedFields

func (m *PrincipalRolesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PrincipalRolesMutation) Client

func (m PrincipalRolesMutation) 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 (*PrincipalRolesMutation) CreatedAt

func (m *PrincipalRolesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PrincipalRolesMutation) CreatedBy

func (m *PrincipalRolesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*PrincipalRolesMutation) CreatedByCleared

func (m *PrincipalRolesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*PrincipalRolesMutation) Description

func (m *PrincipalRolesMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*PrincipalRolesMutation) EdgeCleared

func (m *PrincipalRolesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PrincipalRolesMutation) ExpiresAt

func (m *PrincipalRolesMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*PrincipalRolesMutation) ExpiresAtCleared

func (m *PrincipalRolesMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*PrincipalRolesMutation) Field

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) FieldCleared

func (m *PrincipalRolesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PrincipalRolesMutation) Fields

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) ID

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) IDs

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) LionRolesCleared

func (m *PrincipalRolesMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*PrincipalRolesMutation) LionRolesID

func (m *PrincipalRolesMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*PrincipalRolesMutation) LionRolesIDs

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) Metadata

func (m *PrincipalRolesMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*PrincipalRolesMutation) MetadataCleared

func (m *PrincipalRolesMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*PrincipalRolesMutation) OldBindingStatus

func (m *PrincipalRolesMutation) OldBindingStatus(ctx context.Context) (v int, err error)

OldBindingStatus returns the old "binding_status" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldCreatedAt

func (m *PrincipalRolesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldCreatedBy

func (m *PrincipalRolesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldDescription

func (m *PrincipalRolesMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldExpiresAt

func (m *PrincipalRolesMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldField

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) OldMetadata

func (m *PrincipalRolesMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldPrincipalID

func (m *PrincipalRolesMutation) OldPrincipalID(ctx context.Context) (v int, err error)

OldPrincipalID returns the old "principal_id" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldPrincipalType

func (m *PrincipalRolesMutation) OldPrincipalType(ctx context.Context) (v int, err error)

OldPrincipalType returns the old "principal_type" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldRoleID

func (m *PrincipalRolesMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldUpdatedAt

func (m *PrincipalRolesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) OldUpdatedBy

func (m *PrincipalRolesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the PrincipalRoles entity. If the PrincipalRoles object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PrincipalRolesMutation) Op

func (m *PrincipalRolesMutation) Op() Op

Op returns the operation name.

func (*PrincipalRolesMutation) PrincipalID

func (m *PrincipalRolesMutation) PrincipalID() (r int, exists bool)

PrincipalID returns the value of the "principal_id" field in the mutation.

func (*PrincipalRolesMutation) PrincipalType

func (m *PrincipalRolesMutation) PrincipalType() (r int, exists bool)

PrincipalType returns the value of the "principal_type" field in the mutation.

func (*PrincipalRolesMutation) RemovedEdges

func (m *PrincipalRolesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PrincipalRolesMutation) RemovedIDs

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) ResetBindingStatus

func (m *PrincipalRolesMutation) ResetBindingStatus()

ResetBindingStatus resets all changes to the "binding_status" field.

func (*PrincipalRolesMutation) ResetCreatedAt

func (m *PrincipalRolesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PrincipalRolesMutation) ResetCreatedBy

func (m *PrincipalRolesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*PrincipalRolesMutation) ResetDescription

func (m *PrincipalRolesMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*PrincipalRolesMutation) ResetEdge

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) ResetExpiresAt

func (m *PrincipalRolesMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*PrincipalRolesMutation) ResetField

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) ResetLionRoles

func (m *PrincipalRolesMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*PrincipalRolesMutation) ResetMetadata

func (m *PrincipalRolesMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*PrincipalRolesMutation) ResetPrincipalID

func (m *PrincipalRolesMutation) ResetPrincipalID()

ResetPrincipalID resets all changes to the "principal_id" field.

func (*PrincipalRolesMutation) ResetPrincipalType

func (m *PrincipalRolesMutation) ResetPrincipalType()

ResetPrincipalType resets all changes to the "principal_type" field.

func (*PrincipalRolesMutation) ResetRoleID

func (m *PrincipalRolesMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*PrincipalRolesMutation) ResetUpdatedAt

func (m *PrincipalRolesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PrincipalRolesMutation) ResetUpdatedBy

func (m *PrincipalRolesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*PrincipalRolesMutation) RoleID

func (m *PrincipalRolesMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*PrincipalRolesMutation) SetBindingStatus

func (m *PrincipalRolesMutation) SetBindingStatus(i int)

SetBindingStatus sets the "binding_status" field.

func (*PrincipalRolesMutation) SetCreatedAt

func (m *PrincipalRolesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PrincipalRolesMutation) SetCreatedBy

func (m *PrincipalRolesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*PrincipalRolesMutation) SetDescription

func (m *PrincipalRolesMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*PrincipalRolesMutation) SetExpiresAt

func (m *PrincipalRolesMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*PrincipalRolesMutation) SetField

func (m *PrincipalRolesMutation) 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 (*PrincipalRolesMutation) SetLionRolesID

func (m *PrincipalRolesMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*PrincipalRolesMutation) SetMetadata

func (m *PrincipalRolesMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*PrincipalRolesMutation) SetOp

func (m *PrincipalRolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PrincipalRolesMutation) SetPrincipalID

func (m *PrincipalRolesMutation) SetPrincipalID(i int)

SetPrincipalID sets the "principal_id" field.

func (*PrincipalRolesMutation) SetPrincipalType

func (m *PrincipalRolesMutation) SetPrincipalType(i int)

SetPrincipalType sets the "principal_type" field.

func (*PrincipalRolesMutation) SetRoleID

func (m *PrincipalRolesMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*PrincipalRolesMutation) SetUpdatedAt

func (m *PrincipalRolesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PrincipalRolesMutation) SetUpdatedBy

func (m *PrincipalRolesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (PrincipalRolesMutation) Tx

func (m PrincipalRolesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PrincipalRolesMutation) Type

func (m *PrincipalRolesMutation) Type() string

Type returns the node type of this mutation (PrincipalRoles).

func (*PrincipalRolesMutation) UpdatedAt

func (m *PrincipalRolesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PrincipalRolesMutation) UpdatedBy

func (m *PrincipalRolesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*PrincipalRolesMutation) UpdatedByCleared

func (m *PrincipalRolesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*PrincipalRolesMutation) Where

Where appends a list predicates to the PrincipalRolesMutation builder.

func (*PrincipalRolesMutation) WhereP

func (m *PrincipalRolesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PrincipalRolesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PrincipalRolesQuery

type PrincipalRolesQuery struct {
	// contains filtered or unexported fields
}

PrincipalRolesQuery is the builder for querying PrincipalRoles entities.

func (*PrincipalRolesQuery) Aggregate

Aggregate returns a PrincipalRolesSelect configured with the given aggregations.

func (*PrincipalRolesQuery) All

All executes the query and returns a list of PrincipalRolesSlice.

func (*PrincipalRolesQuery) AllX

AllX is like All, but panics if an error occurs.

func (*PrincipalRolesQuery) Clone

Clone returns a duplicate of the PrincipalRolesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PrincipalRolesQuery) Count

func (_q *PrincipalRolesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PrincipalRolesQuery) CountX

func (_q *PrincipalRolesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PrincipalRolesQuery) Exist

func (_q *PrincipalRolesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PrincipalRolesQuery) ExistX

func (_q *PrincipalRolesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PrincipalRolesQuery) First

First returns the first PrincipalRoles entity from the query. Returns a *NotFoundError when no PrincipalRoles was found.

func (*PrincipalRolesQuery) FirstID

func (_q *PrincipalRolesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first PrincipalRoles ID from the query. Returns a *NotFoundError when no PrincipalRoles ID was found.

func (*PrincipalRolesQuery) FirstIDX

func (_q *PrincipalRolesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PrincipalRolesQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*PrincipalRolesQuery) GroupBy

func (_q *PrincipalRolesQuery) GroupBy(field string, fields ...string) *PrincipalRolesGroupBy

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.PrincipalRoles.Query().
	GroupBy(principalroles.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*PrincipalRolesQuery) IDs

func (_q *PrincipalRolesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of PrincipalRoles IDs.

func (*PrincipalRolesQuery) IDsX

func (_q *PrincipalRolesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PrincipalRolesQuery) Limit

func (_q *PrincipalRolesQuery) Limit(limit int) *PrincipalRolesQuery

Limit the number of records to be returned by this query.

func (*PrincipalRolesQuery) Offset

func (_q *PrincipalRolesQuery) Offset(offset int) *PrincipalRolesQuery

Offset to start from.

func (*PrincipalRolesQuery) Only

Only returns a single PrincipalRoles entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one PrincipalRoles entity is found. Returns a *NotFoundError when no PrincipalRoles entities are found.

func (*PrincipalRolesQuery) OnlyID

func (_q *PrincipalRolesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only PrincipalRoles ID in the query. Returns a *NotSingularError when more than one PrincipalRoles ID is found. Returns a *NotFoundError when no entities are found.

func (*PrincipalRolesQuery) OnlyIDX

func (_q *PrincipalRolesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PrincipalRolesQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*PrincipalRolesQuery) Order

Order specifies how the records should be ordered.

func (*PrincipalRolesQuery) QueryLionRoles

func (_q *PrincipalRolesQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*PrincipalRolesQuery) Select

func (_q *PrincipalRolesQuery) Select(fields ...string) *PrincipalRolesSelect

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.PrincipalRoles.Query().
	Select(principalroles.FieldCreatedAt).
	Scan(ctx, &v)

func (*PrincipalRolesQuery) Unique

func (_q *PrincipalRolesQuery) Unique(unique bool) *PrincipalRolesQuery

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 (*PrincipalRolesQuery) Where

Where adds a new predicate for the PrincipalRolesQuery builder.

func (*PrincipalRolesQuery) WithLionRoles

func (_q *PrincipalRolesQuery) WithLionRoles(opts ...func(*RolesQuery)) *PrincipalRolesQuery

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 PrincipalRolesSelect

type PrincipalRolesSelect struct {
	*PrincipalRolesQuery
	// contains filtered or unexported fields
}

PrincipalRolesSelect is the builder for selecting fields of PrincipalRoles entities.

func (*PrincipalRolesSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*PrincipalRolesSelect) Bool

func (s *PrincipalRolesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) BoolX

func (s *PrincipalRolesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PrincipalRolesSelect) Bools

func (s *PrincipalRolesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) BoolsX

func (s *PrincipalRolesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PrincipalRolesSelect) Float64

func (s *PrincipalRolesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) Float64X

func (s *PrincipalRolesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PrincipalRolesSelect) Float64s

func (s *PrincipalRolesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) Float64sX

func (s *PrincipalRolesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PrincipalRolesSelect) Int

func (s *PrincipalRolesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) IntX

func (s *PrincipalRolesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PrincipalRolesSelect) Ints

func (s *PrincipalRolesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) IntsX

func (s *PrincipalRolesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PrincipalRolesSelect) Scan

func (_s *PrincipalRolesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PrincipalRolesSelect) ScanX

func (s *PrincipalRolesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PrincipalRolesSelect) String

func (s *PrincipalRolesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) StringX

func (s *PrincipalRolesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PrincipalRolesSelect) Strings

func (s *PrincipalRolesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PrincipalRolesSelect) StringsX

func (s *PrincipalRolesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PrincipalRolesSlice

type PrincipalRolesSlice []*PrincipalRoles

PrincipalRolesSlice is a parsable slice of PrincipalRoles.

type PrincipalRolesUpdate

type PrincipalRolesUpdate struct {
	// contains filtered or unexported fields
}

PrincipalRolesUpdate is the builder for updating PrincipalRoles entities.

func (*PrincipalRolesUpdate) AddBindingStatus

func (_u *PrincipalRolesUpdate) AddBindingStatus(v int) *PrincipalRolesUpdate

AddBindingStatus adds value to the "binding_status" field.

func (*PrincipalRolesUpdate) AddCreatedBy

func (_u *PrincipalRolesUpdate) AddCreatedBy(v int64) *PrincipalRolesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*PrincipalRolesUpdate) AddPrincipalID

func (_u *PrincipalRolesUpdate) AddPrincipalID(v int) *PrincipalRolesUpdate

AddPrincipalID adds value to the "principal_id" field.

func (*PrincipalRolesUpdate) AddPrincipalType

func (_u *PrincipalRolesUpdate) AddPrincipalType(v int) *PrincipalRolesUpdate

AddPrincipalType adds value to the "principal_type" field.

func (*PrincipalRolesUpdate) AddUpdatedBy

func (_u *PrincipalRolesUpdate) AddUpdatedBy(v int64) *PrincipalRolesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*PrincipalRolesUpdate) ClearCreatedBy

func (_u *PrincipalRolesUpdate) ClearCreatedBy() *PrincipalRolesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*PrincipalRolesUpdate) ClearExpiresAt

func (_u *PrincipalRolesUpdate) ClearExpiresAt() *PrincipalRolesUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*PrincipalRolesUpdate) ClearLionRoles

func (_u *PrincipalRolesUpdate) ClearLionRoles() *PrincipalRolesUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*PrincipalRolesUpdate) ClearMetadata

func (_u *PrincipalRolesUpdate) ClearMetadata() *PrincipalRolesUpdate

ClearMetadata clears the value of the "metadata" field.

func (*PrincipalRolesUpdate) ClearUpdatedBy

func (_u *PrincipalRolesUpdate) ClearUpdatedBy() *PrincipalRolesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PrincipalRolesUpdate) Exec

func (_u *PrincipalRolesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PrincipalRolesUpdate) ExecX

func (_u *PrincipalRolesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PrincipalRolesUpdate) Mutation

Mutation returns the PrincipalRolesMutation object of the builder.

func (*PrincipalRolesUpdate) Save

func (_u *PrincipalRolesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PrincipalRolesUpdate) SaveX

func (_u *PrincipalRolesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PrincipalRolesUpdate) SetBindingStatus

func (_u *PrincipalRolesUpdate) SetBindingStatus(v int) *PrincipalRolesUpdate

SetBindingStatus sets the "binding_status" field.

func (*PrincipalRolesUpdate) SetCreatedBy

func (_u *PrincipalRolesUpdate) SetCreatedBy(v int64) *PrincipalRolesUpdate

SetCreatedBy sets the "created_by" field.

func (*PrincipalRolesUpdate) SetDescription

func (_u *PrincipalRolesUpdate) SetDescription(v string) *PrincipalRolesUpdate

SetDescription sets the "description" field.

func (*PrincipalRolesUpdate) SetExpiresAt

func (_u *PrincipalRolesUpdate) SetExpiresAt(v time.Time) *PrincipalRolesUpdate

SetExpiresAt sets the "expires_at" field.

func (*PrincipalRolesUpdate) SetLionRoles

func (_u *PrincipalRolesUpdate) SetLionRoles(v *Roles) *PrincipalRolesUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*PrincipalRolesUpdate) SetLionRolesID

func (_u *PrincipalRolesUpdate) SetLionRolesID(id int) *PrincipalRolesUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*PrincipalRolesUpdate) SetMetadata

func (_u *PrincipalRolesUpdate) SetMetadata(v map[string]string) *PrincipalRolesUpdate

SetMetadata sets the "metadata" field.

func (*PrincipalRolesUpdate) SetNillableBindingStatus

func (_u *PrincipalRolesUpdate) SetNillableBindingStatus(v *int) *PrincipalRolesUpdate

SetNillableBindingStatus sets the "binding_status" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillableCreatedBy

func (_u *PrincipalRolesUpdate) SetNillableCreatedBy(v *int64) *PrincipalRolesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillableDescription

func (_u *PrincipalRolesUpdate) SetNillableDescription(v *string) *PrincipalRolesUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillableExpiresAt

func (_u *PrincipalRolesUpdate) SetNillableExpiresAt(v *time.Time) *PrincipalRolesUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillablePrincipalID

func (_u *PrincipalRolesUpdate) SetNillablePrincipalID(v *int) *PrincipalRolesUpdate

SetNillablePrincipalID sets the "principal_id" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillablePrincipalType

func (_u *PrincipalRolesUpdate) SetNillablePrincipalType(v *int) *PrincipalRolesUpdate

SetNillablePrincipalType sets the "principal_type" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillableRoleID

func (_u *PrincipalRolesUpdate) SetNillableRoleID(v *int) *PrincipalRolesUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetNillableUpdatedBy

func (_u *PrincipalRolesUpdate) SetNillableUpdatedBy(v *int64) *PrincipalRolesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PrincipalRolesUpdate) SetPrincipalID

func (_u *PrincipalRolesUpdate) SetPrincipalID(v int) *PrincipalRolesUpdate

SetPrincipalID sets the "principal_id" field.

func (*PrincipalRolesUpdate) SetPrincipalType

func (_u *PrincipalRolesUpdate) SetPrincipalType(v int) *PrincipalRolesUpdate

SetPrincipalType sets the "principal_type" field.

func (*PrincipalRolesUpdate) SetRoleID

func (_u *PrincipalRolesUpdate) SetRoleID(v int) *PrincipalRolesUpdate

SetRoleID sets the "role_id" field.

func (*PrincipalRolesUpdate) SetUpdatedAt

func (_u *PrincipalRolesUpdate) SetUpdatedAt(v time.Time) *PrincipalRolesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PrincipalRolesUpdate) SetUpdatedBy

func (_u *PrincipalRolesUpdate) SetUpdatedBy(v int64) *PrincipalRolesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*PrincipalRolesUpdate) Where

Where appends a list predicates to the PrincipalRolesUpdate builder.

type PrincipalRolesUpdateOne

type PrincipalRolesUpdateOne struct {
	// contains filtered or unexported fields
}

PrincipalRolesUpdateOne is the builder for updating a single PrincipalRoles entity.

func (*PrincipalRolesUpdateOne) AddBindingStatus

func (_u *PrincipalRolesUpdateOne) AddBindingStatus(v int) *PrincipalRolesUpdateOne

AddBindingStatus adds value to the "binding_status" field.

func (*PrincipalRolesUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*PrincipalRolesUpdateOne) AddPrincipalID

func (_u *PrincipalRolesUpdateOne) AddPrincipalID(v int) *PrincipalRolesUpdateOne

AddPrincipalID adds value to the "principal_id" field.

func (*PrincipalRolesUpdateOne) AddPrincipalType

func (_u *PrincipalRolesUpdateOne) AddPrincipalType(v int) *PrincipalRolesUpdateOne

AddPrincipalType adds value to the "principal_type" field.

func (*PrincipalRolesUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*PrincipalRolesUpdateOne) ClearCreatedBy

func (_u *PrincipalRolesUpdateOne) ClearCreatedBy() *PrincipalRolesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*PrincipalRolesUpdateOne) ClearExpiresAt

func (_u *PrincipalRolesUpdateOne) ClearExpiresAt() *PrincipalRolesUpdateOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*PrincipalRolesUpdateOne) ClearLionRoles

func (_u *PrincipalRolesUpdateOne) ClearLionRoles() *PrincipalRolesUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*PrincipalRolesUpdateOne) ClearMetadata

func (_u *PrincipalRolesUpdateOne) ClearMetadata() *PrincipalRolesUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*PrincipalRolesUpdateOne) ClearUpdatedBy

func (_u *PrincipalRolesUpdateOne) ClearUpdatedBy() *PrincipalRolesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*PrincipalRolesUpdateOne) Exec

Exec executes the query on the entity.

func (*PrincipalRolesUpdateOne) ExecX

func (_u *PrincipalRolesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PrincipalRolesUpdateOne) Mutation

Mutation returns the PrincipalRolesMutation object of the builder.

func (*PrincipalRolesUpdateOne) Save

Save executes the query and returns the updated PrincipalRoles entity.

func (*PrincipalRolesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*PrincipalRolesUpdateOne) Select

func (_u *PrincipalRolesUpdateOne) Select(field string, fields ...string) *PrincipalRolesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PrincipalRolesUpdateOne) SetBindingStatus

func (_u *PrincipalRolesUpdateOne) SetBindingStatus(v int) *PrincipalRolesUpdateOne

SetBindingStatus sets the "binding_status" field.

func (*PrincipalRolesUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*PrincipalRolesUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*PrincipalRolesUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*PrincipalRolesUpdateOne) SetLionRoles

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*PrincipalRolesUpdateOne) SetLionRolesID

func (_u *PrincipalRolesUpdateOne) SetLionRolesID(id int) *PrincipalRolesUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*PrincipalRolesUpdateOne) SetMetadata

SetMetadata sets the "metadata" field.

func (*PrincipalRolesUpdateOne) SetNillableBindingStatus

func (_u *PrincipalRolesUpdateOne) SetNillableBindingStatus(v *int) *PrincipalRolesUpdateOne

SetNillableBindingStatus sets the "binding_status" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillableCreatedBy

func (_u *PrincipalRolesUpdateOne) SetNillableCreatedBy(v *int64) *PrincipalRolesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillableDescription

func (_u *PrincipalRolesUpdateOne) SetNillableDescription(v *string) *PrincipalRolesUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillableExpiresAt

func (_u *PrincipalRolesUpdateOne) SetNillableExpiresAt(v *time.Time) *PrincipalRolesUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillablePrincipalID

func (_u *PrincipalRolesUpdateOne) SetNillablePrincipalID(v *int) *PrincipalRolesUpdateOne

SetNillablePrincipalID sets the "principal_id" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillablePrincipalType

func (_u *PrincipalRolesUpdateOne) SetNillablePrincipalType(v *int) *PrincipalRolesUpdateOne

SetNillablePrincipalType sets the "principal_type" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillableRoleID

func (_u *PrincipalRolesUpdateOne) SetNillableRoleID(v *int) *PrincipalRolesUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetNillableUpdatedBy

func (_u *PrincipalRolesUpdateOne) SetNillableUpdatedBy(v *int64) *PrincipalRolesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*PrincipalRolesUpdateOne) SetPrincipalID

func (_u *PrincipalRolesUpdateOne) SetPrincipalID(v int) *PrincipalRolesUpdateOne

SetPrincipalID sets the "principal_id" field.

func (*PrincipalRolesUpdateOne) SetPrincipalType

func (_u *PrincipalRolesUpdateOne) SetPrincipalType(v int) *PrincipalRolesUpdateOne

SetPrincipalType sets the "principal_type" field.

func (*PrincipalRolesUpdateOne) SetRoleID

SetRoleID sets the "role_id" field.

func (*PrincipalRolesUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*PrincipalRolesUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*PrincipalRolesUpdateOne) Where

Where appends a list predicates to the PrincipalRolesUpdate builder.

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 RoleMenus

type RoleMenus 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_menus 表的菜单 ID
	MenuID int `json:"menu_id,omitempty"`
	// 权限范围:1=可见,2=可操作(如按钮级权限)
	PermissionScope int `json:"permission_scope,omitempty"`
	// 描述
	Description string `json:"description,omitempty"`
	// 是否递归包含子菜单,为 true 时授权逻辑自动涵盖所有后代菜单
	IsRecursive bool `json:"is_recursive,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleMenusQuery when eager-loading is set.
	Edges RoleMenusEdges `json:"edges"`
	// contains filtered or unexported fields
}

RoleMenus is the model entity for the RoleMenus schema.

func (*RoleMenus) QueryLionMenus

func (_m *RoleMenus) QueryLionMenus() *MenusQuery

QueryLionMenus queries the "lion_menus" edge of the RoleMenus entity.

func (*RoleMenus) QueryLionRoles

func (_m *RoleMenus) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the RoleMenus entity.

func (*RoleMenus) String

func (_m *RoleMenus) String() string

String implements the fmt.Stringer.

func (*RoleMenus) Unwrap

func (_m *RoleMenus) Unwrap() *RoleMenus

Unwrap unwraps the RoleMenus 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 (*RoleMenus) Update

func (_m *RoleMenus) Update() *RoleMenusUpdateOne

Update returns a builder for updating this RoleMenus. Note that you need to call RoleMenus.Unwrap() before calling this method if this RoleMenus was returned from a transaction, and the transaction was committed or rolled back.

func (*RoleMenus) Value

func (_m *RoleMenus) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the RoleMenus. This includes values selected through modifiers, order, etc.

type RoleMenusClient

type RoleMenusClient struct {
	// contains filtered or unexported fields
}

RoleMenusClient is a client for the RoleMenus schema.

func NewRoleMenusClient

func NewRoleMenusClient(c config) *RoleMenusClient

NewRoleMenusClient returns a client for the RoleMenus from the given config.

func (*RoleMenusClient) Create

func (c *RoleMenusClient) Create() *RoleMenusCreate

Create returns a builder for creating a RoleMenus entity.

func (*RoleMenusClient) CreateBulk

func (c *RoleMenusClient) CreateBulk(builders ...*RoleMenusCreate) *RoleMenusCreateBulk

CreateBulk returns a builder for creating a bulk of RoleMenus entities.

func (*RoleMenusClient) Delete

func (c *RoleMenusClient) Delete() *RoleMenusDelete

Delete returns a delete builder for RoleMenus.

func (*RoleMenusClient) DeleteOne

func (c *RoleMenusClient) DeleteOne(_m *RoleMenus) *RoleMenusDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleMenusClient) DeleteOneID

func (c *RoleMenusClient) DeleteOneID(id int) *RoleMenusDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoleMenusClient) Get

func (c *RoleMenusClient) Get(ctx context.Context, id int) (*RoleMenus, error)

Get returns a RoleMenus entity by its id.

func (*RoleMenusClient) GetX

func (c *RoleMenusClient) GetX(ctx context.Context, id int) *RoleMenus

GetX is like Get, but panics if an error occurs.

func (*RoleMenusClient) Hooks

func (c *RoleMenusClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoleMenusClient) Intercept

func (c *RoleMenusClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `rolemenus.Intercept(f(g(h())))`.

func (*RoleMenusClient) Interceptors

func (c *RoleMenusClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RoleMenusClient) MapCreateBulk

func (c *RoleMenusClient) MapCreateBulk(slice any, setFunc func(*RoleMenusCreate, int)) *RoleMenusCreateBulk

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 (*RoleMenusClient) Query

func (c *RoleMenusClient) Query() *RoleMenusQuery

Query returns a query builder for RoleMenus.

func (*RoleMenusClient) QueryLionMenus

func (c *RoleMenusClient) QueryLionMenus(_m *RoleMenus) *MenusQuery

QueryLionMenus queries the lion_menus edge of a RoleMenus.

func (*RoleMenusClient) QueryLionRoles

func (c *RoleMenusClient) QueryLionRoles(_m *RoleMenus) *RolesQuery

QueryLionRoles queries the lion_roles edge of a RoleMenus.

func (*RoleMenusClient) Update

func (c *RoleMenusClient) Update() *RoleMenusUpdate

Update returns an update builder for RoleMenus.

func (*RoleMenusClient) UpdateOne

func (c *RoleMenusClient) UpdateOne(_m *RoleMenus) *RoleMenusUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleMenusClient) UpdateOneID

func (c *RoleMenusClient) UpdateOneID(id int) *RoleMenusUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleMenusClient) Use

func (c *RoleMenusClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rolemenus.Hooks(f(g(h())))`.

type RoleMenusCreate

type RoleMenusCreate struct {
	// contains filtered or unexported fields
}

RoleMenusCreate is the builder for creating a RoleMenus entity.

func (*RoleMenusCreate) Exec

func (_c *RoleMenusCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleMenusCreate) ExecX

func (_c *RoleMenusCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleMenusCreate) Mutation

func (_c *RoleMenusCreate) Mutation() *RoleMenusMutation

Mutation returns the RoleMenusMutation object of the builder.

func (*RoleMenusCreate) Save

func (_c *RoleMenusCreate) Save(ctx context.Context) (*RoleMenus, error)

Save creates the RoleMenus in the database.

func (*RoleMenusCreate) SaveX

func (_c *RoleMenusCreate) SaveX(ctx context.Context) *RoleMenus

SaveX calls Save and panics if Save returns an error.

func (*RoleMenusCreate) SetCreatedAt

func (_c *RoleMenusCreate) SetCreatedAt(v time.Time) *RoleMenusCreate

SetCreatedAt sets the "created_at" field.

func (*RoleMenusCreate) SetCreatedBy

func (_c *RoleMenusCreate) SetCreatedBy(v int64) *RoleMenusCreate

SetCreatedBy sets the "created_by" field.

func (*RoleMenusCreate) SetDescription

func (_c *RoleMenusCreate) SetDescription(v string) *RoleMenusCreate

SetDescription sets the "description" field.

func (*RoleMenusCreate) SetIsRecursive

func (_c *RoleMenusCreate) SetIsRecursive(v bool) *RoleMenusCreate

SetIsRecursive sets the "is_recursive" field.

func (*RoleMenusCreate) SetLionMenus

func (_c *RoleMenusCreate) SetLionMenus(v *Menus) *RoleMenusCreate

SetLionMenus sets the "lion_menus" edge to the Menus entity.

func (*RoleMenusCreate) SetLionMenusID

func (_c *RoleMenusCreate) SetLionMenusID(id int) *RoleMenusCreate

SetLionMenusID sets the "lion_menus" edge to the Menus entity by ID.

func (*RoleMenusCreate) SetLionRoles

func (_c *RoleMenusCreate) SetLionRoles(v *Roles) *RoleMenusCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RoleMenusCreate) SetLionRolesID

func (_c *RoleMenusCreate) SetLionRolesID(id int) *RoleMenusCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RoleMenusCreate) SetMenuID

func (_c *RoleMenusCreate) SetMenuID(v int) *RoleMenusCreate

SetMenuID sets the "menu_id" field.

func (*RoleMenusCreate) SetNillableCreatedAt

func (_c *RoleMenusCreate) SetNillableCreatedAt(v *time.Time) *RoleMenusCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleMenusCreate) SetNillableCreatedBy

func (_c *RoleMenusCreate) SetNillableCreatedBy(v *int64) *RoleMenusCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoleMenusCreate) SetNillableDescription

func (_c *RoleMenusCreate) SetNillableDescription(v *string) *RoleMenusCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RoleMenusCreate) SetNillableIsRecursive

func (_c *RoleMenusCreate) SetNillableIsRecursive(v *bool) *RoleMenusCreate

SetNillableIsRecursive sets the "is_recursive" field if the given value is not nil.

func (*RoleMenusCreate) SetNillablePermissionScope

func (_c *RoleMenusCreate) SetNillablePermissionScope(v *int) *RoleMenusCreate

SetNillablePermissionScope sets the "permission_scope" field if the given value is not nil.

func (*RoleMenusCreate) SetNillableUpdatedAt

func (_c *RoleMenusCreate) SetNillableUpdatedAt(v *time.Time) *RoleMenusCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RoleMenusCreate) SetNillableUpdatedBy

func (_c *RoleMenusCreate) SetNillableUpdatedBy(v *int64) *RoleMenusCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoleMenusCreate) SetPermissionScope

func (_c *RoleMenusCreate) SetPermissionScope(v int) *RoleMenusCreate

SetPermissionScope sets the "permission_scope" field.

func (*RoleMenusCreate) SetRoleID

func (_c *RoleMenusCreate) SetRoleID(v int) *RoleMenusCreate

SetRoleID sets the "role_id" field.

func (*RoleMenusCreate) SetUpdatedAt

func (_c *RoleMenusCreate) SetUpdatedAt(v time.Time) *RoleMenusCreate

SetUpdatedAt sets the "updated_at" field.

func (*RoleMenusCreate) SetUpdatedBy

func (_c *RoleMenusCreate) SetUpdatedBy(v int64) *RoleMenusCreate

SetUpdatedBy sets the "updated_by" field.

type RoleMenusCreateBulk

type RoleMenusCreateBulk struct {
	// contains filtered or unexported fields
}

RoleMenusCreateBulk is the builder for creating many RoleMenus entities in bulk.

func (*RoleMenusCreateBulk) Exec

func (_c *RoleMenusCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleMenusCreateBulk) ExecX

func (_c *RoleMenusCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleMenusCreateBulk) Save

func (_c *RoleMenusCreateBulk) Save(ctx context.Context) ([]*RoleMenus, error)

Save creates the RoleMenus entities in the database.

func (*RoleMenusCreateBulk) SaveX

func (_c *RoleMenusCreateBulk) SaveX(ctx context.Context) []*RoleMenus

SaveX is like Save, but panics if an error occurs.

type RoleMenusDelete

type RoleMenusDelete struct {
	// contains filtered or unexported fields
}

RoleMenusDelete is the builder for deleting a RoleMenus entity.

func (*RoleMenusDelete) Exec

func (_d *RoleMenusDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoleMenusDelete) ExecX

func (_d *RoleMenusDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoleMenusDelete) Where

Where appends a list predicates to the RoleMenusDelete builder.

type RoleMenusDeleteOne

type RoleMenusDeleteOne struct {
	// contains filtered or unexported fields
}

RoleMenusDeleteOne is the builder for deleting a single RoleMenus entity.

func (*RoleMenusDeleteOne) Exec

func (_d *RoleMenusDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleMenusDeleteOne) ExecX

func (_d *RoleMenusDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleMenusDeleteOne) Where

Where appends a list predicates to the RoleMenusDelete builder.

type RoleMenusEdges

type RoleMenusEdges struct {
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// LionMenus holds the value of the lion_menus edge.
	LionMenus *Menus `json:"lion_menus,omitempty"`
	// contains filtered or unexported fields
}

RoleMenusEdges holds the relations/edges for other nodes in the graph.

func (RoleMenusEdges) LionMenusOrErr

func (e RoleMenusEdges) LionMenusOrErr() (*Menus, error)

LionMenusOrErr returns the LionMenus value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RoleMenusEdges) LionRolesOrErr

func (e RoleMenusEdges) 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 RoleMenusGroupBy

type RoleMenusGroupBy struct {
	// contains filtered or unexported fields
}

RoleMenusGroupBy is the group-by builder for RoleMenus entities.

func (*RoleMenusGroupBy) Aggregate

func (_g *RoleMenusGroupBy) Aggregate(fns ...AggregateFunc) *RoleMenusGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoleMenusGroupBy) Bool

func (s *RoleMenusGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) BoolX

func (s *RoleMenusGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleMenusGroupBy) Bools

func (s *RoleMenusGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) BoolsX

func (s *RoleMenusGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleMenusGroupBy) Float64

func (s *RoleMenusGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) Float64X

func (s *RoleMenusGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleMenusGroupBy) Float64s

func (s *RoleMenusGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) Float64sX

func (s *RoleMenusGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleMenusGroupBy) Int

func (s *RoleMenusGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) IntX

func (s *RoleMenusGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleMenusGroupBy) Ints

func (s *RoleMenusGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) IntsX

func (s *RoleMenusGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleMenusGroupBy) Scan

func (_g *RoleMenusGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleMenusGroupBy) ScanX

func (s *RoleMenusGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleMenusGroupBy) String

func (s *RoleMenusGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) StringX

func (s *RoleMenusGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleMenusGroupBy) Strings

func (s *RoleMenusGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleMenusGroupBy) StringsX

func (s *RoleMenusGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleMenusMutation

type RoleMenusMutation struct {
	// contains filtered or unexported fields
}

RoleMenusMutation represents an operation that mutates the RoleMenus nodes in the graph.

func (*RoleMenusMutation) AddCreatedBy

func (m *RoleMenusMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RoleMenusMutation) AddField

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) AddPermissionScope

func (m *RoleMenusMutation) AddPermissionScope(i int)

AddPermissionScope adds i to the "permission_scope" field.

func (*RoleMenusMutation) AddUpdatedBy

func (m *RoleMenusMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RoleMenusMutation) AddedCreatedBy

func (m *RoleMenusMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RoleMenusMutation) AddedEdges

func (m *RoleMenusMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoleMenusMutation) AddedField

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) AddedFields

func (m *RoleMenusMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoleMenusMutation) AddedIDs

func (m *RoleMenusMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoleMenusMutation) AddedPermissionScope

func (m *RoleMenusMutation) AddedPermissionScope() (r int, exists bool)

AddedPermissionScope returns the value that was added to the "permission_scope" field in this mutation.

func (*RoleMenusMutation) AddedUpdatedBy

func (m *RoleMenusMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RoleMenusMutation) ClearCreatedBy

func (m *RoleMenusMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*RoleMenusMutation) ClearEdge

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) ClearField

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) ClearLionMenus

func (m *RoleMenusMutation) ClearLionMenus()

ClearLionMenus clears the "lion_menus" edge to the Menus entity.

func (*RoleMenusMutation) ClearLionRoles

func (m *RoleMenusMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RoleMenusMutation) ClearUpdatedBy

func (m *RoleMenusMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RoleMenusMutation) ClearedEdges

func (m *RoleMenusMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoleMenusMutation) ClearedFields

func (m *RoleMenusMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoleMenusMutation) Client

func (m RoleMenusMutation) 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 (*RoleMenusMutation) CreatedAt

func (m *RoleMenusMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RoleMenusMutation) CreatedBy

func (m *RoleMenusMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RoleMenusMutation) CreatedByCleared

func (m *RoleMenusMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*RoleMenusMutation) Description

func (m *RoleMenusMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*RoleMenusMutation) EdgeCleared

func (m *RoleMenusMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoleMenusMutation) Field

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) FieldCleared

func (m *RoleMenusMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoleMenusMutation) Fields

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) ID

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) IDs

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) IsRecursive

func (m *RoleMenusMutation) IsRecursive() (r bool, exists bool)

IsRecursive returns the value of the "is_recursive" field in the mutation.

func (*RoleMenusMutation) LionMenusCleared

func (m *RoleMenusMutation) LionMenusCleared() bool

LionMenusCleared reports if the "lion_menus" edge to the Menus entity was cleared.

func (*RoleMenusMutation) LionMenusID

func (m *RoleMenusMutation) LionMenusID() (id int, exists bool)

LionMenusID returns the "lion_menus" edge ID in the mutation.

func (*RoleMenusMutation) LionMenusIDs

func (m *RoleMenusMutation) LionMenusIDs() (ids []int)

LionMenusIDs returns the "lion_menus" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionMenusID instead. It exists only for internal usage by the builders.

func (*RoleMenusMutation) LionRolesCleared

func (m *RoleMenusMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*RoleMenusMutation) LionRolesID

func (m *RoleMenusMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*RoleMenusMutation) LionRolesIDs

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) MenuID

func (m *RoleMenusMutation) MenuID() (r int, exists bool)

MenuID returns the value of the "menu_id" field in the mutation.

func (*RoleMenusMutation) OldCreatedAt

func (m *RoleMenusMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldCreatedBy

func (m *RoleMenusMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldDescription

func (m *RoleMenusMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldField

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) OldIsRecursive

func (m *RoleMenusMutation) OldIsRecursive(ctx context.Context) (v bool, err error)

OldIsRecursive returns the old "is_recursive" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldMenuID

func (m *RoleMenusMutation) OldMenuID(ctx context.Context) (v int, err error)

OldMenuID returns the old "menu_id" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldPermissionScope

func (m *RoleMenusMutation) OldPermissionScope(ctx context.Context) (v int, err error)

OldPermissionScope returns the old "permission_scope" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldRoleID

func (m *RoleMenusMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldUpdatedAt

func (m *RoleMenusMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) OldUpdatedBy

func (m *RoleMenusMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the RoleMenus entity. If the RoleMenus object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMenusMutation) Op

func (m *RoleMenusMutation) Op() Op

Op returns the operation name.

func (*RoleMenusMutation) PermissionScope

func (m *RoleMenusMutation) PermissionScope() (r int, exists bool)

PermissionScope returns the value of the "permission_scope" field in the mutation.

func (*RoleMenusMutation) RemovedEdges

func (m *RoleMenusMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoleMenusMutation) RemovedIDs

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) ResetCreatedAt

func (m *RoleMenusMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoleMenusMutation) ResetCreatedBy

func (m *RoleMenusMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RoleMenusMutation) ResetDescription

func (m *RoleMenusMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RoleMenusMutation) ResetEdge

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) ResetField

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) ResetIsRecursive

func (m *RoleMenusMutation) ResetIsRecursive()

ResetIsRecursive resets all changes to the "is_recursive" field.

func (*RoleMenusMutation) ResetLionMenus

func (m *RoleMenusMutation) ResetLionMenus()

ResetLionMenus resets all changes to the "lion_menus" edge.

func (*RoleMenusMutation) ResetLionRoles

func (m *RoleMenusMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*RoleMenusMutation) ResetMenuID

func (m *RoleMenusMutation) ResetMenuID()

ResetMenuID resets all changes to the "menu_id" field.

func (*RoleMenusMutation) ResetPermissionScope

func (m *RoleMenusMutation) ResetPermissionScope()

ResetPermissionScope resets all changes to the "permission_scope" field.

func (*RoleMenusMutation) ResetRoleID

func (m *RoleMenusMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*RoleMenusMutation) ResetUpdatedAt

func (m *RoleMenusMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RoleMenusMutation) ResetUpdatedBy

func (m *RoleMenusMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RoleMenusMutation) RoleID

func (m *RoleMenusMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*RoleMenusMutation) SetCreatedAt

func (m *RoleMenusMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RoleMenusMutation) SetCreatedBy

func (m *RoleMenusMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RoleMenusMutation) SetDescription

func (m *RoleMenusMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RoleMenusMutation) SetField

func (m *RoleMenusMutation) 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 (*RoleMenusMutation) SetIsRecursive

func (m *RoleMenusMutation) SetIsRecursive(b bool)

SetIsRecursive sets the "is_recursive" field.

func (*RoleMenusMutation) SetLionMenusID

func (m *RoleMenusMutation) SetLionMenusID(id int)

SetLionMenusID sets the "lion_menus" edge to the Menus entity by id.

func (*RoleMenusMutation) SetLionRolesID

func (m *RoleMenusMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*RoleMenusMutation) SetMenuID

func (m *RoleMenusMutation) SetMenuID(i int)

SetMenuID sets the "menu_id" field.

func (*RoleMenusMutation) SetOp

func (m *RoleMenusMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RoleMenusMutation) SetPermissionScope

func (m *RoleMenusMutation) SetPermissionScope(i int)

SetPermissionScope sets the "permission_scope" field.

func (*RoleMenusMutation) SetRoleID

func (m *RoleMenusMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*RoleMenusMutation) SetUpdatedAt

func (m *RoleMenusMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RoleMenusMutation) SetUpdatedBy

func (m *RoleMenusMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (RoleMenusMutation) Tx

func (m RoleMenusMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoleMenusMutation) Type

func (m *RoleMenusMutation) Type() string

Type returns the node type of this mutation (RoleMenus).

func (*RoleMenusMutation) UpdatedAt

func (m *RoleMenusMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RoleMenusMutation) UpdatedBy

func (m *RoleMenusMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RoleMenusMutation) UpdatedByCleared

func (m *RoleMenusMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*RoleMenusMutation) Where

func (m *RoleMenusMutation) Where(ps ...predicate.RoleMenus)

Where appends a list predicates to the RoleMenusMutation builder.

func (*RoleMenusMutation) WhereP

func (m *RoleMenusMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RoleMenusMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RoleMenusQuery

type RoleMenusQuery struct {
	// contains filtered or unexported fields
}

RoleMenusQuery is the builder for querying RoleMenus entities.

func (*RoleMenusQuery) Aggregate

func (_q *RoleMenusQuery) Aggregate(fns ...AggregateFunc) *RoleMenusSelect

Aggregate returns a RoleMenusSelect configured with the given aggregations.

func (*RoleMenusQuery) All

func (_q *RoleMenusQuery) All(ctx context.Context) ([]*RoleMenus, error)

All executes the query and returns a list of RoleMenusSlice.

func (*RoleMenusQuery) AllX

func (_q *RoleMenusQuery) AllX(ctx context.Context) []*RoleMenus

AllX is like All, but panics if an error occurs.

func (*RoleMenusQuery) Clone

func (_q *RoleMenusQuery) Clone() *RoleMenusQuery

Clone returns a duplicate of the RoleMenusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoleMenusQuery) Count

func (_q *RoleMenusQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleMenusQuery) CountX

func (_q *RoleMenusQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoleMenusQuery) Exist

func (_q *RoleMenusQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoleMenusQuery) ExistX

func (_q *RoleMenusQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoleMenusQuery) First

func (_q *RoleMenusQuery) First(ctx context.Context) (*RoleMenus, error)

First returns the first RoleMenus entity from the query. Returns a *NotFoundError when no RoleMenus was found.

func (*RoleMenusQuery) FirstID

func (_q *RoleMenusQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first RoleMenus ID from the query. Returns a *NotFoundError when no RoleMenus ID was found.

func (*RoleMenusQuery) FirstIDX

func (_q *RoleMenusQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoleMenusQuery) FirstX

func (_q *RoleMenusQuery) FirstX(ctx context.Context) *RoleMenus

FirstX is like First, but panics if an error occurs.

func (*RoleMenusQuery) GroupBy

func (_q *RoleMenusQuery) GroupBy(field string, fields ...string) *RoleMenusGroupBy

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.RoleMenus.Query().
	GroupBy(rolemenus.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*RoleMenusQuery) IDs

func (_q *RoleMenusQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of RoleMenus IDs.

func (*RoleMenusQuery) IDsX

func (_q *RoleMenusQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RoleMenusQuery) Limit

func (_q *RoleMenusQuery) Limit(limit int) *RoleMenusQuery

Limit the number of records to be returned by this query.

func (*RoleMenusQuery) Offset

func (_q *RoleMenusQuery) Offset(offset int) *RoleMenusQuery

Offset to start from.

func (*RoleMenusQuery) Only

func (_q *RoleMenusQuery) Only(ctx context.Context) (*RoleMenus, error)

Only returns a single RoleMenus entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RoleMenus entity is found. Returns a *NotFoundError when no RoleMenus entities are found.

func (*RoleMenusQuery) OnlyID

func (_q *RoleMenusQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only RoleMenus ID in the query. Returns a *NotSingularError when more than one RoleMenus ID is found. Returns a *NotFoundError when no entities are found.

func (*RoleMenusQuery) OnlyIDX

func (_q *RoleMenusQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoleMenusQuery) OnlyX

func (_q *RoleMenusQuery) OnlyX(ctx context.Context) *RoleMenus

OnlyX is like Only, but panics if an error occurs.

func (*RoleMenusQuery) Order

Order specifies how the records should be ordered.

func (*RoleMenusQuery) QueryLionMenus

func (_q *RoleMenusQuery) QueryLionMenus() *MenusQuery

QueryLionMenus chains the current query on the "lion_menus" edge.

func (*RoleMenusQuery) QueryLionRoles

func (_q *RoleMenusQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*RoleMenusQuery) Select

func (_q *RoleMenusQuery) Select(fields ...string) *RoleMenusSelect

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.RoleMenus.Query().
	Select(rolemenus.FieldCreatedAt).
	Scan(ctx, &v)

func (*RoleMenusQuery) Unique

func (_q *RoleMenusQuery) Unique(unique bool) *RoleMenusQuery

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 (*RoleMenusQuery) Where

Where adds a new predicate for the RoleMenusQuery builder.

func (*RoleMenusQuery) WithLionMenus

func (_q *RoleMenusQuery) WithLionMenus(opts ...func(*MenusQuery)) *RoleMenusQuery

WithLionMenus tells the query-builder to eager-load the nodes that are connected to the "lion_menus" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoleMenusQuery) WithLionRoles

func (_q *RoleMenusQuery) WithLionRoles(opts ...func(*RolesQuery)) *RoleMenusQuery

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 RoleMenusSelect

type RoleMenusSelect struct {
	*RoleMenusQuery
	// contains filtered or unexported fields
}

RoleMenusSelect is the builder for selecting fields of RoleMenus entities.

func (*RoleMenusSelect) Aggregate

func (_s *RoleMenusSelect) Aggregate(fns ...AggregateFunc) *RoleMenusSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleMenusSelect) Bool

func (s *RoleMenusSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) BoolX

func (s *RoleMenusSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleMenusSelect) Bools

func (s *RoleMenusSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) BoolsX

func (s *RoleMenusSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleMenusSelect) Float64

func (s *RoleMenusSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) Float64X

func (s *RoleMenusSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleMenusSelect) Float64s

func (s *RoleMenusSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) Float64sX

func (s *RoleMenusSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleMenusSelect) Int

func (s *RoleMenusSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) IntX

func (s *RoleMenusSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleMenusSelect) Ints

func (s *RoleMenusSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) IntsX

func (s *RoleMenusSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleMenusSelect) Scan

func (_s *RoleMenusSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleMenusSelect) ScanX

func (s *RoleMenusSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleMenusSelect) String

func (s *RoleMenusSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) StringX

func (s *RoleMenusSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleMenusSelect) Strings

func (s *RoleMenusSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleMenusSelect) StringsX

func (s *RoleMenusSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleMenusSlice

type RoleMenusSlice []*RoleMenus

RoleMenusSlice is a parsable slice of RoleMenus.

type RoleMenusUpdate

type RoleMenusUpdate struct {
	// contains filtered or unexported fields
}

RoleMenusUpdate is the builder for updating RoleMenus entities.

func (*RoleMenusUpdate) AddCreatedBy

func (_u *RoleMenusUpdate) AddCreatedBy(v int64) *RoleMenusUpdate

AddCreatedBy adds value to the "created_by" field.

func (*RoleMenusUpdate) AddPermissionScope

func (_u *RoleMenusUpdate) AddPermissionScope(v int) *RoleMenusUpdate

AddPermissionScope adds value to the "permission_scope" field.

func (*RoleMenusUpdate) AddUpdatedBy

func (_u *RoleMenusUpdate) AddUpdatedBy(v int64) *RoleMenusUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*RoleMenusUpdate) ClearCreatedBy

func (_u *RoleMenusUpdate) ClearCreatedBy() *RoleMenusUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*RoleMenusUpdate) ClearLionMenus

func (_u *RoleMenusUpdate) ClearLionMenus() *RoleMenusUpdate

ClearLionMenus clears the "lion_menus" edge to the Menus entity.

func (*RoleMenusUpdate) ClearLionRoles

func (_u *RoleMenusUpdate) ClearLionRoles() *RoleMenusUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RoleMenusUpdate) ClearUpdatedBy

func (_u *RoleMenusUpdate) ClearUpdatedBy() *RoleMenusUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RoleMenusUpdate) Exec

func (_u *RoleMenusUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleMenusUpdate) ExecX

func (_u *RoleMenusUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleMenusUpdate) Mutation

func (_u *RoleMenusUpdate) Mutation() *RoleMenusMutation

Mutation returns the RoleMenusMutation object of the builder.

func (*RoleMenusUpdate) Save

func (_u *RoleMenusUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoleMenusUpdate) SaveX

func (_u *RoleMenusUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoleMenusUpdate) SetCreatedBy

func (_u *RoleMenusUpdate) SetCreatedBy(v int64) *RoleMenusUpdate

SetCreatedBy sets the "created_by" field.

func (*RoleMenusUpdate) SetDescription

func (_u *RoleMenusUpdate) SetDescription(v string) *RoleMenusUpdate

SetDescription sets the "description" field.

func (*RoleMenusUpdate) SetIsRecursive

func (_u *RoleMenusUpdate) SetIsRecursive(v bool) *RoleMenusUpdate

SetIsRecursive sets the "is_recursive" field.

func (*RoleMenusUpdate) SetLionMenus

func (_u *RoleMenusUpdate) SetLionMenus(v *Menus) *RoleMenusUpdate

SetLionMenus sets the "lion_menus" edge to the Menus entity.

func (*RoleMenusUpdate) SetLionMenusID

func (_u *RoleMenusUpdate) SetLionMenusID(id int) *RoleMenusUpdate

SetLionMenusID sets the "lion_menus" edge to the Menus entity by ID.

func (*RoleMenusUpdate) SetLionRoles

func (_u *RoleMenusUpdate) SetLionRoles(v *Roles) *RoleMenusUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RoleMenusUpdate) SetLionRolesID

func (_u *RoleMenusUpdate) SetLionRolesID(id int) *RoleMenusUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RoleMenusUpdate) SetMenuID

func (_u *RoleMenusUpdate) SetMenuID(v int) *RoleMenusUpdate

SetMenuID sets the "menu_id" field.

func (*RoleMenusUpdate) SetNillableCreatedBy

func (_u *RoleMenusUpdate) SetNillableCreatedBy(v *int64) *RoleMenusUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoleMenusUpdate) SetNillableDescription

func (_u *RoleMenusUpdate) SetNillableDescription(v *string) *RoleMenusUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RoleMenusUpdate) SetNillableIsRecursive

func (_u *RoleMenusUpdate) SetNillableIsRecursive(v *bool) *RoleMenusUpdate

SetNillableIsRecursive sets the "is_recursive" field if the given value is not nil.

func (*RoleMenusUpdate) SetNillableMenuID

func (_u *RoleMenusUpdate) SetNillableMenuID(v *int) *RoleMenusUpdate

SetNillableMenuID sets the "menu_id" field if the given value is not nil.

func (*RoleMenusUpdate) SetNillablePermissionScope

func (_u *RoleMenusUpdate) SetNillablePermissionScope(v *int) *RoleMenusUpdate

SetNillablePermissionScope sets the "permission_scope" field if the given value is not nil.

func (*RoleMenusUpdate) SetNillableRoleID

func (_u *RoleMenusUpdate) SetNillableRoleID(v *int) *RoleMenusUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*RoleMenusUpdate) SetNillableUpdatedBy

func (_u *RoleMenusUpdate) SetNillableUpdatedBy(v *int64) *RoleMenusUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoleMenusUpdate) SetPermissionScope

func (_u *RoleMenusUpdate) SetPermissionScope(v int) *RoleMenusUpdate

SetPermissionScope sets the "permission_scope" field.

func (*RoleMenusUpdate) SetRoleID

func (_u *RoleMenusUpdate) SetRoleID(v int) *RoleMenusUpdate

SetRoleID sets the "role_id" field.

func (*RoleMenusUpdate) SetUpdatedAt

func (_u *RoleMenusUpdate) SetUpdatedAt(v time.Time) *RoleMenusUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RoleMenusUpdate) SetUpdatedBy

func (_u *RoleMenusUpdate) SetUpdatedBy(v int64) *RoleMenusUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RoleMenusUpdate) Where

Where appends a list predicates to the RoleMenusUpdate builder.

type RoleMenusUpdateOne

type RoleMenusUpdateOne struct {
	// contains filtered or unexported fields
}

RoleMenusUpdateOne is the builder for updating a single RoleMenus entity.

func (*RoleMenusUpdateOne) AddCreatedBy

func (_u *RoleMenusUpdateOne) AddCreatedBy(v int64) *RoleMenusUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*RoleMenusUpdateOne) AddPermissionScope

func (_u *RoleMenusUpdateOne) AddPermissionScope(v int) *RoleMenusUpdateOne

AddPermissionScope adds value to the "permission_scope" field.

func (*RoleMenusUpdateOne) AddUpdatedBy

func (_u *RoleMenusUpdateOne) AddUpdatedBy(v int64) *RoleMenusUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*RoleMenusUpdateOne) ClearCreatedBy

func (_u *RoleMenusUpdateOne) ClearCreatedBy() *RoleMenusUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*RoleMenusUpdateOne) ClearLionMenus

func (_u *RoleMenusUpdateOne) ClearLionMenus() *RoleMenusUpdateOne

ClearLionMenus clears the "lion_menus" edge to the Menus entity.

func (*RoleMenusUpdateOne) ClearLionRoles

func (_u *RoleMenusUpdateOne) ClearLionRoles() *RoleMenusUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RoleMenusUpdateOne) ClearUpdatedBy

func (_u *RoleMenusUpdateOne) ClearUpdatedBy() *RoleMenusUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RoleMenusUpdateOne) Exec

func (_u *RoleMenusUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleMenusUpdateOne) ExecX

func (_u *RoleMenusUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleMenusUpdateOne) Mutation

func (_u *RoleMenusUpdateOne) Mutation() *RoleMenusMutation

Mutation returns the RoleMenusMutation object of the builder.

func (*RoleMenusUpdateOne) Save

func (_u *RoleMenusUpdateOne) Save(ctx context.Context) (*RoleMenus, error)

Save executes the query and returns the updated RoleMenus entity.

func (*RoleMenusUpdateOne) SaveX

func (_u *RoleMenusUpdateOne) SaveX(ctx context.Context) *RoleMenus

SaveX is like Save, but panics if an error occurs.

func (*RoleMenusUpdateOne) Select

func (_u *RoleMenusUpdateOne) Select(field string, fields ...string) *RoleMenusUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoleMenusUpdateOne) SetCreatedBy

func (_u *RoleMenusUpdateOne) SetCreatedBy(v int64) *RoleMenusUpdateOne

SetCreatedBy sets the "created_by" field.

func (*RoleMenusUpdateOne) SetDescription

func (_u *RoleMenusUpdateOne) SetDescription(v string) *RoleMenusUpdateOne

SetDescription sets the "description" field.

func (*RoleMenusUpdateOne) SetIsRecursive

func (_u *RoleMenusUpdateOne) SetIsRecursive(v bool) *RoleMenusUpdateOne

SetIsRecursive sets the "is_recursive" field.

func (*RoleMenusUpdateOne) SetLionMenus

func (_u *RoleMenusUpdateOne) SetLionMenus(v *Menus) *RoleMenusUpdateOne

SetLionMenus sets the "lion_menus" edge to the Menus entity.

func (*RoleMenusUpdateOne) SetLionMenusID

func (_u *RoleMenusUpdateOne) SetLionMenusID(id int) *RoleMenusUpdateOne

SetLionMenusID sets the "lion_menus" edge to the Menus entity by ID.

func (*RoleMenusUpdateOne) SetLionRoles

func (_u *RoleMenusUpdateOne) SetLionRoles(v *Roles) *RoleMenusUpdateOne

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RoleMenusUpdateOne) SetLionRolesID

func (_u *RoleMenusUpdateOne) SetLionRolesID(id int) *RoleMenusUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RoleMenusUpdateOne) SetMenuID

func (_u *RoleMenusUpdateOne) SetMenuID(v int) *RoleMenusUpdateOne

SetMenuID sets the "menu_id" field.

func (*RoleMenusUpdateOne) SetNillableCreatedBy

func (_u *RoleMenusUpdateOne) SetNillableCreatedBy(v *int64) *RoleMenusUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetNillableDescription

func (_u *RoleMenusUpdateOne) SetNillableDescription(v *string) *RoleMenusUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetNillableIsRecursive

func (_u *RoleMenusUpdateOne) SetNillableIsRecursive(v *bool) *RoleMenusUpdateOne

SetNillableIsRecursive sets the "is_recursive" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetNillableMenuID

func (_u *RoleMenusUpdateOne) SetNillableMenuID(v *int) *RoleMenusUpdateOne

SetNillableMenuID sets the "menu_id" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetNillablePermissionScope

func (_u *RoleMenusUpdateOne) SetNillablePermissionScope(v *int) *RoleMenusUpdateOne

SetNillablePermissionScope sets the "permission_scope" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetNillableRoleID

func (_u *RoleMenusUpdateOne) SetNillableRoleID(v *int) *RoleMenusUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetNillableUpdatedBy

func (_u *RoleMenusUpdateOne) SetNillableUpdatedBy(v *int64) *RoleMenusUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoleMenusUpdateOne) SetPermissionScope

func (_u *RoleMenusUpdateOne) SetPermissionScope(v int) *RoleMenusUpdateOne

SetPermissionScope sets the "permission_scope" field.

func (*RoleMenusUpdateOne) SetRoleID

func (_u *RoleMenusUpdateOne) SetRoleID(v int) *RoleMenusUpdateOne

SetRoleID sets the "role_id" field.

func (*RoleMenusUpdateOne) SetUpdatedAt

func (_u *RoleMenusUpdateOne) SetUpdatedAt(v time.Time) *RoleMenusUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RoleMenusUpdateOne) SetUpdatedBy

func (_u *RoleMenusUpdateOne) SetUpdatedBy(v int64) *RoleMenusUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*RoleMenusUpdateOne) Where

Where appends a list predicates to the RoleMenusUpdate builder.

type RolePolicies

type RolePolicies 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_policies 表的策略 ID
	PolicyID int `json:"policy_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 RolePoliciesQuery when eager-loading is set.
	Edges RolePoliciesEdges `json:"edges"`
	// contains filtered or unexported fields
}

RolePolicies is the model entity for the RolePolicies schema.

func (*RolePolicies) QueryLionPolicies

func (_m *RolePolicies) QueryLionPolicies() *PoliciesQuery

QueryLionPolicies queries the "lion_policies" edge of the RolePolicies entity.

func (*RolePolicies) QueryLionRoles

func (_m *RolePolicies) QueryLionRoles() *RolesQuery

QueryLionRoles queries the "lion_roles" edge of the RolePolicies entity.

func (*RolePolicies) String

func (_m *RolePolicies) String() string

String implements the fmt.Stringer.

func (*RolePolicies) Unwrap

func (_m *RolePolicies) Unwrap() *RolePolicies

Unwrap unwraps the RolePolicies 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 (*RolePolicies) Update

func (_m *RolePolicies) Update() *RolePoliciesUpdateOne

Update returns a builder for updating this RolePolicies. Note that you need to call RolePolicies.Unwrap() before calling this method if this RolePolicies was returned from a transaction, and the transaction was committed or rolled back.

func (*RolePolicies) Value

func (_m *RolePolicies) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the RolePolicies. This includes values selected through modifiers, order, etc.

type RolePoliciesClient

type RolePoliciesClient struct {
	// contains filtered or unexported fields
}

RolePoliciesClient is a client for the RolePolicies schema.

func NewRolePoliciesClient

func NewRolePoliciesClient(c config) *RolePoliciesClient

NewRolePoliciesClient returns a client for the RolePolicies from the given config.

func (*RolePoliciesClient) Create

Create returns a builder for creating a RolePolicies entity.

func (*RolePoliciesClient) CreateBulk

func (c *RolePoliciesClient) CreateBulk(builders ...*RolePoliciesCreate) *RolePoliciesCreateBulk

CreateBulk returns a builder for creating a bulk of RolePolicies entities.

func (*RolePoliciesClient) Delete

Delete returns a delete builder for RolePolicies.

func (*RolePoliciesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RolePoliciesClient) DeleteOneID

func (c *RolePoliciesClient) DeleteOneID(id int) *RolePoliciesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RolePoliciesClient) Get

Get returns a RolePolicies entity by its id.

func (*RolePoliciesClient) GetX

GetX is like Get, but panics if an error occurs.

func (*RolePoliciesClient) Hooks

func (c *RolePoliciesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RolePoliciesClient) Intercept

func (c *RolePoliciesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `rolepolicies.Intercept(f(g(h())))`.

func (*RolePoliciesClient) Interceptors

func (c *RolePoliciesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RolePoliciesClient) MapCreateBulk

func (c *RolePoliciesClient) MapCreateBulk(slice any, setFunc func(*RolePoliciesCreate, int)) *RolePoliciesCreateBulk

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 (*RolePoliciesClient) Query

Query returns a query builder for RolePolicies.

func (*RolePoliciesClient) QueryLionPolicies

func (c *RolePoliciesClient) QueryLionPolicies(_m *RolePolicies) *PoliciesQuery

QueryLionPolicies queries the lion_policies edge of a RolePolicies.

func (*RolePoliciesClient) QueryLionRoles

func (c *RolePoliciesClient) QueryLionRoles(_m *RolePolicies) *RolesQuery

QueryLionRoles queries the lion_roles edge of a RolePolicies.

func (*RolePoliciesClient) Update

Update returns an update builder for RolePolicies.

func (*RolePoliciesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RolePoliciesClient) UpdateOneID

func (c *RolePoliciesClient) UpdateOneID(id int) *RolePoliciesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RolePoliciesClient) Use

func (c *RolePoliciesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rolepolicies.Hooks(f(g(h())))`.

type RolePoliciesCreate

type RolePoliciesCreate struct {
	// contains filtered or unexported fields
}

RolePoliciesCreate is the builder for creating a RolePolicies entity.

func (*RolePoliciesCreate) Exec

func (_c *RolePoliciesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RolePoliciesCreate) ExecX

func (_c *RolePoliciesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePoliciesCreate) Mutation

func (_c *RolePoliciesCreate) Mutation() *RolePoliciesMutation

Mutation returns the RolePoliciesMutation object of the builder.

func (*RolePoliciesCreate) Save

Save creates the RolePolicies in the database.

func (*RolePoliciesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RolePoliciesCreate) SetCreatedAt

func (_c *RolePoliciesCreate) SetCreatedAt(v time.Time) *RolePoliciesCreate

SetCreatedAt sets the "created_at" field.

func (*RolePoliciesCreate) SetCreatedBy

func (_c *RolePoliciesCreate) SetCreatedBy(v int64) *RolePoliciesCreate

SetCreatedBy sets the "created_by" field.

func (*RolePoliciesCreate) SetDescription

func (_c *RolePoliciesCreate) SetDescription(v string) *RolePoliciesCreate

SetDescription sets the "description" field.

func (*RolePoliciesCreate) SetLionPolicies

func (_c *RolePoliciesCreate) SetLionPolicies(v *Policies) *RolePoliciesCreate

SetLionPolicies sets the "lion_policies" edge to the Policies entity.

func (*RolePoliciesCreate) SetLionPoliciesID

func (_c *RolePoliciesCreate) SetLionPoliciesID(id int) *RolePoliciesCreate

SetLionPoliciesID sets the "lion_policies" edge to the Policies entity by ID.

func (*RolePoliciesCreate) SetLionRoles

func (_c *RolePoliciesCreate) SetLionRoles(v *Roles) *RolePoliciesCreate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RolePoliciesCreate) SetLionRolesID

func (_c *RolePoliciesCreate) SetLionRolesID(id int) *RolePoliciesCreate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RolePoliciesCreate) SetMetadata

func (_c *RolePoliciesCreate) SetMetadata(v map[string]string) *RolePoliciesCreate

SetMetadata sets the "metadata" field.

func (*RolePoliciesCreate) SetNillableCreatedAt

func (_c *RolePoliciesCreate) SetNillableCreatedAt(v *time.Time) *RolePoliciesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RolePoliciesCreate) SetNillableCreatedBy

func (_c *RolePoliciesCreate) SetNillableCreatedBy(v *int64) *RolePoliciesCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolePoliciesCreate) SetNillableDescription

func (_c *RolePoliciesCreate) SetNillableDescription(v *string) *RolePoliciesCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RolePoliciesCreate) SetNillableUpdatedAt

func (_c *RolePoliciesCreate) SetNillableUpdatedAt(v *time.Time) *RolePoliciesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RolePoliciesCreate) SetNillableUpdatedBy

func (_c *RolePoliciesCreate) SetNillableUpdatedBy(v *int64) *RolePoliciesCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolePoliciesCreate) SetPolicyID

func (_c *RolePoliciesCreate) SetPolicyID(v int) *RolePoliciesCreate

SetPolicyID sets the "policy_id" field.

func (*RolePoliciesCreate) SetRoleID

func (_c *RolePoliciesCreate) SetRoleID(v int) *RolePoliciesCreate

SetRoleID sets the "role_id" field.

func (*RolePoliciesCreate) SetUpdatedAt

func (_c *RolePoliciesCreate) SetUpdatedAt(v time.Time) *RolePoliciesCreate

SetUpdatedAt sets the "updated_at" field.

func (*RolePoliciesCreate) SetUpdatedBy

func (_c *RolePoliciesCreate) SetUpdatedBy(v int64) *RolePoliciesCreate

SetUpdatedBy sets the "updated_by" field.

type RolePoliciesCreateBulk

type RolePoliciesCreateBulk struct {
	// contains filtered or unexported fields
}

RolePoliciesCreateBulk is the builder for creating many RolePolicies entities in bulk.

func (*RolePoliciesCreateBulk) Exec

Exec executes the query.

func (*RolePoliciesCreateBulk) ExecX

func (_c *RolePoliciesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePoliciesCreateBulk) Save

Save creates the RolePolicies entities in the database.

func (*RolePoliciesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type RolePoliciesDelete

type RolePoliciesDelete struct {
	// contains filtered or unexported fields
}

RolePoliciesDelete is the builder for deleting a RolePolicies entity.

func (*RolePoliciesDelete) Exec

func (_d *RolePoliciesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RolePoliciesDelete) ExecX

func (_d *RolePoliciesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RolePoliciesDelete) Where

Where appends a list predicates to the RolePoliciesDelete builder.

type RolePoliciesDeleteOne

type RolePoliciesDeleteOne struct {
	// contains filtered or unexported fields
}

RolePoliciesDeleteOne is the builder for deleting a single RolePolicies entity.

func (*RolePoliciesDeleteOne) Exec

Exec executes the deletion query.

func (*RolePoliciesDeleteOne) ExecX

func (_d *RolePoliciesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePoliciesDeleteOne) Where

Where appends a list predicates to the RolePoliciesDelete builder.

type RolePoliciesEdges

type RolePoliciesEdges struct {
	// LionRoles holds the value of the lion_roles edge.
	LionRoles *Roles `json:"lion_roles,omitempty"`
	// LionPolicies holds the value of the lion_policies edge.
	LionPolicies *Policies `json:"lion_policies,omitempty"`
	// contains filtered or unexported fields
}

RolePoliciesEdges holds the relations/edges for other nodes in the graph.

func (RolePoliciesEdges) LionPoliciesOrErr

func (e RolePoliciesEdges) LionPoliciesOrErr() (*Policies, error)

LionPoliciesOrErr returns the LionPolicies value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RolePoliciesEdges) LionRolesOrErr

func (e RolePoliciesEdges) 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 RolePoliciesGroupBy

type RolePoliciesGroupBy struct {
	// contains filtered or unexported fields
}

RolePoliciesGroupBy is the group-by builder for RolePolicies entities.

func (*RolePoliciesGroupBy) Aggregate

func (_g *RolePoliciesGroupBy) Aggregate(fns ...AggregateFunc) *RolePoliciesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RolePoliciesGroupBy) Bool

func (s *RolePoliciesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) BoolX

func (s *RolePoliciesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RolePoliciesGroupBy) Bools

func (s *RolePoliciesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) BoolsX

func (s *RolePoliciesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RolePoliciesGroupBy) Float64

func (s *RolePoliciesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) Float64X

func (s *RolePoliciesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RolePoliciesGroupBy) Float64s

func (s *RolePoliciesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) Float64sX

func (s *RolePoliciesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RolePoliciesGroupBy) Int

func (s *RolePoliciesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) IntX

func (s *RolePoliciesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RolePoliciesGroupBy) Ints

func (s *RolePoliciesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) IntsX

func (s *RolePoliciesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RolePoliciesGroupBy) Scan

func (_g *RolePoliciesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RolePoliciesGroupBy) ScanX

func (s *RolePoliciesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RolePoliciesGroupBy) String

func (s *RolePoliciesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) StringX

func (s *RolePoliciesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RolePoliciesGroupBy) Strings

func (s *RolePoliciesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RolePoliciesGroupBy) StringsX

func (s *RolePoliciesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RolePoliciesMutation

type RolePoliciesMutation struct {
	// contains filtered or unexported fields
}

RolePoliciesMutation represents an operation that mutates the RolePolicies nodes in the graph.

func (*RolePoliciesMutation) AddCreatedBy

func (m *RolePoliciesMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RolePoliciesMutation) AddField

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) AddUpdatedBy

func (m *RolePoliciesMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RolePoliciesMutation) AddedCreatedBy

func (m *RolePoliciesMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RolePoliciesMutation) AddedEdges

func (m *RolePoliciesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RolePoliciesMutation) AddedField

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) AddedFields

func (m *RolePoliciesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RolePoliciesMutation) AddedIDs

func (m *RolePoliciesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RolePoliciesMutation) AddedUpdatedBy

func (m *RolePoliciesMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RolePoliciesMutation) ClearCreatedBy

func (m *RolePoliciesMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*RolePoliciesMutation) ClearEdge

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) ClearField

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) ClearLionPolicies

func (m *RolePoliciesMutation) ClearLionPolicies()

ClearLionPolicies clears the "lion_policies" edge to the Policies entity.

func (*RolePoliciesMutation) ClearLionRoles

func (m *RolePoliciesMutation) ClearLionRoles()

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RolePoliciesMutation) ClearMetadata

func (m *RolePoliciesMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*RolePoliciesMutation) ClearUpdatedBy

func (m *RolePoliciesMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolePoliciesMutation) ClearedEdges

func (m *RolePoliciesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RolePoliciesMutation) ClearedFields

func (m *RolePoliciesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RolePoliciesMutation) Client

func (m RolePoliciesMutation) 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 (*RolePoliciesMutation) CreatedAt

func (m *RolePoliciesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RolePoliciesMutation) CreatedBy

func (m *RolePoliciesMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RolePoliciesMutation) CreatedByCleared

func (m *RolePoliciesMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*RolePoliciesMutation) Description

func (m *RolePoliciesMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*RolePoliciesMutation) EdgeCleared

func (m *RolePoliciesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RolePoliciesMutation) Field

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) FieldCleared

func (m *RolePoliciesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RolePoliciesMutation) Fields

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) ID

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) IDs

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) LionPoliciesCleared

func (m *RolePoliciesMutation) LionPoliciesCleared() bool

LionPoliciesCleared reports if the "lion_policies" edge to the Policies entity was cleared.

func (*RolePoliciesMutation) LionPoliciesID

func (m *RolePoliciesMutation) LionPoliciesID() (id int, exists bool)

LionPoliciesID returns the "lion_policies" edge ID in the mutation.

func (*RolePoliciesMutation) LionPoliciesIDs

func (m *RolePoliciesMutation) LionPoliciesIDs() (ids []int)

LionPoliciesIDs returns the "lion_policies" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LionPoliciesID instead. It exists only for internal usage by the builders.

func (*RolePoliciesMutation) LionRolesCleared

func (m *RolePoliciesMutation) LionRolesCleared() bool

LionRolesCleared reports if the "lion_roles" edge to the Roles entity was cleared.

func (*RolePoliciesMutation) LionRolesID

func (m *RolePoliciesMutation) LionRolesID() (id int, exists bool)

LionRolesID returns the "lion_roles" edge ID in the mutation.

func (*RolePoliciesMutation) LionRolesIDs

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) Metadata

func (m *RolePoliciesMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*RolePoliciesMutation) MetadataCleared

func (m *RolePoliciesMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*RolePoliciesMutation) OldCreatedAt

func (m *RolePoliciesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldCreatedBy

func (m *RolePoliciesMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldDescription

func (m *RolePoliciesMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldField

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) OldMetadata

func (m *RolePoliciesMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldPolicyID

func (m *RolePoliciesMutation) OldPolicyID(ctx context.Context) (v int, err error)

OldPolicyID returns the old "policy_id" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldRoleID

func (m *RolePoliciesMutation) OldRoleID(ctx context.Context) (v int, err error)

OldRoleID returns the old "role_id" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldUpdatedAt

func (m *RolePoliciesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) OldUpdatedBy

func (m *RolePoliciesMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the RolePolicies entity. If the RolePolicies object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RolePoliciesMutation) Op

func (m *RolePoliciesMutation) Op() Op

Op returns the operation name.

func (*RolePoliciesMutation) PolicyID

func (m *RolePoliciesMutation) PolicyID() (r int, exists bool)

PolicyID returns the value of the "policy_id" field in the mutation.

func (*RolePoliciesMutation) RemovedEdges

func (m *RolePoliciesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RolePoliciesMutation) RemovedIDs

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) ResetCreatedAt

func (m *RolePoliciesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RolePoliciesMutation) ResetCreatedBy

func (m *RolePoliciesMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RolePoliciesMutation) ResetDescription

func (m *RolePoliciesMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*RolePoliciesMutation) ResetEdge

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) ResetField

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) ResetLionPolicies

func (m *RolePoliciesMutation) ResetLionPolicies()

ResetLionPolicies resets all changes to the "lion_policies" edge.

func (*RolePoliciesMutation) ResetLionRoles

func (m *RolePoliciesMutation) ResetLionRoles()

ResetLionRoles resets all changes to the "lion_roles" edge.

func (*RolePoliciesMutation) ResetMetadata

func (m *RolePoliciesMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*RolePoliciesMutation) ResetPolicyID

func (m *RolePoliciesMutation) ResetPolicyID()

ResetPolicyID resets all changes to the "policy_id" field.

func (*RolePoliciesMutation) ResetRoleID

func (m *RolePoliciesMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*RolePoliciesMutation) ResetUpdatedAt

func (m *RolePoliciesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RolePoliciesMutation) ResetUpdatedBy

func (m *RolePoliciesMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RolePoliciesMutation) RoleID

func (m *RolePoliciesMutation) RoleID() (r int, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*RolePoliciesMutation) SetCreatedAt

func (m *RolePoliciesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RolePoliciesMutation) SetCreatedBy

func (m *RolePoliciesMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RolePoliciesMutation) SetDescription

func (m *RolePoliciesMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*RolePoliciesMutation) SetField

func (m *RolePoliciesMutation) 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 (*RolePoliciesMutation) SetLionPoliciesID

func (m *RolePoliciesMutation) SetLionPoliciesID(id int)

SetLionPoliciesID sets the "lion_policies" edge to the Policies entity by id.

func (*RolePoliciesMutation) SetLionRolesID

func (m *RolePoliciesMutation) SetLionRolesID(id int)

SetLionRolesID sets the "lion_roles" edge to the Roles entity by id.

func (*RolePoliciesMutation) SetMetadata

func (m *RolePoliciesMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*RolePoliciesMutation) SetOp

func (m *RolePoliciesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RolePoliciesMutation) SetPolicyID

func (m *RolePoliciesMutation) SetPolicyID(i int)

SetPolicyID sets the "policy_id" field.

func (*RolePoliciesMutation) SetRoleID

func (m *RolePoliciesMutation) SetRoleID(i int)

SetRoleID sets the "role_id" field.

func (*RolePoliciesMutation) SetUpdatedAt

func (m *RolePoliciesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RolePoliciesMutation) SetUpdatedBy

func (m *RolePoliciesMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (RolePoliciesMutation) Tx

func (m RolePoliciesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RolePoliciesMutation) Type

func (m *RolePoliciesMutation) Type() string

Type returns the node type of this mutation (RolePolicies).

func (*RolePoliciesMutation) UpdatedAt

func (m *RolePoliciesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RolePoliciesMutation) UpdatedBy

func (m *RolePoliciesMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RolePoliciesMutation) UpdatedByCleared

func (m *RolePoliciesMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*RolePoliciesMutation) Where

Where appends a list predicates to the RolePoliciesMutation builder.

func (*RolePoliciesMutation) WhereP

func (m *RolePoliciesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RolePoliciesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RolePoliciesQuery

type RolePoliciesQuery struct {
	// contains filtered or unexported fields
}

RolePoliciesQuery is the builder for querying RolePolicies entities.

func (*RolePoliciesQuery) Aggregate

func (_q *RolePoliciesQuery) Aggregate(fns ...AggregateFunc) *RolePoliciesSelect

Aggregate returns a RolePoliciesSelect configured with the given aggregations.

func (*RolePoliciesQuery) All

func (_q *RolePoliciesQuery) All(ctx context.Context) ([]*RolePolicies, error)

All executes the query and returns a list of RolePoliciesSlice.

func (*RolePoliciesQuery) AllX

func (_q *RolePoliciesQuery) AllX(ctx context.Context) []*RolePolicies

AllX is like All, but panics if an error occurs.

func (*RolePoliciesQuery) Clone

func (_q *RolePoliciesQuery) Clone() *RolePoliciesQuery

Clone returns a duplicate of the RolePoliciesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RolePoliciesQuery) Count

func (_q *RolePoliciesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RolePoliciesQuery) CountX

func (_q *RolePoliciesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RolePoliciesQuery) Exist

func (_q *RolePoliciesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RolePoliciesQuery) ExistX

func (_q *RolePoliciesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RolePoliciesQuery) First

func (_q *RolePoliciesQuery) First(ctx context.Context) (*RolePolicies, error)

First returns the first RolePolicies entity from the query. Returns a *NotFoundError when no RolePolicies was found.

func (*RolePoliciesQuery) FirstID

func (_q *RolePoliciesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first RolePolicies ID from the query. Returns a *NotFoundError when no RolePolicies ID was found.

func (*RolePoliciesQuery) FirstIDX

func (_q *RolePoliciesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RolePoliciesQuery) FirstX

func (_q *RolePoliciesQuery) FirstX(ctx context.Context) *RolePolicies

FirstX is like First, but panics if an error occurs.

func (*RolePoliciesQuery) GroupBy

func (_q *RolePoliciesQuery) GroupBy(field string, fields ...string) *RolePoliciesGroupBy

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.RolePolicies.Query().
	GroupBy(rolepolicies.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*RolePoliciesQuery) IDs

func (_q *RolePoliciesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of RolePolicies IDs.

func (*RolePoliciesQuery) IDsX

func (_q *RolePoliciesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RolePoliciesQuery) Limit

func (_q *RolePoliciesQuery) Limit(limit int) *RolePoliciesQuery

Limit the number of records to be returned by this query.

func (*RolePoliciesQuery) Offset

func (_q *RolePoliciesQuery) Offset(offset int) *RolePoliciesQuery

Offset to start from.

func (*RolePoliciesQuery) Only

Only returns a single RolePolicies entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RolePolicies entity is found. Returns a *NotFoundError when no RolePolicies entities are found.

func (*RolePoliciesQuery) OnlyID

func (_q *RolePoliciesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only RolePolicies ID in the query. Returns a *NotSingularError when more than one RolePolicies ID is found. Returns a *NotFoundError when no entities are found.

func (*RolePoliciesQuery) OnlyIDX

func (_q *RolePoliciesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RolePoliciesQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*RolePoliciesQuery) Order

Order specifies how the records should be ordered.

func (*RolePoliciesQuery) QueryLionPolicies

func (_q *RolePoliciesQuery) QueryLionPolicies() *PoliciesQuery

QueryLionPolicies chains the current query on the "lion_policies" edge.

func (*RolePoliciesQuery) QueryLionRoles

func (_q *RolePoliciesQuery) QueryLionRoles() *RolesQuery

QueryLionRoles chains the current query on the "lion_roles" edge.

func (*RolePoliciesQuery) Select

func (_q *RolePoliciesQuery) Select(fields ...string) *RolePoliciesSelect

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.RolePolicies.Query().
	Select(rolepolicies.FieldCreatedAt).
	Scan(ctx, &v)

func (*RolePoliciesQuery) Unique

func (_q *RolePoliciesQuery) Unique(unique bool) *RolePoliciesQuery

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 (*RolePoliciesQuery) Where

Where adds a new predicate for the RolePoliciesQuery builder.

func (*RolePoliciesQuery) WithLionPolicies

func (_q *RolePoliciesQuery) WithLionPolicies(opts ...func(*PoliciesQuery)) *RolePoliciesQuery

WithLionPolicies tells the query-builder to eager-load the nodes that are connected to the "lion_policies" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolePoliciesQuery) WithLionRoles

func (_q *RolePoliciesQuery) WithLionRoles(opts ...func(*RolesQuery)) *RolePoliciesQuery

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 RolePoliciesSelect

type RolePoliciesSelect struct {
	*RolePoliciesQuery
	// contains filtered or unexported fields
}

RolePoliciesSelect is the builder for selecting fields of RolePolicies entities.

func (*RolePoliciesSelect) Aggregate

func (_s *RolePoliciesSelect) Aggregate(fns ...AggregateFunc) *RolePoliciesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RolePoliciesSelect) Bool

func (s *RolePoliciesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) BoolX

func (s *RolePoliciesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RolePoliciesSelect) Bools

func (s *RolePoliciesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) BoolsX

func (s *RolePoliciesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RolePoliciesSelect) Float64

func (s *RolePoliciesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) Float64X

func (s *RolePoliciesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RolePoliciesSelect) Float64s

func (s *RolePoliciesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) Float64sX

func (s *RolePoliciesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RolePoliciesSelect) Int

func (s *RolePoliciesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) IntX

func (s *RolePoliciesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RolePoliciesSelect) Ints

func (s *RolePoliciesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) IntsX

func (s *RolePoliciesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RolePoliciesSelect) Scan

func (_s *RolePoliciesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RolePoliciesSelect) ScanX

func (s *RolePoliciesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RolePoliciesSelect) String

func (s *RolePoliciesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) StringX

func (s *RolePoliciesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RolePoliciesSelect) Strings

func (s *RolePoliciesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RolePoliciesSelect) StringsX

func (s *RolePoliciesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RolePoliciesSlice

type RolePoliciesSlice []*RolePolicies

RolePoliciesSlice is a parsable slice of RolePolicies.

type RolePoliciesUpdate

type RolePoliciesUpdate struct {
	// contains filtered or unexported fields
}

RolePoliciesUpdate is the builder for updating RolePolicies entities.

func (*RolePoliciesUpdate) AddCreatedBy

func (_u *RolePoliciesUpdate) AddCreatedBy(v int64) *RolePoliciesUpdate

AddCreatedBy adds value to the "created_by" field.

func (*RolePoliciesUpdate) AddUpdatedBy

func (_u *RolePoliciesUpdate) AddUpdatedBy(v int64) *RolePoliciesUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*RolePoliciesUpdate) ClearCreatedBy

func (_u *RolePoliciesUpdate) ClearCreatedBy() *RolePoliciesUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*RolePoliciesUpdate) ClearLionPolicies

func (_u *RolePoliciesUpdate) ClearLionPolicies() *RolePoliciesUpdate

ClearLionPolicies clears the "lion_policies" edge to the Policies entity.

func (*RolePoliciesUpdate) ClearLionRoles

func (_u *RolePoliciesUpdate) ClearLionRoles() *RolePoliciesUpdate

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RolePoliciesUpdate) ClearMetadata

func (_u *RolePoliciesUpdate) ClearMetadata() *RolePoliciesUpdate

ClearMetadata clears the value of the "metadata" field.

func (*RolePoliciesUpdate) ClearUpdatedBy

func (_u *RolePoliciesUpdate) ClearUpdatedBy() *RolePoliciesUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolePoliciesUpdate) Exec

func (_u *RolePoliciesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RolePoliciesUpdate) ExecX

func (_u *RolePoliciesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePoliciesUpdate) Mutation

func (_u *RolePoliciesUpdate) Mutation() *RolePoliciesMutation

Mutation returns the RolePoliciesMutation object of the builder.

func (*RolePoliciesUpdate) Save

func (_u *RolePoliciesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RolePoliciesUpdate) SaveX

func (_u *RolePoliciesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RolePoliciesUpdate) SetCreatedBy

func (_u *RolePoliciesUpdate) SetCreatedBy(v int64) *RolePoliciesUpdate

SetCreatedBy sets the "created_by" field.

func (*RolePoliciesUpdate) SetDescription

func (_u *RolePoliciesUpdate) SetDescription(v string) *RolePoliciesUpdate

SetDescription sets the "description" field.

func (*RolePoliciesUpdate) SetLionPolicies

func (_u *RolePoliciesUpdate) SetLionPolicies(v *Policies) *RolePoliciesUpdate

SetLionPolicies sets the "lion_policies" edge to the Policies entity.

func (*RolePoliciesUpdate) SetLionPoliciesID

func (_u *RolePoliciesUpdate) SetLionPoliciesID(id int) *RolePoliciesUpdate

SetLionPoliciesID sets the "lion_policies" edge to the Policies entity by ID.

func (*RolePoliciesUpdate) SetLionRoles

func (_u *RolePoliciesUpdate) SetLionRoles(v *Roles) *RolePoliciesUpdate

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RolePoliciesUpdate) SetLionRolesID

func (_u *RolePoliciesUpdate) SetLionRolesID(id int) *RolePoliciesUpdate

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RolePoliciesUpdate) SetMetadata

func (_u *RolePoliciesUpdate) SetMetadata(v map[string]string) *RolePoliciesUpdate

SetMetadata sets the "metadata" field.

func (*RolePoliciesUpdate) SetNillableCreatedBy

func (_u *RolePoliciesUpdate) SetNillableCreatedBy(v *int64) *RolePoliciesUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolePoliciesUpdate) SetNillableDescription

func (_u *RolePoliciesUpdate) SetNillableDescription(v *string) *RolePoliciesUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RolePoliciesUpdate) SetNillablePolicyID

func (_u *RolePoliciesUpdate) SetNillablePolicyID(v *int) *RolePoliciesUpdate

SetNillablePolicyID sets the "policy_id" field if the given value is not nil.

func (*RolePoliciesUpdate) SetNillableRoleID

func (_u *RolePoliciesUpdate) SetNillableRoleID(v *int) *RolePoliciesUpdate

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*RolePoliciesUpdate) SetNillableUpdatedBy

func (_u *RolePoliciesUpdate) SetNillableUpdatedBy(v *int64) *RolePoliciesUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolePoliciesUpdate) SetPolicyID

func (_u *RolePoliciesUpdate) SetPolicyID(v int) *RolePoliciesUpdate

SetPolicyID sets the "policy_id" field.

func (*RolePoliciesUpdate) SetRoleID

func (_u *RolePoliciesUpdate) SetRoleID(v int) *RolePoliciesUpdate

SetRoleID sets the "role_id" field.

func (*RolePoliciesUpdate) SetUpdatedAt

func (_u *RolePoliciesUpdate) SetUpdatedAt(v time.Time) *RolePoliciesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RolePoliciesUpdate) SetUpdatedBy

func (_u *RolePoliciesUpdate) SetUpdatedBy(v int64) *RolePoliciesUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RolePoliciesUpdate) Where

Where appends a list predicates to the RolePoliciesUpdate builder.

type RolePoliciesUpdateOne

type RolePoliciesUpdateOne struct {
	// contains filtered or unexported fields
}

RolePoliciesUpdateOne is the builder for updating a single RolePolicies entity.

func (*RolePoliciesUpdateOne) AddCreatedBy

func (_u *RolePoliciesUpdateOne) AddCreatedBy(v int64) *RolePoliciesUpdateOne

AddCreatedBy adds value to the "created_by" field.

func (*RolePoliciesUpdateOne) AddUpdatedBy

func (_u *RolePoliciesUpdateOne) AddUpdatedBy(v int64) *RolePoliciesUpdateOne

AddUpdatedBy adds value to the "updated_by" field.

func (*RolePoliciesUpdateOne) ClearCreatedBy

func (_u *RolePoliciesUpdateOne) ClearCreatedBy() *RolePoliciesUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*RolePoliciesUpdateOne) ClearLionPolicies

func (_u *RolePoliciesUpdateOne) ClearLionPolicies() *RolePoliciesUpdateOne

ClearLionPolicies clears the "lion_policies" edge to the Policies entity.

func (*RolePoliciesUpdateOne) ClearLionRoles

func (_u *RolePoliciesUpdateOne) ClearLionRoles() *RolePoliciesUpdateOne

ClearLionRoles clears the "lion_roles" edge to the Roles entity.

func (*RolePoliciesUpdateOne) ClearMetadata

func (_u *RolePoliciesUpdateOne) ClearMetadata() *RolePoliciesUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*RolePoliciesUpdateOne) ClearUpdatedBy

func (_u *RolePoliciesUpdateOne) ClearUpdatedBy() *RolePoliciesUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*RolePoliciesUpdateOne) Exec

Exec executes the query on the entity.

func (*RolePoliciesUpdateOne) ExecX

func (_u *RolePoliciesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RolePoliciesUpdateOne) Mutation

Mutation returns the RolePoliciesMutation object of the builder.

func (*RolePoliciesUpdateOne) Save

Save executes the query and returns the updated RolePolicies entity.

func (*RolePoliciesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*RolePoliciesUpdateOne) Select

func (_u *RolePoliciesUpdateOne) Select(field string, fields ...string) *RolePoliciesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RolePoliciesUpdateOne) SetCreatedBy

func (_u *RolePoliciesUpdateOne) SetCreatedBy(v int64) *RolePoliciesUpdateOne

SetCreatedBy sets the "created_by" field.

func (*RolePoliciesUpdateOne) SetDescription

func (_u *RolePoliciesUpdateOne) SetDescription(v string) *RolePoliciesUpdateOne

SetDescription sets the "description" field.

func (*RolePoliciesUpdateOne) SetLionPolicies

func (_u *RolePoliciesUpdateOne) SetLionPolicies(v *Policies) *RolePoliciesUpdateOne

SetLionPolicies sets the "lion_policies" edge to the Policies entity.

func (*RolePoliciesUpdateOne) SetLionPoliciesID

func (_u *RolePoliciesUpdateOne) SetLionPoliciesID(id int) *RolePoliciesUpdateOne

SetLionPoliciesID sets the "lion_policies" edge to the Policies entity by ID.

func (*RolePoliciesUpdateOne) SetLionRoles

func (_u *RolePoliciesUpdateOne) SetLionRoles(v *Roles) *RolePoliciesUpdateOne

SetLionRoles sets the "lion_roles" edge to the Roles entity.

func (*RolePoliciesUpdateOne) SetLionRolesID

func (_u *RolePoliciesUpdateOne) SetLionRolesID(id int) *RolePoliciesUpdateOne

SetLionRolesID sets the "lion_roles" edge to the Roles entity by ID.

func (*RolePoliciesUpdateOne) SetMetadata

func (_u *RolePoliciesUpdateOne) SetMetadata(v map[string]string) *RolePoliciesUpdateOne

SetMetadata sets the "metadata" field.

func (*RolePoliciesUpdateOne) SetNillableCreatedBy

func (_u *RolePoliciesUpdateOne) SetNillableCreatedBy(v *int64) *RolePoliciesUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RolePoliciesUpdateOne) SetNillableDescription

func (_u *RolePoliciesUpdateOne) SetNillableDescription(v *string) *RolePoliciesUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*RolePoliciesUpdateOne) SetNillablePolicyID

func (_u *RolePoliciesUpdateOne) SetNillablePolicyID(v *int) *RolePoliciesUpdateOne

SetNillablePolicyID sets the "policy_id" field if the given value is not nil.

func (*RolePoliciesUpdateOne) SetNillableRoleID

func (_u *RolePoliciesUpdateOne) SetNillableRoleID(v *int) *RolePoliciesUpdateOne

SetNillableRoleID sets the "role_id" field if the given value is not nil.

func (*RolePoliciesUpdateOne) SetNillableUpdatedBy

func (_u *RolePoliciesUpdateOne) SetNillableUpdatedBy(v *int64) *RolePoliciesUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RolePoliciesUpdateOne) SetPolicyID

func (_u *RolePoliciesUpdateOne) SetPolicyID(v int) *RolePoliciesUpdateOne

SetPolicyID sets the "policy_id" field.

func (*RolePoliciesUpdateOne) SetRoleID

SetRoleID sets the "role_id" field.

func (*RolePoliciesUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*RolePoliciesUpdateOne) SetUpdatedBy

func (_u *RolePoliciesUpdateOne) SetUpdatedBy(v int64) *RolePoliciesUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*RolePoliciesUpdateOne) Where

Where appends a list predicates to the RolePoliciesUpdate 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"`
	// 父角色ID,构建树形组织结构,值为 0 表示顶级角色
	ParentID int `json:"parent_id,omitempty"`
	// 角色名称,用于系统内部显示和业务逻辑
	Code string `json:"code,omitempty"`
	// 角色名称,用于系统内部显示和业务逻辑
	DisplayName string `json:"display_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"`
	// 是否为保护资源,保护资源不能被删除,描述等可更改
	Protected bool `json:"protected,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) QueryLionPrincipalRoles

func (_m *Roles) QueryLionPrincipalRoles() *PrincipalRolesQuery

QueryLionPrincipalRoles queries the "lion_principal_roles" edge of the Roles entity.

func (*Roles) QueryLionRoleMenus

func (_m *Roles) QueryLionRoleMenus() *RoleMenusQuery

QueryLionRoleMenus queries the "lion_role_menus" edge of the Roles entity.

func (*Roles) QueryLionRolePolicies

func (_m *Roles) QueryLionRolePolicies() *RolePoliciesQuery

QueryLionRolePolicies queries the "lion_role_policies" 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) QueryLionPrincipalRoles

func (c *RolesClient) QueryLionPrincipalRoles(_m *Roles) *PrincipalRolesQuery

QueryLionPrincipalRoles queries the lion_principal_roles edge of a Roles.

func (*RolesClient) QueryLionRoleMenus

func (c *RolesClient) QueryLionRoleMenus(_m *Roles) *RoleMenusQuery

QueryLionRoleMenus queries the lion_role_menus edge of a Roles.

func (*RolesClient) QueryLionRolePolicies

func (c *RolesClient) QueryLionRolePolicies(_m *Roles) *RolePoliciesQuery

QueryLionRolePolicies queries the lion_role_policies 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) AddLionPrincipalRoleIDs

func (_c *RolesCreate) AddLionPrincipalRoleIDs(ids ...int) *RolesCreate

AddLionPrincipalRoleIDs adds the "lion_principal_roles" edge to the PrincipalRoles entity by IDs.

func (*RolesCreate) AddLionPrincipalRoles

func (_c *RolesCreate) AddLionPrincipalRoles(v ...*PrincipalRoles) *RolesCreate

AddLionPrincipalRoles adds the "lion_principal_roles" edges to the PrincipalRoles entity.

func (*RolesCreate) AddLionRoleMenuIDs

func (_c *RolesCreate) AddLionRoleMenuIDs(ids ...int) *RolesCreate

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (*RolesCreate) AddLionRoleMenus

func (_c *RolesCreate) AddLionRoleMenus(v ...*RoleMenus) *RolesCreate

AddLionRoleMenus adds the "lion_role_menus" edges to the RoleMenus entity.

func (*RolesCreate) AddLionRolePolicies

func (_c *RolesCreate) AddLionRolePolicies(v ...*RolePolicies) *RolesCreate

AddLionRolePolicies adds the "lion_role_policies" edges to the RolePolicies entity.

func (*RolesCreate) AddLionRolePolicyIDs

func (_c *RolesCreate) AddLionRolePolicyIDs(ids ...int) *RolesCreate

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by IDs.

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) SetCode

func (_c *RolesCreate) SetCode(v string) *RolesCreate

SetCode sets the "code" field.

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) SetDisplayName

func (_c *RolesCreate) SetDisplayName(v string) *RolesCreate

SetDisplayName sets the "display_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) SetNillableParentID

func (_c *RolesCreate) SetNillableParentID(v *int) *RolesCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*RolesCreate) SetNillableProtected

func (_c *RolesCreate) SetNillableProtected(v *bool) *RolesCreate

SetNillableProtected sets the "protected" 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) SetParentID

func (_c *RolesCreate) SetParentID(v int) *RolesCreate

SetParentID sets the "parent_id" field.

func (*RolesCreate) SetProtected

func (_c *RolesCreate) SetProtected(v bool) *RolesCreate

SetProtected sets the "protected" field.

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 {
	// LionPrincipalRoles holds the value of the lion_principal_roles edge.
	LionPrincipalRoles []*PrincipalRoles `json:"lion_principal_roles,omitempty"`
	// LionRolePolicies holds the value of the lion_role_policies edge.
	LionRolePolicies []*RolePolicies `json:"lion_role_policies,omitempty"`
	// LionRoleMenus holds the value of the lion_role_menus edge.
	LionRoleMenus []*RoleMenus `json:"lion_role_menus,omitempty"`
	// contains filtered or unexported fields
}

RolesEdges holds the relations/edges for other nodes in the graph.

func (RolesEdges) LionPrincipalRolesOrErr

func (e RolesEdges) LionPrincipalRolesOrErr() ([]*PrincipalRoles, error)

LionPrincipalRolesOrErr returns the LionPrincipalRoles value or an error if the edge was not loaded in eager-loading.

func (RolesEdges) LionRoleMenusOrErr

func (e RolesEdges) LionRoleMenusOrErr() ([]*RoleMenus, error)

LionRoleMenusOrErr returns the LionRoleMenus value or an error if the edge was not loaded in eager-loading.

func (RolesEdges) LionRolePoliciesOrErr

func (e RolesEdges) LionRolePoliciesOrErr() ([]*RolePolicies, error)

LionRolePoliciesOrErr returns the LionRolePolicies 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) AddLionPrincipalRoleIDs

func (m *RolesMutation) AddLionPrincipalRoleIDs(ids ...int)

AddLionPrincipalRoleIDs adds the "lion_principal_roles" edge to the PrincipalRoles entity by ids.

func (*RolesMutation) AddLionRoleMenuIDs

func (m *RolesMutation) AddLionRoleMenuIDs(ids ...int)

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by ids.

func (*RolesMutation) AddLionRolePolicyIDs

func (m *RolesMutation) AddLionRolePolicyIDs(ids ...int)

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by ids.

func (*RolesMutation) AddParentID

func (m *RolesMutation) AddParentID(i int)

AddParentID adds i to the "parent_id" field.

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) AddedParentID

func (m *RolesMutation) AddedParentID() (r int, exists bool)

AddedParentID returns the value that was added to the "parent_id" field 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) ClearLionPrincipalRoles

func (m *RolesMutation) ClearLionPrincipalRoles()

ClearLionPrincipalRoles clears the "lion_principal_roles" edge to the PrincipalRoles entity.

func (*RolesMutation) ClearLionRoleMenus

func (m *RolesMutation) ClearLionRoleMenus()

ClearLionRoleMenus clears the "lion_role_menus" edge to the RoleMenus entity.

func (*RolesMutation) ClearLionRolePolicies

func (m *RolesMutation) ClearLionRolePolicies()

ClearLionRolePolicies clears the "lion_role_policies" edge to the RolePolicies 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) Code

func (m *RolesMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

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) DisplayName

func (m *RolesMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" 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) LionPrincipalRolesCleared

func (m *RolesMutation) LionPrincipalRolesCleared() bool

LionPrincipalRolesCleared reports if the "lion_principal_roles" edge to the PrincipalRoles entity was cleared.

func (*RolesMutation) LionPrincipalRolesIDs

func (m *RolesMutation) LionPrincipalRolesIDs() (ids []int)

LionPrincipalRolesIDs returns the "lion_principal_roles" edge IDs in the mutation.

func (*RolesMutation) LionRoleMenusCleared

func (m *RolesMutation) LionRoleMenusCleared() bool

LionRoleMenusCleared reports if the "lion_role_menus" edge to the RoleMenus entity was cleared.

func (*RolesMutation) LionRoleMenusIDs

func (m *RolesMutation) LionRoleMenusIDs() (ids []int)

LionRoleMenusIDs returns the "lion_role_menus" edge IDs in the mutation.

func (*RolesMutation) LionRolePoliciesCleared

func (m *RolesMutation) LionRolePoliciesCleared() bool

LionRolePoliciesCleared reports if the "lion_role_policies" edge to the RolePolicies entity was cleared.

func (*RolesMutation) LionRolePoliciesIDs

func (m *RolesMutation) LionRolePoliciesIDs() (ids []int)

LionRolePoliciesIDs returns the "lion_role_policies" edge IDs in the mutation.

func (*RolesMutation) OldCode

func (m *RolesMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" 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) 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) OldDisplayName

func (m *RolesMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_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) 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) OldParentID

func (m *RolesMutation) OldParentID(ctx context.Context) (v int, err error)

OldParentID returns the old "parent_id" 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) OldProtected

func (m *RolesMutation) OldProtected(ctx context.Context) (v bool, err error)

OldProtected returns the old "protected" 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) ParentID

func (m *RolesMutation) ParentID() (r int, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*RolesMutation) Protected

func (m *RolesMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (*RolesMutation) RemoveLionPrincipalRoleIDs

func (m *RolesMutation) RemoveLionPrincipalRoleIDs(ids ...int)

RemoveLionPrincipalRoleIDs removes the "lion_principal_roles" edge to the PrincipalRoles entity by IDs.

func (*RolesMutation) RemoveLionRoleMenuIDs

func (m *RolesMutation) RemoveLionRoleMenuIDs(ids ...int)

RemoveLionRoleMenuIDs removes the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (*RolesMutation) RemoveLionRolePolicyIDs

func (m *RolesMutation) RemoveLionRolePolicyIDs(ids ...int)

RemoveLionRolePolicyIDs removes the "lion_role_policies" edge to the RolePolicies 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) RemovedLionPrincipalRolesIDs

func (m *RolesMutation) RemovedLionPrincipalRolesIDs() (ids []int)

RemovedLionPrincipalRoles returns the removed IDs of the "lion_principal_roles" edge to the PrincipalRoles entity.

func (*RolesMutation) RemovedLionRoleMenusIDs

func (m *RolesMutation) RemovedLionRoleMenusIDs() (ids []int)

RemovedLionRoleMenus returns the removed IDs of the "lion_role_menus" edge to the RoleMenus entity.

func (*RolesMutation) RemovedLionRolePoliciesIDs

func (m *RolesMutation) RemovedLionRolePoliciesIDs() (ids []int)

RemovedLionRolePolicies returns the removed IDs of the "lion_role_policies" edge to the RolePolicies entity.

func (*RolesMutation) ResetCode

func (m *RolesMutation) ResetCode()

ResetCode resets all changes to the "code" field.

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) ResetDisplayName

func (m *RolesMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) ResetLionPrincipalRoles

func (m *RolesMutation) ResetLionPrincipalRoles()

ResetLionPrincipalRoles resets all changes to the "lion_principal_roles" edge.

func (*RolesMutation) ResetLionRoleMenus

func (m *RolesMutation) ResetLionRoleMenus()

ResetLionRoleMenus resets all changes to the "lion_role_menus" edge.

func (*RolesMutation) ResetLionRolePolicies

func (m *RolesMutation) ResetLionRolePolicies()

ResetLionRolePolicies resets all changes to the "lion_role_policies" edge.

func (*RolesMutation) ResetParentID

func (m *RolesMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*RolesMutation) ResetProtected

func (m *RolesMutation) ResetProtected()

ResetProtected resets all changes to the "protected" 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) SetCode

func (m *RolesMutation) SetCode(s string)

SetCode sets the "code" field.

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) SetDisplayName

func (m *RolesMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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) SetOp

func (m *RolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RolesMutation) SetParentID

func (m *RolesMutation) SetParentID(i int)

SetParentID sets the "parent_id" field.

func (*RolesMutation) SetProtected

func (m *RolesMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

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) QueryLionPrincipalRoles

func (_q *RolesQuery) QueryLionPrincipalRoles() *PrincipalRolesQuery

QueryLionPrincipalRoles chains the current query on the "lion_principal_roles" edge.

func (*RolesQuery) QueryLionRoleMenus

func (_q *RolesQuery) QueryLionRoleMenus() *RoleMenusQuery

QueryLionRoleMenus chains the current query on the "lion_role_menus" edge.

func (*RolesQuery) QueryLionRolePolicies

func (_q *RolesQuery) QueryLionRolePolicies() *RolePoliciesQuery

QueryLionRolePolicies chains the current query on the "lion_role_policies" 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) WithLionPrincipalRoles

func (_q *RolesQuery) WithLionPrincipalRoles(opts ...func(*PrincipalRolesQuery)) *RolesQuery

WithLionPrincipalRoles tells the query-builder to eager-load the nodes that are connected to the "lion_principal_roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolesQuery) WithLionRoleMenus

func (_q *RolesQuery) WithLionRoleMenus(opts ...func(*RoleMenusQuery)) *RolesQuery

WithLionRoleMenus tells the query-builder to eager-load the nodes that are connected to the "lion_role_menus" edge. The optional arguments are used to configure the query builder of the edge.

func (*RolesQuery) WithLionRolePolicies

func (_q *RolesQuery) WithLionRolePolicies(opts ...func(*RolePoliciesQuery)) *RolesQuery

WithLionRolePolicies tells the query-builder to eager-load the nodes that are connected to the "lion_role_policies" 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) AddLionPrincipalRoleIDs

func (_u *RolesUpdate) AddLionPrincipalRoleIDs(ids ...int) *RolesUpdate

AddLionPrincipalRoleIDs adds the "lion_principal_roles" edge to the PrincipalRoles entity by IDs.

func (*RolesUpdate) AddLionPrincipalRoles

func (_u *RolesUpdate) AddLionPrincipalRoles(v ...*PrincipalRoles) *RolesUpdate

AddLionPrincipalRoles adds the "lion_principal_roles" edges to the PrincipalRoles entity.

func (*RolesUpdate) AddLionRoleMenuIDs

func (_u *RolesUpdate) AddLionRoleMenuIDs(ids ...int) *RolesUpdate

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (*RolesUpdate) AddLionRoleMenus

func (_u *RolesUpdate) AddLionRoleMenus(v ...*RoleMenus) *RolesUpdate

AddLionRoleMenus adds the "lion_role_menus" edges to the RoleMenus entity.

func (*RolesUpdate) AddLionRolePolicies

func (_u *RolesUpdate) AddLionRolePolicies(v ...*RolePolicies) *RolesUpdate

AddLionRolePolicies adds the "lion_role_policies" edges to the RolePolicies entity.

func (*RolesUpdate) AddLionRolePolicyIDs

func (_u *RolesUpdate) AddLionRolePolicyIDs(ids ...int) *RolesUpdate

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by IDs.

func (*RolesUpdate) AddParentID

func (_u *RolesUpdate) AddParentID(v int) *RolesUpdate

AddParentID adds value to the "parent_id" field.

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) ClearLionPrincipalRoles

func (_u *RolesUpdate) ClearLionPrincipalRoles() *RolesUpdate

ClearLionPrincipalRoles clears all "lion_principal_roles" edges to the PrincipalRoles entity.

func (*RolesUpdate) ClearLionRoleMenus

func (_u *RolesUpdate) ClearLionRoleMenus() *RolesUpdate

ClearLionRoleMenus clears all "lion_role_menus" edges to the RoleMenus entity.

func (*RolesUpdate) ClearLionRolePolicies

func (_u *RolesUpdate) ClearLionRolePolicies() *RolesUpdate

ClearLionRolePolicies clears all "lion_role_policies" edges to the RolePolicies 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) RemoveLionPrincipalRoleIDs

func (_u *RolesUpdate) RemoveLionPrincipalRoleIDs(ids ...int) *RolesUpdate

RemoveLionPrincipalRoleIDs removes the "lion_principal_roles" edge to PrincipalRoles entities by IDs.

func (*RolesUpdate) RemoveLionPrincipalRoles

func (_u *RolesUpdate) RemoveLionPrincipalRoles(v ...*PrincipalRoles) *RolesUpdate

RemoveLionPrincipalRoles removes "lion_principal_roles" edges to PrincipalRoles entities.

func (*RolesUpdate) RemoveLionRoleMenuIDs

func (_u *RolesUpdate) RemoveLionRoleMenuIDs(ids ...int) *RolesUpdate

RemoveLionRoleMenuIDs removes the "lion_role_menus" edge to RoleMenus entities by IDs.

func (*RolesUpdate) RemoveLionRoleMenus

func (_u *RolesUpdate) RemoveLionRoleMenus(v ...*RoleMenus) *RolesUpdate

RemoveLionRoleMenus removes "lion_role_menus" edges to RoleMenus entities.

func (*RolesUpdate) RemoveLionRolePolicies

func (_u *RolesUpdate) RemoveLionRolePolicies(v ...*RolePolicies) *RolesUpdate

RemoveLionRolePolicies removes "lion_role_policies" edges to RolePolicies entities.

func (*RolesUpdate) RemoveLionRolePolicyIDs

func (_u *RolesUpdate) RemoveLionRolePolicyIDs(ids ...int) *RolesUpdate

RemoveLionRolePolicyIDs removes the "lion_role_policies" edge to RolePolicies entities by IDs.

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) SetCode

func (_u *RolesUpdate) SetCode(v string) *RolesUpdate

SetCode sets the "code" field.

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) SetDisplayName

func (_u *RolesUpdate) SetDisplayName(v string) *RolesUpdate

SetDisplayName sets the "display_name" field.

func (*RolesUpdate) SetNillableCode

func (_u *RolesUpdate) SetNillableCode(v *string) *RolesUpdate

SetNillableCode sets the "code" field if the given value is not nil.

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) SetNillableDisplayName

func (_u *RolesUpdate) SetNillableDisplayName(v *string) *RolesUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*RolesUpdate) SetNillableParentID

func (_u *RolesUpdate) SetNillableParentID(v *int) *RolesUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*RolesUpdate) SetNillableProtected

func (_u *RolesUpdate) SetNillableProtected(v *bool) *RolesUpdate

SetNillableProtected sets the "protected" 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) SetParentID

func (_u *RolesUpdate) SetParentID(v int) *RolesUpdate

SetParentID sets the "parent_id" field.

func (*RolesUpdate) SetProtected

func (_u *RolesUpdate) SetProtected(v bool) *RolesUpdate

SetProtected sets the "protected" field.

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) AddLionPrincipalRoleIDs

func (_u *RolesUpdateOne) AddLionPrincipalRoleIDs(ids ...int) *RolesUpdateOne

AddLionPrincipalRoleIDs adds the "lion_principal_roles" edge to the PrincipalRoles entity by IDs.

func (*RolesUpdateOne) AddLionPrincipalRoles

func (_u *RolesUpdateOne) AddLionPrincipalRoles(v ...*PrincipalRoles) *RolesUpdateOne

AddLionPrincipalRoles adds the "lion_principal_roles" edges to the PrincipalRoles entity.

func (*RolesUpdateOne) AddLionRoleMenuIDs

func (_u *RolesUpdateOne) AddLionRoleMenuIDs(ids ...int) *RolesUpdateOne

AddLionRoleMenuIDs adds the "lion_role_menus" edge to the RoleMenus entity by IDs.

func (*RolesUpdateOne) AddLionRoleMenus

func (_u *RolesUpdateOne) AddLionRoleMenus(v ...*RoleMenus) *RolesUpdateOne

AddLionRoleMenus adds the "lion_role_menus" edges to the RoleMenus entity.

func (*RolesUpdateOne) AddLionRolePolicies

func (_u *RolesUpdateOne) AddLionRolePolicies(v ...*RolePolicies) *RolesUpdateOne

AddLionRolePolicies adds the "lion_role_policies" edges to the RolePolicies entity.

func (*RolesUpdateOne) AddLionRolePolicyIDs

func (_u *RolesUpdateOne) AddLionRolePolicyIDs(ids ...int) *RolesUpdateOne

AddLionRolePolicyIDs adds the "lion_role_policies" edge to the RolePolicies entity by IDs.

func (*RolesUpdateOne) AddParentID

func (_u *RolesUpdateOne) AddParentID(v int) *RolesUpdateOne

AddParentID adds value to the "parent_id" field.

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) ClearLionPrincipalRoles

func (_u *RolesUpdateOne) ClearLionPrincipalRoles() *RolesUpdateOne

ClearLionPrincipalRoles clears all "lion_principal_roles" edges to the PrincipalRoles entity.

func (*RolesUpdateOne) ClearLionRoleMenus

func (_u *RolesUpdateOne) ClearLionRoleMenus() *RolesUpdateOne

ClearLionRoleMenus clears all "lion_role_menus" edges to the RoleMenus entity.

func (*RolesUpdateOne) ClearLionRolePolicies

func (_u *RolesUpdateOne) ClearLionRolePolicies() *RolesUpdateOne

ClearLionRolePolicies clears all "lion_role_policies" edges to the RolePolicies 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) RemoveLionPrincipalRoleIDs

func (_u *RolesUpdateOne) RemoveLionPrincipalRoleIDs(ids ...int) *RolesUpdateOne

RemoveLionPrincipalRoleIDs removes the "lion_principal_roles" edge to PrincipalRoles entities by IDs.

func (*RolesUpdateOne) RemoveLionPrincipalRoles

func (_u *RolesUpdateOne) RemoveLionPrincipalRoles(v ...*PrincipalRoles) *RolesUpdateOne

RemoveLionPrincipalRoles removes "lion_principal_roles" edges to PrincipalRoles entities.

func (*RolesUpdateOne) RemoveLionRoleMenuIDs

func (_u *RolesUpdateOne) RemoveLionRoleMenuIDs(ids ...int) *RolesUpdateOne

RemoveLionRoleMenuIDs removes the "lion_role_menus" edge to RoleMenus entities by IDs.

func (*RolesUpdateOne) RemoveLionRoleMenus

func (_u *RolesUpdateOne) RemoveLionRoleMenus(v ...*RoleMenus) *RolesUpdateOne

RemoveLionRoleMenus removes "lion_role_menus" edges to RoleMenus entities.

func (*RolesUpdateOne) RemoveLionRolePolicies

func (_u *RolesUpdateOne) RemoveLionRolePolicies(v ...*RolePolicies) *RolesUpdateOne

RemoveLionRolePolicies removes "lion_role_policies" edges to RolePolicies entities.

func (*RolesUpdateOne) RemoveLionRolePolicyIDs

func (_u *RolesUpdateOne) RemoveLionRolePolicyIDs(ids ...int) *RolesUpdateOne

RemoveLionRolePolicyIDs removes the "lion_role_policies" edge to RolePolicies entities by IDs.

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) SetCode

func (_u *RolesUpdateOne) SetCode(v string) *RolesUpdateOne

SetCode sets the "code" field.

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) SetDisplayName

func (_u *RolesUpdateOne) SetDisplayName(v string) *RolesUpdateOne

SetDisplayName sets the "display_name" field.

func (*RolesUpdateOne) SetNillableCode

func (_u *RolesUpdateOne) SetNillableCode(v *string) *RolesUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

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) SetNillableDisplayName

func (_u *RolesUpdateOne) SetNillableDisplayName(v *string) *RolesUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableParentID

func (_u *RolesUpdateOne) SetNillableParentID(v *int) *RolesUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*RolesUpdateOne) SetNillableProtected

func (_u *RolesUpdateOne) SetNillableProtected(v *bool) *RolesUpdateOne

SetNillableProtected sets the "protected" 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) SetParentID

func (_u *RolesUpdateOne) SetParentID(v int) *RolesUpdateOne

SetParentID sets the "parent_id" field.

func (*RolesUpdateOne) SetProtected

func (_u *RolesUpdateOne) SetProtected(v bool) *RolesUpdateOne

SetProtected sets the "protected" field.

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
	// Departments is the client for interacting with the Departments builders.
	Departments *DepartmentsClient
	// GlobalSettings is the client for interacting with the GlobalSettings builders.
	GlobalSettings *GlobalSettingsClient
	// Groups is the client for interacting with the Groups builders.
	Groups *GroupsClient
	// Menus is the client for interacting with the Menus builders.
	Menus *MenusClient
	// OAuth2Clients is the client for interacting with the OAuth2Clients builders.
	OAuth2Clients *OAuth2ClientsClient
	// OAuth2Codes is the client for interacting with the OAuth2Codes builders.
	OAuth2Codes *OAuth2CodesClient
	// Policies is the client for interacting with the Policies builders.
	Policies *PoliciesClient
	// PrincipalRoles is the client for interacting with the PrincipalRoles builders.
	PrincipalRoles *PrincipalRolesClient
	// RoleMenus is the client for interacting with the RoleMenus builders.
	RoleMenus *RoleMenusClient
	// RolePolicies is the client for interacting with the RolePolicies builders.
	RolePolicies *RolePoliciesClient
	// Roles is the client for interacting with the Roles builders.
	Roles *RolesClient
	// UserIdentities is the client for interacting with the UserIdentities builders.
	UserIdentities *UserIdentitiesClient
	// UserMemberships is the client for interacting with the UserMemberships builders.
	UserMemberships *UserMembershipsClient
	// UserProfiles is the client for interacting with the UserProfiles builders.
	UserProfiles *UserProfilesClient
	// 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 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:"-"`
	// 加密后的 MFA 恢复码元数据
	MfaRecoveryCodesEncrypted []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) SetMfaRecoveryCodesEncrypted

func (_c *UserIdentitiesCreate) SetMfaRecoveryCodesEncrypted(v []byte) *UserIdentitiesCreate

SetMfaRecoveryCodesEncrypted sets the "mfa_recovery_codes_encrypted" 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) ClearMfaRecoveryCodesEncrypted

func (m *UserIdentitiesMutation) ClearMfaRecoveryCodesEncrypted()

ClearMfaRecoveryCodesEncrypted clears the value of the "mfa_recovery_codes_encrypted" field.

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) MfaRecoveryCodesEncrypted

func (m *UserIdentitiesMutation) MfaRecoveryCodesEncrypted() (r []byte, exists bool)

MfaRecoveryCodesEncrypted returns the value of the "mfa_recovery_codes_encrypted" field in the mutation.

func (*UserIdentitiesMutation) MfaRecoveryCodesEncryptedCleared

func (m *UserIdentitiesMutation) MfaRecoveryCodesEncryptedCleared() bool

MfaRecoveryCodesEncryptedCleared returns if the "mfa_recovery_codes_encrypted" field was cleared in this 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) OldMfaRecoveryCodesEncrypted

func (m *UserIdentitiesMutation) OldMfaRecoveryCodesEncrypted(ctx context.Context) (v []byte, err error)

OldMfaRecoveryCodesEncrypted returns the old "mfa_recovery_codes_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) 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) ResetMfaRecoveryCodesEncrypted

func (m *UserIdentitiesMutation) ResetMfaRecoveryCodesEncrypted()

ResetMfaRecoveryCodesEncrypted resets all changes to the "mfa_recovery_codes_encrypted" 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) SetMfaRecoveryCodesEncrypted

func (m *UserIdentitiesMutation) SetMfaRecoveryCodesEncrypted(b []byte)

SetMfaRecoveryCodesEncrypted sets the "mfa_recovery_codes_encrypted" 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) ClearMfaRecoveryCodesEncrypted

func (_u *UserIdentitiesUpdate) ClearMfaRecoveryCodesEncrypted() *UserIdentitiesUpdate

ClearMfaRecoveryCodesEncrypted clears the value of the "mfa_recovery_codes_encrypted" field.

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) SetMfaRecoveryCodesEncrypted

func (_u *UserIdentitiesUpdate) SetMfaRecoveryCodesEncrypted(v []byte) *UserIdentitiesUpdate

SetMfaRecoveryCodesEncrypted sets the "mfa_recovery_codes_encrypted" 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) ClearMfaRecoveryCodesEncrypted

func (_u *UserIdentitiesUpdateOne) ClearMfaRecoveryCodesEncrypted() *UserIdentitiesUpdateOne

ClearMfaRecoveryCodesEncrypted clears the value of the "mfa_recovery_codes_encrypted" field.

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) SetMfaRecoveryCodesEncrypted

func (_u *UserIdentitiesUpdateOne) SetMfaRecoveryCodesEncrypted(v []byte) *UserIdentitiesUpdateOne

SetMfaRecoveryCodesEncrypted sets the "mfa_recovery_codes_encrypted" 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 UserMemberships

type UserMemberships 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,关联用户表
	UserID int `json:"user_id,omitempty"`
	// 关联目标类型:0-未指定,1-群组,2-部门
	TargetType int `json:"target_type,omitempty"`
	// 关联目标 ID,与 target_type 配合使用
	TargetID int `json:"target_id,omitempty"`
	// 用户在目标实体中的角色:兼容群组/部门成员角色枚举
	MemberRole int `json:"member_role,omitempty"`
	// 成员关系状态:兼容群组/部门成员状态枚举
	MemberStatus int `json:"member_status,omitempty"`
	// 成员关系类型:主要用于部门主/兼职语义
	MemberType int `json:"member_type,omitempty"`
	// 用户加入目标实体的时间
	JoinedAt time.Time `json:"joined_at,omitempty"`
	// 关系有效期,用于临时成员管理,空表示永久有效
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// 元数据,用于存储自定义属性,统一采用 JSON
	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 UserMembershipsQuery when eager-loading is set.
	Edges UserMembershipsEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserMemberships is the model entity for the UserMemberships schema.

func (*UserMemberships) QueryLionUsers

func (_m *UserMemberships) QueryLionUsers() *UsersQuery

QueryLionUsers queries the "lion_users" edge of the UserMemberships entity.

func (*UserMemberships) String

func (_m *UserMemberships) String() string

String implements the fmt.Stringer.

func (*UserMemberships) Unwrap

func (_m *UserMemberships) Unwrap() *UserMemberships

Unwrap unwraps the UserMemberships 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 (*UserMemberships) Update

Update returns a builder for updating this UserMemberships. Note that you need to call UserMemberships.Unwrap() before calling this method if this UserMemberships was returned from a transaction, and the transaction was committed or rolled back.

func (*UserMemberships) Value

func (_m *UserMemberships) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserMemberships. This includes values selected through modifiers, order, etc.

type UserMembershipsClient

type UserMembershipsClient struct {
	// contains filtered or unexported fields
}

UserMembershipsClient is a client for the UserMemberships schema.

func NewUserMembershipsClient

func NewUserMembershipsClient(c config) *UserMembershipsClient

NewUserMembershipsClient returns a client for the UserMemberships from the given config.

func (*UserMembershipsClient) Create

Create returns a builder for creating a UserMemberships entity.

func (*UserMembershipsClient) CreateBulk

CreateBulk returns a builder for creating a bulk of UserMemberships entities.

func (*UserMembershipsClient) Delete

Delete returns a delete builder for UserMemberships.

func (*UserMembershipsClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserMembershipsClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserMembershipsClient) Get

Get returns a UserMemberships entity by its id.

func (*UserMembershipsClient) GetX

GetX is like Get, but panics if an error occurs.

func (*UserMembershipsClient) Hooks

func (c *UserMembershipsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserMembershipsClient) Intercept

func (c *UserMembershipsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usermemberships.Intercept(f(g(h())))`.

func (*UserMembershipsClient) Interceptors

func (c *UserMembershipsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserMembershipsClient) MapCreateBulk

func (c *UserMembershipsClient) MapCreateBulk(slice any, setFunc func(*UserMembershipsCreate, int)) *UserMembershipsCreateBulk

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 (*UserMembershipsClient) Query

Query returns a query builder for UserMemberships.

func (*UserMembershipsClient) QueryLionUsers

func (c *UserMembershipsClient) QueryLionUsers(_m *UserMemberships) *UsersQuery

QueryLionUsers queries the lion_users edge of a UserMemberships.

func (*UserMembershipsClient) Update

Update returns an update builder for UserMemberships.

func (*UserMembershipsClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserMembershipsClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*UserMembershipsClient) Use

func (c *UserMembershipsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usermemberships.Hooks(f(g(h())))`.

type UserMembershipsCreate

type UserMembershipsCreate struct {
	// contains filtered or unexported fields
}

UserMembershipsCreate is the builder for creating a UserMemberships entity.

func (*UserMembershipsCreate) Exec

Exec executes the query.

func (*UserMembershipsCreate) ExecX

func (_c *UserMembershipsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserMembershipsCreate) Mutation

Mutation returns the UserMembershipsMutation object of the builder.

func (*UserMembershipsCreate) Save

Save creates the UserMemberships in the database.

func (*UserMembershipsCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserMembershipsCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*UserMembershipsCreate) SetCreatedBy

func (_c *UserMembershipsCreate) SetCreatedBy(v int64) *UserMembershipsCreate

SetCreatedBy sets the "created_by" field.

func (*UserMembershipsCreate) SetDescription

func (_c *UserMembershipsCreate) SetDescription(v string) *UserMembershipsCreate

SetDescription sets the "description" field.

func (*UserMembershipsCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*UserMembershipsCreate) SetJoinedAt

SetJoinedAt sets the "joined_at" field.

func (*UserMembershipsCreate) SetLionUsers

func (_c *UserMembershipsCreate) SetLionUsers(v *Users) *UserMembershipsCreate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserMembershipsCreate) SetLionUsersID

func (_c *UserMembershipsCreate) SetLionUsersID(id int) *UserMembershipsCreate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserMembershipsCreate) SetMemberRole

func (_c *UserMembershipsCreate) SetMemberRole(v int) *UserMembershipsCreate

SetMemberRole sets the "member_role" field.

func (*UserMembershipsCreate) SetMemberStatus

func (_c *UserMembershipsCreate) SetMemberStatus(v int) *UserMembershipsCreate

SetMemberStatus sets the "member_status" field.

func (*UserMembershipsCreate) SetMemberType

func (_c *UserMembershipsCreate) SetMemberType(v int) *UserMembershipsCreate

SetMemberType sets the "member_type" field.

func (*UserMembershipsCreate) SetMetadata

func (_c *UserMembershipsCreate) SetMetadata(v map[string]string) *UserMembershipsCreate

SetMetadata sets the "metadata" field.

func (*UserMembershipsCreate) SetNillableCreatedAt

func (_c *UserMembershipsCreate) SetNillableCreatedAt(v *time.Time) *UserMembershipsCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableCreatedBy

func (_c *UserMembershipsCreate) SetNillableCreatedBy(v *int64) *UserMembershipsCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableDescription

func (_c *UserMembershipsCreate) SetNillableDescription(v *string) *UserMembershipsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableExpiresAt

func (_c *UserMembershipsCreate) SetNillableExpiresAt(v *time.Time) *UserMembershipsCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableJoinedAt

func (_c *UserMembershipsCreate) SetNillableJoinedAt(v *time.Time) *UserMembershipsCreate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableMemberRole

func (_c *UserMembershipsCreate) SetNillableMemberRole(v *int) *UserMembershipsCreate

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableMemberStatus

func (_c *UserMembershipsCreate) SetNillableMemberStatus(v *int) *UserMembershipsCreate

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableMemberType

func (_c *UserMembershipsCreate) SetNillableMemberType(v *int) *UserMembershipsCreate

SetNillableMemberType sets the "member_type" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableTargetType

func (_c *UserMembershipsCreate) SetNillableTargetType(v *int) *UserMembershipsCreate

SetNillableTargetType sets the "target_type" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableUpdatedAt

func (_c *UserMembershipsCreate) SetNillableUpdatedAt(v *time.Time) *UserMembershipsCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserMembershipsCreate) SetNillableUpdatedBy

func (_c *UserMembershipsCreate) SetNillableUpdatedBy(v *int64) *UserMembershipsCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserMembershipsCreate) SetTargetID

func (_c *UserMembershipsCreate) SetTargetID(v int) *UserMembershipsCreate

SetTargetID sets the "target_id" field.

func (*UserMembershipsCreate) SetTargetType

func (_c *UserMembershipsCreate) SetTargetType(v int) *UserMembershipsCreate

SetTargetType sets the "target_type" field.

func (*UserMembershipsCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserMembershipsCreate) SetUpdatedBy

func (_c *UserMembershipsCreate) SetUpdatedBy(v int64) *UserMembershipsCreate

SetUpdatedBy sets the "updated_by" field.

func (*UserMembershipsCreate) SetUserID

SetUserID sets the "user_id" field.

type UserMembershipsCreateBulk

type UserMembershipsCreateBulk struct {
	// contains filtered or unexported fields
}

UserMembershipsCreateBulk is the builder for creating many UserMemberships entities in bulk.

func (*UserMembershipsCreateBulk) Exec

Exec executes the query.

func (*UserMembershipsCreateBulk) ExecX

func (_c *UserMembershipsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserMembershipsCreateBulk) Save

Save creates the UserMemberships entities in the database.

func (*UserMembershipsCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type UserMembershipsDelete

type UserMembershipsDelete struct {
	// contains filtered or unexported fields
}

UserMembershipsDelete is the builder for deleting a UserMemberships entity.

func (*UserMembershipsDelete) Exec

func (_d *UserMembershipsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserMembershipsDelete) ExecX

func (_d *UserMembershipsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserMembershipsDelete) Where

Where appends a list predicates to the UserMembershipsDelete builder.

type UserMembershipsDeleteOne

type UserMembershipsDeleteOne struct {
	// contains filtered or unexported fields
}

UserMembershipsDeleteOne is the builder for deleting a single UserMemberships entity.

func (*UserMembershipsDeleteOne) Exec

Exec executes the deletion query.

func (*UserMembershipsDeleteOne) ExecX

func (_d *UserMembershipsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserMembershipsDeleteOne) Where

Where appends a list predicates to the UserMembershipsDelete builder.

type UserMembershipsEdges

type UserMembershipsEdges struct {
	// LionUsers holds the value of the lion_users edge.
	LionUsers *Users `json:"lion_users,omitempty"`
	// contains filtered or unexported fields
}

UserMembershipsEdges holds the relations/edges for other nodes in the graph.

func (UserMembershipsEdges) LionUsersOrErr

func (e UserMembershipsEdges) 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 UserMembershipsGroupBy

type UserMembershipsGroupBy struct {
	// contains filtered or unexported fields
}

UserMembershipsGroupBy is the group-by builder for UserMemberships entities.

func (*UserMembershipsGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*UserMembershipsGroupBy) Bool

func (s *UserMembershipsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) BoolX

func (s *UserMembershipsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserMembershipsGroupBy) Bools

func (s *UserMembershipsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) BoolsX

func (s *UserMembershipsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserMembershipsGroupBy) Float64

func (s *UserMembershipsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) Float64X

func (s *UserMembershipsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserMembershipsGroupBy) Float64s

func (s *UserMembershipsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) Float64sX

func (s *UserMembershipsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserMembershipsGroupBy) Int

func (s *UserMembershipsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) IntX

func (s *UserMembershipsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserMembershipsGroupBy) Ints

func (s *UserMembershipsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) IntsX

func (s *UserMembershipsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserMembershipsGroupBy) Scan

func (_g *UserMembershipsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserMembershipsGroupBy) ScanX

func (s *UserMembershipsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserMembershipsGroupBy) String

func (s *UserMembershipsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) StringX

func (s *UserMembershipsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserMembershipsGroupBy) Strings

func (s *UserMembershipsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserMembershipsGroupBy) StringsX

func (s *UserMembershipsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMembershipsMutation

type UserMembershipsMutation struct {
	// contains filtered or unexported fields
}

UserMembershipsMutation represents an operation that mutates the UserMemberships nodes in the graph.

func (*UserMembershipsMutation) AddCreatedBy

func (m *UserMembershipsMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*UserMembershipsMutation) AddField

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) AddMemberRole

func (m *UserMembershipsMutation) AddMemberRole(i int)

AddMemberRole adds i to the "member_role" field.

func (*UserMembershipsMutation) AddMemberStatus

func (m *UserMembershipsMutation) AddMemberStatus(i int)

AddMemberStatus adds i to the "member_status" field.

func (*UserMembershipsMutation) AddMemberType

func (m *UserMembershipsMutation) AddMemberType(i int)

AddMemberType adds i to the "member_type" field.

func (*UserMembershipsMutation) AddTargetID

func (m *UserMembershipsMutation) AddTargetID(i int)

AddTargetID adds i to the "target_id" field.

func (*UserMembershipsMutation) AddTargetType

func (m *UserMembershipsMutation) AddTargetType(i int)

AddTargetType adds i to the "target_type" field.

func (*UserMembershipsMutation) AddUpdatedBy

func (m *UserMembershipsMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*UserMembershipsMutation) AddedCreatedBy

func (m *UserMembershipsMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*UserMembershipsMutation) AddedEdges

func (m *UserMembershipsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMembershipsMutation) AddedField

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) AddedFields

func (m *UserMembershipsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMembershipsMutation) AddedIDs

func (m *UserMembershipsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMembershipsMutation) AddedMemberRole

func (m *UserMembershipsMutation) AddedMemberRole() (r int, exists bool)

AddedMemberRole returns the value that was added to the "member_role" field in this mutation.

func (*UserMembershipsMutation) AddedMemberStatus

func (m *UserMembershipsMutation) AddedMemberStatus() (r int, exists bool)

AddedMemberStatus returns the value that was added to the "member_status" field in this mutation.

func (*UserMembershipsMutation) AddedMemberType

func (m *UserMembershipsMutation) AddedMemberType() (r int, exists bool)

AddedMemberType returns the value that was added to the "member_type" field in this mutation.

func (*UserMembershipsMutation) AddedTargetID

func (m *UserMembershipsMutation) AddedTargetID() (r int, exists bool)

AddedTargetID returns the value that was added to the "target_id" field in this mutation.

func (*UserMembershipsMutation) AddedTargetType

func (m *UserMembershipsMutation) AddedTargetType() (r int, exists bool)

AddedTargetType returns the value that was added to the "target_type" field in this mutation.

func (*UserMembershipsMutation) AddedUpdatedBy

func (m *UserMembershipsMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*UserMembershipsMutation) ClearCreatedBy

func (m *UserMembershipsMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*UserMembershipsMutation) ClearEdge

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) ClearExpiresAt

func (m *UserMembershipsMutation) ClearExpiresAt()

ClearExpiresAt clears the value of the "expires_at" field.

func (*UserMembershipsMutation) ClearField

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) ClearJoinedAt

func (m *UserMembershipsMutation) ClearJoinedAt()

ClearJoinedAt clears the value of the "joined_at" field.

func (*UserMembershipsMutation) ClearLionUsers

func (m *UserMembershipsMutation) ClearLionUsers()

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserMembershipsMutation) ClearMetadata

func (m *UserMembershipsMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*UserMembershipsMutation) ClearUpdatedBy

func (m *UserMembershipsMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserMembershipsMutation) ClearedEdges

func (m *UserMembershipsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMembershipsMutation) ClearedFields

func (m *UserMembershipsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMembershipsMutation) Client

func (m UserMembershipsMutation) 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 (*UserMembershipsMutation) CreatedAt

func (m *UserMembershipsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMembershipsMutation) CreatedBy

func (m *UserMembershipsMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*UserMembershipsMutation) CreatedByCleared

func (m *UserMembershipsMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*UserMembershipsMutation) Description

func (m *UserMembershipsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*UserMembershipsMutation) EdgeCleared

func (m *UserMembershipsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMembershipsMutation) ExpiresAt

func (m *UserMembershipsMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*UserMembershipsMutation) ExpiresAtCleared

func (m *UserMembershipsMutation) ExpiresAtCleared() bool

ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.

func (*UserMembershipsMutation) Field

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) FieldCleared

func (m *UserMembershipsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMembershipsMutation) Fields

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) ID

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) IDs

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) JoinedAt

func (m *UserMembershipsMutation) JoinedAt() (r time.Time, exists bool)

JoinedAt returns the value of the "joined_at" field in the mutation.

func (*UserMembershipsMutation) JoinedAtCleared

func (m *UserMembershipsMutation) JoinedAtCleared() bool

JoinedAtCleared returns if the "joined_at" field was cleared in this mutation.

func (*UserMembershipsMutation) LionUsersCleared

func (m *UserMembershipsMutation) LionUsersCleared() bool

LionUsersCleared reports if the "lion_users" edge to the Users entity was cleared.

func (*UserMembershipsMutation) LionUsersID

func (m *UserMembershipsMutation) LionUsersID() (id int, exists bool)

LionUsersID returns the "lion_users" edge ID in the mutation.

func (*UserMembershipsMutation) LionUsersIDs

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) MemberRole

func (m *UserMembershipsMutation) MemberRole() (r int, exists bool)

MemberRole returns the value of the "member_role" field in the mutation.

func (*UserMembershipsMutation) MemberStatus

func (m *UserMembershipsMutation) MemberStatus() (r int, exists bool)

MemberStatus returns the value of the "member_status" field in the mutation.

func (*UserMembershipsMutation) MemberType

func (m *UserMembershipsMutation) MemberType() (r int, exists bool)

MemberType returns the value of the "member_type" field in the mutation.

func (*UserMembershipsMutation) Metadata

func (m *UserMembershipsMutation) Metadata() (r map[string]string, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*UserMembershipsMutation) MetadataCleared

func (m *UserMembershipsMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*UserMembershipsMutation) OldCreatedAt

func (m *UserMembershipsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldCreatedBy

func (m *UserMembershipsMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldDescription

func (m *UserMembershipsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldExpiresAt

func (m *UserMembershipsMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldField

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) OldJoinedAt

func (m *UserMembershipsMutation) OldJoinedAt(ctx context.Context) (v time.Time, err error)

OldJoinedAt returns the old "joined_at" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldMemberRole

func (m *UserMembershipsMutation) OldMemberRole(ctx context.Context) (v int, err error)

OldMemberRole returns the old "member_role" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldMemberStatus

func (m *UserMembershipsMutation) OldMemberStatus(ctx context.Context) (v int, err error)

OldMemberStatus returns the old "member_status" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldMemberType

func (m *UserMembershipsMutation) OldMemberType(ctx context.Context) (v int, err error)

OldMemberType returns the old "member_type" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldMetadata

func (m *UserMembershipsMutation) OldMetadata(ctx context.Context) (v map[string]string, err error)

OldMetadata returns the old "metadata" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldTargetID

func (m *UserMembershipsMutation) OldTargetID(ctx context.Context) (v int, err error)

OldTargetID returns the old "target_id" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldTargetType

func (m *UserMembershipsMutation) OldTargetType(ctx context.Context) (v int, err error)

OldTargetType returns the old "target_type" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldUpdatedAt

func (m *UserMembershipsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldUpdatedBy

func (m *UserMembershipsMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) OldUserID

func (m *UserMembershipsMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the UserMemberships entity. If the UserMemberships object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMembershipsMutation) Op

func (m *UserMembershipsMutation) Op() Op

Op returns the operation name.

func (*UserMembershipsMutation) RemovedEdges

func (m *UserMembershipsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMembershipsMutation) RemovedIDs

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) ResetCreatedAt

func (m *UserMembershipsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMembershipsMutation) ResetCreatedBy

func (m *UserMembershipsMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*UserMembershipsMutation) ResetDescription

func (m *UserMembershipsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*UserMembershipsMutation) ResetEdge

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) ResetExpiresAt

func (m *UserMembershipsMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*UserMembershipsMutation) ResetField

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) ResetJoinedAt

func (m *UserMembershipsMutation) ResetJoinedAt()

ResetJoinedAt resets all changes to the "joined_at" field.

func (*UserMembershipsMutation) ResetLionUsers

func (m *UserMembershipsMutation) ResetLionUsers()

ResetLionUsers resets all changes to the "lion_users" edge.

func (*UserMembershipsMutation) ResetMemberRole

func (m *UserMembershipsMutation) ResetMemberRole()

ResetMemberRole resets all changes to the "member_role" field.

func (*UserMembershipsMutation) ResetMemberStatus

func (m *UserMembershipsMutation) ResetMemberStatus()

ResetMemberStatus resets all changes to the "member_status" field.

func (*UserMembershipsMutation) ResetMemberType

func (m *UserMembershipsMutation) ResetMemberType()

ResetMemberType resets all changes to the "member_type" field.

func (*UserMembershipsMutation) ResetMetadata

func (m *UserMembershipsMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*UserMembershipsMutation) ResetTargetID

func (m *UserMembershipsMutation) ResetTargetID()

ResetTargetID resets all changes to the "target_id" field.

func (*UserMembershipsMutation) ResetTargetType

func (m *UserMembershipsMutation) ResetTargetType()

ResetTargetType resets all changes to the "target_type" field.

func (*UserMembershipsMutation) ResetUpdatedAt

func (m *UserMembershipsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMembershipsMutation) ResetUpdatedBy

func (m *UserMembershipsMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*UserMembershipsMutation) ResetUserID

func (m *UserMembershipsMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserMembershipsMutation) SetCreatedAt

func (m *UserMembershipsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMembershipsMutation) SetCreatedBy

func (m *UserMembershipsMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*UserMembershipsMutation) SetDescription

func (m *UserMembershipsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*UserMembershipsMutation) SetExpiresAt

func (m *UserMembershipsMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*UserMembershipsMutation) SetField

func (m *UserMembershipsMutation) 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 (*UserMembershipsMutation) SetJoinedAt

func (m *UserMembershipsMutation) SetJoinedAt(t time.Time)

SetJoinedAt sets the "joined_at" field.

func (*UserMembershipsMutation) SetLionUsersID

func (m *UserMembershipsMutation) SetLionUsersID(id int)

SetLionUsersID sets the "lion_users" edge to the Users entity by id.

func (*UserMembershipsMutation) SetMemberRole

func (m *UserMembershipsMutation) SetMemberRole(i int)

SetMemberRole sets the "member_role" field.

func (*UserMembershipsMutation) SetMemberStatus

func (m *UserMembershipsMutation) SetMemberStatus(i int)

SetMemberStatus sets the "member_status" field.

func (*UserMembershipsMutation) SetMemberType

func (m *UserMembershipsMutation) SetMemberType(i int)

SetMemberType sets the "member_type" field.

func (*UserMembershipsMutation) SetMetadata

func (m *UserMembershipsMutation) SetMetadata(value map[string]string)

SetMetadata sets the "metadata" field.

func (*UserMembershipsMutation) SetOp

func (m *UserMembershipsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMembershipsMutation) SetTargetID

func (m *UserMembershipsMutation) SetTargetID(i int)

SetTargetID sets the "target_id" field.

func (*UserMembershipsMutation) SetTargetType

func (m *UserMembershipsMutation) SetTargetType(i int)

SetTargetType sets the "target_type" field.

func (*UserMembershipsMutation) SetUpdatedAt

func (m *UserMembershipsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMembershipsMutation) SetUpdatedBy

func (m *UserMembershipsMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*UserMembershipsMutation) SetUserID

func (m *UserMembershipsMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*UserMembershipsMutation) TargetID

func (m *UserMembershipsMutation) TargetID() (r int, exists bool)

TargetID returns the value of the "target_id" field in the mutation.

func (*UserMembershipsMutation) TargetType

func (m *UserMembershipsMutation) TargetType() (r int, exists bool)

TargetType returns the value of the "target_type" field in the mutation.

func (UserMembershipsMutation) Tx

func (m UserMembershipsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMembershipsMutation) Type

func (m *UserMembershipsMutation) Type() string

Type returns the node type of this mutation (UserMemberships).

func (*UserMembershipsMutation) UpdatedAt

func (m *UserMembershipsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMembershipsMutation) UpdatedBy

func (m *UserMembershipsMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*UserMembershipsMutation) UpdatedByCleared

func (m *UserMembershipsMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*UserMembershipsMutation) UserID

func (m *UserMembershipsMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserMembershipsMutation) Where

Where appends a list predicates to the UserMembershipsMutation builder.

func (*UserMembershipsMutation) WhereP

func (m *UserMembershipsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMembershipsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserMembershipsQuery

type UserMembershipsQuery struct {
	// contains filtered or unexported fields
}

UserMembershipsQuery is the builder for querying UserMemberships entities.

func (*UserMembershipsQuery) Aggregate

Aggregate returns a UserMembershipsSelect configured with the given aggregations.

func (*UserMembershipsQuery) All

All executes the query and returns a list of UserMembershipsSlice.

func (*UserMembershipsQuery) AllX

AllX is like All, but panics if an error occurs.

func (*UserMembershipsQuery) Clone

Clone returns a duplicate of the UserMembershipsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserMembershipsQuery) Count

func (_q *UserMembershipsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserMembershipsQuery) CountX

func (_q *UserMembershipsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserMembershipsQuery) Exist

func (_q *UserMembershipsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserMembershipsQuery) ExistX

func (_q *UserMembershipsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserMembershipsQuery) First

First returns the first UserMemberships entity from the query. Returns a *NotFoundError when no UserMemberships was found.

func (*UserMembershipsQuery) FirstID

func (_q *UserMembershipsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UserMemberships ID from the query. Returns a *NotFoundError when no UserMemberships ID was found.

func (*UserMembershipsQuery) FirstIDX

func (_q *UserMembershipsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserMembershipsQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*UserMembershipsQuery) GroupBy

func (_q *UserMembershipsQuery) GroupBy(field string, fields ...string) *UserMembershipsGroupBy

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.UserMemberships.Query().
	GroupBy(usermemberships.FieldCreatedAt).
	Aggregate(lion.Count()).
	Scan(ctx, &v)

func (*UserMembershipsQuery) IDs

func (_q *UserMembershipsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of UserMemberships IDs.

func (*UserMembershipsQuery) IDsX

func (_q *UserMembershipsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserMembershipsQuery) Limit

func (_q *UserMembershipsQuery) Limit(limit int) *UserMembershipsQuery

Limit the number of records to be returned by this query.

func (*UserMembershipsQuery) Offset

func (_q *UserMembershipsQuery) Offset(offset int) *UserMembershipsQuery

Offset to start from.

func (*UserMembershipsQuery) Only

Only returns a single UserMemberships entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserMemberships entity is found. Returns a *NotFoundError when no UserMemberships entities are found.

func (*UserMembershipsQuery) OnlyID

func (_q *UserMembershipsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UserMemberships ID in the query. Returns a *NotSingularError when more than one UserMemberships ID is found. Returns a *NotFoundError when no entities are found.

func (*UserMembershipsQuery) OnlyIDX

func (_q *UserMembershipsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserMembershipsQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*UserMembershipsQuery) Order

Order specifies how the records should be ordered.

func (*UserMembershipsQuery) QueryLionUsers

func (_q *UserMembershipsQuery) QueryLionUsers() *UsersQuery

QueryLionUsers chains the current query on the "lion_users" edge.

func (*UserMembershipsQuery) Select

func (_q *UserMembershipsQuery) Select(fields ...string) *UserMembershipsSelect

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.UserMemberships.Query().
	Select(usermemberships.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserMembershipsQuery) Unique

func (_q *UserMembershipsQuery) Unique(unique bool) *UserMembershipsQuery

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 (*UserMembershipsQuery) Where

Where adds a new predicate for the UserMembershipsQuery builder.

func (*UserMembershipsQuery) WithLionUsers

func (_q *UserMembershipsQuery) WithLionUsers(opts ...func(*UsersQuery)) *UserMembershipsQuery

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 UserMembershipsSelect

type UserMembershipsSelect struct {
	*UserMembershipsQuery
	// contains filtered or unexported fields
}

UserMembershipsSelect is the builder for selecting fields of UserMemberships entities.

func (*UserMembershipsSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*UserMembershipsSelect) Bool

func (s *UserMembershipsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) BoolX

func (s *UserMembershipsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserMembershipsSelect) Bools

func (s *UserMembershipsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) BoolsX

func (s *UserMembershipsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserMembershipsSelect) Float64

func (s *UserMembershipsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) Float64X

func (s *UserMembershipsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserMembershipsSelect) Float64s

func (s *UserMembershipsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) Float64sX

func (s *UserMembershipsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserMembershipsSelect) Int

func (s *UserMembershipsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) IntX

func (s *UserMembershipsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserMembershipsSelect) Ints

func (s *UserMembershipsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) IntsX

func (s *UserMembershipsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserMembershipsSelect) Scan

func (_s *UserMembershipsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserMembershipsSelect) ScanX

func (s *UserMembershipsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserMembershipsSelect) String

func (s *UserMembershipsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) StringX

func (s *UserMembershipsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserMembershipsSelect) Strings

func (s *UserMembershipsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserMembershipsSelect) StringsX

func (s *UserMembershipsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMembershipsSlice

type UserMembershipsSlice []*UserMemberships

UserMembershipsSlice is a parsable slice of UserMemberships.

type UserMembershipsUpdate

type UserMembershipsUpdate struct {
	// contains filtered or unexported fields
}

UserMembershipsUpdate is the builder for updating UserMemberships entities.

func (*UserMembershipsUpdate) AddCreatedBy

func (_u *UserMembershipsUpdate) AddCreatedBy(v int64) *UserMembershipsUpdate

AddCreatedBy adds value to the "created_by" field.

func (*UserMembershipsUpdate) AddMemberRole

func (_u *UserMembershipsUpdate) AddMemberRole(v int) *UserMembershipsUpdate

AddMemberRole adds value to the "member_role" field.

func (*UserMembershipsUpdate) AddMemberStatus

func (_u *UserMembershipsUpdate) AddMemberStatus(v int) *UserMembershipsUpdate

AddMemberStatus adds value to the "member_status" field.

func (*UserMembershipsUpdate) AddMemberType

func (_u *UserMembershipsUpdate) AddMemberType(v int) *UserMembershipsUpdate

AddMemberType adds value to the "member_type" field.

func (*UserMembershipsUpdate) AddTargetID

func (_u *UserMembershipsUpdate) AddTargetID(v int) *UserMembershipsUpdate

AddTargetID adds value to the "target_id" field.

func (*UserMembershipsUpdate) AddTargetType

func (_u *UserMembershipsUpdate) AddTargetType(v int) *UserMembershipsUpdate

AddTargetType adds value to the "target_type" field.

func (*UserMembershipsUpdate) AddUpdatedBy

func (_u *UserMembershipsUpdate) AddUpdatedBy(v int64) *UserMembershipsUpdate

AddUpdatedBy adds value to the "updated_by" field.

func (*UserMembershipsUpdate) ClearCreatedBy

func (_u *UserMembershipsUpdate) ClearCreatedBy() *UserMembershipsUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*UserMembershipsUpdate) ClearExpiresAt

func (_u *UserMembershipsUpdate) ClearExpiresAt() *UserMembershipsUpdate

ClearExpiresAt clears the value of the "expires_at" field.

func (*UserMembershipsUpdate) ClearJoinedAt

func (_u *UserMembershipsUpdate) ClearJoinedAt() *UserMembershipsUpdate

ClearJoinedAt clears the value of the "joined_at" field.

func (*UserMembershipsUpdate) ClearLionUsers

func (_u *UserMembershipsUpdate) ClearLionUsers() *UserMembershipsUpdate

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserMembershipsUpdate) ClearMetadata

func (_u *UserMembershipsUpdate) ClearMetadata() *UserMembershipsUpdate

ClearMetadata clears the value of the "metadata" field.

func (*UserMembershipsUpdate) ClearUpdatedBy

func (_u *UserMembershipsUpdate) ClearUpdatedBy() *UserMembershipsUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserMembershipsUpdate) Exec

Exec executes the query.

func (*UserMembershipsUpdate) ExecX

func (_u *UserMembershipsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserMembershipsUpdate) Mutation

Mutation returns the UserMembershipsMutation object of the builder.

func (*UserMembershipsUpdate) Save

func (_u *UserMembershipsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserMembershipsUpdate) SaveX

func (_u *UserMembershipsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserMembershipsUpdate) SetCreatedBy

func (_u *UserMembershipsUpdate) SetCreatedBy(v int64) *UserMembershipsUpdate

SetCreatedBy sets the "created_by" field.

func (*UserMembershipsUpdate) SetDescription

func (_u *UserMembershipsUpdate) SetDescription(v string) *UserMembershipsUpdate

SetDescription sets the "description" field.

func (*UserMembershipsUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*UserMembershipsUpdate) SetJoinedAt

SetJoinedAt sets the "joined_at" field.

func (*UserMembershipsUpdate) SetLionUsers

func (_u *UserMembershipsUpdate) SetLionUsers(v *Users) *UserMembershipsUpdate

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserMembershipsUpdate) SetLionUsersID

func (_u *UserMembershipsUpdate) SetLionUsersID(id int) *UserMembershipsUpdate

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserMembershipsUpdate) SetMemberRole

func (_u *UserMembershipsUpdate) SetMemberRole(v int) *UserMembershipsUpdate

SetMemberRole sets the "member_role" field.

func (*UserMembershipsUpdate) SetMemberStatus

func (_u *UserMembershipsUpdate) SetMemberStatus(v int) *UserMembershipsUpdate

SetMemberStatus sets the "member_status" field.

func (*UserMembershipsUpdate) SetMemberType

func (_u *UserMembershipsUpdate) SetMemberType(v int) *UserMembershipsUpdate

SetMemberType sets the "member_type" field.

func (*UserMembershipsUpdate) SetMetadata

func (_u *UserMembershipsUpdate) SetMetadata(v map[string]string) *UserMembershipsUpdate

SetMetadata sets the "metadata" field.

func (*UserMembershipsUpdate) SetNillableCreatedBy

func (_u *UserMembershipsUpdate) SetNillableCreatedBy(v *int64) *UserMembershipsUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableDescription

func (_u *UserMembershipsUpdate) SetNillableDescription(v *string) *UserMembershipsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableExpiresAt

func (_u *UserMembershipsUpdate) SetNillableExpiresAt(v *time.Time) *UserMembershipsUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableJoinedAt

func (_u *UserMembershipsUpdate) SetNillableJoinedAt(v *time.Time) *UserMembershipsUpdate

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableMemberRole

func (_u *UserMembershipsUpdate) SetNillableMemberRole(v *int) *UserMembershipsUpdate

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableMemberStatus

func (_u *UserMembershipsUpdate) SetNillableMemberStatus(v *int) *UserMembershipsUpdate

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableMemberType

func (_u *UserMembershipsUpdate) SetNillableMemberType(v *int) *UserMembershipsUpdate

SetNillableMemberType sets the "member_type" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableTargetID

func (_u *UserMembershipsUpdate) SetNillableTargetID(v *int) *UserMembershipsUpdate

SetNillableTargetID sets the "target_id" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableTargetType

func (_u *UserMembershipsUpdate) SetNillableTargetType(v *int) *UserMembershipsUpdate

SetNillableTargetType sets the "target_type" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableUpdatedBy

func (_u *UserMembershipsUpdate) SetNillableUpdatedBy(v *int64) *UserMembershipsUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserMembershipsUpdate) SetNillableUserID

func (_u *UserMembershipsUpdate) SetNillableUserID(v *int) *UserMembershipsUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserMembershipsUpdate) SetTargetID

func (_u *UserMembershipsUpdate) SetTargetID(v int) *UserMembershipsUpdate

SetTargetID sets the "target_id" field.

func (*UserMembershipsUpdate) SetTargetType

func (_u *UserMembershipsUpdate) SetTargetType(v int) *UserMembershipsUpdate

SetTargetType sets the "target_type" field.

func (*UserMembershipsUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserMembershipsUpdate) SetUpdatedBy

func (_u *UserMembershipsUpdate) SetUpdatedBy(v int64) *UserMembershipsUpdate

SetUpdatedBy sets the "updated_by" field.

func (*UserMembershipsUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*UserMembershipsUpdate) Where

Where appends a list predicates to the UserMembershipsUpdate builder.

type UserMembershipsUpdateOne

type UserMembershipsUpdateOne struct {
	// contains filtered or unexported fields
}

UserMembershipsUpdateOne is the builder for updating a single UserMemberships entity.

func (*UserMembershipsUpdateOne) AddCreatedBy

AddCreatedBy adds value to the "created_by" field.

func (*UserMembershipsUpdateOne) AddMemberRole

AddMemberRole adds value to the "member_role" field.

func (*UserMembershipsUpdateOne) AddMemberStatus

func (_u *UserMembershipsUpdateOne) AddMemberStatus(v int) *UserMembershipsUpdateOne

AddMemberStatus adds value to the "member_status" field.

func (*UserMembershipsUpdateOne) AddMemberType

AddMemberType adds value to the "member_type" field.

func (*UserMembershipsUpdateOne) AddTargetID

AddTargetID adds value to the "target_id" field.

func (*UserMembershipsUpdateOne) AddTargetType

AddTargetType adds value to the "target_type" field.

func (*UserMembershipsUpdateOne) AddUpdatedBy

AddUpdatedBy adds value to the "updated_by" field.

func (*UserMembershipsUpdateOne) ClearCreatedBy

func (_u *UserMembershipsUpdateOne) ClearCreatedBy() *UserMembershipsUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*UserMembershipsUpdateOne) ClearExpiresAt

func (_u *UserMembershipsUpdateOne) ClearExpiresAt() *UserMembershipsUpdateOne

ClearExpiresAt clears the value of the "expires_at" field.

func (*UserMembershipsUpdateOne) ClearJoinedAt

ClearJoinedAt clears the value of the "joined_at" field.

func (*UserMembershipsUpdateOne) ClearLionUsers

func (_u *UserMembershipsUpdateOne) ClearLionUsers() *UserMembershipsUpdateOne

ClearLionUsers clears the "lion_users" edge to the Users entity.

func (*UserMembershipsUpdateOne) ClearMetadata

ClearMetadata clears the value of the "metadata" field.

func (*UserMembershipsUpdateOne) ClearUpdatedBy

func (_u *UserMembershipsUpdateOne) ClearUpdatedBy() *UserMembershipsUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*UserMembershipsUpdateOne) Exec

Exec executes the query on the entity.

func (*UserMembershipsUpdateOne) ExecX

func (_u *UserMembershipsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserMembershipsUpdateOne) Mutation

Mutation returns the UserMembershipsMutation object of the builder.

func (*UserMembershipsUpdateOne) Save

Save executes the query and returns the updated UserMemberships entity.

func (*UserMembershipsUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*UserMembershipsUpdateOne) Select

func (_u *UserMembershipsUpdateOne) Select(field string, fields ...string) *UserMembershipsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserMembershipsUpdateOne) SetCreatedBy

SetCreatedBy sets the "created_by" field.

func (*UserMembershipsUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*UserMembershipsUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*UserMembershipsUpdateOne) SetJoinedAt

SetJoinedAt sets the "joined_at" field.

func (*UserMembershipsUpdateOne) SetLionUsers

SetLionUsers sets the "lion_users" edge to the Users entity.

func (*UserMembershipsUpdateOne) SetLionUsersID

func (_u *UserMembershipsUpdateOne) SetLionUsersID(id int) *UserMembershipsUpdateOne

SetLionUsersID sets the "lion_users" edge to the Users entity by ID.

func (*UserMembershipsUpdateOne) SetMemberRole

SetMemberRole sets the "member_role" field.

func (*UserMembershipsUpdateOne) SetMemberStatus

func (_u *UserMembershipsUpdateOne) SetMemberStatus(v int) *UserMembershipsUpdateOne

SetMemberStatus sets the "member_status" field.

func (*UserMembershipsUpdateOne) SetMemberType

SetMemberType sets the "member_type" field.

func (*UserMembershipsUpdateOne) SetMetadata

SetMetadata sets the "metadata" field.

func (*UserMembershipsUpdateOne) SetNillableCreatedBy

func (_u *UserMembershipsUpdateOne) SetNillableCreatedBy(v *int64) *UserMembershipsUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableDescription

func (_u *UserMembershipsUpdateOne) SetNillableDescription(v *string) *UserMembershipsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableExpiresAt

func (_u *UserMembershipsUpdateOne) SetNillableExpiresAt(v *time.Time) *UserMembershipsUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableJoinedAt

func (_u *UserMembershipsUpdateOne) SetNillableJoinedAt(v *time.Time) *UserMembershipsUpdateOne

SetNillableJoinedAt sets the "joined_at" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableMemberRole

func (_u *UserMembershipsUpdateOne) SetNillableMemberRole(v *int) *UserMembershipsUpdateOne

SetNillableMemberRole sets the "member_role" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableMemberStatus

func (_u *UserMembershipsUpdateOne) SetNillableMemberStatus(v *int) *UserMembershipsUpdateOne

SetNillableMemberStatus sets the "member_status" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableMemberType

func (_u *UserMembershipsUpdateOne) SetNillableMemberType(v *int) *UserMembershipsUpdateOne

SetNillableMemberType sets the "member_type" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableTargetID

func (_u *UserMembershipsUpdateOne) SetNillableTargetID(v *int) *UserMembershipsUpdateOne

SetNillableTargetID sets the "target_id" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableTargetType

func (_u *UserMembershipsUpdateOne) SetNillableTargetType(v *int) *UserMembershipsUpdateOne

SetNillableTargetType sets the "target_type" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableUpdatedBy

func (_u *UserMembershipsUpdateOne) SetNillableUpdatedBy(v *int64) *UserMembershipsUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetNillableUserID

func (_u *UserMembershipsUpdateOne) SetNillableUserID(v *int) *UserMembershipsUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*UserMembershipsUpdateOne) SetTargetID

SetTargetID sets the "target_id" field.

func (*UserMembershipsUpdateOne) SetTargetType

SetTargetType sets the "target_type" field.

func (*UserMembershipsUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*UserMembershipsUpdateOne) SetUpdatedBy

SetUpdatedBy sets the "updated_by" field.

func (*UserMembershipsUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*UserMembershipsUpdateOne) Where

Where appends a list predicates to the UserMembershipsUpdate 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 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-女性,3-其他,4-保密
	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) QueryLionUserIdentities

func (_m *Users) QueryLionUserIdentities() *UserIdentitiesQuery

QueryLionUserIdentities queries the "lion_user_identities" edge of the Users entity.

func (*Users) QueryLionUserMemberships

func (_m *Users) QueryLionUserMemberships() *UserMembershipsQuery

QueryLionUserMemberships queries the "lion_user_memberships" 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) QueryLionUserIdentities

func (c *UsersClient) QueryLionUserIdentities(_m *Users) *UserIdentitiesQuery

QueryLionUserIdentities queries the lion_user_identities edge of a Users.

func (*UsersClient) QueryLionUserMemberships

func (c *UsersClient) QueryLionUserMemberships(_m *Users) *UserMembershipsQuery

QueryLionUserMemberships queries the lion_user_memberships 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) 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) AddLionUserMembershipIDs

func (_c *UsersCreate) AddLionUserMembershipIDs(ids ...int) *UsersCreate

AddLionUserMembershipIDs adds the "lion_user_memberships" edge to the UserMemberships entity by IDs.

func (*UsersCreate) AddLionUserMemberships

func (_c *UsersCreate) AddLionUserMemberships(v ...*UserMemberships) *UsersCreate

AddLionUserMemberships adds the "lion_user_memberships" edges to the UserMemberships 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 {
	// LionUserMemberships holds the value of the lion_user_memberships edge.
	LionUserMemberships []*UserMemberships `json:"lion_user_memberships,omitempty"`
	// LionUserIdentities holds the value of the lion_user_identities edge.
	LionUserIdentities []*UserIdentities `json:"lion_user_identities,omitempty"`
	// contains filtered or unexported fields
}

UsersEdges holds the relations/edges for other nodes in the graph.

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) LionUserMembershipsOrErr

func (e UsersEdges) LionUserMembershipsOrErr() ([]*UserMemberships, error)

LionUserMembershipsOrErr returns the LionUserMemberships 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) AddLionUserIdentityIDs

func (m *UsersMutation) AddLionUserIdentityIDs(ids ...int)

AddLionUserIdentityIDs adds the "lion_user_identities" edge to the UserIdentities entity by ids.

func (*UsersMutation) AddLionUserMembershipIDs

func (m *UsersMutation) AddLionUserMembershipIDs(ids ...int)

AddLionUserMembershipIDs adds the "lion_user_memberships" edge to the UserMemberships 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) ClearLionUserIdentities

func (m *UsersMutation) ClearLionUserIdentities()

ClearLionUserIdentities clears the "lion_user_identities" edge to the UserIdentities entity.

func (*UsersMutation) ClearLionUserMemberships

func (m *UsersMutation) ClearLionUserMemberships()

ClearLionUserMemberships clears the "lion_user_memberships" edge to the UserMemberships 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) 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) LionUserMembershipsCleared

func (m *UsersMutation) LionUserMembershipsCleared() bool

LionUserMembershipsCleared reports if the "lion_user_memberships" edge to the UserMemberships entity was cleared.

func (*UsersMutation) LionUserMembershipsIDs

func (m *UsersMutation) LionUserMembershipsIDs() (ids []int)

LionUserMembershipsIDs returns the "lion_user_memberships" 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) RemoveLionUserIdentityIDs

func (m *UsersMutation) RemoveLionUserIdentityIDs(ids ...int)

RemoveLionUserIdentityIDs removes the "lion_user_identities" edge to the UserIdentities entity by IDs.

func (*UsersMutation) RemoveLionUserMembershipIDs

func (m *UsersMutation) RemoveLionUserMembershipIDs(ids ...int)

RemoveLionUserMembershipIDs removes the "lion_user_memberships" edge to the UserMemberships 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) RemovedLionUserIdentitiesIDs

func (m *UsersMutation) RemovedLionUserIdentitiesIDs() (ids []int)

RemovedLionUserIdentities returns the removed IDs of the "lion_user_identities" edge to the UserIdentities entity.

func (*UsersMutation) RemovedLionUserMembershipsIDs

func (m *UsersMutation) RemovedLionUserMembershipsIDs() (ids []int)

RemovedLionUserMemberships returns the removed IDs of the "lion_user_memberships" edge to the UserMemberships 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) ResetLionUserIdentities

func (m *UsersMutation) ResetLionUserIdentities()

ResetLionUserIdentities resets all changes to the "lion_user_identities" edge.

func (*UsersMutation) ResetLionUserMemberships

func (m *UsersMutation) ResetLionUserMemberships()

ResetLionUserMemberships resets all changes to the "lion_user_memberships" 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) QueryLionUserIdentities

func (_q *UsersQuery) QueryLionUserIdentities() *UserIdentitiesQuery

QueryLionUserIdentities chains the current query on the "lion_user_identities" edge.

func (*UsersQuery) QueryLionUserMemberships

func (_q *UsersQuery) QueryLionUserMemberships() *UserMembershipsQuery

QueryLionUserMemberships chains the current query on the "lion_user_memberships" 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) 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) WithLionUserMemberships

func (_q *UsersQuery) WithLionUserMemberships(opts ...func(*UserMembershipsQuery)) *UsersQuery

WithLionUserMemberships tells the query-builder to eager-load the nodes that are connected to the "lion_user_memberships" 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) 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) AddLionUserMembershipIDs

func (_u *UsersUpdate) AddLionUserMembershipIDs(ids ...int) *UsersUpdate

AddLionUserMembershipIDs adds the "lion_user_memberships" edge to the UserMemberships entity by IDs.

func (*UsersUpdate) AddLionUserMemberships

func (_u *UsersUpdate) AddLionUserMemberships(v ...*UserMemberships) *UsersUpdate

AddLionUserMemberships adds the "lion_user_memberships" edges to the UserMemberships 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) ClearLionUserIdentities

func (_u *UsersUpdate) ClearLionUserIdentities() *UsersUpdate

ClearLionUserIdentities clears all "lion_user_identities" edges to the UserIdentities entity.

func (*UsersUpdate) ClearLionUserMemberships

func (_u *UsersUpdate) ClearLionUserMemberships() *UsersUpdate

ClearLionUserMemberships clears all "lion_user_memberships" edges to the UserMemberships 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) 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) RemoveLionUserMembershipIDs

func (_u *UsersUpdate) RemoveLionUserMembershipIDs(ids ...int) *UsersUpdate

RemoveLionUserMembershipIDs removes the "lion_user_memberships" edge to UserMemberships entities by IDs.

func (*UsersUpdate) RemoveLionUserMemberships

func (_u *UsersUpdate) RemoveLionUserMemberships(v ...*UserMemberships) *UsersUpdate

RemoveLionUserMemberships removes "lion_user_memberships" edges to UserMemberships 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) 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) AddLionUserMembershipIDs

func (_u *UsersUpdateOne) AddLionUserMembershipIDs(ids ...int) *UsersUpdateOne

AddLionUserMembershipIDs adds the "lion_user_memberships" edge to the UserMemberships entity by IDs.

func (*UsersUpdateOne) AddLionUserMemberships

func (_u *UsersUpdateOne) AddLionUserMemberships(v ...*UserMemberships) *UsersUpdateOne

AddLionUserMemberships adds the "lion_user_memberships" edges to the UserMemberships 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) ClearLionUserIdentities

func (_u *UsersUpdateOne) ClearLionUserIdentities() *UsersUpdateOne

ClearLionUserIdentities clears all "lion_user_identities" edges to the UserIdentities entity.

func (*UsersUpdateOne) ClearLionUserMemberships

func (_u *UsersUpdateOne) ClearLionUserMemberships() *UsersUpdateOne

ClearLionUserMemberships clears all "lion_user_memberships" edges to the UserMemberships 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) 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) RemoveLionUserMembershipIDs

func (_u *UsersUpdateOne) RemoveLionUserMembershipIDs(ids ...int) *UsersUpdateOne

RemoveLionUserMembershipIDs removes the "lion_user_memberships" edge to UserMemberships entities by IDs.

func (*UsersUpdateOne) RemoveLionUserMemberships

func (_u *UsersUpdateOne) RemoveLionUserMemberships(v ...*UserMemberships) *UsersUpdateOne

RemoveLionUserMemberships removes "lion_user_memberships" edges to UserMemberships 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