ent

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 31 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.
	TypeAdminUser  = "AdminUser"
	TypeFile       = "File"
	TypePermission = "Permission"
	TypeRole       = "Role"
	TypeUser       = "User"
)

Variables

View Source
var (
	// AdminUserOrderFieldID orders AdminUser by id.
	AdminUserOrderFieldID = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.ID, nil
		},
		column: adminuser.FieldID,
		toTerm: adminuser.ByID,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.ID,
			}
		},
	}
	// AdminUserOrderFieldName orders AdminUser by name.
	AdminUserOrderFieldName = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.Name, nil
		},
		column: adminuser.FieldName,
		toTerm: adminuser.ByName,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.Name,
			}
		},
	}
	// AdminUserOrderFieldEmail orders AdminUser by email.
	AdminUserOrderFieldEmail = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.Email, nil
		},
		column: adminuser.FieldEmail,
		toTerm: adminuser.ByEmail,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.Email,
			}
		},
	}
	// AdminUserOrderFieldFirstName orders AdminUser by first_name.
	AdminUserOrderFieldFirstName = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.FirstName, nil
		},
		column: adminuser.FieldFirstName,
		toTerm: adminuser.ByFirstName,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.FirstName,
			}
		},
	}
	// AdminUserOrderFieldLastName orders AdminUser by last_name.
	AdminUserOrderFieldLastName = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.LastName, nil
		},
		column: adminuser.FieldLastName,
		toTerm: adminuser.ByLastName,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.LastName,
			}
		},
	}
	// AdminUserOrderFieldCreatedAt orders AdminUser by created_at.
	AdminUserOrderFieldCreatedAt = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.CreatedAt, nil
		},
		column: adminuser.FieldCreatedAt,
		toTerm: adminuser.ByCreatedAt,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.CreatedAt,
			}
		},
	}
	// AdminUserOrderFieldUpdatedAt orders AdminUser by updated_at.
	AdminUserOrderFieldUpdatedAt = &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.UpdatedAt, nil
		},
		column: adminuser.FieldUpdatedAt,
		toTerm: adminuser.ByUpdatedAt,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{
				ID:    au.ID,
				Value: au.UpdatedAt,
			}
		},
	}
)
View Source
var (
	// FileOrderFieldID orders File by id.
	FileOrderFieldID = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.ID, nil
		},
		column: file.FieldID,
		toTerm: file.ByID,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.ID,
			}
		},
	}
	// FileOrderFieldCreatedAt orders File by created_at.
	FileOrderFieldCreatedAt = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.CreatedAt, nil
		},
		column: file.FieldCreatedAt,
		toTerm: file.ByCreatedAt,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.CreatedAt,
			}
		},
	}
	// FileOrderFieldUpdatedAt orders File by updated_at.
	FileOrderFieldUpdatedAt = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.UpdatedAt, nil
		},
		column: file.FieldUpdatedAt,
		toTerm: file.ByUpdatedAt,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.UpdatedAt,
			}
		},
	}
	// FileOrderFieldCaption orders File by caption.
	FileOrderFieldCaption = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.Caption, nil
		},
		column: file.FieldCaption,
		toTerm: file.ByCaption,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.Caption,
			}
		},
	}
	// FileOrderFieldName orders File by name.
	FileOrderFieldName = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.Name, nil
		},
		column: file.FieldName,
		toTerm: file.ByName,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.Name,
			}
		},
	}
	// FileOrderFieldMimeType orders File by mime_type.
	FileOrderFieldMimeType = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.MimeType, nil
		},
		column: file.FieldMimeType,
		toTerm: file.ByMimeType,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.MimeType,
			}
		},
	}
	// FileOrderFieldStorageFileName orders File by storage_file_name.
	FileOrderFieldStorageFileName = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.StorageFileName, nil
		},
		column: file.FieldStorageFileName,
		toTerm: file.ByStorageFileName,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.StorageFileName,
			}
		},
	}
	// FileOrderFieldSize orders File by size.
	FileOrderFieldSize = &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.Size, nil
		},
		column: file.FieldSize,
		toTerm: file.BySize,
		toCursor: func(f *File) Cursor {
			return Cursor{
				ID:    f.ID,
				Value: f.Size,
			}
		},
	}
)
View Source
var (
	// PermissionOrderFieldID orders Permission by id.
	PermissionOrderFieldID = &PermissionOrderField{
		Value: func(pe *Permission) (ent.Value, error) {
			return pe.ID, nil
		},
		column: permission.FieldID,
		toTerm: permission.ByID,
		toCursor: func(pe *Permission) Cursor {
			return Cursor{
				ID:    pe.ID,
				Value: pe.ID,
			}
		},
	}
	// PermissionOrderFieldEntity orders Permission by entity.
	PermissionOrderFieldEntity = &PermissionOrderField{
		Value: func(pe *Permission) (ent.Value, error) {
			return pe.Entity, nil
		},
		column: permission.FieldEntity,
		toTerm: permission.ByEntity,
		toCursor: func(pe *Permission) Cursor {
			return Cursor{
				ID:    pe.ID,
				Value: pe.Entity,
			}
		},
	}
	// PermissionOrderFieldOperation orders Permission by operation.
	PermissionOrderFieldOperation = &PermissionOrderField{
		Value: func(pe *Permission) (ent.Value, error) {
			return pe.Operation, nil
		},
		column: permission.FieldOperation,
		toTerm: permission.ByOperation,
		toCursor: func(pe *Permission) Cursor {
			return Cursor{
				ID:    pe.ID,
				Value: pe.Operation,
			}
		},
	}
)
View Source
var (
	// RoleOrderFieldID orders Role by id.
	RoleOrderFieldID = &RoleOrderField{
		Value: func(r *Role) (ent.Value, error) {
			return r.ID, nil
		},
		column: role.FieldID,
		toTerm: role.ByID,
		toCursor: func(r *Role) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.ID,
			}
		},
	}
	// RoleOrderFieldName orders Role by name.
	RoleOrderFieldName = &RoleOrderField{
		Value: func(r *Role) (ent.Value, error) {
			return r.Name, nil
		},
		column: role.FieldName,
		toTerm: role.ByName,
		toCursor: func(r *Role) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.Name,
			}
		},
	}
	// RoleOrderFieldCreatedAt orders Role by created_at.
	RoleOrderFieldCreatedAt = &RoleOrderField{
		Value: func(r *Role) (ent.Value, error) {
			return r.CreatedAt, nil
		},
		column: role.FieldCreatedAt,
		toTerm: role.ByCreatedAt,
		toCursor: func(r *Role) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.CreatedAt,
			}
		},
	}
	// RoleOrderFieldUpdatedAt orders Role by updated_at.
	RoleOrderFieldUpdatedAt = &RoleOrderField{
		Value: func(r *Role) (ent.Value, error) {
			return r.UpdatedAt, nil
		},
		column: role.FieldUpdatedAt,
		toTerm: role.ByUpdatedAt,
		toCursor: func(r *Role) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.UpdatedAt,
			}
		},
	}
)
View Source
var (
	// UserOrderFieldID orders User by id.
	UserOrderFieldID = &UserOrderField{
		Value: func(u *User) (ent.Value, error) {
			return u.ID, nil
		},
		column: user.FieldID,
		toTerm: user.ByID,
		toCursor: func(u *User) Cursor {
			return Cursor{
				ID:    u.ID,
				Value: u.ID,
			}
		},
	}
	// UserOrderFieldEmail orders User by email.
	UserOrderFieldEmail = &UserOrderField{
		Value: func(u *User) (ent.Value, error) {
			return u.Email, nil
		},
		column: user.FieldEmail,
		toTerm: user.ByEmail,
		toCursor: func(u *User) Cursor {
			return Cursor{
				ID:    u.ID,
				Value: u.Email,
			}
		},
	}
)
View Source
var DefaultAdminUserOrder = &AdminUserOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &AdminUserOrderField{
		Value: func(au *AdminUser) (ent.Value, error) {
			return au.ID, nil
		},
		column: adminuser.FieldID,
		toTerm: adminuser.ByID,
		toCursor: func(au *AdminUser) Cursor {
			return Cursor{ID: au.ID}
		},
	},
}

DefaultAdminUserOrder is the default ordering of AdminUser.

View Source
var DefaultFileOrder = &FileOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &FileOrderField{
		Value: func(f *File) (ent.Value, error) {
			return f.ID, nil
		},
		column: file.FieldID,
		toTerm: file.ByID,
		toCursor: func(f *File) Cursor {
			return Cursor{ID: f.ID}
		},
	},
}

DefaultFileOrder is the default ordering of File.

View Source
var DefaultPermissionOrder = &PermissionOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &PermissionOrderField{
		Value: func(pe *Permission) (ent.Value, error) {
			return pe.ID, nil
		},
		column: permission.FieldID,
		toTerm: permission.ByID,
		toCursor: func(pe *Permission) Cursor {
			return Cursor{ID: pe.ID}
		},
	},
}

DefaultPermissionOrder is the default ordering of Permission.

View Source
var DefaultRoleOrder = &RoleOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &RoleOrderField{
		Value: func(r *Role) (ent.Value, error) {
			return r.ID, nil
		},
		column: role.FieldID,
		toTerm: role.ByID,
		toCursor: func(r *Role) Cursor {
			return Cursor{ID: r.ID}
		},
	},
}

DefaultRoleOrder is the default ordering of Role.

View Source
var DefaultUserOrder = &UserOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &UserOrderField{
		Value: func(u *User) (ent.Value, error) {
			return u.ID, nil
		},
		column: user.FieldID,
		toTerm: user.ByID,
		toCursor: func(u *User) Cursor {
			return Cursor{ID: u.ID}
		},
	},
}

DefaultUserOrder is the default ordering of User.

View Source
var ErrEmptyAdminUserWhereInput = errors.New("ent: empty predicate AdminUserWhereInput")

ErrEmptyAdminUserWhereInput is returned in case the AdminUserWhereInput is empty.

View Source
var ErrEmptyAdminUserWhereUniqueInput = errors.New("empty predicate AdminUserWhereUniqueInput")
View Source
var ErrEmptyFileWhereInput = errors.New("ent: empty predicate FileWhereInput")

ErrEmptyFileWhereInput is returned in case the FileWhereInput is empty.

View Source
var ErrEmptyFileWhereUniqueInput = errors.New("empty predicate FileWhereUniqueInput")
View Source
var ErrEmptyPermissionWhereInput = errors.New("ent: empty predicate PermissionWhereInput")

ErrEmptyPermissionWhereInput is returned in case the PermissionWhereInput is empty.

View Source
var ErrEmptyPermissionWhereUniqueInput = errors.New("empty predicate PermissionWhereUniqueInput")
View Source
var ErrEmptyRoleWhereInput = errors.New("ent: empty predicate RoleWhereInput")

ErrEmptyRoleWhereInput is returned in case the RoleWhereInput is empty.

View Source
var ErrEmptyRoleWhereUniqueInput = errors.New("empty predicate RoleWhereUniqueInput")
View Source
var ErrEmptyUserWhereInput = errors.New("ent: empty predicate UserWhereInput")

ErrEmptyUserWhereInput is returned in case the UserWhereInput is empty.

View Source
var ErrEmptyUserWhereUniqueInput = errors.New("empty predicate UserWhereUniqueInput")
View Source
var ErrTxStarted = errors.New("ent: 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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

Types

type AdminUser

type AdminUser struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AdminUserQuery when eager-loading is set.
	Edges AdminUserEdges `json:"edges"`
	// contains filtered or unexported fields
}

AdminUser is the model entity for the AdminUser schema.

func (*AdminUser) AdminCreatedBy

func (au *AdminUser) AdminCreatedBy(ctx context.Context) (*AdminUser, error)

func (*AdminUser) AdminUpdatedBy

func (au *AdminUser) AdminUpdatedBy(ctx context.Context) (*AdminUser, error)

func (*AdminUser) DefaultRole

func (au *AdminUser) DefaultRole(ctx context.Context) (*Role, error)

func (*AdminUser) ExecContext

func (c *AdminUser) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUser) IsNode

func (*AdminUser) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*AdminUser) NamedRefAdminCreatedBy

func (au *AdminUser) NamedRefAdminCreatedBy(name string) ([]*AdminUser, error)

NamedRefAdminCreatedBy returns the RefAdminCreatedBy named value or an error if the edge was not loaded in eager-loading with this name.

func (*AdminUser) NamedRefAdminUpdatedBy

func (au *AdminUser) NamedRefAdminUpdatedBy(name string) ([]*AdminUser, error)

NamedRefAdminUpdatedBy returns the RefAdminUpdatedBy named value or an error if the edge was not loaded in eager-loading with this name.

func (*AdminUser) NamedRoles

func (au *AdminUser) NamedRoles(name string) ([]*Role, error)

NamedRoles returns the Roles named value or an error if the edge was not loaded in eager-loading with this name.

func (*AdminUser) QueryAdminCreatedBy

func (au *AdminUser) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy queries the "admin_created_by" edge of the AdminUser entity.

func (*AdminUser) QueryAdminUpdatedBy

func (au *AdminUser) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy queries the "admin_updated_by" edge of the AdminUser entity.

func (*AdminUser) QueryContext

func (c *AdminUser) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUser) QueryDefaultRole

func (au *AdminUser) QueryDefaultRole() *RoleQuery

QueryDefaultRole queries the "default_role" edge of the AdminUser entity.

func (*AdminUser) QueryRefAdminCreatedBy

func (au *AdminUser) QueryRefAdminCreatedBy() *AdminUserQuery

QueryRefAdminCreatedBy queries the "ref_admin_created_by" edge of the AdminUser entity.

func (*AdminUser) QueryRefAdminUpdatedBy

func (au *AdminUser) QueryRefAdminUpdatedBy() *AdminUserQuery

QueryRefAdminUpdatedBy queries the "ref_admin_updated_by" edge of the AdminUser entity.

func (*AdminUser) QueryRoles

func (au *AdminUser) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the AdminUser entity.

func (*AdminUser) RefAdminUpdatedBy

func (au *AdminUser) RefAdminUpdatedBy(ctx context.Context) (result []*AdminUser, err error)

func (*AdminUser) Roles

func (au *AdminUser) Roles(ctx context.Context) (result []*Role, err error)

func (*AdminUser) String

func (au *AdminUser) String() string

String implements the fmt.Stringer.

func (*AdminUser) ToEdge

func (au *AdminUser) ToEdge(order *AdminUserOrder) *AdminUserEdge

ToEdge converts AdminUser into AdminUserEdge.

func (*AdminUser) Unwrap

func (au *AdminUser) Unwrap() *AdminUser

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

func (au *AdminUser) Update() *AdminUserUpdateOne

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

func (*AdminUser) Value

func (au *AdminUser) Value(name string) (ent.Value, error)

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

type AdminUserClient

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

AdminUserClient is a client for the AdminUser schema.

func NewAdminUserClient

func NewAdminUserClient(c config) *AdminUserClient

NewAdminUserClient returns a client for the AdminUser from the given config.

func (*AdminUserClient) Create

func (c *AdminUserClient) Create() *AdminUserCreate

Create returns a builder for creating a AdminUser entity.

func (*AdminUserClient) CreateBulk

func (c *AdminUserClient) CreateBulk(builders ...*AdminUserCreate) *AdminUserCreateBulk

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

func (*AdminUserClient) Delete

func (c *AdminUserClient) Delete() *AdminUserDelete

Delete returns a delete builder for AdminUser.

func (*AdminUserClient) DeleteOne

func (c *AdminUserClient) DeleteOne(au *AdminUser) *AdminUserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AdminUserClient) DeleteOneID

func (c *AdminUserClient) DeleteOneID(id string) *AdminUserDeleteOne

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

func (*AdminUserClient) ExecContext

func (c *AdminUserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserClient) Get

func (c *AdminUserClient) Get(ctx context.Context, id string) (*AdminUser, error)

Get returns a AdminUser entity by its id.

func (*AdminUserClient) GetX

func (c *AdminUserClient) GetX(ctx context.Context, id string) *AdminUser

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

func (*AdminUserClient) Hooks

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

Hooks returns the client hooks.

func (*AdminUserClient) Intercept

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

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

func (*AdminUserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AdminUserClient) MapCreateBulk

func (c *AdminUserClient) MapCreateBulk(slice any, setFunc func(*AdminUserCreate, int)) *AdminUserCreateBulk

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

func (c *AdminUserClient) Query() *AdminUserQuery

Query returns a query builder for AdminUser.

func (*AdminUserClient) QueryAdminCreatedBy

func (c *AdminUserClient) QueryAdminCreatedBy(au *AdminUser) *AdminUserQuery

QueryAdminCreatedBy queries the admin_created_by edge of a AdminUser.

func (*AdminUserClient) QueryAdminUpdatedBy

func (c *AdminUserClient) QueryAdminUpdatedBy(au *AdminUser) *AdminUserQuery

QueryAdminUpdatedBy queries the admin_updated_by edge of a AdminUser.

func (*AdminUserClient) QueryContext

func (c *AdminUserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserClient) QueryDefaultRole

func (c *AdminUserClient) QueryDefaultRole(au *AdminUser) *RoleQuery

QueryDefaultRole queries the default_role edge of a AdminUser.

func (*AdminUserClient) QueryRefAdminCreatedBy

func (c *AdminUserClient) QueryRefAdminCreatedBy(au *AdminUser) *AdminUserQuery

QueryRefAdminCreatedBy queries the ref_admin_created_by edge of a AdminUser.

func (*AdminUserClient) QueryRefAdminUpdatedBy

func (c *AdminUserClient) QueryRefAdminUpdatedBy(au *AdminUser) *AdminUserQuery

QueryRefAdminUpdatedBy queries the ref_admin_updated_by edge of a AdminUser.

func (*AdminUserClient) QueryRoles

func (c *AdminUserClient) QueryRoles(au *AdminUser) *RoleQuery

QueryRoles queries the roles edge of a AdminUser.

func (*AdminUserClient) Update

func (c *AdminUserClient) Update() *AdminUserUpdate

Update returns an update builder for AdminUser.

func (*AdminUserClient) UpdateOne

func (c *AdminUserClient) UpdateOne(au *AdminUser) *AdminUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AdminUserClient) UpdateOneID

func (c *AdminUserClient) UpdateOneID(id string) *AdminUserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AdminUserClient) Use

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

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

type AdminUserConnection

type AdminUserConnection struct {
	Edges      []*AdminUserEdge `json:"edges"`
	PageInfo   PageInfo         `json:"pageInfo"`
	TotalCount int              `json:"totalCount"`
}

AdminUserConnection is the connection containing edges to AdminUser.

type AdminUserCreate

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

AdminUserCreate is the builder for creating a AdminUser entity.

func (*AdminUserCreate) AddRefAdminCreatedBy

func (auc *AdminUserCreate) AddRefAdminCreatedBy(a ...*AdminUser) *AdminUserCreate

AddRefAdminCreatedBy adds the "ref_admin_created_by" edges to the AdminUser entity.

func (*AdminUserCreate) AddRefAdminCreatedByIDs

func (auc *AdminUserCreate) AddRefAdminCreatedByIDs(ids ...string) *AdminUserCreate

AddRefAdminCreatedByIDs adds the "ref_admin_created_by" edge to the AdminUser entity by IDs.

func (*AdminUserCreate) AddRefAdminUpdatedBy

func (auc *AdminUserCreate) AddRefAdminUpdatedBy(a ...*AdminUser) *AdminUserCreate

AddRefAdminUpdatedBy adds the "ref_admin_updated_by" edges to the AdminUser entity.

func (*AdminUserCreate) AddRefAdminUpdatedByIDs

func (auc *AdminUserCreate) AddRefAdminUpdatedByIDs(ids ...string) *AdminUserCreate

AddRefAdminUpdatedByIDs adds the "ref_admin_updated_by" edge to the AdminUser entity by IDs.

func (*AdminUserCreate) AddRoleIDs

func (auc *AdminUserCreate) AddRoleIDs(ids ...string) *AdminUserCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*AdminUserCreate) AddRoles

func (auc *AdminUserCreate) AddRoles(r ...*Role) *AdminUserCreate

AddRoles adds the "roles" edges to the Role entity.

func (*AdminUserCreate) Exec

func (auc *AdminUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUserCreate) ExecContext

func (c *AdminUserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserCreate) ExecX

func (auc *AdminUserCreate) ExecX(ctx context.Context)

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

func (*AdminUserCreate) Mutation

func (auc *AdminUserCreate) Mutation() *AdminUserMutation

Mutation returns the AdminUserMutation object of the builder.

func (*AdminUserCreate) OnConflict

func (auc *AdminUserCreate) OnConflict(opts ...sql.ConflictOption) *AdminUserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.AdminUser.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AdminUserUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*AdminUserCreate) OnConflictColumns

func (auc *AdminUserCreate) OnConflictColumns(columns ...string) *AdminUserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.AdminUser.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*AdminUserCreate) QueryContext

func (c *AdminUserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserCreate) Save

func (auc *AdminUserCreate) Save(ctx context.Context) (*AdminUser, error)

Save creates the AdminUser in the database.

func (*AdminUserCreate) SaveX

func (auc *AdminUserCreate) SaveX(ctx context.Context) *AdminUser

SaveX calls Save and panics if Save returns an error.

func (*AdminUserCreate) SetAdminCreatedBy

func (auc *AdminUserCreate) SetAdminCreatedBy(a *AdminUser) *AdminUserCreate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*AdminUserCreate) SetAdminCreatedByID

func (auc *AdminUserCreate) SetAdminCreatedByID(id string) *AdminUserCreate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*AdminUserCreate) SetAdminUpdatedBy

func (auc *AdminUserCreate) SetAdminUpdatedBy(a *AdminUser) *AdminUserCreate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*AdminUserCreate) SetAdminUpdatedByID

func (auc *AdminUserCreate) SetAdminUpdatedByID(id string) *AdminUserCreate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*AdminUserCreate) SetCreatedAt

func (auc *AdminUserCreate) SetCreatedAt(t time.Time) *AdminUserCreate

SetCreatedAt sets the "created_at" field.

func (*AdminUserCreate) SetDefaultRole

func (auc *AdminUserCreate) SetDefaultRole(r *Role) *AdminUserCreate

SetDefaultRole sets the "default_role" edge to the Role entity.

func (*AdminUserCreate) SetDefaultRoleID

func (auc *AdminUserCreate) SetDefaultRoleID(id string) *AdminUserCreate

SetDefaultRoleID sets the "default_role" edge to the Role entity by ID.

func (*AdminUserCreate) SetEmail

func (auc *AdminUserCreate) SetEmail(s string) *AdminUserCreate

SetEmail sets the "email" field.

func (*AdminUserCreate) SetFirstName

func (auc *AdminUserCreate) SetFirstName(s string) *AdminUserCreate

SetFirstName sets the "first_name" field.

func (*AdminUserCreate) SetID

func (auc *AdminUserCreate) SetID(s string) *AdminUserCreate

SetID sets the "id" field.

func (*AdminUserCreate) SetInput

SetInput applies the change-set in the CreateAdminUserInput on the AdminUserCreate builder.

func (*AdminUserCreate) SetLastName

func (auc *AdminUserCreate) SetLastName(s string) *AdminUserCreate

SetLastName sets the "last_name" field.

func (*AdminUserCreate) SetName

func (auc *AdminUserCreate) SetName(s string) *AdminUserCreate

SetName sets the "name" field.

func (*AdminUserCreate) SetNillableAdminCreatedByID

func (auc *AdminUserCreate) SetNillableAdminCreatedByID(id *string) *AdminUserCreate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*AdminUserCreate) SetNillableAdminUpdatedByID

func (auc *AdminUserCreate) SetNillableAdminUpdatedByID(id *string) *AdminUserCreate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*AdminUserCreate) SetNillableCreatedAt

func (auc *AdminUserCreate) SetNillableCreatedAt(t *time.Time) *AdminUserCreate

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

func (*AdminUserCreate) SetNillableDefaultRoleID

func (auc *AdminUserCreate) SetNillableDefaultRoleID(id *string) *AdminUserCreate

SetNillableDefaultRoleID sets the "default_role" edge to the Role entity by ID if the given value is not nil.

func (*AdminUserCreate) SetNillableID

func (auc *AdminUserCreate) SetNillableID(s *string) *AdminUserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AdminUserCreate) SetNillableName

func (auc *AdminUserCreate) SetNillableName(s *string) *AdminUserCreate

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

func (*AdminUserCreate) SetNillableUpdatedAt

func (auc *AdminUserCreate) SetNillableUpdatedAt(t *time.Time) *AdminUserCreate

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

func (*AdminUserCreate) SetPassword

func (auc *AdminUserCreate) SetPassword(s string) *AdminUserCreate

SetPassword sets the "password" field.

func (*AdminUserCreate) SetUpdatedAt

func (auc *AdminUserCreate) SetUpdatedAt(t time.Time) *AdminUserCreate

SetUpdatedAt sets the "updated_at" field.

type AdminUserCreateBulk

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

AdminUserCreateBulk is the builder for creating many AdminUser entities in bulk.

func (*AdminUserCreateBulk) Exec

func (aucb *AdminUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUserCreateBulk) ExecContext

func (c *AdminUserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserCreateBulk) ExecX

func (aucb *AdminUserCreateBulk) ExecX(ctx context.Context)

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

func (*AdminUserCreateBulk) OnConflict

func (aucb *AdminUserCreateBulk) OnConflict(opts ...sql.ConflictOption) *AdminUserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.AdminUser.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.AdminUserUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*AdminUserCreateBulk) OnConflictColumns

func (aucb *AdminUserCreateBulk) OnConflictColumns(columns ...string) *AdminUserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.AdminUser.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*AdminUserCreateBulk) QueryContext

func (c *AdminUserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserCreateBulk) Save

func (aucb *AdminUserCreateBulk) Save(ctx context.Context) ([]*AdminUser, error)

Save creates the AdminUser entities in the database.

func (*AdminUserCreateBulk) SaveX

func (aucb *AdminUserCreateBulk) SaveX(ctx context.Context) []*AdminUser

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

type AdminUserDelete

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

AdminUserDelete is the builder for deleting a AdminUser entity.

func (*AdminUserDelete) Exec

func (aud *AdminUserDelete) Exec(ctx context.Context) (int, error)

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

func (*AdminUserDelete) ExecContext

func (c *AdminUserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserDelete) ExecX

func (aud *AdminUserDelete) ExecX(ctx context.Context) int

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

func (*AdminUserDelete) QueryContext

func (c *AdminUserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserDelete) Where

Where appends a list predicates to the AdminUserDelete builder.

type AdminUserDeleteOne

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

AdminUserDeleteOne is the builder for deleting a single AdminUser entity.

func (*AdminUserDeleteOne) Exec

func (audo *AdminUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AdminUserDeleteOne) ExecX

func (audo *AdminUserDeleteOne) ExecX(ctx context.Context)

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

func (*AdminUserDeleteOne) Where

Where appends a list predicates to the AdminUserDelete builder.

type AdminUserEdge

type AdminUserEdge struct {
	Node   *AdminUser `json:"node"`
	Cursor Cursor     `json:"cursor"`
}

AdminUserEdge is the edge representation of AdminUser.

type AdminUserEdges

type AdminUserEdges struct {
	// RefAdminCreatedBy holds the value of the ref_admin_created_by edge.
	RefAdminCreatedBy []*AdminUser `json:"ref_admin_created_by,omitempty"`
	// AdminCreatedBy holds the value of the admin_created_by edge.
	AdminCreatedBy *AdminUser `json:"admin_created_by,omitempty"`
	// RefAdminUpdatedBy holds the value of the ref_admin_updated_by edge.
	RefAdminUpdatedBy []*AdminUser `json:"ref_admin_updated_by,omitempty"`
	// AdminUpdatedBy holds the value of the admin_updated_by edge.
	AdminUpdatedBy *AdminUser `json:"admin_updated_by,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// DefaultRole holds the value of the default_role edge.
	DefaultRole *Role `json:"default_role,omitempty"`
	// contains filtered or unexported fields
}

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

func (AdminUserEdges) AdminCreatedByOrErr

func (e AdminUserEdges) AdminCreatedByOrErr() (*AdminUser, error)

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

func (AdminUserEdges) AdminUpdatedByOrErr

func (e AdminUserEdges) AdminUpdatedByOrErr() (*AdminUser, error)

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

func (AdminUserEdges) DefaultRoleOrErr

func (e AdminUserEdges) DefaultRoleOrErr() (*Role, error)

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

func (AdminUserEdges) RefAdminCreatedByOrErr

func (e AdminUserEdges) RefAdminCreatedByOrErr() ([]*AdminUser, error)

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

func (AdminUserEdges) RefAdminUpdatedByOrErr

func (e AdminUserEdges) RefAdminUpdatedByOrErr() ([]*AdminUser, error)

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

func (AdminUserEdges) RolesOrErr

func (e AdminUserEdges) RolesOrErr() ([]*Role, error)

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

type AdminUserGroupBy

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

AdminUserGroupBy is the group-by builder for AdminUser entities.

func (*AdminUserGroupBy) Aggregate

func (augb *AdminUserGroupBy) Aggregate(fns ...AggregateFunc) *AdminUserGroupBy

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

func (*AdminUserGroupBy) Bool

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

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

func (*AdminUserGroupBy) BoolX

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

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

func (*AdminUserGroupBy) Bools

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

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

func (*AdminUserGroupBy) BoolsX

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

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

func (*AdminUserGroupBy) Float64

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

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

func (*AdminUserGroupBy) Float64X

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

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

func (*AdminUserGroupBy) Float64s

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

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

func (*AdminUserGroupBy) Float64sX

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

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

func (*AdminUserGroupBy) Int

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

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

func (*AdminUserGroupBy) IntX

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

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

func (*AdminUserGroupBy) Ints

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

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

func (*AdminUserGroupBy) IntsX

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

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

func (*AdminUserGroupBy) Scan

func (augb *AdminUserGroupBy) Scan(ctx context.Context, v any) error

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

func (*AdminUserGroupBy) ScanX

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

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

func (*AdminUserGroupBy) String

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

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

func (*AdminUserGroupBy) StringX

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

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

func (*AdminUserGroupBy) Strings

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

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

func (*AdminUserGroupBy) StringsX

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

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

type AdminUserMutation

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

AdminUserMutation represents an operation that mutates the AdminUser nodes in the graph.

func (*AdminUserMutation) AddEdges

func (m *AdminUserMutation) AddEdges(name string, values []string) error

AddEdges sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*AdminUserMutation) AddField

func (m *AdminUserMutation) 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 (*AdminUserMutation) AddRefAdminCreatedByIDs

func (m *AdminUserMutation) AddRefAdminCreatedByIDs(ids ...string)

AddRefAdminCreatedByIDs adds the "ref_admin_created_by" edge to the AdminUser entity by ids.

func (*AdminUserMutation) AddRefAdminUpdatedByIDs

func (m *AdminUserMutation) AddRefAdminUpdatedByIDs(ids ...string)

AddRefAdminUpdatedByIDs adds the "ref_admin_updated_by" edge to the AdminUser entity by ids.

func (*AdminUserMutation) AddRoleIDs

func (m *AdminUserMutation) AddRoleIDs(ids ...string)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*AdminUserMutation) AddedEdges

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

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

func (*AdminUserMutation) AddedField

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

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

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

func (*AdminUserMutation) AddedIDs

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

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

func (*AdminUserMutation) AdminCreatedByCleared

func (m *AdminUserMutation) AdminCreatedByCleared() bool

AdminCreatedByCleared reports if the "admin_created_by" edge to the AdminUser entity was cleared.

func (*AdminUserMutation) AdminCreatedByID

func (m *AdminUserMutation) AdminCreatedByID() (id string, exists bool)

AdminCreatedByID returns the "admin_created_by" edge ID in the mutation.

func (*AdminUserMutation) AdminCreatedByIDs

func (m *AdminUserMutation) AdminCreatedByIDs() (ids []string)

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

func (*AdminUserMutation) AdminUpdatedByCleared

func (m *AdminUserMutation) AdminUpdatedByCleared() bool

AdminUpdatedByCleared reports if the "admin_updated_by" edge to the AdminUser entity was cleared.

func (*AdminUserMutation) AdminUpdatedByID

func (m *AdminUserMutation) AdminUpdatedByID() (id string, exists bool)

AdminUpdatedByID returns the "admin_updated_by" edge ID in the mutation.

func (*AdminUserMutation) AdminUpdatedByIDs

func (m *AdminUserMutation) AdminUpdatedByIDs() (ids []string)

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

func (*AdminUserMutation) ClearAdminCreatedBy

func (m *AdminUserMutation) ClearAdminCreatedBy()

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*AdminUserMutation) ClearAdminUpdatedBy

func (m *AdminUserMutation) ClearAdminUpdatedBy()

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*AdminUserMutation) ClearCreatedAt

func (m *AdminUserMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*AdminUserMutation) ClearDefaultRole

func (m *AdminUserMutation) ClearDefaultRole()

ClearDefaultRole clears the "default_role" edge to the Role entity.

func (*AdminUserMutation) ClearEdge

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

func (m *AdminUserMutation) 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 (*AdminUserMutation) ClearName

func (m *AdminUserMutation) ClearName()

ClearName clears the value of the "name" field.

func (*AdminUserMutation) ClearRefAdminCreatedBy

func (m *AdminUserMutation) ClearRefAdminCreatedBy()

ClearRefAdminCreatedBy clears the "ref_admin_created_by" edge to the AdminUser entity.

func (*AdminUserMutation) ClearRefAdminUpdatedBy

func (m *AdminUserMutation) ClearRefAdminUpdatedBy()

ClearRefAdminUpdatedBy clears the "ref_admin_updated_by" edge to the AdminUser entity.

func (*AdminUserMutation) ClearRoles

func (m *AdminUserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*AdminUserMutation) ClearUpdatedAt

func (m *AdminUserMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AdminUserMutation) ClearedEdges

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

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

func (*AdminUserMutation) ClearedFields

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

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

func (AdminUserMutation) Client

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

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

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

func (*AdminUserMutation) CreatedAtCleared

func (m *AdminUserMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*AdminUserMutation) DefaultRoleCleared

func (m *AdminUserMutation) DefaultRoleCleared() bool

DefaultRoleCleared reports if the "default_role" edge to the Role entity was cleared.

func (*AdminUserMutation) DefaultRoleID

func (m *AdminUserMutation) DefaultRoleID() (id string, exists bool)

DefaultRoleID returns the "default_role" edge ID in the mutation.

func (*AdminUserMutation) DefaultRoleIDs

func (m *AdminUserMutation) DefaultRoleIDs() (ids []string)

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

func (*AdminUserMutation) EdgeCleared

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

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

func (*AdminUserMutation) Email

func (m *AdminUserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*AdminUserMutation) ExecContext

func (c *AdminUserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserMutation) Field

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

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

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

func (*AdminUserMutation) Fields

func (m *AdminUserMutation) 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 (*AdminUserMutation) FirstName

func (m *AdminUserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*AdminUserMutation) ID

func (m *AdminUserMutation) ID() (id string, 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 (*AdminUserMutation) IDs

func (m *AdminUserMutation) IDs(ctx context.Context) ([]string, 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 (*AdminUserMutation) LastName

func (m *AdminUserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*AdminUserMutation) Name

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

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

func (*AdminUserMutation) NameCleared

func (m *AdminUserMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*AdminUserMutation) OldCreatedAt

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

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

func (*AdminUserMutation) OldEmail

func (m *AdminUserMutation) OldEmail(ctx context.Context) (v string, err error)

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

func (*AdminUserMutation) OldField

func (m *AdminUserMutation) 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 (*AdminUserMutation) OldFirstName

func (m *AdminUserMutation) OldFirstName(ctx context.Context) (v string, err error)

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

func (*AdminUserMutation) OldLastName

func (m *AdminUserMutation) OldLastName(ctx context.Context) (v string, err error)

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

func (*AdminUserMutation) OldName

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

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

func (*AdminUserMutation) OldPassword

func (m *AdminUserMutation) OldPassword(ctx context.Context) (v string, err error)

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

func (*AdminUserMutation) OldUpdatedAt

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

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

func (*AdminUserMutation) Op

func (m *AdminUserMutation) Op() Op

Op returns the operation name.

func (*AdminUserMutation) Password

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

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

func (*AdminUserMutation) QueryContext

func (c *AdminUserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserMutation) RefAdminCreatedByCleared

func (m *AdminUserMutation) RefAdminCreatedByCleared() bool

RefAdminCreatedByCleared reports if the "ref_admin_created_by" edge to the AdminUser entity was cleared.

func (*AdminUserMutation) RefAdminCreatedByIDs

func (m *AdminUserMutation) RefAdminCreatedByIDs() (ids []string)

RefAdminCreatedByIDs returns the "ref_admin_created_by" edge IDs in the mutation.

func (*AdminUserMutation) RefAdminUpdatedByCleared

func (m *AdminUserMutation) RefAdminUpdatedByCleared() bool

RefAdminUpdatedByCleared reports if the "ref_admin_updated_by" edge to the AdminUser entity was cleared.

func (*AdminUserMutation) RefAdminUpdatedByIDs

func (m *AdminUserMutation) RefAdminUpdatedByIDs() (ids []string)

RefAdminUpdatedByIDs returns the "ref_admin_updated_by" edge IDs in the mutation.

func (*AdminUserMutation) RemoveRefAdminCreatedByIDs

func (m *AdminUserMutation) RemoveRefAdminCreatedByIDs(ids ...string)

RemoveRefAdminCreatedByIDs removes the "ref_admin_created_by" edge to the AdminUser entity by IDs.

func (*AdminUserMutation) RemoveRefAdminUpdatedByIDs

func (m *AdminUserMutation) RemoveRefAdminUpdatedByIDs(ids ...string)

RemoveRefAdminUpdatedByIDs removes the "ref_admin_updated_by" edge to the AdminUser entity by IDs.

func (*AdminUserMutation) RemoveRoleIDs

func (m *AdminUserMutation) RemoveRoleIDs(ids ...string)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (*AdminUserMutation) RemovedEdges

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

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

func (*AdminUserMutation) RemovedIDs

func (m *AdminUserMutation) 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 (*AdminUserMutation) RemovedRefAdminCreatedByIDs

func (m *AdminUserMutation) RemovedRefAdminCreatedByIDs() (ids []string)

RemovedRefAdminCreatedBy returns the removed IDs of the "ref_admin_created_by" edge to the AdminUser entity.

func (*AdminUserMutation) RemovedRefAdminUpdatedByIDs

func (m *AdminUserMutation) RemovedRefAdminUpdatedByIDs() (ids []string)

RemovedRefAdminUpdatedBy returns the removed IDs of the "ref_admin_updated_by" edge to the AdminUser entity.

func (*AdminUserMutation) RemovedRolesIDs

func (m *AdminUserMutation) RemovedRolesIDs() (ids []string)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*AdminUserMutation) ResetAdminCreatedBy

func (m *AdminUserMutation) ResetAdminCreatedBy()

ResetAdminCreatedBy resets all changes to the "admin_created_by" edge.

func (*AdminUserMutation) ResetAdminUpdatedBy

func (m *AdminUserMutation) ResetAdminUpdatedBy()

ResetAdminUpdatedBy resets all changes to the "admin_updated_by" edge.

func (*AdminUserMutation) ResetCreatedAt

func (m *AdminUserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AdminUserMutation) ResetDefaultRole

func (m *AdminUserMutation) ResetDefaultRole()

ResetDefaultRole resets all changes to the "default_role" edge.

func (*AdminUserMutation) ResetEdge

func (m *AdminUserMutation) 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 (*AdminUserMutation) ResetEmail

func (m *AdminUserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*AdminUserMutation) ResetField

func (m *AdminUserMutation) 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 (*AdminUserMutation) ResetFirstName

func (m *AdminUserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*AdminUserMutation) ResetLastName

func (m *AdminUserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*AdminUserMutation) ResetName

func (m *AdminUserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AdminUserMutation) ResetPassword

func (m *AdminUserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*AdminUserMutation) ResetRefAdminCreatedBy

func (m *AdminUserMutation) ResetRefAdminCreatedBy()

ResetRefAdminCreatedBy resets all changes to the "ref_admin_created_by" edge.

func (*AdminUserMutation) ResetRefAdminUpdatedBy

func (m *AdminUserMutation) ResetRefAdminUpdatedBy()

ResetRefAdminUpdatedBy resets all changes to the "ref_admin_updated_by" edge.

func (*AdminUserMutation) ResetRoles

func (m *AdminUserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*AdminUserMutation) ResetUpdatedAt

func (m *AdminUserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AdminUserMutation) RolesCleared

func (m *AdminUserMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (*AdminUserMutation) RolesIDs

func (m *AdminUserMutation) RolesIDs() (ids []string)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*AdminUserMutation) SetAdminCreatedByID

func (m *AdminUserMutation) SetAdminCreatedByID(id string)

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by id.

func (*AdminUserMutation) SetAdminUpdatedByID

func (m *AdminUserMutation) SetAdminUpdatedByID(id string)

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by id.

func (*AdminUserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AdminUserMutation) SetDefaultRoleID

func (m *AdminUserMutation) SetDefaultRoleID(id string)

SetDefaultRoleID sets the "default_role" edge to the Role entity by id.

func (*AdminUserMutation) SetEdge

func (m *AdminUserMutation) SetEdge(name, value string) error

SetEdge sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*AdminUserMutation) SetEmail

func (m *AdminUserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*AdminUserMutation) SetField

func (m *AdminUserMutation) 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 (*AdminUserMutation) SetFirstName

func (m *AdminUserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*AdminUserMutation) SetID

func (m *AdminUserMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of AdminUser entities.

func (*AdminUserMutation) SetLastName

func (m *AdminUserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*AdminUserMutation) SetName

func (m *AdminUserMutation) SetName(s string)

SetName sets the "name" field.

func (*AdminUserMutation) SetOp

func (m *AdminUserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AdminUserMutation) SetPassword

func (m *AdminUserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*AdminUserMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (AdminUserMutation) Tx

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

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

func (*AdminUserMutation) Type

func (m *AdminUserMutation) Type() string

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

func (*AdminUserMutation) UpdatedAt

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

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

func (*AdminUserMutation) UpdatedAtCleared

func (m *AdminUserMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*AdminUserMutation) UpdatedFields

func (m *AdminUserMutation) UpdatedFields() map[string]Value

UpdatedFields returns all fields and edges that were changed during this mutation.

func (*AdminUserMutation) Where

func (m *AdminUserMutation) Where(ps ...predicate.AdminUser)

Where appends a list predicates to the AdminUserMutation builder.

func (*AdminUserMutation) WhereP

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

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

type AdminUserOrder

type AdminUserOrder struct {
	Direction OrderDirection       `json:"direction"`
	Field     *AdminUserOrderField `json:"field"`
}

AdminUserOrder defines the ordering of AdminUser.

type AdminUserOrderField

type AdminUserOrderField struct {
	// Value extracts the ordering value from the given AdminUser.
	Value func(*AdminUser) (ent.Value, error)
	// contains filtered or unexported fields
}

AdminUserOrderField defines the ordering field of AdminUser.

func (AdminUserOrderField) MarshalGQL

func (f AdminUserOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (AdminUserOrderField) String

func (f AdminUserOrderField) String() string

String implement fmt.Stringer interface.

func (*AdminUserOrderField) UnmarshalGQL

func (f *AdminUserOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type AdminUserPaginateOption

type AdminUserPaginateOption func(*adminuserPager) error

AdminUserPaginateOption enables pagination customization.

func WithAdminUserFilter

func WithAdminUserFilter(filter func(*AdminUserQuery) (*AdminUserQuery, error)) AdminUserPaginateOption

WithAdminUserFilter configures pagination filter.

func WithAdminUserOrder

func WithAdminUserOrder(order []*AdminUserOrder) AdminUserPaginateOption

WithAdminUserOrder configures pagination ordering.

type AdminUserQuery

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

AdminUserQuery is the builder for querying AdminUser entities.

func (*AdminUserQuery) Aggregate

func (auq *AdminUserQuery) Aggregate(fns ...AggregateFunc) *AdminUserSelect

Aggregate returns a AdminUserSelect configured with the given aggregations.

func (*AdminUserQuery) All

func (auq *AdminUserQuery) All(ctx context.Context) ([]*AdminUser, error)

All executes the query and returns a list of AdminUsers.

func (*AdminUserQuery) AllX

func (auq *AdminUserQuery) AllX(ctx context.Context) []*AdminUser

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

func (*AdminUserQuery) Clone

func (auq *AdminUserQuery) Clone() *AdminUserQuery

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

func (*AdminUserQuery) CollectFields

func (au *AdminUserQuery) CollectFields(ctx context.Context, satisfies ...string) (*AdminUserQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*AdminUserQuery) Count

func (auq *AdminUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AdminUserQuery) CountX

func (auq *AdminUserQuery) CountX(ctx context.Context) int

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

func (*AdminUserQuery) ExecContext

func (c *AdminUserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserQuery) Exist

func (auq *AdminUserQuery) Exist(ctx context.Context) (bool, error)

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

func (*AdminUserQuery) ExistX

func (auq *AdminUserQuery) ExistX(ctx context.Context) bool

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

func (*AdminUserQuery) First

func (auq *AdminUserQuery) First(ctx context.Context) (*AdminUser, error)

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

func (*AdminUserQuery) FirstID

func (auq *AdminUserQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*AdminUserQuery) FirstIDX

func (auq *AdminUserQuery) FirstIDX(ctx context.Context) string

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

func (*AdminUserQuery) FirstX

func (auq *AdminUserQuery) FirstX(ctx context.Context) *AdminUser

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

func (*AdminUserQuery) GroupBy

func (auq *AdminUserQuery) GroupBy(field string, fields ...string) *AdminUserGroupBy

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

Example:

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

client.AdminUser.Query().
	GroupBy(adminuser.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AdminUserQuery) IDs

func (auq *AdminUserQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*AdminUserQuery) IDsX

func (auq *AdminUserQuery) IDsX(ctx context.Context) []string

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

func (*AdminUserQuery) Limit

func (auq *AdminUserQuery) Limit(limit int) *AdminUserQuery

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

func (*AdminUserQuery) Offset

func (auq *AdminUserQuery) Offset(offset int) *AdminUserQuery

Offset to start from.

func (*AdminUserQuery) Only

func (auq *AdminUserQuery) Only(ctx context.Context) (*AdminUser, error)

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

func (*AdminUserQuery) OnlyID

func (auq *AdminUserQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*AdminUserQuery) OnlyIDX

func (auq *AdminUserQuery) OnlyIDX(ctx context.Context) string

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

func (*AdminUserQuery) OnlyX

func (auq *AdminUserQuery) OnlyX(ctx context.Context) *AdminUser

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

func (*AdminUserQuery) Order

Order specifies how the records should be ordered.

func (*AdminUserQuery) Paginate

func (au *AdminUserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...AdminUserPaginateOption,
) (*AdminUserConnection, error)

Paginate executes the query and returns a relay based cursor connection to AdminUser.

func (*AdminUserQuery) QueryAdminCreatedBy

func (auq *AdminUserQuery) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy chains the current query on the "admin_created_by" edge.

func (*AdminUserQuery) QueryAdminUpdatedBy

func (auq *AdminUserQuery) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy chains the current query on the "admin_updated_by" edge.

func (*AdminUserQuery) QueryContext

func (c *AdminUserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserQuery) QueryDefaultRole

func (auq *AdminUserQuery) QueryDefaultRole() *RoleQuery

QueryDefaultRole chains the current query on the "default_role" edge.

func (*AdminUserQuery) QueryRefAdminCreatedBy

func (auq *AdminUserQuery) QueryRefAdminCreatedBy() *AdminUserQuery

QueryRefAdminCreatedBy chains the current query on the "ref_admin_created_by" edge.

func (*AdminUserQuery) QueryRefAdminUpdatedBy

func (auq *AdminUserQuery) QueryRefAdminUpdatedBy() *AdminUserQuery

QueryRefAdminUpdatedBy chains the current query on the "ref_admin_updated_by" edge.

func (*AdminUserQuery) QueryRoles

func (auq *AdminUserQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*AdminUserQuery) Select

func (auq *AdminUserQuery) Select(fields ...string) *AdminUserSelect

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

Example:

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

client.AdminUser.Query().
	Select(adminuser.FieldName).
	Scan(ctx, &v)

func (*AdminUserQuery) Unique

func (auq *AdminUserQuery) Unique(unique bool) *AdminUserQuery

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

func (auq *AdminUserQuery) Where(ps ...predicate.AdminUser) *AdminUserQuery

Where adds a new predicate for the AdminUserQuery builder.

func (*AdminUserQuery) WhereAdminCreatedBy

func (au *AdminUserQuery) WhereAdminCreatedBy(adminUserID string) *AdminUserQuery

WhereAdminCreatedBy adds a filter based on the AdminCreatedBy relationship. This method allows owner-based permission filtering by admin user ID.

func (*AdminUserQuery) WithAdminCreatedBy

func (auq *AdminUserQuery) WithAdminCreatedBy(opts ...func(*AdminUserQuery)) *AdminUserQuery

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

func (*AdminUserQuery) WithAdminUpdatedBy

func (auq *AdminUserQuery) WithAdminUpdatedBy(opts ...func(*AdminUserQuery)) *AdminUserQuery

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

func (*AdminUserQuery) WithDefaultRole

func (auq *AdminUserQuery) WithDefaultRole(opts ...func(*RoleQuery)) *AdminUserQuery

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

func (*AdminUserQuery) WithNamedRefAdminCreatedBy

func (auq *AdminUserQuery) WithNamedRefAdminCreatedBy(name string, opts ...func(*AdminUserQuery)) *AdminUserQuery

WithNamedRefAdminCreatedBy tells the query-builder to eager-load the nodes that are connected to the "ref_admin_created_by" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AdminUserQuery) WithNamedRefAdminUpdatedBy

func (auq *AdminUserQuery) WithNamedRefAdminUpdatedBy(name string, opts ...func(*AdminUserQuery)) *AdminUserQuery

WithNamedRefAdminUpdatedBy tells the query-builder to eager-load the nodes that are connected to the "ref_admin_updated_by" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AdminUserQuery) WithNamedRoles

func (auq *AdminUserQuery) WithNamedRoles(name string, opts ...func(*RoleQuery)) *AdminUserQuery

WithNamedRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*AdminUserQuery) WithRefAdminCreatedBy

func (auq *AdminUserQuery) WithRefAdminCreatedBy(opts ...func(*AdminUserQuery)) *AdminUserQuery

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

func (*AdminUserQuery) WithRefAdminUpdatedBy

func (auq *AdminUserQuery) WithRefAdminUpdatedBy(opts ...func(*AdminUserQuery)) *AdminUserQuery

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

func (*AdminUserQuery) WithRoles

func (auq *AdminUserQuery) WithRoles(opts ...func(*RoleQuery)) *AdminUserQuery

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

type AdminUserSelect

type AdminUserSelect struct {
	*AdminUserQuery
	// contains filtered or unexported fields
}

AdminUserSelect is the builder for selecting fields of AdminUser entities.

func (*AdminUserSelect) Aggregate

func (aus *AdminUserSelect) Aggregate(fns ...AggregateFunc) *AdminUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AdminUserSelect) Bool

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

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

func (*AdminUserSelect) BoolX

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

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

func (*AdminUserSelect) Bools

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

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

func (*AdminUserSelect) BoolsX

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

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

func (AdminUserSelect) ExecContext

func (c AdminUserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserSelect) Float64

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

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

func (*AdminUserSelect) Float64X

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

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

func (*AdminUserSelect) Float64s

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

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

func (*AdminUserSelect) Float64sX

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

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

func (*AdminUserSelect) Int

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

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

func (*AdminUserSelect) IntX

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

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

func (*AdminUserSelect) Ints

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

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

func (*AdminUserSelect) IntsX

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

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

func (AdminUserSelect) QueryContext

func (c AdminUserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserSelect) Scan

func (aus *AdminUserSelect) Scan(ctx context.Context, v any) error

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

func (*AdminUserSelect) ScanX

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

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

func (*AdminUserSelect) String

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

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

func (*AdminUserSelect) StringX

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

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

func (*AdminUserSelect) Strings

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

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

func (*AdminUserSelect) StringsX

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

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

type AdminUserUpdate

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

AdminUserUpdate is the builder for updating AdminUser entities.

func (*AdminUserUpdate) AddRefAdminCreatedBy

func (auu *AdminUserUpdate) AddRefAdminCreatedBy(a ...*AdminUser) *AdminUserUpdate

AddRefAdminCreatedBy adds the "ref_admin_created_by" edges to the AdminUser entity.

func (*AdminUserUpdate) AddRefAdminCreatedByIDs

func (auu *AdminUserUpdate) AddRefAdminCreatedByIDs(ids ...string) *AdminUserUpdate

AddRefAdminCreatedByIDs adds the "ref_admin_created_by" edge to the AdminUser entity by IDs.

func (*AdminUserUpdate) AddRefAdminUpdatedBy

func (auu *AdminUserUpdate) AddRefAdminUpdatedBy(a ...*AdminUser) *AdminUserUpdate

AddRefAdminUpdatedBy adds the "ref_admin_updated_by" edges to the AdminUser entity.

func (*AdminUserUpdate) AddRefAdminUpdatedByIDs

func (auu *AdminUserUpdate) AddRefAdminUpdatedByIDs(ids ...string) *AdminUserUpdate

AddRefAdminUpdatedByIDs adds the "ref_admin_updated_by" edge to the AdminUser entity by IDs.

func (*AdminUserUpdate) AddRoleIDs

func (auu *AdminUserUpdate) AddRoleIDs(ids ...string) *AdminUserUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*AdminUserUpdate) AddRoles

func (auu *AdminUserUpdate) AddRoles(r ...*Role) *AdminUserUpdate

AddRoles adds the "roles" edges to the Role entity.

func (*AdminUserUpdate) ClearAdminCreatedBy

func (auu *AdminUserUpdate) ClearAdminCreatedBy() *AdminUserUpdate

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*AdminUserUpdate) ClearAdminUpdatedBy

func (auu *AdminUserUpdate) ClearAdminUpdatedBy() *AdminUserUpdate

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*AdminUserUpdate) ClearDefaultRole

func (auu *AdminUserUpdate) ClearDefaultRole() *AdminUserUpdate

ClearDefaultRole clears the "default_role" edge to the Role entity.

func (*AdminUserUpdate) ClearName

func (auu *AdminUserUpdate) ClearName() *AdminUserUpdate

ClearName clears the value of the "name" field.

func (*AdminUserUpdate) ClearRefAdminCreatedBy

func (auu *AdminUserUpdate) ClearRefAdminCreatedBy() *AdminUserUpdate

ClearRefAdminCreatedBy clears all "ref_admin_created_by" edges to the AdminUser entity.

func (*AdminUserUpdate) ClearRefAdminUpdatedBy

func (auu *AdminUserUpdate) ClearRefAdminUpdatedBy() *AdminUserUpdate

ClearRefAdminUpdatedBy clears all "ref_admin_updated_by" edges to the AdminUser entity.

func (*AdminUserUpdate) ClearRoles

func (auu *AdminUserUpdate) ClearRoles() *AdminUserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*AdminUserUpdate) ClearUpdatedAt

func (auu *AdminUserUpdate) ClearUpdatedAt() *AdminUserUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AdminUserUpdate) Exec

func (auu *AdminUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUserUpdate) ExecContext

func (c *AdminUserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserUpdate) ExecX

func (auu *AdminUserUpdate) ExecX(ctx context.Context)

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

func (*AdminUserUpdate) Mutation

func (auu *AdminUserUpdate) Mutation() *AdminUserMutation

Mutation returns the AdminUserMutation object of the builder.

func (*AdminUserUpdate) QueryContext

func (c *AdminUserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserUpdate) RemoveRefAdminCreatedBy

func (auu *AdminUserUpdate) RemoveRefAdminCreatedBy(a ...*AdminUser) *AdminUserUpdate

RemoveRefAdminCreatedBy removes "ref_admin_created_by" edges to AdminUser entities.

func (*AdminUserUpdate) RemoveRefAdminCreatedByIDs

func (auu *AdminUserUpdate) RemoveRefAdminCreatedByIDs(ids ...string) *AdminUserUpdate

RemoveRefAdminCreatedByIDs removes the "ref_admin_created_by" edge to AdminUser entities by IDs.

func (*AdminUserUpdate) RemoveRefAdminUpdatedBy

func (auu *AdminUserUpdate) RemoveRefAdminUpdatedBy(a ...*AdminUser) *AdminUserUpdate

RemoveRefAdminUpdatedBy removes "ref_admin_updated_by" edges to AdminUser entities.

func (*AdminUserUpdate) RemoveRefAdminUpdatedByIDs

func (auu *AdminUserUpdate) RemoveRefAdminUpdatedByIDs(ids ...string) *AdminUserUpdate

RemoveRefAdminUpdatedByIDs removes the "ref_admin_updated_by" edge to AdminUser entities by IDs.

func (*AdminUserUpdate) RemoveRoleIDs

func (auu *AdminUserUpdate) RemoveRoleIDs(ids ...string) *AdminUserUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*AdminUserUpdate) RemoveRoles

func (auu *AdminUserUpdate) RemoveRoles(r ...*Role) *AdminUserUpdate

RemoveRoles removes "roles" edges to Role entities.

func (*AdminUserUpdate) Save

func (auu *AdminUserUpdate) Save(ctx context.Context) (int, error)

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

func (*AdminUserUpdate) SaveX

func (auu *AdminUserUpdate) SaveX(ctx context.Context) int

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

func (*AdminUserUpdate) SetAdminCreatedBy

func (auu *AdminUserUpdate) SetAdminCreatedBy(a *AdminUser) *AdminUserUpdate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*AdminUserUpdate) SetAdminCreatedByID

func (auu *AdminUserUpdate) SetAdminCreatedByID(id string) *AdminUserUpdate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*AdminUserUpdate) SetAdminUpdatedBy

func (auu *AdminUserUpdate) SetAdminUpdatedBy(a *AdminUser) *AdminUserUpdate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*AdminUserUpdate) SetAdminUpdatedByID

func (auu *AdminUserUpdate) SetAdminUpdatedByID(id string) *AdminUserUpdate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*AdminUserUpdate) SetDefaultRole

func (auu *AdminUserUpdate) SetDefaultRole(r *Role) *AdminUserUpdate

SetDefaultRole sets the "default_role" edge to the Role entity.

func (*AdminUserUpdate) SetDefaultRoleID

func (auu *AdminUserUpdate) SetDefaultRoleID(id string) *AdminUserUpdate

SetDefaultRoleID sets the "default_role" edge to the Role entity by ID.

func (*AdminUserUpdate) SetEmail

func (auu *AdminUserUpdate) SetEmail(s string) *AdminUserUpdate

SetEmail sets the "email" field.

func (*AdminUserUpdate) SetFirstName

func (auu *AdminUserUpdate) SetFirstName(s string) *AdminUserUpdate

SetFirstName sets the "first_name" field.

func (*AdminUserUpdate) SetInput

SetInput applies the change-set in the UpdateAdminUserInput on the AdminUserUpdate builder.

func (*AdminUserUpdate) SetLastName

func (auu *AdminUserUpdate) SetLastName(s string) *AdminUserUpdate

SetLastName sets the "last_name" field.

func (*AdminUserUpdate) SetName

func (auu *AdminUserUpdate) SetName(s string) *AdminUserUpdate

SetName sets the "name" field.

func (*AdminUserUpdate) SetNillableAdminCreatedByID

func (auu *AdminUserUpdate) SetNillableAdminCreatedByID(id *string) *AdminUserUpdate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*AdminUserUpdate) SetNillableAdminUpdatedByID

func (auu *AdminUserUpdate) SetNillableAdminUpdatedByID(id *string) *AdminUserUpdate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*AdminUserUpdate) SetNillableDefaultRoleID

func (auu *AdminUserUpdate) SetNillableDefaultRoleID(id *string) *AdminUserUpdate

SetNillableDefaultRoleID sets the "default_role" edge to the Role entity by ID if the given value is not nil.

func (*AdminUserUpdate) SetNillableEmail

func (auu *AdminUserUpdate) SetNillableEmail(s *string) *AdminUserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*AdminUserUpdate) SetNillableFirstName

func (auu *AdminUserUpdate) SetNillableFirstName(s *string) *AdminUserUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*AdminUserUpdate) SetNillableLastName

func (auu *AdminUserUpdate) SetNillableLastName(s *string) *AdminUserUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*AdminUserUpdate) SetNillableName

func (auu *AdminUserUpdate) SetNillableName(s *string) *AdminUserUpdate

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

func (*AdminUserUpdate) SetNillablePassword

func (auu *AdminUserUpdate) SetNillablePassword(s *string) *AdminUserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*AdminUserUpdate) SetPassword

func (auu *AdminUserUpdate) SetPassword(s string) *AdminUserUpdate

SetPassword sets the "password" field.

func (*AdminUserUpdate) SetUpdatedAt

func (auu *AdminUserUpdate) SetUpdatedAt(t time.Time) *AdminUserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AdminUserUpdate) Where

Where appends a list predicates to the AdminUserUpdate builder.

type AdminUserUpdateOne

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

AdminUserUpdateOne is the builder for updating a single AdminUser entity.

func (*AdminUserUpdateOne) AddRefAdminCreatedBy

func (auuo *AdminUserUpdateOne) AddRefAdminCreatedBy(a ...*AdminUser) *AdminUserUpdateOne

AddRefAdminCreatedBy adds the "ref_admin_created_by" edges to the AdminUser entity.

func (*AdminUserUpdateOne) AddRefAdminCreatedByIDs

func (auuo *AdminUserUpdateOne) AddRefAdminCreatedByIDs(ids ...string) *AdminUserUpdateOne

AddRefAdminCreatedByIDs adds the "ref_admin_created_by" edge to the AdminUser entity by IDs.

func (*AdminUserUpdateOne) AddRefAdminUpdatedBy

func (auuo *AdminUserUpdateOne) AddRefAdminUpdatedBy(a ...*AdminUser) *AdminUserUpdateOne

AddRefAdminUpdatedBy adds the "ref_admin_updated_by" edges to the AdminUser entity.

func (*AdminUserUpdateOne) AddRefAdminUpdatedByIDs

func (auuo *AdminUserUpdateOne) AddRefAdminUpdatedByIDs(ids ...string) *AdminUserUpdateOne

AddRefAdminUpdatedByIDs adds the "ref_admin_updated_by" edge to the AdminUser entity by IDs.

func (*AdminUserUpdateOne) AddRoleIDs

func (auuo *AdminUserUpdateOne) AddRoleIDs(ids ...string) *AdminUserUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*AdminUserUpdateOne) AddRoles

func (auuo *AdminUserUpdateOne) AddRoles(r ...*Role) *AdminUserUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (*AdminUserUpdateOne) ClearAdminCreatedBy

func (auuo *AdminUserUpdateOne) ClearAdminCreatedBy() *AdminUserUpdateOne

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*AdminUserUpdateOne) ClearAdminUpdatedBy

func (auuo *AdminUserUpdateOne) ClearAdminUpdatedBy() *AdminUserUpdateOne

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*AdminUserUpdateOne) ClearDefaultRole

func (auuo *AdminUserUpdateOne) ClearDefaultRole() *AdminUserUpdateOne

ClearDefaultRole clears the "default_role" edge to the Role entity.

func (*AdminUserUpdateOne) ClearName

func (auuo *AdminUserUpdateOne) ClearName() *AdminUserUpdateOne

ClearName clears the value of the "name" field.

func (*AdminUserUpdateOne) ClearRefAdminCreatedBy

func (auuo *AdminUserUpdateOne) ClearRefAdminCreatedBy() *AdminUserUpdateOne

ClearRefAdminCreatedBy clears all "ref_admin_created_by" edges to the AdminUser entity.

func (*AdminUserUpdateOne) ClearRefAdminUpdatedBy

func (auuo *AdminUserUpdateOne) ClearRefAdminUpdatedBy() *AdminUserUpdateOne

ClearRefAdminUpdatedBy clears all "ref_admin_updated_by" edges to the AdminUser entity.

func (*AdminUserUpdateOne) ClearRoles

func (auuo *AdminUserUpdateOne) ClearRoles() *AdminUserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*AdminUserUpdateOne) ClearUpdatedAt

func (auuo *AdminUserUpdateOne) ClearUpdatedAt() *AdminUserUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AdminUserUpdateOne) Exec

func (auuo *AdminUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AdminUserUpdateOne) ExecContext

func (c *AdminUserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*AdminUserUpdateOne) ExecX

func (auuo *AdminUserUpdateOne) ExecX(ctx context.Context)

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

func (*AdminUserUpdateOne) Mutation

func (auuo *AdminUserUpdateOne) Mutation() *AdminUserMutation

Mutation returns the AdminUserMutation object of the builder.

func (*AdminUserUpdateOne) QueryContext

func (c *AdminUserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*AdminUserUpdateOne) RemoveRefAdminCreatedBy

func (auuo *AdminUserUpdateOne) RemoveRefAdminCreatedBy(a ...*AdminUser) *AdminUserUpdateOne

RemoveRefAdminCreatedBy removes "ref_admin_created_by" edges to AdminUser entities.

func (*AdminUserUpdateOne) RemoveRefAdminCreatedByIDs

func (auuo *AdminUserUpdateOne) RemoveRefAdminCreatedByIDs(ids ...string) *AdminUserUpdateOne

RemoveRefAdminCreatedByIDs removes the "ref_admin_created_by" edge to AdminUser entities by IDs.

func (*AdminUserUpdateOne) RemoveRefAdminUpdatedBy

func (auuo *AdminUserUpdateOne) RemoveRefAdminUpdatedBy(a ...*AdminUser) *AdminUserUpdateOne

RemoveRefAdminUpdatedBy removes "ref_admin_updated_by" edges to AdminUser entities.

func (*AdminUserUpdateOne) RemoveRefAdminUpdatedByIDs

func (auuo *AdminUserUpdateOne) RemoveRefAdminUpdatedByIDs(ids ...string) *AdminUserUpdateOne

RemoveRefAdminUpdatedByIDs removes the "ref_admin_updated_by" edge to AdminUser entities by IDs.

func (*AdminUserUpdateOne) RemoveRoleIDs

func (auuo *AdminUserUpdateOne) RemoveRoleIDs(ids ...string) *AdminUserUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*AdminUserUpdateOne) RemoveRoles

func (auuo *AdminUserUpdateOne) RemoveRoles(r ...*Role) *AdminUserUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (*AdminUserUpdateOne) Save

func (auuo *AdminUserUpdateOne) Save(ctx context.Context) (*AdminUser, error)

Save executes the query and returns the updated AdminUser entity.

func (*AdminUserUpdateOne) SaveX

func (auuo *AdminUserUpdateOne) SaveX(ctx context.Context) *AdminUser

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

func (*AdminUserUpdateOne) Select

func (auuo *AdminUserUpdateOne) Select(field string, fields ...string) *AdminUserUpdateOne

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

func (*AdminUserUpdateOne) SetAdminCreatedBy

func (auuo *AdminUserUpdateOne) SetAdminCreatedBy(a *AdminUser) *AdminUserUpdateOne

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*AdminUserUpdateOne) SetAdminCreatedByID

func (auuo *AdminUserUpdateOne) SetAdminCreatedByID(id string) *AdminUserUpdateOne

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*AdminUserUpdateOne) SetAdminUpdatedBy

func (auuo *AdminUserUpdateOne) SetAdminUpdatedBy(a *AdminUser) *AdminUserUpdateOne

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*AdminUserUpdateOne) SetAdminUpdatedByID

func (auuo *AdminUserUpdateOne) SetAdminUpdatedByID(id string) *AdminUserUpdateOne

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*AdminUserUpdateOne) SetDefaultRole

func (auuo *AdminUserUpdateOne) SetDefaultRole(r *Role) *AdminUserUpdateOne

SetDefaultRole sets the "default_role" edge to the Role entity.

func (*AdminUserUpdateOne) SetDefaultRoleID

func (auuo *AdminUserUpdateOne) SetDefaultRoleID(id string) *AdminUserUpdateOne

SetDefaultRoleID sets the "default_role" edge to the Role entity by ID.

func (*AdminUserUpdateOne) SetEmail

func (auuo *AdminUserUpdateOne) SetEmail(s string) *AdminUserUpdateOne

SetEmail sets the "email" field.

func (*AdminUserUpdateOne) SetFirstName

func (auuo *AdminUserUpdateOne) SetFirstName(s string) *AdminUserUpdateOne

SetFirstName sets the "first_name" field.

func (*AdminUserUpdateOne) SetInput

SetInput applies the change-set in the UpdateAdminUserInput on the AdminUserUpdateOne builder.

func (*AdminUserUpdateOne) SetLastName

func (auuo *AdminUserUpdateOne) SetLastName(s string) *AdminUserUpdateOne

SetLastName sets the "last_name" field.

func (*AdminUserUpdateOne) SetName

func (auuo *AdminUserUpdateOne) SetName(s string) *AdminUserUpdateOne

SetName sets the "name" field.

func (*AdminUserUpdateOne) SetNillableAdminCreatedByID

func (auuo *AdminUserUpdateOne) SetNillableAdminCreatedByID(id *string) *AdminUserUpdateOne

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*AdminUserUpdateOne) SetNillableAdminUpdatedByID

func (auuo *AdminUserUpdateOne) SetNillableAdminUpdatedByID(id *string) *AdminUserUpdateOne

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*AdminUserUpdateOne) SetNillableDefaultRoleID

func (auuo *AdminUserUpdateOne) SetNillableDefaultRoleID(id *string) *AdminUserUpdateOne

SetNillableDefaultRoleID sets the "default_role" edge to the Role entity by ID if the given value is not nil.

func (*AdminUserUpdateOne) SetNillableEmail

func (auuo *AdminUserUpdateOne) SetNillableEmail(s *string) *AdminUserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*AdminUserUpdateOne) SetNillableFirstName

func (auuo *AdminUserUpdateOne) SetNillableFirstName(s *string) *AdminUserUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*AdminUserUpdateOne) SetNillableLastName

func (auuo *AdminUserUpdateOne) SetNillableLastName(s *string) *AdminUserUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*AdminUserUpdateOne) SetNillableName

func (auuo *AdminUserUpdateOne) SetNillableName(s *string) *AdminUserUpdateOne

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

func (*AdminUserUpdateOne) SetNillablePassword

func (auuo *AdminUserUpdateOne) SetNillablePassword(s *string) *AdminUserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*AdminUserUpdateOne) SetPassword

func (auuo *AdminUserUpdateOne) SetPassword(s string) *AdminUserUpdateOne

SetPassword sets the "password" field.

func (*AdminUserUpdateOne) SetUpdatedAt

func (auuo *AdminUserUpdateOne) SetUpdatedAt(t time.Time) *AdminUserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AdminUserUpdateOne) Where

Where appends a list predicates to the AdminUserUpdate builder.

type AdminUserUpsert

type AdminUserUpsert struct {
	*sql.UpdateSet
}

AdminUserUpsert is the "OnConflict" setter.

func (*AdminUserUpsert) ClearName

func (u *AdminUserUpsert) ClearName() *AdminUserUpsert

ClearName clears the value of the "name" field.

func (*AdminUserUpsert) ClearUpdatedAt

func (u *AdminUserUpsert) ClearUpdatedAt() *AdminUserUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AdminUserUpsert) SetEmail

func (u *AdminUserUpsert) SetEmail(v string) *AdminUserUpsert

SetEmail sets the "email" field.

func (*AdminUserUpsert) SetFirstName

func (u *AdminUserUpsert) SetFirstName(v string) *AdminUserUpsert

SetFirstName sets the "first_name" field.

func (*AdminUserUpsert) SetLastName

func (u *AdminUserUpsert) SetLastName(v string) *AdminUserUpsert

SetLastName sets the "last_name" field.

func (*AdminUserUpsert) SetName

func (u *AdminUserUpsert) SetName(v string) *AdminUserUpsert

SetName sets the "name" field.

func (*AdminUserUpsert) SetPassword

func (u *AdminUserUpsert) SetPassword(v string) *AdminUserUpsert

SetPassword sets the "password" field.

func (*AdminUserUpsert) SetUpdatedAt

func (u *AdminUserUpsert) SetUpdatedAt(v time.Time) *AdminUserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*AdminUserUpsert) UpdateEmail

func (u *AdminUserUpsert) UpdateEmail() *AdminUserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AdminUserUpsert) UpdateFirstName

func (u *AdminUserUpsert) UpdateFirstName() *AdminUserUpsert

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*AdminUserUpsert) UpdateLastName

func (u *AdminUserUpsert) UpdateLastName() *AdminUserUpsert

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*AdminUserUpsert) UpdateName

func (u *AdminUserUpsert) UpdateName() *AdminUserUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*AdminUserUpsert) UpdatePassword

func (u *AdminUserUpsert) UpdatePassword() *AdminUserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AdminUserUpsert) UpdateUpdatedAt

func (u *AdminUserUpsert) UpdateUpdatedAt() *AdminUserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type AdminUserUpsertBulk

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

AdminUserUpsertBulk is the builder for "upsert"-ing a bulk of AdminUser nodes.

func (*AdminUserUpsertBulk) ClearName

func (u *AdminUserUpsertBulk) ClearName() *AdminUserUpsertBulk

ClearName clears the value of the "name" field.

func (*AdminUserUpsertBulk) ClearUpdatedAt

func (u *AdminUserUpsertBulk) ClearUpdatedAt() *AdminUserUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AdminUserUpsertBulk) DoNothing

func (u *AdminUserUpsertBulk) DoNothing() *AdminUserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*AdminUserUpsertBulk) Exec

Exec executes the query.

func (*AdminUserUpsertBulk) ExecX

func (u *AdminUserUpsertBulk) ExecX(ctx context.Context)

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

func (*AdminUserUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.AdminUser.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*AdminUserUpsertBulk) SetEmail

SetEmail sets the "email" field.

func (*AdminUserUpsertBulk) SetFirstName

func (u *AdminUserUpsertBulk) SetFirstName(v string) *AdminUserUpsertBulk

SetFirstName sets the "first_name" field.

func (*AdminUserUpsertBulk) SetLastName

func (u *AdminUserUpsertBulk) SetLastName(v string) *AdminUserUpsertBulk

SetLastName sets the "last_name" field.

func (*AdminUserUpsertBulk) SetName

SetName sets the "name" field.

func (*AdminUserUpsertBulk) SetPassword

func (u *AdminUserUpsertBulk) SetPassword(v string) *AdminUserUpsertBulk

SetPassword sets the "password" field.

func (*AdminUserUpsertBulk) SetUpdatedAt

func (u *AdminUserUpsertBulk) SetUpdatedAt(v time.Time) *AdminUserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*AdminUserUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the AdminUserCreateBulk.OnConflict documentation for more info.

func (*AdminUserUpsertBulk) UpdateEmail

func (u *AdminUserUpsertBulk) UpdateEmail() *AdminUserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AdminUserUpsertBulk) UpdateFirstName

func (u *AdminUserUpsertBulk) UpdateFirstName() *AdminUserUpsertBulk

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*AdminUserUpsertBulk) UpdateLastName

func (u *AdminUserUpsertBulk) UpdateLastName() *AdminUserUpsertBulk

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*AdminUserUpsertBulk) UpdateName

func (u *AdminUserUpsertBulk) UpdateName() *AdminUserUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*AdminUserUpsertBulk) UpdateNewValues

func (u *AdminUserUpsertBulk) UpdateNewValues() *AdminUserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.AdminUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(adminuser.FieldID)
		}),
	).
	Exec(ctx)

func (*AdminUserUpsertBulk) UpdatePassword

func (u *AdminUserUpsertBulk) UpdatePassword() *AdminUserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AdminUserUpsertBulk) UpdateUpdatedAt

func (u *AdminUserUpsertBulk) UpdateUpdatedAt() *AdminUserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type AdminUserUpsertOne

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

AdminUserUpsertOne is the builder for "upsert"-ing

one AdminUser node.

func (*AdminUserUpsertOne) ClearName

func (u *AdminUserUpsertOne) ClearName() *AdminUserUpsertOne

ClearName clears the value of the "name" field.

func (*AdminUserUpsertOne) ClearUpdatedAt

func (u *AdminUserUpsertOne) ClearUpdatedAt() *AdminUserUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AdminUserUpsertOne) DoNothing

func (u *AdminUserUpsertOne) DoNothing() *AdminUserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*AdminUserUpsertOne) Exec

func (u *AdminUserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminUserUpsertOne) ExecX

func (u *AdminUserUpsertOne) ExecX(ctx context.Context)

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

func (*AdminUserUpsertOne) ID

func (u *AdminUserUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*AdminUserUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*AdminUserUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.AdminUser.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*AdminUserUpsertOne) SetEmail

SetEmail sets the "email" field.

func (*AdminUserUpsertOne) SetFirstName

func (u *AdminUserUpsertOne) SetFirstName(v string) *AdminUserUpsertOne

SetFirstName sets the "first_name" field.

func (*AdminUserUpsertOne) SetLastName

func (u *AdminUserUpsertOne) SetLastName(v string) *AdminUserUpsertOne

SetLastName sets the "last_name" field.

func (*AdminUserUpsertOne) SetName

SetName sets the "name" field.

func (*AdminUserUpsertOne) SetPassword

func (u *AdminUserUpsertOne) SetPassword(v string) *AdminUserUpsertOne

SetPassword sets the "password" field.

func (*AdminUserUpsertOne) SetUpdatedAt

func (u *AdminUserUpsertOne) SetUpdatedAt(v time.Time) *AdminUserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*AdminUserUpsertOne) Update

func (u *AdminUserUpsertOne) Update(set func(*AdminUserUpsert)) *AdminUserUpsertOne

Update allows overriding fields `UPDATE` values. See the AdminUserCreate.OnConflict documentation for more info.

func (*AdminUserUpsertOne) UpdateEmail

func (u *AdminUserUpsertOne) UpdateEmail() *AdminUserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AdminUserUpsertOne) UpdateFirstName

func (u *AdminUserUpsertOne) UpdateFirstName() *AdminUserUpsertOne

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*AdminUserUpsertOne) UpdateLastName

func (u *AdminUserUpsertOne) UpdateLastName() *AdminUserUpsertOne

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*AdminUserUpsertOne) UpdateName

func (u *AdminUserUpsertOne) UpdateName() *AdminUserUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*AdminUserUpsertOne) UpdateNewValues

func (u *AdminUserUpsertOne) UpdateNewValues() *AdminUserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.AdminUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(adminuser.FieldID)
		}),
	).
	Exec(ctx)

func (*AdminUserUpsertOne) UpdatePassword

func (u *AdminUserUpsertOne) UpdatePassword() *AdminUserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AdminUserUpsertOne) UpdateUpdatedAt

func (u *AdminUserUpsertOne) UpdateUpdatedAt() *AdminUserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type AdminUserWhereInput

type AdminUserWhereInput struct {
	Predicates []predicate.AdminUser  `json:"-"`
	Not        *AdminUserWhereInput   `json:"not,omitempty"`
	Or         []*AdminUserWhereInput `json:"or,omitempty"`
	And        []*AdminUserWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameIsNil        bool     `json:"nameIsNil,omitempty"`
	NameNotNil       bool     `json:"nameNotNil,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "email" field predicates.
	Email             *string  `json:"email,omitempty"`
	EmailNEQ          *string  `json:"emailNEQ,omitempty"`
	EmailIn           []string `json:"emailIn,omitempty"`
	EmailNotIn        []string `json:"emailNotIn,omitempty"`
	EmailGT           *string  `json:"emailGT,omitempty"`
	EmailGTE          *string  `json:"emailGTE,omitempty"`
	EmailLT           *string  `json:"emailLT,omitempty"`
	EmailLTE          *string  `json:"emailLTE,omitempty"`
	EmailContains     *string  `json:"emailContains,omitempty"`
	EmailHasPrefix    *string  `json:"emailHasPrefix,omitempty"`
	EmailHasSuffix    *string  `json:"emailHasSuffix,omitempty"`
	EmailEqualFold    *string  `json:"emailEqualFold,omitempty"`
	EmailContainsFold *string  `json:"emailContainsFold,omitempty"`

	// "password" field predicates.
	Password             *string  `json:"password,omitempty"`
	PasswordNEQ          *string  `json:"passwordNEQ,omitempty"`
	PasswordIn           []string `json:"passwordIn,omitempty"`
	PasswordNotIn        []string `json:"passwordNotIn,omitempty"`
	PasswordGT           *string  `json:"passwordGT,omitempty"`
	PasswordGTE          *string  `json:"passwordGTE,omitempty"`
	PasswordLT           *string  `json:"passwordLT,omitempty"`
	PasswordLTE          *string  `json:"passwordLTE,omitempty"`
	PasswordContains     *string  `json:"passwordContains,omitempty"`
	PasswordHasPrefix    *string  `json:"passwordHasPrefix,omitempty"`
	PasswordHasSuffix    *string  `json:"passwordHasSuffix,omitempty"`
	PasswordEqualFold    *string  `json:"passwordEqualFold,omitempty"`
	PasswordContainsFold *string  `json:"passwordContainsFold,omitempty"`

	// "first_name" field predicates.
	FirstName             *string  `json:"firstName,omitempty"`
	FirstNameNEQ          *string  `json:"firstNameNEQ,omitempty"`
	FirstNameIn           []string `json:"firstNameIn,omitempty"`
	FirstNameNotIn        []string `json:"firstNameNotIn,omitempty"`
	FirstNameGT           *string  `json:"firstNameGT,omitempty"`
	FirstNameGTE          *string  `json:"firstNameGTE,omitempty"`
	FirstNameLT           *string  `json:"firstNameLT,omitempty"`
	FirstNameLTE          *string  `json:"firstNameLTE,omitempty"`
	FirstNameContains     *string  `json:"firstNameContains,omitempty"`
	FirstNameHasPrefix    *string  `json:"firstNameHasPrefix,omitempty"`
	FirstNameHasSuffix    *string  `json:"firstNameHasSuffix,omitempty"`
	FirstNameEqualFold    *string  `json:"firstNameEqualFold,omitempty"`
	FirstNameContainsFold *string  `json:"firstNameContainsFold,omitempty"`

	// "last_name" field predicates.
	LastName             *string  `json:"lastName,omitempty"`
	LastNameNEQ          *string  `json:"lastNameNEQ,omitempty"`
	LastNameIn           []string `json:"lastNameIn,omitempty"`
	LastNameNotIn        []string `json:"lastNameNotIn,omitempty"`
	LastNameGT           *string  `json:"lastNameGT,omitempty"`
	LastNameGTE          *string  `json:"lastNameGTE,omitempty"`
	LastNameLT           *string  `json:"lastNameLT,omitempty"`
	LastNameLTE          *string  `json:"lastNameLTE,omitempty"`
	LastNameContains     *string  `json:"lastNameContains,omitempty"`
	LastNameHasPrefix    *string  `json:"lastNameHasPrefix,omitempty"`
	LastNameHasSuffix    *string  `json:"lastNameHasSuffix,omitempty"`
	LastNameEqualFold    *string  `json:"lastNameEqualFold,omitempty"`
	LastNameContainsFold *string  `json:"lastNameContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt       *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ    *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn     []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn  []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT     *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE    *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT     *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE    *time.Time  `json:"updatedAtLTE,omitempty"`
	UpdatedAtIsNil  bool        `json:"updatedAtIsNil,omitempty"`
	UpdatedAtNotNil bool        `json:"updatedAtNotNil,omitempty"`

	// "admin_created_by" edge predicates.
	HasAdminCreatedBy     *bool                  `json:"hasAdminCreatedBy,omitempty"`
	HasAdminCreatedByWith []*AdminUserWhereInput `json:"hasAdminCreatedByWith,omitempty"`

	// "ref_admin_updated_by" edge predicates.
	HasRefAdminUpdatedBy     *bool                  `json:"hasRefAdminUpdatedBy,omitempty"`
	HasRefAdminUpdatedByWith []*AdminUserWhereInput `json:"hasRefAdminUpdatedByWith,omitempty"`

	// "admin_updated_by" edge predicates.
	HasAdminUpdatedBy     *bool                  `json:"hasAdminUpdatedBy,omitempty"`
	HasAdminUpdatedByWith []*AdminUserWhereInput `json:"hasAdminUpdatedByWith,omitempty"`

	// "roles" edge predicates.
	HasRoles     *bool             `json:"hasRoles,omitempty"`
	HasRolesWith []*RoleWhereInput `json:"hasRolesWith,omitempty"`

	// "default_role" edge predicates.
	HasDefaultRole     *bool             `json:"hasDefaultRole,omitempty"`
	HasDefaultRoleWith []*RoleWhereInput `json:"hasDefaultRoleWith,omitempty"`
}

AdminUserWhereInput represents a where input for filtering AdminUser queries.

func (*AdminUserWhereInput) AddPredicates

func (i *AdminUserWhereInput) AddPredicates(predicates ...predicate.AdminUser)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*AdminUserWhereInput) Filter

Filter applies the AdminUserWhereInput filter on the AdminUserQuery builder.

func (*AdminUserWhereInput) P

P returns a predicate for filtering adminusers. An error is returned if the input is empty or invalid.

type AdminUserWhereUniqueInput

type AdminUserWhereUniqueInput struct {
	Predicates []predicate.AdminUser `json:"-"`

	ID    *string `json:"id,omitempty"`
	Email *string `json:"email,omitempty"`
}

UserWhereUniqueInput represents a where input for filtering User queries.

func (*AdminUserWhereUniqueInput) AddPredicates

func (i *AdminUserWhereUniqueInput) AddPredicates(predicates ...predicate.AdminUser)

func (*AdminUserWhereUniqueInput) Filter

func (*AdminUserWhereUniqueInput) P

type AdminUsers

type AdminUsers []*AdminUser

AdminUsers is a parsable slice of AdminUser.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AdminUser is the client for interacting with the AdminUser builders.
	AdminUser *AdminUserClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Permission is the client for interacting with the Permission builders.
	Permission *PermissionClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	AdminUser.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

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 CreateAdminUserInput

type CreateAdminUserInput struct {
	Name                 *string
	Email                string
	Password             string
	FirstName            string
	LastName             string
	RefAdminCreatedBy    *CreateManyAdminUserInput
	RefAdminCreatedByIDs []string
	AdminCreatedBy       *CreateOneAdminUserInput
	AdminCreatedByID     *string
	RefAdminUpdatedBy    *CreateManyAdminUserInput
	RefAdminUpdatedByIDs []string
	AdminUpdatedBy       *CreateOneAdminUserInput
	AdminUpdatedByID     *string
	Roles                *CreateManyRoleInput
	RoleIDs              []string
	DefaultRole          *CreateOneRoleInput
	DefaultRoleID        *string
}

CreateAdminUserInput represents a mutation input for creating adminusers.

func (*CreateAdminUserInput) Mutate

Mutate applies the CreateAdminUserInput on the AdminUserMutation builder.

type CreateFileInput

type CreateFileInput struct {
	CreatedAt        *time.Time
	UpdatedAt        *time.Time
	Caption          *string
	Name             string
	MimeType         string
	StorageFileName  string
	Size             int64
	AdminCreatedBy   *CreateOneAdminUserInput
	AdminCreatedByID *string
	AdminUpdatedBy   *CreateOneAdminUserInput
	AdminUpdatedByID *string
	CreatedBy        *CreateOneUserInput
	CreatedByID      *string
	UpdatedBy        *CreateOneUserInput
	UpdatedByID      *string
	Content          string `json:"content,omitempty"`
}

CreateFileInput represents a mutation input for creating files.

func (*CreateFileInput) Mutate

func (i *CreateFileInput) Mutate(m *FileMutation)

Mutate applies the CreateFileInput on the FileMutation builder.

type CreateManyAdminUserInput

type CreateManyAdminUserInput struct {
	Create  []*CreateAdminUserInput      `json:"create,omitempty"`
	Connect []*AdminUserWhereUniqueInput `json:"connect,omitempty"`
}

type CreateManyFileInput

type CreateManyFileInput struct {
	Create  []*CreateFileInput      `json:"create,omitempty"`
	Connect []*FileWhereUniqueInput `json:"connect,omitempty"`
}

type CreateManyPermissionInput

type CreateManyPermissionInput struct {
	Create  []*CreatePermissionInput      `json:"create,omitempty"`
	Connect []*PermissionWhereUniqueInput `json:"connect,omitempty"`
}

type CreateManyRoleInput

type CreateManyRoleInput struct {
	Create  []*CreateRoleInput      `json:"create,omitempty"`
	Connect []*RoleWhereUniqueInput `json:"connect,omitempty"`
}

type CreateManyUserInput

type CreateManyUserInput struct {
	Create  []*CreateUserInput      `json:"create,omitempty"`
	Connect []*UserWhereUniqueInput `json:"connect,omitempty"`
}

type CreateOneAdminUserInput

type CreateOneAdminUserInput struct {
	Create  *CreateAdminUserInput      `json:"create,omitempty"`
	Connect *AdminUserWhereUniqueInput `json:"connect,omitempty"`
}

type CreateOneFileInput

type CreateOneFileInput struct {
	Create  *CreateFileInput      `json:"create,omitempty"`
	Connect *FileWhereUniqueInput `json:"connect,omitempty"`
}

type CreateOnePermissionInput

type CreateOnePermissionInput struct {
	Create  *CreatePermissionInput      `json:"create,omitempty"`
	Connect *PermissionWhereUniqueInput `json:"connect,omitempty"`
}

type CreateOneRoleInput

type CreateOneRoleInput struct {
	Create  *CreateRoleInput      `json:"create,omitempty"`
	Connect *RoleWhereUniqueInput `json:"connect,omitempty"`
}

type CreateOneUserInput

type CreateOneUserInput struct {
	Create  *CreateUserInput      `json:"create,omitempty"`
	Connect *UserWhereUniqueInput `json:"connect,omitempty"`
}

type CreatePermissionInput

type CreatePermissionInput struct {
	CreatedAt        *time.Time
	UpdatedAt        *time.Time
	Entity           string
	Operation        *string
	AdminCreatedBy   *CreateOneAdminUserInput
	AdminCreatedByID *string
	AdminUpdatedBy   *CreateOneAdminUserInput
	AdminUpdatedByID *string
	Role             *CreateOneRoleInput
	RoleID           *string
}

CreatePermissionInput represents a mutation input for creating permissions.

func (*CreatePermissionInput) Mutate

Mutate applies the CreatePermissionInput on the PermissionMutation builder.

type CreateRoleInput

type CreateRoleInput struct {
	Name             string
	AdminCreatedBy   *CreateOneAdminUserInput
	AdminCreatedByID *string
	AdminUpdatedBy   *CreateOneAdminUserInput
	AdminUpdatedByID *string
	UserRoles        *CreateManyAdminUserInput
	UserRoleIDs      []string
	Permissions      *CreateManyPermissionInput
	PermissionIDs    []string
}

CreateRoleInput represents a mutation input for creating roles.

func (*CreateRoleInput) Mutate

func (i *CreateRoleInput) Mutate(m *RoleMutation)

Mutate applies the CreateRoleInput on the RoleMutation builder.

type CreateUserInput

type CreateUserInput struct {
	Email            string
	Password         string
	RefCreatedBy     *CreateManyUserInput
	RefCreatedByIDs  []string
	CreatedBy        *CreateOneUserInput
	CreatedByID      *string
	RefUpdatedBy     *CreateManyUserInput
	RefUpdatedByIDs  []string
	UpdatedBy        *CreateOneUserInput
	UpdatedByID      *string
	AdminCreatedBy   *CreateOneAdminUserInput
	AdminCreatedByID *string
	AdminUpdatedBy   *CreateOneAdminUserInput
	AdminUpdatedByID *string
	Roles            *CreateManyRoleInput
	RoleIDs          []string
	DefaultRole      *CreateOneRoleInput
	DefaultRoleID    *string
}

CreateUserInput represents a mutation input for creating users.

func (*CreateUserInput) Mutate

func (i *CreateUserInput) Mutate(m *UserMutation)

Mutate applies the CreateUserInput on the UserMutation builder.

type Cursor

type Cursor = entgql.Cursor[string]

Common entgql types.

type File

type File struct {

	// ID of the ent.
	ID string `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"`
	// Caption holds the value of the "caption" field.
	Caption string `json:"caption,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// MimeType holds the value of the "mime_type" field.
	MimeType string `json:"mime_type,omitempty"`
	// StorageFileName holds the value of the "storage_file_name" field.
	StorageFileName string `json:"storage_file_name,omitempty"`
	// Size holds the value of the "size" field.
	Size int64 `json:"size,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileQuery when eager-loading is set.
	Edges FileEdges `json:"edges"`

	Content string `json:"content,omitempty"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) AdminCreatedBy

func (f *File) AdminCreatedBy(ctx context.Context) (*AdminUser, error)

func (*File) AdminUpdatedBy

func (f *File) AdminUpdatedBy(ctx context.Context) (*AdminUser, error)

func (*File) CreatedBy

func (f *File) CreatedBy(ctx context.Context) (*User, error)

func (*File) ExecContext

func (c *File) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*File) IsNode

func (*File) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*File) QueryAdminCreatedBy

func (f *File) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy queries the "admin_created_by" edge of the File entity.

func (*File) QueryAdminUpdatedBy

func (f *File) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy queries the "admin_updated_by" edge of the File entity.

func (*File) QueryContext

func (c *File) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*File) QueryCreatedBy

func (f *File) QueryCreatedBy() *UserQuery

QueryCreatedBy queries the "created_by" edge of the File entity.

func (*File) QueryUpdatedBy

func (f *File) QueryUpdatedBy() *UserQuery

QueryUpdatedBy queries the "updated_by" edge of the File entity.

func (*File) String

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) ToEdge

func (f *File) ToEdge(order *FileOrder) *FileEdge

ToEdge converts File into FileEdge.

func (*File) Unwrap

func (f *File) Unwrap() *File

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

func (f *File) Update() *FileUpdateOne

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

func (*File) UpdatedBy

func (f *File) UpdatedBy(ctx context.Context) (*User, error)

func (*File) Value

func (f *File) Value(name string) (ent.Value, error)

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

type FileClient

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

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

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

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(f *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id string) *FileDeleteOne

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

func (*FileClient) ExecContext

func (c *FileClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id string) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id string) *File

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

func (*FileClient) Hooks

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

Hooks returns the client hooks.

func (*FileClient) Intercept

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

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

func (*FileClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FileClient) MapCreateBulk

func (c *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk

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

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) QueryAdminCreatedBy

func (c *FileClient) QueryAdminCreatedBy(f *File) *AdminUserQuery

QueryAdminCreatedBy queries the admin_created_by edge of a File.

func (*FileClient) QueryAdminUpdatedBy

func (c *FileClient) QueryAdminUpdatedBy(f *File) *AdminUserQuery

QueryAdminUpdatedBy queries the admin_updated_by edge of a File.

func (*FileClient) QueryContext

func (c *FileClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileClient) QueryCreatedBy

func (c *FileClient) QueryCreatedBy(f *File) *UserQuery

QueryCreatedBy queries the created_by edge of a File.

func (*FileClient) QueryUpdatedBy

func (c *FileClient) QueryUpdatedBy(f *File) *UserQuery

QueryUpdatedBy queries the updated_by edge of a File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(f *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id string) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

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

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

type FileConnection

type FileConnection struct {
	Edges      []*FileEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

FileConnection is the connection containing edges to File.

type FileCreate

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

FileCreate is the builder for creating a File entity.

func (*FileCreate) Exec

func (fc *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecContext

func (c *FileCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileCreate) ExecX

func (fc *FileCreate) ExecX(ctx context.Context)

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

func (*FileCreate) Mutation

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) OnConflict

func (fc *FileCreate) OnConflict(opts ...sql.ConflictOption) *FileUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.File.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*FileCreate) OnConflictColumns

func (fc *FileCreate) OnConflictColumns(columns ...string) *FileUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FileCreate) QueryContext

func (c *FileCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileCreate) Save

func (fc *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (fc *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetAdminCreatedBy

func (fc *FileCreate) SetAdminCreatedBy(a *AdminUser) *FileCreate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*FileCreate) SetAdminCreatedByID

func (fc *FileCreate) SetAdminCreatedByID(id string) *FileCreate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*FileCreate) SetAdminUpdatedBy

func (fc *FileCreate) SetAdminUpdatedBy(a *AdminUser) *FileCreate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*FileCreate) SetAdminUpdatedByID

func (fc *FileCreate) SetAdminUpdatedByID(id string) *FileCreate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*FileCreate) SetCaption

func (fc *FileCreate) SetCaption(s string) *FileCreate

SetCaption sets the "caption" field.

func (*FileCreate) SetCreatedAt

func (fc *FileCreate) SetCreatedAt(t time.Time) *FileCreate

SetCreatedAt sets the "created_at" field.

func (*FileCreate) SetCreatedBy

func (fc *FileCreate) SetCreatedBy(u *User) *FileCreate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*FileCreate) SetCreatedByID

func (fc *FileCreate) SetCreatedByID(id string) *FileCreate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*FileCreate) SetID

func (fc *FileCreate) SetID(s string) *FileCreate

SetID sets the "id" field.

func (*FileCreate) SetInput

func (c *FileCreate) SetInput(i CreateFileInput) *FileCreate

SetInput applies the change-set in the CreateFileInput on the FileCreate builder.

func (*FileCreate) SetMimeType

func (fc *FileCreate) SetMimeType(s string) *FileCreate

SetMimeType sets the "mime_type" field.

func (*FileCreate) SetName

func (fc *FileCreate) SetName(s string) *FileCreate

SetName sets the "name" field.

func (*FileCreate) SetNillableAdminCreatedByID

func (fc *FileCreate) SetNillableAdminCreatedByID(id *string) *FileCreate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*FileCreate) SetNillableAdminUpdatedByID

func (fc *FileCreate) SetNillableAdminUpdatedByID(id *string) *FileCreate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*FileCreate) SetNillableCaption

func (fc *FileCreate) SetNillableCaption(s *string) *FileCreate

SetNillableCaption sets the "caption" field if the given value is not nil.

func (*FileCreate) SetNillableCreatedAt

func (fc *FileCreate) SetNillableCreatedAt(t *time.Time) *FileCreate

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

func (*FileCreate) SetNillableCreatedByID

func (fc *FileCreate) SetNillableCreatedByID(id *string) *FileCreate

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*FileCreate) SetNillableID

func (fc *FileCreate) SetNillableID(s *string) *FileCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*FileCreate) SetNillableUpdatedAt

func (fc *FileCreate) SetNillableUpdatedAt(t *time.Time) *FileCreate

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

func (*FileCreate) SetNillableUpdatedByID

func (fc *FileCreate) SetNillableUpdatedByID(id *string) *FileCreate

SetNillableUpdatedByID sets the "updated_by" edge to the User entity by ID if the given value is not nil.

func (*FileCreate) SetSize

func (fc *FileCreate) SetSize(i int64) *FileCreate

SetSize sets the "size" field.

func (*FileCreate) SetStorageFileName

func (fc *FileCreate) SetStorageFileName(s string) *FileCreate

SetStorageFileName sets the "storage_file_name" field.

func (*FileCreate) SetUpdatedAt

func (fc *FileCreate) SetUpdatedAt(t time.Time) *FileCreate

SetUpdatedAt sets the "updated_at" field.

func (*FileCreate) SetUpdatedBy

func (fc *FileCreate) SetUpdatedBy(u *User) *FileCreate

SetUpdatedBy sets the "updated_by" edge to the User entity.

func (*FileCreate) SetUpdatedByID

func (fc *FileCreate) SetUpdatedByID(id string) *FileCreate

SetUpdatedByID sets the "updated_by" edge to the User entity by ID.

type FileCreateBulk

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

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecContext

func (c *FileCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileCreateBulk) ExecX

func (fcb *FileCreateBulk) ExecX(ctx context.Context)

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

func (*FileCreateBulk) OnConflict

func (fcb *FileCreateBulk) OnConflict(opts ...sql.ConflictOption) *FileUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.File.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.FileUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*FileCreateBulk) OnConflictColumns

func (fcb *FileCreateBulk) OnConflictColumns(columns ...string) *FileUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*FileCreateBulk) QueryContext

func (c *FileCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileCreateBulk) Save

func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File

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

type FileDelete

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

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (fd *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecContext

func (c *FileDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileDelete) ExecX

func (fd *FileDelete) ExecX(ctx context.Context) int

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

func (*FileDelete) QueryContext

func (c *FileDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileDelete) Where

func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

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

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (fdo *FileDeleteOne) ExecX(ctx context.Context)

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

func (*FileDeleteOne) Where

func (fdo *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileEdge

type FileEdge struct {
	Node   *File  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

FileEdge is the edge representation of File.

type FileEdges

type FileEdges struct {
	// AdminCreatedBy holds the value of the admin_created_by edge.
	AdminCreatedBy *AdminUser `json:"admin_created_by,omitempty"`
	// AdminUpdatedBy holds the value of the admin_updated_by edge.
	AdminUpdatedBy *AdminUser `json:"admin_updated_by,omitempty"`
	// CreatedBy holds the value of the created_by edge.
	CreatedBy *User `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the updated_by edge.
	UpdatedBy *User `json:"updated_by,omitempty"`
	// contains filtered or unexported fields
}

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

func (FileEdges) AdminCreatedByOrErr

func (e FileEdges) AdminCreatedByOrErr() (*AdminUser, error)

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

func (FileEdges) AdminUpdatedByOrErr

func (e FileEdges) AdminUpdatedByOrErr() (*AdminUser, error)

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

func (FileEdges) CreatedByOrErr

func (e FileEdges) CreatedByOrErr() (*User, error)

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

func (FileEdges) UpdatedByOrErr

func (e FileEdges) UpdatedByOrErr() (*User, error)

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

type FileGroupBy

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

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

func (*FileGroupBy) Bool

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

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

func (*FileGroupBy) BoolX

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

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

func (*FileGroupBy) Bools

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

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

func (*FileGroupBy) BoolsX

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

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

func (*FileGroupBy) Float64

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

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

func (*FileGroupBy) Float64X

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

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

func (*FileGroupBy) Float64s

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

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

func (*FileGroupBy) Float64sX

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

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

func (*FileGroupBy) Int

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

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

func (*FileGroupBy) IntX

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

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

func (*FileGroupBy) Ints

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

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

func (*FileGroupBy) IntsX

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

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

func (*FileGroupBy) Scan

func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error

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

func (*FileGroupBy) ScanX

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

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

func (*FileGroupBy) String

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

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

func (*FileGroupBy) StringX

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

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

func (*FileGroupBy) Strings

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

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

func (*FileGroupBy) StringsX

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

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

type FileMutation

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

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddEdges

func (m *FileMutation) AddEdges(name string, values []string) error

AddEdges sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*FileMutation) AddField

func (m *FileMutation) 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 (*FileMutation) AddSize

func (m *FileMutation) AddSize(i int64)

AddSize adds i to the "size" field.

func (*FileMutation) AddedEdges

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

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

func (*FileMutation) AddedField

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

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

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

func (*FileMutation) AddedIDs

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

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

func (*FileMutation) AddedSize

func (m *FileMutation) AddedSize() (r int64, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*FileMutation) AdminCreatedByCleared

func (m *FileMutation) AdminCreatedByCleared() bool

AdminCreatedByCleared reports if the "admin_created_by" edge to the AdminUser entity was cleared.

func (*FileMutation) AdminCreatedByID

func (m *FileMutation) AdminCreatedByID() (id string, exists bool)

AdminCreatedByID returns the "admin_created_by" edge ID in the mutation.

func (*FileMutation) AdminCreatedByIDs

func (m *FileMutation) AdminCreatedByIDs() (ids []string)

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

func (*FileMutation) AdminUpdatedByCleared

func (m *FileMutation) AdminUpdatedByCleared() bool

AdminUpdatedByCleared reports if the "admin_updated_by" edge to the AdminUser entity was cleared.

func (*FileMutation) AdminUpdatedByID

func (m *FileMutation) AdminUpdatedByID() (id string, exists bool)

AdminUpdatedByID returns the "admin_updated_by" edge ID in the mutation.

func (*FileMutation) AdminUpdatedByIDs

func (m *FileMutation) AdminUpdatedByIDs() (ids []string)

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

func (*FileMutation) Caption

func (m *FileMutation) Caption() (r string, exists bool)

Caption returns the value of the "caption" field in the mutation.

func (*FileMutation) CaptionCleared

func (m *FileMutation) CaptionCleared() bool

CaptionCleared returns if the "caption" field was cleared in this mutation.

func (*FileMutation) ClearAdminCreatedBy

func (m *FileMutation) ClearAdminCreatedBy()

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*FileMutation) ClearAdminUpdatedBy

func (m *FileMutation) ClearAdminUpdatedBy()

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*FileMutation) ClearCaption

func (m *FileMutation) ClearCaption()

ClearCaption clears the value of the "caption" field.

func (*FileMutation) ClearCreatedAt

func (m *FileMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*FileMutation) ClearCreatedBy

func (m *FileMutation) ClearCreatedBy()

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*FileMutation) ClearEdge

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

func (m *FileMutation) 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 (*FileMutation) ClearUpdatedAt

func (m *FileMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*FileMutation) ClearUpdatedBy

func (m *FileMutation) ClearUpdatedBy()

ClearUpdatedBy clears the "updated_by" edge to the User entity.

func (*FileMutation) ClearedEdges

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

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

func (*FileMutation) ClearedFields

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

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

func (FileMutation) Client

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

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

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

func (*FileMutation) CreatedAtCleared

func (m *FileMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*FileMutation) CreatedByCleared

func (m *FileMutation) CreatedByCleared() bool

CreatedByCleared reports if the "created_by" edge to the User entity was cleared.

func (*FileMutation) CreatedByID

func (m *FileMutation) CreatedByID() (id string, exists bool)

CreatedByID returns the "created_by" edge ID in the mutation.

func (*FileMutation) CreatedByIDs

func (m *FileMutation) CreatedByIDs() (ids []string)

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

func (*FileMutation) EdgeCleared

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

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

func (*FileMutation) ExecContext

func (c *FileMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileMutation) Field

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

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

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

func (*FileMutation) Fields

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

func (m *FileMutation) ID() (id string, 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 (*FileMutation) IDs

func (m *FileMutation) IDs(ctx context.Context) ([]string, 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 (*FileMutation) MimeType

func (m *FileMutation) MimeType() (r string, exists bool)

MimeType returns the value of the "mime_type" field in the mutation.

func (*FileMutation) Name

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

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

func (*FileMutation) OldCaption

func (m *FileMutation) OldCaption(ctx context.Context) (v string, err error)

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

func (*FileMutation) OldCreatedAt

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

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

func (*FileMutation) OldField

func (m *FileMutation) 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 (*FileMutation) OldMimeType

func (m *FileMutation) OldMimeType(ctx context.Context) (v string, err error)

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

func (*FileMutation) OldName

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

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

func (*FileMutation) OldSize

func (m *FileMutation) OldSize(ctx context.Context) (v int64, err error)

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

func (*FileMutation) OldStorageFileName

func (m *FileMutation) OldStorageFileName(ctx context.Context) (v string, err error)

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

func (*FileMutation) OldUpdatedAt

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

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

func (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) QueryContext

func (c *FileMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileMutation) RemovedEdges

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

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

func (*FileMutation) RemovedIDs

func (m *FileMutation) 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 (*FileMutation) ResetAdminCreatedBy

func (m *FileMutation) ResetAdminCreatedBy()

ResetAdminCreatedBy resets all changes to the "admin_created_by" edge.

func (*FileMutation) ResetAdminUpdatedBy

func (m *FileMutation) ResetAdminUpdatedBy()

ResetAdminUpdatedBy resets all changes to the "admin_updated_by" edge.

func (*FileMutation) ResetCaption

func (m *FileMutation) ResetCaption()

ResetCaption resets all changes to the "caption" field.

func (*FileMutation) ResetCreatedAt

func (m *FileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FileMutation) ResetCreatedBy

func (m *FileMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" edge.

func (*FileMutation) ResetEdge

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

func (m *FileMutation) 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 (*FileMutation) ResetMimeType

func (m *FileMutation) ResetMimeType()

ResetMimeType resets all changes to the "mime_type" field.

func (*FileMutation) ResetName

func (m *FileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileMutation) ResetSize

func (m *FileMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*FileMutation) ResetStorageFileName

func (m *FileMutation) ResetStorageFileName()

ResetStorageFileName resets all changes to the "storage_file_name" field.

func (*FileMutation) ResetUpdatedAt

func (m *FileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FileMutation) ResetUpdatedBy

func (m *FileMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" edge.

func (*FileMutation) SetAdminCreatedByID

func (m *FileMutation) SetAdminCreatedByID(id string)

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by id.

func (*FileMutation) SetAdminUpdatedByID

func (m *FileMutation) SetAdminUpdatedByID(id string)

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by id.

func (*FileMutation) SetCaption

func (m *FileMutation) SetCaption(s string)

SetCaption sets the "caption" field.

func (*FileMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FileMutation) SetCreatedByID

func (m *FileMutation) SetCreatedByID(id string)

SetCreatedByID sets the "created_by" edge to the User entity by id.

func (*FileMutation) SetEdge

func (m *FileMutation) SetEdge(name, value string) error

SetEdge sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*FileMutation) SetField

func (m *FileMutation) 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 (*FileMutation) SetID

func (m *FileMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of File entities.

func (*FileMutation) SetMimeType

func (m *FileMutation) SetMimeType(s string)

SetMimeType sets the "mime_type" field.

func (*FileMutation) SetName

func (m *FileMutation) SetName(s string)

SetName sets the "name" field.

func (*FileMutation) SetOp

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileMutation) SetSize

func (m *FileMutation) SetSize(i int64)

SetSize sets the "size" field.

func (*FileMutation) SetStorageFileName

func (m *FileMutation) SetStorageFileName(s string)

SetStorageFileName sets the "storage_file_name" field.

func (*FileMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FileMutation) SetUpdatedByID

func (m *FileMutation) SetUpdatedByID(id string)

SetUpdatedByID sets the "updated_by" edge to the User entity by id.

func (*FileMutation) Size

func (m *FileMutation) Size() (r int64, exists bool)

Size returns the value of the "size" field in the mutation.

func (*FileMutation) StorageFileName

func (m *FileMutation) StorageFileName() (r string, exists bool)

StorageFileName returns the value of the "storage_file_name" field in the mutation.

func (FileMutation) Tx

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

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

func (*FileMutation) Type

func (m *FileMutation) Type() string

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

func (*FileMutation) UpdatedAt

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

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

func (*FileMutation) UpdatedAtCleared

func (m *FileMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*FileMutation) UpdatedByCleared

func (m *FileMutation) UpdatedByCleared() bool

UpdatedByCleared reports if the "updated_by" edge to the User entity was cleared.

func (*FileMutation) UpdatedByID

func (m *FileMutation) UpdatedByID() (id string, exists bool)

UpdatedByID returns the "updated_by" edge ID in the mutation.

func (*FileMutation) UpdatedByIDs

func (m *FileMutation) UpdatedByIDs() (ids []string)

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

func (*FileMutation) UpdatedFields

func (m *FileMutation) UpdatedFields() map[string]Value

UpdatedFields returns all fields and edges that were changed during this mutation.

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP

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

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

type FileOrder

type FileOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *FileOrderField `json:"field"`
}

FileOrder defines the ordering of File.

type FileOrderField

type FileOrderField struct {
	// Value extracts the ordering value from the given File.
	Value func(*File) (ent.Value, error)
	// contains filtered or unexported fields
}

FileOrderField defines the ordering field of File.

func (FileOrderField) MarshalGQL

func (f FileOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (FileOrderField) String

func (f FileOrderField) String() string

String implement fmt.Stringer interface.

func (*FileOrderField) UnmarshalGQL

func (f *FileOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type FilePaginateOption

type FilePaginateOption func(*filePager) error

FilePaginateOption enables pagination customization.

func WithFileFilter

func WithFileFilter(filter func(*FileQuery) (*FileQuery, error)) FilePaginateOption

WithFileFilter configures pagination filter.

func WithFileOrder

func WithFileOrder(order []*FileOrder) FilePaginateOption

WithFileOrder configures pagination ordering.

type FileQuery

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

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate

func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

func (fq *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (fq *FileQuery) AllX(ctx context.Context) []*File

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

func (*FileQuery) Clone

func (fq *FileQuery) Clone() *FileQuery

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

func (*FileQuery) CollectFields

func (f *FileQuery) CollectFields(ctx context.Context, satisfies ...string) (*FileQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*FileQuery) Count

func (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (fq *FileQuery) CountX(ctx context.Context) int

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

func (*FileQuery) ExecContext

func (c *FileQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileQuery) Exist

func (fq *FileQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileQuery) ExistX

func (fq *FileQuery) ExistX(ctx context.Context) bool

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

func (*FileQuery) First

func (fq *FileQuery) First(ctx context.Context) (*File, error)

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

func (*FileQuery) FirstID

func (fq *FileQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FileQuery) FirstIDX

func (fq *FileQuery) FirstIDX(ctx context.Context) string

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

func (*FileQuery) FirstX

func (fq *FileQuery) FirstX(ctx context.Context) *File

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

func (*FileQuery) GroupBy

func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

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.File.Query().
	GroupBy(file.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs

func (fq *FileQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*FileQuery) IDsX

func (fq *FileQuery) IDsX(ctx context.Context) []string

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

func (*FileQuery) Limit

func (fq *FileQuery) Limit(limit int) *FileQuery

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

func (*FileQuery) Offset

func (fq *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only

func (fq *FileQuery) Only(ctx context.Context) (*File, error)

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

func (*FileQuery) OnlyID

func (fq *FileQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*FileQuery) OnlyIDX

func (fq *FileQuery) OnlyIDX(ctx context.Context) string

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

func (*FileQuery) OnlyX

func (fq *FileQuery) OnlyX(ctx context.Context) *File

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

func (*FileQuery) Order

func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) Paginate

func (f *FileQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...FilePaginateOption,
) (*FileConnection, error)

Paginate executes the query and returns a relay based cursor connection to File.

func (*FileQuery) QueryAdminCreatedBy

func (fq *FileQuery) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy chains the current query on the "admin_created_by" edge.

func (*FileQuery) QueryAdminUpdatedBy

func (fq *FileQuery) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy chains the current query on the "admin_updated_by" edge.

func (*FileQuery) QueryContext

func (c *FileQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileQuery) QueryCreatedBy

func (fq *FileQuery) QueryCreatedBy() *UserQuery

QueryCreatedBy chains the current query on the "created_by" edge.

func (*FileQuery) QueryUpdatedBy

func (fq *FileQuery) QueryUpdatedBy() *UserQuery

QueryUpdatedBy chains the current query on the "updated_by" edge.

func (*FileQuery) Select

func (fq *FileQuery) Select(fields ...string) *FileSelect

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

func (*FileQuery) Unique

func (fq *FileQuery) Unique(unique bool) *FileQuery

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

func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WhereAdminCreatedBy

func (f *FileQuery) WhereAdminCreatedBy(adminUserID string) *FileQuery

WhereAdminCreatedBy adds a filter based on the AdminCreatedBy relationship. This method allows owner-based permission filtering by admin user ID.

func (*FileQuery) WithAdminCreatedBy

func (fq *FileQuery) WithAdminCreatedBy(opts ...func(*AdminUserQuery)) *FileQuery

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

func (*FileQuery) WithAdminUpdatedBy

func (fq *FileQuery) WithAdminUpdatedBy(opts ...func(*AdminUserQuery)) *FileQuery

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

func (*FileQuery) WithCreatedBy

func (fq *FileQuery) WithCreatedBy(opts ...func(*UserQuery)) *FileQuery

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

func (*FileQuery) WithUpdatedBy

func (fq *FileQuery) WithUpdatedBy(opts ...func(*UserQuery)) *FileQuery

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

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate

func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool

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

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

func (*FileSelect) BoolX

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

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

func (*FileSelect) Bools

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

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

func (*FileSelect) BoolsX

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

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

func (FileSelect) ExecContext

func (c FileSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileSelect) Float64

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

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

func (*FileSelect) Float64X

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

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

func (*FileSelect) Float64s

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

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

func (*FileSelect) Float64sX

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

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

func (*FileSelect) Int

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

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

func (*FileSelect) IntX

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

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

func (*FileSelect) Ints

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

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

func (*FileSelect) IntsX

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

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

func (FileSelect) QueryContext

func (c FileSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileSelect) Scan

func (fs *FileSelect) Scan(ctx context.Context, v any) error

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

func (*FileSelect) ScanX

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

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

func (*FileSelect) String

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

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

func (*FileSelect) StringX

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

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

func (*FileSelect) Strings

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

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

func (*FileSelect) StringsX

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

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

type FileUpdate

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

FileUpdate is the builder for updating File entities.

func (*FileUpdate) AddSize

func (fu *FileUpdate) AddSize(i int64) *FileUpdate

AddSize adds i to the "size" field.

func (*FileUpdate) ClearAdminCreatedBy

func (fu *FileUpdate) ClearAdminCreatedBy() *FileUpdate

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*FileUpdate) ClearAdminUpdatedBy

func (fu *FileUpdate) ClearAdminUpdatedBy() *FileUpdate

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*FileUpdate) ClearCaption

func (fu *FileUpdate) ClearCaption() *FileUpdate

ClearCaption clears the value of the "caption" field.

func (*FileUpdate) ClearCreatedAt

func (fu *FileUpdate) ClearCreatedAt() *FileUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpdate) ClearCreatedBy

func (fu *FileUpdate) ClearCreatedBy() *FileUpdate

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*FileUpdate) ClearUpdatedAt

func (fu *FileUpdate) ClearUpdatedAt() *FileUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*FileUpdate) ClearUpdatedBy

func (fu *FileUpdate) ClearUpdatedBy() *FileUpdate

ClearUpdatedBy clears the "updated_by" edge to the User entity.

func (*FileUpdate) Exec

func (fu *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecContext

func (c *FileUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileUpdate) ExecX

func (fu *FileUpdate) ExecX(ctx context.Context)

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

func (*FileUpdate) Mutation

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) QueryContext

func (c *FileUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileUpdate) Save

func (fu *FileUpdate) Save(ctx context.Context) (int, error)

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

func (*FileUpdate) SaveX

func (fu *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) SetAdminCreatedBy

func (fu *FileUpdate) SetAdminCreatedBy(a *AdminUser) *FileUpdate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*FileUpdate) SetAdminCreatedByID

func (fu *FileUpdate) SetAdminCreatedByID(id string) *FileUpdate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*FileUpdate) SetAdminUpdatedBy

func (fu *FileUpdate) SetAdminUpdatedBy(a *AdminUser) *FileUpdate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*FileUpdate) SetAdminUpdatedByID

func (fu *FileUpdate) SetAdminUpdatedByID(id string) *FileUpdate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*FileUpdate) SetCaption

func (fu *FileUpdate) SetCaption(s string) *FileUpdate

SetCaption sets the "caption" field.

func (*FileUpdate) SetCreatedAt

func (fu *FileUpdate) SetCreatedAt(t time.Time) *FileUpdate

SetCreatedAt sets the "created_at" field.

func (*FileUpdate) SetCreatedBy

func (fu *FileUpdate) SetCreatedBy(u *User) *FileUpdate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*FileUpdate) SetCreatedByID

func (fu *FileUpdate) SetCreatedByID(id string) *FileUpdate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*FileUpdate) SetInput

func (c *FileUpdate) SetInput(i UpdateFileInput) *FileUpdate

SetInput applies the change-set in the UpdateFileInput on the FileUpdate builder.

func (*FileUpdate) SetMimeType

func (fu *FileUpdate) SetMimeType(s string) *FileUpdate

SetMimeType sets the "mime_type" field.

func (*FileUpdate) SetName

func (fu *FileUpdate) SetName(s string) *FileUpdate

SetName sets the "name" field.

func (*FileUpdate) SetNillableAdminCreatedByID

func (fu *FileUpdate) SetNillableAdminCreatedByID(id *string) *FileUpdate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*FileUpdate) SetNillableAdminUpdatedByID

func (fu *FileUpdate) SetNillableAdminUpdatedByID(id *string) *FileUpdate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*FileUpdate) SetNillableCaption

func (fu *FileUpdate) SetNillableCaption(s *string) *FileUpdate

SetNillableCaption sets the "caption" field if the given value is not nil.

func (*FileUpdate) SetNillableCreatedAt

func (fu *FileUpdate) SetNillableCreatedAt(t *time.Time) *FileUpdate

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

func (*FileUpdate) SetNillableCreatedByID

func (fu *FileUpdate) SetNillableCreatedByID(id *string) *FileUpdate

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*FileUpdate) SetNillableMimeType

func (fu *FileUpdate) SetNillableMimeType(s *string) *FileUpdate

SetNillableMimeType sets the "mime_type" field if the given value is not nil.

func (*FileUpdate) SetNillableName

func (fu *FileUpdate) SetNillableName(s *string) *FileUpdate

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

func (*FileUpdate) SetNillableSize

func (fu *FileUpdate) SetNillableSize(i *int64) *FileUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdate) SetNillableStorageFileName

func (fu *FileUpdate) SetNillableStorageFileName(s *string) *FileUpdate

SetNillableStorageFileName sets the "storage_file_name" field if the given value is not nil.

func (*FileUpdate) SetNillableUpdatedByID

func (fu *FileUpdate) SetNillableUpdatedByID(id *string) *FileUpdate

SetNillableUpdatedByID sets the "updated_by" edge to the User entity by ID if the given value is not nil.

func (*FileUpdate) SetSize

func (fu *FileUpdate) SetSize(i int64) *FileUpdate

SetSize sets the "size" field.

func (*FileUpdate) SetStorageFileName

func (fu *FileUpdate) SetStorageFileName(s string) *FileUpdate

SetStorageFileName sets the "storage_file_name" field.

func (*FileUpdate) SetUpdatedAt

func (fu *FileUpdate) SetUpdatedAt(t time.Time) *FileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdate) SetUpdatedBy

func (fu *FileUpdate) SetUpdatedBy(u *User) *FileUpdate

SetUpdatedBy sets the "updated_by" edge to the User entity.

func (*FileUpdate) SetUpdatedByID

func (fu *FileUpdate) SetUpdatedByID(id string) *FileUpdate

SetUpdatedByID sets the "updated_by" edge to the User entity by ID.

func (*FileUpdate) Where

func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

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

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) AddSize

func (fuo *FileUpdateOne) AddSize(i int64) *FileUpdateOne

AddSize adds i to the "size" field.

func (*FileUpdateOne) ClearAdminCreatedBy

func (fuo *FileUpdateOne) ClearAdminCreatedBy() *FileUpdateOne

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*FileUpdateOne) ClearAdminUpdatedBy

func (fuo *FileUpdateOne) ClearAdminUpdatedBy() *FileUpdateOne

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*FileUpdateOne) ClearCaption

func (fuo *FileUpdateOne) ClearCaption() *FileUpdateOne

ClearCaption clears the value of the "caption" field.

func (*FileUpdateOne) ClearCreatedAt

func (fuo *FileUpdateOne) ClearCreatedAt() *FileUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpdateOne) ClearCreatedBy

func (fuo *FileUpdateOne) ClearCreatedBy() *FileUpdateOne

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*FileUpdateOne) ClearUpdatedAt

func (fuo *FileUpdateOne) ClearUpdatedAt() *FileUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*FileUpdateOne) ClearUpdatedBy

func (fuo *FileUpdateOne) ClearUpdatedBy() *FileUpdateOne

ClearUpdatedBy clears the "updated_by" edge to the User entity.

func (*FileUpdateOne) Exec

func (fuo *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecContext

func (c *FileUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileUpdateOne) ExecX

func (fuo *FileUpdateOne) ExecX(ctx context.Context)

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

func (*FileUpdateOne) Mutation

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) QueryContext

func (c *FileUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileUpdateOne) Save

func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File

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

func (*FileUpdateOne) Select

func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

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

func (*FileUpdateOne) SetAdminCreatedBy

func (fuo *FileUpdateOne) SetAdminCreatedBy(a *AdminUser) *FileUpdateOne

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*FileUpdateOne) SetAdminCreatedByID

func (fuo *FileUpdateOne) SetAdminCreatedByID(id string) *FileUpdateOne

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*FileUpdateOne) SetAdminUpdatedBy

func (fuo *FileUpdateOne) SetAdminUpdatedBy(a *AdminUser) *FileUpdateOne

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*FileUpdateOne) SetAdminUpdatedByID

func (fuo *FileUpdateOne) SetAdminUpdatedByID(id string) *FileUpdateOne

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*FileUpdateOne) SetCaption

func (fuo *FileUpdateOne) SetCaption(s string) *FileUpdateOne

SetCaption sets the "caption" field.

func (*FileUpdateOne) SetCreatedAt

func (fuo *FileUpdateOne) SetCreatedAt(t time.Time) *FileUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FileUpdateOne) SetCreatedBy

func (fuo *FileUpdateOne) SetCreatedBy(u *User) *FileUpdateOne

SetCreatedBy sets the "created_by" edge to the User entity.

func (*FileUpdateOne) SetCreatedByID

func (fuo *FileUpdateOne) SetCreatedByID(id string) *FileUpdateOne

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*FileUpdateOne) SetInput

SetInput applies the change-set in the UpdateFileInput on the FileUpdateOne builder.

func (*FileUpdateOne) SetMimeType

func (fuo *FileUpdateOne) SetMimeType(s string) *FileUpdateOne

SetMimeType sets the "mime_type" field.

func (*FileUpdateOne) SetName

func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne

SetName sets the "name" field.

func (*FileUpdateOne) SetNillableAdminCreatedByID

func (fuo *FileUpdateOne) SetNillableAdminCreatedByID(id *string) *FileUpdateOne

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*FileUpdateOne) SetNillableAdminUpdatedByID

func (fuo *FileUpdateOne) SetNillableAdminUpdatedByID(id *string) *FileUpdateOne

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*FileUpdateOne) SetNillableCaption

func (fuo *FileUpdateOne) SetNillableCaption(s *string) *FileUpdateOne

SetNillableCaption sets the "caption" field if the given value is not nil.

func (*FileUpdateOne) SetNillableCreatedAt

func (fuo *FileUpdateOne) SetNillableCreatedAt(t *time.Time) *FileUpdateOne

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

func (*FileUpdateOne) SetNillableCreatedByID

func (fuo *FileUpdateOne) SetNillableCreatedByID(id *string) *FileUpdateOne

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*FileUpdateOne) SetNillableMimeType

func (fuo *FileUpdateOne) SetNillableMimeType(s *string) *FileUpdateOne

SetNillableMimeType sets the "mime_type" field if the given value is not nil.

func (*FileUpdateOne) SetNillableName

func (fuo *FileUpdateOne) SetNillableName(s *string) *FileUpdateOne

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

func (*FileUpdateOne) SetNillableSize

func (fuo *FileUpdateOne) SetNillableSize(i *int64) *FileUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdateOne) SetNillableStorageFileName

func (fuo *FileUpdateOne) SetNillableStorageFileName(s *string) *FileUpdateOne

SetNillableStorageFileName sets the "storage_file_name" field if the given value is not nil.

func (*FileUpdateOne) SetNillableUpdatedByID

func (fuo *FileUpdateOne) SetNillableUpdatedByID(id *string) *FileUpdateOne

SetNillableUpdatedByID sets the "updated_by" edge to the User entity by ID if the given value is not nil.

func (*FileUpdateOne) SetSize

func (fuo *FileUpdateOne) SetSize(i int64) *FileUpdateOne

SetSize sets the "size" field.

func (*FileUpdateOne) SetStorageFileName

func (fuo *FileUpdateOne) SetStorageFileName(s string) *FileUpdateOne

SetStorageFileName sets the "storage_file_name" field.

func (*FileUpdateOne) SetUpdatedAt

func (fuo *FileUpdateOne) SetUpdatedAt(t time.Time) *FileUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdateOne) SetUpdatedBy

func (fuo *FileUpdateOne) SetUpdatedBy(u *User) *FileUpdateOne

SetUpdatedBy sets the "updated_by" edge to the User entity.

func (*FileUpdateOne) SetUpdatedByID

func (fuo *FileUpdateOne) SetUpdatedByID(id string) *FileUpdateOne

SetUpdatedByID sets the "updated_by" edge to the User entity by ID.

func (*FileUpdateOne) Where

func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type FileUpsert

type FileUpsert struct {
	*sql.UpdateSet
}

FileUpsert is the "OnConflict" setter.

func (*FileUpsert) AddSize

func (u *FileUpsert) AddSize(v int64) *FileUpsert

AddSize adds v to the "size" field.

func (*FileUpsert) ClearCaption

func (u *FileUpsert) ClearCaption() *FileUpsert

ClearCaption clears the value of the "caption" field.

func (*FileUpsert) ClearCreatedAt

func (u *FileUpsert) ClearCreatedAt() *FileUpsert

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpsert) ClearUpdatedAt

func (u *FileUpsert) ClearUpdatedAt() *FileUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*FileUpsert) SetCaption

func (u *FileUpsert) SetCaption(v string) *FileUpsert

SetCaption sets the "caption" field.

func (*FileUpsert) SetCreatedAt

func (u *FileUpsert) SetCreatedAt(v time.Time) *FileUpsert

SetCreatedAt sets the "created_at" field.

func (*FileUpsert) SetMimeType

func (u *FileUpsert) SetMimeType(v string) *FileUpsert

SetMimeType sets the "mime_type" field.

func (*FileUpsert) SetName

func (u *FileUpsert) SetName(v string) *FileUpsert

SetName sets the "name" field.

func (*FileUpsert) SetSize

func (u *FileUpsert) SetSize(v int64) *FileUpsert

SetSize sets the "size" field.

func (*FileUpsert) SetStorageFileName

func (u *FileUpsert) SetStorageFileName(v string) *FileUpsert

SetStorageFileName sets the "storage_file_name" field.

func (*FileUpsert) SetUpdatedAt

func (u *FileUpsert) SetUpdatedAt(v time.Time) *FileUpsert

SetUpdatedAt sets the "updated_at" field.

func (*FileUpsert) UpdateCaption

func (u *FileUpsert) UpdateCaption() *FileUpsert

UpdateCaption sets the "caption" field to the value that was provided on create.

func (*FileUpsert) UpdateCreatedAt

func (u *FileUpsert) UpdateCreatedAt() *FileUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FileUpsert) UpdateMimeType

func (u *FileUpsert) UpdateMimeType() *FileUpsert

UpdateMimeType sets the "mime_type" field to the value that was provided on create.

func (*FileUpsert) UpdateName

func (u *FileUpsert) UpdateName() *FileUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*FileUpsert) UpdateSize

func (u *FileUpsert) UpdateSize() *FileUpsert

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsert) UpdateStorageFileName

func (u *FileUpsert) UpdateStorageFileName() *FileUpsert

UpdateStorageFileName sets the "storage_file_name" field to the value that was provided on create.

func (*FileUpsert) UpdateUpdatedAt

func (u *FileUpsert) UpdateUpdatedAt() *FileUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type FileUpsertBulk

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

FileUpsertBulk is the builder for "upsert"-ing a bulk of File nodes.

func (*FileUpsertBulk) AddSize

func (u *FileUpsertBulk) AddSize(v int64) *FileUpsertBulk

AddSize adds v to the "size" field.

func (*FileUpsertBulk) ClearCaption

func (u *FileUpsertBulk) ClearCaption() *FileUpsertBulk

ClearCaption clears the value of the "caption" field.

func (*FileUpsertBulk) ClearCreatedAt

func (u *FileUpsertBulk) ClearCreatedAt() *FileUpsertBulk

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpsertBulk) ClearUpdatedAt

func (u *FileUpsertBulk) ClearUpdatedAt() *FileUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*FileUpsertBulk) DoNothing

func (u *FileUpsertBulk) DoNothing() *FileUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FileUpsertBulk) Exec

func (u *FileUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpsertBulk) ExecX

func (u *FileUpsertBulk) ExecX(ctx context.Context)

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

func (*FileUpsertBulk) Ignore

func (u *FileUpsertBulk) Ignore() *FileUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.File.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*FileUpsertBulk) SetCaption

func (u *FileUpsertBulk) SetCaption(v string) *FileUpsertBulk

SetCaption sets the "caption" field.

func (*FileUpsertBulk) SetCreatedAt

func (u *FileUpsertBulk) SetCreatedAt(v time.Time) *FileUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*FileUpsertBulk) SetMimeType

func (u *FileUpsertBulk) SetMimeType(v string) *FileUpsertBulk

SetMimeType sets the "mime_type" field.

func (*FileUpsertBulk) SetName

func (u *FileUpsertBulk) SetName(v string) *FileUpsertBulk

SetName sets the "name" field.

func (*FileUpsertBulk) SetSize

func (u *FileUpsertBulk) SetSize(v int64) *FileUpsertBulk

SetSize sets the "size" field.

func (*FileUpsertBulk) SetStorageFileName

func (u *FileUpsertBulk) SetStorageFileName(v string) *FileUpsertBulk

SetStorageFileName sets the "storage_file_name" field.

func (*FileUpsertBulk) SetUpdatedAt

func (u *FileUpsertBulk) SetUpdatedAt(v time.Time) *FileUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*FileUpsertBulk) Update

func (u *FileUpsertBulk) Update(set func(*FileUpsert)) *FileUpsertBulk

Update allows overriding fields `UPDATE` values. See the FileCreateBulk.OnConflict documentation for more info.

func (*FileUpsertBulk) UpdateCaption

func (u *FileUpsertBulk) UpdateCaption() *FileUpsertBulk

UpdateCaption sets the "caption" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateCreatedAt

func (u *FileUpsertBulk) UpdateCreatedAt() *FileUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateMimeType

func (u *FileUpsertBulk) UpdateMimeType() *FileUpsertBulk

UpdateMimeType sets the "mime_type" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateName

func (u *FileUpsertBulk) UpdateName() *FileUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateNewValues

func (u *FileUpsertBulk) UpdateNewValues() *FileUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.File.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(file.FieldID)
		}),
	).
	Exec(ctx)

func (*FileUpsertBulk) UpdateSize

func (u *FileUpsertBulk) UpdateSize() *FileUpsertBulk

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateStorageFileName

func (u *FileUpsertBulk) UpdateStorageFileName() *FileUpsertBulk

UpdateStorageFileName sets the "storage_file_name" field to the value that was provided on create.

func (*FileUpsertBulk) UpdateUpdatedAt

func (u *FileUpsertBulk) UpdateUpdatedAt() *FileUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type FileUpsertOne

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

FileUpsertOne is the builder for "upsert"-ing

one File node.

func (*FileUpsertOne) AddSize

func (u *FileUpsertOne) AddSize(v int64) *FileUpsertOne

AddSize adds v to the "size" field.

func (*FileUpsertOne) ClearCaption

func (u *FileUpsertOne) ClearCaption() *FileUpsertOne

ClearCaption clears the value of the "caption" field.

func (*FileUpsertOne) ClearCreatedAt

func (u *FileUpsertOne) ClearCreatedAt() *FileUpsertOne

ClearCreatedAt clears the value of the "created_at" field.

func (*FileUpsertOne) ClearUpdatedAt

func (u *FileUpsertOne) ClearUpdatedAt() *FileUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*FileUpsertOne) DoNothing

func (u *FileUpsertOne) DoNothing() *FileUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*FileUpsertOne) Exec

func (u *FileUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpsertOne) ExecX

func (u *FileUpsertOne) ExecX(ctx context.Context)

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

func (*FileUpsertOne) ID

func (u *FileUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*FileUpsertOne) IDX

func (u *FileUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*FileUpsertOne) Ignore

func (u *FileUpsertOne) Ignore() *FileUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.File.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*FileUpsertOne) SetCaption

func (u *FileUpsertOne) SetCaption(v string) *FileUpsertOne

SetCaption sets the "caption" field.

func (*FileUpsertOne) SetCreatedAt

func (u *FileUpsertOne) SetCreatedAt(v time.Time) *FileUpsertOne

SetCreatedAt sets the "created_at" field.

func (*FileUpsertOne) SetMimeType

func (u *FileUpsertOne) SetMimeType(v string) *FileUpsertOne

SetMimeType sets the "mime_type" field.

func (*FileUpsertOne) SetName

func (u *FileUpsertOne) SetName(v string) *FileUpsertOne

SetName sets the "name" field.

func (*FileUpsertOne) SetSize

func (u *FileUpsertOne) SetSize(v int64) *FileUpsertOne

SetSize sets the "size" field.

func (*FileUpsertOne) SetStorageFileName

func (u *FileUpsertOne) SetStorageFileName(v string) *FileUpsertOne

SetStorageFileName sets the "storage_file_name" field.

func (*FileUpsertOne) SetUpdatedAt

func (u *FileUpsertOne) SetUpdatedAt(v time.Time) *FileUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*FileUpsertOne) Update

func (u *FileUpsertOne) Update(set func(*FileUpsert)) *FileUpsertOne

Update allows overriding fields `UPDATE` values. See the FileCreate.OnConflict documentation for more info.

func (*FileUpsertOne) UpdateCaption

func (u *FileUpsertOne) UpdateCaption() *FileUpsertOne

UpdateCaption sets the "caption" field to the value that was provided on create.

func (*FileUpsertOne) UpdateCreatedAt

func (u *FileUpsertOne) UpdateCreatedAt() *FileUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*FileUpsertOne) UpdateMimeType

func (u *FileUpsertOne) UpdateMimeType() *FileUpsertOne

UpdateMimeType sets the "mime_type" field to the value that was provided on create.

func (*FileUpsertOne) UpdateName

func (u *FileUpsertOne) UpdateName() *FileUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*FileUpsertOne) UpdateNewValues

func (u *FileUpsertOne) UpdateNewValues() *FileUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.File.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(file.FieldID)
		}),
	).
	Exec(ctx)

func (*FileUpsertOne) UpdateSize

func (u *FileUpsertOne) UpdateSize() *FileUpsertOne

UpdateSize sets the "size" field to the value that was provided on create.

func (*FileUpsertOne) UpdateStorageFileName

func (u *FileUpsertOne) UpdateStorageFileName() *FileUpsertOne

UpdateStorageFileName sets the "storage_file_name" field to the value that was provided on create.

func (*FileUpsertOne) UpdateUpdatedAt

func (u *FileUpsertOne) UpdateUpdatedAt() *FileUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type FileWhereInput

type FileWhereInput struct {
	Predicates []predicate.File  `json:"-"`
	Not        *FileWhereInput   `json:"not,omitempty"`
	Or         []*FileWhereInput `json:"or,omitempty"`
	And        []*FileWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt       *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ    *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn     []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn  []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT     *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE    *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT     *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE    *time.Time  `json:"updatedAtLTE,omitempty"`
	UpdatedAtIsNil  bool        `json:"updatedAtIsNil,omitempty"`
	UpdatedAtNotNil bool        `json:"updatedAtNotNil,omitempty"`

	// "caption" field predicates.
	Caption             *string  `json:"caption,omitempty"`
	CaptionNEQ          *string  `json:"captionNEQ,omitempty"`
	CaptionIn           []string `json:"captionIn,omitempty"`
	CaptionNotIn        []string `json:"captionNotIn,omitempty"`
	CaptionGT           *string  `json:"captionGT,omitempty"`
	CaptionGTE          *string  `json:"captionGTE,omitempty"`
	CaptionLT           *string  `json:"captionLT,omitempty"`
	CaptionLTE          *string  `json:"captionLTE,omitempty"`
	CaptionContains     *string  `json:"captionContains,omitempty"`
	CaptionHasPrefix    *string  `json:"captionHasPrefix,omitempty"`
	CaptionHasSuffix    *string  `json:"captionHasSuffix,omitempty"`
	CaptionIsNil        bool     `json:"captionIsNil,omitempty"`
	CaptionNotNil       bool     `json:"captionNotNil,omitempty"`
	CaptionEqualFold    *string  `json:"captionEqualFold,omitempty"`
	CaptionContainsFold *string  `json:"captionContainsFold,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "mime_type" field predicates.
	MimeType             *string  `json:"mimeType,omitempty"`
	MimeTypeNEQ          *string  `json:"mimeTypeNEQ,omitempty"`
	MimeTypeIn           []string `json:"mimeTypeIn,omitempty"`
	MimeTypeNotIn        []string `json:"mimeTypeNotIn,omitempty"`
	MimeTypeGT           *string  `json:"mimeTypeGT,omitempty"`
	MimeTypeGTE          *string  `json:"mimeTypeGTE,omitempty"`
	MimeTypeLT           *string  `json:"mimeTypeLT,omitempty"`
	MimeTypeLTE          *string  `json:"mimeTypeLTE,omitempty"`
	MimeTypeContains     *string  `json:"mimeTypeContains,omitempty"`
	MimeTypeHasPrefix    *string  `json:"mimeTypeHasPrefix,omitempty"`
	MimeTypeHasSuffix    *string  `json:"mimeTypeHasSuffix,omitempty"`
	MimeTypeEqualFold    *string  `json:"mimeTypeEqualFold,omitempty"`
	MimeTypeContainsFold *string  `json:"mimeTypeContainsFold,omitempty"`

	// "storage_file_name" field predicates.
	StorageFileName             *string  `json:"storageFileName,omitempty"`
	StorageFileNameNEQ          *string  `json:"storageFileNameNEQ,omitempty"`
	StorageFileNameIn           []string `json:"storageFileNameIn,omitempty"`
	StorageFileNameNotIn        []string `json:"storageFileNameNotIn,omitempty"`
	StorageFileNameGT           *string  `json:"storageFileNameGT,omitempty"`
	StorageFileNameGTE          *string  `json:"storageFileNameGTE,omitempty"`
	StorageFileNameLT           *string  `json:"storageFileNameLT,omitempty"`
	StorageFileNameLTE          *string  `json:"storageFileNameLTE,omitempty"`
	StorageFileNameContains     *string  `json:"storageFileNameContains,omitempty"`
	StorageFileNameHasPrefix    *string  `json:"storageFileNameHasPrefix,omitempty"`
	StorageFileNameHasSuffix    *string  `json:"storageFileNameHasSuffix,omitempty"`
	StorageFileNameEqualFold    *string  `json:"storageFileNameEqualFold,omitempty"`
	StorageFileNameContainsFold *string  `json:"storageFileNameContainsFold,omitempty"`

	// "size" field predicates.
	Size      *int64  `json:"size,omitempty"`
	SizeNEQ   *int64  `json:"sizeNEQ,omitempty"`
	SizeIn    []int64 `json:"sizeIn,omitempty"`
	SizeNotIn []int64 `json:"sizeNotIn,omitempty"`
	SizeGT    *int64  `json:"sizeGT,omitempty"`
	SizeGTE   *int64  `json:"sizeGTE,omitempty"`
	SizeLT    *int64  `json:"sizeLT,omitempty"`
	SizeLTE   *int64  `json:"sizeLTE,omitempty"`

	// "admin_created_by" edge predicates.
	HasAdminCreatedBy     *bool                  `json:"hasAdminCreatedBy,omitempty"`
	HasAdminCreatedByWith []*AdminUserWhereInput `json:"hasAdminCreatedByWith,omitempty"`

	// "admin_updated_by" edge predicates.
	HasAdminUpdatedBy     *bool                  `json:"hasAdminUpdatedBy,omitempty"`
	HasAdminUpdatedByWith []*AdminUserWhereInput `json:"hasAdminUpdatedByWith,omitempty"`

	// "created_by" edge predicates.
	HasCreatedBy     *bool             `json:"hasCreatedBy,omitempty"`
	HasCreatedByWith []*UserWhereInput `json:"hasCreatedByWith,omitempty"`

	// "updated_by" edge predicates.
	HasUpdatedBy     *bool             `json:"hasUpdatedBy,omitempty"`
	HasUpdatedByWith []*UserWhereInput `json:"hasUpdatedByWith,omitempty"`
}

FileWhereInput represents a where input for filtering File queries.

func (*FileWhereInput) AddPredicates

func (i *FileWhereInput) AddPredicates(predicates ...predicate.File)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*FileWhereInput) Filter

func (i *FileWhereInput) Filter(q *FileQuery) (*FileQuery, error)

Filter applies the FileWhereInput filter on the FileQuery builder.

func (*FileWhereInput) P

func (i *FileWhereInput) P() (predicate.File, error)

P returns a predicate for filtering files. An error is returned if the input is empty or invalid.

type FileWhereUniqueInput

type FileWhereUniqueInput struct {
	Predicates []predicate.File `json:"-"`

	ID      *string `json:"id,omitempty"`
	Caption *string `json:"caption,omitempty"`
}

FileWhereUniqueInput represents a where input for filtering File queries.

func (*FileWhereUniqueInput) AddPredicates

func (i *FileWhereUniqueInput) AddPredicates(predicates ...predicate.File)

func (*FileWhereUniqueInput) Filter

func (i *FileWhereUniqueInput) Filter(q *FileQuery) (*FileQuery, error)

func (*FileWhereUniqueInput) P

type Files

type Files []*File

Files is a parsable slice of File.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, string) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

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 PageInfo

type PageInfo = entgql.PageInfo[string]

Common entgql types.

type Permission

type Permission struct {

	// ID of the ent.
	ID string `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"`
	// Entity holds the value of the "entity" field.
	Entity string `json:"entity,omitempty"`
	// Operation holds the value of the "operation" field.
	Operation string `json:"operation,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PermissionQuery when eager-loading is set.
	Edges PermissionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Permission is the model entity for the Permission schema.

func (*Permission) AdminCreatedBy

func (pe *Permission) AdminCreatedBy(ctx context.Context) (*AdminUser, error)

func (*Permission) AdminUpdatedBy

func (pe *Permission) AdminUpdatedBy(ctx context.Context) (*AdminUser, error)

func (*Permission) ExecContext

func (c *Permission) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Permission) IsNode

func (*Permission) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Permission) QueryAdminCreatedBy

func (pe *Permission) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy queries the "admin_created_by" edge of the Permission entity.

func (*Permission) QueryAdminUpdatedBy

func (pe *Permission) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy queries the "admin_updated_by" edge of the Permission entity.

func (*Permission) QueryContext

func (c *Permission) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Permission) QueryRole

func (pe *Permission) QueryRole() *RoleQuery

QueryRole queries the "role" edge of the Permission entity.

func (*Permission) Role

func (pe *Permission) Role(ctx context.Context) (*Role, error)

func (*Permission) String

func (pe *Permission) String() string

String implements the fmt.Stringer.

func (*Permission) ToEdge

func (pe *Permission) ToEdge(order *PermissionOrder) *PermissionEdge

ToEdge converts Permission into PermissionEdge.

func (*Permission) Unwrap

func (pe *Permission) Unwrap() *Permission

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

func (pe *Permission) Update() *PermissionUpdateOne

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

func (*Permission) Value

func (pe *Permission) Value(name string) (ent.Value, error)

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

type PermissionClient

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

PermissionClient is a client for the Permission schema.

func NewPermissionClient

func NewPermissionClient(c config) *PermissionClient

NewPermissionClient returns a client for the Permission from the given config.

func (*PermissionClient) Create

func (c *PermissionClient) Create() *PermissionCreate

Create returns a builder for creating a Permission entity.

func (*PermissionClient) CreateBulk

func (c *PermissionClient) CreateBulk(builders ...*PermissionCreate) *PermissionCreateBulk

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

func (*PermissionClient) Delete

func (c *PermissionClient) Delete() *PermissionDelete

Delete returns a delete builder for Permission.

func (*PermissionClient) DeleteOne

func (c *PermissionClient) DeleteOne(pe *Permission) *PermissionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PermissionClient) DeleteOneID

func (c *PermissionClient) DeleteOneID(id string) *PermissionDeleteOne

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

func (*PermissionClient) ExecContext

func (c *PermissionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionClient) Get

func (c *PermissionClient) Get(ctx context.Context, id string) (*Permission, error)

Get returns a Permission entity by its id.

func (*PermissionClient) GetX

func (c *PermissionClient) GetX(ctx context.Context, id string) *Permission

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

func (*PermissionClient) Hooks

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

Hooks returns the client hooks.

func (*PermissionClient) Intercept

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

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

func (*PermissionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PermissionClient) MapCreateBulk

func (c *PermissionClient) MapCreateBulk(slice any, setFunc func(*PermissionCreate, int)) *PermissionCreateBulk

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

func (c *PermissionClient) Query() *PermissionQuery

Query returns a query builder for Permission.

func (*PermissionClient) QueryAdminCreatedBy

func (c *PermissionClient) QueryAdminCreatedBy(pe *Permission) *AdminUserQuery

QueryAdminCreatedBy queries the admin_created_by edge of a Permission.

func (*PermissionClient) QueryAdminUpdatedBy

func (c *PermissionClient) QueryAdminUpdatedBy(pe *Permission) *AdminUserQuery

QueryAdminUpdatedBy queries the admin_updated_by edge of a Permission.

func (*PermissionClient) QueryContext

func (c *PermissionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionClient) QueryRole

func (c *PermissionClient) QueryRole(pe *Permission) *RoleQuery

QueryRole queries the role edge of a Permission.

func (*PermissionClient) Update

func (c *PermissionClient) Update() *PermissionUpdate

Update returns an update builder for Permission.

func (*PermissionClient) UpdateOne

func (c *PermissionClient) UpdateOne(pe *Permission) *PermissionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PermissionClient) UpdateOneID

func (c *PermissionClient) UpdateOneID(id string) *PermissionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PermissionClient) Use

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

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

type PermissionConnection

type PermissionConnection struct {
	Edges      []*PermissionEdge `json:"edges"`
	PageInfo   PageInfo          `json:"pageInfo"`
	TotalCount int               `json:"totalCount"`
}

PermissionConnection is the connection containing edges to Permission.

type PermissionCreate

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

PermissionCreate is the builder for creating a Permission entity.

func (*PermissionCreate) Exec

func (pc *PermissionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PermissionCreate) ExecContext

func (c *PermissionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionCreate) ExecX

func (pc *PermissionCreate) ExecX(ctx context.Context)

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

func (*PermissionCreate) Mutation

func (pc *PermissionCreate) Mutation() *PermissionMutation

Mutation returns the PermissionMutation object of the builder.

func (*PermissionCreate) OnConflict

func (pc *PermissionCreate) OnConflict(opts ...sql.ConflictOption) *PermissionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Permission.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PermissionUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PermissionCreate) OnConflictColumns

func (pc *PermissionCreate) OnConflictColumns(columns ...string) *PermissionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Permission.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PermissionCreate) QueryContext

func (c *PermissionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionCreate) Save

func (pc *PermissionCreate) Save(ctx context.Context) (*Permission, error)

Save creates the Permission in the database.

func (*PermissionCreate) SaveX

func (pc *PermissionCreate) SaveX(ctx context.Context) *Permission

SaveX calls Save and panics if Save returns an error.

func (*PermissionCreate) SetAdminCreatedBy

func (pc *PermissionCreate) SetAdminCreatedBy(a *AdminUser) *PermissionCreate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*PermissionCreate) SetAdminCreatedByID

func (pc *PermissionCreate) SetAdminCreatedByID(id string) *PermissionCreate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*PermissionCreate) SetAdminUpdatedBy

func (pc *PermissionCreate) SetAdminUpdatedBy(a *AdminUser) *PermissionCreate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*PermissionCreate) SetAdminUpdatedByID

func (pc *PermissionCreate) SetAdminUpdatedByID(id string) *PermissionCreate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*PermissionCreate) SetCreatedAt

func (pc *PermissionCreate) SetCreatedAt(t time.Time) *PermissionCreate

SetCreatedAt sets the "created_at" field.

func (*PermissionCreate) SetEntity

func (pc *PermissionCreate) SetEntity(s string) *PermissionCreate

SetEntity sets the "entity" field.

func (*PermissionCreate) SetID

SetID sets the "id" field.

func (*PermissionCreate) SetInput

SetInput applies the change-set in the CreatePermissionInput on the PermissionCreate builder.

func (*PermissionCreate) SetNillableAdminCreatedByID

func (pc *PermissionCreate) SetNillableAdminCreatedByID(id *string) *PermissionCreate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*PermissionCreate) SetNillableAdminUpdatedByID

func (pc *PermissionCreate) SetNillableAdminUpdatedByID(id *string) *PermissionCreate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*PermissionCreate) SetNillableCreatedAt

func (pc *PermissionCreate) SetNillableCreatedAt(t *time.Time) *PermissionCreate

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

func (*PermissionCreate) SetNillableID

func (pc *PermissionCreate) SetNillableID(s *string) *PermissionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PermissionCreate) SetNillableOperation

func (pc *PermissionCreate) SetNillableOperation(s *string) *PermissionCreate

SetNillableOperation sets the "operation" field if the given value is not nil.

func (*PermissionCreate) SetNillableRoleID

func (pc *PermissionCreate) SetNillableRoleID(id *string) *PermissionCreate

SetNillableRoleID sets the "role" edge to the Role entity by ID if the given value is not nil.

func (*PermissionCreate) SetNillableUpdatedAt

func (pc *PermissionCreate) SetNillableUpdatedAt(t *time.Time) *PermissionCreate

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

func (*PermissionCreate) SetOperation

func (pc *PermissionCreate) SetOperation(s string) *PermissionCreate

SetOperation sets the "operation" field.

func (*PermissionCreate) SetRole

func (pc *PermissionCreate) SetRole(r *Role) *PermissionCreate

SetRole sets the "role" edge to the Role entity.

func (*PermissionCreate) SetRoleID

func (pc *PermissionCreate) SetRoleID(id string) *PermissionCreate

SetRoleID sets the "role" edge to the Role entity by ID.

func (*PermissionCreate) SetUpdatedAt

func (pc *PermissionCreate) SetUpdatedAt(t time.Time) *PermissionCreate

SetUpdatedAt sets the "updated_at" field.

type PermissionCreateBulk

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

PermissionCreateBulk is the builder for creating many Permission entities in bulk.

func (*PermissionCreateBulk) Exec

func (pcb *PermissionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PermissionCreateBulk) ExecContext

func (c *PermissionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionCreateBulk) ExecX

func (pcb *PermissionCreateBulk) ExecX(ctx context.Context)

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

func (*PermissionCreateBulk) OnConflict

func (pcb *PermissionCreateBulk) OnConflict(opts ...sql.ConflictOption) *PermissionUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Permission.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PermissionUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PermissionCreateBulk) OnConflictColumns

func (pcb *PermissionCreateBulk) OnConflictColumns(columns ...string) *PermissionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Permission.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PermissionCreateBulk) QueryContext

func (c *PermissionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionCreateBulk) Save

func (pcb *PermissionCreateBulk) Save(ctx context.Context) ([]*Permission, error)

Save creates the Permission entities in the database.

func (*PermissionCreateBulk) SaveX

func (pcb *PermissionCreateBulk) SaveX(ctx context.Context) []*Permission

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

type PermissionDelete

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

PermissionDelete is the builder for deleting a Permission entity.

func (*PermissionDelete) Exec

func (pd *PermissionDelete) Exec(ctx context.Context) (int, error)

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

func (*PermissionDelete) ExecContext

func (c *PermissionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionDelete) ExecX

func (pd *PermissionDelete) ExecX(ctx context.Context) int

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

func (*PermissionDelete) QueryContext

func (c *PermissionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionDelete) Where

Where appends a list predicates to the PermissionDelete builder.

type PermissionDeleteOne

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

PermissionDeleteOne is the builder for deleting a single Permission entity.

func (*PermissionDeleteOne) Exec

func (pdo *PermissionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PermissionDeleteOne) ExecX

func (pdo *PermissionDeleteOne) ExecX(ctx context.Context)

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

func (*PermissionDeleteOne) Where

Where appends a list predicates to the PermissionDelete builder.

type PermissionEdge

type PermissionEdge struct {
	Node   *Permission `json:"node"`
	Cursor Cursor      `json:"cursor"`
}

PermissionEdge is the edge representation of Permission.

type PermissionEdges

type PermissionEdges struct {
	// AdminCreatedBy holds the value of the admin_created_by edge.
	AdminCreatedBy *AdminUser `json:"admin_created_by,omitempty"`
	// AdminUpdatedBy holds the value of the admin_updated_by edge.
	AdminUpdatedBy *AdminUser `json:"admin_updated_by,omitempty"`
	// Role holds the value of the role edge.
	Role *Role `json:"role,omitempty"`
	// contains filtered or unexported fields
}

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

func (PermissionEdges) AdminCreatedByOrErr

func (e PermissionEdges) AdminCreatedByOrErr() (*AdminUser, error)

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

func (PermissionEdges) AdminUpdatedByOrErr

func (e PermissionEdges) AdminUpdatedByOrErr() (*AdminUser, error)

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

func (PermissionEdges) RoleOrErr

func (e PermissionEdges) RoleOrErr() (*Role, error)

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

type PermissionGroupBy

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

PermissionGroupBy is the group-by builder for Permission entities.

func (*PermissionGroupBy) Aggregate

func (pgb *PermissionGroupBy) Aggregate(fns ...AggregateFunc) *PermissionGroupBy

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

func (*PermissionGroupBy) Bool

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

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

func (*PermissionGroupBy) BoolX

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

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

func (*PermissionGroupBy) Bools

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

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

func (*PermissionGroupBy) BoolsX

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

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

func (*PermissionGroupBy) Float64

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

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

func (*PermissionGroupBy) Float64X

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

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

func (*PermissionGroupBy) Float64s

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

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

func (*PermissionGroupBy) Float64sX

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

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

func (*PermissionGroupBy) Int

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

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

func (*PermissionGroupBy) IntX

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

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

func (*PermissionGroupBy) Ints

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

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

func (*PermissionGroupBy) IntsX

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

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

func (*PermissionGroupBy) Scan

func (pgb *PermissionGroupBy) Scan(ctx context.Context, v any) error

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

func (*PermissionGroupBy) ScanX

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

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

func (*PermissionGroupBy) String

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

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

func (*PermissionGroupBy) StringX

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

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

func (*PermissionGroupBy) Strings

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

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

func (*PermissionGroupBy) StringsX

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

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

type PermissionMutation

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

PermissionMutation represents an operation that mutates the Permission nodes in the graph.

func (*PermissionMutation) AddEdges

func (m *PermissionMutation) AddEdges(name string, values []string) error

AddEdges sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*PermissionMutation) AddField

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

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

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

func (*PermissionMutation) AddedField

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

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

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

func (*PermissionMutation) AddedIDs

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

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

func (*PermissionMutation) AdminCreatedByCleared

func (m *PermissionMutation) AdminCreatedByCleared() bool

AdminCreatedByCleared reports if the "admin_created_by" edge to the AdminUser entity was cleared.

func (*PermissionMutation) AdminCreatedByID

func (m *PermissionMutation) AdminCreatedByID() (id string, exists bool)

AdminCreatedByID returns the "admin_created_by" edge ID in the mutation.

func (*PermissionMutation) AdminCreatedByIDs

func (m *PermissionMutation) AdminCreatedByIDs() (ids []string)

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

func (*PermissionMutation) AdminUpdatedByCleared

func (m *PermissionMutation) AdminUpdatedByCleared() bool

AdminUpdatedByCleared reports if the "admin_updated_by" edge to the AdminUser entity was cleared.

func (*PermissionMutation) AdminUpdatedByID

func (m *PermissionMutation) AdminUpdatedByID() (id string, exists bool)

AdminUpdatedByID returns the "admin_updated_by" edge ID in the mutation.

func (*PermissionMutation) AdminUpdatedByIDs

func (m *PermissionMutation) AdminUpdatedByIDs() (ids []string)

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

func (*PermissionMutation) ClearAdminCreatedBy

func (m *PermissionMutation) ClearAdminCreatedBy()

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*PermissionMutation) ClearAdminUpdatedBy

func (m *PermissionMutation) ClearAdminUpdatedBy()

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*PermissionMutation) ClearCreatedAt

func (m *PermissionMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*PermissionMutation) ClearEdge

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

func (m *PermissionMutation) 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 (*PermissionMutation) ClearRole

func (m *PermissionMutation) ClearRole()

ClearRole clears the "role" edge to the Role entity.

func (*PermissionMutation) ClearUpdatedAt

func (m *PermissionMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PermissionMutation) ClearedEdges

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

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

func (*PermissionMutation) ClearedFields

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

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

func (PermissionMutation) Client

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

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

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

func (*PermissionMutation) CreatedAtCleared

func (m *PermissionMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*PermissionMutation) EdgeCleared

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

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

func (*PermissionMutation) Entity

func (m *PermissionMutation) Entity() (r string, exists bool)

Entity returns the value of the "entity" field in the mutation.

func (*PermissionMutation) ExecContext

func (c *PermissionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionMutation) Field

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

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

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

func (*PermissionMutation) Fields

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

func (m *PermissionMutation) ID() (id string, 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 (*PermissionMutation) IDs

func (m *PermissionMutation) IDs(ctx context.Context) ([]string, 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 (*PermissionMutation) OldCreatedAt

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

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

func (*PermissionMutation) OldEntity

func (m *PermissionMutation) OldEntity(ctx context.Context) (v string, err error)

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

func (*PermissionMutation) OldField

func (m *PermissionMutation) 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 (*PermissionMutation) OldOperation

func (m *PermissionMutation) OldOperation(ctx context.Context) (v string, err error)

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

func (*PermissionMutation) OldUpdatedAt

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

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

func (*PermissionMutation) Op

func (m *PermissionMutation) Op() Op

Op returns the operation name.

func (*PermissionMutation) Operation

func (m *PermissionMutation) Operation() (r string, exists bool)

Operation returns the value of the "operation" field in the mutation.

func (*PermissionMutation) QueryContext

func (c *PermissionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionMutation) RemovedEdges

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

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

func (*PermissionMutation) RemovedIDs

func (m *PermissionMutation) 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 (*PermissionMutation) ResetAdminCreatedBy

func (m *PermissionMutation) ResetAdminCreatedBy()

ResetAdminCreatedBy resets all changes to the "admin_created_by" edge.

func (*PermissionMutation) ResetAdminUpdatedBy

func (m *PermissionMutation) ResetAdminUpdatedBy()

ResetAdminUpdatedBy resets all changes to the "admin_updated_by" edge.

func (*PermissionMutation) ResetCreatedAt

func (m *PermissionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PermissionMutation) ResetEdge

func (m *PermissionMutation) 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 (*PermissionMutation) ResetEntity

func (m *PermissionMutation) ResetEntity()

ResetEntity resets all changes to the "entity" field.

func (*PermissionMutation) ResetField

func (m *PermissionMutation) 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 (*PermissionMutation) ResetOperation

func (m *PermissionMutation) ResetOperation()

ResetOperation resets all changes to the "operation" field.

func (*PermissionMutation) ResetRole

func (m *PermissionMutation) ResetRole()

ResetRole resets all changes to the "role" edge.

func (*PermissionMutation) ResetUpdatedAt

func (m *PermissionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PermissionMutation) RoleCleared

func (m *PermissionMutation) RoleCleared() bool

RoleCleared reports if the "role" edge to the Role entity was cleared.

func (*PermissionMutation) RoleID

func (m *PermissionMutation) RoleID() (id string, exists bool)

RoleID returns the "role" edge ID in the mutation.

func (*PermissionMutation) RoleIDs

func (m *PermissionMutation) RoleIDs() (ids []string)

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

func (*PermissionMutation) SetAdminCreatedByID

func (m *PermissionMutation) SetAdminCreatedByID(id string)

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by id.

func (*PermissionMutation) SetAdminUpdatedByID

func (m *PermissionMutation) SetAdminUpdatedByID(id string)

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by id.

func (*PermissionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*PermissionMutation) SetEdge

func (m *PermissionMutation) SetEdge(name, value string) error

SetEdge sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*PermissionMutation) SetEntity

func (m *PermissionMutation) SetEntity(s string)

SetEntity sets the "entity" field.

func (*PermissionMutation) SetField

func (m *PermissionMutation) 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 (*PermissionMutation) SetID

func (m *PermissionMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Permission entities.

func (*PermissionMutation) SetOp

func (m *PermissionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PermissionMutation) SetOperation

func (m *PermissionMutation) SetOperation(s string)

SetOperation sets the "operation" field.

func (*PermissionMutation) SetRoleID

func (m *PermissionMutation) SetRoleID(id string)

SetRoleID sets the "role" edge to the Role entity by id.

func (*PermissionMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (PermissionMutation) Tx

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

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

func (*PermissionMutation) Type

func (m *PermissionMutation) Type() string

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

func (*PermissionMutation) UpdatedAt

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

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

func (*PermissionMutation) UpdatedAtCleared

func (m *PermissionMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*PermissionMutation) UpdatedFields

func (m *PermissionMutation) UpdatedFields() map[string]Value

UpdatedFields returns all fields and edges that were changed during this mutation.

func (*PermissionMutation) Where

func (m *PermissionMutation) Where(ps ...predicate.Permission)

Where appends a list predicates to the PermissionMutation builder.

func (*PermissionMutation) WhereP

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

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

type PermissionOrder

type PermissionOrder struct {
	Direction OrderDirection        `json:"direction"`
	Field     *PermissionOrderField `json:"field"`
}

PermissionOrder defines the ordering of Permission.

type PermissionOrderField

type PermissionOrderField struct {
	// Value extracts the ordering value from the given Permission.
	Value func(*Permission) (ent.Value, error)
	// contains filtered or unexported fields
}

PermissionOrderField defines the ordering field of Permission.

func (PermissionOrderField) MarshalGQL

func (f PermissionOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (PermissionOrderField) String

func (f PermissionOrderField) String() string

String implement fmt.Stringer interface.

func (*PermissionOrderField) UnmarshalGQL

func (f *PermissionOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type PermissionPaginateOption

type PermissionPaginateOption func(*permissionPager) error

PermissionPaginateOption enables pagination customization.

func WithPermissionFilter

func WithPermissionFilter(filter func(*PermissionQuery) (*PermissionQuery, error)) PermissionPaginateOption

WithPermissionFilter configures pagination filter.

func WithPermissionOrder

func WithPermissionOrder(order []*PermissionOrder) PermissionPaginateOption

WithPermissionOrder configures pagination ordering.

type PermissionQuery

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

PermissionQuery is the builder for querying Permission entities.

func (*PermissionQuery) Aggregate

func (pq *PermissionQuery) Aggregate(fns ...AggregateFunc) *PermissionSelect

Aggregate returns a PermissionSelect configured with the given aggregations.

func (*PermissionQuery) All

func (pq *PermissionQuery) All(ctx context.Context) ([]*Permission, error)

All executes the query and returns a list of Permissions.

func (*PermissionQuery) AllX

func (pq *PermissionQuery) AllX(ctx context.Context) []*Permission

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

func (*PermissionQuery) Clone

func (pq *PermissionQuery) Clone() *PermissionQuery

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

func (*PermissionQuery) CollectFields

func (pe *PermissionQuery) CollectFields(ctx context.Context, satisfies ...string) (*PermissionQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*PermissionQuery) Count

func (pq *PermissionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PermissionQuery) CountX

func (pq *PermissionQuery) CountX(ctx context.Context) int

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

func (*PermissionQuery) ExecContext

func (c *PermissionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionQuery) Exist

func (pq *PermissionQuery) Exist(ctx context.Context) (bool, error)

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

func (*PermissionQuery) ExistX

func (pq *PermissionQuery) ExistX(ctx context.Context) bool

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

func (*PermissionQuery) First

func (pq *PermissionQuery) First(ctx context.Context) (*Permission, error)

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

func (*PermissionQuery) FirstID

func (pq *PermissionQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*PermissionQuery) FirstIDX

func (pq *PermissionQuery) FirstIDX(ctx context.Context) string

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

func (*PermissionQuery) FirstX

func (pq *PermissionQuery) FirstX(ctx context.Context) *Permission

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

func (*PermissionQuery) GroupBy

func (pq *PermissionQuery) GroupBy(field string, fields ...string) *PermissionGroupBy

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.Permission.Query().
	GroupBy(permission.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PermissionQuery) IDs

func (pq *PermissionQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*PermissionQuery) IDsX

func (pq *PermissionQuery) IDsX(ctx context.Context) []string

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

func (*PermissionQuery) Limit

func (pq *PermissionQuery) Limit(limit int) *PermissionQuery

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

func (*PermissionQuery) Offset

func (pq *PermissionQuery) Offset(offset int) *PermissionQuery

Offset to start from.

func (*PermissionQuery) Only

func (pq *PermissionQuery) Only(ctx context.Context) (*Permission, error)

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

func (*PermissionQuery) OnlyID

func (pq *PermissionQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*PermissionQuery) OnlyIDX

func (pq *PermissionQuery) OnlyIDX(ctx context.Context) string

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

func (*PermissionQuery) OnlyX

func (pq *PermissionQuery) OnlyX(ctx context.Context) *Permission

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

func (*PermissionQuery) Order

Order specifies how the records should be ordered.

func (*PermissionQuery) Paginate

func (pe *PermissionQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...PermissionPaginateOption,
) (*PermissionConnection, error)

Paginate executes the query and returns a relay based cursor connection to Permission.

func (*PermissionQuery) QueryAdminCreatedBy

func (pq *PermissionQuery) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy chains the current query on the "admin_created_by" edge.

func (*PermissionQuery) QueryAdminUpdatedBy

func (pq *PermissionQuery) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy chains the current query on the "admin_updated_by" edge.

func (*PermissionQuery) QueryContext

func (c *PermissionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionQuery) QueryRole

func (pq *PermissionQuery) QueryRole() *RoleQuery

QueryRole chains the current query on the "role" edge.

func (*PermissionQuery) Select

func (pq *PermissionQuery) Select(fields ...string) *PermissionSelect

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

func (*PermissionQuery) Unique

func (pq *PermissionQuery) Unique(unique bool) *PermissionQuery

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

Where adds a new predicate for the PermissionQuery builder.

func (*PermissionQuery) WhereAdminCreatedBy

func (p *PermissionQuery) WhereAdminCreatedBy(adminUserID string) *PermissionQuery

WhereAdminCreatedBy adds a filter based on the AdminCreatedBy relationship. This method allows owner-based permission filtering by admin user ID.

func (*PermissionQuery) WithAdminCreatedBy

func (pq *PermissionQuery) WithAdminCreatedBy(opts ...func(*AdminUserQuery)) *PermissionQuery

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

func (*PermissionQuery) WithAdminUpdatedBy

func (pq *PermissionQuery) WithAdminUpdatedBy(opts ...func(*AdminUserQuery)) *PermissionQuery

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

func (*PermissionQuery) WithRole

func (pq *PermissionQuery) WithRole(opts ...func(*RoleQuery)) *PermissionQuery

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

type PermissionSelect

type PermissionSelect struct {
	*PermissionQuery
	// contains filtered or unexported fields
}

PermissionSelect is the builder for selecting fields of Permission entities.

func (*PermissionSelect) Aggregate

func (ps *PermissionSelect) Aggregate(fns ...AggregateFunc) *PermissionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PermissionSelect) Bool

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

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

func (*PermissionSelect) BoolX

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

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

func (*PermissionSelect) Bools

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

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

func (*PermissionSelect) BoolsX

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

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

func (PermissionSelect) ExecContext

func (c PermissionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionSelect) Float64

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

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

func (*PermissionSelect) Float64X

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

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

func (*PermissionSelect) Float64s

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

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

func (*PermissionSelect) Float64sX

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

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

func (*PermissionSelect) Int

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

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

func (*PermissionSelect) IntX

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

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

func (*PermissionSelect) Ints

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

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

func (*PermissionSelect) IntsX

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

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

func (PermissionSelect) QueryContext

func (c PermissionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionSelect) Scan

func (ps *PermissionSelect) Scan(ctx context.Context, v any) error

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

func (*PermissionSelect) ScanX

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

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

func (*PermissionSelect) String

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

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

func (*PermissionSelect) StringX

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

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

func (*PermissionSelect) Strings

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

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

func (*PermissionSelect) StringsX

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

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

type PermissionUpdate

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

PermissionUpdate is the builder for updating Permission entities.

func (*PermissionUpdate) ClearAdminCreatedBy

func (pu *PermissionUpdate) ClearAdminCreatedBy() *PermissionUpdate

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*PermissionUpdate) ClearAdminUpdatedBy

func (pu *PermissionUpdate) ClearAdminUpdatedBy() *PermissionUpdate

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*PermissionUpdate) ClearCreatedAt

func (pu *PermissionUpdate) ClearCreatedAt() *PermissionUpdate

ClearCreatedAt clears the value of the "created_at" field.

func (*PermissionUpdate) ClearRole

func (pu *PermissionUpdate) ClearRole() *PermissionUpdate

ClearRole clears the "role" edge to the Role entity.

func (*PermissionUpdate) ClearUpdatedAt

func (pu *PermissionUpdate) ClearUpdatedAt() *PermissionUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PermissionUpdate) Exec

func (pu *PermissionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PermissionUpdate) ExecContext

func (c *PermissionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionUpdate) ExecX

func (pu *PermissionUpdate) ExecX(ctx context.Context)

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

func (*PermissionUpdate) Mutation

func (pu *PermissionUpdate) Mutation() *PermissionMutation

Mutation returns the PermissionMutation object of the builder.

func (*PermissionUpdate) QueryContext

func (c *PermissionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionUpdate) Save

func (pu *PermissionUpdate) Save(ctx context.Context) (int, error)

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

func (*PermissionUpdate) SaveX

func (pu *PermissionUpdate) SaveX(ctx context.Context) int

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

func (*PermissionUpdate) SetAdminCreatedBy

func (pu *PermissionUpdate) SetAdminCreatedBy(a *AdminUser) *PermissionUpdate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*PermissionUpdate) SetAdminCreatedByID

func (pu *PermissionUpdate) SetAdminCreatedByID(id string) *PermissionUpdate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*PermissionUpdate) SetAdminUpdatedBy

func (pu *PermissionUpdate) SetAdminUpdatedBy(a *AdminUser) *PermissionUpdate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*PermissionUpdate) SetAdminUpdatedByID

func (pu *PermissionUpdate) SetAdminUpdatedByID(id string) *PermissionUpdate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*PermissionUpdate) SetCreatedAt

func (pu *PermissionUpdate) SetCreatedAt(t time.Time) *PermissionUpdate

SetCreatedAt sets the "created_at" field.

func (*PermissionUpdate) SetEntity

func (pu *PermissionUpdate) SetEntity(s string) *PermissionUpdate

SetEntity sets the "entity" field.

func (*PermissionUpdate) SetInput

SetInput applies the change-set in the UpdatePermissionInput on the PermissionUpdate builder.

func (*PermissionUpdate) SetNillableAdminCreatedByID

func (pu *PermissionUpdate) SetNillableAdminCreatedByID(id *string) *PermissionUpdate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*PermissionUpdate) SetNillableAdminUpdatedByID

func (pu *PermissionUpdate) SetNillableAdminUpdatedByID(id *string) *PermissionUpdate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*PermissionUpdate) SetNillableCreatedAt

func (pu *PermissionUpdate) SetNillableCreatedAt(t *time.Time) *PermissionUpdate

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

func (*PermissionUpdate) SetNillableEntity

func (pu *PermissionUpdate) SetNillableEntity(s *string) *PermissionUpdate

SetNillableEntity sets the "entity" field if the given value is not nil.

func (*PermissionUpdate) SetNillableOperation

func (pu *PermissionUpdate) SetNillableOperation(s *string) *PermissionUpdate

SetNillableOperation sets the "operation" field if the given value is not nil.

func (*PermissionUpdate) SetNillableRoleID

func (pu *PermissionUpdate) SetNillableRoleID(id *string) *PermissionUpdate

SetNillableRoleID sets the "role" edge to the Role entity by ID if the given value is not nil.

func (*PermissionUpdate) SetOperation

func (pu *PermissionUpdate) SetOperation(s string) *PermissionUpdate

SetOperation sets the "operation" field.

func (*PermissionUpdate) SetRole

func (pu *PermissionUpdate) SetRole(r *Role) *PermissionUpdate

SetRole sets the "role" edge to the Role entity.

func (*PermissionUpdate) SetRoleID

func (pu *PermissionUpdate) SetRoleID(id string) *PermissionUpdate

SetRoleID sets the "role" edge to the Role entity by ID.

func (*PermissionUpdate) SetUpdatedAt

func (pu *PermissionUpdate) SetUpdatedAt(t time.Time) *PermissionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PermissionUpdate) Where

Where appends a list predicates to the PermissionUpdate builder.

type PermissionUpdateOne

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

PermissionUpdateOne is the builder for updating a single Permission entity.

func (*PermissionUpdateOne) ClearAdminCreatedBy

func (puo *PermissionUpdateOne) ClearAdminCreatedBy() *PermissionUpdateOne

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*PermissionUpdateOne) ClearAdminUpdatedBy

func (puo *PermissionUpdateOne) ClearAdminUpdatedBy() *PermissionUpdateOne

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*PermissionUpdateOne) ClearCreatedAt

func (puo *PermissionUpdateOne) ClearCreatedAt() *PermissionUpdateOne

ClearCreatedAt clears the value of the "created_at" field.

func (*PermissionUpdateOne) ClearRole

func (puo *PermissionUpdateOne) ClearRole() *PermissionUpdateOne

ClearRole clears the "role" edge to the Role entity.

func (*PermissionUpdateOne) ClearUpdatedAt

func (puo *PermissionUpdateOne) ClearUpdatedAt() *PermissionUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PermissionUpdateOne) Exec

func (puo *PermissionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PermissionUpdateOne) ExecContext

func (c *PermissionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PermissionUpdateOne) ExecX

func (puo *PermissionUpdateOne) ExecX(ctx context.Context)

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

func (*PermissionUpdateOne) Mutation

func (puo *PermissionUpdateOne) Mutation() *PermissionMutation

Mutation returns the PermissionMutation object of the builder.

func (*PermissionUpdateOne) QueryContext

func (c *PermissionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PermissionUpdateOne) Save

func (puo *PermissionUpdateOne) Save(ctx context.Context) (*Permission, error)

Save executes the query and returns the updated Permission entity.

func (*PermissionUpdateOne) SaveX

func (puo *PermissionUpdateOne) SaveX(ctx context.Context) *Permission

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

func (*PermissionUpdateOne) Select

func (puo *PermissionUpdateOne) Select(field string, fields ...string) *PermissionUpdateOne

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

func (*PermissionUpdateOne) SetAdminCreatedBy

func (puo *PermissionUpdateOne) SetAdminCreatedBy(a *AdminUser) *PermissionUpdateOne

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*PermissionUpdateOne) SetAdminCreatedByID

func (puo *PermissionUpdateOne) SetAdminCreatedByID(id string) *PermissionUpdateOne

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*PermissionUpdateOne) SetAdminUpdatedBy

func (puo *PermissionUpdateOne) SetAdminUpdatedBy(a *AdminUser) *PermissionUpdateOne

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*PermissionUpdateOne) SetAdminUpdatedByID

func (puo *PermissionUpdateOne) SetAdminUpdatedByID(id string) *PermissionUpdateOne

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*PermissionUpdateOne) SetCreatedAt

func (puo *PermissionUpdateOne) SetCreatedAt(t time.Time) *PermissionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*PermissionUpdateOne) SetEntity

func (puo *PermissionUpdateOne) SetEntity(s string) *PermissionUpdateOne

SetEntity sets the "entity" field.

func (*PermissionUpdateOne) SetInput

SetInput applies the change-set in the UpdatePermissionInput on the PermissionUpdateOne builder.

func (*PermissionUpdateOne) SetNillableAdminCreatedByID

func (puo *PermissionUpdateOne) SetNillableAdminCreatedByID(id *string) *PermissionUpdateOne

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*PermissionUpdateOne) SetNillableAdminUpdatedByID

func (puo *PermissionUpdateOne) SetNillableAdminUpdatedByID(id *string) *PermissionUpdateOne

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*PermissionUpdateOne) SetNillableCreatedAt

func (puo *PermissionUpdateOne) SetNillableCreatedAt(t *time.Time) *PermissionUpdateOne

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

func (*PermissionUpdateOne) SetNillableEntity

func (puo *PermissionUpdateOne) SetNillableEntity(s *string) *PermissionUpdateOne

SetNillableEntity sets the "entity" field if the given value is not nil.

func (*PermissionUpdateOne) SetNillableOperation

func (puo *PermissionUpdateOne) SetNillableOperation(s *string) *PermissionUpdateOne

SetNillableOperation sets the "operation" field if the given value is not nil.

func (*PermissionUpdateOne) SetNillableRoleID

func (puo *PermissionUpdateOne) SetNillableRoleID(id *string) *PermissionUpdateOne

SetNillableRoleID sets the "role" edge to the Role entity by ID if the given value is not nil.

func (*PermissionUpdateOne) SetOperation

func (puo *PermissionUpdateOne) SetOperation(s string) *PermissionUpdateOne

SetOperation sets the "operation" field.

func (*PermissionUpdateOne) SetRole

func (puo *PermissionUpdateOne) SetRole(r *Role) *PermissionUpdateOne

SetRole sets the "role" edge to the Role entity.

func (*PermissionUpdateOne) SetRoleID

func (puo *PermissionUpdateOne) SetRoleID(id string) *PermissionUpdateOne

SetRoleID sets the "role" edge to the Role entity by ID.

func (*PermissionUpdateOne) SetUpdatedAt

func (puo *PermissionUpdateOne) SetUpdatedAt(t time.Time) *PermissionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PermissionUpdateOne) Where

Where appends a list predicates to the PermissionUpdate builder.

type PermissionUpsert

type PermissionUpsert struct {
	*sql.UpdateSet
}

PermissionUpsert is the "OnConflict" setter.

func (*PermissionUpsert) ClearCreatedAt

func (u *PermissionUpsert) ClearCreatedAt() *PermissionUpsert

ClearCreatedAt clears the value of the "created_at" field.

func (*PermissionUpsert) ClearUpdatedAt

func (u *PermissionUpsert) ClearUpdatedAt() *PermissionUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PermissionUpsert) SetCreatedAt

func (u *PermissionUpsert) SetCreatedAt(v time.Time) *PermissionUpsert

SetCreatedAt sets the "created_at" field.

func (*PermissionUpsert) SetEntity

func (u *PermissionUpsert) SetEntity(v string) *PermissionUpsert

SetEntity sets the "entity" field.

func (*PermissionUpsert) SetOperation

func (u *PermissionUpsert) SetOperation(v string) *PermissionUpsert

SetOperation sets the "operation" field.

func (*PermissionUpsert) SetUpdatedAt

func (u *PermissionUpsert) SetUpdatedAt(v time.Time) *PermissionUpsert

SetUpdatedAt sets the "updated_at" field.

func (*PermissionUpsert) UpdateCreatedAt

func (u *PermissionUpsert) UpdateCreatedAt() *PermissionUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*PermissionUpsert) UpdateEntity

func (u *PermissionUpsert) UpdateEntity() *PermissionUpsert

UpdateEntity sets the "entity" field to the value that was provided on create.

func (*PermissionUpsert) UpdateOperation

func (u *PermissionUpsert) UpdateOperation() *PermissionUpsert

UpdateOperation sets the "operation" field to the value that was provided on create.

func (*PermissionUpsert) UpdateUpdatedAt

func (u *PermissionUpsert) UpdateUpdatedAt() *PermissionUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type PermissionUpsertBulk

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

PermissionUpsertBulk is the builder for "upsert"-ing a bulk of Permission nodes.

func (*PermissionUpsertBulk) ClearCreatedAt

func (u *PermissionUpsertBulk) ClearCreatedAt() *PermissionUpsertBulk

ClearCreatedAt clears the value of the "created_at" field.

func (*PermissionUpsertBulk) ClearUpdatedAt

func (u *PermissionUpsertBulk) ClearUpdatedAt() *PermissionUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PermissionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PermissionUpsertBulk) Exec

Exec executes the query.

func (*PermissionUpsertBulk) ExecX

func (u *PermissionUpsertBulk) ExecX(ctx context.Context)

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

func (*PermissionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Permission.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PermissionUpsertBulk) SetCreatedAt

func (u *PermissionUpsertBulk) SetCreatedAt(v time.Time) *PermissionUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*PermissionUpsertBulk) SetEntity

SetEntity sets the "entity" field.

func (*PermissionUpsertBulk) SetOperation

func (u *PermissionUpsertBulk) SetOperation(v string) *PermissionUpsertBulk

SetOperation sets the "operation" field.

func (*PermissionUpsertBulk) SetUpdatedAt

func (u *PermissionUpsertBulk) SetUpdatedAt(v time.Time) *PermissionUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*PermissionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the PermissionCreateBulk.OnConflict documentation for more info.

func (*PermissionUpsertBulk) UpdateCreatedAt

func (u *PermissionUpsertBulk) UpdateCreatedAt() *PermissionUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*PermissionUpsertBulk) UpdateEntity

func (u *PermissionUpsertBulk) UpdateEntity() *PermissionUpsertBulk

UpdateEntity sets the "entity" field to the value that was provided on create.

func (*PermissionUpsertBulk) UpdateNewValues

func (u *PermissionUpsertBulk) UpdateNewValues() *PermissionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Permission.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(permission.FieldID)
		}),
	).
	Exec(ctx)

func (*PermissionUpsertBulk) UpdateOperation

func (u *PermissionUpsertBulk) UpdateOperation() *PermissionUpsertBulk

UpdateOperation sets the "operation" field to the value that was provided on create.

func (*PermissionUpsertBulk) UpdateUpdatedAt

func (u *PermissionUpsertBulk) UpdateUpdatedAt() *PermissionUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type PermissionUpsertOne

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

PermissionUpsertOne is the builder for "upsert"-ing

one Permission node.

func (*PermissionUpsertOne) ClearCreatedAt

func (u *PermissionUpsertOne) ClearCreatedAt() *PermissionUpsertOne

ClearCreatedAt clears the value of the "created_at" field.

func (*PermissionUpsertOne) ClearUpdatedAt

func (u *PermissionUpsertOne) ClearUpdatedAt() *PermissionUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PermissionUpsertOne) DoNothing

func (u *PermissionUpsertOne) DoNothing() *PermissionUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PermissionUpsertOne) Exec

Exec executes the query.

func (*PermissionUpsertOne) ExecX

func (u *PermissionUpsertOne) ExecX(ctx context.Context)

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

func (*PermissionUpsertOne) ID

func (u *PermissionUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PermissionUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*PermissionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Permission.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PermissionUpsertOne) SetCreatedAt

func (u *PermissionUpsertOne) SetCreatedAt(v time.Time) *PermissionUpsertOne

SetCreatedAt sets the "created_at" field.

func (*PermissionUpsertOne) SetEntity

SetEntity sets the "entity" field.

func (*PermissionUpsertOne) SetOperation

func (u *PermissionUpsertOne) SetOperation(v string) *PermissionUpsertOne

SetOperation sets the "operation" field.

func (*PermissionUpsertOne) SetUpdatedAt

func (u *PermissionUpsertOne) SetUpdatedAt(v time.Time) *PermissionUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*PermissionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the PermissionCreate.OnConflict documentation for more info.

func (*PermissionUpsertOne) UpdateCreatedAt

func (u *PermissionUpsertOne) UpdateCreatedAt() *PermissionUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*PermissionUpsertOne) UpdateEntity

func (u *PermissionUpsertOne) UpdateEntity() *PermissionUpsertOne

UpdateEntity sets the "entity" field to the value that was provided on create.

func (*PermissionUpsertOne) UpdateNewValues

func (u *PermissionUpsertOne) UpdateNewValues() *PermissionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Permission.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(permission.FieldID)
		}),
	).
	Exec(ctx)

func (*PermissionUpsertOne) UpdateOperation

func (u *PermissionUpsertOne) UpdateOperation() *PermissionUpsertOne

UpdateOperation sets the "operation" field to the value that was provided on create.

func (*PermissionUpsertOne) UpdateUpdatedAt

func (u *PermissionUpsertOne) UpdateUpdatedAt() *PermissionUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type PermissionWhereInput

type PermissionWhereInput struct {
	Predicates []predicate.Permission  `json:"-"`
	Not        *PermissionWhereInput   `json:"not,omitempty"`
	Or         []*PermissionWhereInput `json:"or,omitempty"`
	And        []*PermissionWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt       *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ    *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn     []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn  []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT     *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE    *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT     *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE    *time.Time  `json:"updatedAtLTE,omitempty"`
	UpdatedAtIsNil  bool        `json:"updatedAtIsNil,omitempty"`
	UpdatedAtNotNil bool        `json:"updatedAtNotNil,omitempty"`

	// "entity" field predicates.
	Entity             *string  `json:"entity,omitempty"`
	EntityNEQ          *string  `json:"entityNEQ,omitempty"`
	EntityIn           []string `json:"entityIn,omitempty"`
	EntityNotIn        []string `json:"entityNotIn,omitempty"`
	EntityGT           *string  `json:"entityGT,omitempty"`
	EntityGTE          *string  `json:"entityGTE,omitempty"`
	EntityLT           *string  `json:"entityLT,omitempty"`
	EntityLTE          *string  `json:"entityLTE,omitempty"`
	EntityContains     *string  `json:"entityContains,omitempty"`
	EntityHasPrefix    *string  `json:"entityHasPrefix,omitempty"`
	EntityHasSuffix    *string  `json:"entityHasSuffix,omitempty"`
	EntityEqualFold    *string  `json:"entityEqualFold,omitempty"`
	EntityContainsFold *string  `json:"entityContainsFold,omitempty"`

	// "operation" field predicates.
	Operation             *string  `json:"operation,omitempty"`
	OperationNEQ          *string  `json:"operationNEQ,omitempty"`
	OperationIn           []string `json:"operationIn,omitempty"`
	OperationNotIn        []string `json:"operationNotIn,omitempty"`
	OperationGT           *string  `json:"operationGT,omitempty"`
	OperationGTE          *string  `json:"operationGTE,omitempty"`
	OperationLT           *string  `json:"operationLT,omitempty"`
	OperationLTE          *string  `json:"operationLTE,omitempty"`
	OperationContains     *string  `json:"operationContains,omitempty"`
	OperationHasPrefix    *string  `json:"operationHasPrefix,omitempty"`
	OperationHasSuffix    *string  `json:"operationHasSuffix,omitempty"`
	OperationEqualFold    *string  `json:"operationEqualFold,omitempty"`
	OperationContainsFold *string  `json:"operationContainsFold,omitempty"`

	// "admin_created_by" edge predicates.
	HasAdminCreatedBy     *bool                  `json:"hasAdminCreatedBy,omitempty"`
	HasAdminCreatedByWith []*AdminUserWhereInput `json:"hasAdminCreatedByWith,omitempty"`

	// "admin_updated_by" edge predicates.
	HasAdminUpdatedBy     *bool                  `json:"hasAdminUpdatedBy,omitempty"`
	HasAdminUpdatedByWith []*AdminUserWhereInput `json:"hasAdminUpdatedByWith,omitempty"`

	// "role" edge predicates.
	HasRole     *bool             `json:"hasRole,omitempty"`
	HasRoleWith []*RoleWhereInput `json:"hasRoleWith,omitempty"`
}

PermissionWhereInput represents a where input for filtering Permission queries.

func (*PermissionWhereInput) AddPredicates

func (i *PermissionWhereInput) AddPredicates(predicates ...predicate.Permission)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*PermissionWhereInput) Filter

Filter applies the PermissionWhereInput filter on the PermissionQuery builder.

func (*PermissionWhereInput) P

P returns a predicate for filtering permissions. An error is returned if the input is empty or invalid.

type PermissionWhereUniqueInput

type PermissionWhereUniqueInput struct {
	Predicates []predicate.Permission `json:"-"`

	ID *string `json:"id,omitempty"`
}

PermissionWhereUniqueInput represents a where input for filtering Permission queries.

func (*PermissionWhereUniqueInput) AddPredicates

func (i *PermissionWhereUniqueInput) AddPredicates(predicates ...predicate.Permission)

func (*PermissionWhereUniqueInput) Filter

func (*PermissionWhereUniqueInput) P

type Permissions

type Permissions []*Permission

Permissions is a parsable slice of Permission.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type Role

type Role struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleQuery when eager-loading is set.
	Edges RoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) AdminCreatedBy

func (r *Role) AdminCreatedBy(ctx context.Context) (*AdminUser, error)

func (*Role) AdminUpdatedBy

func (r *Role) AdminUpdatedBy(ctx context.Context) (*AdminUser, error)

func (*Role) AdminUserRoles

func (r *Role) AdminUserRoles(ctx context.Context) (result []*AdminUser, err error)

func (*Role) ExecContext

func (c *Role) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Role) IsNode

func (*Role) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Role) NamedAdminUserRoles

func (r *Role) NamedAdminUserRoles(name string) ([]*AdminUser, error)

NamedAdminUserRoles returns the AdminUserRoles named value or an error if the edge was not loaded in eager-loading with this name.

func (*Role) NamedPermissions

func (r *Role) NamedPermissions(name string) ([]*Permission, error)

NamedPermissions returns the Permissions named value or an error if the edge was not loaded in eager-loading with this name.

func (*Role) NamedUserRoles

func (r *Role) NamedUserRoles(name string) ([]*User, error)

NamedUserRoles returns the UserRoles named value or an error if the edge was not loaded in eager-loading with this name.

func (*Role) Permissions

func (r *Role) Permissions(ctx context.Context) (result []*Permission, err error)

func (*Role) QueryAdminCreatedBy

func (r *Role) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy queries the "admin_created_by" edge of the Role entity.

func (*Role) QueryAdminUpdatedBy

func (r *Role) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy queries the "admin_updated_by" edge of the Role entity.

func (*Role) QueryAdminUserRoles

func (r *Role) QueryAdminUserRoles() *AdminUserQuery

QueryAdminUserRoles queries the "admin_user_roles" edge of the Role entity.

func (*Role) QueryContext

func (c *Role) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Role) QueryPermissions

func (r *Role) QueryPermissions() *PermissionQuery

QueryPermissions queries the "permissions" edge of the Role entity.

func (*Role) QueryUserRoles

func (r *Role) QueryUserRoles() *UserQuery

QueryUserRoles queries the "user_roles" edge of the Role entity.

func (*Role) String

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) ToEdge

func (r *Role) ToEdge(order *RoleOrder) *RoleEdge

ToEdge converts Role into RoleEdge.

func (*Role) Unwrap

func (r *Role) Unwrap() *Role

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

func (*Role) Update

func (r *Role) Update() *RoleUpdateOne

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

func (*Role) UserRoles

func (r *Role) UserRoles(ctx context.Context) (result []*User, err error)

func (*Role) Value

func (r *Role) Value(name string) (ent.Value, error)

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

type RoleClient

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

RoleClient is a client for the Role schema.

func NewRoleClient

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create

func (c *RoleClient) Create() *RoleCreate

Create returns a builder for creating a Role entity.

func (*RoleClient) CreateBulk

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

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

func (*RoleClient) Delete

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleClient) DeleteOneID

func (c *RoleClient) DeleteOneID(id string) *RoleDeleteOne

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

func (*RoleClient) ExecContext

func (c *RoleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id string) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id string) *Role

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

func (*RoleClient) Hooks

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

Hooks returns the client hooks.

func (*RoleClient) Intercept

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

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

func (*RoleClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RoleClient) MapCreateBulk

func (c *RoleClient) MapCreateBulk(slice any, setFunc func(*RoleCreate, int)) *RoleCreateBulk

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

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) QueryAdminCreatedBy

func (c *RoleClient) QueryAdminCreatedBy(r *Role) *AdminUserQuery

QueryAdminCreatedBy queries the admin_created_by edge of a Role.

func (*RoleClient) QueryAdminUpdatedBy

func (c *RoleClient) QueryAdminUpdatedBy(r *Role) *AdminUserQuery

QueryAdminUpdatedBy queries the admin_updated_by edge of a Role.

func (*RoleClient) QueryAdminUserRoles

func (c *RoleClient) QueryAdminUserRoles(r *Role) *AdminUserQuery

QueryAdminUserRoles queries the admin_user_roles edge of a Role.

func (*RoleClient) QueryContext

func (c *RoleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleClient) QueryPermissions

func (c *RoleClient) QueryPermissions(r *Role) *PermissionQuery

QueryPermissions queries the permissions edge of a Role.

func (*RoleClient) QueryUserRoles

func (c *RoleClient) QueryUserRoles(r *Role) *UserQuery

QueryUserRoles queries the user_roles edge of a Role.

func (*RoleClient) Update

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID

func (c *RoleClient) UpdateOneID(id string) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use

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

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

type RoleConnection

type RoleConnection struct {
	Edges      []*RoleEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

RoleConnection is the connection containing edges to Role.

type RoleCreate

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

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) AddAdminUserRoleIDs

func (rc *RoleCreate) AddAdminUserRoleIDs(ids ...string) *RoleCreate

AddAdminUserRoleIDs adds the "admin_user_roles" edge to the AdminUser entity by IDs.

func (*RoleCreate) AddAdminUserRoles

func (rc *RoleCreate) AddAdminUserRoles(a ...*AdminUser) *RoleCreate

AddAdminUserRoles adds the "admin_user_roles" edges to the AdminUser entity.

func (*RoleCreate) AddPermissionIDs

func (rc *RoleCreate) AddPermissionIDs(ids ...string) *RoleCreate

AddPermissionIDs adds the "permissions" edge to the Permission entity by IDs.

func (*RoleCreate) AddPermissions

func (rc *RoleCreate) AddPermissions(p ...*Permission) *RoleCreate

AddPermissions adds the "permissions" edges to the Permission entity.

func (*RoleCreate) AddUserRoleIDs

func (rc *RoleCreate) AddUserRoleIDs(ids ...string) *RoleCreate

AddUserRoleIDs adds the "user_roles" edge to the User entity by IDs.

func (*RoleCreate) AddUserRoles

func (rc *RoleCreate) AddUserRoles(u ...*User) *RoleCreate

AddUserRoles adds the "user_roles" edges to the User entity.

func (*RoleCreate) Exec

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecContext

func (c *RoleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleCreate) ExecX

func (rc *RoleCreate) ExecX(ctx context.Context)

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

func (*RoleCreate) Mutation

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) OnConflict

func (rc *RoleCreate) OnConflict(opts ...sql.ConflictOption) *RoleUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Role.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*RoleCreate) OnConflictColumns

func (rc *RoleCreate) OnConflictColumns(columns ...string) *RoleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RoleCreate) QueryContext

func (c *RoleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleCreate) Save

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

func (*RoleCreate) SetAdminCreatedBy

func (rc *RoleCreate) SetAdminCreatedBy(a *AdminUser) *RoleCreate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*RoleCreate) SetAdminCreatedByID

func (rc *RoleCreate) SetAdminCreatedByID(id string) *RoleCreate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*RoleCreate) SetAdminUpdatedBy

func (rc *RoleCreate) SetAdminUpdatedBy(a *AdminUser) *RoleCreate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*RoleCreate) SetAdminUpdatedByID

func (rc *RoleCreate) SetAdminUpdatedByID(id string) *RoleCreate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*RoleCreate) SetCreatedAt

func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate

SetCreatedAt sets the "created_at" field.

func (*RoleCreate) SetID

func (rc *RoleCreate) SetID(s string) *RoleCreate

SetID sets the "id" field.

func (*RoleCreate) SetInput

func (c *RoleCreate) SetInput(i CreateRoleInput) *RoleCreate

SetInput applies the change-set in the CreateRoleInput on the RoleCreate builder.

func (*RoleCreate) SetName

func (rc *RoleCreate) SetName(s string) *RoleCreate

SetName sets the "name" field.

func (*RoleCreate) SetNillableAdminCreatedByID

func (rc *RoleCreate) SetNillableAdminCreatedByID(id *string) *RoleCreate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*RoleCreate) SetNillableAdminUpdatedByID

func (rc *RoleCreate) SetNillableAdminUpdatedByID(id *string) *RoleCreate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*RoleCreate) SetNillableCreatedAt

func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate

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

func (*RoleCreate) SetNillableID

func (rc *RoleCreate) SetNillableID(s *string) *RoleCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*RoleCreate) SetNillableUpdatedAt

func (rc *RoleCreate) SetNillableUpdatedAt(t *time.Time) *RoleCreate

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

func (*RoleCreate) SetUpdatedAt

func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate

SetUpdatedAt sets the "updated_at" field.

type RoleCreateBulk

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

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecContext

func (c *RoleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleCreateBulk) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

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

func (*RoleCreateBulk) OnConflict

func (rcb *RoleCreateBulk) OnConflict(opts ...sql.ConflictOption) *RoleUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Role.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*RoleCreateBulk) OnConflictColumns

func (rcb *RoleCreateBulk) OnConflictColumns(columns ...string) *RoleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RoleCreateBulk) QueryContext

func (c *RoleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleCreateBulk) Save

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

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

type RoleDelete

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

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

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

func (*RoleDelete) ExecContext

func (c *RoleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleDelete) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

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

func (*RoleDelete) QueryContext

func (c *RoleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleDelete) Where

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne

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

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

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

func (*RoleDeleteOne) Where

func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne

Where appends a list predicates to the RoleDelete builder.

type RoleEdge

type RoleEdge struct {
	Node   *Role  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

RoleEdge is the edge representation of Role.

type RoleEdges

type RoleEdges struct {
	// AdminCreatedBy holds the value of the admin_created_by edge.
	AdminCreatedBy *AdminUser `json:"admin_created_by,omitempty"`
	// AdminUpdatedBy holds the value of the admin_updated_by edge.
	AdminUpdatedBy *AdminUser `json:"admin_updated_by,omitempty"`
	// AdminUserRoles holds the value of the admin_user_roles edge.
	AdminUserRoles []*AdminUser `json:"admin_user_roles,omitempty"`
	// UserRoles holds the value of the user_roles edge.
	UserRoles []*User `json:"user_roles,omitempty"`
	// Permissions holds the value of the permissions edge.
	Permissions []*Permission `json:"permissions,omitempty"`
	// contains filtered or unexported fields
}

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

func (RoleEdges) AdminCreatedByOrErr

func (e RoleEdges) AdminCreatedByOrErr() (*AdminUser, error)

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

func (RoleEdges) AdminUpdatedByOrErr

func (e RoleEdges) AdminUpdatedByOrErr() (*AdminUser, error)

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

func (RoleEdges) AdminUserRolesOrErr

func (e RoleEdges) AdminUserRolesOrErr() ([]*AdminUser, error)

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

func (RoleEdges) PermissionsOrErr

func (e RoleEdges) PermissionsOrErr() ([]*Permission, error)

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

func (RoleEdges) UserRolesOrErr

func (e RoleEdges) UserRolesOrErr() ([]*User, error)

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

type RoleGroupBy

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

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

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

func (*RoleGroupBy) Bool

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

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

func (*RoleGroupBy) BoolX

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

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

func (*RoleGroupBy) Bools

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

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

func (*RoleGroupBy) BoolsX

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

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

func (*RoleGroupBy) Float64

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

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

func (*RoleGroupBy) Float64X

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

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

func (*RoleGroupBy) Float64s

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

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

func (*RoleGroupBy) Float64sX

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

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

func (*RoleGroupBy) Int

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

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

func (*RoleGroupBy) IntX

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

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

func (*RoleGroupBy) Ints

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

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

func (*RoleGroupBy) IntsX

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

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

func (*RoleGroupBy) Scan

func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error

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

func (*RoleGroupBy) ScanX

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

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

func (*RoleGroupBy) String

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

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

func (*RoleGroupBy) StringX

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

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

func (*RoleGroupBy) Strings

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

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

func (*RoleGroupBy) StringsX

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

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

type RoleMutation

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

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddAdminUserRoleIDs

func (m *RoleMutation) AddAdminUserRoleIDs(ids ...string)

AddAdminUserRoleIDs adds the "admin_user_roles" edge to the AdminUser entity by ids.

func (*RoleMutation) AddEdges

func (m *RoleMutation) AddEdges(name string, values []string) error

AddEdges sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*RoleMutation) AddField

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

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

func (*RoleMutation) AddPermissionIDs

func (m *RoleMutation) AddPermissionIDs(ids ...string)

AddPermissionIDs adds the "permissions" edge to the Permission entity by ids.

func (*RoleMutation) AddUserRoleIDs

func (m *RoleMutation) AddUserRoleIDs(ids ...string)

AddUserRoleIDs adds the "user_roles" edge to the User entity by ids.

func (*RoleMutation) AddedEdges

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

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

func (*RoleMutation) AddedField

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

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

func (*RoleMutation) AddedFields

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

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

func (*RoleMutation) AddedIDs

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

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

func (*RoleMutation) AdminCreatedByCleared

func (m *RoleMutation) AdminCreatedByCleared() bool

AdminCreatedByCleared reports if the "admin_created_by" edge to the AdminUser entity was cleared.

func (*RoleMutation) AdminCreatedByID

func (m *RoleMutation) AdminCreatedByID() (id string, exists bool)

AdminCreatedByID returns the "admin_created_by" edge ID in the mutation.

func (*RoleMutation) AdminCreatedByIDs

func (m *RoleMutation) AdminCreatedByIDs() (ids []string)

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

func (*RoleMutation) AdminUpdatedByCleared

func (m *RoleMutation) AdminUpdatedByCleared() bool

AdminUpdatedByCleared reports if the "admin_updated_by" edge to the AdminUser entity was cleared.

func (*RoleMutation) AdminUpdatedByID

func (m *RoleMutation) AdminUpdatedByID() (id string, exists bool)

AdminUpdatedByID returns the "admin_updated_by" edge ID in the mutation.

func (*RoleMutation) AdminUpdatedByIDs

func (m *RoleMutation) AdminUpdatedByIDs() (ids []string)

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

func (*RoleMutation) AdminUserRolesCleared

func (m *RoleMutation) AdminUserRolesCleared() bool

AdminUserRolesCleared reports if the "admin_user_roles" edge to the AdminUser entity was cleared.

func (*RoleMutation) AdminUserRolesIDs

func (m *RoleMutation) AdminUserRolesIDs() (ids []string)

AdminUserRolesIDs returns the "admin_user_roles" edge IDs in the mutation.

func (*RoleMutation) ClearAdminCreatedBy

func (m *RoleMutation) ClearAdminCreatedBy()

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*RoleMutation) ClearAdminUpdatedBy

func (m *RoleMutation) ClearAdminUpdatedBy()

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*RoleMutation) ClearAdminUserRoles

func (m *RoleMutation) ClearAdminUserRoles()

ClearAdminUserRoles clears the "admin_user_roles" edge to the AdminUser entity.

func (*RoleMutation) ClearCreatedAt

func (m *RoleMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*RoleMutation) ClearEdge

func (m *RoleMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*RoleMutation) ClearField

func (m *RoleMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*RoleMutation) ClearPermissions

func (m *RoleMutation) ClearPermissions()

ClearPermissions clears the "permissions" edge to the Permission entity.

func (*RoleMutation) ClearUpdatedAt

func (m *RoleMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleMutation) ClearUserRoles

func (m *RoleMutation) ClearUserRoles()

ClearUserRoles clears the "user_roles" edge to the User entity.

func (*RoleMutation) ClearedEdges

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

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

func (*RoleMutation) ClearedFields

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

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

func (RoleMutation) Client

func (m RoleMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*RoleMutation) CreatedAt

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

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

func (*RoleMutation) CreatedAtCleared

func (m *RoleMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*RoleMutation) EdgeCleared

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

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

func (*RoleMutation) ExecContext

func (c *RoleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleMutation) Field

func (m *RoleMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*RoleMutation) FieldCleared

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

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

func (*RoleMutation) Fields

func (m *RoleMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*RoleMutation) ID

func (m *RoleMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*RoleMutation) IDs

func (m *RoleMutation) IDs(ctx context.Context) ([]string, error)

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

func (*RoleMutation) Name

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

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

func (*RoleMutation) OldCreatedAt

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

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

func (*RoleMutation) OldField

func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*RoleMutation) OldName

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

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

func (*RoleMutation) OldUpdatedAt

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

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

func (*RoleMutation) Op

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) PermissionsCleared

func (m *RoleMutation) PermissionsCleared() bool

PermissionsCleared reports if the "permissions" edge to the Permission entity was cleared.

func (*RoleMutation) PermissionsIDs

func (m *RoleMutation) PermissionsIDs() (ids []string)

PermissionsIDs returns the "permissions" edge IDs in the mutation.

func (*RoleMutation) QueryContext

func (c *RoleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleMutation) RemoveAdminUserRoleIDs

func (m *RoleMutation) RemoveAdminUserRoleIDs(ids ...string)

RemoveAdminUserRoleIDs removes the "admin_user_roles" edge to the AdminUser entity by IDs.

func (*RoleMutation) RemovePermissionIDs

func (m *RoleMutation) RemovePermissionIDs(ids ...string)

RemovePermissionIDs removes the "permissions" edge to the Permission entity by IDs.

func (*RoleMutation) RemoveUserRoleIDs

func (m *RoleMutation) RemoveUserRoleIDs(ids ...string)

RemoveUserRoleIDs removes the "user_roles" edge to the User entity by IDs.

func (*RoleMutation) RemovedAdminUserRolesIDs

func (m *RoleMutation) RemovedAdminUserRolesIDs() (ids []string)

RemovedAdminUserRoles returns the removed IDs of the "admin_user_roles" edge to the AdminUser entity.

func (*RoleMutation) RemovedEdges

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

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

func (*RoleMutation) RemovedIDs

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

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

func (*RoleMutation) RemovedPermissionsIDs

func (m *RoleMutation) RemovedPermissionsIDs() (ids []string)

RemovedPermissions returns the removed IDs of the "permissions" edge to the Permission entity.

func (*RoleMutation) RemovedUserRolesIDs

func (m *RoleMutation) RemovedUserRolesIDs() (ids []string)

RemovedUserRoles returns the removed IDs of the "user_roles" edge to the User entity.

func (*RoleMutation) ResetAdminCreatedBy

func (m *RoleMutation) ResetAdminCreatedBy()

ResetAdminCreatedBy resets all changes to the "admin_created_by" edge.

func (*RoleMutation) ResetAdminUpdatedBy

func (m *RoleMutation) ResetAdminUpdatedBy()

ResetAdminUpdatedBy resets all changes to the "admin_updated_by" edge.

func (*RoleMutation) ResetAdminUserRoles

func (m *RoleMutation) ResetAdminUserRoles()

ResetAdminUserRoles resets all changes to the "admin_user_roles" edge.

func (*RoleMutation) ResetCreatedAt

func (m *RoleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoleMutation) ResetEdge

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

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

func (*RoleMutation) ResetField

func (m *RoleMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*RoleMutation) ResetName

func (m *RoleMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RoleMutation) ResetPermissions

func (m *RoleMutation) ResetPermissions()

ResetPermissions resets all changes to the "permissions" edge.

func (*RoleMutation) ResetUpdatedAt

func (m *RoleMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RoleMutation) ResetUserRoles

func (m *RoleMutation) ResetUserRoles()

ResetUserRoles resets all changes to the "user_roles" edge.

func (*RoleMutation) SetAdminCreatedByID

func (m *RoleMutation) SetAdminCreatedByID(id string)

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by id.

func (*RoleMutation) SetAdminUpdatedByID

func (m *RoleMutation) SetAdminUpdatedByID(id string)

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by id.

func (*RoleMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RoleMutation) SetEdge

func (m *RoleMutation) SetEdge(name, value string) error

SetEdge sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*RoleMutation) SetField

func (m *RoleMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*RoleMutation) SetID

func (m *RoleMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Role entities.

func (*RoleMutation) SetName

func (m *RoleMutation) SetName(s string)

SetName sets the "name" field.

func (*RoleMutation) SetOp

func (m *RoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RoleMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (RoleMutation) Tx

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

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

func (*RoleMutation) Type

func (m *RoleMutation) Type() string

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

func (*RoleMutation) UpdatedAt

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

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

func (*RoleMutation) UpdatedAtCleared

func (m *RoleMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*RoleMutation) UpdatedFields

func (m *RoleMutation) UpdatedFields() map[string]Value

UpdatedFields returns all fields and edges that were changed during this mutation.

func (*RoleMutation) UserRolesCleared

func (m *RoleMutation) UserRolesCleared() bool

UserRolesCleared reports if the "user_roles" edge to the User entity was cleared.

func (*RoleMutation) UserRolesIDs

func (m *RoleMutation) UserRolesIDs() (ids []string)

UserRolesIDs returns the "user_roles" edge IDs in the mutation.

func (*RoleMutation) Where

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

func (*RoleMutation) WhereP

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

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

type RoleOrder

type RoleOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *RoleOrderField `json:"field"`
}

RoleOrder defines the ordering of Role.

type RoleOrderField

type RoleOrderField struct {
	// Value extracts the ordering value from the given Role.
	Value func(*Role) (ent.Value, error)
	// contains filtered or unexported fields
}

RoleOrderField defines the ordering field of Role.

func (RoleOrderField) MarshalGQL

func (f RoleOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (RoleOrderField) String

func (f RoleOrderField) String() string

String implement fmt.Stringer interface.

func (*RoleOrderField) UnmarshalGQL

func (f *RoleOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type RolePaginateOption

type RolePaginateOption func(*rolePager) error

RolePaginateOption enables pagination customization.

func WithRoleFilter

func WithRoleFilter(filter func(*RoleQuery) (*RoleQuery, error)) RolePaginateOption

WithRoleFilter configures pagination filter.

func WithRoleOrder

func WithRoleOrder(order []*RoleOrder) RolePaginateOption

WithRoleOrder configures pagination ordering.

type RoleQuery

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

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) Aggregate

func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate returns a RoleSelect configured with the given aggregations.

func (*RoleQuery) All

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

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

func (*RoleQuery) Clone

func (rq *RoleQuery) Clone() *RoleQuery

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

func (*RoleQuery) CollectFields

func (r *RoleQuery) CollectFields(ctx context.Context, satisfies ...string) (*RoleQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*RoleQuery) Count

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX

func (rq *RoleQuery) CountX(ctx context.Context) int

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

func (*RoleQuery) ExecContext

func (c *RoleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleQuery) Exist

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

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

func (*RoleQuery) ExistX

func (rq *RoleQuery) ExistX(ctx context.Context) bool

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

func (*RoleQuery) First

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

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

func (*RoleQuery) FirstID

func (rq *RoleQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*RoleQuery) FirstIDX

func (rq *RoleQuery) FirstIDX(ctx context.Context) string

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

func (*RoleQuery) FirstX

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

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

func (*RoleQuery) GroupBy

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

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

Example:

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

client.Role.Query().
	GroupBy(role.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoleQuery) IDs

func (rq *RoleQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []string

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

func (*RoleQuery) Limit

func (rq *RoleQuery) Limit(limit int) *RoleQuery

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

func (*RoleQuery) Offset

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset to start from.

func (*RoleQuery) Only

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

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

func (*RoleQuery) OnlyID

func (rq *RoleQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*RoleQuery) OnlyIDX

func (rq *RoleQuery) OnlyIDX(ctx context.Context) string

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

func (*RoleQuery) OnlyX

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

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

func (*RoleQuery) Order

func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery

Order specifies how the records should be ordered.

func (*RoleQuery) Paginate

func (r *RoleQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...RolePaginateOption,
) (*RoleConnection, error)

Paginate executes the query and returns a relay based cursor connection to Role.

func (*RoleQuery) QueryAdminCreatedBy

func (rq *RoleQuery) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy chains the current query on the "admin_created_by" edge.

func (*RoleQuery) QueryAdminUpdatedBy

func (rq *RoleQuery) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy chains the current query on the "admin_updated_by" edge.

func (*RoleQuery) QueryAdminUserRoles

func (rq *RoleQuery) QueryAdminUserRoles() *AdminUserQuery

QueryAdminUserRoles chains the current query on the "admin_user_roles" edge.

func (*RoleQuery) QueryContext

func (c *RoleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleQuery) QueryPermissions

func (rq *RoleQuery) QueryPermissions() *PermissionQuery

QueryPermissions chains the current query on the "permissions" edge.

func (*RoleQuery) QueryUserRoles

func (rq *RoleQuery) QueryUserRoles() *UserQuery

QueryUserRoles chains the current query on the "user_roles" edge.

func (*RoleQuery) Select

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

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

Example:

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

client.Role.Query().
	Select(role.FieldName).
	Scan(ctx, &v)

func (*RoleQuery) Unique

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

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

func (*RoleQuery) Where

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

func (*RoleQuery) WhereAdminCreatedBy

func (r *RoleQuery) WhereAdminCreatedBy(adminUserID string) *RoleQuery

WhereAdminCreatedBy adds a filter based on the AdminCreatedBy relationship. This method allows owner-based permission filtering by admin user ID.

func (*RoleQuery) WithAdminCreatedBy

func (rq *RoleQuery) WithAdminCreatedBy(opts ...func(*AdminUserQuery)) *RoleQuery

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

func (*RoleQuery) WithAdminUpdatedBy

func (rq *RoleQuery) WithAdminUpdatedBy(opts ...func(*AdminUserQuery)) *RoleQuery

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

func (*RoleQuery) WithAdminUserRoles

func (rq *RoleQuery) WithAdminUserRoles(opts ...func(*AdminUserQuery)) *RoleQuery

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

func (*RoleQuery) WithNamedAdminUserRoles

func (rq *RoleQuery) WithNamedAdminUserRoles(name string, opts ...func(*AdminUserQuery)) *RoleQuery

WithNamedAdminUserRoles tells the query-builder to eager-load the nodes that are connected to the "admin_user_roles" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RoleQuery) WithNamedPermissions

func (rq *RoleQuery) WithNamedPermissions(name string, opts ...func(*PermissionQuery)) *RoleQuery

WithNamedPermissions tells the query-builder to eager-load the nodes that are connected to the "permissions" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RoleQuery) WithNamedUserRoles

func (rq *RoleQuery) WithNamedUserRoles(name string, opts ...func(*UserQuery)) *RoleQuery

WithNamedUserRoles tells the query-builder to eager-load the nodes that are connected to the "user_roles" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RoleQuery) WithPermissions

func (rq *RoleQuery) WithPermissions(opts ...func(*PermissionQuery)) *RoleQuery

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

func (*RoleQuery) WithUserRoles

func (rq *RoleQuery) WithUserRoles(opts ...func(*UserQuery)) *RoleQuery

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

type RoleSelect

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Aggregate

func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleSelect) Bool

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

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

func (*RoleSelect) BoolX

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

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

func (*RoleSelect) Bools

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

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

func (*RoleSelect) BoolsX

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

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

func (RoleSelect) ExecContext

func (c RoleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleSelect) Float64

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

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

func (*RoleSelect) Float64X

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

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

func (*RoleSelect) Float64s

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

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

func (*RoleSelect) Float64sX

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

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

func (*RoleSelect) Int

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

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

func (*RoleSelect) IntX

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

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

func (*RoleSelect) Ints

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

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

func (*RoleSelect) IntsX

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

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

func (RoleSelect) QueryContext

func (c RoleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleSelect) Scan

func (rs *RoleSelect) Scan(ctx context.Context, v any) error

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

func (*RoleSelect) ScanX

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

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

func (*RoleSelect) String

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

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

func (*RoleSelect) StringX

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

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

func (*RoleSelect) Strings

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

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

func (*RoleSelect) StringsX

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

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

type RoleUpdate

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

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) AddAdminUserRoleIDs

func (ru *RoleUpdate) AddAdminUserRoleIDs(ids ...string) *RoleUpdate

AddAdminUserRoleIDs adds the "admin_user_roles" edge to the AdminUser entity by IDs.

func (*RoleUpdate) AddAdminUserRoles

func (ru *RoleUpdate) AddAdminUserRoles(a ...*AdminUser) *RoleUpdate

AddAdminUserRoles adds the "admin_user_roles" edges to the AdminUser entity.

func (*RoleUpdate) AddPermissionIDs

func (ru *RoleUpdate) AddPermissionIDs(ids ...string) *RoleUpdate

AddPermissionIDs adds the "permissions" edge to the Permission entity by IDs.

func (*RoleUpdate) AddPermissions

func (ru *RoleUpdate) AddPermissions(p ...*Permission) *RoleUpdate

AddPermissions adds the "permissions" edges to the Permission entity.

func (*RoleUpdate) AddUserRoleIDs

func (ru *RoleUpdate) AddUserRoleIDs(ids ...string) *RoleUpdate

AddUserRoleIDs adds the "user_roles" edge to the User entity by IDs.

func (*RoleUpdate) AddUserRoles

func (ru *RoleUpdate) AddUserRoles(u ...*User) *RoleUpdate

AddUserRoles adds the "user_roles" edges to the User entity.

func (*RoleUpdate) ClearAdminCreatedBy

func (ru *RoleUpdate) ClearAdminCreatedBy() *RoleUpdate

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*RoleUpdate) ClearAdminUpdatedBy

func (ru *RoleUpdate) ClearAdminUpdatedBy() *RoleUpdate

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*RoleUpdate) ClearAdminUserRoles

func (ru *RoleUpdate) ClearAdminUserRoles() *RoleUpdate

ClearAdminUserRoles clears all "admin_user_roles" edges to the AdminUser entity.

func (*RoleUpdate) ClearPermissions

func (ru *RoleUpdate) ClearPermissions() *RoleUpdate

ClearPermissions clears all "permissions" edges to the Permission entity.

func (*RoleUpdate) ClearUpdatedAt

func (ru *RoleUpdate) ClearUpdatedAt() *RoleUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpdate) ClearUserRoles

func (ru *RoleUpdate) ClearUserRoles() *RoleUpdate

ClearUserRoles clears all "user_roles" edges to the User entity.

func (*RoleUpdate) Exec

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecContext

func (c *RoleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleUpdate) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

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

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) QueryContext

func (c *RoleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleUpdate) RemoveAdminUserRoleIDs

func (ru *RoleUpdate) RemoveAdminUserRoleIDs(ids ...string) *RoleUpdate

RemoveAdminUserRoleIDs removes the "admin_user_roles" edge to AdminUser entities by IDs.

func (*RoleUpdate) RemoveAdminUserRoles

func (ru *RoleUpdate) RemoveAdminUserRoles(a ...*AdminUser) *RoleUpdate

RemoveAdminUserRoles removes "admin_user_roles" edges to AdminUser entities.

func (*RoleUpdate) RemovePermissionIDs

func (ru *RoleUpdate) RemovePermissionIDs(ids ...string) *RoleUpdate

RemovePermissionIDs removes the "permissions" edge to Permission entities by IDs.

func (*RoleUpdate) RemovePermissions

func (ru *RoleUpdate) RemovePermissions(p ...*Permission) *RoleUpdate

RemovePermissions removes "permissions" edges to Permission entities.

func (*RoleUpdate) RemoveUserRoleIDs

func (ru *RoleUpdate) RemoveUserRoleIDs(ids ...string) *RoleUpdate

RemoveUserRoleIDs removes the "user_roles" edge to User entities by IDs.

func (*RoleUpdate) RemoveUserRoles

func (ru *RoleUpdate) RemoveUserRoles(u ...*User) *RoleUpdate

RemoveUserRoles removes "user_roles" edges to User entities.

func (*RoleUpdate) Save

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

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

func (*RoleUpdate) SaveX

func (ru *RoleUpdate) SaveX(ctx context.Context) int

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

func (*RoleUpdate) SetAdminCreatedBy

func (ru *RoleUpdate) SetAdminCreatedBy(a *AdminUser) *RoleUpdate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*RoleUpdate) SetAdminCreatedByID

func (ru *RoleUpdate) SetAdminCreatedByID(id string) *RoleUpdate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*RoleUpdate) SetAdminUpdatedBy

func (ru *RoleUpdate) SetAdminUpdatedBy(a *AdminUser) *RoleUpdate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*RoleUpdate) SetAdminUpdatedByID

func (ru *RoleUpdate) SetAdminUpdatedByID(id string) *RoleUpdate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*RoleUpdate) SetInput

func (c *RoleUpdate) SetInput(i UpdateRoleInput) *RoleUpdate

SetInput applies the change-set in the UpdateRoleInput on the RoleUpdate builder.

func (*RoleUpdate) SetName

func (ru *RoleUpdate) SetName(s string) *RoleUpdate

SetName sets the "name" field.

func (*RoleUpdate) SetNillableAdminCreatedByID

func (ru *RoleUpdate) SetNillableAdminCreatedByID(id *string) *RoleUpdate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*RoleUpdate) SetNillableAdminUpdatedByID

func (ru *RoleUpdate) SetNillableAdminUpdatedByID(id *string) *RoleUpdate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*RoleUpdate) SetNillableName

func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate

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

func (*RoleUpdate) SetUpdatedAt

func (ru *RoleUpdate) SetUpdatedAt(t time.Time) *RoleUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpdate) Where

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne

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

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) AddAdminUserRoleIDs

func (ruo *RoleUpdateOne) AddAdminUserRoleIDs(ids ...string) *RoleUpdateOne

AddAdminUserRoleIDs adds the "admin_user_roles" edge to the AdminUser entity by IDs.

func (*RoleUpdateOne) AddAdminUserRoles

func (ruo *RoleUpdateOne) AddAdminUserRoles(a ...*AdminUser) *RoleUpdateOne

AddAdminUserRoles adds the "admin_user_roles" edges to the AdminUser entity.

func (*RoleUpdateOne) AddPermissionIDs

func (ruo *RoleUpdateOne) AddPermissionIDs(ids ...string) *RoleUpdateOne

AddPermissionIDs adds the "permissions" edge to the Permission entity by IDs.

func (*RoleUpdateOne) AddPermissions

func (ruo *RoleUpdateOne) AddPermissions(p ...*Permission) *RoleUpdateOne

AddPermissions adds the "permissions" edges to the Permission entity.

func (*RoleUpdateOne) AddUserRoleIDs

func (ruo *RoleUpdateOne) AddUserRoleIDs(ids ...string) *RoleUpdateOne

AddUserRoleIDs adds the "user_roles" edge to the User entity by IDs.

func (*RoleUpdateOne) AddUserRoles

func (ruo *RoleUpdateOne) AddUserRoles(u ...*User) *RoleUpdateOne

AddUserRoles adds the "user_roles" edges to the User entity.

func (*RoleUpdateOne) ClearAdminCreatedBy

func (ruo *RoleUpdateOne) ClearAdminCreatedBy() *RoleUpdateOne

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*RoleUpdateOne) ClearAdminUpdatedBy

func (ruo *RoleUpdateOne) ClearAdminUpdatedBy() *RoleUpdateOne

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*RoleUpdateOne) ClearAdminUserRoles

func (ruo *RoleUpdateOne) ClearAdminUserRoles() *RoleUpdateOne

ClearAdminUserRoles clears all "admin_user_roles" edges to the AdminUser entity.

func (*RoleUpdateOne) ClearPermissions

func (ruo *RoleUpdateOne) ClearPermissions() *RoleUpdateOne

ClearPermissions clears all "permissions" edges to the Permission entity.

func (*RoleUpdateOne) ClearUpdatedAt

func (ruo *RoleUpdateOne) ClearUpdatedAt() *RoleUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpdateOne) ClearUserRoles

func (ruo *RoleUpdateOne) ClearUserRoles() *RoleUpdateOne

ClearUserRoles clears all "user_roles" edges to the User entity.

func (*RoleUpdateOne) Exec

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecContext

func (c *RoleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleUpdateOne) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

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

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) QueryContext

func (c *RoleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleUpdateOne) RemoveAdminUserRoleIDs

func (ruo *RoleUpdateOne) RemoveAdminUserRoleIDs(ids ...string) *RoleUpdateOne

RemoveAdminUserRoleIDs removes the "admin_user_roles" edge to AdminUser entities by IDs.

func (*RoleUpdateOne) RemoveAdminUserRoles

func (ruo *RoleUpdateOne) RemoveAdminUserRoles(a ...*AdminUser) *RoleUpdateOne

RemoveAdminUserRoles removes "admin_user_roles" edges to AdminUser entities.

func (*RoleUpdateOne) RemovePermissionIDs

func (ruo *RoleUpdateOne) RemovePermissionIDs(ids ...string) *RoleUpdateOne

RemovePermissionIDs removes the "permissions" edge to Permission entities by IDs.

func (*RoleUpdateOne) RemovePermissions

func (ruo *RoleUpdateOne) RemovePermissions(p ...*Permission) *RoleUpdateOne

RemovePermissions removes "permissions" edges to Permission entities.

func (*RoleUpdateOne) RemoveUserRoleIDs

func (ruo *RoleUpdateOne) RemoveUserRoleIDs(ids ...string) *RoleUpdateOne

RemoveUserRoleIDs removes the "user_roles" edge to User entities by IDs.

func (*RoleUpdateOne) RemoveUserRoles

func (ruo *RoleUpdateOne) RemoveUserRoles(u ...*User) *RoleUpdateOne

RemoveUserRoles removes "user_roles" edges to User entities.

func (*RoleUpdateOne) Save

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

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

func (*RoleUpdateOne) Select

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

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

func (*RoleUpdateOne) SetAdminCreatedBy

func (ruo *RoleUpdateOne) SetAdminCreatedBy(a *AdminUser) *RoleUpdateOne

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*RoleUpdateOne) SetAdminCreatedByID

func (ruo *RoleUpdateOne) SetAdminCreatedByID(id string) *RoleUpdateOne

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*RoleUpdateOne) SetAdminUpdatedBy

func (ruo *RoleUpdateOne) SetAdminUpdatedBy(a *AdminUser) *RoleUpdateOne

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*RoleUpdateOne) SetAdminUpdatedByID

func (ruo *RoleUpdateOne) SetAdminUpdatedByID(id string) *RoleUpdateOne

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*RoleUpdateOne) SetInput

SetInput applies the change-set in the UpdateRoleInput on the RoleUpdateOne builder.

func (*RoleUpdateOne) SetName

func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne

SetName sets the "name" field.

func (*RoleUpdateOne) SetNillableAdminCreatedByID

func (ruo *RoleUpdateOne) SetNillableAdminCreatedByID(id *string) *RoleUpdateOne

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*RoleUpdateOne) SetNillableAdminUpdatedByID

func (ruo *RoleUpdateOne) SetNillableAdminUpdatedByID(id *string) *RoleUpdateOne

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*RoleUpdateOne) SetNillableName

func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne

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

func (*RoleUpdateOne) SetUpdatedAt

func (ruo *RoleUpdateOne) SetUpdatedAt(t time.Time) *RoleUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpdateOne) Where

func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne

Where appends a list predicates to the RoleUpdate builder.

type RoleUpsert

type RoleUpsert struct {
	*sql.UpdateSet
}

RoleUpsert is the "OnConflict" setter.

func (*RoleUpsert) ClearUpdatedAt

func (u *RoleUpsert) ClearUpdatedAt() *RoleUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpsert) SetName

func (u *RoleUpsert) SetName(v string) *RoleUpsert

SetName sets the "name" field.

func (*RoleUpsert) SetUpdatedAt

func (u *RoleUpsert) SetUpdatedAt(v time.Time) *RoleUpsert

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpsert) UpdateName

func (u *RoleUpsert) UpdateName() *RoleUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsert) UpdateUpdatedAt

func (u *RoleUpsert) UpdateUpdatedAt() *RoleUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type RoleUpsertBulk

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

RoleUpsertBulk is the builder for "upsert"-ing a bulk of Role nodes.

func (*RoleUpsertBulk) ClearUpdatedAt

func (u *RoleUpsertBulk) ClearUpdatedAt() *RoleUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpsertBulk) DoNothing

func (u *RoleUpsertBulk) DoNothing() *RoleUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUpsertBulk) Exec

func (u *RoleUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpsertBulk) ExecX

func (u *RoleUpsertBulk) ExecX(ctx context.Context)

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

func (*RoleUpsertBulk) Ignore

func (u *RoleUpsertBulk) Ignore() *RoleUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RoleUpsertBulk) SetName

func (u *RoleUpsertBulk) SetName(v string) *RoleUpsertBulk

SetName sets the "name" field.

func (*RoleUpsertBulk) SetUpdatedAt

func (u *RoleUpsertBulk) SetUpdatedAt(v time.Time) *RoleUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpsertBulk) Update

func (u *RoleUpsertBulk) Update(set func(*RoleUpsert)) *RoleUpsertBulk

Update allows overriding fields `UPDATE` values. See the RoleCreateBulk.OnConflict documentation for more info.

func (*RoleUpsertBulk) UpdateName

func (u *RoleUpsertBulk) UpdateName() *RoleUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateNewValues

func (u *RoleUpsertBulk) UpdateNewValues() *RoleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(role.FieldID)
		}),
	).
	Exec(ctx)

func (*RoleUpsertBulk) UpdateUpdatedAt

func (u *RoleUpsertBulk) UpdateUpdatedAt() *RoleUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type RoleUpsertOne

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

RoleUpsertOne is the builder for "upsert"-ing

one Role node.

func (*RoleUpsertOne) ClearUpdatedAt

func (u *RoleUpsertOne) ClearUpdatedAt() *RoleUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpsertOne) DoNothing

func (u *RoleUpsertOne) DoNothing() *RoleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUpsertOne) Exec

func (u *RoleUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpsertOne) ExecX

func (u *RoleUpsertOne) ExecX(ctx context.Context)

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

func (*RoleUpsertOne) ID

func (u *RoleUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*RoleUpsertOne) IDX

func (u *RoleUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*RoleUpsertOne) Ignore

func (u *RoleUpsertOne) Ignore() *RoleUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Role.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RoleUpsertOne) SetName

func (u *RoleUpsertOne) SetName(v string) *RoleUpsertOne

SetName sets the "name" field.

func (*RoleUpsertOne) SetUpdatedAt

func (u *RoleUpsertOne) SetUpdatedAt(v time.Time) *RoleUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpsertOne) Update

func (u *RoleUpsertOne) Update(set func(*RoleUpsert)) *RoleUpsertOne

Update allows overriding fields `UPDATE` values. See the RoleCreate.OnConflict documentation for more info.

func (*RoleUpsertOne) UpdateName

func (u *RoleUpsertOne) UpdateName() *RoleUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateNewValues

func (u *RoleUpsertOne) UpdateNewValues() *RoleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(role.FieldID)
		}),
	).
	Exec(ctx)

func (*RoleUpsertOne) UpdateUpdatedAt

func (u *RoleUpsertOne) UpdateUpdatedAt() *RoleUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type RoleWhereInput

type RoleWhereInput struct {
	Predicates []predicate.Role  `json:"-"`
	Not        *RoleWhereInput   `json:"not,omitempty"`
	Or         []*RoleWhereInput `json:"or,omitempty"`
	And        []*RoleWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "created_at" field predicates.
	CreatedAt       *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ    *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn     []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn  []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT     *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE    *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT     *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE    *time.Time  `json:"createdAtLTE,omitempty"`
	CreatedAtIsNil  bool        `json:"createdAtIsNil,omitempty"`
	CreatedAtNotNil bool        `json:"createdAtNotNil,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt       *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ    *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn     []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn  []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT     *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE    *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT     *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE    *time.Time  `json:"updatedAtLTE,omitempty"`
	UpdatedAtIsNil  bool        `json:"updatedAtIsNil,omitempty"`
	UpdatedAtNotNil bool        `json:"updatedAtNotNil,omitempty"`

	// "admin_created_by" edge predicates.
	HasAdminCreatedBy     *bool                  `json:"hasAdminCreatedBy,omitempty"`
	HasAdminCreatedByWith []*AdminUserWhereInput `json:"hasAdminCreatedByWith,omitempty"`

	// "admin_updated_by" edge predicates.
	HasAdminUpdatedBy     *bool                  `json:"hasAdminUpdatedBy,omitempty"`
	HasAdminUpdatedByWith []*AdminUserWhereInput `json:"hasAdminUpdatedByWith,omitempty"`

	// "admin_user_roles" edge predicates.
	HasAdminUserRoles     *bool                  `json:"hasAdminUserRoles,omitempty"`
	HasAdminUserRolesWith []*AdminUserWhereInput `json:"hasAdminUserRolesWith,omitempty"`

	// "user_roles" edge predicates.
	HasUserRoles     *bool             `json:"hasUserRoles,omitempty"`
	HasUserRolesWith []*UserWhereInput `json:"hasUserRolesWith,omitempty"`

	// "permissions" edge predicates.
	HasPermissions     *bool                   `json:"hasPermissions,omitempty"`
	HasPermissionsWith []*PermissionWhereInput `json:"hasPermissionsWith,omitempty"`
}

RoleWhereInput represents a where input for filtering Role queries.

func (*RoleWhereInput) AddPredicates

func (i *RoleWhereInput) AddPredicates(predicates ...predicate.Role)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*RoleWhereInput) Filter

func (i *RoleWhereInput) Filter(q *RoleQuery) (*RoleQuery, error)

Filter applies the RoleWhereInput filter on the RoleQuery builder.

func (*RoleWhereInput) P

func (i *RoleWhereInput) P() (predicate.Role, error)

P returns a predicate for filtering roles. An error is returned if the input is empty or invalid.

type RoleWhereUniqueInput

type RoleWhereUniqueInput struct {
	Predicates []predicate.Role `json:"-"`

	ID   *string `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

RoleWhereUniqueInput represents a where input for filtering Role queries.

func (*RoleWhereUniqueInput) AddPredicates

func (i *RoleWhereUniqueInput) AddPredicates(predicates ...predicate.Role)

func (*RoleWhereUniqueInput) Filter

func (i *RoleWhereUniqueInput) Filter(q *RoleQuery) (*RoleQuery, error)

func (*RoleWhereUniqueInput) P

type Roles

type Roles []*Role

Roles is a parsable slice of Role.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type 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 {

	// AdminUser is the client for interacting with the AdminUser builders.
	AdminUser *AdminUserClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Permission is the client for interacting with the Permission builders.
	Permission *PermissionClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

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

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type UpdateAdminUserInput

type UpdateAdminUserInput struct {
	ClearName                  bool
	Name                       *string
	Email                      *string
	Password                   *string
	FirstName                  *string
	LastName                   *string
	ClearRefAdminCreatedBy     bool
	RefAdminCreatedBy          *UpdateManyAdminUserInput
	AddRefAdminCreatedByIDs    []string
	RemoveRefAdminCreatedByIDs []string
	ClearAdminCreatedBy        bool
	AdminCreatedBy             *UpdateOneAdminUserInput
	AdminCreatedByID           *string
	ClearRefAdminUpdatedBy     bool
	RefAdminUpdatedBy          *UpdateManyAdminUserInput
	AddRefAdminUpdatedByIDs    []string
	RemoveRefAdminUpdatedByIDs []string
	ClearAdminUpdatedBy        bool
	AdminUpdatedBy             *UpdateOneAdminUserInput
	AdminUpdatedByID           *string
	ClearRoles                 bool
	Roles                      *UpdateManyRoleInput
	AddRoleIDs                 []string
	RemoveRoleIDs              []string
	ClearDefaultRole           bool
	DefaultRole                *UpdateOneRoleInput
	DefaultRoleID              *string
}

UpdateAdminUserInput represents a mutation input for updating adminusers.

func (*UpdateAdminUserInput) Mutate

Mutate applies the UpdateAdminUserInput on the AdminUserMutation builder.

type UpdateFileInput

type UpdateFileInput struct {
	ClearCreatedAt      bool
	CreatedAt           *time.Time
	ClearUpdatedAt      bool
	UpdatedAt           *time.Time
	ClearCaption        bool
	Caption             *string
	Name                *string
	MimeType            *string
	StorageFileName     *string
	Size                *int64
	ClearAdminCreatedBy bool
	AdminCreatedBy      *UpdateOneAdminUserInput
	AdminCreatedByID    *string
	ClearAdminUpdatedBy bool
	AdminUpdatedBy      *UpdateOneAdminUserInput
	AdminUpdatedByID    *string
	ClearCreatedBy      bool
	CreatedBy           *UpdateOneUserInput
	CreatedByID         *string
	ClearUpdatedBy      bool
	UpdatedBy           *UpdateOneUserInput
	UpdatedByID         *string
	Content             string `json:"content,omitempty"`
}

UpdateFileInput represents a mutation input for updating files.

func (*UpdateFileInput) Mutate

func (i *UpdateFileInput) Mutate(m *FileMutation)

Mutate applies the UpdateFileInput on the FileMutation builder.

type UpdateManyAdminUserInput

type UpdateManyAdminUserInput struct {
	Create     []*CreateAdminUserInput      `json:"create,omitempty"`
	Connect    []*AdminUserWhereUniqueInput `json:"connect,omitempty"`
	Disconnect []*AdminUserWhereUniqueInput `json:"disconnect,omitempty"`
	Delete     []*AdminUserWhereUniqueInput `json:"delete,omitempty"`
}

type UpdateManyFileInput

type UpdateManyFileInput struct {
	Create     []*CreateFileInput      `json:"create,omitempty"`
	Connect    []*FileWhereUniqueInput `json:"connect,omitempty"`
	Disconnect []*FileWhereUniqueInput `json:"disconnect,omitempty"`
	Delete     []*FileWhereUniqueInput `json:"delete,omitempty"`
}

type UpdateManyPermissionInput

type UpdateManyPermissionInput struct {
	Create     []*CreatePermissionInput      `json:"create,omitempty"`
	Connect    []*PermissionWhereUniqueInput `json:"connect,omitempty"`
	Disconnect []*PermissionWhereUniqueInput `json:"disconnect,omitempty"`
	Delete     []*PermissionWhereUniqueInput `json:"delete,omitempty"`
}

type UpdateManyRoleInput

type UpdateManyRoleInput struct {
	Create     []*CreateRoleInput      `json:"create,omitempty"`
	Connect    []*RoleWhereUniqueInput `json:"connect,omitempty"`
	Disconnect []*RoleWhereUniqueInput `json:"disconnect,omitempty"`
	Delete     []*RoleWhereUniqueInput `json:"delete,omitempty"`
}

type UpdateManyUserInput

type UpdateManyUserInput struct {
	Create     []*CreateUserInput      `json:"create,omitempty"`
	Connect    []*UserWhereUniqueInput `json:"connect,omitempty"`
	Disconnect []*UserWhereUniqueInput `json:"disconnect,omitempty"`
	Delete     []*UserWhereUniqueInput `json:"delete,omitempty"`
}

type UpdateOneAdminUserInput

type UpdateOneAdminUserInput struct {
	Create  *CreateAdminUserInput      `json:"create,omitempty"`
	Connect *AdminUserWhereUniqueInput `json:"connect,omitempty"`
	Unset   *bool                      `json:"unset,omitempty"`
	Delete  *bool                      `json:"delete,omitempty"`
}

type UpdateOneFileInput

type UpdateOneFileInput struct {
	Create  *CreateFileInput      `json:"create,omitempty"`
	Connect *FileWhereUniqueInput `json:"connect,omitempty"`
	Unset   *bool                 `json:"unset,omitempty"`
	Delete  *bool                 `json:"delete,omitempty"`
}

type UpdateOnePermissionInput

type UpdateOnePermissionInput struct {
	Create  *CreatePermissionInput      `json:"create,omitempty"`
	Connect *PermissionWhereUniqueInput `json:"connect,omitempty"`
	Unset   *bool                       `json:"unset,omitempty"`
	Delete  *bool                       `json:"delete,omitempty"`
}

type UpdateOneRoleInput

type UpdateOneRoleInput struct {
	Create  *CreateRoleInput      `json:"create,omitempty"`
	Connect *RoleWhereUniqueInput `json:"connect,omitempty"`
	Unset   *bool                 `json:"unset,omitempty"`
	Delete  *bool                 `json:"delete,omitempty"`
}

type UpdateOneUserInput

type UpdateOneUserInput struct {
	Create  *CreateUserInput      `json:"create,omitempty"`
	Connect *UserWhereUniqueInput `json:"connect,omitempty"`
	Unset   *bool                 `json:"unset,omitempty"`
	Delete  *bool                 `json:"delete,omitempty"`
}

type UpdatePermissionInput

type UpdatePermissionInput struct {
	ClearCreatedAt      bool
	CreatedAt           *time.Time
	ClearUpdatedAt      bool
	UpdatedAt           *time.Time
	Entity              *string
	Operation           *string
	ClearAdminCreatedBy bool
	AdminCreatedBy      *UpdateOneAdminUserInput
	AdminCreatedByID    *string
	ClearAdminUpdatedBy bool
	AdminUpdatedBy      *UpdateOneAdminUserInput
	AdminUpdatedByID    *string
	ClearRole           bool
	Role                *UpdateOneRoleInput
	RoleID              *string
}

UpdatePermissionInput represents a mutation input for updating permissions.

func (*UpdatePermissionInput) Mutate

Mutate applies the UpdatePermissionInput on the PermissionMutation builder.

type UpdateRoleInput

type UpdateRoleInput struct {
	Name                *string
	ClearAdminCreatedBy bool
	AdminCreatedBy      *UpdateOneAdminUserInput
	AdminCreatedByID    *string
	ClearAdminUpdatedBy bool
	AdminUpdatedBy      *UpdateOneAdminUserInput
	AdminUpdatedByID    *string
	ClearUserRoles      bool
	UserRoles           *UpdateManyAdminUserInput
	AddUserRoleIDs      []string
	RemoveUserRoleIDs   []string
	ClearPermissions    bool
	Permissions         *UpdateManyPermissionInput
	AddPermissionIDs    []string
	RemovePermissionIDs []string
}

UpdateRoleInput represents a mutation input for updating roles.

func (*UpdateRoleInput) Mutate

func (i *UpdateRoleInput) Mutate(m *RoleMutation)

Mutate applies the UpdateRoleInput on the RoleMutation builder.

type UpdateUserInput

type UpdateUserInput struct {
	Email                 *string
	Password              *string
	ClearRefCreatedBy     bool
	RefCreatedBy          *UpdateManyUserInput
	AddRefCreatedByIDs    []string
	RemoveRefCreatedByIDs []string
	ClearCreatedBy        bool
	CreatedBy             *UpdateOneUserInput
	CreatedByID           *string
	ClearRefUpdatedBy     bool
	RefUpdatedBy          *UpdateManyUserInput
	AddRefUpdatedByIDs    []string
	RemoveRefUpdatedByIDs []string
	ClearUpdatedBy        bool
	UpdatedBy             *UpdateOneUserInput
	UpdatedByID           *string
	ClearAdminCreatedBy   bool
	AdminCreatedBy        *UpdateOneAdminUserInput
	AdminCreatedByID      *string
	ClearAdminUpdatedBy   bool
	AdminUpdatedBy        *UpdateOneAdminUserInput
	AdminUpdatedByID      *string
	ClearRoles            bool
	Roles                 *UpdateManyRoleInput
	AddRoleIDs            []string
	RemoveRoleIDs         []string
	ClearDefaultRole      bool
	DefaultRole           *UpdateOneRoleInput
	DefaultRoleID         *string
}

UpdateUserInput represents a mutation input for updating users.

func (*UpdateUserInput) Mutate

func (i *UpdateUserInput) Mutate(m *UserMutation)

Mutate applies the UpdateUserInput on the UserMutation builder.

type User

type User struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) AdminCreatedBy

func (u *User) AdminCreatedBy(ctx context.Context) (*AdminUser, error)

func (*User) AdminUpdatedBy

func (u *User) AdminUpdatedBy(ctx context.Context) (*AdminUser, error)

func (*User) CreatedBy

func (u *User) CreatedBy(ctx context.Context) (*User, error)

func (*User) DefaultRole

func (u *User) DefaultRole(ctx context.Context) (*Role, error)

func (*User) ExecContext

func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*User) IsNode

func (*User) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*User) NamedRefCreatedBy

func (u *User) NamedRefCreatedBy(name string) ([]*User, error)

NamedRefCreatedBy returns the RefCreatedBy named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) NamedRefUpdatedBy

func (u *User) NamedRefUpdatedBy(name string) ([]*User, error)

NamedRefUpdatedBy returns the RefUpdatedBy named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) NamedRoles

func (u *User) NamedRoles(name string) ([]*Role, error)

NamedRoles returns the Roles named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) QueryAdminCreatedBy

func (u *User) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy queries the "admin_created_by" edge of the User entity.

func (*User) QueryAdminUpdatedBy

func (u *User) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy queries the "admin_updated_by" edge of the User entity.

func (*User) QueryContext

func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*User) QueryCreatedBy

func (u *User) QueryCreatedBy() *UserQuery

QueryCreatedBy queries the "created_by" edge of the User entity.

func (*User) QueryDefaultRole

func (u *User) QueryDefaultRole() *RoleQuery

QueryDefaultRole queries the "default_role" edge of the User entity.

func (*User) QueryRefCreatedBy

func (u *User) QueryRefCreatedBy() *UserQuery

QueryRefCreatedBy queries the "ref_created_by" edge of the User entity.

func (*User) QueryRefUpdatedBy

func (u *User) QueryRefUpdatedBy() *UserQuery

QueryRefUpdatedBy queries the "ref_updated_by" edge of the User entity.

func (*User) QueryRoles

func (u *User) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the User entity.

func (*User) QueryUpdatedBy

func (u *User) QueryUpdatedBy() *UserQuery

QueryUpdatedBy queries the "updated_by" edge of the User entity.

func (*User) Roles

func (u *User) Roles(ctx context.Context) (result []*Role, err error)

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) ToEdge

func (u *User) ToEdge(order *UserOrder) *UserEdge

ToEdge converts User into UserEdge.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

func (*User) UpdatedBy

func (u *User) UpdatedBy(ctx context.Context) (*User, error)

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

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

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

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

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

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

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

func (*UserClient) ExecContext

func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserClient) Get

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

Get returns a User entity by its id.

func (*UserClient) GetX

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

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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 (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAdminCreatedBy

func (c *UserClient) QueryAdminCreatedBy(u *User) *AdminUserQuery

QueryAdminCreatedBy queries the admin_created_by edge of a User.

func (*UserClient) QueryAdminUpdatedBy

func (c *UserClient) QueryAdminUpdatedBy(u *User) *AdminUserQuery

QueryAdminUpdatedBy queries the admin_updated_by edge of a User.

func (*UserClient) QueryContext

func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserClient) QueryCreatedBy

func (c *UserClient) QueryCreatedBy(u *User) *UserQuery

QueryCreatedBy queries the created_by edge of a User.

func (*UserClient) QueryDefaultRole

func (c *UserClient) QueryDefaultRole(u *User) *RoleQuery

QueryDefaultRole queries the default_role edge of a User.

func (*UserClient) QueryRefCreatedBy

func (c *UserClient) QueryRefCreatedBy(u *User) *UserQuery

QueryRefCreatedBy queries the ref_created_by edge of a User.

func (*UserClient) QueryRefUpdatedBy

func (c *UserClient) QueryRefUpdatedBy(u *User) *UserQuery

QueryRefUpdatedBy queries the ref_updated_by edge of a User.

func (*UserClient) QueryRoles

func (c *UserClient) QueryRoles(u *User) *RoleQuery

QueryRoles queries the roles edge of a User.

func (*UserClient) QueryUpdatedBy

func (c *UserClient) QueryUpdatedBy(u *User) *UserQuery

QueryUpdatedBy queries the updated_by edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id string) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserConnection

type UserConnection struct {
	Edges      []*UserEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

UserConnection is the connection containing edges to User.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddRefCreatedBy

func (uc *UserCreate) AddRefCreatedBy(u ...*User) *UserCreate

AddRefCreatedBy adds the "ref_created_by" edges to the User entity.

func (*UserCreate) AddRefCreatedByIDs

func (uc *UserCreate) AddRefCreatedByIDs(ids ...string) *UserCreate

AddRefCreatedByIDs adds the "ref_created_by" edge to the User entity by IDs.

func (*UserCreate) AddRefUpdatedBy

func (uc *UserCreate) AddRefUpdatedBy(u ...*User) *UserCreate

AddRefUpdatedBy adds the "ref_updated_by" edges to the User entity.

func (*UserCreate) AddRefUpdatedByIDs

func (uc *UserCreate) AddRefUpdatedByIDs(ids ...string) *UserCreate

AddRefUpdatedByIDs adds the "ref_updated_by" edge to the User entity by IDs.

func (*UserCreate) AddRoleIDs

func (uc *UserCreate) AddRoleIDs(ids ...string) *UserCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserCreate) AddRoles

func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate

AddRoles adds the "roles" edges to the Role entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecContext

func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetEmail(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetEmail(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) QueryContext

func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAdminCreatedBy

func (uc *UserCreate) SetAdminCreatedBy(a *AdminUser) *UserCreate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*UserCreate) SetAdminCreatedByID

func (uc *UserCreate) SetAdminCreatedByID(id string) *UserCreate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*UserCreate) SetAdminUpdatedBy

func (uc *UserCreate) SetAdminUpdatedBy(a *AdminUser) *UserCreate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*UserCreate) SetAdminUpdatedByID

func (uc *UserCreate) SetAdminUpdatedByID(id string) *UserCreate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*UserCreate) SetCreatedBy

func (uc *UserCreate) SetCreatedBy(u *User) *UserCreate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*UserCreate) SetCreatedByID

func (uc *UserCreate) SetCreatedByID(id string) *UserCreate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*UserCreate) SetDefaultRole

func (uc *UserCreate) SetDefaultRole(r *Role) *UserCreate

SetDefaultRole sets the "default_role" edge to the Role entity.

func (*UserCreate) SetDefaultRoleID

func (uc *UserCreate) SetDefaultRoleID(id string) *UserCreate

SetDefaultRoleID sets the "default_role" edge to the Role entity by ID.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(s string) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetInput

func (c *UserCreate) SetInput(i CreateUserInput) *UserCreate

SetInput applies the change-set in the CreateUserInput on the UserCreate builder.

func (*UserCreate) SetNillableAdminCreatedByID

func (uc *UserCreate) SetNillableAdminCreatedByID(id *string) *UserCreate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*UserCreate) SetNillableAdminUpdatedByID

func (uc *UserCreate) SetNillableAdminUpdatedByID(id *string) *UserCreate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*UserCreate) SetNillableCreatedByID

func (uc *UserCreate) SetNillableCreatedByID(id *string) *UserCreate

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*UserCreate) SetNillableDefaultRoleID

func (uc *UserCreate) SetNillableDefaultRoleID(id *string) *UserCreate

SetNillableDefaultRoleID sets the "default_role" edge to the Role entity by ID if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(s *string) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedByID

func (uc *UserCreate) SetNillableUpdatedByID(id *string) *UserCreate

SetNillableUpdatedByID sets the "updated_by" edge to the User entity by ID if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUpdatedBy

func (uc *UserCreate) SetUpdatedBy(u *User) *UserCreate

SetUpdatedBy sets the "updated_by" edge to the User entity.

func (*UserCreate) SetUpdatedByID

func (uc *UserCreate) SetUpdatedByID(id string) *UserCreate

SetUpdatedByID sets the "updated_by" edge to the User entity by ID.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecContext

func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetEmail(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) QueryContext

func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecContext

func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) QueryContext

func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdge

type UserEdge struct {
	Node   *User  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

UserEdge is the edge representation of User.

type UserEdges

type UserEdges struct {
	// RefCreatedBy holds the value of the ref_created_by edge.
	RefCreatedBy []*User `json:"ref_created_by,omitempty"`
	// CreatedBy holds the value of the created_by edge.
	CreatedBy *User `json:"created_by,omitempty"`
	// RefUpdatedBy holds the value of the ref_updated_by edge.
	RefUpdatedBy []*User `json:"ref_updated_by,omitempty"`
	// UpdatedBy holds the value of the updated_by edge.
	UpdatedBy *User `json:"updated_by,omitempty"`
	// AdminCreatedBy holds the value of the admin_created_by edge.
	AdminCreatedBy *AdminUser `json:"admin_created_by,omitempty"`
	// AdminUpdatedBy holds the value of the admin_updated_by edge.
	AdminUpdatedBy *AdminUser `json:"admin_updated_by,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// DefaultRole holds the value of the default_role edge.
	DefaultRole *Role `json:"default_role,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AdminCreatedByOrErr

func (e UserEdges) AdminCreatedByOrErr() (*AdminUser, error)

AdminCreatedByOrErr returns the AdminCreatedBy value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) AdminUpdatedByOrErr

func (e UserEdges) AdminUpdatedByOrErr() (*AdminUser, error)

AdminUpdatedByOrErr returns the AdminUpdatedBy value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) CreatedByOrErr

func (e UserEdges) CreatedByOrErr() (*User, error)

CreatedByOrErr returns the CreatedBy value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) DefaultRoleOrErr

func (e UserEdges) DefaultRoleOrErr() (*Role, error)

DefaultRoleOrErr returns the DefaultRole value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) RefCreatedByOrErr

func (e UserEdges) RefCreatedByOrErr() ([]*User, error)

RefCreatedByOrErr returns the RefCreatedBy value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RefUpdatedByOrErr

func (e UserEdges) RefUpdatedByOrErr() ([]*User, error)

RefUpdatedByOrErr returns the RefUpdatedBy value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RolesOrErr

func (e UserEdges) RolesOrErr() ([]*Role, error)

RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.

func (UserEdges) UpdatedByOrErr

func (e UserEdges) UpdatedByOrErr() (*User, error)

UpdatedByOrErr returns the UpdatedBy value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddEdges

func (m *UserMutation) AddEdges(name string, values []string) error

AddEdges sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddRefCreatedByIDs

func (m *UserMutation) AddRefCreatedByIDs(ids ...string)

AddRefCreatedByIDs adds the "ref_created_by" edge to the User entity by ids.

func (*UserMutation) AddRefUpdatedByIDs

func (m *UserMutation) AddRefUpdatedByIDs(ids ...string)

AddRefUpdatedByIDs adds the "ref_updated_by" edge to the User entity by ids.

func (*UserMutation) AddRoleIDs

func (m *UserMutation) AddRoleIDs(ids ...string)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AdminCreatedByCleared

func (m *UserMutation) AdminCreatedByCleared() bool

AdminCreatedByCleared reports if the "admin_created_by" edge to the AdminUser entity was cleared.

func (*UserMutation) AdminCreatedByID

func (m *UserMutation) AdminCreatedByID() (id string, exists bool)

AdminCreatedByID returns the "admin_created_by" edge ID in the mutation.

func (*UserMutation) AdminCreatedByIDs

func (m *UserMutation) AdminCreatedByIDs() (ids []string)

AdminCreatedByIDs returns the "admin_created_by" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AdminCreatedByID instead. It exists only for internal usage by the builders.

func (*UserMutation) AdminUpdatedByCleared

func (m *UserMutation) AdminUpdatedByCleared() bool

AdminUpdatedByCleared reports if the "admin_updated_by" edge to the AdminUser entity was cleared.

func (*UserMutation) AdminUpdatedByID

func (m *UserMutation) AdminUpdatedByID() (id string, exists bool)

AdminUpdatedByID returns the "admin_updated_by" edge ID in the mutation.

func (*UserMutation) AdminUpdatedByIDs

func (m *UserMutation) AdminUpdatedByIDs() (ids []string)

AdminUpdatedByIDs returns the "admin_updated_by" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AdminUpdatedByID instead. It exists only for internal usage by the builders.

func (*UserMutation) ClearAdminCreatedBy

func (m *UserMutation) ClearAdminCreatedBy()

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*UserMutation) ClearAdminUpdatedBy

func (m *UserMutation) ClearAdminUpdatedBy()

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*UserMutation) ClearCreatedBy

func (m *UserMutation) ClearCreatedBy()

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*UserMutation) ClearDefaultRole

func (m *UserMutation) ClearDefaultRole()

ClearDefaultRole clears the "default_role" edge to the Role entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearRefCreatedBy

func (m *UserMutation) ClearRefCreatedBy()

ClearRefCreatedBy clears the "ref_created_by" edge to the User entity.

func (*UserMutation) ClearRefUpdatedBy

func (m *UserMutation) ClearRefUpdatedBy()

ClearRefUpdatedBy clears the "ref_updated_by" edge to the User entity.

func (*UserMutation) ClearRoles

func (m *UserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*UserMutation) ClearUpdatedBy

func (m *UserMutation) ClearUpdatedBy()

ClearUpdatedBy clears the "updated_by" edge to the User entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedByCleared

func (m *UserMutation) CreatedByCleared() bool

CreatedByCleared reports if the "created_by" edge to the User entity was cleared.

func (*UserMutation) CreatedByID

func (m *UserMutation) CreatedByID() (id string, exists bool)

CreatedByID returns the "created_by" edge ID in the mutation.

func (*UserMutation) CreatedByIDs

func (m *UserMutation) CreatedByIDs() (ids []string)

CreatedByIDs returns the "created_by" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatedByID instead. It exists only for internal usage by the builders.

func (*UserMutation) DefaultRoleCleared

func (m *UserMutation) DefaultRoleCleared() bool

DefaultRoleCleared reports if the "default_role" edge to the Role entity was cleared.

func (*UserMutation) DefaultRoleID

func (m *UserMutation) DefaultRoleID() (id string, exists bool)

DefaultRoleID returns the "default_role" edge ID in the mutation.

func (*UserMutation) DefaultRoleIDs

func (m *UserMutation) DefaultRoleIDs() (ids []string)

DefaultRoleIDs returns the "default_role" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DefaultRoleID instead. It exists only for internal usage by the builders.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) ExecContext

func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) QueryContext

func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserMutation) RefCreatedByCleared

func (m *UserMutation) RefCreatedByCleared() bool

RefCreatedByCleared reports if the "ref_created_by" edge to the User entity was cleared.

func (*UserMutation) RefCreatedByIDs

func (m *UserMutation) RefCreatedByIDs() (ids []string)

RefCreatedByIDs returns the "ref_created_by" edge IDs in the mutation.

func (*UserMutation) RefUpdatedByCleared

func (m *UserMutation) RefUpdatedByCleared() bool

RefUpdatedByCleared reports if the "ref_updated_by" edge to the User entity was cleared.

func (*UserMutation) RefUpdatedByIDs

func (m *UserMutation) RefUpdatedByIDs() (ids []string)

RefUpdatedByIDs returns the "ref_updated_by" edge IDs in the mutation.

func (*UserMutation) RemoveRefCreatedByIDs

func (m *UserMutation) RemoveRefCreatedByIDs(ids ...string)

RemoveRefCreatedByIDs removes the "ref_created_by" edge to the User entity by IDs.

func (*UserMutation) RemoveRefUpdatedByIDs

func (m *UserMutation) RemoveRefUpdatedByIDs(ids ...string)

RemoveRefUpdatedByIDs removes the "ref_updated_by" edge to the User entity by IDs.

func (*UserMutation) RemoveRoleIDs

func (m *UserMutation) RemoveRoleIDs(ids ...string)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedRefCreatedByIDs

func (m *UserMutation) RemovedRefCreatedByIDs() (ids []string)

RemovedRefCreatedBy returns the removed IDs of the "ref_created_by" edge to the User entity.

func (*UserMutation) RemovedRefUpdatedByIDs

func (m *UserMutation) RemovedRefUpdatedByIDs() (ids []string)

RemovedRefUpdatedBy returns the removed IDs of the "ref_updated_by" edge to the User entity.

func (*UserMutation) RemovedRolesIDs

func (m *UserMutation) RemovedRolesIDs() (ids []string)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*UserMutation) ResetAdminCreatedBy

func (m *UserMutation) ResetAdminCreatedBy()

ResetAdminCreatedBy resets all changes to the "admin_created_by" edge.

func (*UserMutation) ResetAdminUpdatedBy

func (m *UserMutation) ResetAdminUpdatedBy()

ResetAdminUpdatedBy resets all changes to the "admin_updated_by" edge.

func (*UserMutation) ResetCreatedBy

func (m *UserMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" edge.

func (*UserMutation) ResetDefaultRole

func (m *UserMutation) ResetDefaultRole()

ResetDefaultRole resets all changes to the "default_role" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetRefCreatedBy

func (m *UserMutation) ResetRefCreatedBy()

ResetRefCreatedBy resets all changes to the "ref_created_by" edge.

func (*UserMutation) ResetRefUpdatedBy

func (m *UserMutation) ResetRefUpdatedBy()

ResetRefUpdatedBy resets all changes to the "ref_updated_by" edge.

func (*UserMutation) ResetRoles

func (m *UserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMutation) ResetUpdatedBy

func (m *UserMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" edge.

func (*UserMutation) RolesCleared

func (m *UserMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (*UserMutation) RolesIDs

func (m *UserMutation) RolesIDs() (ids []string)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*UserMutation) SetAdminCreatedByID

func (m *UserMutation) SetAdminCreatedByID(id string)

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by id.

func (*UserMutation) SetAdminUpdatedByID

func (m *UserMutation) SetAdminUpdatedByID(id string)

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by id.

func (*UserMutation) SetCreatedByID

func (m *UserMutation) SetCreatedByID(id string)

SetCreatedByID sets the "created_by" edge to the User entity by id.

func (*UserMutation) SetDefaultRoleID

func (m *UserMutation) SetDefaultRoleID(id string)

SetDefaultRoleID sets the "default_role" edge to the Role entity by id.

func (*UserMutation) SetEdge

func (m *UserMutation) SetEdge(name, value string) error

SetEdge sets the value of a field with the given name. It returns an error if the edge is not defined in the schema

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUpdatedByID

func (m *UserMutation) SetUpdatedByID(id string)

SetUpdatedByID sets the "updated_by" edge to the User entity by id.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedByCleared

func (m *UserMutation) UpdatedByCleared() bool

UpdatedByCleared reports if the "updated_by" edge to the User entity was cleared.

func (*UserMutation) UpdatedByID

func (m *UserMutation) UpdatedByID() (id string, exists bool)

UpdatedByID returns the "updated_by" edge ID in the mutation.

func (*UserMutation) UpdatedByIDs

func (m *UserMutation) UpdatedByIDs() (ids []string)

UpdatedByIDs returns the "updated_by" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UpdatedByID instead. It exists only for internal usage by the builders.

func (*UserMutation) UpdatedFields

func (m *UserMutation) UpdatedFields() map[string]Value

UpdatedFields returns all fields and edges that were changed during this mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserOrder

type UserOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *UserOrderField `json:"field"`
}

UserOrder defines the ordering of User.

type UserOrderField

type UserOrderField struct {
	// Value extracts the ordering value from the given User.
	Value func(*User) (ent.Value, error)
	// contains filtered or unexported fields
}

UserOrderField defines the ordering field of User.

func (UserOrderField) MarshalGQL

func (f UserOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (UserOrderField) String

func (f UserOrderField) String() string

String implement fmt.Stringer interface.

func (*UserOrderField) UnmarshalGQL

func (f *UserOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type UserPaginateOption

type UserPaginateOption func(*userPager) error

UserPaginateOption enables pagination customization.

func WithUserFilter

func WithUserFilter(filter func(*UserQuery) (*UserQuery, error)) UserPaginateOption

WithUserFilter configures pagination filter.

func WithUserOrder

func WithUserOrder(order []*UserOrder) UserPaginateOption

WithUserOrder configures pagination ordering.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) CollectFields

func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) ExecContext

func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldEmail).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Paginate

func (u *UserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...UserPaginateOption,
) (*UserConnection, error)

Paginate executes the query and returns a relay based cursor connection to User.

func (*UserQuery) QueryAdminCreatedBy

func (uq *UserQuery) QueryAdminCreatedBy() *AdminUserQuery

QueryAdminCreatedBy chains the current query on the "admin_created_by" edge.

func (*UserQuery) QueryAdminUpdatedBy

func (uq *UserQuery) QueryAdminUpdatedBy() *AdminUserQuery

QueryAdminUpdatedBy chains the current query on the "admin_updated_by" edge.

func (*UserQuery) QueryContext

func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserQuery) QueryCreatedBy

func (uq *UserQuery) QueryCreatedBy() *UserQuery

QueryCreatedBy chains the current query on the "created_by" edge.

func (*UserQuery) QueryDefaultRole

func (uq *UserQuery) QueryDefaultRole() *RoleQuery

QueryDefaultRole chains the current query on the "default_role" edge.

func (*UserQuery) QueryRefCreatedBy

func (uq *UserQuery) QueryRefCreatedBy() *UserQuery

QueryRefCreatedBy chains the current query on the "ref_created_by" edge.

func (*UserQuery) QueryRefUpdatedBy

func (uq *UserQuery) QueryRefUpdatedBy() *UserQuery

QueryRefUpdatedBy chains the current query on the "ref_updated_by" edge.

func (*UserQuery) QueryRoles

func (uq *UserQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*UserQuery) QueryUpdatedBy

func (uq *UserQuery) QueryUpdatedBy() *UserQuery

QueryUpdatedBy chains the current query on the "updated_by" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Email string `json:"email,omitempty"`
}

client.User.Query().
	Select(user.FieldEmail).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAdminCreatedBy

func (uq *UserQuery) WithAdminCreatedBy(opts ...func(*AdminUserQuery)) *UserQuery

WithAdminCreatedBy tells the query-builder to eager-load the nodes that are connected to the "admin_created_by" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithAdminUpdatedBy

func (uq *UserQuery) WithAdminUpdatedBy(opts ...func(*AdminUserQuery)) *UserQuery

WithAdminUpdatedBy tells the query-builder to eager-load the nodes that are connected to the "admin_updated_by" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithCreatedBy

func (uq *UserQuery) WithCreatedBy(opts ...func(*UserQuery)) *UserQuery

WithCreatedBy tells the query-builder to eager-load the nodes that are connected to the "created_by" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithDefaultRole

func (uq *UserQuery) WithDefaultRole(opts ...func(*RoleQuery)) *UserQuery

WithDefaultRole tells the query-builder to eager-load the nodes that are connected to the "default_role" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedRefCreatedBy

func (uq *UserQuery) WithNamedRefCreatedBy(name string, opts ...func(*UserQuery)) *UserQuery

WithNamedRefCreatedBy tells the query-builder to eager-load the nodes that are connected to the "ref_created_by" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedRefUpdatedBy

func (uq *UserQuery) WithNamedRefUpdatedBy(name string, opts ...func(*UserQuery)) *UserQuery

WithNamedRefUpdatedBy tells the query-builder to eager-load the nodes that are connected to the "ref_updated_by" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedRoles

func (uq *UserQuery) WithNamedRoles(name string, opts ...func(*RoleQuery)) *UserQuery

WithNamedRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRefCreatedBy

func (uq *UserQuery) WithRefCreatedBy(opts ...func(*UserQuery)) *UserQuery

WithRefCreatedBy tells the query-builder to eager-load the nodes that are connected to the "ref_created_by" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRefUpdatedBy

func (uq *UserQuery) WithRefUpdatedBy(opts ...func(*UserQuery)) *UserQuery

WithRefUpdatedBy tells the query-builder to eager-load the nodes that are connected to the "ref_updated_by" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRoles

func (uq *UserQuery) WithRoles(opts ...func(*RoleQuery)) *UserQuery

WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithUpdatedBy

func (uq *UserQuery) WithUpdatedBy(opts ...func(*UserQuery)) *UserQuery

WithUpdatedBy tells the query-builder to eager-load the nodes that are connected to the "updated_by" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (UserSelect) ExecContext

func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (UserSelect) QueryContext

func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddRefCreatedBy

func (uu *UserUpdate) AddRefCreatedBy(u ...*User) *UserUpdate

AddRefCreatedBy adds the "ref_created_by" edges to the User entity.

func (*UserUpdate) AddRefCreatedByIDs

func (uu *UserUpdate) AddRefCreatedByIDs(ids ...string) *UserUpdate

AddRefCreatedByIDs adds the "ref_created_by" edge to the User entity by IDs.

func (*UserUpdate) AddRefUpdatedBy

func (uu *UserUpdate) AddRefUpdatedBy(u ...*User) *UserUpdate

AddRefUpdatedBy adds the "ref_updated_by" edges to the User entity.

func (*UserUpdate) AddRefUpdatedByIDs

func (uu *UserUpdate) AddRefUpdatedByIDs(ids ...string) *UserUpdate

AddRefUpdatedByIDs adds the "ref_updated_by" edge to the User entity by IDs.

func (*UserUpdate) AddRoleIDs

func (uu *UserUpdate) AddRoleIDs(ids ...string) *UserUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdate) AddRoles

func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdate) ClearAdminCreatedBy

func (uu *UserUpdate) ClearAdminCreatedBy() *UserUpdate

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*UserUpdate) ClearAdminUpdatedBy

func (uu *UserUpdate) ClearAdminUpdatedBy() *UserUpdate

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*UserUpdate) ClearCreatedBy

func (uu *UserUpdate) ClearCreatedBy() *UserUpdate

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*UserUpdate) ClearDefaultRole

func (uu *UserUpdate) ClearDefaultRole() *UserUpdate

ClearDefaultRole clears the "default_role" edge to the Role entity.

func (*UserUpdate) ClearRefCreatedBy

func (uu *UserUpdate) ClearRefCreatedBy() *UserUpdate

ClearRefCreatedBy clears all "ref_created_by" edges to the User entity.

func (*UserUpdate) ClearRefUpdatedBy

func (uu *UserUpdate) ClearRefUpdatedBy() *UserUpdate

ClearRefUpdatedBy clears all "ref_updated_by" edges to the User entity.

func (*UserUpdate) ClearRoles

func (uu *UserUpdate) ClearRoles() *UserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdate) ClearUpdatedBy

func (uu *UserUpdate) ClearUpdatedBy() *UserUpdate

ClearUpdatedBy clears the "updated_by" edge to the User entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecContext

func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) QueryContext

func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdate) RemoveRefCreatedBy

func (uu *UserUpdate) RemoveRefCreatedBy(u ...*User) *UserUpdate

RemoveRefCreatedBy removes "ref_created_by" edges to User entities.

func (*UserUpdate) RemoveRefCreatedByIDs

func (uu *UserUpdate) RemoveRefCreatedByIDs(ids ...string) *UserUpdate

RemoveRefCreatedByIDs removes the "ref_created_by" edge to User entities by IDs.

func (*UserUpdate) RemoveRefUpdatedBy

func (uu *UserUpdate) RemoveRefUpdatedBy(u ...*User) *UserUpdate

RemoveRefUpdatedBy removes "ref_updated_by" edges to User entities.

func (*UserUpdate) RemoveRefUpdatedByIDs

func (uu *UserUpdate) RemoveRefUpdatedByIDs(ids ...string) *UserUpdate

RemoveRefUpdatedByIDs removes the "ref_updated_by" edge to User entities by IDs.

func (*UserUpdate) RemoveRoleIDs

func (uu *UserUpdate) RemoveRoleIDs(ids ...string) *UserUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdate) RemoveRoles

func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAdminCreatedBy

func (uu *UserUpdate) SetAdminCreatedBy(a *AdminUser) *UserUpdate

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*UserUpdate) SetAdminCreatedByID

func (uu *UserUpdate) SetAdminCreatedByID(id string) *UserUpdate

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*UserUpdate) SetAdminUpdatedBy

func (uu *UserUpdate) SetAdminUpdatedBy(a *AdminUser) *UserUpdate

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*UserUpdate) SetAdminUpdatedByID

func (uu *UserUpdate) SetAdminUpdatedByID(id string) *UserUpdate

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*UserUpdate) SetCreatedBy

func (uu *UserUpdate) SetCreatedBy(u *User) *UserUpdate

SetCreatedBy sets the "created_by" edge to the User entity.

func (*UserUpdate) SetCreatedByID

func (uu *UserUpdate) SetCreatedByID(id string) *UserUpdate

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*UserUpdate) SetDefaultRole

func (uu *UserUpdate) SetDefaultRole(r *Role) *UserUpdate

SetDefaultRole sets the "default_role" edge to the Role entity.

func (*UserUpdate) SetDefaultRoleID

func (uu *UserUpdate) SetDefaultRoleID(id string) *UserUpdate

SetDefaultRoleID sets the "default_role" edge to the Role entity by ID.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetInput

func (c *UserUpdate) SetInput(i UpdateUserInput) *UserUpdate

SetInput applies the change-set in the UpdateUserInput on the UserUpdate builder.

func (*UserUpdate) SetNillableAdminCreatedByID

func (uu *UserUpdate) SetNillableAdminCreatedByID(id *string) *UserUpdate

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableAdminUpdatedByID

func (uu *UserUpdate) SetNillableAdminUpdatedByID(id *string) *UserUpdate

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableCreatedByID

func (uu *UserUpdate) SetNillableCreatedByID(id *string) *UserUpdate

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableDefaultRoleID

func (uu *UserUpdate) SetNillableDefaultRoleID(id *string) *UserUpdate

SetNillableDefaultRoleID sets the "default_role" edge to the Role entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableUpdatedByID

func (uu *UserUpdate) SetNillableUpdatedByID(id *string) *UserUpdate

SetNillableUpdatedByID sets the "updated_by" edge to the User entity by ID if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUpdatedBy

func (uu *UserUpdate) SetUpdatedBy(u *User) *UserUpdate

SetUpdatedBy sets the "updated_by" edge to the User entity.

func (*UserUpdate) SetUpdatedByID

func (uu *UserUpdate) SetUpdatedByID(id string) *UserUpdate

SetUpdatedByID sets the "updated_by" edge to the User entity by ID.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddRefCreatedBy

func (uuo *UserUpdateOne) AddRefCreatedBy(u ...*User) *UserUpdateOne

AddRefCreatedBy adds the "ref_created_by" edges to the User entity.

func (*UserUpdateOne) AddRefCreatedByIDs

func (uuo *UserUpdateOne) AddRefCreatedByIDs(ids ...string) *UserUpdateOne

AddRefCreatedByIDs adds the "ref_created_by" edge to the User entity by IDs.

func (*UserUpdateOne) AddRefUpdatedBy

func (uuo *UserUpdateOne) AddRefUpdatedBy(u ...*User) *UserUpdateOne

AddRefUpdatedBy adds the "ref_updated_by" edges to the User entity.

func (*UserUpdateOne) AddRefUpdatedByIDs

func (uuo *UserUpdateOne) AddRefUpdatedByIDs(ids ...string) *UserUpdateOne

AddRefUpdatedByIDs adds the "ref_updated_by" edge to the User entity by IDs.

func (*UserUpdateOne) AddRoleIDs

func (uuo *UserUpdateOne) AddRoleIDs(ids ...string) *UserUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdateOne) AddRoles

func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdateOne) ClearAdminCreatedBy

func (uuo *UserUpdateOne) ClearAdminCreatedBy() *UserUpdateOne

ClearAdminCreatedBy clears the "admin_created_by" edge to the AdminUser entity.

func (*UserUpdateOne) ClearAdminUpdatedBy

func (uuo *UserUpdateOne) ClearAdminUpdatedBy() *UserUpdateOne

ClearAdminUpdatedBy clears the "admin_updated_by" edge to the AdminUser entity.

func (*UserUpdateOne) ClearCreatedBy

func (uuo *UserUpdateOne) ClearCreatedBy() *UserUpdateOne

ClearCreatedBy clears the "created_by" edge to the User entity.

func (*UserUpdateOne) ClearDefaultRole

func (uuo *UserUpdateOne) ClearDefaultRole() *UserUpdateOne

ClearDefaultRole clears the "default_role" edge to the Role entity.

func (*UserUpdateOne) ClearRefCreatedBy

func (uuo *UserUpdateOne) ClearRefCreatedBy() *UserUpdateOne

ClearRefCreatedBy clears all "ref_created_by" edges to the User entity.

func (*UserUpdateOne) ClearRefUpdatedBy

func (uuo *UserUpdateOne) ClearRefUpdatedBy() *UserUpdateOne

ClearRefUpdatedBy clears all "ref_updated_by" edges to the User entity.

func (*UserUpdateOne) ClearRoles

func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdateOne) ClearUpdatedBy

func (uuo *UserUpdateOne) ClearUpdatedBy() *UserUpdateOne

ClearUpdatedBy clears the "updated_by" edge to the User entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecContext

func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) QueryContext

func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdateOne) RemoveRefCreatedBy

func (uuo *UserUpdateOne) RemoveRefCreatedBy(u ...*User) *UserUpdateOne

RemoveRefCreatedBy removes "ref_created_by" edges to User entities.

func (*UserUpdateOne) RemoveRefCreatedByIDs

func (uuo *UserUpdateOne) RemoveRefCreatedByIDs(ids ...string) *UserUpdateOne

RemoveRefCreatedByIDs removes the "ref_created_by" edge to User entities by IDs.

func (*UserUpdateOne) RemoveRefUpdatedBy

func (uuo *UserUpdateOne) RemoveRefUpdatedBy(u ...*User) *UserUpdateOne

RemoveRefUpdatedBy removes "ref_updated_by" edges to User entities.

func (*UserUpdateOne) RemoveRefUpdatedByIDs

func (uuo *UserUpdateOne) RemoveRefUpdatedByIDs(ids ...string) *UserUpdateOne

RemoveRefUpdatedByIDs removes the "ref_updated_by" edge to User entities by IDs.

func (*UserUpdateOne) RemoveRoleIDs

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...string) *UserUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdateOne) RemoveRoles

func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAdminCreatedBy

func (uuo *UserUpdateOne) SetAdminCreatedBy(a *AdminUser) *UserUpdateOne

SetAdminCreatedBy sets the "admin_created_by" edge to the AdminUser entity.

func (*UserUpdateOne) SetAdminCreatedByID

func (uuo *UserUpdateOne) SetAdminCreatedByID(id string) *UserUpdateOne

SetAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID.

func (*UserUpdateOne) SetAdminUpdatedBy

func (uuo *UserUpdateOne) SetAdminUpdatedBy(a *AdminUser) *UserUpdateOne

SetAdminUpdatedBy sets the "admin_updated_by" edge to the AdminUser entity.

func (*UserUpdateOne) SetAdminUpdatedByID

func (uuo *UserUpdateOne) SetAdminUpdatedByID(id string) *UserUpdateOne

SetAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID.

func (*UserUpdateOne) SetCreatedBy

func (uuo *UserUpdateOne) SetCreatedBy(u *User) *UserUpdateOne

SetCreatedBy sets the "created_by" edge to the User entity.

func (*UserUpdateOne) SetCreatedByID

func (uuo *UserUpdateOne) SetCreatedByID(id string) *UserUpdateOne

SetCreatedByID sets the "created_by" edge to the User entity by ID.

func (*UserUpdateOne) SetDefaultRole

func (uuo *UserUpdateOne) SetDefaultRole(r *Role) *UserUpdateOne

SetDefaultRole sets the "default_role" edge to the Role entity.

func (*UserUpdateOne) SetDefaultRoleID

func (uuo *UserUpdateOne) SetDefaultRoleID(id string) *UserUpdateOne

SetDefaultRoleID sets the "default_role" edge to the Role entity by ID.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetInput

SetInput applies the change-set in the UpdateUserInput on the UserUpdateOne builder.

func (*UserUpdateOne) SetNillableAdminCreatedByID

func (uuo *UserUpdateOne) SetNillableAdminCreatedByID(id *string) *UserUpdateOne

SetNillableAdminCreatedByID sets the "admin_created_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableAdminUpdatedByID

func (uuo *UserUpdateOne) SetNillableAdminUpdatedByID(id *string) *UserUpdateOne

SetNillableAdminUpdatedByID sets the "admin_updated_by" edge to the AdminUser entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableCreatedByID

func (uuo *UserUpdateOne) SetNillableCreatedByID(id *string) *UserUpdateOne

SetNillableCreatedByID sets the "created_by" edge to the User entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableDefaultRoleID

func (uuo *UserUpdateOne) SetNillableDefaultRoleID(id *string) *UserUpdateOne

SetNillableDefaultRoleID sets the "default_role" edge to the Role entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUpdatedByID

func (uuo *UserUpdateOne) SetNillableUpdatedByID(id *string) *UserUpdateOne

SetNillableUpdatedByID sets the "updated_by" edge to the User entity by ID if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUpdatedBy

func (uuo *UserUpdateOne) SetUpdatedBy(u *User) *UserUpdateOne

SetUpdatedBy sets the "updated_by" edge to the User entity.

func (*UserUpdateOne) SetUpdatedByID

func (uuo *UserUpdateOne) SetUpdatedByID(id string) *UserUpdateOne

SetUpdatedByID sets the "updated_by" edge to the User entity by ID.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetPassword

func (u *UserUpsert) SetPassword(v string) *UserUpsert

SetPassword sets the "password" field.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdatePassword

func (u *UserUpsert) UpdatePassword() *UserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetEmail

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetPassword

func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk

SetPassword sets the "password" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdatePassword

func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetEmail

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetPassword

func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne

SetPassword sets the "password" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdatePassword

func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

type UserWhereInput

type UserWhereInput struct {
	Predicates []predicate.User  `json:"-"`
	Not        *UserWhereInput   `json:"not,omitempty"`
	Or         []*UserWhereInput `json:"or,omitempty"`
	And        []*UserWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID             *string  `json:"id,omitempty"`
	IDNEQ          *string  `json:"idNEQ,omitempty"`
	IDIn           []string `json:"idIn,omitempty"`
	IDNotIn        []string `json:"idNotIn,omitempty"`
	IDGT           *string  `json:"idGT,omitempty"`
	IDGTE          *string  `json:"idGTE,omitempty"`
	IDLT           *string  `json:"idLT,omitempty"`
	IDLTE          *string  `json:"idLTE,omitempty"`
	IDEqualFold    *string  `json:"idEqualFold,omitempty"`
	IDContainsFold *string  `json:"idContainsFold,omitempty"`

	// "email" field predicates.
	Email             *string  `json:"email,omitempty"`
	EmailNEQ          *string  `json:"emailNEQ,omitempty"`
	EmailIn           []string `json:"emailIn,omitempty"`
	EmailNotIn        []string `json:"emailNotIn,omitempty"`
	EmailGT           *string  `json:"emailGT,omitempty"`
	EmailGTE          *string  `json:"emailGTE,omitempty"`
	EmailLT           *string  `json:"emailLT,omitempty"`
	EmailLTE          *string  `json:"emailLTE,omitempty"`
	EmailContains     *string  `json:"emailContains,omitempty"`
	EmailHasPrefix    *string  `json:"emailHasPrefix,omitempty"`
	EmailHasSuffix    *string  `json:"emailHasSuffix,omitempty"`
	EmailEqualFold    *string  `json:"emailEqualFold,omitempty"`
	EmailContainsFold *string  `json:"emailContainsFold,omitempty"`

	// "password" field predicates.
	Password             *string  `json:"password,omitempty"`
	PasswordNEQ          *string  `json:"passwordNEQ,omitempty"`
	PasswordIn           []string `json:"passwordIn,omitempty"`
	PasswordNotIn        []string `json:"passwordNotIn,omitempty"`
	PasswordGT           *string  `json:"passwordGT,omitempty"`
	PasswordGTE          *string  `json:"passwordGTE,omitempty"`
	PasswordLT           *string  `json:"passwordLT,omitempty"`
	PasswordLTE          *string  `json:"passwordLTE,omitempty"`
	PasswordContains     *string  `json:"passwordContains,omitempty"`
	PasswordHasPrefix    *string  `json:"passwordHasPrefix,omitempty"`
	PasswordHasSuffix    *string  `json:"passwordHasSuffix,omitempty"`
	PasswordEqualFold    *string  `json:"passwordEqualFold,omitempty"`
	PasswordContainsFold *string  `json:"passwordContainsFold,omitempty"`

	// "created_by" edge predicates.
	HasCreatedBy     *bool             `json:"hasCreatedBy,omitempty"`
	HasCreatedByWith []*UserWhereInput `json:"hasCreatedByWith,omitempty"`

	// "updated_by" edge predicates.
	HasUpdatedBy     *bool             `json:"hasUpdatedBy,omitempty"`
	HasUpdatedByWith []*UserWhereInput `json:"hasUpdatedByWith,omitempty"`

	// "admin_created_by" edge predicates.
	HasAdminCreatedBy     *bool                  `json:"hasAdminCreatedBy,omitempty"`
	HasAdminCreatedByWith []*AdminUserWhereInput `json:"hasAdminCreatedByWith,omitempty"`

	// "admin_updated_by" edge predicates.
	HasAdminUpdatedBy     *bool                  `json:"hasAdminUpdatedBy,omitempty"`
	HasAdminUpdatedByWith []*AdminUserWhereInput `json:"hasAdminUpdatedByWith,omitempty"`

	// "roles" edge predicates.
	HasRoles     *bool             `json:"hasRoles,omitempty"`
	HasRolesWith []*RoleWhereInput `json:"hasRolesWith,omitempty"`

	// "default_role" edge predicates.
	HasDefaultRole     *bool             `json:"hasDefaultRole,omitempty"`
	HasDefaultRoleWith []*RoleWhereInput `json:"hasDefaultRoleWith,omitempty"`
}

UserWhereInput represents a where input for filtering User queries.

func (*UserWhereInput) AddPredicates

func (i *UserWhereInput) AddPredicates(predicates ...predicate.User)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*UserWhereInput) Filter

func (i *UserWhereInput) Filter(q *UserQuery) (*UserQuery, error)

Filter applies the UserWhereInput filter on the UserQuery builder.

func (*UserWhereInput) P

func (i *UserWhereInput) P() (predicate.User, error)

P returns a predicate for filtering users. An error is returned if the input is empty or invalid.

type UserWhereUniqueInput

type UserWhereUniqueInput struct {
	Predicates []predicate.User `json:"-"`

	ID    *string `json:"id,omitempty"`
	Email *string `json:"email,omitempty"`
}

UserWhereUniqueInput represents a where input for filtering User queries.

func (*UserWhereUniqueInput) AddPredicates

func (i *UserWhereUniqueInput) AddPredicates(predicates ...predicate.User)

func (*UserWhereUniqueInput) Filter

func (i *UserWhereUniqueInput) Filter(q *UserQuery) (*UserQuery, error)

func (*UserWhereUniqueInput) P

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL