ent

package
v0.0.0-...-6fd8457 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: AGPL-3.0 Imports: 33 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.
	TypeAttachment           = "Attachment"
	TypeAuthRoles            = "AuthRoles"
	TypeAuthTokens           = "AuthTokens"
	TypeDocument             = "Document"
	TypeGroup                = "Group"
	TypeGroupInvitationToken = "GroupInvitationToken"
	TypeItem                 = "Item"
	TypeItemField            = "ItemField"
	TypeLabel                = "Label"
	TypeLocation             = "Location"
	TypeMaintenanceEntry     = "MaintenanceEntry"
	TypeNotifier             = "Notifier"
	TypeUser                 = "User"
)

Variables

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.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Attachment

type Attachment struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Type holds the value of the "type" field.
	Type attachment.Type `json:"type,omitempty"`
	// Primary holds the value of the "primary" field.
	Primary bool `json:"primary,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AttachmentQuery when eager-loading is set.
	Edges AttachmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Attachment is the model entity for the Attachment schema.

func (*Attachment) GetID

func (a *Attachment) GetID() uuid.UUID

func (*Attachment) QueryDocument

func (a *Attachment) QueryDocument() *DocumentQuery

QueryDocument queries the "document" edge of the Attachment entity.

func (*Attachment) QueryItem

func (a *Attachment) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the Attachment entity.

func (*Attachment) String

func (a *Attachment) String() string

String implements the fmt.Stringer.

func (*Attachment) Unwrap

func (a *Attachment) Unwrap() *Attachment

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

func (a *Attachment) Update() *AttachmentUpdateOne

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

func (*Attachment) Value

func (a *Attachment) Value(name string) (ent.Value, error)

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

type AttachmentClient

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

AttachmentClient is a client for the Attachment schema.

func NewAttachmentClient

func NewAttachmentClient(c config) *AttachmentClient

NewAttachmentClient returns a client for the Attachment from the given config.

func (*AttachmentClient) Create

func (c *AttachmentClient) Create() *AttachmentCreate

Create returns a builder for creating a Attachment entity.

func (*AttachmentClient) CreateBulk

func (c *AttachmentClient) CreateBulk(builders ...*AttachmentCreate) *AttachmentCreateBulk

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

func (*AttachmentClient) Delete

func (c *AttachmentClient) Delete() *AttachmentDelete

Delete returns a delete builder for Attachment.

func (*AttachmentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AttachmentClient) DeleteOneID

func (c *AttachmentClient) DeleteOneID(id uuid.UUID) *AttachmentDeleteOne

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

func (*AttachmentClient) Get

Get returns a Attachment entity by its id.

func (*AttachmentClient) GetX

func (c *AttachmentClient) GetX(ctx context.Context, id uuid.UUID) *Attachment

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

func (*AttachmentClient) Hooks

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

Hooks returns the client hooks.

func (*AttachmentClient) Intercept

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

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

func (*AttachmentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AttachmentClient) MapCreateBulk

func (c *AttachmentClient) MapCreateBulk(slice any, setFunc func(*AttachmentCreate, int)) *AttachmentCreateBulk

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

func (c *AttachmentClient) Query() *AttachmentQuery

Query returns a query builder for Attachment.

func (*AttachmentClient) QueryDocument

func (c *AttachmentClient) QueryDocument(a *Attachment) *DocumentQuery

QueryDocument queries the document edge of a Attachment.

func (*AttachmentClient) QueryItem

func (c *AttachmentClient) QueryItem(a *Attachment) *ItemQuery

QueryItem queries the item edge of a Attachment.

func (*AttachmentClient) Update

func (c *AttachmentClient) Update() *AttachmentUpdate

Update returns an update builder for Attachment.

func (*AttachmentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AttachmentClient) UpdateOneID

func (c *AttachmentClient) UpdateOneID(id uuid.UUID) *AttachmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AttachmentClient) Use

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

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

type AttachmentCreate

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

AttachmentCreate is the builder for creating a Attachment entity.

func (*AttachmentCreate) Exec

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

Exec executes the query.

func (*AttachmentCreate) ExecX

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

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

func (*AttachmentCreate) Mutation

func (ac *AttachmentCreate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentCreate) Save

func (ac *AttachmentCreate) Save(ctx context.Context) (*Attachment, error)

Save creates the Attachment in the database.

func (*AttachmentCreate) SaveX

func (ac *AttachmentCreate) SaveX(ctx context.Context) *Attachment

SaveX calls Save and panics if Save returns an error.

func (*AttachmentCreate) SetCreatedAt

func (ac *AttachmentCreate) SetCreatedAt(t time.Time) *AttachmentCreate

SetCreatedAt sets the "created_at" field.

func (*AttachmentCreate) SetDocument

func (ac *AttachmentCreate) SetDocument(d *Document) *AttachmentCreate

SetDocument sets the "document" edge to the Document entity.

func (*AttachmentCreate) SetDocumentID

func (ac *AttachmentCreate) SetDocumentID(id uuid.UUID) *AttachmentCreate

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*AttachmentCreate) SetID

SetID sets the "id" field.

func (*AttachmentCreate) SetItem

func (ac *AttachmentCreate) SetItem(i *Item) *AttachmentCreate

SetItem sets the "item" edge to the Item entity.

func (*AttachmentCreate) SetItemID

func (ac *AttachmentCreate) SetItemID(id uuid.UUID) *AttachmentCreate

SetItemID sets the "item" edge to the Item entity by ID.

func (*AttachmentCreate) SetNillableCreatedAt

func (ac *AttachmentCreate) SetNillableCreatedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableID

func (ac *AttachmentCreate) SetNillableID(u *uuid.UUID) *AttachmentCreate

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

func (*AttachmentCreate) SetNillablePrimary

func (ac *AttachmentCreate) SetNillablePrimary(b *bool) *AttachmentCreate

SetNillablePrimary sets the "primary" field if the given value is not nil.

func (*AttachmentCreate) SetNillableType

func (ac *AttachmentCreate) SetNillableType(a *attachment.Type) *AttachmentCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*AttachmentCreate) SetNillableUpdatedAt

func (ac *AttachmentCreate) SetNillableUpdatedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetPrimary

func (ac *AttachmentCreate) SetPrimary(b bool) *AttachmentCreate

SetPrimary sets the "primary" field.

func (*AttachmentCreate) SetType

SetType sets the "type" field.

func (*AttachmentCreate) SetUpdatedAt

func (ac *AttachmentCreate) SetUpdatedAt(t time.Time) *AttachmentCreate

SetUpdatedAt sets the "updated_at" field.

type AttachmentCreateBulk

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

AttachmentCreateBulk is the builder for creating many Attachment entities in bulk.

func (*AttachmentCreateBulk) Exec

func (acb *AttachmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreateBulk) ExecX

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

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

func (*AttachmentCreateBulk) Save

func (acb *AttachmentCreateBulk) Save(ctx context.Context) ([]*Attachment, error)

Save creates the Attachment entities in the database.

func (*AttachmentCreateBulk) SaveX

func (acb *AttachmentCreateBulk) SaveX(ctx context.Context) []*Attachment

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

type AttachmentDelete

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

AttachmentDelete is the builder for deleting a Attachment entity.

func (*AttachmentDelete) Exec

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

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

func (*AttachmentDelete) ExecX

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

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

func (*AttachmentDelete) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentDeleteOne

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

AttachmentDeleteOne is the builder for deleting a single Attachment entity.

func (*AttachmentDeleteOne) Exec

func (ado *AttachmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AttachmentDeleteOne) ExecX

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

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

func (*AttachmentDeleteOne) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentEdges

type AttachmentEdges struct {
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// Document holds the value of the document edge.
	Document *Document `json:"document,omitempty"`
	// contains filtered or unexported fields
}

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

func (AttachmentEdges) DocumentOrErr

func (e AttachmentEdges) DocumentOrErr() (*Document, error)

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

func (AttachmentEdges) ItemOrErr

func (e AttachmentEdges) ItemOrErr() (*Item, error)

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

type AttachmentGroupBy

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

AttachmentGroupBy is the group-by builder for Attachment entities.

func (*AttachmentGroupBy) Aggregate

func (agb *AttachmentGroupBy) Aggregate(fns ...AggregateFunc) *AttachmentGroupBy

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

func (*AttachmentGroupBy) Bool

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

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

func (*AttachmentGroupBy) BoolX

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

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

func (*AttachmentGroupBy) Bools

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

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

func (*AttachmentGroupBy) BoolsX

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

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

func (*AttachmentGroupBy) Float64

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

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

func (*AttachmentGroupBy) Float64X

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

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

func (*AttachmentGroupBy) Float64s

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

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

func (*AttachmentGroupBy) Float64sX

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

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

func (*AttachmentGroupBy) Int

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

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

func (*AttachmentGroupBy) IntX

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

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

func (*AttachmentGroupBy) Ints

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

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

func (*AttachmentGroupBy) IntsX

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

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

func (*AttachmentGroupBy) Scan

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

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

func (*AttachmentGroupBy) ScanX

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

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

func (*AttachmentGroupBy) String

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

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

func (*AttachmentGroupBy) StringX

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

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

func (*AttachmentGroupBy) Strings

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

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

func (*AttachmentGroupBy) StringsX

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

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

type AttachmentMutation

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

AttachmentMutation represents an operation that mutates the Attachment nodes in the graph.

func (*AttachmentMutation) AddField

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

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

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

func (*AttachmentMutation) AddedField

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

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

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

func (*AttachmentMutation) AddedIDs

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

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

func (*AttachmentMutation) ClearDocument

func (m *AttachmentMutation) ClearDocument()

ClearDocument clears the "document" edge to the Document entity.

func (*AttachmentMutation) ClearEdge

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

func (m *AttachmentMutation) 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 (*AttachmentMutation) ClearItem

func (m *AttachmentMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*AttachmentMutation) ClearedEdges

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

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

func (*AttachmentMutation) ClearedFields

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

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

func (AttachmentMutation) Client

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

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

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

func (*AttachmentMutation) DocumentCleared

func (m *AttachmentMutation) DocumentCleared() bool

DocumentCleared reports if the "document" edge to the Document entity was cleared.

func (*AttachmentMutation) DocumentID

func (m *AttachmentMutation) DocumentID() (id uuid.UUID, exists bool)

DocumentID returns the "document" edge ID in the mutation.

func (*AttachmentMutation) DocumentIDs

func (m *AttachmentMutation) DocumentIDs() (ids []uuid.UUID)

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

func (*AttachmentMutation) EdgeCleared

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

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

func (*AttachmentMutation) Field

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

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

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

func (*AttachmentMutation) Fields

func (m *AttachmentMutation) 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 (*AttachmentMutation) GetType

func (m *AttachmentMutation) GetType() (r attachment.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*AttachmentMutation) ID

func (m *AttachmentMutation) ID() (id uuid.UUID, 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 (*AttachmentMutation) IDs

func (m *AttachmentMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*AttachmentMutation) ItemCleared

func (m *AttachmentMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*AttachmentMutation) ItemID

func (m *AttachmentMutation) ItemID() (id uuid.UUID, exists bool)

ItemID returns the "item" edge ID in the mutation.

func (*AttachmentMutation) ItemIDs

func (m *AttachmentMutation) ItemIDs() (ids []uuid.UUID)

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

func (*AttachmentMutation) OldCreatedAt

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

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

func (*AttachmentMutation) OldField

func (m *AttachmentMutation) 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 (*AttachmentMutation) OldPrimary

func (m *AttachmentMutation) OldPrimary(ctx context.Context) (v bool, err error)

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

func (*AttachmentMutation) OldType

func (m *AttachmentMutation) OldType(ctx context.Context) (v attachment.Type, err error)

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

func (*AttachmentMutation) OldUpdatedAt

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

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

func (*AttachmentMutation) Op

func (m *AttachmentMutation) Op() Op

Op returns the operation name.

func (*AttachmentMutation) Primary

func (m *AttachmentMutation) Primary() (r bool, exists bool)

Primary returns the value of the "primary" field in the mutation.

func (*AttachmentMutation) RemovedEdges

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

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

func (*AttachmentMutation) RemovedIDs

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetCreatedAt

func (m *AttachmentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AttachmentMutation) ResetDocument

func (m *AttachmentMutation) ResetDocument()

ResetDocument resets all changes to the "document" edge.

func (*AttachmentMutation) ResetEdge

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

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetItem

func (m *AttachmentMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*AttachmentMutation) ResetPrimary

func (m *AttachmentMutation) ResetPrimary()

ResetPrimary resets all changes to the "primary" field.

func (*AttachmentMutation) ResetType

func (m *AttachmentMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*AttachmentMutation) ResetUpdatedAt

func (m *AttachmentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AttachmentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AttachmentMutation) SetDocumentID

func (m *AttachmentMutation) SetDocumentID(id uuid.UUID)

SetDocumentID sets the "document" edge to the Document entity by id.

func (*AttachmentMutation) SetField

func (m *AttachmentMutation) 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 (*AttachmentMutation) SetID

func (m *AttachmentMutation) SetID(id uuid.UUID)

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

func (*AttachmentMutation) SetItemID

func (m *AttachmentMutation) SetItemID(id uuid.UUID)

SetItemID sets the "item" edge to the Item entity by id.

func (*AttachmentMutation) SetOp

func (m *AttachmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AttachmentMutation) SetPrimary

func (m *AttachmentMutation) SetPrimary(b bool)

SetPrimary sets the "primary" field.

func (*AttachmentMutation) SetType

func (m *AttachmentMutation) SetType(a attachment.Type)

SetType sets the "type" field.

func (*AttachmentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (AttachmentMutation) Tx

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

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

func (*AttachmentMutation) Type

func (m *AttachmentMutation) Type() string

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

func (*AttachmentMutation) UpdatedAt

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

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

func (*AttachmentMutation) Where

func (m *AttachmentMutation) Where(ps ...predicate.Attachment)

Where appends a list predicates to the AttachmentMutation builder.

func (*AttachmentMutation) WhereP

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

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

type AttachmentQuery

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

AttachmentQuery is the builder for querying Attachment entities.

func (*AttachmentQuery) Aggregate

func (aq *AttachmentQuery) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate returns a AttachmentSelect configured with the given aggregations.

func (*AttachmentQuery) All

func (aq *AttachmentQuery) All(ctx context.Context) ([]*Attachment, error)

All executes the query and returns a list of Attachments.

func (*AttachmentQuery) AllX

func (aq *AttachmentQuery) AllX(ctx context.Context) []*Attachment

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

func (*AttachmentQuery) Clone

func (aq *AttachmentQuery) Clone() *AttachmentQuery

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

func (*AttachmentQuery) Count

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

Count returns the count of the given query.

func (*AttachmentQuery) CountX

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

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

func (*AttachmentQuery) Exist

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

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

func (*AttachmentQuery) ExistX

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

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

func (*AttachmentQuery) First

func (aq *AttachmentQuery) First(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) FirstID

func (aq *AttachmentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AttachmentQuery) FirstIDX

func (aq *AttachmentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AttachmentQuery) FirstX

func (aq *AttachmentQuery) FirstX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) GroupBy

func (aq *AttachmentQuery) GroupBy(field string, fields ...string) *AttachmentGroupBy

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.Attachment.Query().
	GroupBy(attachment.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AttachmentQuery) IDs

func (aq *AttachmentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AttachmentQuery) IDsX

func (aq *AttachmentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AttachmentQuery) Limit

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

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

func (*AttachmentQuery) Offset

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

Offset to start from.

func (*AttachmentQuery) Only

func (aq *AttachmentQuery) Only(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) OnlyID

func (aq *AttachmentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AttachmentQuery) OnlyIDX

func (aq *AttachmentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AttachmentQuery) OnlyX

func (aq *AttachmentQuery) OnlyX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) Order

Order specifies how the records should be ordered.

func (*AttachmentQuery) QueryDocument

func (aq *AttachmentQuery) QueryDocument() *DocumentQuery

QueryDocument chains the current query on the "document" edge.

func (*AttachmentQuery) QueryItem

func (aq *AttachmentQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*AttachmentQuery) Select

func (aq *AttachmentQuery) Select(fields ...string) *AttachmentSelect

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

func (*AttachmentQuery) Unique

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

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

Where adds a new predicate for the AttachmentQuery builder.

func (*AttachmentQuery) WithDocument

func (aq *AttachmentQuery) WithDocument(opts ...func(*DocumentQuery)) *AttachmentQuery

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

func (*AttachmentQuery) WithItem

func (aq *AttachmentQuery) WithItem(opts ...func(*ItemQuery)) *AttachmentQuery

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

type AttachmentSelect

type AttachmentSelect struct {
	*AttachmentQuery
	// contains filtered or unexported fields
}

AttachmentSelect is the builder for selecting fields of Attachment entities.

func (*AttachmentSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AttachmentSelect) Bool

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

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

func (*AttachmentSelect) BoolX

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

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

func (*AttachmentSelect) Bools

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

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

func (*AttachmentSelect) BoolsX

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

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

func (*AttachmentSelect) Float64

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

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

func (*AttachmentSelect) Float64X

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

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

func (*AttachmentSelect) Float64s

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

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

func (*AttachmentSelect) Float64sX

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

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

func (*AttachmentSelect) Int

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

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

func (*AttachmentSelect) IntX

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

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

func (*AttachmentSelect) Ints

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

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

func (*AttachmentSelect) IntsX

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

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

func (*AttachmentSelect) Scan

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

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

func (*AttachmentSelect) ScanX

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

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

func (*AttachmentSelect) String

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

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

func (*AttachmentSelect) StringX

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

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

func (*AttachmentSelect) Strings

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

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

func (*AttachmentSelect) StringsX

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

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

type AttachmentUpdate

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

AttachmentUpdate is the builder for updating Attachment entities.

func (*AttachmentUpdate) ClearDocument

func (au *AttachmentUpdate) ClearDocument() *AttachmentUpdate

ClearDocument clears the "document" edge to the Document entity.

func (*AttachmentUpdate) ClearItem

func (au *AttachmentUpdate) ClearItem() *AttachmentUpdate

ClearItem clears the "item" edge to the Item entity.

func (*AttachmentUpdate) Exec

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

Exec executes the query.

func (*AttachmentUpdate) ExecX

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

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

func (*AttachmentUpdate) Mutation

func (au *AttachmentUpdate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdate) Save

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

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

func (*AttachmentUpdate) SaveX

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

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

func (*AttachmentUpdate) SetDocument

func (au *AttachmentUpdate) SetDocument(d *Document) *AttachmentUpdate

SetDocument sets the "document" edge to the Document entity.

func (*AttachmentUpdate) SetDocumentID

func (au *AttachmentUpdate) SetDocumentID(id uuid.UUID) *AttachmentUpdate

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*AttachmentUpdate) SetItem

func (au *AttachmentUpdate) SetItem(i *Item) *AttachmentUpdate

SetItem sets the "item" edge to the Item entity.

func (*AttachmentUpdate) SetItemID

func (au *AttachmentUpdate) SetItemID(id uuid.UUID) *AttachmentUpdate

SetItemID sets the "item" edge to the Item entity by ID.

func (*AttachmentUpdate) SetNillablePrimary

func (au *AttachmentUpdate) SetNillablePrimary(b *bool) *AttachmentUpdate

SetNillablePrimary sets the "primary" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableType

func (au *AttachmentUpdate) SetNillableType(a *attachment.Type) *AttachmentUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*AttachmentUpdate) SetPrimary

func (au *AttachmentUpdate) SetPrimary(b bool) *AttachmentUpdate

SetPrimary sets the "primary" field.

func (*AttachmentUpdate) SetType

SetType sets the "type" field.

func (*AttachmentUpdate) SetUpdatedAt

func (au *AttachmentUpdate) SetUpdatedAt(t time.Time) *AttachmentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpdate) Where

Where appends a list predicates to the AttachmentUpdate builder.

type AttachmentUpdateOne

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

AttachmentUpdateOne is the builder for updating a single Attachment entity.

func (*AttachmentUpdateOne) ClearDocument

func (auo *AttachmentUpdateOne) ClearDocument() *AttachmentUpdateOne

ClearDocument clears the "document" edge to the Document entity.

func (*AttachmentUpdateOne) ClearItem

func (auo *AttachmentUpdateOne) ClearItem() *AttachmentUpdateOne

ClearItem clears the "item" edge to the Item entity.

func (*AttachmentUpdateOne) Exec

func (auo *AttachmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AttachmentUpdateOne) ExecX

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

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

func (*AttachmentUpdateOne) Mutation

func (auo *AttachmentUpdateOne) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdateOne) Save

func (auo *AttachmentUpdateOne) Save(ctx context.Context) (*Attachment, error)

Save executes the query and returns the updated Attachment entity.

func (*AttachmentUpdateOne) SaveX

func (auo *AttachmentUpdateOne) SaveX(ctx context.Context) *Attachment

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

func (*AttachmentUpdateOne) Select

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

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

func (*AttachmentUpdateOne) SetDocument

func (auo *AttachmentUpdateOne) SetDocument(d *Document) *AttachmentUpdateOne

SetDocument sets the "document" edge to the Document entity.

func (*AttachmentUpdateOne) SetDocumentID

func (auo *AttachmentUpdateOne) SetDocumentID(id uuid.UUID) *AttachmentUpdateOne

SetDocumentID sets the "document" edge to the Document entity by ID.

func (*AttachmentUpdateOne) SetItem

func (auo *AttachmentUpdateOne) SetItem(i *Item) *AttachmentUpdateOne

SetItem sets the "item" edge to the Item entity.

func (*AttachmentUpdateOne) SetItemID

func (auo *AttachmentUpdateOne) SetItemID(id uuid.UUID) *AttachmentUpdateOne

SetItemID sets the "item" edge to the Item entity by ID.

func (*AttachmentUpdateOne) SetNillablePrimary

func (auo *AttachmentUpdateOne) SetNillablePrimary(b *bool) *AttachmentUpdateOne

SetNillablePrimary sets the "primary" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableType

func (auo *AttachmentUpdateOne) SetNillableType(a *attachment.Type) *AttachmentUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*AttachmentUpdateOne) SetPrimary

func (auo *AttachmentUpdateOne) SetPrimary(b bool) *AttachmentUpdateOne

SetPrimary sets the "primary" field.

func (*AttachmentUpdateOne) SetType

SetType sets the "type" field.

func (*AttachmentUpdateOne) SetUpdatedAt

func (auo *AttachmentUpdateOne) SetUpdatedAt(t time.Time) *AttachmentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpdateOne) Where

Where appends a list predicates to the AttachmentUpdate builder.

type Attachments

type Attachments []*Attachment

Attachments is a parsable slice of Attachment.

type AuthRoles

type AuthRoles struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Role holds the value of the "role" field.
	Role authroles.Role `json:"role,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthRolesQuery when eager-loading is set.
	Edges AuthRolesEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuthRoles is the model entity for the AuthRoles schema.

func (*AuthRoles) GetID

func (ar *AuthRoles) GetID() int

func (*AuthRoles) QueryToken

func (ar *AuthRoles) QueryToken() *AuthTokensQuery

QueryToken queries the "token" edge of the AuthRoles entity.

func (*AuthRoles) String

func (ar *AuthRoles) String() string

String implements the fmt.Stringer.

func (*AuthRoles) Unwrap

func (ar *AuthRoles) Unwrap() *AuthRoles

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

func (ar *AuthRoles) Update() *AuthRolesUpdateOne

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

func (*AuthRoles) Value

func (ar *AuthRoles) Value(name string) (ent.Value, error)

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

type AuthRolesClient

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

AuthRolesClient is a client for the AuthRoles schema.

func NewAuthRolesClient

func NewAuthRolesClient(c config) *AuthRolesClient

NewAuthRolesClient returns a client for the AuthRoles from the given config.

func (*AuthRolesClient) Create

func (c *AuthRolesClient) Create() *AuthRolesCreate

Create returns a builder for creating a AuthRoles entity.

func (*AuthRolesClient) CreateBulk

func (c *AuthRolesClient) CreateBulk(builders ...*AuthRolesCreate) *AuthRolesCreateBulk

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

func (*AuthRolesClient) Delete

func (c *AuthRolesClient) Delete() *AuthRolesDelete

Delete returns a delete builder for AuthRoles.

func (*AuthRolesClient) DeleteOne

func (c *AuthRolesClient) DeleteOne(ar *AuthRoles) *AuthRolesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthRolesClient) DeleteOneID

func (c *AuthRolesClient) DeleteOneID(id int) *AuthRolesDeleteOne

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

func (*AuthRolesClient) Get

func (c *AuthRolesClient) Get(ctx context.Context, id int) (*AuthRoles, error)

Get returns a AuthRoles entity by its id.

func (*AuthRolesClient) GetX

func (c *AuthRolesClient) GetX(ctx context.Context, id int) *AuthRoles

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

func (*AuthRolesClient) Hooks

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

Hooks returns the client hooks.

func (*AuthRolesClient) Intercept

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

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

func (*AuthRolesClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthRolesClient) MapCreateBulk

func (c *AuthRolesClient) MapCreateBulk(slice any, setFunc func(*AuthRolesCreate, int)) *AuthRolesCreateBulk

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

func (c *AuthRolesClient) Query() *AuthRolesQuery

Query returns a query builder for AuthRoles.

func (*AuthRolesClient) QueryToken

func (c *AuthRolesClient) QueryToken(ar *AuthRoles) *AuthTokensQuery

QueryToken queries the token edge of a AuthRoles.

func (*AuthRolesClient) Update

func (c *AuthRolesClient) Update() *AuthRolesUpdate

Update returns an update builder for AuthRoles.

func (*AuthRolesClient) UpdateOne

func (c *AuthRolesClient) UpdateOne(ar *AuthRoles) *AuthRolesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthRolesClient) UpdateOneID

func (c *AuthRolesClient) UpdateOneID(id int) *AuthRolesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuthRolesClient) Use

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

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

type AuthRolesCreate

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

AuthRolesCreate is the builder for creating a AuthRoles entity.

func (*AuthRolesCreate) Exec

func (arc *AuthRolesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthRolesCreate) ExecX

func (arc *AuthRolesCreate) ExecX(ctx context.Context)

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

func (*AuthRolesCreate) Mutation

func (arc *AuthRolesCreate) Mutation() *AuthRolesMutation

Mutation returns the AuthRolesMutation object of the builder.

func (*AuthRolesCreate) Save

func (arc *AuthRolesCreate) Save(ctx context.Context) (*AuthRoles, error)

Save creates the AuthRoles in the database.

func (*AuthRolesCreate) SaveX

func (arc *AuthRolesCreate) SaveX(ctx context.Context) *AuthRoles

SaveX calls Save and panics if Save returns an error.

func (*AuthRolesCreate) SetNillableRole

func (arc *AuthRolesCreate) SetNillableRole(a *authroles.Role) *AuthRolesCreate

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

func (*AuthRolesCreate) SetNillableTokenID

func (arc *AuthRolesCreate) SetNillableTokenID(id *uuid.UUID) *AuthRolesCreate

SetNillableTokenID sets the "token" edge to the AuthTokens entity by ID if the given value is not nil.

func (*AuthRolesCreate) SetRole

func (arc *AuthRolesCreate) SetRole(a authroles.Role) *AuthRolesCreate

SetRole sets the "role" field.

func (*AuthRolesCreate) SetToken

func (arc *AuthRolesCreate) SetToken(a *AuthTokens) *AuthRolesCreate

SetToken sets the "token" edge to the AuthTokens entity.

func (*AuthRolesCreate) SetTokenID

func (arc *AuthRolesCreate) SetTokenID(id uuid.UUID) *AuthRolesCreate

SetTokenID sets the "token" edge to the AuthTokens entity by ID.

type AuthRolesCreateBulk

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

AuthRolesCreateBulk is the builder for creating many AuthRoles entities in bulk.

func (*AuthRolesCreateBulk) Exec

func (arcb *AuthRolesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthRolesCreateBulk) ExecX

func (arcb *AuthRolesCreateBulk) ExecX(ctx context.Context)

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

func (*AuthRolesCreateBulk) Save

func (arcb *AuthRolesCreateBulk) Save(ctx context.Context) ([]*AuthRoles, error)

Save creates the AuthRoles entities in the database.

func (*AuthRolesCreateBulk) SaveX

func (arcb *AuthRolesCreateBulk) SaveX(ctx context.Context) []*AuthRoles

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

type AuthRolesDelete

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

AuthRolesDelete is the builder for deleting a AuthRoles entity.

func (*AuthRolesDelete) Exec

func (ard *AuthRolesDelete) Exec(ctx context.Context) (int, error)

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

func (*AuthRolesDelete) ExecX

func (ard *AuthRolesDelete) ExecX(ctx context.Context) int

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

func (*AuthRolesDelete) Where

Where appends a list predicates to the AuthRolesDelete builder.

type AuthRolesDeleteOne

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

AuthRolesDeleteOne is the builder for deleting a single AuthRoles entity.

func (*AuthRolesDeleteOne) Exec

func (ardo *AuthRolesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AuthRolesDeleteOne) ExecX

func (ardo *AuthRolesDeleteOne) ExecX(ctx context.Context)

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

func (*AuthRolesDeleteOne) Where

Where appends a list predicates to the AuthRolesDelete builder.

type AuthRolesEdges

type AuthRolesEdges struct {
	// Token holds the value of the token edge.
	Token *AuthTokens `json:"token,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthRolesEdges) TokenOrErr

func (e AuthRolesEdges) TokenOrErr() (*AuthTokens, error)

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

type AuthRolesGroupBy

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

AuthRolesGroupBy is the group-by builder for AuthRoles entities.

func (*AuthRolesGroupBy) Aggregate

func (argb *AuthRolesGroupBy) Aggregate(fns ...AggregateFunc) *AuthRolesGroupBy

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

func (*AuthRolesGroupBy) Bool

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

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

func (*AuthRolesGroupBy) BoolX

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

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

func (*AuthRolesGroupBy) Bools

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

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

func (*AuthRolesGroupBy) BoolsX

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

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

func (*AuthRolesGroupBy) Float64

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

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

func (*AuthRolesGroupBy) Float64X

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

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

func (*AuthRolesGroupBy) Float64s

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

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

func (*AuthRolesGroupBy) Float64sX

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

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

func (*AuthRolesGroupBy) Int

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

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

func (*AuthRolesGroupBy) IntX

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

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

func (*AuthRolesGroupBy) Ints

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

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

func (*AuthRolesGroupBy) IntsX

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

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

func (*AuthRolesGroupBy) Scan

func (argb *AuthRolesGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthRolesGroupBy) ScanX

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

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

func (*AuthRolesGroupBy) String

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

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

func (*AuthRolesGroupBy) StringX

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

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

func (*AuthRolesGroupBy) Strings

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

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

func (*AuthRolesGroupBy) StringsX

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

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

type AuthRolesMutation

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

AuthRolesMutation represents an operation that mutates the AuthRoles nodes in the graph.

func (*AuthRolesMutation) AddField

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

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

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

func (*AuthRolesMutation) AddedField

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

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

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

func (*AuthRolesMutation) AddedIDs

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

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

func (*AuthRolesMutation) ClearEdge

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

func (m *AuthRolesMutation) 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 (*AuthRolesMutation) ClearToken

func (m *AuthRolesMutation) ClearToken()

ClearToken clears the "token" edge to the AuthTokens entity.

func (*AuthRolesMutation) ClearedEdges

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

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

func (*AuthRolesMutation) ClearedFields

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

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

func (AuthRolesMutation) Client

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

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

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

func (*AuthRolesMutation) Field

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

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

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

func (*AuthRolesMutation) Fields

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

func (m *AuthRolesMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*AuthRolesMutation) IDs

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

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

func (*AuthRolesMutation) OldField

func (m *AuthRolesMutation) 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 (*AuthRolesMutation) OldRole

func (m *AuthRolesMutation) OldRole(ctx context.Context) (v authroles.Role, err error)

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

func (*AuthRolesMutation) Op

func (m *AuthRolesMutation) Op() Op

Op returns the operation name.

func (*AuthRolesMutation) RemovedEdges

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

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

func (*AuthRolesMutation) RemovedIDs

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

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

func (m *AuthRolesMutation) 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 (*AuthRolesMutation) ResetRole

func (m *AuthRolesMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*AuthRolesMutation) ResetToken

func (m *AuthRolesMutation) ResetToken()

ResetToken resets all changes to the "token" edge.

func (*AuthRolesMutation) Role

func (m *AuthRolesMutation) Role() (r authroles.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*AuthRolesMutation) SetField

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

func (m *AuthRolesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthRolesMutation) SetRole

func (m *AuthRolesMutation) SetRole(a authroles.Role)

SetRole sets the "role" field.

func (*AuthRolesMutation) SetTokenID

func (m *AuthRolesMutation) SetTokenID(id uuid.UUID)

SetTokenID sets the "token" edge to the AuthTokens entity by id.

func (*AuthRolesMutation) TokenCleared

func (m *AuthRolesMutation) TokenCleared() bool

TokenCleared reports if the "token" edge to the AuthTokens entity was cleared.

func (*AuthRolesMutation) TokenID

func (m *AuthRolesMutation) TokenID() (id uuid.UUID, exists bool)

TokenID returns the "token" edge ID in the mutation.

func (*AuthRolesMutation) TokenIDs

func (m *AuthRolesMutation) TokenIDs() (ids []uuid.UUID)

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

func (AuthRolesMutation) Tx

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

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

func (*AuthRolesMutation) Type

func (m *AuthRolesMutation) Type() string

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

func (*AuthRolesMutation) Where

func (m *AuthRolesMutation) Where(ps ...predicate.AuthRoles)

Where appends a list predicates to the AuthRolesMutation builder.

func (*AuthRolesMutation) WhereP

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

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

type AuthRolesQuery

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

AuthRolesQuery is the builder for querying AuthRoles entities.

func (*AuthRolesQuery) Aggregate

func (arq *AuthRolesQuery) Aggregate(fns ...AggregateFunc) *AuthRolesSelect

Aggregate returns a AuthRolesSelect configured with the given aggregations.

func (*AuthRolesQuery) All

func (arq *AuthRolesQuery) All(ctx context.Context) ([]*AuthRoles, error)

All executes the query and returns a list of AuthRolesSlice.

func (*AuthRolesQuery) AllX

func (arq *AuthRolesQuery) AllX(ctx context.Context) []*AuthRoles

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

func (*AuthRolesQuery) Clone

func (arq *AuthRolesQuery) Clone() *AuthRolesQuery

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

func (*AuthRolesQuery) Count

func (arq *AuthRolesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuthRolesQuery) CountX

func (arq *AuthRolesQuery) CountX(ctx context.Context) int

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

func (*AuthRolesQuery) Exist

func (arq *AuthRolesQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuthRolesQuery) ExistX

func (arq *AuthRolesQuery) ExistX(ctx context.Context) bool

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

func (*AuthRolesQuery) First

func (arq *AuthRolesQuery) First(ctx context.Context) (*AuthRoles, error)

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

func (*AuthRolesQuery) FirstID

func (arq *AuthRolesQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AuthRolesQuery) FirstIDX

func (arq *AuthRolesQuery) FirstIDX(ctx context.Context) int

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

func (*AuthRolesQuery) FirstX

func (arq *AuthRolesQuery) FirstX(ctx context.Context) *AuthRoles

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

func (*AuthRolesQuery) GroupBy

func (arq *AuthRolesQuery) GroupBy(field string, fields ...string) *AuthRolesGroupBy

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

Example:

var v []struct {
	Role authroles.Role `json:"role,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AuthRoles.Query().
	GroupBy(authroles.FieldRole).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuthRolesQuery) IDs

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

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

func (*AuthRolesQuery) IDsX

func (arq *AuthRolesQuery) IDsX(ctx context.Context) []int

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

func (*AuthRolesQuery) Limit

func (arq *AuthRolesQuery) Limit(limit int) *AuthRolesQuery

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

func (*AuthRolesQuery) Offset

func (arq *AuthRolesQuery) Offset(offset int) *AuthRolesQuery

Offset to start from.

func (*AuthRolesQuery) Only

func (arq *AuthRolesQuery) Only(ctx context.Context) (*AuthRoles, error)

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

func (*AuthRolesQuery) OnlyID

func (arq *AuthRolesQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AuthRolesQuery) OnlyIDX

func (arq *AuthRolesQuery) OnlyIDX(ctx context.Context) int

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

func (*AuthRolesQuery) OnlyX

func (arq *AuthRolesQuery) OnlyX(ctx context.Context) *AuthRoles

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

func (*AuthRolesQuery) Order

Order specifies how the records should be ordered.

func (*AuthRolesQuery) QueryToken

func (arq *AuthRolesQuery) QueryToken() *AuthTokensQuery

QueryToken chains the current query on the "token" edge.

func (*AuthRolesQuery) Select

func (arq *AuthRolesQuery) Select(fields ...string) *AuthRolesSelect

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

Example:

var v []struct {
	Role authroles.Role `json:"role,omitempty"`
}

client.AuthRoles.Query().
	Select(authroles.FieldRole).
	Scan(ctx, &v)

func (*AuthRolesQuery) Unique

func (arq *AuthRolesQuery) Unique(unique bool) *AuthRolesQuery

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

func (arq *AuthRolesQuery) Where(ps ...predicate.AuthRoles) *AuthRolesQuery

Where adds a new predicate for the AuthRolesQuery builder.

func (*AuthRolesQuery) WithToken

func (arq *AuthRolesQuery) WithToken(opts ...func(*AuthTokensQuery)) *AuthRolesQuery

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

type AuthRolesSelect

type AuthRolesSelect struct {
	*AuthRolesQuery
	// contains filtered or unexported fields
}

AuthRolesSelect is the builder for selecting fields of AuthRoles entities.

func (*AuthRolesSelect) Aggregate

func (ars *AuthRolesSelect) Aggregate(fns ...AggregateFunc) *AuthRolesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuthRolesSelect) Bool

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

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

func (*AuthRolesSelect) BoolX

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

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

func (*AuthRolesSelect) Bools

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

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

func (*AuthRolesSelect) BoolsX

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

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

func (*AuthRolesSelect) Float64

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

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

func (*AuthRolesSelect) Float64X

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

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

func (*AuthRolesSelect) Float64s

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

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

func (*AuthRolesSelect) Float64sX

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

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

func (*AuthRolesSelect) Int

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

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

func (*AuthRolesSelect) IntX

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

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

func (*AuthRolesSelect) Ints

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

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

func (*AuthRolesSelect) IntsX

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

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

func (*AuthRolesSelect) Scan

func (ars *AuthRolesSelect) Scan(ctx context.Context, v any) error

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

func (*AuthRolesSelect) ScanX

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

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

func (*AuthRolesSelect) String

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

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

func (*AuthRolesSelect) StringX

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

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

func (*AuthRolesSelect) Strings

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

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

func (*AuthRolesSelect) StringsX

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

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

type AuthRolesSlice

type AuthRolesSlice []*AuthRoles

AuthRolesSlice is a parsable slice of AuthRoles.

type AuthRolesUpdate

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

AuthRolesUpdate is the builder for updating AuthRoles entities.

func (*AuthRolesUpdate) ClearToken

func (aru *AuthRolesUpdate) ClearToken() *AuthRolesUpdate

ClearToken clears the "token" edge to the AuthTokens entity.

func (*AuthRolesUpdate) Exec

func (aru *AuthRolesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthRolesUpdate) ExecX

func (aru *AuthRolesUpdate) ExecX(ctx context.Context)

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

func (*AuthRolesUpdate) Mutation

func (aru *AuthRolesUpdate) Mutation() *AuthRolesMutation

Mutation returns the AuthRolesMutation object of the builder.

func (*AuthRolesUpdate) Save

func (aru *AuthRolesUpdate) Save(ctx context.Context) (int, error)

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

func (*AuthRolesUpdate) SaveX

func (aru *AuthRolesUpdate) SaveX(ctx context.Context) int

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

func (*AuthRolesUpdate) SetNillableRole

func (aru *AuthRolesUpdate) SetNillableRole(a *authroles.Role) *AuthRolesUpdate

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

func (*AuthRolesUpdate) SetNillableTokenID

func (aru *AuthRolesUpdate) SetNillableTokenID(id *uuid.UUID) *AuthRolesUpdate

SetNillableTokenID sets the "token" edge to the AuthTokens entity by ID if the given value is not nil.

func (*AuthRolesUpdate) SetRole

func (aru *AuthRolesUpdate) SetRole(a authroles.Role) *AuthRolesUpdate

SetRole sets the "role" field.

func (*AuthRolesUpdate) SetToken

func (aru *AuthRolesUpdate) SetToken(a *AuthTokens) *AuthRolesUpdate

SetToken sets the "token" edge to the AuthTokens entity.

func (*AuthRolesUpdate) SetTokenID

func (aru *AuthRolesUpdate) SetTokenID(id uuid.UUID) *AuthRolesUpdate

SetTokenID sets the "token" edge to the AuthTokens entity by ID.

func (*AuthRolesUpdate) Where

Where appends a list predicates to the AuthRolesUpdate builder.

type AuthRolesUpdateOne

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

AuthRolesUpdateOne is the builder for updating a single AuthRoles entity.

func (*AuthRolesUpdateOne) ClearToken

func (aruo *AuthRolesUpdateOne) ClearToken() *AuthRolesUpdateOne

ClearToken clears the "token" edge to the AuthTokens entity.

func (*AuthRolesUpdateOne) Exec

func (aruo *AuthRolesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AuthRolesUpdateOne) ExecX

func (aruo *AuthRolesUpdateOne) ExecX(ctx context.Context)

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

func (*AuthRolesUpdateOne) Mutation

func (aruo *AuthRolesUpdateOne) Mutation() *AuthRolesMutation

Mutation returns the AuthRolesMutation object of the builder.

func (*AuthRolesUpdateOne) Save

func (aruo *AuthRolesUpdateOne) Save(ctx context.Context) (*AuthRoles, error)

Save executes the query and returns the updated AuthRoles entity.

func (*AuthRolesUpdateOne) SaveX

func (aruo *AuthRolesUpdateOne) SaveX(ctx context.Context) *AuthRoles

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

func (*AuthRolesUpdateOne) Select

func (aruo *AuthRolesUpdateOne) Select(field string, fields ...string) *AuthRolesUpdateOne

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

func (*AuthRolesUpdateOne) SetNillableRole

func (aruo *AuthRolesUpdateOne) SetNillableRole(a *authroles.Role) *AuthRolesUpdateOne

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

func (*AuthRolesUpdateOne) SetNillableTokenID

func (aruo *AuthRolesUpdateOne) SetNillableTokenID(id *uuid.UUID) *AuthRolesUpdateOne

SetNillableTokenID sets the "token" edge to the AuthTokens entity by ID if the given value is not nil.

func (*AuthRolesUpdateOne) SetRole

SetRole sets the "role" field.

func (*AuthRolesUpdateOne) SetToken

func (aruo *AuthRolesUpdateOne) SetToken(a *AuthTokens) *AuthRolesUpdateOne

SetToken sets the "token" edge to the AuthTokens entity.

func (*AuthRolesUpdateOne) SetTokenID

func (aruo *AuthRolesUpdateOne) SetTokenID(id uuid.UUID) *AuthRolesUpdateOne

SetTokenID sets the "token" edge to the AuthTokens entity by ID.

func (*AuthRolesUpdateOne) Where

Where appends a list predicates to the AuthRolesUpdate builder.

type AuthTokens

type AuthTokens struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Token holds the value of the "token" field.
	Token []byte `json:"token,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthTokensQuery when eager-loading is set.
	Edges AuthTokensEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuthTokens is the model entity for the AuthTokens schema.

func (*AuthTokens) GetID

func (at *AuthTokens) GetID() uuid.UUID

func (*AuthTokens) QueryRoles

func (at *AuthTokens) QueryRoles() *AuthRolesQuery

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

func (*AuthTokens) QueryUser

func (at *AuthTokens) QueryUser() *UserQuery

QueryUser queries the "user" edge of the AuthTokens entity.

func (*AuthTokens) String

func (at *AuthTokens) String() string

String implements the fmt.Stringer.

func (*AuthTokens) Unwrap

func (at *AuthTokens) Unwrap() *AuthTokens

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

func (at *AuthTokens) Update() *AuthTokensUpdateOne

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

func (*AuthTokens) Value

func (at *AuthTokens) Value(name string) (ent.Value, error)

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

type AuthTokensClient

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

AuthTokensClient is a client for the AuthTokens schema.

func NewAuthTokensClient

func NewAuthTokensClient(c config) *AuthTokensClient

NewAuthTokensClient returns a client for the AuthTokens from the given config.

func (*AuthTokensClient) Create

func (c *AuthTokensClient) Create() *AuthTokensCreate

Create returns a builder for creating a AuthTokens entity.

func (*AuthTokensClient) CreateBulk

func (c *AuthTokensClient) CreateBulk(builders ...*AuthTokensCreate) *AuthTokensCreateBulk

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

func (*AuthTokensClient) Delete

func (c *AuthTokensClient) Delete() *AuthTokensDelete

Delete returns a delete builder for AuthTokens.

func (*AuthTokensClient) DeleteOne

func (c *AuthTokensClient) DeleteOne(at *AuthTokens) *AuthTokensDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthTokensClient) DeleteOneID

func (c *AuthTokensClient) DeleteOneID(id uuid.UUID) *AuthTokensDeleteOne

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

func (*AuthTokensClient) Get

Get returns a AuthTokens entity by its id.

func (*AuthTokensClient) GetX

func (c *AuthTokensClient) GetX(ctx context.Context, id uuid.UUID) *AuthTokens

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

func (*AuthTokensClient) Hooks

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

Hooks returns the client hooks.

func (*AuthTokensClient) Intercept

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

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

func (*AuthTokensClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AuthTokensClient) MapCreateBulk

func (c *AuthTokensClient) MapCreateBulk(slice any, setFunc func(*AuthTokensCreate, int)) *AuthTokensCreateBulk

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

func (c *AuthTokensClient) Query() *AuthTokensQuery

Query returns a query builder for AuthTokens.

func (*AuthTokensClient) QueryRoles

func (c *AuthTokensClient) QueryRoles(at *AuthTokens) *AuthRolesQuery

QueryRoles queries the roles edge of a AuthTokens.

func (*AuthTokensClient) QueryUser

func (c *AuthTokensClient) QueryUser(at *AuthTokens) *UserQuery

QueryUser queries the user edge of a AuthTokens.

func (*AuthTokensClient) Update

func (c *AuthTokensClient) Update() *AuthTokensUpdate

Update returns an update builder for AuthTokens.

func (*AuthTokensClient) UpdateOne

func (c *AuthTokensClient) UpdateOne(at *AuthTokens) *AuthTokensUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthTokensClient) UpdateOneID

func (c *AuthTokensClient) UpdateOneID(id uuid.UUID) *AuthTokensUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuthTokensClient) Use

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

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

type AuthTokensCreate

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

AuthTokensCreate is the builder for creating a AuthTokens entity.

func (*AuthTokensCreate) Exec

func (atc *AuthTokensCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthTokensCreate) ExecX

func (atc *AuthTokensCreate) ExecX(ctx context.Context)

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

func (*AuthTokensCreate) Mutation

func (atc *AuthTokensCreate) Mutation() *AuthTokensMutation

Mutation returns the AuthTokensMutation object of the builder.

func (*AuthTokensCreate) Save

func (atc *AuthTokensCreate) Save(ctx context.Context) (*AuthTokens, error)

Save creates the AuthTokens in the database.

func (*AuthTokensCreate) SaveX

func (atc *AuthTokensCreate) SaveX(ctx context.Context) *AuthTokens

SaveX calls Save and panics if Save returns an error.

func (*AuthTokensCreate) SetCreatedAt

func (atc *AuthTokensCreate) SetCreatedAt(t time.Time) *AuthTokensCreate

SetCreatedAt sets the "created_at" field.

func (*AuthTokensCreate) SetExpiresAt

func (atc *AuthTokensCreate) SetExpiresAt(t time.Time) *AuthTokensCreate

SetExpiresAt sets the "expires_at" field.

func (*AuthTokensCreate) SetID

func (atc *AuthTokensCreate) SetID(u uuid.UUID) *AuthTokensCreate

SetID sets the "id" field.

func (*AuthTokensCreate) SetNillableCreatedAt

func (atc *AuthTokensCreate) SetNillableCreatedAt(t *time.Time) *AuthTokensCreate

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

func (*AuthTokensCreate) SetNillableExpiresAt

func (atc *AuthTokensCreate) SetNillableExpiresAt(t *time.Time) *AuthTokensCreate

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

func (*AuthTokensCreate) SetNillableID

func (atc *AuthTokensCreate) SetNillableID(u *uuid.UUID) *AuthTokensCreate

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

func (*AuthTokensCreate) SetNillableRolesID

func (atc *AuthTokensCreate) SetNillableRolesID(id *int) *AuthTokensCreate

SetNillableRolesID sets the "roles" edge to the AuthRoles entity by ID if the given value is not nil.

func (*AuthTokensCreate) SetNillableUpdatedAt

func (atc *AuthTokensCreate) SetNillableUpdatedAt(t *time.Time) *AuthTokensCreate

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

func (*AuthTokensCreate) SetNillableUserID

func (atc *AuthTokensCreate) SetNillableUserID(id *uuid.UUID) *AuthTokensCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*AuthTokensCreate) SetRoles

func (atc *AuthTokensCreate) SetRoles(a *AuthRoles) *AuthTokensCreate

SetRoles sets the "roles" edge to the AuthRoles entity.

func (*AuthTokensCreate) SetRolesID

func (atc *AuthTokensCreate) SetRolesID(id int) *AuthTokensCreate

SetRolesID sets the "roles" edge to the AuthRoles entity by ID.

func (*AuthTokensCreate) SetToken

func (atc *AuthTokensCreate) SetToken(b []byte) *AuthTokensCreate

SetToken sets the "token" field.

func (*AuthTokensCreate) SetUpdatedAt

func (atc *AuthTokensCreate) SetUpdatedAt(t time.Time) *AuthTokensCreate

SetUpdatedAt sets the "updated_at" field.

func (*AuthTokensCreate) SetUser

func (atc *AuthTokensCreate) SetUser(u *User) *AuthTokensCreate

SetUser sets the "user" edge to the User entity.

func (*AuthTokensCreate) SetUserID

func (atc *AuthTokensCreate) SetUserID(id uuid.UUID) *AuthTokensCreate

SetUserID sets the "user" edge to the User entity by ID.

type AuthTokensCreateBulk

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

AuthTokensCreateBulk is the builder for creating many AuthTokens entities in bulk.

func (*AuthTokensCreateBulk) Exec

func (atcb *AuthTokensCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthTokensCreateBulk) ExecX

func (atcb *AuthTokensCreateBulk) ExecX(ctx context.Context)

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

func (*AuthTokensCreateBulk) Save

func (atcb *AuthTokensCreateBulk) Save(ctx context.Context) ([]*AuthTokens, error)

Save creates the AuthTokens entities in the database.

func (*AuthTokensCreateBulk) SaveX

func (atcb *AuthTokensCreateBulk) SaveX(ctx context.Context) []*AuthTokens

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

type AuthTokensDelete

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

AuthTokensDelete is the builder for deleting a AuthTokens entity.

func (*AuthTokensDelete) Exec

func (atd *AuthTokensDelete) Exec(ctx context.Context) (int, error)

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

func (*AuthTokensDelete) ExecX

func (atd *AuthTokensDelete) ExecX(ctx context.Context) int

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

func (*AuthTokensDelete) Where

Where appends a list predicates to the AuthTokensDelete builder.

type AuthTokensDeleteOne

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

AuthTokensDeleteOne is the builder for deleting a single AuthTokens entity.

func (*AuthTokensDeleteOne) Exec

func (atdo *AuthTokensDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AuthTokensDeleteOne) ExecX

func (atdo *AuthTokensDeleteOne) ExecX(ctx context.Context)

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

func (*AuthTokensDeleteOne) Where

Where appends a list predicates to the AuthTokensDelete builder.

type AuthTokensEdges

type AuthTokensEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Roles holds the value of the roles edge.
	Roles *AuthRoles `json:"roles,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthTokensEdges) RolesOrErr

func (e AuthTokensEdges) RolesOrErr() (*AuthRoles, error)

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

func (AuthTokensEdges) UserOrErr

func (e AuthTokensEdges) UserOrErr() (*User, error)

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

type AuthTokensGroupBy

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

AuthTokensGroupBy is the group-by builder for AuthTokens entities.

func (*AuthTokensGroupBy) Aggregate

func (atgb *AuthTokensGroupBy) Aggregate(fns ...AggregateFunc) *AuthTokensGroupBy

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

func (*AuthTokensGroupBy) Bool

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

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

func (*AuthTokensGroupBy) BoolX

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

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

func (*AuthTokensGroupBy) Bools

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

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

func (*AuthTokensGroupBy) BoolsX

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

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

func (*AuthTokensGroupBy) Float64

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

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

func (*AuthTokensGroupBy) Float64X

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

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

func (*AuthTokensGroupBy) Float64s

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

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

func (*AuthTokensGroupBy) Float64sX

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

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

func (*AuthTokensGroupBy) Int

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

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

func (*AuthTokensGroupBy) IntX

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

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

func (*AuthTokensGroupBy) Ints

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

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

func (*AuthTokensGroupBy) IntsX

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

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

func (*AuthTokensGroupBy) Scan

func (atgb *AuthTokensGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthTokensGroupBy) ScanX

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

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

func (*AuthTokensGroupBy) String

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

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

func (*AuthTokensGroupBy) StringX

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

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

func (*AuthTokensGroupBy) Strings

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

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

func (*AuthTokensGroupBy) StringsX

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

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

type AuthTokensMutation

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

AuthTokensMutation represents an operation that mutates the AuthTokens nodes in the graph.

func (*AuthTokensMutation) AddField

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

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

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

func (*AuthTokensMutation) AddedField

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

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

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

func (*AuthTokensMutation) AddedIDs

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

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

func (*AuthTokensMutation) ClearEdge

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

func (m *AuthTokensMutation) 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 (*AuthTokensMutation) ClearRoles

func (m *AuthTokensMutation) ClearRoles()

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

func (*AuthTokensMutation) ClearUser

func (m *AuthTokensMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AuthTokensMutation) ClearedEdges

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

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

func (*AuthTokensMutation) ClearedFields

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

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

func (AuthTokensMutation) Client

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

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

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

func (*AuthTokensMutation) EdgeCleared

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

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

func (*AuthTokensMutation) ExpiresAt

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

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

func (*AuthTokensMutation) Field

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

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

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

func (*AuthTokensMutation) Fields

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

func (m *AuthTokensMutation) ID() (id uuid.UUID, 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 (*AuthTokensMutation) IDs

func (m *AuthTokensMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*AuthTokensMutation) OldCreatedAt

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

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

func (*AuthTokensMutation) OldExpiresAt

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

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

func (*AuthTokensMutation) OldField

func (m *AuthTokensMutation) 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 (*AuthTokensMutation) OldToken

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

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

func (*AuthTokensMutation) OldUpdatedAt

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

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

func (*AuthTokensMutation) Op

func (m *AuthTokensMutation) Op() Op

Op returns the operation name.

func (*AuthTokensMutation) RemovedEdges

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

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

func (*AuthTokensMutation) RemovedIDs

func (m *AuthTokensMutation) 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 (*AuthTokensMutation) ResetCreatedAt

func (m *AuthTokensMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AuthTokensMutation) ResetEdge

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

func (m *AuthTokensMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*AuthTokensMutation) ResetField

func (m *AuthTokensMutation) 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 (*AuthTokensMutation) ResetRoles

func (m *AuthTokensMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*AuthTokensMutation) ResetToken

func (m *AuthTokensMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*AuthTokensMutation) ResetUpdatedAt

func (m *AuthTokensMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AuthTokensMutation) ResetUser

func (m *AuthTokensMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AuthTokensMutation) RolesCleared

func (m *AuthTokensMutation) RolesCleared() bool

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

func (*AuthTokensMutation) RolesID

func (m *AuthTokensMutation) RolesID() (id int, exists bool)

RolesID returns the "roles" edge ID in the mutation.

func (*AuthTokensMutation) RolesIDs

func (m *AuthTokensMutation) RolesIDs() (ids []int)

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

func (*AuthTokensMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AuthTokensMutation) SetExpiresAt

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

SetExpiresAt sets the "expires_at" field.

func (*AuthTokensMutation) SetField

func (m *AuthTokensMutation) 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 (*AuthTokensMutation) SetID

func (m *AuthTokensMutation) SetID(id uuid.UUID)

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

func (*AuthTokensMutation) SetOp

func (m *AuthTokensMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuthTokensMutation) SetRolesID

func (m *AuthTokensMutation) SetRolesID(id int)

SetRolesID sets the "roles" edge to the AuthRoles entity by id.

func (*AuthTokensMutation) SetToken

func (m *AuthTokensMutation) SetToken(b []byte)

SetToken sets the "token" field.

func (*AuthTokensMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AuthTokensMutation) SetUserID

func (m *AuthTokensMutation) SetUserID(id uuid.UUID)

SetUserID sets the "user" edge to the User entity by id.

func (*AuthTokensMutation) Token

func (m *AuthTokensMutation) Token() (r []byte, exists bool)

Token returns the value of the "token" field in the mutation.

func (AuthTokensMutation) Tx

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

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

func (*AuthTokensMutation) Type

func (m *AuthTokensMutation) Type() string

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

func (*AuthTokensMutation) UpdatedAt

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

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

func (*AuthTokensMutation) UserCleared

func (m *AuthTokensMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AuthTokensMutation) UserID

func (m *AuthTokensMutation) UserID() (id uuid.UUID, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*AuthTokensMutation) UserIDs

func (m *AuthTokensMutation) UserIDs() (ids []uuid.UUID)

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

func (*AuthTokensMutation) Where

func (m *AuthTokensMutation) Where(ps ...predicate.AuthTokens)

Where appends a list predicates to the AuthTokensMutation builder.

func (*AuthTokensMutation) WhereP

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

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

type AuthTokensQuery

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

AuthTokensQuery is the builder for querying AuthTokens entities.

func (*AuthTokensQuery) Aggregate

func (atq *AuthTokensQuery) Aggregate(fns ...AggregateFunc) *AuthTokensSelect

Aggregate returns a AuthTokensSelect configured with the given aggregations.

func (*AuthTokensQuery) All

func (atq *AuthTokensQuery) All(ctx context.Context) ([]*AuthTokens, error)

All executes the query and returns a list of AuthTokensSlice.

func (*AuthTokensQuery) AllX

func (atq *AuthTokensQuery) AllX(ctx context.Context) []*AuthTokens

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

func (*AuthTokensQuery) Clone

func (atq *AuthTokensQuery) Clone() *AuthTokensQuery

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

func (*AuthTokensQuery) Count

func (atq *AuthTokensQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuthTokensQuery) CountX

func (atq *AuthTokensQuery) CountX(ctx context.Context) int

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

func (*AuthTokensQuery) Exist

func (atq *AuthTokensQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuthTokensQuery) ExistX

func (atq *AuthTokensQuery) ExistX(ctx context.Context) bool

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

func (*AuthTokensQuery) First

func (atq *AuthTokensQuery) First(ctx context.Context) (*AuthTokens, error)

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

func (*AuthTokensQuery) FirstID

func (atq *AuthTokensQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuthTokensQuery) FirstIDX

func (atq *AuthTokensQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AuthTokensQuery) FirstX

func (atq *AuthTokensQuery) FirstX(ctx context.Context) *AuthTokens

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

func (*AuthTokensQuery) GroupBy

func (atq *AuthTokensQuery) GroupBy(field string, fields ...string) *AuthTokensGroupBy

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.AuthTokens.Query().
	GroupBy(authtokens.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuthTokensQuery) IDs

func (atq *AuthTokensQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AuthTokensQuery) IDsX

func (atq *AuthTokensQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AuthTokensQuery) Limit

func (atq *AuthTokensQuery) Limit(limit int) *AuthTokensQuery

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

func (*AuthTokensQuery) Offset

func (atq *AuthTokensQuery) Offset(offset int) *AuthTokensQuery

Offset to start from.

func (*AuthTokensQuery) Only

func (atq *AuthTokensQuery) Only(ctx context.Context) (*AuthTokens, error)

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

func (*AuthTokensQuery) OnlyID

func (atq *AuthTokensQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuthTokensQuery) OnlyIDX

func (atq *AuthTokensQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AuthTokensQuery) OnlyX

func (atq *AuthTokensQuery) OnlyX(ctx context.Context) *AuthTokens

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

func (*AuthTokensQuery) Order

Order specifies how the records should be ordered.

func (*AuthTokensQuery) QueryRoles

func (atq *AuthTokensQuery) QueryRoles() *AuthRolesQuery

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

func (*AuthTokensQuery) QueryUser

func (atq *AuthTokensQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AuthTokensQuery) Select

func (atq *AuthTokensQuery) Select(fields ...string) *AuthTokensSelect

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

func (*AuthTokensQuery) Unique

func (atq *AuthTokensQuery) Unique(unique bool) *AuthTokensQuery

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

Where adds a new predicate for the AuthTokensQuery builder.

func (*AuthTokensQuery) WithRoles

func (atq *AuthTokensQuery) WithRoles(opts ...func(*AuthRolesQuery)) *AuthTokensQuery

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 (*AuthTokensQuery) WithUser

func (atq *AuthTokensQuery) WithUser(opts ...func(*UserQuery)) *AuthTokensQuery

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

type AuthTokensSelect

type AuthTokensSelect struct {
	*AuthTokensQuery
	// contains filtered or unexported fields
}

AuthTokensSelect is the builder for selecting fields of AuthTokens entities.

func (*AuthTokensSelect) Aggregate

func (ats *AuthTokensSelect) Aggregate(fns ...AggregateFunc) *AuthTokensSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuthTokensSelect) Bool

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

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

func (*AuthTokensSelect) BoolX

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

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

func (*AuthTokensSelect) Bools

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

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

func (*AuthTokensSelect) BoolsX

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

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

func (*AuthTokensSelect) Float64

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

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

func (*AuthTokensSelect) Float64X

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

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

func (*AuthTokensSelect) Float64s

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

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

func (*AuthTokensSelect) Float64sX

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

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

func (*AuthTokensSelect) Int

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

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

func (*AuthTokensSelect) IntX

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

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

func (*AuthTokensSelect) Ints

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

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

func (*AuthTokensSelect) IntsX

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

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

func (*AuthTokensSelect) Scan

func (ats *AuthTokensSelect) Scan(ctx context.Context, v any) error

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

func (*AuthTokensSelect) ScanX

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

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

func (*AuthTokensSelect) String

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

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

func (*AuthTokensSelect) StringX

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

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

func (*AuthTokensSelect) Strings

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

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

func (*AuthTokensSelect) StringsX

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

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

type AuthTokensSlice

type AuthTokensSlice []*AuthTokens

AuthTokensSlice is a parsable slice of AuthTokens.

type AuthTokensUpdate

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

AuthTokensUpdate is the builder for updating AuthTokens entities.

func (*AuthTokensUpdate) ClearRoles

func (atu *AuthTokensUpdate) ClearRoles() *AuthTokensUpdate

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

func (*AuthTokensUpdate) ClearUser

func (atu *AuthTokensUpdate) ClearUser() *AuthTokensUpdate

ClearUser clears the "user" edge to the User entity.

func (*AuthTokensUpdate) Exec

func (atu *AuthTokensUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuthTokensUpdate) ExecX

func (atu *AuthTokensUpdate) ExecX(ctx context.Context)

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

func (*AuthTokensUpdate) Mutation

func (atu *AuthTokensUpdate) Mutation() *AuthTokensMutation

Mutation returns the AuthTokensMutation object of the builder.

func (*AuthTokensUpdate) Save

func (atu *AuthTokensUpdate) Save(ctx context.Context) (int, error)

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

func (*AuthTokensUpdate) SaveX

func (atu *AuthTokensUpdate) SaveX(ctx context.Context) int

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

func (*AuthTokensUpdate) SetExpiresAt

func (atu *AuthTokensUpdate) SetExpiresAt(t time.Time) *AuthTokensUpdate

SetExpiresAt sets the "expires_at" field.

func (*AuthTokensUpdate) SetNillableExpiresAt

func (atu *AuthTokensUpdate) SetNillableExpiresAt(t *time.Time) *AuthTokensUpdate

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

func (*AuthTokensUpdate) SetNillableRolesID

func (atu *AuthTokensUpdate) SetNillableRolesID(id *int) *AuthTokensUpdate

SetNillableRolesID sets the "roles" edge to the AuthRoles entity by ID if the given value is not nil.

func (*AuthTokensUpdate) SetNillableUserID

func (atu *AuthTokensUpdate) SetNillableUserID(id *uuid.UUID) *AuthTokensUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*AuthTokensUpdate) SetRoles

func (atu *AuthTokensUpdate) SetRoles(a *AuthRoles) *AuthTokensUpdate

SetRoles sets the "roles" edge to the AuthRoles entity.

func (*AuthTokensUpdate) SetRolesID

func (atu *AuthTokensUpdate) SetRolesID(id int) *AuthTokensUpdate

SetRolesID sets the "roles" edge to the AuthRoles entity by ID.

func (*AuthTokensUpdate) SetToken

func (atu *AuthTokensUpdate) SetToken(b []byte) *AuthTokensUpdate

SetToken sets the "token" field.

func (*AuthTokensUpdate) SetUpdatedAt

func (atu *AuthTokensUpdate) SetUpdatedAt(t time.Time) *AuthTokensUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AuthTokensUpdate) SetUser

func (atu *AuthTokensUpdate) SetUser(u *User) *AuthTokensUpdate

SetUser sets the "user" edge to the User entity.

func (*AuthTokensUpdate) SetUserID

func (atu *AuthTokensUpdate) SetUserID(id uuid.UUID) *AuthTokensUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*AuthTokensUpdate) Where

Where appends a list predicates to the AuthTokensUpdate builder.

type AuthTokensUpdateOne

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

AuthTokensUpdateOne is the builder for updating a single AuthTokens entity.

func (*AuthTokensUpdateOne) ClearRoles

func (atuo *AuthTokensUpdateOne) ClearRoles() *AuthTokensUpdateOne

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

func (*AuthTokensUpdateOne) ClearUser

func (atuo *AuthTokensUpdateOne) ClearUser() *AuthTokensUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*AuthTokensUpdateOne) Exec

func (atuo *AuthTokensUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AuthTokensUpdateOne) ExecX

func (atuo *AuthTokensUpdateOne) ExecX(ctx context.Context)

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

func (*AuthTokensUpdateOne) Mutation

func (atuo *AuthTokensUpdateOne) Mutation() *AuthTokensMutation

Mutation returns the AuthTokensMutation object of the builder.

func (*AuthTokensUpdateOne) Save

func (atuo *AuthTokensUpdateOne) Save(ctx context.Context) (*AuthTokens, error)

Save executes the query and returns the updated AuthTokens entity.

func (*AuthTokensUpdateOne) SaveX

func (atuo *AuthTokensUpdateOne) SaveX(ctx context.Context) *AuthTokens

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

func (*AuthTokensUpdateOne) Select

func (atuo *AuthTokensUpdateOne) Select(field string, fields ...string) *AuthTokensUpdateOne

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

func (*AuthTokensUpdateOne) SetExpiresAt

func (atuo *AuthTokensUpdateOne) SetExpiresAt(t time.Time) *AuthTokensUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*AuthTokensUpdateOne) SetNillableExpiresAt

func (atuo *AuthTokensUpdateOne) SetNillableExpiresAt(t *time.Time) *AuthTokensUpdateOne

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

func (*AuthTokensUpdateOne) SetNillableRolesID

func (atuo *AuthTokensUpdateOne) SetNillableRolesID(id *int) *AuthTokensUpdateOne

SetNillableRolesID sets the "roles" edge to the AuthRoles entity by ID if the given value is not nil.

func (*AuthTokensUpdateOne) SetNillableUserID

func (atuo *AuthTokensUpdateOne) SetNillableUserID(id *uuid.UUID) *AuthTokensUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*AuthTokensUpdateOne) SetRoles

SetRoles sets the "roles" edge to the AuthRoles entity.

func (*AuthTokensUpdateOne) SetRolesID

func (atuo *AuthTokensUpdateOne) SetRolesID(id int) *AuthTokensUpdateOne

SetRolesID sets the "roles" edge to the AuthRoles entity by ID.

func (*AuthTokensUpdateOne) SetToken

func (atuo *AuthTokensUpdateOne) SetToken(b []byte) *AuthTokensUpdateOne

SetToken sets the "token" field.

func (*AuthTokensUpdateOne) SetUpdatedAt

func (atuo *AuthTokensUpdateOne) SetUpdatedAt(t time.Time) *AuthTokensUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AuthTokensUpdateOne) SetUser

func (atuo *AuthTokensUpdateOne) SetUser(u *User) *AuthTokensUpdateOne

SetUser sets the "user" edge to the User entity.

func (*AuthTokensUpdateOne) SetUserID

func (atuo *AuthTokensUpdateOne) SetUserID(id uuid.UUID) *AuthTokensUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*AuthTokensUpdateOne) Where

Where appends a list predicates to the AuthTokensUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// AuthRoles is the client for interacting with the AuthRoles builders.
	AuthRoles *AuthRolesClient
	// AuthTokens is the client for interacting with the AuthTokens builders.
	AuthTokens *AuthTokensClient
	// Document is the client for interacting with the Document builders.
	Document *DocumentClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupInvitationToken is the client for interacting with the GroupInvitationToken builders.
	GroupInvitationToken *GroupInvitationTokenClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// ItemField is the client for interacting with the ItemField builders.
	ItemField *ItemFieldClient
	// Label is the client for interacting with the Label builders.
	Label *LabelClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// MaintenanceEntry is the client for interacting with the MaintenanceEntry builders.
	MaintenanceEntry *MaintenanceEntryClient
	// Notifier is the client for interacting with the Notifier builders.
	Notifier *NotifierClient
	// 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().
	Attachment.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Sql

func (c *Client) Sql() *sql.DB

Sql exposes the underlying database connection in the ent client so that we can use it to perform custom queries.

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 Document

type Document struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DocumentQuery when eager-loading is set.
	Edges DocumentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Document is the model entity for the Document schema.

func (*Document) GetID

func (d *Document) GetID() uuid.UUID

func (*Document) QueryAttachments

func (d *Document) QueryAttachments() *AttachmentQuery

QueryAttachments queries the "attachments" edge of the Document entity.

func (*Document) QueryGroup

func (d *Document) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Document entity.

func (*Document) String

func (d *Document) String() string

String implements the fmt.Stringer.

func (*Document) Unwrap

func (d *Document) Unwrap() *Document

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

func (d *Document) Update() *DocumentUpdateOne

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

func (*Document) Value

func (d *Document) Value(name string) (ent.Value, error)

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

type DocumentClient

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

DocumentClient is a client for the Document schema.

func NewDocumentClient

func NewDocumentClient(c config) *DocumentClient

NewDocumentClient returns a client for the Document from the given config.

func (*DocumentClient) Create

func (c *DocumentClient) Create() *DocumentCreate

Create returns a builder for creating a Document entity.

func (*DocumentClient) CreateBulk

func (c *DocumentClient) CreateBulk(builders ...*DocumentCreate) *DocumentCreateBulk

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

func (*DocumentClient) Delete

func (c *DocumentClient) Delete() *DocumentDelete

Delete returns a delete builder for Document.

func (*DocumentClient) DeleteOne

func (c *DocumentClient) DeleteOne(d *Document) *DocumentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DocumentClient) DeleteOneID

func (c *DocumentClient) DeleteOneID(id uuid.UUID) *DocumentDeleteOne

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

func (*DocumentClient) Get

func (c *DocumentClient) Get(ctx context.Context, id uuid.UUID) (*Document, error)

Get returns a Document entity by its id.

func (*DocumentClient) GetX

func (c *DocumentClient) GetX(ctx context.Context, id uuid.UUID) *Document

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

func (*DocumentClient) Hooks

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

Hooks returns the client hooks.

func (*DocumentClient) Intercept

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

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

func (*DocumentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DocumentClient) MapCreateBulk

func (c *DocumentClient) MapCreateBulk(slice any, setFunc func(*DocumentCreate, int)) *DocumentCreateBulk

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

func (c *DocumentClient) Query() *DocumentQuery

Query returns a query builder for Document.

func (*DocumentClient) QueryAttachments

func (c *DocumentClient) QueryAttachments(d *Document) *AttachmentQuery

QueryAttachments queries the attachments edge of a Document.

func (*DocumentClient) QueryGroup

func (c *DocumentClient) QueryGroup(d *Document) *GroupQuery

QueryGroup queries the group edge of a Document.

func (*DocumentClient) Update

func (c *DocumentClient) Update() *DocumentUpdate

Update returns an update builder for Document.

func (*DocumentClient) UpdateOne

func (c *DocumentClient) UpdateOne(d *Document) *DocumentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DocumentClient) UpdateOneID

func (c *DocumentClient) UpdateOneID(id uuid.UUID) *DocumentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DocumentClient) Use

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

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

type DocumentCreate

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

DocumentCreate is the builder for creating a Document entity.

func (*DocumentCreate) AddAttachmentIDs

func (dc *DocumentCreate) AddAttachmentIDs(ids ...uuid.UUID) *DocumentCreate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*DocumentCreate) AddAttachments

func (dc *DocumentCreate) AddAttachments(a ...*Attachment) *DocumentCreate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*DocumentCreate) Exec

func (dc *DocumentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentCreate) ExecX

func (dc *DocumentCreate) ExecX(ctx context.Context)

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

func (*DocumentCreate) Mutation

func (dc *DocumentCreate) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentCreate) Save

func (dc *DocumentCreate) Save(ctx context.Context) (*Document, error)

Save creates the Document in the database.

func (*DocumentCreate) SaveX

func (dc *DocumentCreate) SaveX(ctx context.Context) *Document

SaveX calls Save and panics if Save returns an error.

func (*DocumentCreate) SetCreatedAt

func (dc *DocumentCreate) SetCreatedAt(t time.Time) *DocumentCreate

SetCreatedAt sets the "created_at" field.

func (*DocumentCreate) SetGroup

func (dc *DocumentCreate) SetGroup(g *Group) *DocumentCreate

SetGroup sets the "group" edge to the Group entity.

func (*DocumentCreate) SetGroupID

func (dc *DocumentCreate) SetGroupID(id uuid.UUID) *DocumentCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*DocumentCreate) SetID

func (dc *DocumentCreate) SetID(u uuid.UUID) *DocumentCreate

SetID sets the "id" field.

func (*DocumentCreate) SetNillableCreatedAt

func (dc *DocumentCreate) SetNillableCreatedAt(t *time.Time) *DocumentCreate

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

func (*DocumentCreate) SetNillableID

func (dc *DocumentCreate) SetNillableID(u *uuid.UUID) *DocumentCreate

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

func (*DocumentCreate) SetNillableUpdatedAt

func (dc *DocumentCreate) SetNillableUpdatedAt(t *time.Time) *DocumentCreate

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

func (*DocumentCreate) SetPath

func (dc *DocumentCreate) SetPath(s string) *DocumentCreate

SetPath sets the "path" field.

func (*DocumentCreate) SetTitle

func (dc *DocumentCreate) SetTitle(s string) *DocumentCreate

SetTitle sets the "title" field.

func (*DocumentCreate) SetUpdatedAt

func (dc *DocumentCreate) SetUpdatedAt(t time.Time) *DocumentCreate

SetUpdatedAt sets the "updated_at" field.

type DocumentCreateBulk

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

DocumentCreateBulk is the builder for creating many Document entities in bulk.

func (*DocumentCreateBulk) Exec

func (dcb *DocumentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentCreateBulk) ExecX

func (dcb *DocumentCreateBulk) ExecX(ctx context.Context)

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

func (*DocumentCreateBulk) Save

func (dcb *DocumentCreateBulk) Save(ctx context.Context) ([]*Document, error)

Save creates the Document entities in the database.

func (*DocumentCreateBulk) SaveX

func (dcb *DocumentCreateBulk) SaveX(ctx context.Context) []*Document

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

type DocumentDelete

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

DocumentDelete is the builder for deleting a Document entity.

func (*DocumentDelete) Exec

func (dd *DocumentDelete) Exec(ctx context.Context) (int, error)

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

func (*DocumentDelete) ExecX

func (dd *DocumentDelete) ExecX(ctx context.Context) int

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

func (*DocumentDelete) Where

func (dd *DocumentDelete) Where(ps ...predicate.Document) *DocumentDelete

Where appends a list predicates to the DocumentDelete builder.

type DocumentDeleteOne

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

DocumentDeleteOne is the builder for deleting a single Document entity.

func (*DocumentDeleteOne) Exec

func (ddo *DocumentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DocumentDeleteOne) ExecX

func (ddo *DocumentDeleteOne) ExecX(ctx context.Context)

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

func (*DocumentDeleteOne) Where

Where appends a list predicates to the DocumentDelete builder.

type DocumentEdges

type DocumentEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Attachments holds the value of the attachments edge.
	Attachments []*Attachment `json:"attachments,omitempty"`
	// contains filtered or unexported fields
}

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

func (DocumentEdges) AttachmentsOrErr

func (e DocumentEdges) AttachmentsOrErr() ([]*Attachment, error)

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

func (DocumentEdges) GroupOrErr

func (e DocumentEdges) GroupOrErr() (*Group, error)

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

type DocumentGroupBy

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

DocumentGroupBy is the group-by builder for Document entities.

func (*DocumentGroupBy) Aggregate

func (dgb *DocumentGroupBy) Aggregate(fns ...AggregateFunc) *DocumentGroupBy

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

func (*DocumentGroupBy) Bool

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

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

func (*DocumentGroupBy) BoolX

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

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

func (*DocumentGroupBy) Bools

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

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

func (*DocumentGroupBy) BoolsX

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

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

func (*DocumentGroupBy) Float64

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

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

func (*DocumentGroupBy) Float64X

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

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

func (*DocumentGroupBy) Float64s

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

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

func (*DocumentGroupBy) Float64sX

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

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

func (*DocumentGroupBy) Int

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

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

func (*DocumentGroupBy) IntX

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

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

func (*DocumentGroupBy) Ints

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

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

func (*DocumentGroupBy) IntsX

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

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

func (*DocumentGroupBy) Scan

func (dgb *DocumentGroupBy) Scan(ctx context.Context, v any) error

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

func (*DocumentGroupBy) ScanX

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

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

func (*DocumentGroupBy) String

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

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

func (*DocumentGroupBy) StringX

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

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

func (*DocumentGroupBy) Strings

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

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

func (*DocumentGroupBy) StringsX

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

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

type DocumentMutation

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

DocumentMutation represents an operation that mutates the Document nodes in the graph.

func (*DocumentMutation) AddAttachmentIDs

func (m *DocumentMutation) AddAttachmentIDs(ids ...uuid.UUID)

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by ids.

func (*DocumentMutation) AddField

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

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

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

func (*DocumentMutation) AddedField

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

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

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

func (*DocumentMutation) AddedIDs

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

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

func (*DocumentMutation) AttachmentsCleared

func (m *DocumentMutation) AttachmentsCleared() bool

AttachmentsCleared reports if the "attachments" edge to the Attachment entity was cleared.

func (*DocumentMutation) AttachmentsIDs

func (m *DocumentMutation) AttachmentsIDs() (ids []uuid.UUID)

AttachmentsIDs returns the "attachments" edge IDs in the mutation.

func (*DocumentMutation) ClearAttachments

func (m *DocumentMutation) ClearAttachments()

ClearAttachments clears the "attachments" edge to the Attachment entity.

func (*DocumentMutation) ClearEdge

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

func (m *DocumentMutation) 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 (*DocumentMutation) ClearGroup

func (m *DocumentMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*DocumentMutation) ClearedEdges

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

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

func (*DocumentMutation) ClearedFields

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

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

func (DocumentMutation) Client

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

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

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

func (*DocumentMutation) EdgeCleared

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

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

func (*DocumentMutation) Field

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

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

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

func (*DocumentMutation) Fields

func (m *DocumentMutation) 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 (*DocumentMutation) GroupCleared

func (m *DocumentMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*DocumentMutation) GroupID

func (m *DocumentMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*DocumentMutation) GroupIDs

func (m *DocumentMutation) GroupIDs() (ids []uuid.UUID)

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

func (*DocumentMutation) ID

func (m *DocumentMutation) ID() (id uuid.UUID, 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 (*DocumentMutation) IDs

func (m *DocumentMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*DocumentMutation) OldCreatedAt

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

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

func (*DocumentMutation) OldField

func (m *DocumentMutation) 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 (*DocumentMutation) OldPath

func (m *DocumentMutation) OldPath(ctx context.Context) (v string, err error)

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

func (*DocumentMutation) OldTitle

func (m *DocumentMutation) OldTitle(ctx context.Context) (v string, err error)

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

func (*DocumentMutation) OldUpdatedAt

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

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

func (*DocumentMutation) Op

func (m *DocumentMutation) Op() Op

Op returns the operation name.

func (*DocumentMutation) Path

func (m *DocumentMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*DocumentMutation) RemoveAttachmentIDs

func (m *DocumentMutation) RemoveAttachmentIDs(ids ...uuid.UUID)

RemoveAttachmentIDs removes the "attachments" edge to the Attachment entity by IDs.

func (*DocumentMutation) RemovedAttachmentsIDs

func (m *DocumentMutation) RemovedAttachmentsIDs() (ids []uuid.UUID)

RemovedAttachments returns the removed IDs of the "attachments" edge to the Attachment entity.

func (*DocumentMutation) RemovedEdges

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

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

func (*DocumentMutation) RemovedIDs

func (m *DocumentMutation) 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 (*DocumentMutation) ResetAttachments

func (m *DocumentMutation) ResetAttachments()

ResetAttachments resets all changes to the "attachments" edge.

func (*DocumentMutation) ResetCreatedAt

func (m *DocumentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DocumentMutation) ResetEdge

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

func (m *DocumentMutation) 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 (*DocumentMutation) ResetGroup

func (m *DocumentMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*DocumentMutation) ResetPath

func (m *DocumentMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*DocumentMutation) ResetTitle

func (m *DocumentMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DocumentMutation) ResetUpdatedAt

func (m *DocumentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DocumentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DocumentMutation) SetField

func (m *DocumentMutation) 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 (*DocumentMutation) SetGroupID

func (m *DocumentMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*DocumentMutation) SetID

func (m *DocumentMutation) SetID(id uuid.UUID)

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

func (*DocumentMutation) SetOp

func (m *DocumentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DocumentMutation) SetPath

func (m *DocumentMutation) SetPath(s string)

SetPath sets the "path" field.

func (*DocumentMutation) SetTitle

func (m *DocumentMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DocumentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DocumentMutation) Title

func (m *DocumentMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DocumentMutation) Tx

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

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

func (*DocumentMutation) Type

func (m *DocumentMutation) Type() string

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

func (*DocumentMutation) UpdatedAt

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

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

func (*DocumentMutation) Where

func (m *DocumentMutation) Where(ps ...predicate.Document)

Where appends a list predicates to the DocumentMutation builder.

func (*DocumentMutation) WhereP

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

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

type DocumentQuery

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

DocumentQuery is the builder for querying Document entities.

func (*DocumentQuery) Aggregate

func (dq *DocumentQuery) Aggregate(fns ...AggregateFunc) *DocumentSelect

Aggregate returns a DocumentSelect configured with the given aggregations.

func (*DocumentQuery) All

func (dq *DocumentQuery) All(ctx context.Context) ([]*Document, error)

All executes the query and returns a list of Documents.

func (*DocumentQuery) AllX

func (dq *DocumentQuery) AllX(ctx context.Context) []*Document

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

func (*DocumentQuery) Clone

func (dq *DocumentQuery) Clone() *DocumentQuery

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

func (*DocumentQuery) Count

func (dq *DocumentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DocumentQuery) CountX

func (dq *DocumentQuery) CountX(ctx context.Context) int

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

func (*DocumentQuery) Exist

func (dq *DocumentQuery) Exist(ctx context.Context) (bool, error)

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

func (*DocumentQuery) ExistX

func (dq *DocumentQuery) ExistX(ctx context.Context) bool

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

func (*DocumentQuery) First

func (dq *DocumentQuery) First(ctx context.Context) (*Document, error)

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

func (*DocumentQuery) FirstID

func (dq *DocumentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DocumentQuery) FirstIDX

func (dq *DocumentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*DocumentQuery) FirstX

func (dq *DocumentQuery) FirstX(ctx context.Context) *Document

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

func (*DocumentQuery) GroupBy

func (dq *DocumentQuery) GroupBy(field string, fields ...string) *DocumentGroupBy

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.Document.Query().
	GroupBy(document.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DocumentQuery) IDs

func (dq *DocumentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*DocumentQuery) IDsX

func (dq *DocumentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*DocumentQuery) Limit

func (dq *DocumentQuery) Limit(limit int) *DocumentQuery

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

func (*DocumentQuery) Offset

func (dq *DocumentQuery) Offset(offset int) *DocumentQuery

Offset to start from.

func (*DocumentQuery) Only

func (dq *DocumentQuery) Only(ctx context.Context) (*Document, error)

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

func (*DocumentQuery) OnlyID

func (dq *DocumentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DocumentQuery) OnlyIDX

func (dq *DocumentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*DocumentQuery) OnlyX

func (dq *DocumentQuery) OnlyX(ctx context.Context) *Document

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

func (*DocumentQuery) Order

Order specifies how the records should be ordered.

func (*DocumentQuery) QueryAttachments

func (dq *DocumentQuery) QueryAttachments() *AttachmentQuery

QueryAttachments chains the current query on the "attachments" edge.

func (*DocumentQuery) QueryGroup

func (dq *DocumentQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*DocumentQuery) Select

func (dq *DocumentQuery) Select(fields ...string) *DocumentSelect

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

func (*DocumentQuery) Unique

func (dq *DocumentQuery) Unique(unique bool) *DocumentQuery

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

func (dq *DocumentQuery) Where(ps ...predicate.Document) *DocumentQuery

Where adds a new predicate for the DocumentQuery builder.

func (*DocumentQuery) WithAttachments

func (dq *DocumentQuery) WithAttachments(opts ...func(*AttachmentQuery)) *DocumentQuery

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

func (*DocumentQuery) WithGroup

func (dq *DocumentQuery) WithGroup(opts ...func(*GroupQuery)) *DocumentQuery

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

type DocumentSelect

type DocumentSelect struct {
	*DocumentQuery
	// contains filtered or unexported fields
}

DocumentSelect is the builder for selecting fields of Document entities.

func (*DocumentSelect) Aggregate

func (ds *DocumentSelect) Aggregate(fns ...AggregateFunc) *DocumentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DocumentSelect) Bool

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

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

func (*DocumentSelect) BoolX

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

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

func (*DocumentSelect) Bools

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

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

func (*DocumentSelect) BoolsX

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

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

func (*DocumentSelect) Float64

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

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

func (*DocumentSelect) Float64X

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

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

func (*DocumentSelect) Float64s

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

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

func (*DocumentSelect) Float64sX

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

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

func (*DocumentSelect) Int

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

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

func (*DocumentSelect) IntX

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

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

func (*DocumentSelect) Ints

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

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

func (*DocumentSelect) IntsX

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

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

func (*DocumentSelect) Scan

func (ds *DocumentSelect) Scan(ctx context.Context, v any) error

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

func (*DocumentSelect) ScanX

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

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

func (*DocumentSelect) String

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

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

func (*DocumentSelect) StringX

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

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

func (*DocumentSelect) Strings

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

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

func (*DocumentSelect) StringsX

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

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

type DocumentUpdate

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

DocumentUpdate is the builder for updating Document entities.

func (*DocumentUpdate) AddAttachmentIDs

func (du *DocumentUpdate) AddAttachmentIDs(ids ...uuid.UUID) *DocumentUpdate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*DocumentUpdate) AddAttachments

func (du *DocumentUpdate) AddAttachments(a ...*Attachment) *DocumentUpdate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*DocumentUpdate) ClearAttachments

func (du *DocumentUpdate) ClearAttachments() *DocumentUpdate

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*DocumentUpdate) ClearGroup

func (du *DocumentUpdate) ClearGroup() *DocumentUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*DocumentUpdate) Exec

func (du *DocumentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DocumentUpdate) ExecX

func (du *DocumentUpdate) ExecX(ctx context.Context)

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

func (*DocumentUpdate) Mutation

func (du *DocumentUpdate) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentUpdate) RemoveAttachmentIDs

func (du *DocumentUpdate) RemoveAttachmentIDs(ids ...uuid.UUID) *DocumentUpdate

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*DocumentUpdate) RemoveAttachments

func (du *DocumentUpdate) RemoveAttachments(a ...*Attachment) *DocumentUpdate

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*DocumentUpdate) Save

func (du *DocumentUpdate) Save(ctx context.Context) (int, error)

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

func (*DocumentUpdate) SaveX

func (du *DocumentUpdate) SaveX(ctx context.Context) int

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

func (*DocumentUpdate) SetGroup

func (du *DocumentUpdate) SetGroup(g *Group) *DocumentUpdate

SetGroup sets the "group" edge to the Group entity.

func (*DocumentUpdate) SetGroupID

func (du *DocumentUpdate) SetGroupID(id uuid.UUID) *DocumentUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*DocumentUpdate) SetNillablePath

func (du *DocumentUpdate) SetNillablePath(s *string) *DocumentUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*DocumentUpdate) SetNillableTitle

func (du *DocumentUpdate) SetNillableTitle(s *string) *DocumentUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*DocumentUpdate) SetPath

func (du *DocumentUpdate) SetPath(s string) *DocumentUpdate

SetPath sets the "path" field.

func (*DocumentUpdate) SetTitle

func (du *DocumentUpdate) SetTitle(s string) *DocumentUpdate

SetTitle sets the "title" field.

func (*DocumentUpdate) SetUpdatedAt

func (du *DocumentUpdate) SetUpdatedAt(t time.Time) *DocumentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DocumentUpdate) Where

func (du *DocumentUpdate) Where(ps ...predicate.Document) *DocumentUpdate

Where appends a list predicates to the DocumentUpdate builder.

type DocumentUpdateOne

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

DocumentUpdateOne is the builder for updating a single Document entity.

func (*DocumentUpdateOne) AddAttachmentIDs

func (duo *DocumentUpdateOne) AddAttachmentIDs(ids ...uuid.UUID) *DocumentUpdateOne

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*DocumentUpdateOne) AddAttachments

func (duo *DocumentUpdateOne) AddAttachments(a ...*Attachment) *DocumentUpdateOne

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*DocumentUpdateOne) ClearAttachments

func (duo *DocumentUpdateOne) ClearAttachments() *DocumentUpdateOne

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*DocumentUpdateOne) ClearGroup

func (duo *DocumentUpdateOne) ClearGroup() *DocumentUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*DocumentUpdateOne) Exec

func (duo *DocumentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DocumentUpdateOne) ExecX

func (duo *DocumentUpdateOne) ExecX(ctx context.Context)

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

func (*DocumentUpdateOne) Mutation

func (duo *DocumentUpdateOne) Mutation() *DocumentMutation

Mutation returns the DocumentMutation object of the builder.

func (*DocumentUpdateOne) RemoveAttachmentIDs

func (duo *DocumentUpdateOne) RemoveAttachmentIDs(ids ...uuid.UUID) *DocumentUpdateOne

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*DocumentUpdateOne) RemoveAttachments

func (duo *DocumentUpdateOne) RemoveAttachments(a ...*Attachment) *DocumentUpdateOne

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*DocumentUpdateOne) Save

func (duo *DocumentUpdateOne) Save(ctx context.Context) (*Document, error)

Save executes the query and returns the updated Document entity.

func (*DocumentUpdateOne) SaveX

func (duo *DocumentUpdateOne) SaveX(ctx context.Context) *Document

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

func (*DocumentUpdateOne) Select

func (duo *DocumentUpdateOne) Select(field string, fields ...string) *DocumentUpdateOne

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

func (*DocumentUpdateOne) SetGroup

func (duo *DocumentUpdateOne) SetGroup(g *Group) *DocumentUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*DocumentUpdateOne) SetGroupID

func (duo *DocumentUpdateOne) SetGroupID(id uuid.UUID) *DocumentUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*DocumentUpdateOne) SetNillablePath

func (duo *DocumentUpdateOne) SetNillablePath(s *string) *DocumentUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*DocumentUpdateOne) SetNillableTitle

func (duo *DocumentUpdateOne) SetNillableTitle(s *string) *DocumentUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*DocumentUpdateOne) SetPath

func (duo *DocumentUpdateOne) SetPath(s string) *DocumentUpdateOne

SetPath sets the "path" field.

func (*DocumentUpdateOne) SetTitle

func (duo *DocumentUpdateOne) SetTitle(s string) *DocumentUpdateOne

SetTitle sets the "title" field.

func (*DocumentUpdateOne) SetUpdatedAt

func (duo *DocumentUpdateOne) SetUpdatedAt(t time.Time) *DocumentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DocumentUpdateOne) Where

Where appends a list predicates to the DocumentUpdate builder.

type Documents

type Documents []*Document

Documents is a parsable slice of Document.

type Group

type Group struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Currency holds the value of the "currency" field.
	Currency string `json:"currency,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) GetID

func (gr *Group) GetID() uuid.UUID

func (*Group) QueryDocuments

func (gr *Group) QueryDocuments() *DocumentQuery

QueryDocuments queries the "documents" edge of the Group entity.

func (*Group) QueryInvitationTokens

func (gr *Group) QueryInvitationTokens() *GroupInvitationTokenQuery

QueryInvitationTokens queries the "invitation_tokens" edge of the Group entity.

func (*Group) QueryItems

func (gr *Group) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Group entity.

func (*Group) QueryLabels

func (gr *Group) QueryLabels() *LabelQuery

QueryLabels queries the "labels" edge of the Group entity.

func (*Group) QueryLocations

func (gr *Group) QueryLocations() *LocationQuery

QueryLocations queries the "locations" edge of the Group entity.

func (*Group) QueryNotifiers

func (gr *Group) QueryNotifiers() *NotifierQuery

QueryNotifiers queries the "notifiers" edge of the Group entity.

func (*Group) QueryUsers

func (gr *Group) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Group entity.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

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

func (gr *Group) Update() *GroupUpdateOne

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

func (*Group) Value

func (gr *Group) Value(name string) (ent.Value, error)

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne

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

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id uuid.UUID) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id uuid.UUID) *Group

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Intercept

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

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

func (*GroupClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroupClient) MapCreateBulk

func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk

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

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryDocuments

func (c *GroupClient) QueryDocuments(gr *Group) *DocumentQuery

QueryDocuments queries the documents edge of a Group.

func (*GroupClient) QueryInvitationTokens

func (c *GroupClient) QueryInvitationTokens(gr *Group) *GroupInvitationTokenQuery

QueryInvitationTokens queries the invitation_tokens edge of a Group.

func (*GroupClient) QueryItems

func (c *GroupClient) QueryItems(gr *Group) *ItemQuery

QueryItems queries the items edge of a Group.

func (*GroupClient) QueryLabels

func (c *GroupClient) QueryLabels(gr *Group) *LabelQuery

QueryLabels queries the labels edge of a Group.

func (*GroupClient) QueryLocations

func (c *GroupClient) QueryLocations(gr *Group) *LocationQuery

QueryLocations queries the locations edge of a Group.

func (*GroupClient) QueryNotifiers

func (c *GroupClient) QueryNotifiers(gr *Group) *NotifierQuery

QueryNotifiers queries the notifiers edge of a Group.

func (*GroupClient) QueryUsers

func (c *GroupClient) QueryUsers(gr *Group) *UserQuery

QueryUsers queries the users edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddDocumentIDs

func (gc *GroupCreate) AddDocumentIDs(ids ...uuid.UUID) *GroupCreate

AddDocumentIDs adds the "documents" edge to the Document entity by IDs.

func (*GroupCreate) AddDocuments

func (gc *GroupCreate) AddDocuments(d ...*Document) *GroupCreate

AddDocuments adds the "documents" edges to the Document entity.

func (*GroupCreate) AddInvitationTokenIDs

func (gc *GroupCreate) AddInvitationTokenIDs(ids ...uuid.UUID) *GroupCreate

AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.

func (*GroupCreate) AddInvitationTokens

func (gc *GroupCreate) AddInvitationTokens(g ...*GroupInvitationToken) *GroupCreate

AddInvitationTokens adds the "invitation_tokens" edges to the GroupInvitationToken entity.

func (*GroupCreate) AddItemIDs

func (gc *GroupCreate) AddItemIDs(ids ...uuid.UUID) *GroupCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*GroupCreate) AddItems

func (gc *GroupCreate) AddItems(i ...*Item) *GroupCreate

AddItems adds the "items" edges to the Item entity.

func (*GroupCreate) AddLabelIDs

func (gc *GroupCreate) AddLabelIDs(ids ...uuid.UUID) *GroupCreate

AddLabelIDs adds the "labels" edge to the Label entity by IDs.

func (*GroupCreate) AddLabels

func (gc *GroupCreate) AddLabels(l ...*Label) *GroupCreate

AddLabels adds the "labels" edges to the Label entity.

func (*GroupCreate) AddLocationIDs

func (gc *GroupCreate) AddLocationIDs(ids ...uuid.UUID) *GroupCreate

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*GroupCreate) AddLocations

func (gc *GroupCreate) AddLocations(l ...*Location) *GroupCreate

AddLocations adds the "locations" edges to the Location entity.

func (*GroupCreate) AddNotifierIDs

func (gc *GroupCreate) AddNotifierIDs(ids ...uuid.UUID) *GroupCreate

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by IDs.

func (*GroupCreate) AddNotifiers

func (gc *GroupCreate) AddNotifiers(n ...*Notifier) *GroupCreate

AddNotifiers adds the "notifiers" edges to the Notifier entity.

func (*GroupCreate) AddUserIDs

func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupCreate) AddUsers

func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate

AddUsers adds the "users" edges to the User entity.

func (*GroupCreate) Exec

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetCreatedAt

func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate

SetCreatedAt sets the "created_at" field.

func (*GroupCreate) SetCurrency

func (gc *GroupCreate) SetCurrency(s string) *GroupCreate

SetCurrency sets the "currency" field.

func (*GroupCreate) SetID

func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetName

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" field.

func (*GroupCreate) SetNillableCreatedAt

func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableCurrency

func (gc *GroupCreate) SetNillableCurrency(s *string) *GroupCreate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*GroupCreate) SetNillableID

func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate

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

func (*GroupCreate) SetNillableUpdatedAt

func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetUpdatedAt

func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate

SetUpdatedAt sets the "updated_at" field.

type GroupCreateBulk

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

func (*GroupDeleteOne) Where

func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne

Where appends a list predicates to the GroupDelete builder.

type GroupEdges

type GroupEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Locations holds the value of the locations edge.
	Locations []*Location `json:"locations,omitempty"`
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// Labels holds the value of the labels edge.
	Labels []*Label `json:"labels,omitempty"`
	// Documents holds the value of the documents edge.
	Documents []*Document `json:"documents,omitempty"`
	// InvitationTokens holds the value of the invitation_tokens edge.
	InvitationTokens []*GroupInvitationToken `json:"invitation_tokens,omitempty"`
	// Notifiers holds the value of the notifiers edge.
	Notifiers []*Notifier `json:"notifiers,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroupEdges) DocumentsOrErr

func (e GroupEdges) DocumentsOrErr() ([]*Document, error)

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

func (GroupEdges) InvitationTokensOrErr

func (e GroupEdges) InvitationTokensOrErr() ([]*GroupInvitationToken, error)

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

func (GroupEdges) ItemsOrErr

func (e GroupEdges) ItemsOrErr() ([]*Item, error)

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

func (GroupEdges) LabelsOrErr

func (e GroupEdges) LabelsOrErr() ([]*Label, error)

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

func (GroupEdges) LocationsOrErr

func (e GroupEdges) LocationsOrErr() ([]*Location, error)

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

func (GroupEdges) NotifiersOrErr

func (e GroupEdges) NotifiersOrErr() ([]*Notifier, error)

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

func (GroupEdges) UsersOrErr

func (e GroupEdges) UsersOrErr() ([]*User, error)

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

type GroupGroupBy

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool

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

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

func (*GroupGroupBy) BoolX

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

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

func (*GroupGroupBy) Bools

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

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

func (*GroupGroupBy) BoolsX

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

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

func (*GroupGroupBy) Float64

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

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

func (*GroupGroupBy) Float64X

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

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

func (*GroupGroupBy) Float64s

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

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

func (*GroupGroupBy) Float64sX

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

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

func (*GroupGroupBy) Int

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

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

func (*GroupGroupBy) IntX

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

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

func (*GroupGroupBy) Ints

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

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

func (*GroupGroupBy) IntsX

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

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

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroupGroupBy) ScanX

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

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

func (*GroupGroupBy) String

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

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

func (*GroupGroupBy) StringX

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

StringX is like String, but panics if an error occurs.

func (*GroupGroupBy) Strings

func (s *GroupGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) StringsX

func (s *GroupGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupInvitationToken

type GroupInvitationToken struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Token holds the value of the "token" field.
	Token []byte `json:"token,omitempty"`
	// ExpiresAt holds the value of the "expires_at" field.
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// Uses holds the value of the "uses" field.
	Uses int `json:"uses,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupInvitationTokenQuery when eager-loading is set.
	Edges GroupInvitationTokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroupInvitationToken is the model entity for the GroupInvitationToken schema.

func (*GroupInvitationToken) GetID

func (git *GroupInvitationToken) GetID() uuid.UUID

func (*GroupInvitationToken) QueryGroup

func (git *GroupInvitationToken) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the GroupInvitationToken entity.

func (*GroupInvitationToken) String

func (git *GroupInvitationToken) String() string

String implements the fmt.Stringer.

func (*GroupInvitationToken) Unwrap

Unwrap unwraps the GroupInvitationToken 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 (*GroupInvitationToken) Update

Update returns a builder for updating this GroupInvitationToken. Note that you need to call GroupInvitationToken.Unwrap() before calling this method if this GroupInvitationToken was returned from a transaction, and the transaction was committed or rolled back.

func (*GroupInvitationToken) Value

func (git *GroupInvitationToken) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GroupInvitationToken. This includes values selected through modifiers, order, etc.

type GroupInvitationTokenClient

type GroupInvitationTokenClient struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenClient is a client for the GroupInvitationToken schema.

func NewGroupInvitationTokenClient

func NewGroupInvitationTokenClient(c config) *GroupInvitationTokenClient

NewGroupInvitationTokenClient returns a client for the GroupInvitationToken from the given config.

func (*GroupInvitationTokenClient) Create

Create returns a builder for creating a GroupInvitationToken entity.

func (*GroupInvitationTokenClient) CreateBulk

CreateBulk returns a builder for creating a bulk of GroupInvitationToken entities.

func (*GroupInvitationTokenClient) Delete

Delete returns a delete builder for GroupInvitationToken.

func (*GroupInvitationTokenClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupInvitationTokenClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GroupInvitationTokenClient) Get

Get returns a GroupInvitationToken entity by its id.

func (*GroupInvitationTokenClient) GetX

GetX is like Get, but panics if an error occurs.

func (*GroupInvitationTokenClient) Hooks

func (c *GroupInvitationTokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupInvitationTokenClient) Intercept

func (c *GroupInvitationTokenClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `groupinvitationtoken.Intercept(f(g(h())))`.

func (*GroupInvitationTokenClient) Interceptors

func (c *GroupInvitationTokenClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupInvitationTokenClient) MapCreateBulk

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 (*GroupInvitationTokenClient) Query

Query returns a query builder for GroupInvitationToken.

func (*GroupInvitationTokenClient) QueryGroup

QueryGroup queries the group edge of a GroupInvitationToken.

func (*GroupInvitationTokenClient) Update

Update returns an update builder for GroupInvitationToken.

func (*GroupInvitationTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupInvitationTokenClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GroupInvitationTokenClient) Use

func (c *GroupInvitationTokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `groupinvitationtoken.Hooks(f(g(h())))`.

type GroupInvitationTokenCreate

type GroupInvitationTokenCreate struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenCreate is the builder for creating a GroupInvitationToken entity.

func (*GroupInvitationTokenCreate) Exec

Exec executes the query.

func (*GroupInvitationTokenCreate) ExecX

func (gitc *GroupInvitationTokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInvitationTokenCreate) Mutation

Mutation returns the GroupInvitationTokenMutation object of the builder.

func (*GroupInvitationTokenCreate) Save

Save creates the GroupInvitationToken in the database.

func (*GroupInvitationTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GroupInvitationTokenCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*GroupInvitationTokenCreate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*GroupInvitationTokenCreate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupInvitationTokenCreate) SetGroupID

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GroupInvitationTokenCreate) SetID

SetID sets the "id" field.

func (*GroupInvitationTokenCreate) SetNillableCreatedAt

func (gitc *GroupInvitationTokenCreate) SetNillableCreatedAt(t *time.Time) *GroupInvitationTokenCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroupInvitationTokenCreate) SetNillableExpiresAt

func (gitc *GroupInvitationTokenCreate) SetNillableExpiresAt(t *time.Time) *GroupInvitationTokenCreate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*GroupInvitationTokenCreate) SetNillableGroupID

func (gitc *GroupInvitationTokenCreate) SetNillableGroupID(id *uuid.UUID) *GroupInvitationTokenCreate

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*GroupInvitationTokenCreate) SetNillableID

SetNillableID sets the "id" field if the given value is not nil.

func (*GroupInvitationTokenCreate) SetNillableUpdatedAt

func (gitc *GroupInvitationTokenCreate) SetNillableUpdatedAt(t *time.Time) *GroupInvitationTokenCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GroupInvitationTokenCreate) SetNillableUses

func (gitc *GroupInvitationTokenCreate) SetNillableUses(i *int) *GroupInvitationTokenCreate

SetNillableUses sets the "uses" field if the given value is not nil.

func (*GroupInvitationTokenCreate) SetToken

SetToken sets the "token" field.

func (*GroupInvitationTokenCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GroupInvitationTokenCreate) SetUses

SetUses sets the "uses" field.

type GroupInvitationTokenCreateBulk

type GroupInvitationTokenCreateBulk struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenCreateBulk is the builder for creating many GroupInvitationToken entities in bulk.

func (*GroupInvitationTokenCreateBulk) Exec

Exec executes the query.

func (*GroupInvitationTokenCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*GroupInvitationTokenCreateBulk) Save

Save creates the GroupInvitationToken entities in the database.

func (*GroupInvitationTokenCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type GroupInvitationTokenDelete

type GroupInvitationTokenDelete struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenDelete is the builder for deleting a GroupInvitationToken entity.

func (*GroupInvitationTokenDelete) Exec

func (gitd *GroupInvitationTokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupInvitationTokenDelete) ExecX

func (gitd *GroupInvitationTokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupInvitationTokenDelete) Where

Where appends a list predicates to the GroupInvitationTokenDelete builder.

type GroupInvitationTokenDeleteOne

type GroupInvitationTokenDeleteOne struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenDeleteOne is the builder for deleting a single GroupInvitationToken entity.

func (*GroupInvitationTokenDeleteOne) Exec

Exec executes the deletion query.

func (*GroupInvitationTokenDeleteOne) ExecX

func (gitdo *GroupInvitationTokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInvitationTokenDeleteOne) Where

Where appends a list predicates to the GroupInvitationTokenDelete builder.

type GroupInvitationTokenEdges

type GroupInvitationTokenEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

GroupInvitationTokenEdges holds the relations/edges for other nodes in the graph.

func (GroupInvitationTokenEdges) GroupOrErr

func (e GroupInvitationTokenEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GroupInvitationTokenGroupBy

type GroupInvitationTokenGroupBy struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenGroupBy is the group-by builder for GroupInvitationToken entities.

func (*GroupInvitationTokenGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupInvitationTokenGroupBy) Bool

func (s *GroupInvitationTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) BoolX

func (s *GroupInvitationTokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Bools

func (s *GroupInvitationTokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) BoolsX

func (s *GroupInvitationTokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Float64

func (s *GroupInvitationTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) Float64X

func (s *GroupInvitationTokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Float64s

func (s *GroupInvitationTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) Float64sX

func (s *GroupInvitationTokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Int

func (s *GroupInvitationTokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) IntX

func (s *GroupInvitationTokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Ints

func (s *GroupInvitationTokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) IntsX

func (s *GroupInvitationTokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Scan

func (gitgb *GroupInvitationTokenGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupInvitationTokenGroupBy) ScanX

func (s *GroupInvitationTokenGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) String

func (s *GroupInvitationTokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) StringX

func (s *GroupInvitationTokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupInvitationTokenGroupBy) Strings

func (s *GroupInvitationTokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenGroupBy) StringsX

func (s *GroupInvitationTokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupInvitationTokenMutation

type GroupInvitationTokenMutation struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenMutation represents an operation that mutates the GroupInvitationToken nodes in the graph.

func (*GroupInvitationTokenMutation) AddField

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) AddUses

func (m *GroupInvitationTokenMutation) AddUses(i int)

AddUses adds i to the "uses" field.

func (*GroupInvitationTokenMutation) AddedEdges

func (m *GroupInvitationTokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupInvitationTokenMutation) AddedField

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) AddedFields

func (m *GroupInvitationTokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupInvitationTokenMutation) AddedIDs

func (m *GroupInvitationTokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupInvitationTokenMutation) AddedUses

func (m *GroupInvitationTokenMutation) AddedUses() (r int, exists bool)

AddedUses returns the value that was added to the "uses" field in this mutation.

func (*GroupInvitationTokenMutation) ClearEdge

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) ClearField

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) ClearGroup

func (m *GroupInvitationTokenMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*GroupInvitationTokenMutation) ClearedEdges

func (m *GroupInvitationTokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupInvitationTokenMutation) ClearedFields

func (m *GroupInvitationTokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) CreatedAt

func (m *GroupInvitationTokenMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroupInvitationTokenMutation) EdgeCleared

func (m *GroupInvitationTokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupInvitationTokenMutation) ExpiresAt

func (m *GroupInvitationTokenMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*GroupInvitationTokenMutation) Field

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) FieldCleared

func (m *GroupInvitationTokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupInvitationTokenMutation) Fields

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) GroupCleared

func (m *GroupInvitationTokenMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*GroupInvitationTokenMutation) GroupID

func (m *GroupInvitationTokenMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*GroupInvitationTokenMutation) GroupIDs

func (m *GroupInvitationTokenMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*GroupInvitationTokenMutation) ID

func (m *GroupInvitationTokenMutation) ID() (id uuid.UUID, 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 (*GroupInvitationTokenMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*GroupInvitationTokenMutation) OldCreatedAt

func (m *GroupInvitationTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the GroupInvitationToken entity. If the GroupInvitationToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupInvitationTokenMutation) OldExpiresAt

func (m *GroupInvitationTokenMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the GroupInvitationToken entity. If the GroupInvitationToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupInvitationTokenMutation) OldField

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) OldToken

func (m *GroupInvitationTokenMutation) OldToken(ctx context.Context) (v []byte, err error)

OldToken returns the old "token" field's value of the GroupInvitationToken entity. If the GroupInvitationToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupInvitationTokenMutation) OldUpdatedAt

func (m *GroupInvitationTokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the GroupInvitationToken entity. If the GroupInvitationToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupInvitationTokenMutation) OldUses

func (m *GroupInvitationTokenMutation) OldUses(ctx context.Context) (v int, err error)

OldUses returns the old "uses" field's value of the GroupInvitationToken entity. If the GroupInvitationToken object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupInvitationTokenMutation) Op

Op returns the operation name.

func (*GroupInvitationTokenMutation) RemovedEdges

func (m *GroupInvitationTokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupInvitationTokenMutation) RemovedIDs

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) ResetCreatedAt

func (m *GroupInvitationTokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupInvitationTokenMutation) ResetEdge

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) ResetExpiresAt

func (m *GroupInvitationTokenMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*GroupInvitationTokenMutation) ResetField

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) ResetGroup

func (m *GroupInvitationTokenMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*GroupInvitationTokenMutation) ResetToken

func (m *GroupInvitationTokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*GroupInvitationTokenMutation) ResetUpdatedAt

func (m *GroupInvitationTokenMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupInvitationTokenMutation) ResetUses

func (m *GroupInvitationTokenMutation) ResetUses()

ResetUses resets all changes to the "uses" field.

func (*GroupInvitationTokenMutation) SetCreatedAt

func (m *GroupInvitationTokenMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroupInvitationTokenMutation) SetExpiresAt

func (m *GroupInvitationTokenMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*GroupInvitationTokenMutation) SetField

func (m *GroupInvitationTokenMutation) 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 (*GroupInvitationTokenMutation) SetGroupID

func (m *GroupInvitationTokenMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*GroupInvitationTokenMutation) SetID

func (m *GroupInvitationTokenMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of GroupInvitationToken entities.

func (*GroupInvitationTokenMutation) SetOp

func (m *GroupInvitationTokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupInvitationTokenMutation) SetToken

func (m *GroupInvitationTokenMutation) SetToken(b []byte)

SetToken sets the "token" field.

func (*GroupInvitationTokenMutation) SetUpdatedAt

func (m *GroupInvitationTokenMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GroupInvitationTokenMutation) SetUses

func (m *GroupInvitationTokenMutation) SetUses(i int)

SetUses sets the "uses" field.

func (*GroupInvitationTokenMutation) Token

func (m *GroupInvitationTokenMutation) Token() (r []byte, exists bool)

Token returns the value of the "token" field in the mutation.

func (GroupInvitationTokenMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupInvitationTokenMutation) Type

Type returns the node type of this mutation (GroupInvitationToken).

func (*GroupInvitationTokenMutation) UpdatedAt

func (m *GroupInvitationTokenMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GroupInvitationTokenMutation) Uses

func (m *GroupInvitationTokenMutation) Uses() (r int, exists bool)

Uses returns the value of the "uses" field in the mutation.

func (*GroupInvitationTokenMutation) Where

Where appends a list predicates to the GroupInvitationTokenMutation builder.

func (*GroupInvitationTokenMutation) WhereP

func (m *GroupInvitationTokenMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupInvitationTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupInvitationTokenQuery

type GroupInvitationTokenQuery struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenQuery is the builder for querying GroupInvitationToken entities.

func (*GroupInvitationTokenQuery) Aggregate

Aggregate returns a GroupInvitationTokenSelect configured with the given aggregations.

func (*GroupInvitationTokenQuery) All

All executes the query and returns a list of GroupInvitationTokens.

func (*GroupInvitationTokenQuery) AllX

AllX is like All, but panics if an error occurs.

func (*GroupInvitationTokenQuery) Clone

Clone returns a duplicate of the GroupInvitationTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupInvitationTokenQuery) Count

func (gitq *GroupInvitationTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupInvitationTokenQuery) CountX

func (gitq *GroupInvitationTokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupInvitationTokenQuery) Exist

func (gitq *GroupInvitationTokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupInvitationTokenQuery) ExistX

func (gitq *GroupInvitationTokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupInvitationTokenQuery) First

First returns the first GroupInvitationToken entity from the query. Returns a *NotFoundError when no GroupInvitationToken was found.

func (*GroupInvitationTokenQuery) FirstID

func (gitq *GroupInvitationTokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first GroupInvitationToken ID from the query. Returns a *NotFoundError when no GroupInvitationToken ID was found.

func (*GroupInvitationTokenQuery) FirstIDX

func (gitq *GroupInvitationTokenQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupInvitationTokenQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*GroupInvitationTokenQuery) GroupBy

func (gitq *GroupInvitationTokenQuery) GroupBy(field string, fields ...string) *GroupInvitationTokenGroupBy

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.GroupInvitationToken.Query().
	GroupBy(groupinvitationtoken.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupInvitationTokenQuery) IDs

func (gitq *GroupInvitationTokenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of GroupInvitationToken IDs.

func (*GroupInvitationTokenQuery) IDsX

IDsX is like IDs, but panics if an error occurs.

func (*GroupInvitationTokenQuery) Limit

Limit the number of records to be returned by this query.

func (*GroupInvitationTokenQuery) Offset

Offset to start from.

func (*GroupInvitationTokenQuery) Only

Only returns a single GroupInvitationToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroupInvitationToken entity is found. Returns a *NotFoundError when no GroupInvitationToken entities are found.

func (*GroupInvitationTokenQuery) OnlyID

func (gitq *GroupInvitationTokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only GroupInvitationToken ID in the query. Returns a *NotSingularError when more than one GroupInvitationToken ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupInvitationTokenQuery) OnlyIDX

func (gitq *GroupInvitationTokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupInvitationTokenQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*GroupInvitationTokenQuery) Order

Order specifies how the records should be ordered.

func (*GroupInvitationTokenQuery) QueryGroup

func (gitq *GroupInvitationTokenQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*GroupInvitationTokenQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.GroupInvitationToken.Query().
	Select(groupinvitationtoken.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupInvitationTokenQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*GroupInvitationTokenQuery) Where

Where adds a new predicate for the GroupInvitationTokenQuery builder.

func (*GroupInvitationTokenQuery) WithGroup

func (gitq *GroupInvitationTokenQuery) WithGroup(opts ...func(*GroupQuery)) *GroupInvitationTokenQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

type GroupInvitationTokenSelect

type GroupInvitationTokenSelect struct {
	*GroupInvitationTokenQuery
	// contains filtered or unexported fields
}

GroupInvitationTokenSelect is the builder for selecting fields of GroupInvitationToken entities.

func (*GroupInvitationTokenSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GroupInvitationTokenSelect) Bool

func (s *GroupInvitationTokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) BoolX

func (s *GroupInvitationTokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Bools

func (s *GroupInvitationTokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) BoolsX

func (s *GroupInvitationTokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Float64

func (s *GroupInvitationTokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) Float64X

func (s *GroupInvitationTokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Float64s

func (s *GroupInvitationTokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) Float64sX

func (s *GroupInvitationTokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Int

func (s *GroupInvitationTokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) IntX

func (s *GroupInvitationTokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Ints

func (s *GroupInvitationTokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) IntsX

func (s *GroupInvitationTokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Scan

func (gits *GroupInvitationTokenSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupInvitationTokenSelect) ScanX

func (s *GroupInvitationTokenSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupInvitationTokenSelect) String

func (s *GroupInvitationTokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) StringX

func (s *GroupInvitationTokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupInvitationTokenSelect) Strings

func (s *GroupInvitationTokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupInvitationTokenSelect) StringsX

func (s *GroupInvitationTokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupInvitationTokenUpdate

type GroupInvitationTokenUpdate struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenUpdate is the builder for updating GroupInvitationToken entities.

func (*GroupInvitationTokenUpdate) AddUses

AddUses adds i to the "uses" field.

func (*GroupInvitationTokenUpdate) ClearGroup

ClearGroup clears the "group" edge to the Group entity.

func (*GroupInvitationTokenUpdate) Exec

Exec executes the query.

func (*GroupInvitationTokenUpdate) ExecX

func (gitu *GroupInvitationTokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInvitationTokenUpdate) Mutation

Mutation returns the GroupInvitationTokenMutation object of the builder.

func (*GroupInvitationTokenUpdate) Save

func (gitu *GroupInvitationTokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupInvitationTokenUpdate) SaveX

func (gitu *GroupInvitationTokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupInvitationTokenUpdate) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*GroupInvitationTokenUpdate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupInvitationTokenUpdate) SetGroupID

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GroupInvitationTokenUpdate) SetNillableExpiresAt

func (gitu *GroupInvitationTokenUpdate) SetNillableExpiresAt(t *time.Time) *GroupInvitationTokenUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*GroupInvitationTokenUpdate) SetNillableGroupID

func (gitu *GroupInvitationTokenUpdate) SetNillableGroupID(id *uuid.UUID) *GroupInvitationTokenUpdate

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*GroupInvitationTokenUpdate) SetNillableUses

func (gitu *GroupInvitationTokenUpdate) SetNillableUses(i *int) *GroupInvitationTokenUpdate

SetNillableUses sets the "uses" field if the given value is not nil.

func (*GroupInvitationTokenUpdate) SetToken

SetToken sets the "token" field.

func (*GroupInvitationTokenUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GroupInvitationTokenUpdate) SetUses

SetUses sets the "uses" field.

func (*GroupInvitationTokenUpdate) Where

Where appends a list predicates to the GroupInvitationTokenUpdate builder.

type GroupInvitationTokenUpdateOne

type GroupInvitationTokenUpdateOne struct {
	// contains filtered or unexported fields
}

GroupInvitationTokenUpdateOne is the builder for updating a single GroupInvitationToken entity.

func (*GroupInvitationTokenUpdateOne) AddUses

AddUses adds i to the "uses" field.

func (*GroupInvitationTokenUpdateOne) ClearGroup

ClearGroup clears the "group" edge to the Group entity.

func (*GroupInvitationTokenUpdateOne) Exec

Exec executes the query on the entity.

func (*GroupInvitationTokenUpdateOne) ExecX

func (gituo *GroupInvitationTokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInvitationTokenUpdateOne) Mutation

Mutation returns the GroupInvitationTokenMutation object of the builder.

func (*GroupInvitationTokenUpdateOne) Save

Save executes the query and returns the updated GroupInvitationToken entity.

func (*GroupInvitationTokenUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GroupInvitationTokenUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupInvitationTokenUpdateOne) SetExpiresAt

SetExpiresAt sets the "expires_at" field.

func (*GroupInvitationTokenUpdateOne) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupInvitationTokenUpdateOne) SetGroupID

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GroupInvitationTokenUpdateOne) SetNillableExpiresAt

func (gituo *GroupInvitationTokenUpdateOne) SetNillableExpiresAt(t *time.Time) *GroupInvitationTokenUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*GroupInvitationTokenUpdateOne) SetNillableGroupID

func (gituo *GroupInvitationTokenUpdateOne) SetNillableGroupID(id *uuid.UUID) *GroupInvitationTokenUpdateOne

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*GroupInvitationTokenUpdateOne) SetNillableUses

SetNillableUses sets the "uses" field if the given value is not nil.

func (*GroupInvitationTokenUpdateOne) SetToken

SetToken sets the "token" field.

func (*GroupInvitationTokenUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GroupInvitationTokenUpdateOne) SetUses

SetUses sets the "uses" field.

func (*GroupInvitationTokenUpdateOne) Where

Where appends a list predicates to the GroupInvitationTokenUpdate builder.

type GroupInvitationTokens

type GroupInvitationTokens []*GroupInvitationToken

GroupInvitationTokens is a parsable slice of GroupInvitationToken.

type GroupMutation

type GroupMutation struct {
	// contains filtered or unexported fields
}

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddDocumentIDs

func (m *GroupMutation) AddDocumentIDs(ids ...uuid.UUID)

AddDocumentIDs adds the "documents" edge to the Document entity by ids.

func (*GroupMutation) AddField

func (m *GroupMutation) 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 (*GroupMutation) AddInvitationTokenIDs

func (m *GroupMutation) AddInvitationTokenIDs(ids ...uuid.UUID)

AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by ids.

func (*GroupMutation) AddItemIDs

func (m *GroupMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*GroupMutation) AddLabelIDs

func (m *GroupMutation) AddLabelIDs(ids ...uuid.UUID)

AddLabelIDs adds the "labels" edge to the Label entity by ids.

func (*GroupMutation) AddLocationIDs

func (m *GroupMutation) AddLocationIDs(ids ...uuid.UUID)

AddLocationIDs adds the "locations" edge to the Location entity by ids.

func (*GroupMutation) AddNotifierIDs

func (m *GroupMutation) AddNotifierIDs(ids ...uuid.UUID)

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by ids.

func (*GroupMutation) AddUserIDs

func (m *GroupMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*GroupMutation) AddedEdges

func (m *GroupMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupMutation) AddedField

func (m *GroupMutation) 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 (*GroupMutation) AddedFields

func (m *GroupMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupMutation) AddedIDs

func (m *GroupMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupMutation) ClearDocuments

func (m *GroupMutation) ClearDocuments()

ClearDocuments clears the "documents" edge to the Document entity.

func (*GroupMutation) ClearEdge

func (m *GroupMutation) 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 (*GroupMutation) ClearField

func (m *GroupMutation) 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 (*GroupMutation) ClearInvitationTokens

func (m *GroupMutation) ClearInvitationTokens()

ClearInvitationTokens clears the "invitation_tokens" edge to the GroupInvitationToken entity.

func (*GroupMutation) ClearItems

func (m *GroupMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*GroupMutation) ClearLabels

func (m *GroupMutation) ClearLabels()

ClearLabels clears the "labels" edge to the Label entity.

func (*GroupMutation) ClearLocations

func (m *GroupMutation) ClearLocations()

ClearLocations clears the "locations" edge to the Location entity.

func (*GroupMutation) ClearNotifiers

func (m *GroupMutation) ClearNotifiers()

ClearNotifiers clears the "notifiers" edge to the Notifier entity.

func (*GroupMutation) ClearUsers

func (m *GroupMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*GroupMutation) ClearedEdges

func (m *GroupMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupMutation) ClearedFields

func (m *GroupMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupMutation) Client

func (m GroupMutation) 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 (*GroupMutation) CreatedAt

func (m *GroupMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroupMutation) Currency

func (m *GroupMutation) Currency() (r string, exists bool)

Currency returns the value of the "currency" field in the mutation.

func (*GroupMutation) DocumentsCleared

func (m *GroupMutation) DocumentsCleared() bool

DocumentsCleared reports if the "documents" edge to the Document entity was cleared.

func (*GroupMutation) DocumentsIDs

func (m *GroupMutation) DocumentsIDs() (ids []uuid.UUID)

DocumentsIDs returns the "documents" edge IDs in the mutation.

func (*GroupMutation) EdgeCleared

func (m *GroupMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupMutation) Field

func (m *GroupMutation) 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 (*GroupMutation) FieldCleared

func (m *GroupMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupMutation) Fields

func (m *GroupMutation) 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 (*GroupMutation) ID

func (m *GroupMutation) ID() (id uuid.UUID, 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 (*GroupMutation) IDs

func (m *GroupMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*GroupMutation) InvitationTokensCleared

func (m *GroupMutation) InvitationTokensCleared() bool

InvitationTokensCleared reports if the "invitation_tokens" edge to the GroupInvitationToken entity was cleared.

func (*GroupMutation) InvitationTokensIDs

func (m *GroupMutation) InvitationTokensIDs() (ids []uuid.UUID)

InvitationTokensIDs returns the "invitation_tokens" edge IDs in the mutation.

func (*GroupMutation) ItemsCleared

func (m *GroupMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*GroupMutation) ItemsIDs

func (m *GroupMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*GroupMutation) LabelsCleared

func (m *GroupMutation) LabelsCleared() bool

LabelsCleared reports if the "labels" edge to the Label entity was cleared.

func (*GroupMutation) LabelsIDs

func (m *GroupMutation) LabelsIDs() (ids []uuid.UUID)

LabelsIDs returns the "labels" edge IDs in the mutation.

func (*GroupMutation) LocationsCleared

func (m *GroupMutation) LocationsCleared() bool

LocationsCleared reports if the "locations" edge to the Location entity was cleared.

func (*GroupMutation) LocationsIDs

func (m *GroupMutation) LocationsIDs() (ids []uuid.UUID)

LocationsIDs returns the "locations" edge IDs in the mutation.

func (*GroupMutation) Name

func (m *GroupMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroupMutation) NotifiersCleared

func (m *GroupMutation) NotifiersCleared() bool

NotifiersCleared reports if the "notifiers" edge to the Notifier entity was cleared.

func (*GroupMutation) NotifiersIDs

func (m *GroupMutation) NotifiersIDs() (ids []uuid.UUID)

NotifiersIDs returns the "notifiers" edge IDs in the mutation.

func (*GroupMutation) OldCreatedAt

func (m *GroupMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) OldCurrency

func (m *GroupMutation) OldCurrency(ctx context.Context) (v string, err error)

OldCurrency returns the old "currency" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) OldField

func (m *GroupMutation) 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 (*GroupMutation) OldName

func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) OldUpdatedAt

func (m *GroupMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveDocumentIDs

func (m *GroupMutation) RemoveDocumentIDs(ids ...uuid.UUID)

RemoveDocumentIDs removes the "documents" edge to the Document entity by IDs.

func (*GroupMutation) RemoveInvitationTokenIDs

func (m *GroupMutation) RemoveInvitationTokenIDs(ids ...uuid.UUID)

RemoveInvitationTokenIDs removes the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.

func (*GroupMutation) RemoveItemIDs

func (m *GroupMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*GroupMutation) RemoveLabelIDs

func (m *GroupMutation) RemoveLabelIDs(ids ...uuid.UUID)

RemoveLabelIDs removes the "labels" edge to the Label entity by IDs.

func (*GroupMutation) RemoveLocationIDs

func (m *GroupMutation) RemoveLocationIDs(ids ...uuid.UUID)

RemoveLocationIDs removes the "locations" edge to the Location entity by IDs.

func (*GroupMutation) RemoveNotifierIDs

func (m *GroupMutation) RemoveNotifierIDs(ids ...uuid.UUID)

RemoveNotifierIDs removes the "notifiers" edge to the Notifier entity by IDs.

func (*GroupMutation) RemoveUserIDs

func (m *GroupMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*GroupMutation) RemovedDocumentsIDs

func (m *GroupMutation) RemovedDocumentsIDs() (ids []uuid.UUID)

RemovedDocuments returns the removed IDs of the "documents" edge to the Document entity.

func (*GroupMutation) RemovedEdges

func (m *GroupMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupMutation) RemovedIDs

func (m *GroupMutation) 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 (*GroupMutation) RemovedInvitationTokensIDs

func (m *GroupMutation) RemovedInvitationTokensIDs() (ids []uuid.UUID)

RemovedInvitationTokens returns the removed IDs of the "invitation_tokens" edge to the GroupInvitationToken entity.

func (*GroupMutation) RemovedItemsIDs

func (m *GroupMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*GroupMutation) RemovedLabelsIDs

func (m *GroupMutation) RemovedLabelsIDs() (ids []uuid.UUID)

RemovedLabels returns the removed IDs of the "labels" edge to the Label entity.

func (*GroupMutation) RemovedLocationsIDs

func (m *GroupMutation) RemovedLocationsIDs() (ids []uuid.UUID)

RemovedLocations returns the removed IDs of the "locations" edge to the Location entity.

func (*GroupMutation) RemovedNotifiersIDs

func (m *GroupMutation) RemovedNotifiersIDs() (ids []uuid.UUID)

RemovedNotifiers returns the removed IDs of the "notifiers" edge to the Notifier entity.

func (*GroupMutation) RemovedUsersIDs

func (m *GroupMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*GroupMutation) ResetCreatedAt

func (m *GroupMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupMutation) ResetCurrency

func (m *GroupMutation) ResetCurrency()

ResetCurrency resets all changes to the "currency" field.

func (*GroupMutation) ResetDocuments

func (m *GroupMutation) ResetDocuments()

ResetDocuments resets all changes to the "documents" edge.

func (*GroupMutation) ResetEdge

func (m *GroupMutation) 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 (*GroupMutation) ResetField

func (m *GroupMutation) 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 (*GroupMutation) ResetInvitationTokens

func (m *GroupMutation) ResetInvitationTokens()

ResetInvitationTokens resets all changes to the "invitation_tokens" edge.

func (*GroupMutation) ResetItems

func (m *GroupMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*GroupMutation) ResetLabels

func (m *GroupMutation) ResetLabels()

ResetLabels resets all changes to the "labels" edge.

func (*GroupMutation) ResetLocations

func (m *GroupMutation) ResetLocations()

ResetLocations resets all changes to the "locations" edge.

func (*GroupMutation) ResetName

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetNotifiers

func (m *GroupMutation) ResetNotifiers()

ResetNotifiers resets all changes to the "notifiers" edge.

func (*GroupMutation) ResetUpdatedAt

func (m *GroupMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*GroupMutation) SetCreatedAt

func (m *GroupMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroupMutation) SetCurrency

func (m *GroupMutation) SetCurrency(s string)

SetCurrency sets the "currency" field.

func (*GroupMutation) SetField

func (m *GroupMutation) 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 (*GroupMutation) SetID

func (m *GroupMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Group entities.

func (*GroupMutation) SetName

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetOp

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMutation) SetUpdatedAt

func (m *GroupMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (GroupMutation) Tx

func (m GroupMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

Type returns the node type of this mutation (Group).

func (*GroupMutation) UpdatedAt

func (m *GroupMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GroupMutation) UsersCleared

func (m *GroupMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*GroupMutation) UsersIDs

func (m *GroupMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP

func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupQuery

type GroupQuery struct {
	// contains filtered or unexported fields
}

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) Aggregate

func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate returns a GroupSelect configured with the given aggregations.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

AllX is like All, but panics if an error occurs.

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

First returns the first Group entity from the query. Returns a *NotFoundError when no Group was found.

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Group ID from the query. Returns a *NotFoundError when no Group ID was found.

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

FirstX is like First, but panics if an error occurs.

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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.Group.Query().
	GroupBy(group.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

func (gq *GroupQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Group IDs.

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit the number of records to be returned by this query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset to start from.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

Only returns a single Group entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Group entity is found. Returns a *NotFoundError when no Group entities are found.

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Group ID in the query. Returns a *NotSingularError when more than one Group ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

OnlyX is like Only, but panics if an error occurs.

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery

Order specifies how the records should be ordered.

func (*GroupQuery) QueryDocuments

func (gq *GroupQuery) QueryDocuments() *DocumentQuery

QueryDocuments chains the current query on the "documents" edge.

func (*GroupQuery) QueryInvitationTokens

func (gq *GroupQuery) QueryInvitationTokens() *GroupInvitationTokenQuery

QueryInvitationTokens chains the current query on the "invitation_tokens" edge.

func (*GroupQuery) QueryItems

func (gq *GroupQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*GroupQuery) QueryLabels

func (gq *GroupQuery) QueryLabels() *LabelQuery

QueryLabels chains the current query on the "labels" edge.

func (*GroupQuery) QueryLocations

func (gq *GroupQuery) QueryLocations() *LocationQuery

QueryLocations chains the current query on the "locations" edge.

func (*GroupQuery) QueryNotifiers

func (gq *GroupQuery) QueryNotifiers() *NotifierQuery

QueryNotifiers chains the current query on the "notifiers" edge.

func (*GroupQuery) QueryUsers

func (gq *GroupQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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.Group.Query().
	Select(group.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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 (*GroupQuery) Where

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithDocuments

func (gq *GroupQuery) WithDocuments(opts ...func(*DocumentQuery)) *GroupQuery

WithDocuments tells the query-builder to eager-load the nodes that are connected to the "documents" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithInvitationTokens

func (gq *GroupQuery) WithInvitationTokens(opts ...func(*GroupInvitationTokenQuery)) *GroupQuery

WithInvitationTokens tells the query-builder to eager-load the nodes that are connected to the "invitation_tokens" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithItems

func (gq *GroupQuery) WithItems(opts ...func(*ItemQuery)) *GroupQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithLabels

func (gq *GroupQuery) WithLabels(opts ...func(*LabelQuery)) *GroupQuery

WithLabels tells the query-builder to eager-load the nodes that are connected to the "labels" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithLocations

func (gq *GroupQuery) WithLocations(opts ...func(*LocationQuery)) *GroupQuery

WithLocations tells the query-builder to eager-load the nodes that are connected to the "locations" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithNotifiers

func (gq *GroupQuery) WithNotifiers(opts ...func(*NotifierQuery)) *GroupQuery

WithNotifiers tells the query-builder to eager-load the nodes that are connected to the "notifiers" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithUsers

func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Aggregate

func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupSelect) Bool

func (s *GroupSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupSelect) BoolX

func (s *GroupSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupSelect) Bools

func (s *GroupSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupSelect) BoolsX

func (s *GroupSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupSelect) Float64

func (s *GroupSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupSelect) Float64X

func (s *GroupSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupSelect) Float64s

func (s *GroupSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupSelect) Float64sX

func (s *GroupSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupSelect) Int

func (s *GroupSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupSelect) IntX

func (s *GroupSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupSelect) Ints

func (s *GroupSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupSelect) IntsX

func (s *GroupSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupSelect) ScanX

func (s *GroupSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupSelect) String

func (s *GroupSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupSelect) StringX

func (s *GroupSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupSelect) Strings

func (s *GroupSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupSelect) StringsX

func (s *GroupSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupUpdate

type GroupUpdate struct {
	// contains filtered or unexported fields
}

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddDocumentIDs

func (gu *GroupUpdate) AddDocumentIDs(ids ...uuid.UUID) *GroupUpdate

AddDocumentIDs adds the "documents" edge to the Document entity by IDs.

func (*GroupUpdate) AddDocuments

func (gu *GroupUpdate) AddDocuments(d ...*Document) *GroupUpdate

AddDocuments adds the "documents" edges to the Document entity.

func (*GroupUpdate) AddInvitationTokenIDs

func (gu *GroupUpdate) AddInvitationTokenIDs(ids ...uuid.UUID) *GroupUpdate

AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.

func (*GroupUpdate) AddInvitationTokens

func (gu *GroupUpdate) AddInvitationTokens(g ...*GroupInvitationToken) *GroupUpdate

AddInvitationTokens adds the "invitation_tokens" edges to the GroupInvitationToken entity.

func (*GroupUpdate) AddItemIDs

func (gu *GroupUpdate) AddItemIDs(ids ...uuid.UUID) *GroupUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*GroupUpdate) AddItems

func (gu *GroupUpdate) AddItems(i ...*Item) *GroupUpdate

AddItems adds the "items" edges to the Item entity.

func (*GroupUpdate) AddLabelIDs

func (gu *GroupUpdate) AddLabelIDs(ids ...uuid.UUID) *GroupUpdate

AddLabelIDs adds the "labels" edge to the Label entity by IDs.

func (*GroupUpdate) AddLabels

func (gu *GroupUpdate) AddLabels(l ...*Label) *GroupUpdate

AddLabels adds the "labels" edges to the Label entity.

func (*GroupUpdate) AddLocationIDs

func (gu *GroupUpdate) AddLocationIDs(ids ...uuid.UUID) *GroupUpdate

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*GroupUpdate) AddLocations

func (gu *GroupUpdate) AddLocations(l ...*Location) *GroupUpdate

AddLocations adds the "locations" edges to the Location entity.

func (*GroupUpdate) AddNotifierIDs

func (gu *GroupUpdate) AddNotifierIDs(ids ...uuid.UUID) *GroupUpdate

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by IDs.

func (*GroupUpdate) AddNotifiers

func (gu *GroupUpdate) AddNotifiers(n ...*Notifier) *GroupUpdate

AddNotifiers adds the "notifiers" edges to the Notifier entity.

func (*GroupUpdate) AddUserIDs

func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdate) AddUsers

func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdate) ClearDocuments

func (gu *GroupUpdate) ClearDocuments() *GroupUpdate

ClearDocuments clears all "documents" edges to the Document entity.

func (*GroupUpdate) ClearInvitationTokens

func (gu *GroupUpdate) ClearInvitationTokens() *GroupUpdate

ClearInvitationTokens clears all "invitation_tokens" edges to the GroupInvitationToken entity.

func (*GroupUpdate) ClearItems

func (gu *GroupUpdate) ClearItems() *GroupUpdate

ClearItems clears all "items" edges to the Item entity.

func (*GroupUpdate) ClearLabels

func (gu *GroupUpdate) ClearLabels() *GroupUpdate

ClearLabels clears all "labels" edges to the Label entity.

func (*GroupUpdate) ClearLocations

func (gu *GroupUpdate) ClearLocations() *GroupUpdate

ClearLocations clears all "locations" edges to the Location entity.

func (*GroupUpdate) ClearNotifiers

func (gu *GroupUpdate) ClearNotifiers() *GroupUpdate

ClearNotifiers clears all "notifiers" edges to the Notifier entity.

func (*GroupUpdate) ClearUsers

func (gu *GroupUpdate) ClearUsers() *GroupUpdate

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveDocumentIDs

func (gu *GroupUpdate) RemoveDocumentIDs(ids ...uuid.UUID) *GroupUpdate

RemoveDocumentIDs removes the "documents" edge to Document entities by IDs.

func (*GroupUpdate) RemoveDocuments

func (gu *GroupUpdate) RemoveDocuments(d ...*Document) *GroupUpdate

RemoveDocuments removes "documents" edges to Document entities.

func (*GroupUpdate) RemoveInvitationTokenIDs

func (gu *GroupUpdate) RemoveInvitationTokenIDs(ids ...uuid.UUID) *GroupUpdate

RemoveInvitationTokenIDs removes the "invitation_tokens" edge to GroupInvitationToken entities by IDs.

func (*GroupUpdate) RemoveInvitationTokens

func (gu *GroupUpdate) RemoveInvitationTokens(g ...*GroupInvitationToken) *GroupUpdate

RemoveInvitationTokens removes "invitation_tokens" edges to GroupInvitationToken entities.

func (*GroupUpdate) RemoveItemIDs

func (gu *GroupUpdate) RemoveItemIDs(ids ...uuid.UUID) *GroupUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*GroupUpdate) RemoveItems

func (gu *GroupUpdate) RemoveItems(i ...*Item) *GroupUpdate

RemoveItems removes "items" edges to Item entities.

func (*GroupUpdate) RemoveLabelIDs

func (gu *GroupUpdate) RemoveLabelIDs(ids ...uuid.UUID) *GroupUpdate

RemoveLabelIDs removes the "labels" edge to Label entities by IDs.

func (*GroupUpdate) RemoveLabels

func (gu *GroupUpdate) RemoveLabels(l ...*Label) *GroupUpdate

RemoveLabels removes "labels" edges to Label entities.

func (*GroupUpdate) RemoveLocationIDs

func (gu *GroupUpdate) RemoveLocationIDs(ids ...uuid.UUID) *GroupUpdate

RemoveLocationIDs removes the "locations" edge to Location entities by IDs.

func (*GroupUpdate) RemoveLocations

func (gu *GroupUpdate) RemoveLocations(l ...*Location) *GroupUpdate

RemoveLocations removes "locations" edges to Location entities.

func (*GroupUpdate) RemoveNotifierIDs

func (gu *GroupUpdate) RemoveNotifierIDs(ids ...uuid.UUID) *GroupUpdate

RemoveNotifierIDs removes the "notifiers" edge to Notifier entities by IDs.

func (*GroupUpdate) RemoveNotifiers

func (gu *GroupUpdate) RemoveNotifiers(n ...*Notifier) *GroupUpdate

RemoveNotifiers removes "notifiers" edges to Notifier entities.

func (*GroupUpdate) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdate) RemoveUsers

func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdate) SetCurrency

func (gu *GroupUpdate) SetCurrency(s string) *GroupUpdate

SetCurrency sets the "currency" field.

func (*GroupUpdate) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetNillableCurrency

func (gu *GroupUpdate) SetNillableCurrency(s *string) *GroupUpdate

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*GroupUpdate) SetNillableName

func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupUpdate) SetUpdatedAt

func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

type GroupUpdateOne struct {
	// contains filtered or unexported fields
}

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddDocumentIDs

func (guo *GroupUpdateOne) AddDocumentIDs(ids ...uuid.UUID) *GroupUpdateOne

AddDocumentIDs adds the "documents" edge to the Document entity by IDs.

func (*GroupUpdateOne) AddDocuments

func (guo *GroupUpdateOne) AddDocuments(d ...*Document) *GroupUpdateOne

AddDocuments adds the "documents" edges to the Document entity.

func (*GroupUpdateOne) AddInvitationTokenIDs

func (guo *GroupUpdateOne) AddInvitationTokenIDs(ids ...uuid.UUID) *GroupUpdateOne

AddInvitationTokenIDs adds the "invitation_tokens" edge to the GroupInvitationToken entity by IDs.

func (*GroupUpdateOne) AddInvitationTokens

func (guo *GroupUpdateOne) AddInvitationTokens(g ...*GroupInvitationToken) *GroupUpdateOne

AddInvitationTokens adds the "invitation_tokens" edges to the GroupInvitationToken entity.

func (*GroupUpdateOne) AddItemIDs

func (guo *GroupUpdateOne) AddItemIDs(ids ...uuid.UUID) *GroupUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*GroupUpdateOne) AddItems

func (guo *GroupUpdateOne) AddItems(i ...*Item) *GroupUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*GroupUpdateOne) AddLabelIDs

func (guo *GroupUpdateOne) AddLabelIDs(ids ...uuid.UUID) *GroupUpdateOne

AddLabelIDs adds the "labels" edge to the Label entity by IDs.

func (*GroupUpdateOne) AddLabels

func (guo *GroupUpdateOne) AddLabels(l ...*Label) *GroupUpdateOne

AddLabels adds the "labels" edges to the Label entity.

func (*GroupUpdateOne) AddLocationIDs

func (guo *GroupUpdateOne) AddLocationIDs(ids ...uuid.UUID) *GroupUpdateOne

AddLocationIDs adds the "locations" edge to the Location entity by IDs.

func (*GroupUpdateOne) AddLocations

func (guo *GroupUpdateOne) AddLocations(l ...*Location) *GroupUpdateOne

AddLocations adds the "locations" edges to the Location entity.

func (*GroupUpdateOne) AddNotifierIDs

func (guo *GroupUpdateOne) AddNotifierIDs(ids ...uuid.UUID) *GroupUpdateOne

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by IDs.

func (*GroupUpdateOne) AddNotifiers

func (guo *GroupUpdateOne) AddNotifiers(n ...*Notifier) *GroupUpdateOne

AddNotifiers adds the "notifiers" edges to the Notifier entity.

func (*GroupUpdateOne) AddUserIDs

func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdateOne) AddUsers

func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdateOne) ClearDocuments

func (guo *GroupUpdateOne) ClearDocuments() *GroupUpdateOne

ClearDocuments clears all "documents" edges to the Document entity.

func (*GroupUpdateOne) ClearInvitationTokens

func (guo *GroupUpdateOne) ClearInvitationTokens() *GroupUpdateOne

ClearInvitationTokens clears all "invitation_tokens" edges to the GroupInvitationToken entity.

func (*GroupUpdateOne) ClearItems

func (guo *GroupUpdateOne) ClearItems() *GroupUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*GroupUpdateOne) ClearLabels

func (guo *GroupUpdateOne) ClearLabels() *GroupUpdateOne

ClearLabels clears all "labels" edges to the Label entity.

func (*GroupUpdateOne) ClearLocations

func (guo *GroupUpdateOne) ClearLocations() *GroupUpdateOne

ClearLocations clears all "locations" edges to the Location entity.

func (*GroupUpdateOne) ClearNotifiers

func (guo *GroupUpdateOne) ClearNotifiers() *GroupUpdateOne

ClearNotifiers clears all "notifiers" edges to the Notifier entity.

func (*GroupUpdateOne) ClearUsers

func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveDocumentIDs

func (guo *GroupUpdateOne) RemoveDocumentIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveDocumentIDs removes the "documents" edge to Document entities by IDs.

func (*GroupUpdateOne) RemoveDocuments

func (guo *GroupUpdateOne) RemoveDocuments(d ...*Document) *GroupUpdateOne

RemoveDocuments removes "documents" edges to Document entities.

func (*GroupUpdateOne) RemoveInvitationTokenIDs

func (guo *GroupUpdateOne) RemoveInvitationTokenIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveInvitationTokenIDs removes the "invitation_tokens" edge to GroupInvitationToken entities by IDs.

func (*GroupUpdateOne) RemoveInvitationTokens

func (guo *GroupUpdateOne) RemoveInvitationTokens(g ...*GroupInvitationToken) *GroupUpdateOne

RemoveInvitationTokens removes "invitation_tokens" edges to GroupInvitationToken entities.

func (*GroupUpdateOne) RemoveItemIDs

func (guo *GroupUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*GroupUpdateOne) RemoveItems

func (guo *GroupUpdateOne) RemoveItems(i ...*Item) *GroupUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*GroupUpdateOne) RemoveLabelIDs

func (guo *GroupUpdateOne) RemoveLabelIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveLabelIDs removes the "labels" edge to Label entities by IDs.

func (*GroupUpdateOne) RemoveLabels

func (guo *GroupUpdateOne) RemoveLabels(l ...*Label) *GroupUpdateOne

RemoveLabels removes "labels" edges to Label entities.

func (*GroupUpdateOne) RemoveLocationIDs

func (guo *GroupUpdateOne) RemoveLocationIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveLocationIDs removes the "locations" edge to Location entities by IDs.

func (*GroupUpdateOne) RemoveLocations

func (guo *GroupUpdateOne) RemoveLocations(l ...*Location) *GroupUpdateOne

RemoveLocations removes "locations" edges to Location entities.

func (*GroupUpdateOne) RemoveNotifierIDs

func (guo *GroupUpdateOne) RemoveNotifierIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveNotifierIDs removes the "notifiers" edge to Notifier entities by IDs.

func (*GroupUpdateOne) RemoveNotifiers

func (guo *GroupUpdateOne) RemoveNotifiers(n ...*Notifier) *GroupUpdateOne

RemoveNotifiers removes "notifiers" edges to Notifier entities.

func (*GroupUpdateOne) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdateOne) RemoveUsers

func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupUpdateOne) SetCurrency

func (guo *GroupUpdateOne) SetCurrency(s string) *GroupUpdateOne

SetCurrency sets the "currency" field.

func (*GroupUpdateOne) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetNillableCurrency

func (guo *GroupUpdateOne) SetNillableCurrency(s *string) *GroupUpdateOne

SetNillableCurrency sets the "currency" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableName

func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupUpdateOne) SetUpdatedAt

func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdateOne) Where

func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne

Where appends a list predicates to the GroupUpdate builder.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

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 Item

type Item struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// ImportRef holds the value of the "import_ref" field.
	ImportRef string `json:"import_ref,omitempty"`
	// Notes holds the value of the "notes" field.
	Notes string `json:"notes,omitempty"`
	// Quantity holds the value of the "quantity" field.
	Quantity int `json:"quantity,omitempty"`
	// Insured holds the value of the "insured" field.
	Insured bool `json:"insured,omitempty"`
	// Archived holds the value of the "archived" field.
	Archived bool `json:"archived,omitempty"`
	// AssetID holds the value of the "asset_id" field.
	AssetID int `json:"asset_id,omitempty"`
	// SerialNumber holds the value of the "serial_number" field.
	SerialNumber string `json:"serial_number,omitempty"`
	// ModelNumber holds the value of the "model_number" field.
	ModelNumber string `json:"model_number,omitempty"`
	// Manufacturer holds the value of the "manufacturer" field.
	Manufacturer string `json:"manufacturer,omitempty"`
	// LifetimeWarranty holds the value of the "lifetime_warranty" field.
	LifetimeWarranty bool `json:"lifetime_warranty,omitempty"`
	// WarrantyExpires holds the value of the "warranty_expires" field.
	WarrantyExpires time.Time `json:"warranty_expires,omitempty"`
	// WarrantyDetails holds the value of the "warranty_details" field.
	WarrantyDetails string `json:"warranty_details,omitempty"`
	// PurchaseTime holds the value of the "purchase_time" field.
	PurchaseTime time.Time `json:"purchase_time,omitempty"`
	// PurchaseFrom holds the value of the "purchase_from" field.
	PurchaseFrom string `json:"purchase_from,omitempty"`
	// PurchasePrice holds the value of the "purchase_price" field.
	PurchasePrice float64 `json:"purchase_price,omitempty"`
	// SoldTime holds the value of the "sold_time" field.
	SoldTime time.Time `json:"sold_time,omitempty"`
	// SoldTo holds the value of the "sold_to" field.
	SoldTo string `json:"sold_to,omitempty"`
	// SoldPrice holds the value of the "sold_price" field.
	SoldPrice float64 `json:"sold_price,omitempty"`
	// SoldNotes holds the value of the "sold_notes" field.
	SoldNotes string `json:"sold_notes,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemQuery when eager-loading is set.
	Edges ItemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Item is the model entity for the Item schema.

func (*Item) GetID

func (i *Item) GetID() uuid.UUID

func (*Item) QueryAttachments

func (i *Item) QueryAttachments() *AttachmentQuery

QueryAttachments queries the "attachments" edge of the Item entity.

func (*Item) QueryChildren

func (i *Item) QueryChildren() *ItemQuery

QueryChildren queries the "children" edge of the Item entity.

func (*Item) QueryFields

func (i *Item) QueryFields() *ItemFieldQuery

QueryFields queries the "fields" edge of the Item entity.

func (*Item) QueryGroup

func (i *Item) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Item entity.

func (*Item) QueryLabel

func (i *Item) QueryLabel() *LabelQuery

QueryLabel queries the "label" edge of the Item entity.

func (*Item) QueryLocation

func (i *Item) QueryLocation() *LocationQuery

QueryLocation queries the "location" edge of the Item entity.

func (*Item) QueryMaintenanceEntries

func (i *Item) QueryMaintenanceEntries() *MaintenanceEntryQuery

QueryMaintenanceEntries queries the "maintenance_entries" edge of the Item entity.

func (*Item) QueryParent

func (i *Item) QueryParent() *ItemQuery

QueryParent queries the "parent" edge of the Item entity.

func (*Item) String

func (i *Item) String() string

String implements the fmt.Stringer.

func (*Item) Unwrap

func (i *Item) Unwrap() *Item

Unwrap unwraps the Item 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 (*Item) Update

func (i *Item) Update() *ItemUpdateOne

Update returns a builder for updating this Item. Note that you need to call Item.Unwrap() before calling this method if this Item was returned from a transaction, and the transaction was committed or rolled back.

func (*Item) Value

func (i *Item) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Item. This includes values selected through modifiers, order, etc.

type ItemClient

type ItemClient struct {
	// contains filtered or unexported fields
}

ItemClient is a client for the Item schema.

func NewItemClient

func NewItemClient(c config) *ItemClient

NewItemClient returns a client for the Item from the given config.

func (*ItemClient) Create

func (c *ItemClient) Create() *ItemCreate

Create returns a builder for creating a Item entity.

func (*ItemClient) CreateBulk

func (c *ItemClient) CreateBulk(builders ...*ItemCreate) *ItemCreateBulk

CreateBulk returns a builder for creating a bulk of Item entities.

func (*ItemClient) Delete

func (c *ItemClient) Delete() *ItemDelete

Delete returns a delete builder for Item.

func (*ItemClient) DeleteOne

func (c *ItemClient) DeleteOne(i *Item) *ItemDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemClient) DeleteOneID

func (c *ItemClient) DeleteOneID(id uuid.UUID) *ItemDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ItemClient) Get

func (c *ItemClient) Get(ctx context.Context, id uuid.UUID) (*Item, error)

Get returns a Item entity by its id.

func (*ItemClient) GetX

func (c *ItemClient) GetX(ctx context.Context, id uuid.UUID) *Item

GetX is like Get, but panics if an error occurs.

func (*ItemClient) Hooks

func (c *ItemClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ItemClient) Intercept

func (c *ItemClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `item.Intercept(f(g(h())))`.

func (*ItemClient) Interceptors

func (c *ItemClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ItemClient) MapCreateBulk

func (c *ItemClient) MapCreateBulk(slice any, setFunc func(*ItemCreate, int)) *ItemCreateBulk

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 (*ItemClient) Query

func (c *ItemClient) Query() *ItemQuery

Query returns a query builder for Item.

func (*ItemClient) QueryAttachments

func (c *ItemClient) QueryAttachments(i *Item) *AttachmentQuery

QueryAttachments queries the attachments edge of a Item.

func (*ItemClient) QueryChildren

func (c *ItemClient) QueryChildren(i *Item) *ItemQuery

QueryChildren queries the children edge of a Item.

func (*ItemClient) QueryFields

func (c *ItemClient) QueryFields(i *Item) *ItemFieldQuery

QueryFields queries the fields edge of a Item.

func (*ItemClient) QueryGroup

func (c *ItemClient) QueryGroup(i *Item) *GroupQuery

QueryGroup queries the group edge of a Item.

func (*ItemClient) QueryLabel

func (c *ItemClient) QueryLabel(i *Item) *LabelQuery

QueryLabel queries the label edge of a Item.

func (*ItemClient) QueryLocation

func (c *ItemClient) QueryLocation(i *Item) *LocationQuery

QueryLocation queries the location edge of a Item.

func (*ItemClient) QueryMaintenanceEntries

func (c *ItemClient) QueryMaintenanceEntries(i *Item) *MaintenanceEntryQuery

QueryMaintenanceEntries queries the maintenance_entries edge of a Item.

func (*ItemClient) QueryParent

func (c *ItemClient) QueryParent(i *Item) *ItemQuery

QueryParent queries the parent edge of a Item.

func (*ItemClient) Update

func (c *ItemClient) Update() *ItemUpdate

Update returns an update builder for Item.

func (*ItemClient) UpdateOne

func (c *ItemClient) UpdateOne(i *Item) *ItemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemClient) UpdateOneID

func (c *ItemClient) UpdateOneID(id uuid.UUID) *ItemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemClient) Use

func (c *ItemClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `item.Hooks(f(g(h())))`.

type ItemCreate

type ItemCreate struct {
	// contains filtered or unexported fields
}

ItemCreate is the builder for creating a Item entity.

func (*ItemCreate) AddAttachmentIDs

func (ic *ItemCreate) AddAttachmentIDs(ids ...uuid.UUID) *ItemCreate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*ItemCreate) AddAttachments

func (ic *ItemCreate) AddAttachments(a ...*Attachment) *ItemCreate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*ItemCreate) AddChildIDs

func (ic *ItemCreate) AddChildIDs(ids ...uuid.UUID) *ItemCreate

AddChildIDs adds the "children" edge to the Item entity by IDs.

func (*ItemCreate) AddChildren

func (ic *ItemCreate) AddChildren(i ...*Item) *ItemCreate

AddChildren adds the "children" edges to the Item entity.

func (*ItemCreate) AddFieldIDs

func (ic *ItemCreate) AddFieldIDs(ids ...uuid.UUID) *ItemCreate

AddFieldIDs adds the "fields" edge to the ItemField entity by IDs.

func (*ItemCreate) AddFields

func (ic *ItemCreate) AddFields(i ...*ItemField) *ItemCreate

AddFields adds the "fields" edges to the ItemField entity.

func (*ItemCreate) AddLabel

func (ic *ItemCreate) AddLabel(l ...*Label) *ItemCreate

AddLabel adds the "label" edges to the Label entity.

func (*ItemCreate) AddLabelIDs

func (ic *ItemCreate) AddLabelIDs(ids ...uuid.UUID) *ItemCreate

AddLabelIDs adds the "label" edge to the Label entity by IDs.

func (*ItemCreate) AddMaintenanceEntries

func (ic *ItemCreate) AddMaintenanceEntries(m ...*MaintenanceEntry) *ItemCreate

AddMaintenanceEntries adds the "maintenance_entries" edges to the MaintenanceEntry entity.

func (*ItemCreate) AddMaintenanceEntryIDs

func (ic *ItemCreate) AddMaintenanceEntryIDs(ids ...uuid.UUID) *ItemCreate

AddMaintenanceEntryIDs adds the "maintenance_entries" edge to the MaintenanceEntry entity by IDs.

func (*ItemCreate) Exec

func (ic *ItemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreate) ExecX

func (ic *ItemCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemCreate) Mutation

func (ic *ItemCreate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemCreate) Save

func (ic *ItemCreate) Save(ctx context.Context) (*Item, error)

Save creates the Item in the database.

func (*ItemCreate) SaveX

func (ic *ItemCreate) SaveX(ctx context.Context) *Item

SaveX calls Save and panics if Save returns an error.

func (*ItemCreate) SetArchived

func (ic *ItemCreate) SetArchived(b bool) *ItemCreate

SetArchived sets the "archived" field.

func (*ItemCreate) SetAssetID

func (ic *ItemCreate) SetAssetID(i int) *ItemCreate

SetAssetID sets the "asset_id" field.

func (*ItemCreate) SetCreatedAt

func (ic *ItemCreate) SetCreatedAt(t time.Time) *ItemCreate

SetCreatedAt sets the "created_at" field.

func (*ItemCreate) SetDescription

func (ic *ItemCreate) SetDescription(s string) *ItemCreate

SetDescription sets the "description" field.

func (*ItemCreate) SetGroup

func (ic *ItemCreate) SetGroup(g *Group) *ItemCreate

SetGroup sets the "group" edge to the Group entity.

func (*ItemCreate) SetGroupID

func (ic *ItemCreate) SetGroupID(id uuid.UUID) *ItemCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*ItemCreate) SetID

func (ic *ItemCreate) SetID(u uuid.UUID) *ItemCreate

SetID sets the "id" field.

func (*ItemCreate) SetImportRef

func (ic *ItemCreate) SetImportRef(s string) *ItemCreate

SetImportRef sets the "import_ref" field.

func (*ItemCreate) SetInsured

func (ic *ItemCreate) SetInsured(b bool) *ItemCreate

SetInsured sets the "insured" field.

func (*ItemCreate) SetLifetimeWarranty

func (ic *ItemCreate) SetLifetimeWarranty(b bool) *ItemCreate

SetLifetimeWarranty sets the "lifetime_warranty" field.

func (*ItemCreate) SetLocation

func (ic *ItemCreate) SetLocation(l *Location) *ItemCreate

SetLocation sets the "location" edge to the Location entity.

func (*ItemCreate) SetLocationID

func (ic *ItemCreate) SetLocationID(id uuid.UUID) *ItemCreate

SetLocationID sets the "location" edge to the Location entity by ID.

func (*ItemCreate) SetManufacturer

func (ic *ItemCreate) SetManufacturer(s string) *ItemCreate

SetManufacturer sets the "manufacturer" field.

func (*ItemCreate) SetModelNumber

func (ic *ItemCreate) SetModelNumber(s string) *ItemCreate

SetModelNumber sets the "model_number" field.

func (*ItemCreate) SetName

func (ic *ItemCreate) SetName(s string) *ItemCreate

SetName sets the "name" field.

func (*ItemCreate) SetNillableArchived

func (ic *ItemCreate) SetNillableArchived(b *bool) *ItemCreate

SetNillableArchived sets the "archived" field if the given value is not nil.

func (*ItemCreate) SetNillableAssetID

func (ic *ItemCreate) SetNillableAssetID(i *int) *ItemCreate

SetNillableAssetID sets the "asset_id" field if the given value is not nil.

func (*ItemCreate) SetNillableCreatedAt

func (ic *ItemCreate) SetNillableCreatedAt(t *time.Time) *ItemCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ItemCreate) SetNillableDescription

func (ic *ItemCreate) SetNillableDescription(s *string) *ItemCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemCreate) SetNillableID

func (ic *ItemCreate) SetNillableID(u *uuid.UUID) *ItemCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ItemCreate) SetNillableImportRef

func (ic *ItemCreate) SetNillableImportRef(s *string) *ItemCreate

SetNillableImportRef sets the "import_ref" field if the given value is not nil.

func (*ItemCreate) SetNillableInsured

func (ic *ItemCreate) SetNillableInsured(b *bool) *ItemCreate

SetNillableInsured sets the "insured" field if the given value is not nil.

func (*ItemCreate) SetNillableLifetimeWarranty

func (ic *ItemCreate) SetNillableLifetimeWarranty(b *bool) *ItemCreate

SetNillableLifetimeWarranty sets the "lifetime_warranty" field if the given value is not nil.

func (*ItemCreate) SetNillableLocationID

func (ic *ItemCreate) SetNillableLocationID(id *uuid.UUID) *ItemCreate

SetNillableLocationID sets the "location" edge to the Location entity by ID if the given value is not nil.

func (*ItemCreate) SetNillableManufacturer

func (ic *ItemCreate) SetNillableManufacturer(s *string) *ItemCreate

SetNillableManufacturer sets the "manufacturer" field if the given value is not nil.

func (*ItemCreate) SetNillableModelNumber

func (ic *ItemCreate) SetNillableModelNumber(s *string) *ItemCreate

SetNillableModelNumber sets the "model_number" field if the given value is not nil.

func (*ItemCreate) SetNillableNotes

func (ic *ItemCreate) SetNillableNotes(s *string) *ItemCreate

SetNillableNotes sets the "notes" field if the given value is not nil.

func (*ItemCreate) SetNillableParentID

func (ic *ItemCreate) SetNillableParentID(id *uuid.UUID) *ItemCreate

SetNillableParentID sets the "parent" edge to the Item entity by ID if the given value is not nil.

func (*ItemCreate) SetNillablePurchaseFrom

func (ic *ItemCreate) SetNillablePurchaseFrom(s *string) *ItemCreate

SetNillablePurchaseFrom sets the "purchase_from" field if the given value is not nil.

func (*ItemCreate) SetNillablePurchasePrice

func (ic *ItemCreate) SetNillablePurchasePrice(f *float64) *ItemCreate

SetNillablePurchasePrice sets the "purchase_price" field if the given value is not nil.

func (*ItemCreate) SetNillablePurchaseTime

func (ic *ItemCreate) SetNillablePurchaseTime(t *time.Time) *ItemCreate

SetNillablePurchaseTime sets the "purchase_time" field if the given value is not nil.

func (*ItemCreate) SetNillableQuantity

func (ic *ItemCreate) SetNillableQuantity(i *int) *ItemCreate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*ItemCreate) SetNillableSerialNumber

func (ic *ItemCreate) SetNillableSerialNumber(s *string) *ItemCreate

SetNillableSerialNumber sets the "serial_number" field if the given value is not nil.

func (*ItemCreate) SetNillableSoldNotes

func (ic *ItemCreate) SetNillableSoldNotes(s *string) *ItemCreate

SetNillableSoldNotes sets the "sold_notes" field if the given value is not nil.

func (*ItemCreate) SetNillableSoldPrice

func (ic *ItemCreate) SetNillableSoldPrice(f *float64) *ItemCreate

SetNillableSoldPrice sets the "sold_price" field if the given value is not nil.

func (*ItemCreate) SetNillableSoldTime

func (ic *ItemCreate) SetNillableSoldTime(t *time.Time) *ItemCreate

SetNillableSoldTime sets the "sold_time" field if the given value is not nil.

func (*ItemCreate) SetNillableSoldTo

func (ic *ItemCreate) SetNillableSoldTo(s *string) *ItemCreate

SetNillableSoldTo sets the "sold_to" field if the given value is not nil.

func (*ItemCreate) SetNillableUpdatedAt

func (ic *ItemCreate) SetNillableUpdatedAt(t *time.Time) *ItemCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ItemCreate) SetNillableWarrantyDetails

func (ic *ItemCreate) SetNillableWarrantyDetails(s *string) *ItemCreate

SetNillableWarrantyDetails sets the "warranty_details" field if the given value is not nil.

func (*ItemCreate) SetNillableWarrantyExpires

func (ic *ItemCreate) SetNillableWarrantyExpires(t *time.Time) *ItemCreate

SetNillableWarrantyExpires sets the "warranty_expires" field if the given value is not nil.

func (*ItemCreate) SetNotes

func (ic *ItemCreate) SetNotes(s string) *ItemCreate

SetNotes sets the "notes" field.

func (*ItemCreate) SetParent

func (ic *ItemCreate) SetParent(i *Item) *ItemCreate

SetParent sets the "parent" edge to the Item entity.

func (*ItemCreate) SetParentID

func (ic *ItemCreate) SetParentID(id uuid.UUID) *ItemCreate

SetParentID sets the "parent" edge to the Item entity by ID.

func (*ItemCreate) SetPurchaseFrom

func (ic *ItemCreate) SetPurchaseFrom(s string) *ItemCreate

SetPurchaseFrom sets the "purchase_from" field.

func (*ItemCreate) SetPurchasePrice

func (ic *ItemCreate) SetPurchasePrice(f float64) *ItemCreate

SetPurchasePrice sets the "purchase_price" field.

func (*ItemCreate) SetPurchaseTime

func (ic *ItemCreate) SetPurchaseTime(t time.Time) *ItemCreate

SetPurchaseTime sets the "purchase_time" field.

func (*ItemCreate) SetQuantity

func (ic *ItemCreate) SetQuantity(i int) *ItemCreate

SetQuantity sets the "quantity" field.

func (*ItemCreate) SetSerialNumber

func (ic *ItemCreate) SetSerialNumber(s string) *ItemCreate

SetSerialNumber sets the "serial_number" field.

func (*ItemCreate) SetSoldNotes

func (ic *ItemCreate) SetSoldNotes(s string) *ItemCreate

SetSoldNotes sets the "sold_notes" field.

func (*ItemCreate) SetSoldPrice

func (ic *ItemCreate) SetSoldPrice(f float64) *ItemCreate

SetSoldPrice sets the "sold_price" field.

func (*ItemCreate) SetSoldTime

func (ic *ItemCreate) SetSoldTime(t time.Time) *ItemCreate

SetSoldTime sets the "sold_time" field.

func (*ItemCreate) SetSoldTo

func (ic *ItemCreate) SetSoldTo(s string) *ItemCreate

SetSoldTo sets the "sold_to" field.

func (*ItemCreate) SetUpdatedAt

func (ic *ItemCreate) SetUpdatedAt(t time.Time) *ItemCreate

SetUpdatedAt sets the "updated_at" field.

func (*ItemCreate) SetWarrantyDetails

func (ic *ItemCreate) SetWarrantyDetails(s string) *ItemCreate

SetWarrantyDetails sets the "warranty_details" field.

func (*ItemCreate) SetWarrantyExpires

func (ic *ItemCreate) SetWarrantyExpires(t time.Time) *ItemCreate

SetWarrantyExpires sets the "warranty_expires" field.

type ItemCreateBulk

type ItemCreateBulk struct {
	// contains filtered or unexported fields
}

ItemCreateBulk is the builder for creating many Item entities in bulk.

func (*ItemCreateBulk) Exec

func (icb *ItemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemCreateBulk) ExecX

func (icb *ItemCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemCreateBulk) Save

func (icb *ItemCreateBulk) Save(ctx context.Context) ([]*Item, error)

Save creates the Item entities in the database.

func (*ItemCreateBulk) SaveX

func (icb *ItemCreateBulk) SaveX(ctx context.Context) []*Item

SaveX is like Save, but panics if an error occurs.

type ItemDelete

type ItemDelete struct {
	// contains filtered or unexported fields
}

ItemDelete is the builder for deleting a Item entity.

func (*ItemDelete) Exec

func (id *ItemDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ItemDelete) ExecX

func (id *ItemDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ItemDelete) Where

func (id *ItemDelete) Where(ps ...predicate.Item) *ItemDelete

Where appends a list predicates to the ItemDelete builder.

type ItemDeleteOne

type ItemDeleteOne struct {
	// contains filtered or unexported fields
}

ItemDeleteOne is the builder for deleting a single Item entity.

func (*ItemDeleteOne) Exec

func (ido *ItemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemDeleteOne) ExecX

func (ido *ItemDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemDeleteOne) Where

func (ido *ItemDeleteOne) Where(ps ...predicate.Item) *ItemDeleteOne

Where appends a list predicates to the ItemDelete builder.

type ItemEdges

type ItemEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *Item `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Item `json:"children,omitempty"`
	// Label holds the value of the label edge.
	Label []*Label `json:"label,omitempty"`
	// Location holds the value of the location edge.
	Location *Location `json:"location,omitempty"`
	// Fields holds the value of the fields edge.
	Fields []*ItemField `json:"fields,omitempty"`
	// MaintenanceEntries holds the value of the maintenance_entries edge.
	MaintenanceEntries []*MaintenanceEntry `json:"maintenance_entries,omitempty"`
	// Attachments holds the value of the attachments edge.
	Attachments []*Attachment `json:"attachments,omitempty"`
	// contains filtered or unexported fields
}

ItemEdges holds the relations/edges for other nodes in the graph.

func (ItemEdges) AttachmentsOrErr

func (e ItemEdges) AttachmentsOrErr() ([]*Attachment, error)

AttachmentsOrErr returns the Attachments value or an error if the edge was not loaded in eager-loading.

func (ItemEdges) ChildrenOrErr

func (e ItemEdges) ChildrenOrErr() ([]*Item, error)

ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.

func (ItemEdges) FieldsOrErr

func (e ItemEdges) FieldsOrErr() ([]*ItemField, error)

FieldsOrErr returns the Fields value or an error if the edge was not loaded in eager-loading.

func (ItemEdges) GroupOrErr

func (e ItemEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ItemEdges) LabelOrErr

func (e ItemEdges) LabelOrErr() ([]*Label, error)

LabelOrErr returns the Label value or an error if the edge was not loaded in eager-loading.

func (ItemEdges) LocationOrErr

func (e ItemEdges) LocationOrErr() (*Location, error)

LocationOrErr returns the Location value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ItemEdges) MaintenanceEntriesOrErr

func (e ItemEdges) MaintenanceEntriesOrErr() ([]*MaintenanceEntry, error)

MaintenanceEntriesOrErr returns the MaintenanceEntries value or an error if the edge was not loaded in eager-loading.

func (ItemEdges) ParentOrErr

func (e ItemEdges) ParentOrErr() (*Item, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ItemField

type ItemField struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Type holds the value of the "type" field.
	Type itemfield.Type `json:"type,omitempty"`
	// TextValue holds the value of the "text_value" field.
	TextValue string `json:"text_value,omitempty"`
	// NumberValue holds the value of the "number_value" field.
	NumberValue int `json:"number_value,omitempty"`
	// BooleanValue holds the value of the "boolean_value" field.
	BooleanValue bool `json:"boolean_value,omitempty"`
	// TimeValue holds the value of the "time_value" field.
	TimeValue time.Time `json:"time_value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ItemFieldQuery when eager-loading is set.
	Edges ItemFieldEdges `json:"edges"`
	// contains filtered or unexported fields
}

ItemField is the model entity for the ItemField schema.

func (*ItemField) GetID

func (_if *ItemField) GetID() uuid.UUID

func (*ItemField) QueryItem

func (_if *ItemField) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the ItemField entity.

func (*ItemField) String

func (_if *ItemField) String() string

String implements the fmt.Stringer.

func (*ItemField) Unwrap

func (_if *ItemField) Unwrap() *ItemField

Unwrap unwraps the ItemField 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 (*ItemField) Update

func (_if *ItemField) Update() *ItemFieldUpdateOne

Update returns a builder for updating this ItemField. Note that you need to call ItemField.Unwrap() before calling this method if this ItemField was returned from a transaction, and the transaction was committed or rolled back.

func (*ItemField) Value

func (_if *ItemField) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the ItemField. This includes values selected through modifiers, order, etc.

type ItemFieldClient

type ItemFieldClient struct {
	// contains filtered or unexported fields
}

ItemFieldClient is a client for the ItemField schema.

func NewItemFieldClient

func NewItemFieldClient(c config) *ItemFieldClient

NewItemFieldClient returns a client for the ItemField from the given config.

func (*ItemFieldClient) Create

func (c *ItemFieldClient) Create() *ItemFieldCreate

Create returns a builder for creating a ItemField entity.

func (*ItemFieldClient) CreateBulk

func (c *ItemFieldClient) CreateBulk(builders ...*ItemFieldCreate) *ItemFieldCreateBulk

CreateBulk returns a builder for creating a bulk of ItemField entities.

func (*ItemFieldClient) Delete

func (c *ItemFieldClient) Delete() *ItemFieldDelete

Delete returns a delete builder for ItemField.

func (*ItemFieldClient) DeleteOne

func (c *ItemFieldClient) DeleteOne(_if *ItemField) *ItemFieldDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ItemFieldClient) DeleteOneID

func (c *ItemFieldClient) DeleteOneID(id uuid.UUID) *ItemFieldDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ItemFieldClient) Get

func (c *ItemFieldClient) Get(ctx context.Context, id uuid.UUID) (*ItemField, error)

Get returns a ItemField entity by its id.

func (*ItemFieldClient) GetX

func (c *ItemFieldClient) GetX(ctx context.Context, id uuid.UUID) *ItemField

GetX is like Get, but panics if an error occurs.

func (*ItemFieldClient) Hooks

func (c *ItemFieldClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ItemFieldClient) Intercept

func (c *ItemFieldClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `itemfield.Intercept(f(g(h())))`.

func (*ItemFieldClient) Interceptors

func (c *ItemFieldClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ItemFieldClient) MapCreateBulk

func (c *ItemFieldClient) MapCreateBulk(slice any, setFunc func(*ItemFieldCreate, int)) *ItemFieldCreateBulk

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 (*ItemFieldClient) Query

func (c *ItemFieldClient) Query() *ItemFieldQuery

Query returns a query builder for ItemField.

func (*ItemFieldClient) QueryItem

func (c *ItemFieldClient) QueryItem(_if *ItemField) *ItemQuery

QueryItem queries the item edge of a ItemField.

func (*ItemFieldClient) Update

func (c *ItemFieldClient) Update() *ItemFieldUpdate

Update returns an update builder for ItemField.

func (*ItemFieldClient) UpdateOne

func (c *ItemFieldClient) UpdateOne(_if *ItemField) *ItemFieldUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ItemFieldClient) UpdateOneID

func (c *ItemFieldClient) UpdateOneID(id uuid.UUID) *ItemFieldUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ItemFieldClient) Use

func (c *ItemFieldClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `itemfield.Hooks(f(g(h())))`.

type ItemFieldCreate

type ItemFieldCreate struct {
	// contains filtered or unexported fields
}

ItemFieldCreate is the builder for creating a ItemField entity.

func (*ItemFieldCreate) Exec

func (ifc *ItemFieldCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemFieldCreate) ExecX

func (ifc *ItemFieldCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemFieldCreate) Mutation

func (ifc *ItemFieldCreate) Mutation() *ItemFieldMutation

Mutation returns the ItemFieldMutation object of the builder.

func (*ItemFieldCreate) Save

func (ifc *ItemFieldCreate) Save(ctx context.Context) (*ItemField, error)

Save creates the ItemField in the database.

func (*ItemFieldCreate) SaveX

func (ifc *ItemFieldCreate) SaveX(ctx context.Context) *ItemField

SaveX calls Save and panics if Save returns an error.

func (*ItemFieldCreate) SetBooleanValue

func (ifc *ItemFieldCreate) SetBooleanValue(b bool) *ItemFieldCreate

SetBooleanValue sets the "boolean_value" field.

func (*ItemFieldCreate) SetCreatedAt

func (ifc *ItemFieldCreate) SetCreatedAt(t time.Time) *ItemFieldCreate

SetCreatedAt sets the "created_at" field.

func (*ItemFieldCreate) SetDescription

func (ifc *ItemFieldCreate) SetDescription(s string) *ItemFieldCreate

SetDescription sets the "description" field.

func (*ItemFieldCreate) SetID

func (ifc *ItemFieldCreate) SetID(u uuid.UUID) *ItemFieldCreate

SetID sets the "id" field.

func (*ItemFieldCreate) SetItem

func (ifc *ItemFieldCreate) SetItem(i *Item) *ItemFieldCreate

SetItem sets the "item" edge to the Item entity.

func (*ItemFieldCreate) SetItemID

func (ifc *ItemFieldCreate) SetItemID(id uuid.UUID) *ItemFieldCreate

SetItemID sets the "item" edge to the Item entity by ID.

func (*ItemFieldCreate) SetName

func (ifc *ItemFieldCreate) SetName(s string) *ItemFieldCreate

SetName sets the "name" field.

func (*ItemFieldCreate) SetNillableBooleanValue

func (ifc *ItemFieldCreate) SetNillableBooleanValue(b *bool) *ItemFieldCreate

SetNillableBooleanValue sets the "boolean_value" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableCreatedAt

func (ifc *ItemFieldCreate) SetNillableCreatedAt(t *time.Time) *ItemFieldCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableDescription

func (ifc *ItemFieldCreate) SetNillableDescription(s *string) *ItemFieldCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableID

func (ifc *ItemFieldCreate) SetNillableID(u *uuid.UUID) *ItemFieldCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableItemID

func (ifc *ItemFieldCreate) SetNillableItemID(id *uuid.UUID) *ItemFieldCreate

SetNillableItemID sets the "item" edge to the Item entity by ID if the given value is not nil.

func (*ItemFieldCreate) SetNillableNumberValue

func (ifc *ItemFieldCreate) SetNillableNumberValue(i *int) *ItemFieldCreate

SetNillableNumberValue sets the "number_value" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableTextValue

func (ifc *ItemFieldCreate) SetNillableTextValue(s *string) *ItemFieldCreate

SetNillableTextValue sets the "text_value" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableTimeValue

func (ifc *ItemFieldCreate) SetNillableTimeValue(t *time.Time) *ItemFieldCreate

SetNillableTimeValue sets the "time_value" field if the given value is not nil.

func (*ItemFieldCreate) SetNillableUpdatedAt

func (ifc *ItemFieldCreate) SetNillableUpdatedAt(t *time.Time) *ItemFieldCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ItemFieldCreate) SetNumberValue

func (ifc *ItemFieldCreate) SetNumberValue(i int) *ItemFieldCreate

SetNumberValue sets the "number_value" field.

func (*ItemFieldCreate) SetTextValue

func (ifc *ItemFieldCreate) SetTextValue(s string) *ItemFieldCreate

SetTextValue sets the "text_value" field.

func (*ItemFieldCreate) SetTimeValue

func (ifc *ItemFieldCreate) SetTimeValue(t time.Time) *ItemFieldCreate

SetTimeValue sets the "time_value" field.

func (*ItemFieldCreate) SetType

func (ifc *ItemFieldCreate) SetType(i itemfield.Type) *ItemFieldCreate

SetType sets the "type" field.

func (*ItemFieldCreate) SetUpdatedAt

func (ifc *ItemFieldCreate) SetUpdatedAt(t time.Time) *ItemFieldCreate

SetUpdatedAt sets the "updated_at" field.

type ItemFieldCreateBulk

type ItemFieldCreateBulk struct {
	// contains filtered or unexported fields
}

ItemFieldCreateBulk is the builder for creating many ItemField entities in bulk.

func (*ItemFieldCreateBulk) Exec

func (ifcb *ItemFieldCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemFieldCreateBulk) ExecX

func (ifcb *ItemFieldCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemFieldCreateBulk) Save

func (ifcb *ItemFieldCreateBulk) Save(ctx context.Context) ([]*ItemField, error)

Save creates the ItemField entities in the database.

func (*ItemFieldCreateBulk) SaveX

func (ifcb *ItemFieldCreateBulk) SaveX(ctx context.Context) []*ItemField

SaveX is like Save, but panics if an error occurs.

type ItemFieldDelete

type ItemFieldDelete struct {
	// contains filtered or unexported fields
}

ItemFieldDelete is the builder for deleting a ItemField entity.

func (*ItemFieldDelete) Exec

func (ifd *ItemFieldDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ItemFieldDelete) ExecX

func (ifd *ItemFieldDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ItemFieldDelete) Where

Where appends a list predicates to the ItemFieldDelete builder.

type ItemFieldDeleteOne

type ItemFieldDeleteOne struct {
	// contains filtered or unexported fields
}

ItemFieldDeleteOne is the builder for deleting a single ItemField entity.

func (*ItemFieldDeleteOne) Exec

func (ifdo *ItemFieldDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ItemFieldDeleteOne) ExecX

func (ifdo *ItemFieldDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemFieldDeleteOne) Where

Where appends a list predicates to the ItemFieldDelete builder.

type ItemFieldEdges

type ItemFieldEdges struct {
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// contains filtered or unexported fields
}

ItemFieldEdges holds the relations/edges for other nodes in the graph.

func (ItemFieldEdges) ItemOrErr

func (e ItemFieldEdges) ItemOrErr() (*Item, error)

ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ItemFieldGroupBy

type ItemFieldGroupBy struct {
	// contains filtered or unexported fields
}

ItemFieldGroupBy is the group-by builder for ItemField entities.

func (*ItemFieldGroupBy) Aggregate

func (ifgb *ItemFieldGroupBy) Aggregate(fns ...AggregateFunc) *ItemFieldGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ItemFieldGroupBy) Bool

func (s *ItemFieldGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) BoolX

func (s *ItemFieldGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ItemFieldGroupBy) Bools

func (s *ItemFieldGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) BoolsX

func (s *ItemFieldGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ItemFieldGroupBy) Float64

func (s *ItemFieldGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) Float64X

func (s *ItemFieldGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ItemFieldGroupBy) Float64s

func (s *ItemFieldGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) Float64sX

func (s *ItemFieldGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ItemFieldGroupBy) Int

func (s *ItemFieldGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) IntX

func (s *ItemFieldGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ItemFieldGroupBy) Ints

func (s *ItemFieldGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) IntsX

func (s *ItemFieldGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ItemFieldGroupBy) Scan

func (ifgb *ItemFieldGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ItemFieldGroupBy) ScanX

func (s *ItemFieldGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ItemFieldGroupBy) String

func (s *ItemFieldGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) StringX

func (s *ItemFieldGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ItemFieldGroupBy) Strings

func (s *ItemFieldGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ItemFieldGroupBy) StringsX

func (s *ItemFieldGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ItemFieldMutation

type ItemFieldMutation struct {
	// contains filtered or unexported fields
}

ItemFieldMutation represents an operation that mutates the ItemField nodes in the graph.

func (*ItemFieldMutation) AddField

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) AddNumberValue

func (m *ItemFieldMutation) AddNumberValue(i int)

AddNumberValue adds i to the "number_value" field.

func (*ItemFieldMutation) AddedEdges

func (m *ItemFieldMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ItemFieldMutation) AddedField

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) AddedFields

func (m *ItemFieldMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ItemFieldMutation) AddedIDs

func (m *ItemFieldMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ItemFieldMutation) AddedNumberValue

func (m *ItemFieldMutation) AddedNumberValue() (r int, exists bool)

AddedNumberValue returns the value that was added to the "number_value" field in this mutation.

func (*ItemFieldMutation) BooleanValue

func (m *ItemFieldMutation) BooleanValue() (r bool, exists bool)

BooleanValue returns the value of the "boolean_value" field in the mutation.

func (*ItemFieldMutation) ClearDescription

func (m *ItemFieldMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ItemFieldMutation) ClearEdge

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) ClearField

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) ClearItem

func (m *ItemFieldMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*ItemFieldMutation) ClearNumberValue

func (m *ItemFieldMutation) ClearNumberValue()

ClearNumberValue clears the value of the "number_value" field.

func (*ItemFieldMutation) ClearTextValue

func (m *ItemFieldMutation) ClearTextValue()

ClearTextValue clears the value of the "text_value" field.

func (*ItemFieldMutation) ClearedEdges

func (m *ItemFieldMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ItemFieldMutation) ClearedFields

func (m *ItemFieldMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ItemFieldMutation) Client

func (m ItemFieldMutation) 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 (*ItemFieldMutation) CreatedAt

func (m *ItemFieldMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ItemFieldMutation) Description

func (m *ItemFieldMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ItemFieldMutation) DescriptionCleared

func (m *ItemFieldMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ItemFieldMutation) EdgeCleared

func (m *ItemFieldMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ItemFieldMutation) Field

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) FieldCleared

func (m *ItemFieldMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ItemFieldMutation) Fields

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) GetType

func (m *ItemFieldMutation) GetType() (r itemfield.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ItemFieldMutation) ID

func (m *ItemFieldMutation) ID() (id uuid.UUID, 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 (*ItemFieldMutation) IDs

func (m *ItemFieldMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ItemFieldMutation) ItemCleared

func (m *ItemFieldMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*ItemFieldMutation) ItemID

func (m *ItemFieldMutation) ItemID() (id uuid.UUID, exists bool)

ItemID returns the "item" edge ID in the mutation.

func (*ItemFieldMutation) ItemIDs

func (m *ItemFieldMutation) ItemIDs() (ids []uuid.UUID)

ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.

func (*ItemFieldMutation) Name

func (m *ItemFieldMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ItemFieldMutation) NumberValue

func (m *ItemFieldMutation) NumberValue() (r int, exists bool)

NumberValue returns the value of the "number_value" field in the mutation.

func (*ItemFieldMutation) NumberValueCleared

func (m *ItemFieldMutation) NumberValueCleared() bool

NumberValueCleared returns if the "number_value" field was cleared in this mutation.

func (*ItemFieldMutation) OldBooleanValue

func (m *ItemFieldMutation) OldBooleanValue(ctx context.Context) (v bool, err error)

OldBooleanValue returns the old "boolean_value" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldCreatedAt

func (m *ItemFieldMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldDescription

func (m *ItemFieldMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldField

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) OldName

func (m *ItemFieldMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldNumberValue

func (m *ItemFieldMutation) OldNumberValue(ctx context.Context) (v int, err error)

OldNumberValue returns the old "number_value" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldTextValue

func (m *ItemFieldMutation) OldTextValue(ctx context.Context) (v string, err error)

OldTextValue returns the old "text_value" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldTimeValue

func (m *ItemFieldMutation) OldTimeValue(ctx context.Context) (v time.Time, err error)

OldTimeValue returns the old "time_value" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldType

func (m *ItemFieldMutation) OldType(ctx context.Context) (v itemfield.Type, err error)

OldType returns the old "type" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) OldUpdatedAt

func (m *ItemFieldMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the ItemField entity. If the ItemField object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemFieldMutation) Op

func (m *ItemFieldMutation) Op() Op

Op returns the operation name.

func (*ItemFieldMutation) RemovedEdges

func (m *ItemFieldMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ItemFieldMutation) RemovedIDs

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) ResetBooleanValue

func (m *ItemFieldMutation) ResetBooleanValue()

ResetBooleanValue resets all changes to the "boolean_value" field.

func (*ItemFieldMutation) ResetCreatedAt

func (m *ItemFieldMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ItemFieldMutation) ResetDescription

func (m *ItemFieldMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ItemFieldMutation) ResetEdge

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) ResetField

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) ResetItem

func (m *ItemFieldMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*ItemFieldMutation) ResetName

func (m *ItemFieldMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ItemFieldMutation) ResetNumberValue

func (m *ItemFieldMutation) ResetNumberValue()

ResetNumberValue resets all changes to the "number_value" field.

func (*ItemFieldMutation) ResetTextValue

func (m *ItemFieldMutation) ResetTextValue()

ResetTextValue resets all changes to the "text_value" field.

func (*ItemFieldMutation) ResetTimeValue

func (m *ItemFieldMutation) ResetTimeValue()

ResetTimeValue resets all changes to the "time_value" field.

func (*ItemFieldMutation) ResetType

func (m *ItemFieldMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ItemFieldMutation) ResetUpdatedAt

func (m *ItemFieldMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ItemFieldMutation) SetBooleanValue

func (m *ItemFieldMutation) SetBooleanValue(b bool)

SetBooleanValue sets the "boolean_value" field.

func (*ItemFieldMutation) SetCreatedAt

func (m *ItemFieldMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ItemFieldMutation) SetDescription

func (m *ItemFieldMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ItemFieldMutation) SetField

func (m *ItemFieldMutation) 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 (*ItemFieldMutation) SetID

func (m *ItemFieldMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of ItemField entities.

func (*ItemFieldMutation) SetItemID

func (m *ItemFieldMutation) SetItemID(id uuid.UUID)

SetItemID sets the "item" edge to the Item entity by id.

func (*ItemFieldMutation) SetName

func (m *ItemFieldMutation) SetName(s string)

SetName sets the "name" field.

func (*ItemFieldMutation) SetNumberValue

func (m *ItemFieldMutation) SetNumberValue(i int)

SetNumberValue sets the "number_value" field.

func (*ItemFieldMutation) SetOp

func (m *ItemFieldMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ItemFieldMutation) SetTextValue

func (m *ItemFieldMutation) SetTextValue(s string)

SetTextValue sets the "text_value" field.

func (*ItemFieldMutation) SetTimeValue

func (m *ItemFieldMutation) SetTimeValue(t time.Time)

SetTimeValue sets the "time_value" field.

func (*ItemFieldMutation) SetType

func (m *ItemFieldMutation) SetType(i itemfield.Type)

SetType sets the "type" field.

func (*ItemFieldMutation) SetUpdatedAt

func (m *ItemFieldMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ItemFieldMutation) TextValue

func (m *ItemFieldMutation) TextValue() (r string, exists bool)

TextValue returns the value of the "text_value" field in the mutation.

func (*ItemFieldMutation) TextValueCleared

func (m *ItemFieldMutation) TextValueCleared() bool

TextValueCleared returns if the "text_value" field was cleared in this mutation.

func (*ItemFieldMutation) TimeValue

func (m *ItemFieldMutation) TimeValue() (r time.Time, exists bool)

TimeValue returns the value of the "time_value" field in the mutation.

func (ItemFieldMutation) Tx

func (m ItemFieldMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ItemFieldMutation) Type

func (m *ItemFieldMutation) Type() string

Type returns the node type of this mutation (ItemField).

func (*ItemFieldMutation) UpdatedAt

func (m *ItemFieldMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ItemFieldMutation) Where

func (m *ItemFieldMutation) Where(ps ...predicate.ItemField)

Where appends a list predicates to the ItemFieldMutation builder.

func (*ItemFieldMutation) WhereP

func (m *ItemFieldMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ItemFieldMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ItemFieldQuery

type ItemFieldQuery struct {
	// contains filtered or unexported fields
}

ItemFieldQuery is the builder for querying ItemField entities.

func (*ItemFieldQuery) Aggregate

func (ifq *ItemFieldQuery) Aggregate(fns ...AggregateFunc) *ItemFieldSelect

Aggregate returns a ItemFieldSelect configured with the given aggregations.

func (*ItemFieldQuery) All

func (ifq *ItemFieldQuery) All(ctx context.Context) ([]*ItemField, error)

All executes the query and returns a list of ItemFields.

func (*ItemFieldQuery) AllX

func (ifq *ItemFieldQuery) AllX(ctx context.Context) []*ItemField

AllX is like All, but panics if an error occurs.

func (*ItemFieldQuery) Clone

func (ifq *ItemFieldQuery) Clone() *ItemFieldQuery

Clone returns a duplicate of the ItemFieldQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ItemFieldQuery) Count

func (ifq *ItemFieldQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemFieldQuery) CountX

func (ifq *ItemFieldQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ItemFieldQuery) Exist

func (ifq *ItemFieldQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ItemFieldQuery) ExistX

func (ifq *ItemFieldQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ItemFieldQuery) First

func (ifq *ItemFieldQuery) First(ctx context.Context) (*ItemField, error)

First returns the first ItemField entity from the query. Returns a *NotFoundError when no ItemField was found.

func (*ItemFieldQuery) FirstID

func (ifq *ItemFieldQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first ItemField ID from the query. Returns a *NotFoundError when no ItemField ID was found.

func (*ItemFieldQuery) FirstIDX

func (ifq *ItemFieldQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ItemFieldQuery) FirstX

func (ifq *ItemFieldQuery) FirstX(ctx context.Context) *ItemField

FirstX is like First, but panics if an error occurs.

func (*ItemFieldQuery) GroupBy

func (ifq *ItemFieldQuery) GroupBy(field string, fields ...string) *ItemFieldGroupBy

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.ItemField.Query().
	GroupBy(itemfield.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemFieldQuery) IDs

func (ifq *ItemFieldQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of ItemField IDs.

func (*ItemFieldQuery) IDsX

func (ifq *ItemFieldQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ItemFieldQuery) Limit

func (ifq *ItemFieldQuery) Limit(limit int) *ItemFieldQuery

Limit the number of records to be returned by this query.

func (*ItemFieldQuery) Offset

func (ifq *ItemFieldQuery) Offset(offset int) *ItemFieldQuery

Offset to start from.

func (*ItemFieldQuery) Only

func (ifq *ItemFieldQuery) Only(ctx context.Context) (*ItemField, error)

Only returns a single ItemField entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ItemField entity is found. Returns a *NotFoundError when no ItemField entities are found.

func (*ItemFieldQuery) OnlyID

func (ifq *ItemFieldQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only ItemField ID in the query. Returns a *NotSingularError when more than one ItemField ID is found. Returns a *NotFoundError when no entities are found.

func (*ItemFieldQuery) OnlyIDX

func (ifq *ItemFieldQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ItemFieldQuery) OnlyX

func (ifq *ItemFieldQuery) OnlyX(ctx context.Context) *ItemField

OnlyX is like Only, but panics if an error occurs.

func (*ItemFieldQuery) Order

Order specifies how the records should be ordered.

func (*ItemFieldQuery) QueryItem

func (ifq *ItemFieldQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*ItemFieldQuery) Select

func (ifq *ItemFieldQuery) Select(fields ...string) *ItemFieldSelect

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.ItemField.Query().
	Select(itemfield.FieldCreatedAt).
	Scan(ctx, &v)

func (*ItemFieldQuery) Unique

func (ifq *ItemFieldQuery) Unique(unique bool) *ItemFieldQuery

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 (*ItemFieldQuery) Where

func (ifq *ItemFieldQuery) Where(ps ...predicate.ItemField) *ItemFieldQuery

Where adds a new predicate for the ItemFieldQuery builder.

func (*ItemFieldQuery) WithItem

func (ifq *ItemFieldQuery) WithItem(opts ...func(*ItemQuery)) *ItemFieldQuery

WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.

type ItemFieldSelect

type ItemFieldSelect struct {
	*ItemFieldQuery
	// contains filtered or unexported fields
}

ItemFieldSelect is the builder for selecting fields of ItemField entities.

func (*ItemFieldSelect) Aggregate

func (ifs *ItemFieldSelect) Aggregate(fns ...AggregateFunc) *ItemFieldSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ItemFieldSelect) Bool

func (s *ItemFieldSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) BoolX

func (s *ItemFieldSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ItemFieldSelect) Bools

func (s *ItemFieldSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) BoolsX

func (s *ItemFieldSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ItemFieldSelect) Float64

func (s *ItemFieldSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) Float64X

func (s *ItemFieldSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ItemFieldSelect) Float64s

func (s *ItemFieldSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) Float64sX

func (s *ItemFieldSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ItemFieldSelect) Int

func (s *ItemFieldSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) IntX

func (s *ItemFieldSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ItemFieldSelect) Ints

func (s *ItemFieldSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) IntsX

func (s *ItemFieldSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ItemFieldSelect) Scan

func (ifs *ItemFieldSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ItemFieldSelect) ScanX

func (s *ItemFieldSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ItemFieldSelect) String

func (s *ItemFieldSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) StringX

func (s *ItemFieldSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ItemFieldSelect) Strings

func (s *ItemFieldSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ItemFieldSelect) StringsX

func (s *ItemFieldSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ItemFieldUpdate

type ItemFieldUpdate struct {
	// contains filtered or unexported fields
}

ItemFieldUpdate is the builder for updating ItemField entities.

func (*ItemFieldUpdate) AddNumberValue

func (ifu *ItemFieldUpdate) AddNumberValue(i int) *ItemFieldUpdate

AddNumberValue adds i to the "number_value" field.

func (*ItemFieldUpdate) ClearDescription

func (ifu *ItemFieldUpdate) ClearDescription() *ItemFieldUpdate

ClearDescription clears the value of the "description" field.

func (*ItemFieldUpdate) ClearItem

func (ifu *ItemFieldUpdate) ClearItem() *ItemFieldUpdate

ClearItem clears the "item" edge to the Item entity.

func (*ItemFieldUpdate) ClearNumberValue

func (ifu *ItemFieldUpdate) ClearNumberValue() *ItemFieldUpdate

ClearNumberValue clears the value of the "number_value" field.

func (*ItemFieldUpdate) ClearTextValue

func (ifu *ItemFieldUpdate) ClearTextValue() *ItemFieldUpdate

ClearTextValue clears the value of the "text_value" field.

func (*ItemFieldUpdate) Exec

func (ifu *ItemFieldUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemFieldUpdate) ExecX

func (ifu *ItemFieldUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemFieldUpdate) Mutation

func (ifu *ItemFieldUpdate) Mutation() *ItemFieldMutation

Mutation returns the ItemFieldMutation object of the builder.

func (*ItemFieldUpdate) Save

func (ifu *ItemFieldUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ItemFieldUpdate) SaveX

func (ifu *ItemFieldUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ItemFieldUpdate) SetBooleanValue

func (ifu *ItemFieldUpdate) SetBooleanValue(b bool) *ItemFieldUpdate

SetBooleanValue sets the "boolean_value" field.

func (*ItemFieldUpdate) SetDescription

func (ifu *ItemFieldUpdate) SetDescription(s string) *ItemFieldUpdate

SetDescription sets the "description" field.

func (*ItemFieldUpdate) SetItem

func (ifu *ItemFieldUpdate) SetItem(i *Item) *ItemFieldUpdate

SetItem sets the "item" edge to the Item entity.

func (*ItemFieldUpdate) SetItemID

func (ifu *ItemFieldUpdate) SetItemID(id uuid.UUID) *ItemFieldUpdate

SetItemID sets the "item" edge to the Item entity by ID.

func (*ItemFieldUpdate) SetName

func (ifu *ItemFieldUpdate) SetName(s string) *ItemFieldUpdate

SetName sets the "name" field.

func (*ItemFieldUpdate) SetNillableBooleanValue

func (ifu *ItemFieldUpdate) SetNillableBooleanValue(b *bool) *ItemFieldUpdate

SetNillableBooleanValue sets the "boolean_value" field if the given value is not nil.

func (*ItemFieldUpdate) SetNillableDescription

func (ifu *ItemFieldUpdate) SetNillableDescription(s *string) *ItemFieldUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemFieldUpdate) SetNillableItemID

func (ifu *ItemFieldUpdate) SetNillableItemID(id *uuid.UUID) *ItemFieldUpdate

SetNillableItemID sets the "item" edge to the Item entity by ID if the given value is not nil.

func (*ItemFieldUpdate) SetNillableName

func (ifu *ItemFieldUpdate) SetNillableName(s *string) *ItemFieldUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ItemFieldUpdate) SetNillableNumberValue

func (ifu *ItemFieldUpdate) SetNillableNumberValue(i *int) *ItemFieldUpdate

SetNillableNumberValue sets the "number_value" field if the given value is not nil.

func (*ItemFieldUpdate) SetNillableTextValue

func (ifu *ItemFieldUpdate) SetNillableTextValue(s *string) *ItemFieldUpdate

SetNillableTextValue sets the "text_value" field if the given value is not nil.

func (*ItemFieldUpdate) SetNillableTimeValue

func (ifu *ItemFieldUpdate) SetNillableTimeValue(t *time.Time) *ItemFieldUpdate

SetNillableTimeValue sets the "time_value" field if the given value is not nil.

func (*ItemFieldUpdate) SetNillableType

func (ifu *ItemFieldUpdate) SetNillableType(i *itemfield.Type) *ItemFieldUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ItemFieldUpdate) SetNumberValue

func (ifu *ItemFieldUpdate) SetNumberValue(i int) *ItemFieldUpdate

SetNumberValue sets the "number_value" field.

func (*ItemFieldUpdate) SetTextValue

func (ifu *ItemFieldUpdate) SetTextValue(s string) *ItemFieldUpdate

SetTextValue sets the "text_value" field.

func (*ItemFieldUpdate) SetTimeValue

func (ifu *ItemFieldUpdate) SetTimeValue(t time.Time) *ItemFieldUpdate

SetTimeValue sets the "time_value" field.

func (*ItemFieldUpdate) SetType

func (ifu *ItemFieldUpdate) SetType(i itemfield.Type) *ItemFieldUpdate

SetType sets the "type" field.

func (*ItemFieldUpdate) SetUpdatedAt

func (ifu *ItemFieldUpdate) SetUpdatedAt(t time.Time) *ItemFieldUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ItemFieldUpdate) Where

Where appends a list predicates to the ItemFieldUpdate builder.

type ItemFieldUpdateOne

type ItemFieldUpdateOne struct {
	// contains filtered or unexported fields
}

ItemFieldUpdateOne is the builder for updating a single ItemField entity.

func (*ItemFieldUpdateOne) AddNumberValue

func (ifuo *ItemFieldUpdateOne) AddNumberValue(i int) *ItemFieldUpdateOne

AddNumberValue adds i to the "number_value" field.

func (*ItemFieldUpdateOne) ClearDescription

func (ifuo *ItemFieldUpdateOne) ClearDescription() *ItemFieldUpdateOne

ClearDescription clears the value of the "description" field.

func (*ItemFieldUpdateOne) ClearItem

func (ifuo *ItemFieldUpdateOne) ClearItem() *ItemFieldUpdateOne

ClearItem clears the "item" edge to the Item entity.

func (*ItemFieldUpdateOne) ClearNumberValue

func (ifuo *ItemFieldUpdateOne) ClearNumberValue() *ItemFieldUpdateOne

ClearNumberValue clears the value of the "number_value" field.

func (*ItemFieldUpdateOne) ClearTextValue

func (ifuo *ItemFieldUpdateOne) ClearTextValue() *ItemFieldUpdateOne

ClearTextValue clears the value of the "text_value" field.

func (*ItemFieldUpdateOne) Exec

func (ifuo *ItemFieldUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemFieldUpdateOne) ExecX

func (ifuo *ItemFieldUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemFieldUpdateOne) Mutation

func (ifuo *ItemFieldUpdateOne) Mutation() *ItemFieldMutation

Mutation returns the ItemFieldMutation object of the builder.

func (*ItemFieldUpdateOne) Save

func (ifuo *ItemFieldUpdateOne) Save(ctx context.Context) (*ItemField, error)

Save executes the query and returns the updated ItemField entity.

func (*ItemFieldUpdateOne) SaveX

func (ifuo *ItemFieldUpdateOne) SaveX(ctx context.Context) *ItemField

SaveX is like Save, but panics if an error occurs.

func (*ItemFieldUpdateOne) Select

func (ifuo *ItemFieldUpdateOne) Select(field string, fields ...string) *ItemFieldUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ItemFieldUpdateOne) SetBooleanValue

func (ifuo *ItemFieldUpdateOne) SetBooleanValue(b bool) *ItemFieldUpdateOne

SetBooleanValue sets the "boolean_value" field.

func (*ItemFieldUpdateOne) SetDescription

func (ifuo *ItemFieldUpdateOne) SetDescription(s string) *ItemFieldUpdateOne

SetDescription sets the "description" field.

func (*ItemFieldUpdateOne) SetItem

func (ifuo *ItemFieldUpdateOne) SetItem(i *Item) *ItemFieldUpdateOne

SetItem sets the "item" edge to the Item entity.

func (*ItemFieldUpdateOne) SetItemID

func (ifuo *ItemFieldUpdateOne) SetItemID(id uuid.UUID) *ItemFieldUpdateOne

SetItemID sets the "item" edge to the Item entity by ID.

func (*ItemFieldUpdateOne) SetName

func (ifuo *ItemFieldUpdateOne) SetName(s string) *ItemFieldUpdateOne

SetName sets the "name" field.

func (*ItemFieldUpdateOne) SetNillableBooleanValue

func (ifuo *ItemFieldUpdateOne) SetNillableBooleanValue(b *bool) *ItemFieldUpdateOne

SetNillableBooleanValue sets the "boolean_value" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableDescription

func (ifuo *ItemFieldUpdateOne) SetNillableDescription(s *string) *ItemFieldUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableItemID

func (ifuo *ItemFieldUpdateOne) SetNillableItemID(id *uuid.UUID) *ItemFieldUpdateOne

SetNillableItemID sets the "item" edge to the Item entity by ID if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableName

func (ifuo *ItemFieldUpdateOne) SetNillableName(s *string) *ItemFieldUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableNumberValue

func (ifuo *ItemFieldUpdateOne) SetNillableNumberValue(i *int) *ItemFieldUpdateOne

SetNillableNumberValue sets the "number_value" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableTextValue

func (ifuo *ItemFieldUpdateOne) SetNillableTextValue(s *string) *ItemFieldUpdateOne

SetNillableTextValue sets the "text_value" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableTimeValue

func (ifuo *ItemFieldUpdateOne) SetNillableTimeValue(t *time.Time) *ItemFieldUpdateOne

SetNillableTimeValue sets the "time_value" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNillableType

func (ifuo *ItemFieldUpdateOne) SetNillableType(i *itemfield.Type) *ItemFieldUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ItemFieldUpdateOne) SetNumberValue

func (ifuo *ItemFieldUpdateOne) SetNumberValue(i int) *ItemFieldUpdateOne

SetNumberValue sets the "number_value" field.

func (*ItemFieldUpdateOne) SetTextValue

func (ifuo *ItemFieldUpdateOne) SetTextValue(s string) *ItemFieldUpdateOne

SetTextValue sets the "text_value" field.

func (*ItemFieldUpdateOne) SetTimeValue

func (ifuo *ItemFieldUpdateOne) SetTimeValue(t time.Time) *ItemFieldUpdateOne

SetTimeValue sets the "time_value" field.

func (*ItemFieldUpdateOne) SetType

SetType sets the "type" field.

func (*ItemFieldUpdateOne) SetUpdatedAt

func (ifuo *ItemFieldUpdateOne) SetUpdatedAt(t time.Time) *ItemFieldUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ItemFieldUpdateOne) Where

Where appends a list predicates to the ItemFieldUpdate builder.

type ItemFields

type ItemFields []*ItemField

ItemFields is a parsable slice of ItemField.

type ItemGroupBy

type ItemGroupBy struct {
	// contains filtered or unexported fields
}

ItemGroupBy is the group-by builder for Item entities.

func (*ItemGroupBy) Aggregate

func (igb *ItemGroupBy) Aggregate(fns ...AggregateFunc) *ItemGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ItemGroupBy) Bool

func (s *ItemGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) BoolX

func (s *ItemGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ItemGroupBy) Bools

func (s *ItemGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) BoolsX

func (s *ItemGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ItemGroupBy) Float64

func (s *ItemGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) Float64X

func (s *ItemGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ItemGroupBy) Float64s

func (s *ItemGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) Float64sX

func (s *ItemGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ItemGroupBy) Int

func (s *ItemGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) IntX

func (s *ItemGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ItemGroupBy) Ints

func (s *ItemGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) IntsX

func (s *ItemGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ItemGroupBy) Scan

func (igb *ItemGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ItemGroupBy) ScanX

func (s *ItemGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ItemGroupBy) String

func (s *ItemGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) StringX

func (s *ItemGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ItemGroupBy) Strings

func (s *ItemGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ItemGroupBy) StringsX

func (s *ItemGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ItemMutation

type ItemMutation struct {
	// contains filtered or unexported fields
}

ItemMutation represents an operation that mutates the Item nodes in the graph.

func (*ItemMutation) AddAssetID

func (m *ItemMutation) AddAssetID(i int)

AddAssetID adds i to the "asset_id" field.

func (*ItemMutation) AddAttachmentIDs

func (m *ItemMutation) AddAttachmentIDs(ids ...uuid.UUID)

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by ids.

func (*ItemMutation) AddChildIDs

func (m *ItemMutation) AddChildIDs(ids ...uuid.UUID)

AddChildIDs adds the "children" edge to the Item entity by ids.

func (*ItemMutation) AddField

func (m *ItemMutation) 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 (*ItemMutation) AddFieldIDs

func (m *ItemMutation) AddFieldIDs(ids ...uuid.UUID)

AddFieldIDs adds the "fields" edge to the ItemField entity by ids.

func (*ItemMutation) AddLabelIDs

func (m *ItemMutation) AddLabelIDs(ids ...uuid.UUID)

AddLabelIDs adds the "label" edge to the Label entity by ids.

func (*ItemMutation) AddMaintenanceEntryIDs

func (m *ItemMutation) AddMaintenanceEntryIDs(ids ...uuid.UUID)

AddMaintenanceEntryIDs adds the "maintenance_entries" edge to the MaintenanceEntry entity by ids.

func (*ItemMutation) AddPurchasePrice

func (m *ItemMutation) AddPurchasePrice(f float64)

AddPurchasePrice adds f to the "purchase_price" field.

func (*ItemMutation) AddQuantity

func (m *ItemMutation) AddQuantity(i int)

AddQuantity adds i to the "quantity" field.

func (*ItemMutation) AddSoldPrice

func (m *ItemMutation) AddSoldPrice(f float64)

AddSoldPrice adds f to the "sold_price" field.

func (*ItemMutation) AddedAssetID

func (m *ItemMutation) AddedAssetID() (r int, exists bool)

AddedAssetID returns the value that was added to the "asset_id" field in this mutation.

func (*ItemMutation) AddedEdges

func (m *ItemMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ItemMutation) AddedField

func (m *ItemMutation) 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 (*ItemMutation) AddedFields

func (m *ItemMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ItemMutation) AddedIDs

func (m *ItemMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ItemMutation) AddedPurchasePrice

func (m *ItemMutation) AddedPurchasePrice() (r float64, exists bool)

AddedPurchasePrice returns the value that was added to the "purchase_price" field in this mutation.

func (*ItemMutation) AddedQuantity

func (m *ItemMutation) AddedQuantity() (r int, exists bool)

AddedQuantity returns the value that was added to the "quantity" field in this mutation.

func (*ItemMutation) AddedSoldPrice

func (m *ItemMutation) AddedSoldPrice() (r float64, exists bool)

AddedSoldPrice returns the value that was added to the "sold_price" field in this mutation.

func (*ItemMutation) Archived

func (m *ItemMutation) Archived() (r bool, exists bool)

Archived returns the value of the "archived" field in the mutation.

func (*ItemMutation) AssetID

func (m *ItemMutation) AssetID() (r int, exists bool)

AssetID returns the value of the "asset_id" field in the mutation.

func (*ItemMutation) AttachmentsCleared

func (m *ItemMutation) AttachmentsCleared() bool

AttachmentsCleared reports if the "attachments" edge to the Attachment entity was cleared.

func (*ItemMutation) AttachmentsIDs

func (m *ItemMutation) AttachmentsIDs() (ids []uuid.UUID)

AttachmentsIDs returns the "attachments" edge IDs in the mutation.

func (*ItemMutation) ChildrenCleared

func (m *ItemMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Item entity was cleared.

func (*ItemMutation) ChildrenIDs

func (m *ItemMutation) ChildrenIDs() (ids []uuid.UUID)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*ItemMutation) ClearAttachments

func (m *ItemMutation) ClearAttachments()

ClearAttachments clears the "attachments" edge to the Attachment entity.

func (*ItemMutation) ClearChildren

func (m *ItemMutation) ClearChildren()

ClearChildren clears the "children" edge to the Item entity.

func (*ItemMutation) ClearDescription

func (m *ItemMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ItemMutation) ClearEdge

func (m *ItemMutation) 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 (*ItemMutation) ClearField

func (m *ItemMutation) 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 (*ItemMutation) ClearFields

func (m *ItemMutation) ClearFields()

ClearFields clears the "fields" edge to the ItemField entity.

func (*ItemMutation) ClearGroup

func (m *ItemMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*ItemMutation) ClearImportRef

func (m *ItemMutation) ClearImportRef()

ClearImportRef clears the value of the "import_ref" field.

func (*ItemMutation) ClearLabel

func (m *ItemMutation) ClearLabel()

ClearLabel clears the "label" edge to the Label entity.

func (*ItemMutation) ClearLocation

func (m *ItemMutation) ClearLocation()

ClearLocation clears the "location" edge to the Location entity.

func (*ItemMutation) ClearMaintenanceEntries

func (m *ItemMutation) ClearMaintenanceEntries()

ClearMaintenanceEntries clears the "maintenance_entries" edge to the MaintenanceEntry entity.

func (*ItemMutation) ClearManufacturer

func (m *ItemMutation) ClearManufacturer()

ClearManufacturer clears the value of the "manufacturer" field.

func (*ItemMutation) ClearModelNumber

func (m *ItemMutation) ClearModelNumber()

ClearModelNumber clears the value of the "model_number" field.

func (*ItemMutation) ClearNotes

func (m *ItemMutation) ClearNotes()

ClearNotes clears the value of the "notes" field.

func (*ItemMutation) ClearParent

func (m *ItemMutation) ClearParent()

ClearParent clears the "parent" edge to the Item entity.

func (*ItemMutation) ClearPurchaseFrom

func (m *ItemMutation) ClearPurchaseFrom()

ClearPurchaseFrom clears the value of the "purchase_from" field.

func (*ItemMutation) ClearPurchaseTime

func (m *ItemMutation) ClearPurchaseTime()

ClearPurchaseTime clears the value of the "purchase_time" field.

func (*ItemMutation) ClearSerialNumber

func (m *ItemMutation) ClearSerialNumber()

ClearSerialNumber clears the value of the "serial_number" field.

func (*ItemMutation) ClearSoldNotes

func (m *ItemMutation) ClearSoldNotes()

ClearSoldNotes clears the value of the "sold_notes" field.

func (*ItemMutation) ClearSoldTime

func (m *ItemMutation) ClearSoldTime()

ClearSoldTime clears the value of the "sold_time" field.

func (*ItemMutation) ClearSoldTo

func (m *ItemMutation) ClearSoldTo()

ClearSoldTo clears the value of the "sold_to" field.

func (*ItemMutation) ClearWarrantyDetails

func (m *ItemMutation) ClearWarrantyDetails()

ClearWarrantyDetails clears the value of the "warranty_details" field.

func (*ItemMutation) ClearWarrantyExpires

func (m *ItemMutation) ClearWarrantyExpires()

ClearWarrantyExpires clears the value of the "warranty_expires" field.

func (*ItemMutation) ClearedEdges

func (m *ItemMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ItemMutation) ClearedFields

func (m *ItemMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ItemMutation) Client

func (m ItemMutation) 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 (*ItemMutation) CreatedAt

func (m *ItemMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ItemMutation) Description

func (m *ItemMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ItemMutation) DescriptionCleared

func (m *ItemMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*ItemMutation) EdgeCleared

func (m *ItemMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ItemMutation) Field

func (m *ItemMutation) 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 (*ItemMutation) FieldCleared

func (m *ItemMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ItemMutation) Fields

func (m *ItemMutation) 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 (*ItemMutation) FieldsCleared

func (m *ItemMutation) FieldsCleared() bool

FieldsCleared reports if the "fields" edge to the ItemField entity was cleared.

func (*ItemMutation) FieldsIDs

func (m *ItemMutation) FieldsIDs() (ids []uuid.UUID)

FieldsIDs returns the "fields" edge IDs in the mutation.

func (*ItemMutation) GroupCleared

func (m *ItemMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*ItemMutation) GroupID

func (m *ItemMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*ItemMutation) GroupIDs

func (m *ItemMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*ItemMutation) ID

func (m *ItemMutation) ID() (id uuid.UUID, 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 (*ItemMutation) IDs

func (m *ItemMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ItemMutation) ImportRef

func (m *ItemMutation) ImportRef() (r string, exists bool)

ImportRef returns the value of the "import_ref" field in the mutation.

func (*ItemMutation) ImportRefCleared

func (m *ItemMutation) ImportRefCleared() bool

ImportRefCleared returns if the "import_ref" field was cleared in this mutation.

func (*ItemMutation) Insured

func (m *ItemMutation) Insured() (r bool, exists bool)

Insured returns the value of the "insured" field in the mutation.

func (*ItemMutation) LabelCleared

func (m *ItemMutation) LabelCleared() bool

LabelCleared reports if the "label" edge to the Label entity was cleared.

func (*ItemMutation) LabelIDs

func (m *ItemMutation) LabelIDs() (ids []uuid.UUID)

LabelIDs returns the "label" edge IDs in the mutation.

func (*ItemMutation) LifetimeWarranty

func (m *ItemMutation) LifetimeWarranty() (r bool, exists bool)

LifetimeWarranty returns the value of the "lifetime_warranty" field in the mutation.

func (*ItemMutation) LocationCleared

func (m *ItemMutation) LocationCleared() bool

LocationCleared reports if the "location" edge to the Location entity was cleared.

func (*ItemMutation) LocationID

func (m *ItemMutation) LocationID() (id uuid.UUID, exists bool)

LocationID returns the "location" edge ID in the mutation.

func (*ItemMutation) LocationIDs

func (m *ItemMutation) LocationIDs() (ids []uuid.UUID)

LocationIDs returns the "location" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use LocationID instead. It exists only for internal usage by the builders.

func (*ItemMutation) MaintenanceEntriesCleared

func (m *ItemMutation) MaintenanceEntriesCleared() bool

MaintenanceEntriesCleared reports if the "maintenance_entries" edge to the MaintenanceEntry entity was cleared.

func (*ItemMutation) MaintenanceEntriesIDs

func (m *ItemMutation) MaintenanceEntriesIDs() (ids []uuid.UUID)

MaintenanceEntriesIDs returns the "maintenance_entries" edge IDs in the mutation.

func (*ItemMutation) Manufacturer

func (m *ItemMutation) Manufacturer() (r string, exists bool)

Manufacturer returns the value of the "manufacturer" field in the mutation.

func (*ItemMutation) ManufacturerCleared

func (m *ItemMutation) ManufacturerCleared() bool

ManufacturerCleared returns if the "manufacturer" field was cleared in this mutation.

func (*ItemMutation) ModelNumber

func (m *ItemMutation) ModelNumber() (r string, exists bool)

ModelNumber returns the value of the "model_number" field in the mutation.

func (*ItemMutation) ModelNumberCleared

func (m *ItemMutation) ModelNumberCleared() bool

ModelNumberCleared returns if the "model_number" field was cleared in this mutation.

func (*ItemMutation) Name

func (m *ItemMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ItemMutation) Notes

func (m *ItemMutation) Notes() (r string, exists bool)

Notes returns the value of the "notes" field in the mutation.

func (*ItemMutation) NotesCleared

func (m *ItemMutation) NotesCleared() bool

NotesCleared returns if the "notes" field was cleared in this mutation.

func (*ItemMutation) OldArchived

func (m *ItemMutation) OldArchived(ctx context.Context) (v bool, err error)

OldArchived returns the old "archived" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldAssetID

func (m *ItemMutation) OldAssetID(ctx context.Context) (v int, err error)

OldAssetID returns the old "asset_id" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldCreatedAt

func (m *ItemMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldDescription

func (m *ItemMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldField

func (m *ItemMutation) 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 (*ItemMutation) OldImportRef

func (m *ItemMutation) OldImportRef(ctx context.Context) (v string, err error)

OldImportRef returns the old "import_ref" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldInsured

func (m *ItemMutation) OldInsured(ctx context.Context) (v bool, err error)

OldInsured returns the old "insured" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldLifetimeWarranty

func (m *ItemMutation) OldLifetimeWarranty(ctx context.Context) (v bool, err error)

OldLifetimeWarranty returns the old "lifetime_warranty" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldManufacturer

func (m *ItemMutation) OldManufacturer(ctx context.Context) (v string, err error)

OldManufacturer returns the old "manufacturer" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldModelNumber

func (m *ItemMutation) OldModelNumber(ctx context.Context) (v string, err error)

OldModelNumber returns the old "model_number" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldName

func (m *ItemMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldNotes

func (m *ItemMutation) OldNotes(ctx context.Context) (v string, err error)

OldNotes returns the old "notes" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldPurchaseFrom

func (m *ItemMutation) OldPurchaseFrom(ctx context.Context) (v string, err error)

OldPurchaseFrom returns the old "purchase_from" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldPurchasePrice

func (m *ItemMutation) OldPurchasePrice(ctx context.Context) (v float64, err error)

OldPurchasePrice returns the old "purchase_price" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldPurchaseTime

func (m *ItemMutation) OldPurchaseTime(ctx context.Context) (v time.Time, err error)

OldPurchaseTime returns the old "purchase_time" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldQuantity

func (m *ItemMutation) OldQuantity(ctx context.Context) (v int, err error)

OldQuantity returns the old "quantity" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldSerialNumber

func (m *ItemMutation) OldSerialNumber(ctx context.Context) (v string, err error)

OldSerialNumber returns the old "serial_number" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldSoldNotes

func (m *ItemMutation) OldSoldNotes(ctx context.Context) (v string, err error)

OldSoldNotes returns the old "sold_notes" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldSoldPrice

func (m *ItemMutation) OldSoldPrice(ctx context.Context) (v float64, err error)

OldSoldPrice returns the old "sold_price" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldSoldTime

func (m *ItemMutation) OldSoldTime(ctx context.Context) (v time.Time, err error)

OldSoldTime returns the old "sold_time" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldSoldTo

func (m *ItemMutation) OldSoldTo(ctx context.Context) (v string, err error)

OldSoldTo returns the old "sold_to" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldUpdatedAt

func (m *ItemMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldWarrantyDetails

func (m *ItemMutation) OldWarrantyDetails(ctx context.Context) (v string, err error)

OldWarrantyDetails returns the old "warranty_details" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) OldWarrantyExpires

func (m *ItemMutation) OldWarrantyExpires(ctx context.Context) (v time.Time, err error)

OldWarrantyExpires returns the old "warranty_expires" field's value of the Item entity. If the Item object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ItemMutation) Op

func (m *ItemMutation) Op() Op

Op returns the operation name.

func (*ItemMutation) ParentCleared

func (m *ItemMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Item entity was cleared.

func (*ItemMutation) ParentID

func (m *ItemMutation) ParentID() (id uuid.UUID, exists bool)

ParentID returns the "parent" edge ID in the mutation.

func (*ItemMutation) ParentIDs

func (m *ItemMutation) ParentIDs() (ids []uuid.UUID)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (*ItemMutation) PurchaseFrom

func (m *ItemMutation) PurchaseFrom() (r string, exists bool)

PurchaseFrom returns the value of the "purchase_from" field in the mutation.

func (*ItemMutation) PurchaseFromCleared

func (m *ItemMutation) PurchaseFromCleared() bool

PurchaseFromCleared returns if the "purchase_from" field was cleared in this mutation.

func (*ItemMutation) PurchasePrice

func (m *ItemMutation) PurchasePrice() (r float64, exists bool)

PurchasePrice returns the value of the "purchase_price" field in the mutation.

func (*ItemMutation) PurchaseTime

func (m *ItemMutation) PurchaseTime() (r time.Time, exists bool)

PurchaseTime returns the value of the "purchase_time" field in the mutation.

func (*ItemMutation) PurchaseTimeCleared

func (m *ItemMutation) PurchaseTimeCleared() bool

PurchaseTimeCleared returns if the "purchase_time" field was cleared in this mutation.

func (*ItemMutation) Quantity

func (m *ItemMutation) Quantity() (r int, exists bool)

Quantity returns the value of the "quantity" field in the mutation.

func (*ItemMutation) RemoveAttachmentIDs

func (m *ItemMutation) RemoveAttachmentIDs(ids ...uuid.UUID)

RemoveAttachmentIDs removes the "attachments" edge to the Attachment entity by IDs.

func (*ItemMutation) RemoveChildIDs

func (m *ItemMutation) RemoveChildIDs(ids ...uuid.UUID)

RemoveChildIDs removes the "children" edge to the Item entity by IDs.

func (*ItemMutation) RemoveFieldIDs

func (m *ItemMutation) RemoveFieldIDs(ids ...uuid.UUID)

RemoveFieldIDs removes the "fields" edge to the ItemField entity by IDs.

func (*ItemMutation) RemoveLabelIDs

func (m *ItemMutation) RemoveLabelIDs(ids ...uuid.UUID)

RemoveLabelIDs removes the "label" edge to the Label entity by IDs.

func (*ItemMutation) RemoveMaintenanceEntryIDs

func (m *ItemMutation) RemoveMaintenanceEntryIDs(ids ...uuid.UUID)

RemoveMaintenanceEntryIDs removes the "maintenance_entries" edge to the MaintenanceEntry entity by IDs.

func (*ItemMutation) RemovedAttachmentsIDs

func (m *ItemMutation) RemovedAttachmentsIDs() (ids []uuid.UUID)

RemovedAttachments returns the removed IDs of the "attachments" edge to the Attachment entity.

func (*ItemMutation) RemovedChildrenIDs

func (m *ItemMutation) RemovedChildrenIDs() (ids []uuid.UUID)

RemovedChildren returns the removed IDs of the "children" edge to the Item entity.

func (*ItemMutation) RemovedEdges

func (m *ItemMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ItemMutation) RemovedFieldsIDs

func (m *ItemMutation) RemovedFieldsIDs() (ids []uuid.UUID)

RemovedFields returns the removed IDs of the "fields" edge to the ItemField entity.

func (*ItemMutation) RemovedIDs

func (m *ItemMutation) 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 (*ItemMutation) RemovedLabelIDs

func (m *ItemMutation) RemovedLabelIDs() (ids []uuid.UUID)

RemovedLabel returns the removed IDs of the "label" edge to the Label entity.

func (*ItemMutation) RemovedMaintenanceEntriesIDs

func (m *ItemMutation) RemovedMaintenanceEntriesIDs() (ids []uuid.UUID)

RemovedMaintenanceEntries returns the removed IDs of the "maintenance_entries" edge to the MaintenanceEntry entity.

func (*ItemMutation) ResetArchived

func (m *ItemMutation) ResetArchived()

ResetArchived resets all changes to the "archived" field.

func (*ItemMutation) ResetAssetID

func (m *ItemMutation) ResetAssetID()

ResetAssetID resets all changes to the "asset_id" field.

func (*ItemMutation) ResetAttachments

func (m *ItemMutation) ResetAttachments()

ResetAttachments resets all changes to the "attachments" edge.

func (*ItemMutation) ResetChildren

func (m *ItemMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*ItemMutation) ResetCreatedAt

func (m *ItemMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ItemMutation) ResetDescription

func (m *ItemMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ItemMutation) ResetEdge

func (m *ItemMutation) 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 (*ItemMutation) ResetField

func (m *ItemMutation) 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 (*ItemMutation) ResetFields

func (m *ItemMutation) ResetFields()

ResetFields resets all changes to the "fields" edge.

func (*ItemMutation) ResetGroup

func (m *ItemMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*ItemMutation) ResetImportRef

func (m *ItemMutation) ResetImportRef()

ResetImportRef resets all changes to the "import_ref" field.

func (*ItemMutation) ResetInsured

func (m *ItemMutation) ResetInsured()

ResetInsured resets all changes to the "insured" field.

func (*ItemMutation) ResetLabel

func (m *ItemMutation) ResetLabel()

ResetLabel resets all changes to the "label" edge.

func (*ItemMutation) ResetLifetimeWarranty

func (m *ItemMutation) ResetLifetimeWarranty()

ResetLifetimeWarranty resets all changes to the "lifetime_warranty" field.

func (*ItemMutation) ResetLocation

func (m *ItemMutation) ResetLocation()

ResetLocation resets all changes to the "location" edge.

func (*ItemMutation) ResetMaintenanceEntries

func (m *ItemMutation) ResetMaintenanceEntries()

ResetMaintenanceEntries resets all changes to the "maintenance_entries" edge.

func (*ItemMutation) ResetManufacturer

func (m *ItemMutation) ResetManufacturer()

ResetManufacturer resets all changes to the "manufacturer" field.

func (*ItemMutation) ResetModelNumber

func (m *ItemMutation) ResetModelNumber()

ResetModelNumber resets all changes to the "model_number" field.

func (*ItemMutation) ResetName

func (m *ItemMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ItemMutation) ResetNotes

func (m *ItemMutation) ResetNotes()

ResetNotes resets all changes to the "notes" field.

func (*ItemMutation) ResetParent

func (m *ItemMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*ItemMutation) ResetPurchaseFrom

func (m *ItemMutation) ResetPurchaseFrom()

ResetPurchaseFrom resets all changes to the "purchase_from" field.

func (*ItemMutation) ResetPurchasePrice

func (m *ItemMutation) ResetPurchasePrice()

ResetPurchasePrice resets all changes to the "purchase_price" field.

func (*ItemMutation) ResetPurchaseTime

func (m *ItemMutation) ResetPurchaseTime()

ResetPurchaseTime resets all changes to the "purchase_time" field.

func (*ItemMutation) ResetQuantity

func (m *ItemMutation) ResetQuantity()

ResetQuantity resets all changes to the "quantity" field.

func (*ItemMutation) ResetSerialNumber

func (m *ItemMutation) ResetSerialNumber()

ResetSerialNumber resets all changes to the "serial_number" field.

func (*ItemMutation) ResetSoldNotes

func (m *ItemMutation) ResetSoldNotes()

ResetSoldNotes resets all changes to the "sold_notes" field.

func (*ItemMutation) ResetSoldPrice

func (m *ItemMutation) ResetSoldPrice()

ResetSoldPrice resets all changes to the "sold_price" field.

func (*ItemMutation) ResetSoldTime

func (m *ItemMutation) ResetSoldTime()

ResetSoldTime resets all changes to the "sold_time" field.

func (*ItemMutation) ResetSoldTo

func (m *ItemMutation) ResetSoldTo()

ResetSoldTo resets all changes to the "sold_to" field.

func (*ItemMutation) ResetUpdatedAt

func (m *ItemMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ItemMutation) ResetWarrantyDetails

func (m *ItemMutation) ResetWarrantyDetails()

ResetWarrantyDetails resets all changes to the "warranty_details" field.

func (*ItemMutation) ResetWarrantyExpires

func (m *ItemMutation) ResetWarrantyExpires()

ResetWarrantyExpires resets all changes to the "warranty_expires" field.

func (*ItemMutation) SerialNumber

func (m *ItemMutation) SerialNumber() (r string, exists bool)

SerialNumber returns the value of the "serial_number" field in the mutation.

func (*ItemMutation) SerialNumberCleared

func (m *ItemMutation) SerialNumberCleared() bool

SerialNumberCleared returns if the "serial_number" field was cleared in this mutation.

func (*ItemMutation) SetArchived

func (m *ItemMutation) SetArchived(b bool)

SetArchived sets the "archived" field.

func (*ItemMutation) SetAssetID

func (m *ItemMutation) SetAssetID(i int)

SetAssetID sets the "asset_id" field.

func (*ItemMutation) SetCreatedAt

func (m *ItemMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ItemMutation) SetDescription

func (m *ItemMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ItemMutation) SetField

func (m *ItemMutation) 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 (*ItemMutation) SetGroupID

func (m *ItemMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*ItemMutation) SetID

func (m *ItemMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Item entities.

func (*ItemMutation) SetImportRef

func (m *ItemMutation) SetImportRef(s string)

SetImportRef sets the "import_ref" field.

func (*ItemMutation) SetInsured

func (m *ItemMutation) SetInsured(b bool)

SetInsured sets the "insured" field.

func (*ItemMutation) SetLifetimeWarranty

func (m *ItemMutation) SetLifetimeWarranty(b bool)

SetLifetimeWarranty sets the "lifetime_warranty" field.

func (*ItemMutation) SetLocationID

func (m *ItemMutation) SetLocationID(id uuid.UUID)

SetLocationID sets the "location" edge to the Location entity by id.

func (*ItemMutation) SetManufacturer

func (m *ItemMutation) SetManufacturer(s string)

SetManufacturer sets the "manufacturer" field.

func (*ItemMutation) SetModelNumber

func (m *ItemMutation) SetModelNumber(s string)

SetModelNumber sets the "model_number" field.

func (*ItemMutation) SetName

func (m *ItemMutation) SetName(s string)

SetName sets the "name" field.

func (*ItemMutation) SetNotes

func (m *ItemMutation) SetNotes(s string)

SetNotes sets the "notes" field.

func (*ItemMutation) SetOp

func (m *ItemMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ItemMutation) SetParentID

func (m *ItemMutation) SetParentID(id uuid.UUID)

SetParentID sets the "parent" edge to the Item entity by id.

func (*ItemMutation) SetPurchaseFrom

func (m *ItemMutation) SetPurchaseFrom(s string)

SetPurchaseFrom sets the "purchase_from" field.

func (*ItemMutation) SetPurchasePrice

func (m *ItemMutation) SetPurchasePrice(f float64)

SetPurchasePrice sets the "purchase_price" field.

func (*ItemMutation) SetPurchaseTime

func (m *ItemMutation) SetPurchaseTime(t time.Time)

SetPurchaseTime sets the "purchase_time" field.

func (*ItemMutation) SetQuantity

func (m *ItemMutation) SetQuantity(i int)

SetQuantity sets the "quantity" field.

func (*ItemMutation) SetSerialNumber

func (m *ItemMutation) SetSerialNumber(s string)

SetSerialNumber sets the "serial_number" field.

func (*ItemMutation) SetSoldNotes

func (m *ItemMutation) SetSoldNotes(s string)

SetSoldNotes sets the "sold_notes" field.

func (*ItemMutation) SetSoldPrice

func (m *ItemMutation) SetSoldPrice(f float64)

SetSoldPrice sets the "sold_price" field.

func (*ItemMutation) SetSoldTime

func (m *ItemMutation) SetSoldTime(t time.Time)

SetSoldTime sets the "sold_time" field.

func (*ItemMutation) SetSoldTo

func (m *ItemMutation) SetSoldTo(s string)

SetSoldTo sets the "sold_to" field.

func (*ItemMutation) SetUpdatedAt

func (m *ItemMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ItemMutation) SetWarrantyDetails

func (m *ItemMutation) SetWarrantyDetails(s string)

SetWarrantyDetails sets the "warranty_details" field.

func (*ItemMutation) SetWarrantyExpires

func (m *ItemMutation) SetWarrantyExpires(t time.Time)

SetWarrantyExpires sets the "warranty_expires" field.

func (*ItemMutation) SoldNotes

func (m *ItemMutation) SoldNotes() (r string, exists bool)

SoldNotes returns the value of the "sold_notes" field in the mutation.

func (*ItemMutation) SoldNotesCleared

func (m *ItemMutation) SoldNotesCleared() bool

SoldNotesCleared returns if the "sold_notes" field was cleared in this mutation.

func (*ItemMutation) SoldPrice

func (m *ItemMutation) SoldPrice() (r float64, exists bool)

SoldPrice returns the value of the "sold_price" field in the mutation.

func (*ItemMutation) SoldTime

func (m *ItemMutation) SoldTime() (r time.Time, exists bool)

SoldTime returns the value of the "sold_time" field in the mutation.

func (*ItemMutation) SoldTimeCleared

func (m *ItemMutation) SoldTimeCleared() bool

SoldTimeCleared returns if the "sold_time" field was cleared in this mutation.

func (*ItemMutation) SoldTo

func (m *ItemMutation) SoldTo() (r string, exists bool)

SoldTo returns the value of the "sold_to" field in the mutation.

func (*ItemMutation) SoldToCleared

func (m *ItemMutation) SoldToCleared() bool

SoldToCleared returns if the "sold_to" field was cleared in this mutation.

func (ItemMutation) Tx

func (m ItemMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ItemMutation) Type

func (m *ItemMutation) Type() string

Type returns the node type of this mutation (Item).

func (*ItemMutation) UpdatedAt

func (m *ItemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ItemMutation) WarrantyDetails

func (m *ItemMutation) WarrantyDetails() (r string, exists bool)

WarrantyDetails returns the value of the "warranty_details" field in the mutation.

func (*ItemMutation) WarrantyDetailsCleared

func (m *ItemMutation) WarrantyDetailsCleared() bool

WarrantyDetailsCleared returns if the "warranty_details" field was cleared in this mutation.

func (*ItemMutation) WarrantyExpires

func (m *ItemMutation) WarrantyExpires() (r time.Time, exists bool)

WarrantyExpires returns the value of the "warranty_expires" field in the mutation.

func (*ItemMutation) WarrantyExpiresCleared

func (m *ItemMutation) WarrantyExpiresCleared() bool

WarrantyExpiresCleared returns if the "warranty_expires" field was cleared in this mutation.

func (*ItemMutation) Where

func (m *ItemMutation) Where(ps ...predicate.Item)

Where appends a list predicates to the ItemMutation builder.

func (*ItemMutation) WhereP

func (m *ItemMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ItemMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ItemQuery

type ItemQuery struct {
	// contains filtered or unexported fields
}

ItemQuery is the builder for querying Item entities.

func (*ItemQuery) Aggregate

func (iq *ItemQuery) Aggregate(fns ...AggregateFunc) *ItemSelect

Aggregate returns a ItemSelect configured with the given aggregations.

func (*ItemQuery) All

func (iq *ItemQuery) All(ctx context.Context) ([]*Item, error)

All executes the query and returns a list of Items.

func (*ItemQuery) AllX

func (iq *ItemQuery) AllX(ctx context.Context) []*Item

AllX is like All, but panics if an error occurs.

func (*ItemQuery) Clone

func (iq *ItemQuery) Clone() *ItemQuery

Clone returns a duplicate of the ItemQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ItemQuery) Count

func (iq *ItemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ItemQuery) CountX

func (iq *ItemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ItemQuery) Exist

func (iq *ItemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ItemQuery) ExistX

func (iq *ItemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ItemQuery) First

func (iq *ItemQuery) First(ctx context.Context) (*Item, error)

First returns the first Item entity from the query. Returns a *NotFoundError when no Item was found.

func (*ItemQuery) FirstID

func (iq *ItemQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Item ID from the query. Returns a *NotFoundError when no Item ID was found.

func (*ItemQuery) FirstIDX

func (iq *ItemQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ItemQuery) FirstX

func (iq *ItemQuery) FirstX(ctx context.Context) *Item

FirstX is like First, but panics if an error occurs.

func (*ItemQuery) GroupBy

func (iq *ItemQuery) GroupBy(field string, fields ...string) *ItemGroupBy

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.Item.Query().
	GroupBy(item.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ItemQuery) IDs

func (iq *ItemQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Item IDs.

func (*ItemQuery) IDsX

func (iq *ItemQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ItemQuery) Limit

func (iq *ItemQuery) Limit(limit int) *ItemQuery

Limit the number of records to be returned by this query.

func (*ItemQuery) Offset

func (iq *ItemQuery) Offset(offset int) *ItemQuery

Offset to start from.

func (*ItemQuery) Only

func (iq *ItemQuery) Only(ctx context.Context) (*Item, error)

Only returns a single Item entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Item entity is found. Returns a *NotFoundError when no Item entities are found.

func (*ItemQuery) OnlyID

func (iq *ItemQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Item ID in the query. Returns a *NotSingularError when more than one Item ID is found. Returns a *NotFoundError when no entities are found.

func (*ItemQuery) OnlyIDX

func (iq *ItemQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ItemQuery) OnlyX

func (iq *ItemQuery) OnlyX(ctx context.Context) *Item

OnlyX is like Only, but panics if an error occurs.

func (*ItemQuery) Order

func (iq *ItemQuery) Order(o ...item.OrderOption) *ItemQuery

Order specifies how the records should be ordered.

func (*ItemQuery) QueryAttachments

func (iq *ItemQuery) QueryAttachments() *AttachmentQuery

QueryAttachments chains the current query on the "attachments" edge.

func (*ItemQuery) QueryChildren

func (iq *ItemQuery) QueryChildren() *ItemQuery

QueryChildren chains the current query on the "children" edge.

func (*ItemQuery) QueryFields

func (iq *ItemQuery) QueryFields() *ItemFieldQuery

QueryFields chains the current query on the "fields" edge.

func (*ItemQuery) QueryGroup

func (iq *ItemQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*ItemQuery) QueryLabel

func (iq *ItemQuery) QueryLabel() *LabelQuery

QueryLabel chains the current query on the "label" edge.

func (*ItemQuery) QueryLocation

func (iq *ItemQuery) QueryLocation() *LocationQuery

QueryLocation chains the current query on the "location" edge.

func (*ItemQuery) QueryMaintenanceEntries

func (iq *ItemQuery) QueryMaintenanceEntries() *MaintenanceEntryQuery

QueryMaintenanceEntries chains the current query on the "maintenance_entries" edge.

func (*ItemQuery) QueryParent

func (iq *ItemQuery) QueryParent() *ItemQuery

QueryParent chains the current query on the "parent" edge.

func (*ItemQuery) Select

func (iq *ItemQuery) Select(fields ...string) *ItemSelect

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.Item.Query().
	Select(item.FieldCreatedAt).
	Scan(ctx, &v)

func (*ItemQuery) Unique

func (iq *ItemQuery) Unique(unique bool) *ItemQuery

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 (*ItemQuery) Where

func (iq *ItemQuery) Where(ps ...predicate.Item) *ItemQuery

Where adds a new predicate for the ItemQuery builder.

func (*ItemQuery) WithAttachments

func (iq *ItemQuery) WithAttachments(opts ...func(*AttachmentQuery)) *ItemQuery

WithAttachments tells the query-builder to eager-load the nodes that are connected to the "attachments" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithChildren

func (iq *ItemQuery) WithChildren(opts ...func(*ItemQuery)) *ItemQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithFields

func (iq *ItemQuery) WithFields(opts ...func(*ItemFieldQuery)) *ItemQuery

WithFields tells the query-builder to eager-load the nodes that are connected to the "fields" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithGroup

func (iq *ItemQuery) WithGroup(opts ...func(*GroupQuery)) *ItemQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithLabel

func (iq *ItemQuery) WithLabel(opts ...func(*LabelQuery)) *ItemQuery

WithLabel tells the query-builder to eager-load the nodes that are connected to the "label" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithLocation

func (iq *ItemQuery) WithLocation(opts ...func(*LocationQuery)) *ItemQuery

WithLocation tells the query-builder to eager-load the nodes that are connected to the "location" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithMaintenanceEntries

func (iq *ItemQuery) WithMaintenanceEntries(opts ...func(*MaintenanceEntryQuery)) *ItemQuery

WithMaintenanceEntries tells the query-builder to eager-load the nodes that are connected to the "maintenance_entries" edge. The optional arguments are used to configure the query builder of the edge.

func (*ItemQuery) WithParent

func (iq *ItemQuery) WithParent(opts ...func(*ItemQuery)) *ItemQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

type ItemSelect

type ItemSelect struct {
	*ItemQuery
	// contains filtered or unexported fields
}

ItemSelect is the builder for selecting fields of Item entities.

func (*ItemSelect) Aggregate

func (is *ItemSelect) Aggregate(fns ...AggregateFunc) *ItemSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ItemSelect) Bool

func (s *ItemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ItemSelect) BoolX

func (s *ItemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ItemSelect) Bools

func (s *ItemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ItemSelect) BoolsX

func (s *ItemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ItemSelect) Float64

func (s *ItemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ItemSelect) Float64X

func (s *ItemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ItemSelect) Float64s

func (s *ItemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ItemSelect) Float64sX

func (s *ItemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ItemSelect) Int

func (s *ItemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ItemSelect) IntX

func (s *ItemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ItemSelect) Ints

func (s *ItemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ItemSelect) IntsX

func (s *ItemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ItemSelect) Scan

func (is *ItemSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ItemSelect) ScanX

func (s *ItemSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ItemSelect) String

func (s *ItemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ItemSelect) StringX

func (s *ItemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ItemSelect) Strings

func (s *ItemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ItemSelect) StringsX

func (s *ItemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ItemUpdate

type ItemUpdate struct {
	// contains filtered or unexported fields
}

ItemUpdate is the builder for updating Item entities.

func (*ItemUpdate) AddAssetID

func (iu *ItemUpdate) AddAssetID(i int) *ItemUpdate

AddAssetID adds i to the "asset_id" field.

func (*ItemUpdate) AddAttachmentIDs

func (iu *ItemUpdate) AddAttachmentIDs(ids ...uuid.UUID) *ItemUpdate

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*ItemUpdate) AddAttachments

func (iu *ItemUpdate) AddAttachments(a ...*Attachment) *ItemUpdate

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*ItemUpdate) AddChildIDs

func (iu *ItemUpdate) AddChildIDs(ids ...uuid.UUID) *ItemUpdate

AddChildIDs adds the "children" edge to the Item entity by IDs.

func (*ItemUpdate) AddChildren

func (iu *ItemUpdate) AddChildren(i ...*Item) *ItemUpdate

AddChildren adds the "children" edges to the Item entity.

func (*ItemUpdate) AddFieldIDs

func (iu *ItemUpdate) AddFieldIDs(ids ...uuid.UUID) *ItemUpdate

AddFieldIDs adds the "fields" edge to the ItemField entity by IDs.

func (*ItemUpdate) AddFields

func (iu *ItemUpdate) AddFields(i ...*ItemField) *ItemUpdate

AddFields adds the "fields" edges to the ItemField entity.

func (*ItemUpdate) AddLabel

func (iu *ItemUpdate) AddLabel(l ...*Label) *ItemUpdate

AddLabel adds the "label" edges to the Label entity.

func (*ItemUpdate) AddLabelIDs

func (iu *ItemUpdate) AddLabelIDs(ids ...uuid.UUID) *ItemUpdate

AddLabelIDs adds the "label" edge to the Label entity by IDs.

func (*ItemUpdate) AddMaintenanceEntries

func (iu *ItemUpdate) AddMaintenanceEntries(m ...*MaintenanceEntry) *ItemUpdate

AddMaintenanceEntries adds the "maintenance_entries" edges to the MaintenanceEntry entity.

func (*ItemUpdate) AddMaintenanceEntryIDs

func (iu *ItemUpdate) AddMaintenanceEntryIDs(ids ...uuid.UUID) *ItemUpdate

AddMaintenanceEntryIDs adds the "maintenance_entries" edge to the MaintenanceEntry entity by IDs.

func (*ItemUpdate) AddPurchasePrice

func (iu *ItemUpdate) AddPurchasePrice(f float64) *ItemUpdate

AddPurchasePrice adds f to the "purchase_price" field.

func (*ItemUpdate) AddQuantity

func (iu *ItemUpdate) AddQuantity(i int) *ItemUpdate

AddQuantity adds i to the "quantity" field.

func (*ItemUpdate) AddSoldPrice

func (iu *ItemUpdate) AddSoldPrice(f float64) *ItemUpdate

AddSoldPrice adds f to the "sold_price" field.

func (*ItemUpdate) ClearAttachments

func (iu *ItemUpdate) ClearAttachments() *ItemUpdate

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*ItemUpdate) ClearChildren

func (iu *ItemUpdate) ClearChildren() *ItemUpdate

ClearChildren clears all "children" edges to the Item entity.

func (*ItemUpdate) ClearDescription

func (iu *ItemUpdate) ClearDescription() *ItemUpdate

ClearDescription clears the value of the "description" field.

func (*ItemUpdate) ClearFields

func (iu *ItemUpdate) ClearFields() *ItemUpdate

ClearFields clears all "fields" edges to the ItemField entity.

func (*ItemUpdate) ClearGroup

func (iu *ItemUpdate) ClearGroup() *ItemUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*ItemUpdate) ClearImportRef

func (iu *ItemUpdate) ClearImportRef() *ItemUpdate

ClearImportRef clears the value of the "import_ref" field.

func (*ItemUpdate) ClearLabel

func (iu *ItemUpdate) ClearLabel() *ItemUpdate

ClearLabel clears all "label" edges to the Label entity.

func (*ItemUpdate) ClearLocation

func (iu *ItemUpdate) ClearLocation() *ItemUpdate

ClearLocation clears the "location" edge to the Location entity.

func (*ItemUpdate) ClearMaintenanceEntries

func (iu *ItemUpdate) ClearMaintenanceEntries() *ItemUpdate

ClearMaintenanceEntries clears all "maintenance_entries" edges to the MaintenanceEntry entity.

func (*ItemUpdate) ClearManufacturer

func (iu *ItemUpdate) ClearManufacturer() *ItemUpdate

ClearManufacturer clears the value of the "manufacturer" field.

func (*ItemUpdate) ClearModelNumber

func (iu *ItemUpdate) ClearModelNumber() *ItemUpdate

ClearModelNumber clears the value of the "model_number" field.

func (*ItemUpdate) ClearNotes

func (iu *ItemUpdate) ClearNotes() *ItemUpdate

ClearNotes clears the value of the "notes" field.

func (*ItemUpdate) ClearParent

func (iu *ItemUpdate) ClearParent() *ItemUpdate

ClearParent clears the "parent" edge to the Item entity.

func (*ItemUpdate) ClearPurchaseFrom

func (iu *ItemUpdate) ClearPurchaseFrom() *ItemUpdate

ClearPurchaseFrom clears the value of the "purchase_from" field.

func (*ItemUpdate) ClearPurchaseTime

func (iu *ItemUpdate) ClearPurchaseTime() *ItemUpdate

ClearPurchaseTime clears the value of the "purchase_time" field.

func (*ItemUpdate) ClearSerialNumber

func (iu *ItemUpdate) ClearSerialNumber() *ItemUpdate

ClearSerialNumber clears the value of the "serial_number" field.

func (*ItemUpdate) ClearSoldNotes

func (iu *ItemUpdate) ClearSoldNotes() *ItemUpdate

ClearSoldNotes clears the value of the "sold_notes" field.

func (*ItemUpdate) ClearSoldTime

func (iu *ItemUpdate) ClearSoldTime() *ItemUpdate

ClearSoldTime clears the value of the "sold_time" field.

func (*ItemUpdate) ClearSoldTo

func (iu *ItemUpdate) ClearSoldTo() *ItemUpdate

ClearSoldTo clears the value of the "sold_to" field.

func (*ItemUpdate) ClearWarrantyDetails

func (iu *ItemUpdate) ClearWarrantyDetails() *ItemUpdate

ClearWarrantyDetails clears the value of the "warranty_details" field.

func (*ItemUpdate) ClearWarrantyExpires

func (iu *ItemUpdate) ClearWarrantyExpires() *ItemUpdate

ClearWarrantyExpires clears the value of the "warranty_expires" field.

func (*ItemUpdate) Exec

func (iu *ItemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ItemUpdate) ExecX

func (iu *ItemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemUpdate) Mutation

func (iu *ItemUpdate) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdate) RemoveAttachmentIDs

func (iu *ItemUpdate) RemoveAttachmentIDs(ids ...uuid.UUID) *ItemUpdate

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*ItemUpdate) RemoveAttachments

func (iu *ItemUpdate) RemoveAttachments(a ...*Attachment) *ItemUpdate

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*ItemUpdate) RemoveChildIDs

func (iu *ItemUpdate) RemoveChildIDs(ids ...uuid.UUID) *ItemUpdate

RemoveChildIDs removes the "children" edge to Item entities by IDs.

func (*ItemUpdate) RemoveChildren

func (iu *ItemUpdate) RemoveChildren(i ...*Item) *ItemUpdate

RemoveChildren removes "children" edges to Item entities.

func (*ItemUpdate) RemoveFieldIDs

func (iu *ItemUpdate) RemoveFieldIDs(ids ...uuid.UUID) *ItemUpdate

RemoveFieldIDs removes the "fields" edge to ItemField entities by IDs.

func (*ItemUpdate) RemoveFields

func (iu *ItemUpdate) RemoveFields(i ...*ItemField) *ItemUpdate

RemoveFields removes "fields" edges to ItemField entities.

func (*ItemUpdate) RemoveLabel

func (iu *ItemUpdate) RemoveLabel(l ...*Label) *ItemUpdate

RemoveLabel removes "label" edges to Label entities.

func (*ItemUpdate) RemoveLabelIDs

func (iu *ItemUpdate) RemoveLabelIDs(ids ...uuid.UUID) *ItemUpdate

RemoveLabelIDs removes the "label" edge to Label entities by IDs.

func (*ItemUpdate) RemoveMaintenanceEntries

func (iu *ItemUpdate) RemoveMaintenanceEntries(m ...*MaintenanceEntry) *ItemUpdate

RemoveMaintenanceEntries removes "maintenance_entries" edges to MaintenanceEntry entities.

func (*ItemUpdate) RemoveMaintenanceEntryIDs

func (iu *ItemUpdate) RemoveMaintenanceEntryIDs(ids ...uuid.UUID) *ItemUpdate

RemoveMaintenanceEntryIDs removes the "maintenance_entries" edge to MaintenanceEntry entities by IDs.

func (*ItemUpdate) Save

func (iu *ItemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ItemUpdate) SaveX

func (iu *ItemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ItemUpdate) SetArchived

func (iu *ItemUpdate) SetArchived(b bool) *ItemUpdate

SetArchived sets the "archived" field.

func (*ItemUpdate) SetAssetID

func (iu *ItemUpdate) SetAssetID(i int) *ItemUpdate

SetAssetID sets the "asset_id" field.

func (*ItemUpdate) SetDescription

func (iu *ItemUpdate) SetDescription(s string) *ItemUpdate

SetDescription sets the "description" field.

func (*ItemUpdate) SetGroup

func (iu *ItemUpdate) SetGroup(g *Group) *ItemUpdate

SetGroup sets the "group" edge to the Group entity.

func (*ItemUpdate) SetGroupID

func (iu *ItemUpdate) SetGroupID(id uuid.UUID) *ItemUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*ItemUpdate) SetImportRef

func (iu *ItemUpdate) SetImportRef(s string) *ItemUpdate

SetImportRef sets the "import_ref" field.

func (*ItemUpdate) SetInsured

func (iu *ItemUpdate) SetInsured(b bool) *ItemUpdate

SetInsured sets the "insured" field.

func (*ItemUpdate) SetLifetimeWarranty

func (iu *ItemUpdate) SetLifetimeWarranty(b bool) *ItemUpdate

SetLifetimeWarranty sets the "lifetime_warranty" field.

func (*ItemUpdate) SetLocation

func (iu *ItemUpdate) SetLocation(l *Location) *ItemUpdate

SetLocation sets the "location" edge to the Location entity.

func (*ItemUpdate) SetLocationID

func (iu *ItemUpdate) SetLocationID(id uuid.UUID) *ItemUpdate

SetLocationID sets the "location" edge to the Location entity by ID.

func (*ItemUpdate) SetManufacturer

func (iu *ItemUpdate) SetManufacturer(s string) *ItemUpdate

SetManufacturer sets the "manufacturer" field.

func (*ItemUpdate) SetModelNumber

func (iu *ItemUpdate) SetModelNumber(s string) *ItemUpdate

SetModelNumber sets the "model_number" field.

func (*ItemUpdate) SetName

func (iu *ItemUpdate) SetName(s string) *ItemUpdate

SetName sets the "name" field.

func (*ItemUpdate) SetNillableArchived

func (iu *ItemUpdate) SetNillableArchived(b *bool) *ItemUpdate

SetNillableArchived sets the "archived" field if the given value is not nil.

func (*ItemUpdate) SetNillableAssetID

func (iu *ItemUpdate) SetNillableAssetID(i *int) *ItemUpdate

SetNillableAssetID sets the "asset_id" field if the given value is not nil.

func (*ItemUpdate) SetNillableDescription

func (iu *ItemUpdate) SetNillableDescription(s *string) *ItemUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemUpdate) SetNillableImportRef

func (iu *ItemUpdate) SetNillableImportRef(s *string) *ItemUpdate

SetNillableImportRef sets the "import_ref" field if the given value is not nil.

func (*ItemUpdate) SetNillableInsured

func (iu *ItemUpdate) SetNillableInsured(b *bool) *ItemUpdate

SetNillableInsured sets the "insured" field if the given value is not nil.

func (*ItemUpdate) SetNillableLifetimeWarranty

func (iu *ItemUpdate) SetNillableLifetimeWarranty(b *bool) *ItemUpdate

SetNillableLifetimeWarranty sets the "lifetime_warranty" field if the given value is not nil.

func (*ItemUpdate) SetNillableLocationID

func (iu *ItemUpdate) SetNillableLocationID(id *uuid.UUID) *ItemUpdate

SetNillableLocationID sets the "location" edge to the Location entity by ID if the given value is not nil.

func (*ItemUpdate) SetNillableManufacturer

func (iu *ItemUpdate) SetNillableManufacturer(s *string) *ItemUpdate

SetNillableManufacturer sets the "manufacturer" field if the given value is not nil.

func (*ItemUpdate) SetNillableModelNumber

func (iu *ItemUpdate) SetNillableModelNumber(s *string) *ItemUpdate

SetNillableModelNumber sets the "model_number" field if the given value is not nil.

func (*ItemUpdate) SetNillableName

func (iu *ItemUpdate) SetNillableName(s *string) *ItemUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ItemUpdate) SetNillableNotes

func (iu *ItemUpdate) SetNillableNotes(s *string) *ItemUpdate

SetNillableNotes sets the "notes" field if the given value is not nil.

func (*ItemUpdate) SetNillableParentID

func (iu *ItemUpdate) SetNillableParentID(id *uuid.UUID) *ItemUpdate

SetNillableParentID sets the "parent" edge to the Item entity by ID if the given value is not nil.

func (*ItemUpdate) SetNillablePurchaseFrom

func (iu *ItemUpdate) SetNillablePurchaseFrom(s *string) *ItemUpdate

SetNillablePurchaseFrom sets the "purchase_from" field if the given value is not nil.

func (*ItemUpdate) SetNillablePurchasePrice

func (iu *ItemUpdate) SetNillablePurchasePrice(f *float64) *ItemUpdate

SetNillablePurchasePrice sets the "purchase_price" field if the given value is not nil.

func (*ItemUpdate) SetNillablePurchaseTime

func (iu *ItemUpdate) SetNillablePurchaseTime(t *time.Time) *ItemUpdate

SetNillablePurchaseTime sets the "purchase_time" field if the given value is not nil.

func (*ItemUpdate) SetNillableQuantity

func (iu *ItemUpdate) SetNillableQuantity(i *int) *ItemUpdate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*ItemUpdate) SetNillableSerialNumber

func (iu *ItemUpdate) SetNillableSerialNumber(s *string) *ItemUpdate

SetNillableSerialNumber sets the "serial_number" field if the given value is not nil.

func (*ItemUpdate) SetNillableSoldNotes

func (iu *ItemUpdate) SetNillableSoldNotes(s *string) *ItemUpdate

SetNillableSoldNotes sets the "sold_notes" field if the given value is not nil.

func (*ItemUpdate) SetNillableSoldPrice

func (iu *ItemUpdate) SetNillableSoldPrice(f *float64) *ItemUpdate

SetNillableSoldPrice sets the "sold_price" field if the given value is not nil.

func (*ItemUpdate) SetNillableSoldTime

func (iu *ItemUpdate) SetNillableSoldTime(t *time.Time) *ItemUpdate

SetNillableSoldTime sets the "sold_time" field if the given value is not nil.

func (*ItemUpdate) SetNillableSoldTo

func (iu *ItemUpdate) SetNillableSoldTo(s *string) *ItemUpdate

SetNillableSoldTo sets the "sold_to" field if the given value is not nil.

func (*ItemUpdate) SetNillableWarrantyDetails

func (iu *ItemUpdate) SetNillableWarrantyDetails(s *string) *ItemUpdate

SetNillableWarrantyDetails sets the "warranty_details" field if the given value is not nil.

func (*ItemUpdate) SetNillableWarrantyExpires

func (iu *ItemUpdate) SetNillableWarrantyExpires(t *time.Time) *ItemUpdate

SetNillableWarrantyExpires sets the "warranty_expires" field if the given value is not nil.

func (*ItemUpdate) SetNotes

func (iu *ItemUpdate) SetNotes(s string) *ItemUpdate

SetNotes sets the "notes" field.

func (*ItemUpdate) SetParent

func (iu *ItemUpdate) SetParent(i *Item) *ItemUpdate

SetParent sets the "parent" edge to the Item entity.

func (*ItemUpdate) SetParentID

func (iu *ItemUpdate) SetParentID(id uuid.UUID) *ItemUpdate

SetParentID sets the "parent" edge to the Item entity by ID.

func (*ItemUpdate) SetPurchaseFrom

func (iu *ItemUpdate) SetPurchaseFrom(s string) *ItemUpdate

SetPurchaseFrom sets the "purchase_from" field.

func (*ItemUpdate) SetPurchasePrice

func (iu *ItemUpdate) SetPurchasePrice(f float64) *ItemUpdate

SetPurchasePrice sets the "purchase_price" field.

func (*ItemUpdate) SetPurchaseTime

func (iu *ItemUpdate) SetPurchaseTime(t time.Time) *ItemUpdate

SetPurchaseTime sets the "purchase_time" field.

func (*ItemUpdate) SetQuantity

func (iu *ItemUpdate) SetQuantity(i int) *ItemUpdate

SetQuantity sets the "quantity" field.

func (*ItemUpdate) SetSerialNumber

func (iu *ItemUpdate) SetSerialNumber(s string) *ItemUpdate

SetSerialNumber sets the "serial_number" field.

func (*ItemUpdate) SetSoldNotes

func (iu *ItemUpdate) SetSoldNotes(s string) *ItemUpdate

SetSoldNotes sets the "sold_notes" field.

func (*ItemUpdate) SetSoldPrice

func (iu *ItemUpdate) SetSoldPrice(f float64) *ItemUpdate

SetSoldPrice sets the "sold_price" field.

func (*ItemUpdate) SetSoldTime

func (iu *ItemUpdate) SetSoldTime(t time.Time) *ItemUpdate

SetSoldTime sets the "sold_time" field.

func (*ItemUpdate) SetSoldTo

func (iu *ItemUpdate) SetSoldTo(s string) *ItemUpdate

SetSoldTo sets the "sold_to" field.

func (*ItemUpdate) SetUpdatedAt

func (iu *ItemUpdate) SetUpdatedAt(t time.Time) *ItemUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpdate) SetWarrantyDetails

func (iu *ItemUpdate) SetWarrantyDetails(s string) *ItemUpdate

SetWarrantyDetails sets the "warranty_details" field.

func (*ItemUpdate) SetWarrantyExpires

func (iu *ItemUpdate) SetWarrantyExpires(t time.Time) *ItemUpdate

SetWarrantyExpires sets the "warranty_expires" field.

func (*ItemUpdate) Where

func (iu *ItemUpdate) Where(ps ...predicate.Item) *ItemUpdate

Where appends a list predicates to the ItemUpdate builder.

type ItemUpdateOne

type ItemUpdateOne struct {
	// contains filtered or unexported fields
}

ItemUpdateOne is the builder for updating a single Item entity.

func (*ItemUpdateOne) AddAssetID

func (iuo *ItemUpdateOne) AddAssetID(i int) *ItemUpdateOne

AddAssetID adds i to the "asset_id" field.

func (*ItemUpdateOne) AddAttachmentIDs

func (iuo *ItemUpdateOne) AddAttachmentIDs(ids ...uuid.UUID) *ItemUpdateOne

AddAttachmentIDs adds the "attachments" edge to the Attachment entity by IDs.

func (*ItemUpdateOne) AddAttachments

func (iuo *ItemUpdateOne) AddAttachments(a ...*Attachment) *ItemUpdateOne

AddAttachments adds the "attachments" edges to the Attachment entity.

func (*ItemUpdateOne) AddChildIDs

func (iuo *ItemUpdateOne) AddChildIDs(ids ...uuid.UUID) *ItemUpdateOne

AddChildIDs adds the "children" edge to the Item entity by IDs.

func (*ItemUpdateOne) AddChildren

func (iuo *ItemUpdateOne) AddChildren(i ...*Item) *ItemUpdateOne

AddChildren adds the "children" edges to the Item entity.

func (*ItemUpdateOne) AddFieldIDs

func (iuo *ItemUpdateOne) AddFieldIDs(ids ...uuid.UUID) *ItemUpdateOne

AddFieldIDs adds the "fields" edge to the ItemField entity by IDs.

func (*ItemUpdateOne) AddFields

func (iuo *ItemUpdateOne) AddFields(i ...*ItemField) *ItemUpdateOne

AddFields adds the "fields" edges to the ItemField entity.

func (*ItemUpdateOne) AddLabel

func (iuo *ItemUpdateOne) AddLabel(l ...*Label) *ItemUpdateOne

AddLabel adds the "label" edges to the Label entity.

func (*ItemUpdateOne) AddLabelIDs

func (iuo *ItemUpdateOne) AddLabelIDs(ids ...uuid.UUID) *ItemUpdateOne

AddLabelIDs adds the "label" edge to the Label entity by IDs.

func (*ItemUpdateOne) AddMaintenanceEntries

func (iuo *ItemUpdateOne) AddMaintenanceEntries(m ...*MaintenanceEntry) *ItemUpdateOne

AddMaintenanceEntries adds the "maintenance_entries" edges to the MaintenanceEntry entity.

func (*ItemUpdateOne) AddMaintenanceEntryIDs

func (iuo *ItemUpdateOne) AddMaintenanceEntryIDs(ids ...uuid.UUID) *ItemUpdateOne

AddMaintenanceEntryIDs adds the "maintenance_entries" edge to the MaintenanceEntry entity by IDs.

func (*ItemUpdateOne) AddPurchasePrice

func (iuo *ItemUpdateOne) AddPurchasePrice(f float64) *ItemUpdateOne

AddPurchasePrice adds f to the "purchase_price" field.

func (*ItemUpdateOne) AddQuantity

func (iuo *ItemUpdateOne) AddQuantity(i int) *ItemUpdateOne

AddQuantity adds i to the "quantity" field.

func (*ItemUpdateOne) AddSoldPrice

func (iuo *ItemUpdateOne) AddSoldPrice(f float64) *ItemUpdateOne

AddSoldPrice adds f to the "sold_price" field.

func (*ItemUpdateOne) ClearAttachments

func (iuo *ItemUpdateOne) ClearAttachments() *ItemUpdateOne

ClearAttachments clears all "attachments" edges to the Attachment entity.

func (*ItemUpdateOne) ClearChildren

func (iuo *ItemUpdateOne) ClearChildren() *ItemUpdateOne

ClearChildren clears all "children" edges to the Item entity.

func (*ItemUpdateOne) ClearDescription

func (iuo *ItemUpdateOne) ClearDescription() *ItemUpdateOne

ClearDescription clears the value of the "description" field.

func (*ItemUpdateOne) ClearFields

func (iuo *ItemUpdateOne) ClearFields() *ItemUpdateOne

ClearFields clears all "fields" edges to the ItemField entity.

func (*ItemUpdateOne) ClearGroup

func (iuo *ItemUpdateOne) ClearGroup() *ItemUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*ItemUpdateOne) ClearImportRef

func (iuo *ItemUpdateOne) ClearImportRef() *ItemUpdateOne

ClearImportRef clears the value of the "import_ref" field.

func (*ItemUpdateOne) ClearLabel

func (iuo *ItemUpdateOne) ClearLabel() *ItemUpdateOne

ClearLabel clears all "label" edges to the Label entity.

func (*ItemUpdateOne) ClearLocation

func (iuo *ItemUpdateOne) ClearLocation() *ItemUpdateOne

ClearLocation clears the "location" edge to the Location entity.

func (*ItemUpdateOne) ClearMaintenanceEntries

func (iuo *ItemUpdateOne) ClearMaintenanceEntries() *ItemUpdateOne

ClearMaintenanceEntries clears all "maintenance_entries" edges to the MaintenanceEntry entity.

func (*ItemUpdateOne) ClearManufacturer

func (iuo *ItemUpdateOne) ClearManufacturer() *ItemUpdateOne

ClearManufacturer clears the value of the "manufacturer" field.

func (*ItemUpdateOne) ClearModelNumber

func (iuo *ItemUpdateOne) ClearModelNumber() *ItemUpdateOne

ClearModelNumber clears the value of the "model_number" field.

func (*ItemUpdateOne) ClearNotes

func (iuo *ItemUpdateOne) ClearNotes() *ItemUpdateOne

ClearNotes clears the value of the "notes" field.

func (*ItemUpdateOne) ClearParent

func (iuo *ItemUpdateOne) ClearParent() *ItemUpdateOne

ClearParent clears the "parent" edge to the Item entity.

func (*ItemUpdateOne) ClearPurchaseFrom

func (iuo *ItemUpdateOne) ClearPurchaseFrom() *ItemUpdateOne

ClearPurchaseFrom clears the value of the "purchase_from" field.

func (*ItemUpdateOne) ClearPurchaseTime

func (iuo *ItemUpdateOne) ClearPurchaseTime() *ItemUpdateOne

ClearPurchaseTime clears the value of the "purchase_time" field.

func (*ItemUpdateOne) ClearSerialNumber

func (iuo *ItemUpdateOne) ClearSerialNumber() *ItemUpdateOne

ClearSerialNumber clears the value of the "serial_number" field.

func (*ItemUpdateOne) ClearSoldNotes

func (iuo *ItemUpdateOne) ClearSoldNotes() *ItemUpdateOne

ClearSoldNotes clears the value of the "sold_notes" field.

func (*ItemUpdateOne) ClearSoldTime

func (iuo *ItemUpdateOne) ClearSoldTime() *ItemUpdateOne

ClearSoldTime clears the value of the "sold_time" field.

func (*ItemUpdateOne) ClearSoldTo

func (iuo *ItemUpdateOne) ClearSoldTo() *ItemUpdateOne

ClearSoldTo clears the value of the "sold_to" field.

func (*ItemUpdateOne) ClearWarrantyDetails

func (iuo *ItemUpdateOne) ClearWarrantyDetails() *ItemUpdateOne

ClearWarrantyDetails clears the value of the "warranty_details" field.

func (*ItemUpdateOne) ClearWarrantyExpires

func (iuo *ItemUpdateOne) ClearWarrantyExpires() *ItemUpdateOne

ClearWarrantyExpires clears the value of the "warranty_expires" field.

func (*ItemUpdateOne) Exec

func (iuo *ItemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ItemUpdateOne) ExecX

func (iuo *ItemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ItemUpdateOne) Mutation

func (iuo *ItemUpdateOne) Mutation() *ItemMutation

Mutation returns the ItemMutation object of the builder.

func (*ItemUpdateOne) RemoveAttachmentIDs

func (iuo *ItemUpdateOne) RemoveAttachmentIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveAttachmentIDs removes the "attachments" edge to Attachment entities by IDs.

func (*ItemUpdateOne) RemoveAttachments

func (iuo *ItemUpdateOne) RemoveAttachments(a ...*Attachment) *ItemUpdateOne

RemoveAttachments removes "attachments" edges to Attachment entities.

func (*ItemUpdateOne) RemoveChildIDs

func (iuo *ItemUpdateOne) RemoveChildIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveChildIDs removes the "children" edge to Item entities by IDs.

func (*ItemUpdateOne) RemoveChildren

func (iuo *ItemUpdateOne) RemoveChildren(i ...*Item) *ItemUpdateOne

RemoveChildren removes "children" edges to Item entities.

func (*ItemUpdateOne) RemoveFieldIDs

func (iuo *ItemUpdateOne) RemoveFieldIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveFieldIDs removes the "fields" edge to ItemField entities by IDs.

func (*ItemUpdateOne) RemoveFields

func (iuo *ItemUpdateOne) RemoveFields(i ...*ItemField) *ItemUpdateOne

RemoveFields removes "fields" edges to ItemField entities.

func (*ItemUpdateOne) RemoveLabel

func (iuo *ItemUpdateOne) RemoveLabel(l ...*Label) *ItemUpdateOne

RemoveLabel removes "label" edges to Label entities.

func (*ItemUpdateOne) RemoveLabelIDs

func (iuo *ItemUpdateOne) RemoveLabelIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveLabelIDs removes the "label" edge to Label entities by IDs.

func (*ItemUpdateOne) RemoveMaintenanceEntries

func (iuo *ItemUpdateOne) RemoveMaintenanceEntries(m ...*MaintenanceEntry) *ItemUpdateOne

RemoveMaintenanceEntries removes "maintenance_entries" edges to MaintenanceEntry entities.

func (*ItemUpdateOne) RemoveMaintenanceEntryIDs

func (iuo *ItemUpdateOne) RemoveMaintenanceEntryIDs(ids ...uuid.UUID) *ItemUpdateOne

RemoveMaintenanceEntryIDs removes the "maintenance_entries" edge to MaintenanceEntry entities by IDs.

func (*ItemUpdateOne) Save

func (iuo *ItemUpdateOne) Save(ctx context.Context) (*Item, error)

Save executes the query and returns the updated Item entity.

func (*ItemUpdateOne) SaveX

func (iuo *ItemUpdateOne) SaveX(ctx context.Context) *Item

SaveX is like Save, but panics if an error occurs.

func (*ItemUpdateOne) Select

func (iuo *ItemUpdateOne) Select(field string, fields ...string) *ItemUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ItemUpdateOne) SetArchived

func (iuo *ItemUpdateOne) SetArchived(b bool) *ItemUpdateOne

SetArchived sets the "archived" field.

func (*ItemUpdateOne) SetAssetID

func (iuo *ItemUpdateOne) SetAssetID(i int) *ItemUpdateOne

SetAssetID sets the "asset_id" field.

func (*ItemUpdateOne) SetDescription

func (iuo *ItemUpdateOne) SetDescription(s string) *ItemUpdateOne

SetDescription sets the "description" field.

func (*ItemUpdateOne) SetGroup

func (iuo *ItemUpdateOne) SetGroup(g *Group) *ItemUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*ItemUpdateOne) SetGroupID

func (iuo *ItemUpdateOne) SetGroupID(id uuid.UUID) *ItemUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*ItemUpdateOne) SetImportRef

func (iuo *ItemUpdateOne) SetImportRef(s string) *ItemUpdateOne

SetImportRef sets the "import_ref" field.

func (*ItemUpdateOne) SetInsured

func (iuo *ItemUpdateOne) SetInsured(b bool) *ItemUpdateOne

SetInsured sets the "insured" field.

func (*ItemUpdateOne) SetLifetimeWarranty

func (iuo *ItemUpdateOne) SetLifetimeWarranty(b bool) *ItemUpdateOne

SetLifetimeWarranty sets the "lifetime_warranty" field.

func (*ItemUpdateOne) SetLocation

func (iuo *ItemUpdateOne) SetLocation(l *Location) *ItemUpdateOne

SetLocation sets the "location" edge to the Location entity.

func (*ItemUpdateOne) SetLocationID

func (iuo *ItemUpdateOne) SetLocationID(id uuid.UUID) *ItemUpdateOne

SetLocationID sets the "location" edge to the Location entity by ID.

func (*ItemUpdateOne) SetManufacturer

func (iuo *ItemUpdateOne) SetManufacturer(s string) *ItemUpdateOne

SetManufacturer sets the "manufacturer" field.

func (*ItemUpdateOne) SetModelNumber

func (iuo *ItemUpdateOne) SetModelNumber(s string) *ItemUpdateOne

SetModelNumber sets the "model_number" field.

func (*ItemUpdateOne) SetName

func (iuo *ItemUpdateOne) SetName(s string) *ItemUpdateOne

SetName sets the "name" field.

func (*ItemUpdateOne) SetNillableArchived

func (iuo *ItemUpdateOne) SetNillableArchived(b *bool) *ItemUpdateOne

SetNillableArchived sets the "archived" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableAssetID

func (iuo *ItemUpdateOne) SetNillableAssetID(i *int) *ItemUpdateOne

SetNillableAssetID sets the "asset_id" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableDescription

func (iuo *ItemUpdateOne) SetNillableDescription(s *string) *ItemUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableImportRef

func (iuo *ItemUpdateOne) SetNillableImportRef(s *string) *ItemUpdateOne

SetNillableImportRef sets the "import_ref" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableInsured

func (iuo *ItemUpdateOne) SetNillableInsured(b *bool) *ItemUpdateOne

SetNillableInsured sets the "insured" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableLifetimeWarranty

func (iuo *ItemUpdateOne) SetNillableLifetimeWarranty(b *bool) *ItemUpdateOne

SetNillableLifetimeWarranty sets the "lifetime_warranty" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableLocationID

func (iuo *ItemUpdateOne) SetNillableLocationID(id *uuid.UUID) *ItemUpdateOne

SetNillableLocationID sets the "location" edge to the Location entity by ID if the given value is not nil.

func (*ItemUpdateOne) SetNillableManufacturer

func (iuo *ItemUpdateOne) SetNillableManufacturer(s *string) *ItemUpdateOne

SetNillableManufacturer sets the "manufacturer" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableModelNumber

func (iuo *ItemUpdateOne) SetNillableModelNumber(s *string) *ItemUpdateOne

SetNillableModelNumber sets the "model_number" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableName

func (iuo *ItemUpdateOne) SetNillableName(s *string) *ItemUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableNotes

func (iuo *ItemUpdateOne) SetNillableNotes(s *string) *ItemUpdateOne

SetNillableNotes sets the "notes" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableParentID

func (iuo *ItemUpdateOne) SetNillableParentID(id *uuid.UUID) *ItemUpdateOne

SetNillableParentID sets the "parent" edge to the Item entity by ID if the given value is not nil.

func (*ItemUpdateOne) SetNillablePurchaseFrom

func (iuo *ItemUpdateOne) SetNillablePurchaseFrom(s *string) *ItemUpdateOne

SetNillablePurchaseFrom sets the "purchase_from" field if the given value is not nil.

func (*ItemUpdateOne) SetNillablePurchasePrice

func (iuo *ItemUpdateOne) SetNillablePurchasePrice(f *float64) *ItemUpdateOne

SetNillablePurchasePrice sets the "purchase_price" field if the given value is not nil.

func (*ItemUpdateOne) SetNillablePurchaseTime

func (iuo *ItemUpdateOne) SetNillablePurchaseTime(t *time.Time) *ItemUpdateOne

SetNillablePurchaseTime sets the "purchase_time" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableQuantity

func (iuo *ItemUpdateOne) SetNillableQuantity(i *int) *ItemUpdateOne

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableSerialNumber

func (iuo *ItemUpdateOne) SetNillableSerialNumber(s *string) *ItemUpdateOne

SetNillableSerialNumber sets the "serial_number" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableSoldNotes

func (iuo *ItemUpdateOne) SetNillableSoldNotes(s *string) *ItemUpdateOne

SetNillableSoldNotes sets the "sold_notes" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableSoldPrice

func (iuo *ItemUpdateOne) SetNillableSoldPrice(f *float64) *ItemUpdateOne

SetNillableSoldPrice sets the "sold_price" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableSoldTime

func (iuo *ItemUpdateOne) SetNillableSoldTime(t *time.Time) *ItemUpdateOne

SetNillableSoldTime sets the "sold_time" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableSoldTo

func (iuo *ItemUpdateOne) SetNillableSoldTo(s *string) *ItemUpdateOne

SetNillableSoldTo sets the "sold_to" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableWarrantyDetails

func (iuo *ItemUpdateOne) SetNillableWarrantyDetails(s *string) *ItemUpdateOne

SetNillableWarrantyDetails sets the "warranty_details" field if the given value is not nil.

func (*ItemUpdateOne) SetNillableWarrantyExpires

func (iuo *ItemUpdateOne) SetNillableWarrantyExpires(t *time.Time) *ItemUpdateOne

SetNillableWarrantyExpires sets the "warranty_expires" field if the given value is not nil.

func (*ItemUpdateOne) SetNotes

func (iuo *ItemUpdateOne) SetNotes(s string) *ItemUpdateOne

SetNotes sets the "notes" field.

func (*ItemUpdateOne) SetParent

func (iuo *ItemUpdateOne) SetParent(i *Item) *ItemUpdateOne

SetParent sets the "parent" edge to the Item entity.

func (*ItemUpdateOne) SetParentID

func (iuo *ItemUpdateOne) SetParentID(id uuid.UUID) *ItemUpdateOne

SetParentID sets the "parent" edge to the Item entity by ID.

func (*ItemUpdateOne) SetPurchaseFrom

func (iuo *ItemUpdateOne) SetPurchaseFrom(s string) *ItemUpdateOne

SetPurchaseFrom sets the "purchase_from" field.

func (*ItemUpdateOne) SetPurchasePrice

func (iuo *ItemUpdateOne) SetPurchasePrice(f float64) *ItemUpdateOne

SetPurchasePrice sets the "purchase_price" field.

func (*ItemUpdateOne) SetPurchaseTime

func (iuo *ItemUpdateOne) SetPurchaseTime(t time.Time) *ItemUpdateOne

SetPurchaseTime sets the "purchase_time" field.

func (*ItemUpdateOne) SetQuantity

func (iuo *ItemUpdateOne) SetQuantity(i int) *ItemUpdateOne

SetQuantity sets the "quantity" field.

func (*ItemUpdateOne) SetSerialNumber

func (iuo *ItemUpdateOne) SetSerialNumber(s string) *ItemUpdateOne

SetSerialNumber sets the "serial_number" field.

func (*ItemUpdateOne) SetSoldNotes

func (iuo *ItemUpdateOne) SetSoldNotes(s string) *ItemUpdateOne

SetSoldNotes sets the "sold_notes" field.

func (*ItemUpdateOne) SetSoldPrice

func (iuo *ItemUpdateOne) SetSoldPrice(f float64) *ItemUpdateOne

SetSoldPrice sets the "sold_price" field.

func (*ItemUpdateOne) SetSoldTime

func (iuo *ItemUpdateOne) SetSoldTime(t time.Time) *ItemUpdateOne

SetSoldTime sets the "sold_time" field.

func (*ItemUpdateOne) SetSoldTo

func (iuo *ItemUpdateOne) SetSoldTo(s string) *ItemUpdateOne

SetSoldTo sets the "sold_to" field.

func (*ItemUpdateOne) SetUpdatedAt

func (iuo *ItemUpdateOne) SetUpdatedAt(t time.Time) *ItemUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ItemUpdateOne) SetWarrantyDetails

func (iuo *ItemUpdateOne) SetWarrantyDetails(s string) *ItemUpdateOne

SetWarrantyDetails sets the "warranty_details" field.

func (*ItemUpdateOne) SetWarrantyExpires

func (iuo *ItemUpdateOne) SetWarrantyExpires(t time.Time) *ItemUpdateOne

SetWarrantyExpires sets the "warranty_expires" field.

func (*ItemUpdateOne) Where

func (iuo *ItemUpdateOne) Where(ps ...predicate.Item) *ItemUpdateOne

Where appends a list predicates to the ItemUpdate builder.

type Items

type Items []*Item

Items is a parsable slice of Item.

type Label

type Label struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Color holds the value of the "color" field.
	Color string `json:"color,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LabelQuery when eager-loading is set.
	Edges LabelEdges `json:"edges"`
	// contains filtered or unexported fields
}

Label is the model entity for the Label schema.

func (*Label) GetID

func (l *Label) GetID() uuid.UUID

func (*Label) QueryGroup

func (l *Label) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Label entity.

func (*Label) QueryItems

func (l *Label) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Label entity.

func (*Label) String

func (l *Label) String() string

String implements the fmt.Stringer.

func (*Label) Unwrap

func (l *Label) Unwrap() *Label

Unwrap unwraps the Label 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 (*Label) Update

func (l *Label) Update() *LabelUpdateOne

Update returns a builder for updating this Label. Note that you need to call Label.Unwrap() before calling this method if this Label was returned from a transaction, and the transaction was committed or rolled back.

func (*Label) Value

func (l *Label) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Label. This includes values selected through modifiers, order, etc.

type LabelClient

type LabelClient struct {
	// contains filtered or unexported fields
}

LabelClient is a client for the Label schema.

func NewLabelClient

func NewLabelClient(c config) *LabelClient

NewLabelClient returns a client for the Label from the given config.

func (*LabelClient) Create

func (c *LabelClient) Create() *LabelCreate

Create returns a builder for creating a Label entity.

func (*LabelClient) CreateBulk

func (c *LabelClient) CreateBulk(builders ...*LabelCreate) *LabelCreateBulk

CreateBulk returns a builder for creating a bulk of Label entities.

func (*LabelClient) Delete

func (c *LabelClient) Delete() *LabelDelete

Delete returns a delete builder for Label.

func (*LabelClient) DeleteOne

func (c *LabelClient) DeleteOne(l *Label) *LabelDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LabelClient) DeleteOneID

func (c *LabelClient) DeleteOneID(id uuid.UUID) *LabelDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LabelClient) Get

func (c *LabelClient) Get(ctx context.Context, id uuid.UUID) (*Label, error)

Get returns a Label entity by its id.

func (*LabelClient) GetX

func (c *LabelClient) GetX(ctx context.Context, id uuid.UUID) *Label

GetX is like Get, but panics if an error occurs.

func (*LabelClient) Hooks

func (c *LabelClient) Hooks() []Hook

Hooks returns the client hooks.

func (*LabelClient) Intercept

func (c *LabelClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `label.Intercept(f(g(h())))`.

func (*LabelClient) Interceptors

func (c *LabelClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LabelClient) MapCreateBulk

func (c *LabelClient) MapCreateBulk(slice any, setFunc func(*LabelCreate, int)) *LabelCreateBulk

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 (*LabelClient) Query

func (c *LabelClient) Query() *LabelQuery

Query returns a query builder for Label.

func (*LabelClient) QueryGroup

func (c *LabelClient) QueryGroup(l *Label) *GroupQuery

QueryGroup queries the group edge of a Label.

func (*LabelClient) QueryItems

func (c *LabelClient) QueryItems(l *Label) *ItemQuery

QueryItems queries the items edge of a Label.

func (*LabelClient) Update

func (c *LabelClient) Update() *LabelUpdate

Update returns an update builder for Label.

func (*LabelClient) UpdateOne

func (c *LabelClient) UpdateOne(l *Label) *LabelUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LabelClient) UpdateOneID

func (c *LabelClient) UpdateOneID(id uuid.UUID) *LabelUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LabelClient) Use

func (c *LabelClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `label.Hooks(f(g(h())))`.

type LabelCreate

type LabelCreate struct {
	// contains filtered or unexported fields
}

LabelCreate is the builder for creating a Label entity.

func (*LabelCreate) AddItemIDs

func (lc *LabelCreate) AddItemIDs(ids ...uuid.UUID) *LabelCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*LabelCreate) AddItems

func (lc *LabelCreate) AddItems(i ...*Item) *LabelCreate

AddItems adds the "items" edges to the Item entity.

func (*LabelCreate) Exec

func (lc *LabelCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LabelCreate) ExecX

func (lc *LabelCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LabelCreate) Mutation

func (lc *LabelCreate) Mutation() *LabelMutation

Mutation returns the LabelMutation object of the builder.

func (*LabelCreate) Save

func (lc *LabelCreate) Save(ctx context.Context) (*Label, error)

Save creates the Label in the database.

func (*LabelCreate) SaveX

func (lc *LabelCreate) SaveX(ctx context.Context) *Label

SaveX calls Save and panics if Save returns an error.

func (*LabelCreate) SetColor

func (lc *LabelCreate) SetColor(s string) *LabelCreate

SetColor sets the "color" field.

func (*LabelCreate) SetCreatedAt

func (lc *LabelCreate) SetCreatedAt(t time.Time) *LabelCreate

SetCreatedAt sets the "created_at" field.

func (*LabelCreate) SetDescription

func (lc *LabelCreate) SetDescription(s string) *LabelCreate

SetDescription sets the "description" field.

func (*LabelCreate) SetGroup

func (lc *LabelCreate) SetGroup(g *Group) *LabelCreate

SetGroup sets the "group" edge to the Group entity.

func (*LabelCreate) SetGroupID

func (lc *LabelCreate) SetGroupID(id uuid.UUID) *LabelCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*LabelCreate) SetID

func (lc *LabelCreate) SetID(u uuid.UUID) *LabelCreate

SetID sets the "id" field.

func (*LabelCreate) SetName

func (lc *LabelCreate) SetName(s string) *LabelCreate

SetName sets the "name" field.

func (*LabelCreate) SetNillableColor

func (lc *LabelCreate) SetNillableColor(s *string) *LabelCreate

SetNillableColor sets the "color" field if the given value is not nil.

func (*LabelCreate) SetNillableCreatedAt

func (lc *LabelCreate) SetNillableCreatedAt(t *time.Time) *LabelCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*LabelCreate) SetNillableDescription

func (lc *LabelCreate) SetNillableDescription(s *string) *LabelCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LabelCreate) SetNillableID

func (lc *LabelCreate) SetNillableID(u *uuid.UUID) *LabelCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*LabelCreate) SetNillableUpdatedAt

func (lc *LabelCreate) SetNillableUpdatedAt(t *time.Time) *LabelCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*LabelCreate) SetUpdatedAt

func (lc *LabelCreate) SetUpdatedAt(t time.Time) *LabelCreate

SetUpdatedAt sets the "updated_at" field.

type LabelCreateBulk

type LabelCreateBulk struct {
	// contains filtered or unexported fields
}

LabelCreateBulk is the builder for creating many Label entities in bulk.

func (*LabelCreateBulk) Exec

func (lcb *LabelCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LabelCreateBulk) ExecX

func (lcb *LabelCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LabelCreateBulk) Save

func (lcb *LabelCreateBulk) Save(ctx context.Context) ([]*Label, error)

Save creates the Label entities in the database.

func (*LabelCreateBulk) SaveX

func (lcb *LabelCreateBulk) SaveX(ctx context.Context) []*Label

SaveX is like Save, but panics if an error occurs.

type LabelDelete

type LabelDelete struct {
	// contains filtered or unexported fields
}

LabelDelete is the builder for deleting a Label entity.

func (*LabelDelete) Exec

func (ld *LabelDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*LabelDelete) ExecX

func (ld *LabelDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*LabelDelete) Where

func (ld *LabelDelete) Where(ps ...predicate.Label) *LabelDelete

Where appends a list predicates to the LabelDelete builder.

type LabelDeleteOne

type LabelDeleteOne struct {
	// contains filtered or unexported fields
}

LabelDeleteOne is the builder for deleting a single Label entity.

func (*LabelDeleteOne) Exec

func (ldo *LabelDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LabelDeleteOne) ExecX

func (ldo *LabelDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LabelDeleteOne) Where

func (ldo *LabelDeleteOne) Where(ps ...predicate.Label) *LabelDeleteOne

Where appends a list predicates to the LabelDelete builder.

type LabelEdges

type LabelEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// contains filtered or unexported fields
}

LabelEdges holds the relations/edges for other nodes in the graph.

func (LabelEdges) GroupOrErr

func (e LabelEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (LabelEdges) ItemsOrErr

func (e LabelEdges) ItemsOrErr() ([]*Item, error)

ItemsOrErr returns the Items value or an error if the edge was not loaded in eager-loading.

type LabelGroupBy

type LabelGroupBy struct {
	// contains filtered or unexported fields
}

LabelGroupBy is the group-by builder for Label entities.

func (*LabelGroupBy) Aggregate

func (lgb *LabelGroupBy) Aggregate(fns ...AggregateFunc) *LabelGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*LabelGroupBy) Bool

func (s *LabelGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) BoolX

func (s *LabelGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LabelGroupBy) Bools

func (s *LabelGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) BoolsX

func (s *LabelGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LabelGroupBy) Float64

func (s *LabelGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) Float64X

func (s *LabelGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LabelGroupBy) Float64s

func (s *LabelGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) Float64sX

func (s *LabelGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LabelGroupBy) Int

func (s *LabelGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) IntX

func (s *LabelGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LabelGroupBy) Ints

func (s *LabelGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) IntsX

func (s *LabelGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LabelGroupBy) Scan

func (lgb *LabelGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LabelGroupBy) ScanX

func (s *LabelGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LabelGroupBy) String

func (s *LabelGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) StringX

func (s *LabelGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LabelGroupBy) Strings

func (s *LabelGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LabelGroupBy) StringsX

func (s *LabelGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LabelMutation

type LabelMutation struct {
	// contains filtered or unexported fields
}

LabelMutation represents an operation that mutates the Label nodes in the graph.

func (*LabelMutation) AddField

func (m *LabelMutation) 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 (*LabelMutation) AddItemIDs

func (m *LabelMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*LabelMutation) AddedEdges

func (m *LabelMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LabelMutation) AddedField

func (m *LabelMutation) 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 (*LabelMutation) AddedFields

func (m *LabelMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LabelMutation) AddedIDs

func (m *LabelMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LabelMutation) ClearColor

func (m *LabelMutation) ClearColor()

ClearColor clears the value of the "color" field.

func (*LabelMutation) ClearDescription

func (m *LabelMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*LabelMutation) ClearEdge

func (m *LabelMutation) 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 (*LabelMutation) ClearField

func (m *LabelMutation) 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 (*LabelMutation) ClearGroup

func (m *LabelMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*LabelMutation) ClearItems

func (m *LabelMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*LabelMutation) ClearedEdges

func (m *LabelMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LabelMutation) ClearedFields

func (m *LabelMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LabelMutation) Client

func (m LabelMutation) 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 (*LabelMutation) Color

func (m *LabelMutation) Color() (r string, exists bool)

Color returns the value of the "color" field in the mutation.

func (*LabelMutation) ColorCleared

func (m *LabelMutation) ColorCleared() bool

ColorCleared returns if the "color" field was cleared in this mutation.

func (*LabelMutation) CreatedAt

func (m *LabelMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*LabelMutation) Description

func (m *LabelMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*LabelMutation) DescriptionCleared

func (m *LabelMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*LabelMutation) EdgeCleared

func (m *LabelMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LabelMutation) Field

func (m *LabelMutation) 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 (*LabelMutation) FieldCleared

func (m *LabelMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LabelMutation) Fields

func (m *LabelMutation) 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 (*LabelMutation) GroupCleared

func (m *LabelMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*LabelMutation) GroupID

func (m *LabelMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*LabelMutation) GroupIDs

func (m *LabelMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*LabelMutation) ID

func (m *LabelMutation) ID() (id uuid.UUID, 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 (*LabelMutation) IDs

func (m *LabelMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*LabelMutation) ItemsCleared

func (m *LabelMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*LabelMutation) ItemsIDs

func (m *LabelMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*LabelMutation) Name

func (m *LabelMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*LabelMutation) OldColor

func (m *LabelMutation) OldColor(ctx context.Context) (v string, err error)

OldColor returns the old "color" field's value of the Label entity. If the Label object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LabelMutation) OldCreatedAt

func (m *LabelMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Label entity. If the Label object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LabelMutation) OldDescription

func (m *LabelMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Label entity. If the Label object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LabelMutation) OldField

func (m *LabelMutation) 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 (*LabelMutation) OldName

func (m *LabelMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Label entity. If the Label object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LabelMutation) OldUpdatedAt

func (m *LabelMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Label entity. If the Label object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LabelMutation) Op

func (m *LabelMutation) Op() Op

Op returns the operation name.

func (*LabelMutation) RemoveItemIDs

func (m *LabelMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*LabelMutation) RemovedEdges

func (m *LabelMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LabelMutation) RemovedIDs

func (m *LabelMutation) 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 (*LabelMutation) RemovedItemsIDs

func (m *LabelMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*LabelMutation) ResetColor

func (m *LabelMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*LabelMutation) ResetCreatedAt

func (m *LabelMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LabelMutation) ResetDescription

func (m *LabelMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*LabelMutation) ResetEdge

func (m *LabelMutation) 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 (*LabelMutation) ResetField

func (m *LabelMutation) 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 (*LabelMutation) ResetGroup

func (m *LabelMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*LabelMutation) ResetItems

func (m *LabelMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*LabelMutation) ResetName

func (m *LabelMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LabelMutation) ResetUpdatedAt

func (m *LabelMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*LabelMutation) SetColor

func (m *LabelMutation) SetColor(s string)

SetColor sets the "color" field.

func (*LabelMutation) SetCreatedAt

func (m *LabelMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*LabelMutation) SetDescription

func (m *LabelMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*LabelMutation) SetField

func (m *LabelMutation) 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 (*LabelMutation) SetGroupID

func (m *LabelMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*LabelMutation) SetID

func (m *LabelMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Label entities.

func (*LabelMutation) SetName

func (m *LabelMutation) SetName(s string)

SetName sets the "name" field.

func (*LabelMutation) SetOp

func (m *LabelMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LabelMutation) SetUpdatedAt

func (m *LabelMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (LabelMutation) Tx

func (m LabelMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LabelMutation) Type

func (m *LabelMutation) Type() string

Type returns the node type of this mutation (Label).

func (*LabelMutation) UpdatedAt

func (m *LabelMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*LabelMutation) Where

func (m *LabelMutation) Where(ps ...predicate.Label)

Where appends a list predicates to the LabelMutation builder.

func (*LabelMutation) WhereP

func (m *LabelMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LabelMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LabelQuery

type LabelQuery struct {
	// contains filtered or unexported fields
}

LabelQuery is the builder for querying Label entities.

func (*LabelQuery) Aggregate

func (lq *LabelQuery) Aggregate(fns ...AggregateFunc) *LabelSelect

Aggregate returns a LabelSelect configured with the given aggregations.

func (*LabelQuery) All

func (lq *LabelQuery) All(ctx context.Context) ([]*Label, error)

All executes the query and returns a list of Labels.

func (*LabelQuery) AllX

func (lq *LabelQuery) AllX(ctx context.Context) []*Label

AllX is like All, but panics if an error occurs.

func (*LabelQuery) Clone

func (lq *LabelQuery) Clone() *LabelQuery

Clone returns a duplicate of the LabelQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LabelQuery) Count

func (lq *LabelQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LabelQuery) CountX

func (lq *LabelQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LabelQuery) Exist

func (lq *LabelQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LabelQuery) ExistX

func (lq *LabelQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LabelQuery) First

func (lq *LabelQuery) First(ctx context.Context) (*Label, error)

First returns the first Label entity from the query. Returns a *NotFoundError when no Label was found.

func (*LabelQuery) FirstID

func (lq *LabelQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Label ID from the query. Returns a *NotFoundError when no Label ID was found.

func (*LabelQuery) FirstIDX

func (lq *LabelQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*LabelQuery) FirstX

func (lq *LabelQuery) FirstX(ctx context.Context) *Label

FirstX is like First, but panics if an error occurs.

func (*LabelQuery) GroupBy

func (lq *LabelQuery) GroupBy(field string, fields ...string) *LabelGroupBy

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.Label.Query().
	GroupBy(label.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LabelQuery) IDs

func (lq *LabelQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Label IDs.

func (*LabelQuery) IDsX

func (lq *LabelQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*LabelQuery) Limit

func (lq *LabelQuery) Limit(limit int) *LabelQuery

Limit the number of records to be returned by this query.

func (*LabelQuery) Offset

func (lq *LabelQuery) Offset(offset int) *LabelQuery

Offset to start from.

func (*LabelQuery) Only

func (lq *LabelQuery) Only(ctx context.Context) (*Label, error)

Only returns a single Label entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Label entity is found. Returns a *NotFoundError when no Label entities are found.

func (*LabelQuery) OnlyID

func (lq *LabelQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Label ID in the query. Returns a *NotSingularError when more than one Label ID is found. Returns a *NotFoundError when no entities are found.

func (*LabelQuery) OnlyIDX

func (lq *LabelQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LabelQuery) OnlyX

func (lq *LabelQuery) OnlyX(ctx context.Context) *Label

OnlyX is like Only, but panics if an error occurs.

func (*LabelQuery) Order

func (lq *LabelQuery) Order(o ...label.OrderOption) *LabelQuery

Order specifies how the records should be ordered.

func (*LabelQuery) QueryGroup

func (lq *LabelQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*LabelQuery) QueryItems

func (lq *LabelQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*LabelQuery) Select

func (lq *LabelQuery) Select(fields ...string) *LabelSelect

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.Label.Query().
	Select(label.FieldCreatedAt).
	Scan(ctx, &v)

func (*LabelQuery) Unique

func (lq *LabelQuery) Unique(unique bool) *LabelQuery

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 (*LabelQuery) Where

func (lq *LabelQuery) Where(ps ...predicate.Label) *LabelQuery

Where adds a new predicate for the LabelQuery builder.

func (*LabelQuery) WithGroup

func (lq *LabelQuery) WithGroup(opts ...func(*GroupQuery)) *LabelQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*LabelQuery) WithItems

func (lq *LabelQuery) WithItems(opts ...func(*ItemQuery)) *LabelQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" edge. The optional arguments are used to configure the query builder of the edge.

type LabelSelect

type LabelSelect struct {
	*LabelQuery
	// contains filtered or unexported fields
}

LabelSelect is the builder for selecting fields of Label entities.

func (*LabelSelect) Aggregate

func (ls *LabelSelect) Aggregate(fns ...AggregateFunc) *LabelSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LabelSelect) Bool

func (s *LabelSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LabelSelect) BoolX

func (s *LabelSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LabelSelect) Bools

func (s *LabelSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LabelSelect) BoolsX

func (s *LabelSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LabelSelect) Float64

func (s *LabelSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LabelSelect) Float64X

func (s *LabelSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LabelSelect) Float64s

func (s *LabelSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LabelSelect) Float64sX

func (s *LabelSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LabelSelect) Int

func (s *LabelSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LabelSelect) IntX

func (s *LabelSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LabelSelect) Ints

func (s *LabelSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LabelSelect) IntsX

func (s *LabelSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LabelSelect) Scan

func (ls *LabelSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LabelSelect) ScanX

func (s *LabelSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LabelSelect) String

func (s *LabelSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LabelSelect) StringX

func (s *LabelSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LabelSelect) Strings

func (s *LabelSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LabelSelect) StringsX

func (s *LabelSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LabelUpdate

type LabelUpdate struct {
	// contains filtered or unexported fields
}

LabelUpdate is the builder for updating Label entities.

func (*LabelUpdate) AddItemIDs

func (lu *LabelUpdate) AddItemIDs(ids ...uuid.UUID) *LabelUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*LabelUpdate) AddItems

func (lu *LabelUpdate) AddItems(i ...*Item) *LabelUpdate

AddItems adds the "items" edges to the Item entity.

func (*LabelUpdate) ClearColor

func (lu *LabelUpdate) ClearColor() *LabelUpdate

ClearColor clears the value of the "color" field.

func (*LabelUpdate) ClearDescription

func (lu *LabelUpdate) ClearDescription() *LabelUpdate

ClearDescription clears the value of the "description" field.

func (*LabelUpdate) ClearGroup

func (lu *LabelUpdate) ClearGroup() *LabelUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*LabelUpdate) ClearItems

func (lu *LabelUpdate) ClearItems() *LabelUpdate

ClearItems clears all "items" edges to the Item entity.

func (*LabelUpdate) Exec

func (lu *LabelUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LabelUpdate) ExecX

func (lu *LabelUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LabelUpdate) Mutation

func (lu *LabelUpdate) Mutation() *LabelMutation

Mutation returns the LabelMutation object of the builder.

func (*LabelUpdate) RemoveItemIDs

func (lu *LabelUpdate) RemoveItemIDs(ids ...uuid.UUID) *LabelUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*LabelUpdate) RemoveItems

func (lu *LabelUpdate) RemoveItems(i ...*Item) *LabelUpdate

RemoveItems removes "items" edges to Item entities.

func (*LabelUpdate) Save

func (lu *LabelUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LabelUpdate) SaveX

func (lu *LabelUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LabelUpdate) SetColor

func (lu *LabelUpdate) SetColor(s string) *LabelUpdate

SetColor sets the "color" field.

func (*LabelUpdate) SetDescription

func (lu *LabelUpdate) SetDescription(s string) *LabelUpdate

SetDescription sets the "description" field.

func (*LabelUpdate) SetGroup

func (lu *LabelUpdate) SetGroup(g *Group) *LabelUpdate

SetGroup sets the "group" edge to the Group entity.

func (*LabelUpdate) SetGroupID

func (lu *LabelUpdate) SetGroupID(id uuid.UUID) *LabelUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*LabelUpdate) SetName

func (lu *LabelUpdate) SetName(s string) *LabelUpdate

SetName sets the "name" field.

func (*LabelUpdate) SetNillableColor

func (lu *LabelUpdate) SetNillableColor(s *string) *LabelUpdate

SetNillableColor sets the "color" field if the given value is not nil.

func (*LabelUpdate) SetNillableDescription

func (lu *LabelUpdate) SetNillableDescription(s *string) *LabelUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LabelUpdate) SetNillableName

func (lu *LabelUpdate) SetNillableName(s *string) *LabelUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*LabelUpdate) SetUpdatedAt

func (lu *LabelUpdate) SetUpdatedAt(t time.Time) *LabelUpdate

SetUpdatedAt sets the "updated_at" field.

func (*LabelUpdate) Where

func (lu *LabelUpdate) Where(ps ...predicate.Label) *LabelUpdate

Where appends a list predicates to the LabelUpdate builder.

type LabelUpdateOne

type LabelUpdateOne struct {
	// contains filtered or unexported fields
}

LabelUpdateOne is the builder for updating a single Label entity.

func (*LabelUpdateOne) AddItemIDs

func (luo *LabelUpdateOne) AddItemIDs(ids ...uuid.UUID) *LabelUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*LabelUpdateOne) AddItems

func (luo *LabelUpdateOne) AddItems(i ...*Item) *LabelUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*LabelUpdateOne) ClearColor

func (luo *LabelUpdateOne) ClearColor() *LabelUpdateOne

ClearColor clears the value of the "color" field.

func (*LabelUpdateOne) ClearDescription

func (luo *LabelUpdateOne) ClearDescription() *LabelUpdateOne

ClearDescription clears the value of the "description" field.

func (*LabelUpdateOne) ClearGroup

func (luo *LabelUpdateOne) ClearGroup() *LabelUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*LabelUpdateOne) ClearItems

func (luo *LabelUpdateOne) ClearItems() *LabelUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*LabelUpdateOne) Exec

func (luo *LabelUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LabelUpdateOne) ExecX

func (luo *LabelUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LabelUpdateOne) Mutation

func (luo *LabelUpdateOne) Mutation() *LabelMutation

Mutation returns the LabelMutation object of the builder.

func (*LabelUpdateOne) RemoveItemIDs

func (luo *LabelUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *LabelUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*LabelUpdateOne) RemoveItems

func (luo *LabelUpdateOne) RemoveItems(i ...*Item) *LabelUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*LabelUpdateOne) Save

func (luo *LabelUpdateOne) Save(ctx context.Context) (*Label, error)

Save executes the query and returns the updated Label entity.

func (*LabelUpdateOne) SaveX

func (luo *LabelUpdateOne) SaveX(ctx context.Context) *Label

SaveX is like Save, but panics if an error occurs.

func (*LabelUpdateOne) Select

func (luo *LabelUpdateOne) Select(field string, fields ...string) *LabelUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LabelUpdateOne) SetColor

func (luo *LabelUpdateOne) SetColor(s string) *LabelUpdateOne

SetColor sets the "color" field.

func (*LabelUpdateOne) SetDescription

func (luo *LabelUpdateOne) SetDescription(s string) *LabelUpdateOne

SetDescription sets the "description" field.

func (*LabelUpdateOne) SetGroup

func (luo *LabelUpdateOne) SetGroup(g *Group) *LabelUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*LabelUpdateOne) SetGroupID

func (luo *LabelUpdateOne) SetGroupID(id uuid.UUID) *LabelUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*LabelUpdateOne) SetName

func (luo *LabelUpdateOne) SetName(s string) *LabelUpdateOne

SetName sets the "name" field.

func (*LabelUpdateOne) SetNillableColor

func (luo *LabelUpdateOne) SetNillableColor(s *string) *LabelUpdateOne

SetNillableColor sets the "color" field if the given value is not nil.

func (*LabelUpdateOne) SetNillableDescription

func (luo *LabelUpdateOne) SetNillableDescription(s *string) *LabelUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LabelUpdateOne) SetNillableName

func (luo *LabelUpdateOne) SetNillableName(s *string) *LabelUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*LabelUpdateOne) SetUpdatedAt

func (luo *LabelUpdateOne) SetUpdatedAt(t time.Time) *LabelUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*LabelUpdateOne) Where

func (luo *LabelUpdateOne) Where(ps ...predicate.Label) *LabelUpdateOne

Where appends a list predicates to the LabelUpdate builder.

type Labels

type Labels []*Label

Labels is a parsable slice of Label.

type Location

type Location struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LocationQuery when eager-loading is set.
	Edges LocationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Location is the model entity for the Location schema.

func (*Location) GetID

func (l *Location) GetID() uuid.UUID

func (*Location) QueryChildren

func (l *Location) QueryChildren() *LocationQuery

QueryChildren queries the "children" edge of the Location entity.

func (*Location) QueryGroup

func (l *Location) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Location entity.

func (*Location) QueryItems

func (l *Location) QueryItems() *ItemQuery

QueryItems queries the "items" edge of the Location entity.

func (*Location) QueryParent

func (l *Location) QueryParent() *LocationQuery

QueryParent queries the "parent" edge of the Location entity.

func (*Location) String

func (l *Location) String() string

String implements the fmt.Stringer.

func (*Location) Unwrap

func (l *Location) Unwrap() *Location

Unwrap unwraps the Location 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 (*Location) Update

func (l *Location) Update() *LocationUpdateOne

Update returns a builder for updating this Location. Note that you need to call Location.Unwrap() before calling this method if this Location was returned from a transaction, and the transaction was committed or rolled back.

func (*Location) Value

func (l *Location) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Location. This includes values selected through modifiers, order, etc.

type LocationClient

type LocationClient struct {
	// contains filtered or unexported fields
}

LocationClient is a client for the Location schema.

func NewLocationClient

func NewLocationClient(c config) *LocationClient

NewLocationClient returns a client for the Location from the given config.

func (*LocationClient) Create

func (c *LocationClient) Create() *LocationCreate

Create returns a builder for creating a Location entity.

func (*LocationClient) CreateBulk

func (c *LocationClient) CreateBulk(builders ...*LocationCreate) *LocationCreateBulk

CreateBulk returns a builder for creating a bulk of Location entities.

func (*LocationClient) Delete

func (c *LocationClient) Delete() *LocationDelete

Delete returns a delete builder for Location.

func (*LocationClient) DeleteOne

func (c *LocationClient) DeleteOne(l *Location) *LocationDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LocationClient) DeleteOneID

func (c *LocationClient) DeleteOneID(id uuid.UUID) *LocationDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LocationClient) Get

func (c *LocationClient) Get(ctx context.Context, id uuid.UUID) (*Location, error)

Get returns a Location entity by its id.

func (*LocationClient) GetX

func (c *LocationClient) GetX(ctx context.Context, id uuid.UUID) *Location

GetX is like Get, but panics if an error occurs.

func (*LocationClient) Hooks

func (c *LocationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*LocationClient) Intercept

func (c *LocationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `location.Intercept(f(g(h())))`.

func (*LocationClient) Interceptors

func (c *LocationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LocationClient) MapCreateBulk

func (c *LocationClient) MapCreateBulk(slice any, setFunc func(*LocationCreate, int)) *LocationCreateBulk

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 (*LocationClient) Query

func (c *LocationClient) Query() *LocationQuery

Query returns a query builder for Location.

func (*LocationClient) QueryChildren

func (c *LocationClient) QueryChildren(l *Location) *LocationQuery

QueryChildren queries the children edge of a Location.

func (*LocationClient) QueryGroup

func (c *LocationClient) QueryGroup(l *Location) *GroupQuery

QueryGroup queries the group edge of a Location.

func (*LocationClient) QueryItems

func (c *LocationClient) QueryItems(l *Location) *ItemQuery

QueryItems queries the items edge of a Location.

func (*LocationClient) QueryParent

func (c *LocationClient) QueryParent(l *Location) *LocationQuery

QueryParent queries the parent edge of a Location.

func (*LocationClient) Update

func (c *LocationClient) Update() *LocationUpdate

Update returns an update builder for Location.

func (*LocationClient) UpdateOne

func (c *LocationClient) UpdateOne(l *Location) *LocationUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LocationClient) UpdateOneID

func (c *LocationClient) UpdateOneID(id uuid.UUID) *LocationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LocationClient) Use

func (c *LocationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `location.Hooks(f(g(h())))`.

type LocationCreate

type LocationCreate struct {
	// contains filtered or unexported fields
}

LocationCreate is the builder for creating a Location entity.

func (*LocationCreate) AddChildIDs

func (lc *LocationCreate) AddChildIDs(ids ...uuid.UUID) *LocationCreate

AddChildIDs adds the "children" edge to the Location entity by IDs.

func (*LocationCreate) AddChildren

func (lc *LocationCreate) AddChildren(l ...*Location) *LocationCreate

AddChildren adds the "children" edges to the Location entity.

func (*LocationCreate) AddItemIDs

func (lc *LocationCreate) AddItemIDs(ids ...uuid.UUID) *LocationCreate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*LocationCreate) AddItems

func (lc *LocationCreate) AddItems(i ...*Item) *LocationCreate

AddItems adds the "items" edges to the Item entity.

func (*LocationCreate) Exec

func (lc *LocationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreate) ExecX

func (lc *LocationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationCreate) Mutation

func (lc *LocationCreate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationCreate) Save

func (lc *LocationCreate) Save(ctx context.Context) (*Location, error)

Save creates the Location in the database.

func (*LocationCreate) SaveX

func (lc *LocationCreate) SaveX(ctx context.Context) *Location

SaveX calls Save and panics if Save returns an error.

func (*LocationCreate) SetCreatedAt

func (lc *LocationCreate) SetCreatedAt(t time.Time) *LocationCreate

SetCreatedAt sets the "created_at" field.

func (*LocationCreate) SetDescription

func (lc *LocationCreate) SetDescription(s string) *LocationCreate

SetDescription sets the "description" field.

func (*LocationCreate) SetGroup

func (lc *LocationCreate) SetGroup(g *Group) *LocationCreate

SetGroup sets the "group" edge to the Group entity.

func (*LocationCreate) SetGroupID

func (lc *LocationCreate) SetGroupID(id uuid.UUID) *LocationCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*LocationCreate) SetID

func (lc *LocationCreate) SetID(u uuid.UUID) *LocationCreate

SetID sets the "id" field.

func (*LocationCreate) SetName

func (lc *LocationCreate) SetName(s string) *LocationCreate

SetName sets the "name" field.

func (*LocationCreate) SetNillableCreatedAt

func (lc *LocationCreate) SetNillableCreatedAt(t *time.Time) *LocationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*LocationCreate) SetNillableDescription

func (lc *LocationCreate) SetNillableDescription(s *string) *LocationCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LocationCreate) SetNillableID

func (lc *LocationCreate) SetNillableID(u *uuid.UUID) *LocationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*LocationCreate) SetNillableParentID

func (lc *LocationCreate) SetNillableParentID(id *uuid.UUID) *LocationCreate

SetNillableParentID sets the "parent" edge to the Location entity by ID if the given value is not nil.

func (*LocationCreate) SetNillableUpdatedAt

func (lc *LocationCreate) SetNillableUpdatedAt(t *time.Time) *LocationCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*LocationCreate) SetParent

func (lc *LocationCreate) SetParent(l *Location) *LocationCreate

SetParent sets the "parent" edge to the Location entity.

func (*LocationCreate) SetParentID

func (lc *LocationCreate) SetParentID(id uuid.UUID) *LocationCreate

SetParentID sets the "parent" edge to the Location entity by ID.

func (*LocationCreate) SetUpdatedAt

func (lc *LocationCreate) SetUpdatedAt(t time.Time) *LocationCreate

SetUpdatedAt sets the "updated_at" field.

type LocationCreateBulk

type LocationCreateBulk struct {
	// contains filtered or unexported fields
}

LocationCreateBulk is the builder for creating many Location entities in bulk.

func (*LocationCreateBulk) Exec

func (lcb *LocationCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationCreateBulk) ExecX

func (lcb *LocationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationCreateBulk) Save

func (lcb *LocationCreateBulk) Save(ctx context.Context) ([]*Location, error)

Save creates the Location entities in the database.

func (*LocationCreateBulk) SaveX

func (lcb *LocationCreateBulk) SaveX(ctx context.Context) []*Location

SaveX is like Save, but panics if an error occurs.

type LocationDelete

type LocationDelete struct {
	// contains filtered or unexported fields
}

LocationDelete is the builder for deleting a Location entity.

func (*LocationDelete) Exec

func (ld *LocationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*LocationDelete) ExecX

func (ld *LocationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*LocationDelete) Where

func (ld *LocationDelete) Where(ps ...predicate.Location) *LocationDelete

Where appends a list predicates to the LocationDelete builder.

type LocationDeleteOne

type LocationDeleteOne struct {
	// contains filtered or unexported fields
}

LocationDeleteOne is the builder for deleting a single Location entity.

func (*LocationDeleteOne) Exec

func (ldo *LocationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LocationDeleteOne) ExecX

func (ldo *LocationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationDeleteOne) Where

Where appends a list predicates to the LocationDelete builder.

type LocationEdges

type LocationEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *Location `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Location `json:"children,omitempty"`
	// Items holds the value of the items edge.
	Items []*Item `json:"items,omitempty"`
	// contains filtered or unexported fields
}

LocationEdges holds the relations/edges for other nodes in the graph.

func (LocationEdges) ChildrenOrErr

func (e LocationEdges) ChildrenOrErr() ([]*Location, error)

ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.

func (LocationEdges) GroupOrErr

func (e LocationEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (LocationEdges) ItemsOrErr

func (e LocationEdges) ItemsOrErr() ([]*Item, error)

ItemsOrErr returns the Items value or an error if the edge was not loaded in eager-loading.

func (LocationEdges) ParentOrErr

func (e LocationEdges) ParentOrErr() (*Location, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type LocationGroupBy

type LocationGroupBy struct {
	// contains filtered or unexported fields
}

LocationGroupBy is the group-by builder for Location entities.

func (*LocationGroupBy) Aggregate

func (lgb *LocationGroupBy) Aggregate(fns ...AggregateFunc) *LocationGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*LocationGroupBy) Bool

func (s *LocationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) BoolX

func (s *LocationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LocationGroupBy) Bools

func (s *LocationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) BoolsX

func (s *LocationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LocationGroupBy) Float64

func (s *LocationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) Float64X

func (s *LocationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LocationGroupBy) Float64s

func (s *LocationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) Float64sX

func (s *LocationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LocationGroupBy) Int

func (s *LocationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) IntX

func (s *LocationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LocationGroupBy) Ints

func (s *LocationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) IntsX

func (s *LocationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LocationGroupBy) Scan

func (lgb *LocationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LocationGroupBy) ScanX

func (s *LocationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LocationGroupBy) String

func (s *LocationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) StringX

func (s *LocationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LocationGroupBy) Strings

func (s *LocationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LocationGroupBy) StringsX

func (s *LocationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LocationMutation

type LocationMutation struct {
	// contains filtered or unexported fields
}

LocationMutation represents an operation that mutates the Location nodes in the graph.

func (*LocationMutation) AddChildIDs

func (m *LocationMutation) AddChildIDs(ids ...uuid.UUID)

AddChildIDs adds the "children" edge to the Location entity by ids.

func (*LocationMutation) AddField

func (m *LocationMutation) 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 (*LocationMutation) AddItemIDs

func (m *LocationMutation) AddItemIDs(ids ...uuid.UUID)

AddItemIDs adds the "items" edge to the Item entity by ids.

func (*LocationMutation) AddedEdges

func (m *LocationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LocationMutation) AddedField

func (m *LocationMutation) 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 (*LocationMutation) AddedFields

func (m *LocationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LocationMutation) AddedIDs

func (m *LocationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LocationMutation) ChildrenCleared

func (m *LocationMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Location entity was cleared.

func (*LocationMutation) ChildrenIDs

func (m *LocationMutation) ChildrenIDs() (ids []uuid.UUID)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*LocationMutation) ClearChildren

func (m *LocationMutation) ClearChildren()

ClearChildren clears the "children" edge to the Location entity.

func (*LocationMutation) ClearDescription

func (m *LocationMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*LocationMutation) ClearEdge

func (m *LocationMutation) 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 (*LocationMutation) ClearField

func (m *LocationMutation) 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 (*LocationMutation) ClearGroup

func (m *LocationMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*LocationMutation) ClearItems

func (m *LocationMutation) ClearItems()

ClearItems clears the "items" edge to the Item entity.

func (*LocationMutation) ClearParent

func (m *LocationMutation) ClearParent()

ClearParent clears the "parent" edge to the Location entity.

func (*LocationMutation) ClearedEdges

func (m *LocationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LocationMutation) ClearedFields

func (m *LocationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LocationMutation) Client

func (m LocationMutation) 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 (*LocationMutation) CreatedAt

func (m *LocationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*LocationMutation) Description

func (m *LocationMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*LocationMutation) DescriptionCleared

func (m *LocationMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*LocationMutation) EdgeCleared

func (m *LocationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LocationMutation) Field

func (m *LocationMutation) 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 (*LocationMutation) FieldCleared

func (m *LocationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LocationMutation) Fields

func (m *LocationMutation) 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 (*LocationMutation) GroupCleared

func (m *LocationMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*LocationMutation) GroupID

func (m *LocationMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*LocationMutation) GroupIDs

func (m *LocationMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*LocationMutation) ID

func (m *LocationMutation) ID() (id uuid.UUID, 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 (*LocationMutation) IDs

func (m *LocationMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*LocationMutation) ItemsCleared

func (m *LocationMutation) ItemsCleared() bool

ItemsCleared reports if the "items" edge to the Item entity was cleared.

func (*LocationMutation) ItemsIDs

func (m *LocationMutation) ItemsIDs() (ids []uuid.UUID)

ItemsIDs returns the "items" edge IDs in the mutation.

func (*LocationMutation) Name

func (m *LocationMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*LocationMutation) OldCreatedAt

func (m *LocationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldDescription

func (m *LocationMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldField

func (m *LocationMutation) 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 (*LocationMutation) OldName

func (m *LocationMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) OldUpdatedAt

func (m *LocationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Location entity. If the Location object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*LocationMutation) Op

func (m *LocationMutation) Op() Op

Op returns the operation name.

func (*LocationMutation) ParentCleared

func (m *LocationMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Location entity was cleared.

func (*LocationMutation) ParentID

func (m *LocationMutation) ParentID() (id uuid.UUID, exists bool)

ParentID returns the "parent" edge ID in the mutation.

func (*LocationMutation) ParentIDs

func (m *LocationMutation) ParentIDs() (ids []uuid.UUID)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (*LocationMutation) RemoveChildIDs

func (m *LocationMutation) RemoveChildIDs(ids ...uuid.UUID)

RemoveChildIDs removes the "children" edge to the Location entity by IDs.

func (*LocationMutation) RemoveItemIDs

func (m *LocationMutation) RemoveItemIDs(ids ...uuid.UUID)

RemoveItemIDs removes the "items" edge to the Item entity by IDs.

func (*LocationMutation) RemovedChildrenIDs

func (m *LocationMutation) RemovedChildrenIDs() (ids []uuid.UUID)

RemovedChildren returns the removed IDs of the "children" edge to the Location entity.

func (*LocationMutation) RemovedEdges

func (m *LocationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LocationMutation) RemovedIDs

func (m *LocationMutation) 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 (*LocationMutation) RemovedItemsIDs

func (m *LocationMutation) RemovedItemsIDs() (ids []uuid.UUID)

RemovedItems returns the removed IDs of the "items" edge to the Item entity.

func (*LocationMutation) ResetChildren

func (m *LocationMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*LocationMutation) ResetCreatedAt

func (m *LocationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LocationMutation) ResetDescription

func (m *LocationMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*LocationMutation) ResetEdge

func (m *LocationMutation) 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 (*LocationMutation) ResetField

func (m *LocationMutation) 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 (*LocationMutation) ResetGroup

func (m *LocationMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*LocationMutation) ResetItems

func (m *LocationMutation) ResetItems()

ResetItems resets all changes to the "items" edge.

func (*LocationMutation) ResetName

func (m *LocationMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LocationMutation) ResetParent

func (m *LocationMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*LocationMutation) ResetUpdatedAt

func (m *LocationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*LocationMutation) SetCreatedAt

func (m *LocationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*LocationMutation) SetDescription

func (m *LocationMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*LocationMutation) SetField

func (m *LocationMutation) 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 (*LocationMutation) SetGroupID

func (m *LocationMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*LocationMutation) SetID

func (m *LocationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Location entities.

func (*LocationMutation) SetName

func (m *LocationMutation) SetName(s string)

SetName sets the "name" field.

func (*LocationMutation) SetOp

func (m *LocationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LocationMutation) SetParentID

func (m *LocationMutation) SetParentID(id uuid.UUID)

SetParentID sets the "parent" edge to the Location entity by id.

func (*LocationMutation) SetUpdatedAt

func (m *LocationMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (LocationMutation) Tx

func (m LocationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LocationMutation) Type

func (m *LocationMutation) Type() string

Type returns the node type of this mutation (Location).

func (*LocationMutation) UpdatedAt

func (m *LocationMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*LocationMutation) Where

func (m *LocationMutation) Where(ps ...predicate.Location)

Where appends a list predicates to the LocationMutation builder.

func (*LocationMutation) WhereP

func (m *LocationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LocationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LocationQuery

type LocationQuery struct {
	// contains filtered or unexported fields
}

LocationQuery is the builder for querying Location entities.

func (*LocationQuery) Aggregate

func (lq *LocationQuery) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate returns a LocationSelect configured with the given aggregations.

func (*LocationQuery) All

func (lq *LocationQuery) All(ctx context.Context) ([]*Location, error)

All executes the query and returns a list of Locations.

func (*LocationQuery) AllX

func (lq *LocationQuery) AllX(ctx context.Context) []*Location

AllX is like All, but panics if an error occurs.

func (*LocationQuery) Clone

func (lq *LocationQuery) Clone() *LocationQuery

Clone returns a duplicate of the LocationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LocationQuery) Count

func (lq *LocationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LocationQuery) CountX

func (lq *LocationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LocationQuery) Exist

func (lq *LocationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LocationQuery) ExistX

func (lq *LocationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LocationQuery) First

func (lq *LocationQuery) First(ctx context.Context) (*Location, error)

First returns the first Location entity from the query. Returns a *NotFoundError when no Location was found.

func (*LocationQuery) FirstID

func (lq *LocationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Location ID from the query. Returns a *NotFoundError when no Location ID was found.

func (*LocationQuery) FirstIDX

func (lq *LocationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*LocationQuery) FirstX

func (lq *LocationQuery) FirstX(ctx context.Context) *Location

FirstX is like First, but panics if an error occurs.

func (*LocationQuery) GroupBy

func (lq *LocationQuery) GroupBy(field string, fields ...string) *LocationGroupBy

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.Location.Query().
	GroupBy(location.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LocationQuery) IDs

func (lq *LocationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Location IDs.

func (*LocationQuery) IDsX

func (lq *LocationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*LocationQuery) Limit

func (lq *LocationQuery) Limit(limit int) *LocationQuery

Limit the number of records to be returned by this query.

func (*LocationQuery) Offset

func (lq *LocationQuery) Offset(offset int) *LocationQuery

Offset to start from.

func (*LocationQuery) Only

func (lq *LocationQuery) Only(ctx context.Context) (*Location, error)

Only returns a single Location entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Location entity is found. Returns a *NotFoundError when no Location entities are found.

func (*LocationQuery) OnlyID

func (lq *LocationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Location ID in the query. Returns a *NotSingularError when more than one Location ID is found. Returns a *NotFoundError when no entities are found.

func (*LocationQuery) OnlyIDX

func (lq *LocationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LocationQuery) OnlyX

func (lq *LocationQuery) OnlyX(ctx context.Context) *Location

OnlyX is like Only, but panics if an error occurs.

func (*LocationQuery) Order

Order specifies how the records should be ordered.

func (*LocationQuery) QueryChildren

func (lq *LocationQuery) QueryChildren() *LocationQuery

QueryChildren chains the current query on the "children" edge.

func (*LocationQuery) QueryGroup

func (lq *LocationQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*LocationQuery) QueryItems

func (lq *LocationQuery) QueryItems() *ItemQuery

QueryItems chains the current query on the "items" edge.

func (*LocationQuery) QueryParent

func (lq *LocationQuery) QueryParent() *LocationQuery

QueryParent chains the current query on the "parent" edge.

func (*LocationQuery) Select

func (lq *LocationQuery) Select(fields ...string) *LocationSelect

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.Location.Query().
	Select(location.FieldCreatedAt).
	Scan(ctx, &v)

func (*LocationQuery) Unique

func (lq *LocationQuery) Unique(unique bool) *LocationQuery

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 (*LocationQuery) Where

func (lq *LocationQuery) Where(ps ...predicate.Location) *LocationQuery

Where adds a new predicate for the LocationQuery builder.

func (*LocationQuery) WithChildren

func (lq *LocationQuery) WithChildren(opts ...func(*LocationQuery)) *LocationQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (*LocationQuery) WithGroup

func (lq *LocationQuery) WithGroup(opts ...func(*GroupQuery)) *LocationQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*LocationQuery) WithItems

func (lq *LocationQuery) WithItems(opts ...func(*ItemQuery)) *LocationQuery

WithItems tells the query-builder to eager-load the nodes that are connected to the "items" edge. The optional arguments are used to configure the query builder of the edge.

func (*LocationQuery) WithParent

func (lq *LocationQuery) WithParent(opts ...func(*LocationQuery)) *LocationQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

type LocationSelect

type LocationSelect struct {
	*LocationQuery
	// contains filtered or unexported fields
}

LocationSelect is the builder for selecting fields of Location entities.

func (*LocationSelect) Aggregate

func (ls *LocationSelect) Aggregate(fns ...AggregateFunc) *LocationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LocationSelect) Bool

func (s *LocationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LocationSelect) BoolX

func (s *LocationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LocationSelect) Bools

func (s *LocationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LocationSelect) BoolsX

func (s *LocationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LocationSelect) Float64

func (s *LocationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LocationSelect) Float64X

func (s *LocationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LocationSelect) Float64s

func (s *LocationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LocationSelect) Float64sX

func (s *LocationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LocationSelect) Int

func (s *LocationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LocationSelect) IntX

func (s *LocationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LocationSelect) Ints

func (s *LocationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LocationSelect) IntsX

func (s *LocationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LocationSelect) Scan

func (ls *LocationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LocationSelect) ScanX

func (s *LocationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LocationSelect) String

func (s *LocationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LocationSelect) StringX

func (s *LocationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LocationSelect) Strings

func (s *LocationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LocationSelect) StringsX

func (s *LocationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LocationUpdate

type LocationUpdate struct {
	// contains filtered or unexported fields
}

LocationUpdate is the builder for updating Location entities.

func (*LocationUpdate) AddChildIDs

func (lu *LocationUpdate) AddChildIDs(ids ...uuid.UUID) *LocationUpdate

AddChildIDs adds the "children" edge to the Location entity by IDs.

func (*LocationUpdate) AddChildren

func (lu *LocationUpdate) AddChildren(l ...*Location) *LocationUpdate

AddChildren adds the "children" edges to the Location entity.

func (*LocationUpdate) AddItemIDs

func (lu *LocationUpdate) AddItemIDs(ids ...uuid.UUID) *LocationUpdate

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*LocationUpdate) AddItems

func (lu *LocationUpdate) AddItems(i ...*Item) *LocationUpdate

AddItems adds the "items" edges to the Item entity.

func (*LocationUpdate) ClearChildren

func (lu *LocationUpdate) ClearChildren() *LocationUpdate

ClearChildren clears all "children" edges to the Location entity.

func (*LocationUpdate) ClearDescription

func (lu *LocationUpdate) ClearDescription() *LocationUpdate

ClearDescription clears the value of the "description" field.

func (*LocationUpdate) ClearGroup

func (lu *LocationUpdate) ClearGroup() *LocationUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*LocationUpdate) ClearItems

func (lu *LocationUpdate) ClearItems() *LocationUpdate

ClearItems clears all "items" edges to the Item entity.

func (*LocationUpdate) ClearParent

func (lu *LocationUpdate) ClearParent() *LocationUpdate

ClearParent clears the "parent" edge to the Location entity.

func (*LocationUpdate) Exec

func (lu *LocationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocationUpdate) ExecX

func (lu *LocationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationUpdate) Mutation

func (lu *LocationUpdate) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdate) RemoveChildIDs

func (lu *LocationUpdate) RemoveChildIDs(ids ...uuid.UUID) *LocationUpdate

RemoveChildIDs removes the "children" edge to Location entities by IDs.

func (*LocationUpdate) RemoveChildren

func (lu *LocationUpdate) RemoveChildren(l ...*Location) *LocationUpdate

RemoveChildren removes "children" edges to Location entities.

func (*LocationUpdate) RemoveItemIDs

func (lu *LocationUpdate) RemoveItemIDs(ids ...uuid.UUID) *LocationUpdate

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*LocationUpdate) RemoveItems

func (lu *LocationUpdate) RemoveItems(i ...*Item) *LocationUpdate

RemoveItems removes "items" edges to Item entities.

func (*LocationUpdate) Save

func (lu *LocationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LocationUpdate) SaveX

func (lu *LocationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LocationUpdate) SetDescription

func (lu *LocationUpdate) SetDescription(s string) *LocationUpdate

SetDescription sets the "description" field.

func (*LocationUpdate) SetGroup

func (lu *LocationUpdate) SetGroup(g *Group) *LocationUpdate

SetGroup sets the "group" edge to the Group entity.

func (*LocationUpdate) SetGroupID

func (lu *LocationUpdate) SetGroupID(id uuid.UUID) *LocationUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*LocationUpdate) SetName

func (lu *LocationUpdate) SetName(s string) *LocationUpdate

SetName sets the "name" field.

func (*LocationUpdate) SetNillableDescription

func (lu *LocationUpdate) SetNillableDescription(s *string) *LocationUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LocationUpdate) SetNillableName

func (lu *LocationUpdate) SetNillableName(s *string) *LocationUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*LocationUpdate) SetNillableParentID

func (lu *LocationUpdate) SetNillableParentID(id *uuid.UUID) *LocationUpdate

SetNillableParentID sets the "parent" edge to the Location entity by ID if the given value is not nil.

func (*LocationUpdate) SetParent

func (lu *LocationUpdate) SetParent(l *Location) *LocationUpdate

SetParent sets the "parent" edge to the Location entity.

func (*LocationUpdate) SetParentID

func (lu *LocationUpdate) SetParentID(id uuid.UUID) *LocationUpdate

SetParentID sets the "parent" edge to the Location entity by ID.

func (*LocationUpdate) SetUpdatedAt

func (lu *LocationUpdate) SetUpdatedAt(t time.Time) *LocationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*LocationUpdate) Where

func (lu *LocationUpdate) Where(ps ...predicate.Location) *LocationUpdate

Where appends a list predicates to the LocationUpdate builder.

type LocationUpdateOne

type LocationUpdateOne struct {
	// contains filtered or unexported fields
}

LocationUpdateOne is the builder for updating a single Location entity.

func (*LocationUpdateOne) AddChildIDs

func (luo *LocationUpdateOne) AddChildIDs(ids ...uuid.UUID) *LocationUpdateOne

AddChildIDs adds the "children" edge to the Location entity by IDs.

func (*LocationUpdateOne) AddChildren

func (luo *LocationUpdateOne) AddChildren(l ...*Location) *LocationUpdateOne

AddChildren adds the "children" edges to the Location entity.

func (*LocationUpdateOne) AddItemIDs

func (luo *LocationUpdateOne) AddItemIDs(ids ...uuid.UUID) *LocationUpdateOne

AddItemIDs adds the "items" edge to the Item entity by IDs.

func (*LocationUpdateOne) AddItems

func (luo *LocationUpdateOne) AddItems(i ...*Item) *LocationUpdateOne

AddItems adds the "items" edges to the Item entity.

func (*LocationUpdateOne) ClearChildren

func (luo *LocationUpdateOne) ClearChildren() *LocationUpdateOne

ClearChildren clears all "children" edges to the Location entity.

func (*LocationUpdateOne) ClearDescription

func (luo *LocationUpdateOne) ClearDescription() *LocationUpdateOne

ClearDescription clears the value of the "description" field.

func (*LocationUpdateOne) ClearGroup

func (luo *LocationUpdateOne) ClearGroup() *LocationUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*LocationUpdateOne) ClearItems

func (luo *LocationUpdateOne) ClearItems() *LocationUpdateOne

ClearItems clears all "items" edges to the Item entity.

func (*LocationUpdateOne) ClearParent

func (luo *LocationUpdateOne) ClearParent() *LocationUpdateOne

ClearParent clears the "parent" edge to the Location entity.

func (*LocationUpdateOne) Exec

func (luo *LocationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LocationUpdateOne) ExecX

func (luo *LocationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocationUpdateOne) Mutation

func (luo *LocationUpdateOne) Mutation() *LocationMutation

Mutation returns the LocationMutation object of the builder.

func (*LocationUpdateOne) RemoveChildIDs

func (luo *LocationUpdateOne) RemoveChildIDs(ids ...uuid.UUID) *LocationUpdateOne

RemoveChildIDs removes the "children" edge to Location entities by IDs.

func (*LocationUpdateOne) RemoveChildren

func (luo *LocationUpdateOne) RemoveChildren(l ...*Location) *LocationUpdateOne

RemoveChildren removes "children" edges to Location entities.

func (*LocationUpdateOne) RemoveItemIDs

func (luo *LocationUpdateOne) RemoveItemIDs(ids ...uuid.UUID) *LocationUpdateOne

RemoveItemIDs removes the "items" edge to Item entities by IDs.

func (*LocationUpdateOne) RemoveItems

func (luo *LocationUpdateOne) RemoveItems(i ...*Item) *LocationUpdateOne

RemoveItems removes "items" edges to Item entities.

func (*LocationUpdateOne) Save

func (luo *LocationUpdateOne) Save(ctx context.Context) (*Location, error)

Save executes the query and returns the updated Location entity.

func (*LocationUpdateOne) SaveX

func (luo *LocationUpdateOne) SaveX(ctx context.Context) *Location

SaveX is like Save, but panics if an error occurs.

func (*LocationUpdateOne) Select

func (luo *LocationUpdateOne) Select(field string, fields ...string) *LocationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LocationUpdateOne) SetDescription

func (luo *LocationUpdateOne) SetDescription(s string) *LocationUpdateOne

SetDescription sets the "description" field.

func (*LocationUpdateOne) SetGroup

func (luo *LocationUpdateOne) SetGroup(g *Group) *LocationUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*LocationUpdateOne) SetGroupID

func (luo *LocationUpdateOne) SetGroupID(id uuid.UUID) *LocationUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*LocationUpdateOne) SetName

func (luo *LocationUpdateOne) SetName(s string) *LocationUpdateOne

SetName sets the "name" field.

func (*LocationUpdateOne) SetNillableDescription

func (luo *LocationUpdateOne) SetNillableDescription(s *string) *LocationUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LocationUpdateOne) SetNillableName

func (luo *LocationUpdateOne) SetNillableName(s *string) *LocationUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*LocationUpdateOne) SetNillableParentID

func (luo *LocationUpdateOne) SetNillableParentID(id *uuid.UUID) *LocationUpdateOne

SetNillableParentID sets the "parent" edge to the Location entity by ID if the given value is not nil.

func (*LocationUpdateOne) SetParent

func (luo *LocationUpdateOne) SetParent(l *Location) *LocationUpdateOne

SetParent sets the "parent" edge to the Location entity.

func (*LocationUpdateOne) SetParentID

func (luo *LocationUpdateOne) SetParentID(id uuid.UUID) *LocationUpdateOne

SetParentID sets the "parent" edge to the Location entity by ID.

func (*LocationUpdateOne) SetUpdatedAt

func (luo *LocationUpdateOne) SetUpdatedAt(t time.Time) *LocationUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*LocationUpdateOne) Where

Where appends a list predicates to the LocationUpdate builder.

type Locations

type Locations []*Location

Locations is a parsable slice of Location.

type MaintenanceEntries

type MaintenanceEntries []*MaintenanceEntry

MaintenanceEntries is a parsable slice of MaintenanceEntry.

type MaintenanceEntry

type MaintenanceEntry struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// ItemID holds the value of the "item_id" field.
	ItemID uuid.UUID `json:"item_id,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// ScheduledDate holds the value of the "scheduled_date" field.
	ScheduledDate time.Time `json:"scheduled_date,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Cost holds the value of the "cost" field.
	Cost float64 `json:"cost,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MaintenanceEntryQuery when eager-loading is set.
	Edges MaintenanceEntryEdges `json:"edges"`
	// contains filtered or unexported fields
}

MaintenanceEntry is the model entity for the MaintenanceEntry schema.

func (*MaintenanceEntry) GetID

func (me *MaintenanceEntry) GetID() uuid.UUID

func (*MaintenanceEntry) QueryItem

func (me *MaintenanceEntry) QueryItem() *ItemQuery

QueryItem queries the "item" edge of the MaintenanceEntry entity.

func (*MaintenanceEntry) String

func (me *MaintenanceEntry) String() string

String implements the fmt.Stringer.

func (*MaintenanceEntry) Unwrap

func (me *MaintenanceEntry) Unwrap() *MaintenanceEntry

Unwrap unwraps the MaintenanceEntry 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 (*MaintenanceEntry) Update

Update returns a builder for updating this MaintenanceEntry. Note that you need to call MaintenanceEntry.Unwrap() before calling this method if this MaintenanceEntry was returned from a transaction, and the transaction was committed or rolled back.

func (*MaintenanceEntry) Value

func (me *MaintenanceEntry) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the MaintenanceEntry. This includes values selected through modifiers, order, etc.

type MaintenanceEntryClient

type MaintenanceEntryClient struct {
	// contains filtered or unexported fields
}

MaintenanceEntryClient is a client for the MaintenanceEntry schema.

func NewMaintenanceEntryClient

func NewMaintenanceEntryClient(c config) *MaintenanceEntryClient

NewMaintenanceEntryClient returns a client for the MaintenanceEntry from the given config.

func (*MaintenanceEntryClient) Create

Create returns a builder for creating a MaintenanceEntry entity.

func (*MaintenanceEntryClient) CreateBulk

CreateBulk returns a builder for creating a bulk of MaintenanceEntry entities.

func (*MaintenanceEntryClient) Delete

Delete returns a delete builder for MaintenanceEntry.

func (*MaintenanceEntryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MaintenanceEntryClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MaintenanceEntryClient) Get

Get returns a MaintenanceEntry entity by its id.

func (*MaintenanceEntryClient) GetX

GetX is like Get, but panics if an error occurs.

func (*MaintenanceEntryClient) Hooks

func (c *MaintenanceEntryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MaintenanceEntryClient) Intercept

func (c *MaintenanceEntryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `maintenanceentry.Intercept(f(g(h())))`.

func (*MaintenanceEntryClient) Interceptors

func (c *MaintenanceEntryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MaintenanceEntryClient) MapCreateBulk

func (c *MaintenanceEntryClient) MapCreateBulk(slice any, setFunc func(*MaintenanceEntryCreate, int)) *MaintenanceEntryCreateBulk

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 (*MaintenanceEntryClient) Query

Query returns a query builder for MaintenanceEntry.

func (*MaintenanceEntryClient) QueryItem

QueryItem queries the item edge of a MaintenanceEntry.

func (*MaintenanceEntryClient) Update

Update returns an update builder for MaintenanceEntry.

func (*MaintenanceEntryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MaintenanceEntryClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MaintenanceEntryClient) Use

func (c *MaintenanceEntryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `maintenanceentry.Hooks(f(g(h())))`.

type MaintenanceEntryCreate

type MaintenanceEntryCreate struct {
	// contains filtered or unexported fields
}

MaintenanceEntryCreate is the builder for creating a MaintenanceEntry entity.

func (*MaintenanceEntryCreate) Exec

Exec executes the query.

func (*MaintenanceEntryCreate) ExecX

func (mec *MaintenanceEntryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MaintenanceEntryCreate) Mutation

Mutation returns the MaintenanceEntryMutation object of the builder.

func (*MaintenanceEntryCreate) Save

Save creates the MaintenanceEntry in the database.

func (*MaintenanceEntryCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MaintenanceEntryCreate) SetCost

SetCost sets the "cost" field.

func (*MaintenanceEntryCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*MaintenanceEntryCreate) SetDate

SetDate sets the "date" field.

func (*MaintenanceEntryCreate) SetDescription

func (mec *MaintenanceEntryCreate) SetDescription(s string) *MaintenanceEntryCreate

SetDescription sets the "description" field.

func (*MaintenanceEntryCreate) SetID

SetID sets the "id" field.

func (*MaintenanceEntryCreate) SetItem

SetItem sets the "item" edge to the Item entity.

func (*MaintenanceEntryCreate) SetItemID

SetItemID sets the "item_id" field.

func (*MaintenanceEntryCreate) SetName

SetName sets the "name" field.

func (*MaintenanceEntryCreate) SetNillableCost

func (mec *MaintenanceEntryCreate) SetNillableCost(f *float64) *MaintenanceEntryCreate

SetNillableCost sets the "cost" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetNillableCreatedAt

func (mec *MaintenanceEntryCreate) SetNillableCreatedAt(t *time.Time) *MaintenanceEntryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetNillableDate

func (mec *MaintenanceEntryCreate) SetNillableDate(t *time.Time) *MaintenanceEntryCreate

SetNillableDate sets the "date" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetNillableDescription

func (mec *MaintenanceEntryCreate) SetNillableDescription(s *string) *MaintenanceEntryCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetNillableID

func (mec *MaintenanceEntryCreate) SetNillableID(u *uuid.UUID) *MaintenanceEntryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetNillableScheduledDate

func (mec *MaintenanceEntryCreate) SetNillableScheduledDate(t *time.Time) *MaintenanceEntryCreate

SetNillableScheduledDate sets the "scheduled_date" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetNillableUpdatedAt

func (mec *MaintenanceEntryCreate) SetNillableUpdatedAt(t *time.Time) *MaintenanceEntryCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*MaintenanceEntryCreate) SetScheduledDate

func (mec *MaintenanceEntryCreate) SetScheduledDate(t time.Time) *MaintenanceEntryCreate

SetScheduledDate sets the "scheduled_date" field.

func (*MaintenanceEntryCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

type MaintenanceEntryCreateBulk

type MaintenanceEntryCreateBulk struct {
	// contains filtered or unexported fields
}

MaintenanceEntryCreateBulk is the builder for creating many MaintenanceEntry entities in bulk.

func (*MaintenanceEntryCreateBulk) Exec

Exec executes the query.

func (*MaintenanceEntryCreateBulk) ExecX

func (mecb *MaintenanceEntryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MaintenanceEntryCreateBulk) Save

Save creates the MaintenanceEntry entities in the database.

func (*MaintenanceEntryCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type MaintenanceEntryDelete

type MaintenanceEntryDelete struct {
	// contains filtered or unexported fields
}

MaintenanceEntryDelete is the builder for deleting a MaintenanceEntry entity.

func (*MaintenanceEntryDelete) Exec

func (med *MaintenanceEntryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MaintenanceEntryDelete) ExecX

func (med *MaintenanceEntryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MaintenanceEntryDelete) Where

Where appends a list predicates to the MaintenanceEntryDelete builder.

type MaintenanceEntryDeleteOne

type MaintenanceEntryDeleteOne struct {
	// contains filtered or unexported fields
}

MaintenanceEntryDeleteOne is the builder for deleting a single MaintenanceEntry entity.

func (*MaintenanceEntryDeleteOne) Exec

Exec executes the deletion query.

func (*MaintenanceEntryDeleteOne) ExecX

func (medo *MaintenanceEntryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MaintenanceEntryDeleteOne) Where

Where appends a list predicates to the MaintenanceEntryDelete builder.

type MaintenanceEntryEdges

type MaintenanceEntryEdges struct {
	// Item holds the value of the item edge.
	Item *Item `json:"item,omitempty"`
	// contains filtered or unexported fields
}

MaintenanceEntryEdges holds the relations/edges for other nodes in the graph.

func (MaintenanceEntryEdges) ItemOrErr

func (e MaintenanceEntryEdges) ItemOrErr() (*Item, error)

ItemOrErr returns the Item value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MaintenanceEntryGroupBy

type MaintenanceEntryGroupBy struct {
	// contains filtered or unexported fields
}

MaintenanceEntryGroupBy is the group-by builder for MaintenanceEntry entities.

func (*MaintenanceEntryGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*MaintenanceEntryGroupBy) Bool

func (s *MaintenanceEntryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) BoolX

func (s *MaintenanceEntryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Bools

func (s *MaintenanceEntryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) BoolsX

func (s *MaintenanceEntryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Float64

func (s *MaintenanceEntryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) Float64X

func (s *MaintenanceEntryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Float64s

func (s *MaintenanceEntryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) Float64sX

func (s *MaintenanceEntryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Int

func (s *MaintenanceEntryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) IntX

func (s *MaintenanceEntryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Ints

func (s *MaintenanceEntryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) IntsX

func (s *MaintenanceEntryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Scan

func (megb *MaintenanceEntryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MaintenanceEntryGroupBy) ScanX

func (s *MaintenanceEntryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) String

func (s *MaintenanceEntryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) StringX

func (s *MaintenanceEntryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MaintenanceEntryGroupBy) Strings

func (s *MaintenanceEntryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntryGroupBy) StringsX

func (s *MaintenanceEntryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MaintenanceEntryMutation

type MaintenanceEntryMutation struct {
	// contains filtered or unexported fields
}

MaintenanceEntryMutation represents an operation that mutates the MaintenanceEntry nodes in the graph.

func (*MaintenanceEntryMutation) AddCost

func (m *MaintenanceEntryMutation) AddCost(f float64)

AddCost adds f to the "cost" field.

func (*MaintenanceEntryMutation) AddField

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) AddedCost

func (m *MaintenanceEntryMutation) AddedCost() (r float64, exists bool)

AddedCost returns the value that was added to the "cost" field in this mutation.

func (*MaintenanceEntryMutation) AddedEdges

func (m *MaintenanceEntryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MaintenanceEntryMutation) AddedField

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) AddedFields

func (m *MaintenanceEntryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MaintenanceEntryMutation) AddedIDs

func (m *MaintenanceEntryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MaintenanceEntryMutation) ClearDate

func (m *MaintenanceEntryMutation) ClearDate()

ClearDate clears the value of the "date" field.

func (*MaintenanceEntryMutation) ClearDescription

func (m *MaintenanceEntryMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*MaintenanceEntryMutation) ClearEdge

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) ClearField

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) ClearItem

func (m *MaintenanceEntryMutation) ClearItem()

ClearItem clears the "item" edge to the Item entity.

func (*MaintenanceEntryMutation) ClearScheduledDate

func (m *MaintenanceEntryMutation) ClearScheduledDate()

ClearScheduledDate clears the value of the "scheduled_date" field.

func (*MaintenanceEntryMutation) ClearedEdges

func (m *MaintenanceEntryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MaintenanceEntryMutation) ClearedFields

func (m *MaintenanceEntryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MaintenanceEntryMutation) Client

func (m MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) Cost

func (m *MaintenanceEntryMutation) Cost() (r float64, exists bool)

Cost returns the value of the "cost" field in the mutation.

func (*MaintenanceEntryMutation) CreatedAt

func (m *MaintenanceEntryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MaintenanceEntryMutation) Date

func (m *MaintenanceEntryMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*MaintenanceEntryMutation) DateCleared

func (m *MaintenanceEntryMutation) DateCleared() bool

DateCleared returns if the "date" field was cleared in this mutation.

func (*MaintenanceEntryMutation) Description

func (m *MaintenanceEntryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*MaintenanceEntryMutation) DescriptionCleared

func (m *MaintenanceEntryMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*MaintenanceEntryMutation) EdgeCleared

func (m *MaintenanceEntryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MaintenanceEntryMutation) Field

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) FieldCleared

func (m *MaintenanceEntryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MaintenanceEntryMutation) Fields

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) ID

func (m *MaintenanceEntryMutation) ID() (id uuid.UUID, 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 (*MaintenanceEntryMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MaintenanceEntryMutation) ItemCleared

func (m *MaintenanceEntryMutation) ItemCleared() bool

ItemCleared reports if the "item" edge to the Item entity was cleared.

func (*MaintenanceEntryMutation) ItemID

func (m *MaintenanceEntryMutation) ItemID() (r uuid.UUID, exists bool)

ItemID returns the value of the "item_id" field in the mutation.

func (*MaintenanceEntryMutation) ItemIDs

func (m *MaintenanceEntryMutation) ItemIDs() (ids []uuid.UUID)

ItemIDs returns the "item" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ItemID instead. It exists only for internal usage by the builders.

func (*MaintenanceEntryMutation) Name

func (m *MaintenanceEntryMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MaintenanceEntryMutation) OldCost

func (m *MaintenanceEntryMutation) OldCost(ctx context.Context) (v float64, err error)

OldCost returns the old "cost" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldCreatedAt

func (m *MaintenanceEntryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldDate

func (m *MaintenanceEntryMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldDescription

func (m *MaintenanceEntryMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldField

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) OldItemID

func (m *MaintenanceEntryMutation) OldItemID(ctx context.Context) (v uuid.UUID, err error)

OldItemID returns the old "item_id" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldName

func (m *MaintenanceEntryMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldScheduledDate

func (m *MaintenanceEntryMutation) OldScheduledDate(ctx context.Context) (v time.Time, err error)

OldScheduledDate returns the old "scheduled_date" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) OldUpdatedAt

func (m *MaintenanceEntryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the MaintenanceEntry entity. If the MaintenanceEntry object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MaintenanceEntryMutation) Op

func (m *MaintenanceEntryMutation) Op() Op

Op returns the operation name.

func (*MaintenanceEntryMutation) RemovedEdges

func (m *MaintenanceEntryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MaintenanceEntryMutation) RemovedIDs

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) ResetCost

func (m *MaintenanceEntryMutation) ResetCost()

ResetCost resets all changes to the "cost" field.

func (*MaintenanceEntryMutation) ResetCreatedAt

func (m *MaintenanceEntryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MaintenanceEntryMutation) ResetDate

func (m *MaintenanceEntryMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*MaintenanceEntryMutation) ResetDescription

func (m *MaintenanceEntryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MaintenanceEntryMutation) ResetEdge

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) ResetField

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) ResetItem

func (m *MaintenanceEntryMutation) ResetItem()

ResetItem resets all changes to the "item" edge.

func (*MaintenanceEntryMutation) ResetItemID

func (m *MaintenanceEntryMutation) ResetItemID()

ResetItemID resets all changes to the "item_id" field.

func (*MaintenanceEntryMutation) ResetName

func (m *MaintenanceEntryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MaintenanceEntryMutation) ResetScheduledDate

func (m *MaintenanceEntryMutation) ResetScheduledDate()

ResetScheduledDate resets all changes to the "scheduled_date" field.

func (*MaintenanceEntryMutation) ResetUpdatedAt

func (m *MaintenanceEntryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MaintenanceEntryMutation) ScheduledDate

func (m *MaintenanceEntryMutation) ScheduledDate() (r time.Time, exists bool)

ScheduledDate returns the value of the "scheduled_date" field in the mutation.

func (*MaintenanceEntryMutation) ScheduledDateCleared

func (m *MaintenanceEntryMutation) ScheduledDateCleared() bool

ScheduledDateCleared returns if the "scheduled_date" field was cleared in this mutation.

func (*MaintenanceEntryMutation) SetCost

func (m *MaintenanceEntryMutation) SetCost(f float64)

SetCost sets the "cost" field.

func (*MaintenanceEntryMutation) SetCreatedAt

func (m *MaintenanceEntryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MaintenanceEntryMutation) SetDate

func (m *MaintenanceEntryMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*MaintenanceEntryMutation) SetDescription

func (m *MaintenanceEntryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MaintenanceEntryMutation) SetField

func (m *MaintenanceEntryMutation) 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 (*MaintenanceEntryMutation) SetID

func (m *MaintenanceEntryMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of MaintenanceEntry entities.

func (*MaintenanceEntryMutation) SetItemID

func (m *MaintenanceEntryMutation) SetItemID(u uuid.UUID)

SetItemID sets the "item_id" field.

func (*MaintenanceEntryMutation) SetName

func (m *MaintenanceEntryMutation) SetName(s string)

SetName sets the "name" field.

func (*MaintenanceEntryMutation) SetOp

func (m *MaintenanceEntryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MaintenanceEntryMutation) SetScheduledDate

func (m *MaintenanceEntryMutation) SetScheduledDate(t time.Time)

SetScheduledDate sets the "scheduled_date" field.

func (*MaintenanceEntryMutation) SetUpdatedAt

func (m *MaintenanceEntryMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (MaintenanceEntryMutation) Tx

func (m MaintenanceEntryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MaintenanceEntryMutation) Type

func (m *MaintenanceEntryMutation) Type() string

Type returns the node type of this mutation (MaintenanceEntry).

func (*MaintenanceEntryMutation) UpdatedAt

func (m *MaintenanceEntryMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MaintenanceEntryMutation) Where

Where appends a list predicates to the MaintenanceEntryMutation builder.

func (*MaintenanceEntryMutation) WhereP

func (m *MaintenanceEntryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MaintenanceEntryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MaintenanceEntryQuery

type MaintenanceEntryQuery struct {
	// contains filtered or unexported fields
}

MaintenanceEntryQuery is the builder for querying MaintenanceEntry entities.

func (*MaintenanceEntryQuery) Aggregate

Aggregate returns a MaintenanceEntrySelect configured with the given aggregations.

func (*MaintenanceEntryQuery) All

All executes the query and returns a list of MaintenanceEntries.

func (*MaintenanceEntryQuery) AllX

AllX is like All, but panics if an error occurs.

func (*MaintenanceEntryQuery) Clone

Clone returns a duplicate of the MaintenanceEntryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MaintenanceEntryQuery) Count

func (meq *MaintenanceEntryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MaintenanceEntryQuery) CountX

func (meq *MaintenanceEntryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MaintenanceEntryQuery) Exist

func (meq *MaintenanceEntryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MaintenanceEntryQuery) ExistX

func (meq *MaintenanceEntryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MaintenanceEntryQuery) First

First returns the first MaintenanceEntry entity from the query. Returns a *NotFoundError when no MaintenanceEntry was found.

func (*MaintenanceEntryQuery) FirstID

func (meq *MaintenanceEntryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first MaintenanceEntry ID from the query. Returns a *NotFoundError when no MaintenanceEntry ID was found.

func (*MaintenanceEntryQuery) FirstIDX

func (meq *MaintenanceEntryQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*MaintenanceEntryQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*MaintenanceEntryQuery) GroupBy

func (meq *MaintenanceEntryQuery) GroupBy(field string, fields ...string) *MaintenanceEntryGroupBy

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.MaintenanceEntry.Query().
	GroupBy(maintenanceentry.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MaintenanceEntryQuery) IDs

func (meq *MaintenanceEntryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of MaintenanceEntry IDs.

func (*MaintenanceEntryQuery) IDsX

func (meq *MaintenanceEntryQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*MaintenanceEntryQuery) Limit

func (meq *MaintenanceEntryQuery) Limit(limit int) *MaintenanceEntryQuery

Limit the number of records to be returned by this query.

func (*MaintenanceEntryQuery) Offset

func (meq *MaintenanceEntryQuery) Offset(offset int) *MaintenanceEntryQuery

Offset to start from.

func (*MaintenanceEntryQuery) Only

Only returns a single MaintenanceEntry entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MaintenanceEntry entity is found. Returns a *NotFoundError when no MaintenanceEntry entities are found.

func (*MaintenanceEntryQuery) OnlyID

func (meq *MaintenanceEntryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only MaintenanceEntry ID in the query. Returns a *NotSingularError when more than one MaintenanceEntry ID is found. Returns a *NotFoundError when no entities are found.

func (*MaintenanceEntryQuery) OnlyIDX

func (meq *MaintenanceEntryQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MaintenanceEntryQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*MaintenanceEntryQuery) Order

Order specifies how the records should be ordered.

func (*MaintenanceEntryQuery) QueryItem

func (meq *MaintenanceEntryQuery) QueryItem() *ItemQuery

QueryItem chains the current query on the "item" edge.

func (*MaintenanceEntryQuery) Select

func (meq *MaintenanceEntryQuery) Select(fields ...string) *MaintenanceEntrySelect

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.MaintenanceEntry.Query().
	Select(maintenanceentry.FieldCreatedAt).
	Scan(ctx, &v)

func (*MaintenanceEntryQuery) Unique

func (meq *MaintenanceEntryQuery) Unique(unique bool) *MaintenanceEntryQuery

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 (*MaintenanceEntryQuery) Where

Where adds a new predicate for the MaintenanceEntryQuery builder.

func (*MaintenanceEntryQuery) WithItem

func (meq *MaintenanceEntryQuery) WithItem(opts ...func(*ItemQuery)) *MaintenanceEntryQuery

WithItem tells the query-builder to eager-load the nodes that are connected to the "item" edge. The optional arguments are used to configure the query builder of the edge.

type MaintenanceEntrySelect

type MaintenanceEntrySelect struct {
	*MaintenanceEntryQuery
	// contains filtered or unexported fields
}

MaintenanceEntrySelect is the builder for selecting fields of MaintenanceEntry entities.

func (*MaintenanceEntrySelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*MaintenanceEntrySelect) Bool

func (s *MaintenanceEntrySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) BoolX

func (s *MaintenanceEntrySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MaintenanceEntrySelect) Bools

func (s *MaintenanceEntrySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) BoolsX

func (s *MaintenanceEntrySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MaintenanceEntrySelect) Float64

func (s *MaintenanceEntrySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) Float64X

func (s *MaintenanceEntrySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MaintenanceEntrySelect) Float64s

func (s *MaintenanceEntrySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) Float64sX

func (s *MaintenanceEntrySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MaintenanceEntrySelect) Int

func (s *MaintenanceEntrySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) IntX

func (s *MaintenanceEntrySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MaintenanceEntrySelect) Ints

func (s *MaintenanceEntrySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) IntsX

func (s *MaintenanceEntrySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MaintenanceEntrySelect) Scan

func (mes *MaintenanceEntrySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MaintenanceEntrySelect) ScanX

func (s *MaintenanceEntrySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MaintenanceEntrySelect) String

func (s *MaintenanceEntrySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) StringX

func (s *MaintenanceEntrySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MaintenanceEntrySelect) Strings

func (s *MaintenanceEntrySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MaintenanceEntrySelect) StringsX

func (s *MaintenanceEntrySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MaintenanceEntryUpdate

type MaintenanceEntryUpdate struct {
	// contains filtered or unexported fields
}

MaintenanceEntryUpdate is the builder for updating MaintenanceEntry entities.

func (*MaintenanceEntryUpdate) AddCost

AddCost adds f to the "cost" field.

func (*MaintenanceEntryUpdate) ClearDate

ClearDate clears the value of the "date" field.

func (*MaintenanceEntryUpdate) ClearDescription

func (meu *MaintenanceEntryUpdate) ClearDescription() *MaintenanceEntryUpdate

ClearDescription clears the value of the "description" field.

func (*MaintenanceEntryUpdate) ClearItem

ClearItem clears the "item" edge to the Item entity.

func (*MaintenanceEntryUpdate) ClearScheduledDate

func (meu *MaintenanceEntryUpdate) ClearScheduledDate() *MaintenanceEntryUpdate

ClearScheduledDate clears the value of the "scheduled_date" field.

func (*MaintenanceEntryUpdate) Exec

Exec executes the query.

func (*MaintenanceEntryUpdate) ExecX

func (meu *MaintenanceEntryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MaintenanceEntryUpdate) Mutation

Mutation returns the MaintenanceEntryMutation object of the builder.

func (*MaintenanceEntryUpdate) Save

func (meu *MaintenanceEntryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MaintenanceEntryUpdate) SaveX

func (meu *MaintenanceEntryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MaintenanceEntryUpdate) SetCost

SetCost sets the "cost" field.

func (*MaintenanceEntryUpdate) SetDate

SetDate sets the "date" field.

func (*MaintenanceEntryUpdate) SetDescription

func (meu *MaintenanceEntryUpdate) SetDescription(s string) *MaintenanceEntryUpdate

SetDescription sets the "description" field.

func (*MaintenanceEntryUpdate) SetItem

SetItem sets the "item" edge to the Item entity.

func (*MaintenanceEntryUpdate) SetItemID

SetItemID sets the "item_id" field.

func (*MaintenanceEntryUpdate) SetName

SetName sets the "name" field.

func (*MaintenanceEntryUpdate) SetNillableCost

func (meu *MaintenanceEntryUpdate) SetNillableCost(f *float64) *MaintenanceEntryUpdate

SetNillableCost sets the "cost" field if the given value is not nil.

func (*MaintenanceEntryUpdate) SetNillableDate

func (meu *MaintenanceEntryUpdate) SetNillableDate(t *time.Time) *MaintenanceEntryUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*MaintenanceEntryUpdate) SetNillableDescription

func (meu *MaintenanceEntryUpdate) SetNillableDescription(s *string) *MaintenanceEntryUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MaintenanceEntryUpdate) SetNillableItemID

func (meu *MaintenanceEntryUpdate) SetNillableItemID(u *uuid.UUID) *MaintenanceEntryUpdate

SetNillableItemID sets the "item_id" field if the given value is not nil.

func (*MaintenanceEntryUpdate) SetNillableName

func (meu *MaintenanceEntryUpdate) SetNillableName(s *string) *MaintenanceEntryUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*MaintenanceEntryUpdate) SetNillableScheduledDate

func (meu *MaintenanceEntryUpdate) SetNillableScheduledDate(t *time.Time) *MaintenanceEntryUpdate

SetNillableScheduledDate sets the "scheduled_date" field if the given value is not nil.

func (*MaintenanceEntryUpdate) SetScheduledDate

func (meu *MaintenanceEntryUpdate) SetScheduledDate(t time.Time) *MaintenanceEntryUpdate

SetScheduledDate sets the "scheduled_date" field.

func (*MaintenanceEntryUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*MaintenanceEntryUpdate) Where

Where appends a list predicates to the MaintenanceEntryUpdate builder.

type MaintenanceEntryUpdateOne

type MaintenanceEntryUpdateOne struct {
	// contains filtered or unexported fields
}

MaintenanceEntryUpdateOne is the builder for updating a single MaintenanceEntry entity.

func (*MaintenanceEntryUpdateOne) AddCost

AddCost adds f to the "cost" field.

func (*MaintenanceEntryUpdateOne) ClearDate

ClearDate clears the value of the "date" field.

func (*MaintenanceEntryUpdateOne) ClearDescription

func (meuo *MaintenanceEntryUpdateOne) ClearDescription() *MaintenanceEntryUpdateOne

ClearDescription clears the value of the "description" field.

func (*MaintenanceEntryUpdateOne) ClearItem

ClearItem clears the "item" edge to the Item entity.

func (*MaintenanceEntryUpdateOne) ClearScheduledDate

func (meuo *MaintenanceEntryUpdateOne) ClearScheduledDate() *MaintenanceEntryUpdateOne

ClearScheduledDate clears the value of the "scheduled_date" field.

func (*MaintenanceEntryUpdateOne) Exec

Exec executes the query on the entity.

func (*MaintenanceEntryUpdateOne) ExecX

func (meuo *MaintenanceEntryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MaintenanceEntryUpdateOne) Mutation

Mutation returns the MaintenanceEntryMutation object of the builder.

func (*MaintenanceEntryUpdateOne) Save

Save executes the query and returns the updated MaintenanceEntry entity.

func (*MaintenanceEntryUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*MaintenanceEntryUpdateOne) Select

func (meuo *MaintenanceEntryUpdateOne) Select(field string, fields ...string) *MaintenanceEntryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MaintenanceEntryUpdateOne) SetCost

SetCost sets the "cost" field.

func (*MaintenanceEntryUpdateOne) SetDate

SetDate sets the "date" field.

func (*MaintenanceEntryUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*MaintenanceEntryUpdateOne) SetItem

SetItem sets the "item" edge to the Item entity.

func (*MaintenanceEntryUpdateOne) SetItemID

SetItemID sets the "item_id" field.

func (*MaintenanceEntryUpdateOne) SetName

SetName sets the "name" field.

func (*MaintenanceEntryUpdateOne) SetNillableCost

func (meuo *MaintenanceEntryUpdateOne) SetNillableCost(f *float64) *MaintenanceEntryUpdateOne

SetNillableCost sets the "cost" field if the given value is not nil.

func (*MaintenanceEntryUpdateOne) SetNillableDate

func (meuo *MaintenanceEntryUpdateOne) SetNillableDate(t *time.Time) *MaintenanceEntryUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*MaintenanceEntryUpdateOne) SetNillableDescription

func (meuo *MaintenanceEntryUpdateOne) SetNillableDescription(s *string) *MaintenanceEntryUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MaintenanceEntryUpdateOne) SetNillableItemID

func (meuo *MaintenanceEntryUpdateOne) SetNillableItemID(u *uuid.UUID) *MaintenanceEntryUpdateOne

SetNillableItemID sets the "item_id" field if the given value is not nil.

func (*MaintenanceEntryUpdateOne) SetNillableName

func (meuo *MaintenanceEntryUpdateOne) SetNillableName(s *string) *MaintenanceEntryUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*MaintenanceEntryUpdateOne) SetNillableScheduledDate

func (meuo *MaintenanceEntryUpdateOne) SetNillableScheduledDate(t *time.Time) *MaintenanceEntryUpdateOne

SetNillableScheduledDate sets the "scheduled_date" field if the given value is not nil.

func (*MaintenanceEntryUpdateOne) SetScheduledDate

func (meuo *MaintenanceEntryUpdateOne) SetScheduledDate(t time.Time) *MaintenanceEntryUpdateOne

SetScheduledDate sets the "scheduled_date" field.

func (*MaintenanceEntryUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*MaintenanceEntryUpdateOne) Where

Where appends a list predicates to the MaintenanceEntryUpdate builder.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Notifier

type Notifier struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// GroupID holds the value of the "group_id" field.
	GroupID uuid.UUID `json:"group_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"-"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotifierQuery when eager-loading is set.
	Edges NotifierEdges `json:"edges"`
	// contains filtered or unexported fields
}

Notifier is the model entity for the Notifier schema.

func (*Notifier) GetID

func (n *Notifier) GetID() uuid.UUID

func (*Notifier) QueryGroup

func (n *Notifier) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Notifier entity.

func (*Notifier) QueryUser

func (n *Notifier) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Notifier entity.

func (*Notifier) String

func (n *Notifier) String() string

String implements the fmt.Stringer.

func (*Notifier) Unwrap

func (n *Notifier) Unwrap() *Notifier

Unwrap unwraps the Notifier 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 (*Notifier) Update

func (n *Notifier) Update() *NotifierUpdateOne

Update returns a builder for updating this Notifier. Note that you need to call Notifier.Unwrap() before calling this method if this Notifier was returned from a transaction, and the transaction was committed or rolled back.

func (*Notifier) Value

func (n *Notifier) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Notifier. This includes values selected through modifiers, order, etc.

type NotifierClient

type NotifierClient struct {
	// contains filtered or unexported fields
}

NotifierClient is a client for the Notifier schema.

func NewNotifierClient

func NewNotifierClient(c config) *NotifierClient

NewNotifierClient returns a client for the Notifier from the given config.

func (*NotifierClient) Create

func (c *NotifierClient) Create() *NotifierCreate

Create returns a builder for creating a Notifier entity.

func (*NotifierClient) CreateBulk

func (c *NotifierClient) CreateBulk(builders ...*NotifierCreate) *NotifierCreateBulk

CreateBulk returns a builder for creating a bulk of Notifier entities.

func (*NotifierClient) Delete

func (c *NotifierClient) Delete() *NotifierDelete

Delete returns a delete builder for Notifier.

func (*NotifierClient) DeleteOne

func (c *NotifierClient) DeleteOne(n *Notifier) *NotifierDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotifierClient) DeleteOneID

func (c *NotifierClient) DeleteOneID(id uuid.UUID) *NotifierDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NotifierClient) Get

func (c *NotifierClient) Get(ctx context.Context, id uuid.UUID) (*Notifier, error)

Get returns a Notifier entity by its id.

func (*NotifierClient) GetX

func (c *NotifierClient) GetX(ctx context.Context, id uuid.UUID) *Notifier

GetX is like Get, but panics if an error occurs.

func (*NotifierClient) Hooks

func (c *NotifierClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NotifierClient) Intercept

func (c *NotifierClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notifier.Intercept(f(g(h())))`.

func (*NotifierClient) Interceptors

func (c *NotifierClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NotifierClient) MapCreateBulk

func (c *NotifierClient) MapCreateBulk(slice any, setFunc func(*NotifierCreate, int)) *NotifierCreateBulk

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 (*NotifierClient) Query

func (c *NotifierClient) Query() *NotifierQuery

Query returns a query builder for Notifier.

func (*NotifierClient) QueryGroup

func (c *NotifierClient) QueryGroup(n *Notifier) *GroupQuery

QueryGroup queries the group edge of a Notifier.

func (*NotifierClient) QueryUser

func (c *NotifierClient) QueryUser(n *Notifier) *UserQuery

QueryUser queries the user edge of a Notifier.

func (*NotifierClient) Update

func (c *NotifierClient) Update() *NotifierUpdate

Update returns an update builder for Notifier.

func (*NotifierClient) UpdateOne

func (c *NotifierClient) UpdateOne(n *Notifier) *NotifierUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotifierClient) UpdateOneID

func (c *NotifierClient) UpdateOneID(id uuid.UUID) *NotifierUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NotifierClient) Use

func (c *NotifierClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `notifier.Hooks(f(g(h())))`.

type NotifierCreate

type NotifierCreate struct {
	// contains filtered or unexported fields
}

NotifierCreate is the builder for creating a Notifier entity.

func (*NotifierCreate) Exec

func (nc *NotifierCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NotifierCreate) ExecX

func (nc *NotifierCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifierCreate) Mutation

func (nc *NotifierCreate) Mutation() *NotifierMutation

Mutation returns the NotifierMutation object of the builder.

func (*NotifierCreate) Save

func (nc *NotifierCreate) Save(ctx context.Context) (*Notifier, error)

Save creates the Notifier in the database.

func (*NotifierCreate) SaveX

func (nc *NotifierCreate) SaveX(ctx context.Context) *Notifier

SaveX calls Save and panics if Save returns an error.

func (*NotifierCreate) SetCreatedAt

func (nc *NotifierCreate) SetCreatedAt(t time.Time) *NotifierCreate

SetCreatedAt sets the "created_at" field.

func (*NotifierCreate) SetGroup

func (nc *NotifierCreate) SetGroup(g *Group) *NotifierCreate

SetGroup sets the "group" edge to the Group entity.

func (*NotifierCreate) SetGroupID

func (nc *NotifierCreate) SetGroupID(u uuid.UUID) *NotifierCreate

SetGroupID sets the "group_id" field.

func (*NotifierCreate) SetID

func (nc *NotifierCreate) SetID(u uuid.UUID) *NotifierCreate

SetID sets the "id" field.

func (*NotifierCreate) SetIsActive

func (nc *NotifierCreate) SetIsActive(b bool) *NotifierCreate

SetIsActive sets the "is_active" field.

func (*NotifierCreate) SetName

func (nc *NotifierCreate) SetName(s string) *NotifierCreate

SetName sets the "name" field.

func (*NotifierCreate) SetNillableCreatedAt

func (nc *NotifierCreate) SetNillableCreatedAt(t *time.Time) *NotifierCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NotifierCreate) SetNillableID

func (nc *NotifierCreate) SetNillableID(u *uuid.UUID) *NotifierCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NotifierCreate) SetNillableIsActive

func (nc *NotifierCreate) SetNillableIsActive(b *bool) *NotifierCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*NotifierCreate) SetNillableUpdatedAt

func (nc *NotifierCreate) SetNillableUpdatedAt(t *time.Time) *NotifierCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*NotifierCreate) SetURL

func (nc *NotifierCreate) SetURL(s string) *NotifierCreate

SetURL sets the "url" field.

func (*NotifierCreate) SetUpdatedAt

func (nc *NotifierCreate) SetUpdatedAt(t time.Time) *NotifierCreate

SetUpdatedAt sets the "updated_at" field.

func (*NotifierCreate) SetUser

func (nc *NotifierCreate) SetUser(u *User) *NotifierCreate

SetUser sets the "user" edge to the User entity.

func (*NotifierCreate) SetUserID

func (nc *NotifierCreate) SetUserID(u uuid.UUID) *NotifierCreate

SetUserID sets the "user_id" field.

type NotifierCreateBulk

type NotifierCreateBulk struct {
	// contains filtered or unexported fields
}

NotifierCreateBulk is the builder for creating many Notifier entities in bulk.

func (*NotifierCreateBulk) Exec

func (ncb *NotifierCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NotifierCreateBulk) ExecX

func (ncb *NotifierCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifierCreateBulk) Save

func (ncb *NotifierCreateBulk) Save(ctx context.Context) ([]*Notifier, error)

Save creates the Notifier entities in the database.

func (*NotifierCreateBulk) SaveX

func (ncb *NotifierCreateBulk) SaveX(ctx context.Context) []*Notifier

SaveX is like Save, but panics if an error occurs.

type NotifierDelete

type NotifierDelete struct {
	// contains filtered or unexported fields
}

NotifierDelete is the builder for deleting a Notifier entity.

func (*NotifierDelete) Exec

func (nd *NotifierDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NotifierDelete) ExecX

func (nd *NotifierDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NotifierDelete) Where

func (nd *NotifierDelete) Where(ps ...predicate.Notifier) *NotifierDelete

Where appends a list predicates to the NotifierDelete builder.

type NotifierDeleteOne

type NotifierDeleteOne struct {
	// contains filtered or unexported fields
}

NotifierDeleteOne is the builder for deleting a single Notifier entity.

func (*NotifierDeleteOne) Exec

func (ndo *NotifierDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NotifierDeleteOne) ExecX

func (ndo *NotifierDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifierDeleteOne) Where

Where appends a list predicates to the NotifierDelete builder.

type NotifierEdges

type NotifierEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

NotifierEdges holds the relations/edges for other nodes in the graph.

func (NotifierEdges) GroupOrErr

func (e NotifierEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NotifierEdges) UserOrErr

func (e NotifierEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NotifierGroupBy

type NotifierGroupBy struct {
	// contains filtered or unexported fields
}

NotifierGroupBy is the group-by builder for Notifier entities.

func (*NotifierGroupBy) Aggregate

func (ngb *NotifierGroupBy) Aggregate(fns ...AggregateFunc) *NotifierGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NotifierGroupBy) Bool

func (s *NotifierGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) BoolX

func (s *NotifierGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotifierGroupBy) Bools

func (s *NotifierGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) BoolsX

func (s *NotifierGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotifierGroupBy) Float64

func (s *NotifierGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) Float64X

func (s *NotifierGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotifierGroupBy) Float64s

func (s *NotifierGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) Float64sX

func (s *NotifierGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotifierGroupBy) Int

func (s *NotifierGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) IntX

func (s *NotifierGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotifierGroupBy) Ints

func (s *NotifierGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) IntsX

func (s *NotifierGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotifierGroupBy) Scan

func (ngb *NotifierGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotifierGroupBy) ScanX

func (s *NotifierGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotifierGroupBy) String

func (s *NotifierGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) StringX

func (s *NotifierGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotifierGroupBy) Strings

func (s *NotifierGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotifierGroupBy) StringsX

func (s *NotifierGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotifierMutation

type NotifierMutation struct {
	// contains filtered or unexported fields
}

NotifierMutation represents an operation that mutates the Notifier nodes in the graph.

func (*NotifierMutation) AddField

func (m *NotifierMutation) 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 (*NotifierMutation) AddedEdges

func (m *NotifierMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NotifierMutation) AddedField

func (m *NotifierMutation) 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 (*NotifierMutation) AddedFields

func (m *NotifierMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NotifierMutation) AddedIDs

func (m *NotifierMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NotifierMutation) ClearEdge

func (m *NotifierMutation) 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 (*NotifierMutation) ClearField

func (m *NotifierMutation) 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 (*NotifierMutation) ClearGroup

func (m *NotifierMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*NotifierMutation) ClearUser

func (m *NotifierMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*NotifierMutation) ClearedEdges

func (m *NotifierMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NotifierMutation) ClearedFields

func (m *NotifierMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NotifierMutation) Client

func (m NotifierMutation) 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 (*NotifierMutation) CreatedAt

func (m *NotifierMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NotifierMutation) EdgeCleared

func (m *NotifierMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NotifierMutation) Field

func (m *NotifierMutation) 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 (*NotifierMutation) FieldCleared

func (m *NotifierMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NotifierMutation) Fields

func (m *NotifierMutation) 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 (*NotifierMutation) GroupCleared

func (m *NotifierMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*NotifierMutation) GroupID

func (m *NotifierMutation) GroupID() (r uuid.UUID, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*NotifierMutation) GroupIDs

func (m *NotifierMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*NotifierMutation) ID

func (m *NotifierMutation) ID() (id uuid.UUID, 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 (*NotifierMutation) IDs

func (m *NotifierMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*NotifierMutation) IsActive

func (m *NotifierMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*NotifierMutation) Name

func (m *NotifierMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*NotifierMutation) OldCreatedAt

func (m *NotifierMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) OldField

func (m *NotifierMutation) 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 (*NotifierMutation) OldGroupID

func (m *NotifierMutation) OldGroupID(ctx context.Context) (v uuid.UUID, err error)

OldGroupID returns the old "group_id" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) OldIsActive

func (m *NotifierMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) OldName

func (m *NotifierMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) OldURL

func (m *NotifierMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) OldUpdatedAt

func (m *NotifierMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) OldUserID

func (m *NotifierMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the Notifier entity. If the Notifier object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*NotifierMutation) Op

func (m *NotifierMutation) Op() Op

Op returns the operation name.

func (*NotifierMutation) RemovedEdges

func (m *NotifierMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NotifierMutation) RemovedIDs

func (m *NotifierMutation) 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 (*NotifierMutation) ResetCreatedAt

func (m *NotifierMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotifierMutation) ResetEdge

func (m *NotifierMutation) 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 (*NotifierMutation) ResetField

func (m *NotifierMutation) 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 (*NotifierMutation) ResetGroup

func (m *NotifierMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*NotifierMutation) ResetGroupID

func (m *NotifierMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*NotifierMutation) ResetIsActive

func (m *NotifierMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*NotifierMutation) ResetName

func (m *NotifierMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*NotifierMutation) ResetURL

func (m *NotifierMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*NotifierMutation) ResetUpdatedAt

func (m *NotifierMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NotifierMutation) ResetUser

func (m *NotifierMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*NotifierMutation) ResetUserID

func (m *NotifierMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*NotifierMutation) SetCreatedAt

func (m *NotifierMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*NotifierMutation) SetField

func (m *NotifierMutation) 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 (*NotifierMutation) SetGroupID

func (m *NotifierMutation) SetGroupID(u uuid.UUID)

SetGroupID sets the "group_id" field.

func (*NotifierMutation) SetID

func (m *NotifierMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Notifier entities.

func (*NotifierMutation) SetIsActive

func (m *NotifierMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*NotifierMutation) SetName

func (m *NotifierMutation) SetName(s string)

SetName sets the "name" field.

func (*NotifierMutation) SetOp

func (m *NotifierMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotifierMutation) SetURL

func (m *NotifierMutation) SetURL(s string)

SetURL sets the "url" field.

func (*NotifierMutation) SetUpdatedAt

func (m *NotifierMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*NotifierMutation) SetUserID

func (m *NotifierMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (NotifierMutation) Tx

func (m NotifierMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NotifierMutation) Type

func (m *NotifierMutation) Type() string

Type returns the node type of this mutation (Notifier).

func (*NotifierMutation) URL

func (m *NotifierMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*NotifierMutation) UpdatedAt

func (m *NotifierMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NotifierMutation) UserCleared

func (m *NotifierMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*NotifierMutation) UserID

func (m *NotifierMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*NotifierMutation) UserIDs

func (m *NotifierMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*NotifierMutation) Where

func (m *NotifierMutation) Where(ps ...predicate.Notifier)

Where appends a list predicates to the NotifierMutation builder.

func (*NotifierMutation) WhereP

func (m *NotifierMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NotifierMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NotifierQuery

type NotifierQuery struct {
	// contains filtered or unexported fields
}

NotifierQuery is the builder for querying Notifier entities.

func (*NotifierQuery) Aggregate

func (nq *NotifierQuery) Aggregate(fns ...AggregateFunc) *NotifierSelect

Aggregate returns a NotifierSelect configured with the given aggregations.

func (*NotifierQuery) All

func (nq *NotifierQuery) All(ctx context.Context) ([]*Notifier, error)

All executes the query and returns a list of Notifiers.

func (*NotifierQuery) AllX

func (nq *NotifierQuery) AllX(ctx context.Context) []*Notifier

AllX is like All, but panics if an error occurs.

func (*NotifierQuery) Clone

func (nq *NotifierQuery) Clone() *NotifierQuery

Clone returns a duplicate of the NotifierQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NotifierQuery) Count

func (nq *NotifierQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NotifierQuery) CountX

func (nq *NotifierQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NotifierQuery) Exist

func (nq *NotifierQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NotifierQuery) ExistX

func (nq *NotifierQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NotifierQuery) First

func (nq *NotifierQuery) First(ctx context.Context) (*Notifier, error)

First returns the first Notifier entity from the query. Returns a *NotFoundError when no Notifier was found.

func (*NotifierQuery) FirstID

func (nq *NotifierQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Notifier ID from the query. Returns a *NotFoundError when no Notifier ID was found.

func (*NotifierQuery) FirstIDX

func (nq *NotifierQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*NotifierQuery) FirstX

func (nq *NotifierQuery) FirstX(ctx context.Context) *Notifier

FirstX is like First, but panics if an error occurs.

func (*NotifierQuery) GroupBy

func (nq *NotifierQuery) GroupBy(field string, fields ...string) *NotifierGroupBy

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.Notifier.Query().
	GroupBy(notifier.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NotifierQuery) IDs

func (nq *NotifierQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Notifier IDs.

func (*NotifierQuery) IDsX

func (nq *NotifierQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*NotifierQuery) Limit

func (nq *NotifierQuery) Limit(limit int) *NotifierQuery

Limit the number of records to be returned by this query.

func (*NotifierQuery) Offset

func (nq *NotifierQuery) Offset(offset int) *NotifierQuery

Offset to start from.

func (*NotifierQuery) Only

func (nq *NotifierQuery) Only(ctx context.Context) (*Notifier, error)

Only returns a single Notifier entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Notifier entity is found. Returns a *NotFoundError when no Notifier entities are found.

func (*NotifierQuery) OnlyID

func (nq *NotifierQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Notifier ID in the query. Returns a *NotSingularError when more than one Notifier ID is found. Returns a *NotFoundError when no entities are found.

func (*NotifierQuery) OnlyIDX

func (nq *NotifierQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NotifierQuery) OnlyX

func (nq *NotifierQuery) OnlyX(ctx context.Context) *Notifier

OnlyX is like Only, but panics if an error occurs.

func (*NotifierQuery) Order

Order specifies how the records should be ordered.

func (*NotifierQuery) QueryGroup

func (nq *NotifierQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*NotifierQuery) QueryUser

func (nq *NotifierQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*NotifierQuery) Select

func (nq *NotifierQuery) Select(fields ...string) *NotifierSelect

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.Notifier.Query().
	Select(notifier.FieldCreatedAt).
	Scan(ctx, &v)

func (*NotifierQuery) Unique

func (nq *NotifierQuery) Unique(unique bool) *NotifierQuery

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 (*NotifierQuery) Where

func (nq *NotifierQuery) Where(ps ...predicate.Notifier) *NotifierQuery

Where adds a new predicate for the NotifierQuery builder.

func (*NotifierQuery) WithGroup

func (nq *NotifierQuery) WithGroup(opts ...func(*GroupQuery)) *NotifierQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotifierQuery) WithUser

func (nq *NotifierQuery) WithUser(opts ...func(*UserQuery)) *NotifierQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type NotifierSelect

type NotifierSelect struct {
	*NotifierQuery
	// contains filtered or unexported fields
}

NotifierSelect is the builder for selecting fields of Notifier entities.

func (*NotifierSelect) Aggregate

func (ns *NotifierSelect) Aggregate(fns ...AggregateFunc) *NotifierSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NotifierSelect) Bool

func (s *NotifierSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) BoolX

func (s *NotifierSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotifierSelect) Bools

func (s *NotifierSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) BoolsX

func (s *NotifierSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotifierSelect) Float64

func (s *NotifierSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) Float64X

func (s *NotifierSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotifierSelect) Float64s

func (s *NotifierSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) Float64sX

func (s *NotifierSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotifierSelect) Int

func (s *NotifierSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) IntX

func (s *NotifierSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotifierSelect) Ints

func (s *NotifierSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) IntsX

func (s *NotifierSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotifierSelect) Scan

func (ns *NotifierSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotifierSelect) ScanX

func (s *NotifierSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotifierSelect) String

func (s *NotifierSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) StringX

func (s *NotifierSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotifierSelect) Strings

func (s *NotifierSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotifierSelect) StringsX

func (s *NotifierSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotifierUpdate

type NotifierUpdate struct {
	// contains filtered or unexported fields
}

NotifierUpdate is the builder for updating Notifier entities.

func (*NotifierUpdate) ClearGroup

func (nu *NotifierUpdate) ClearGroup() *NotifierUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*NotifierUpdate) ClearUser

func (nu *NotifierUpdate) ClearUser() *NotifierUpdate

ClearUser clears the "user" edge to the User entity.

func (*NotifierUpdate) Exec

func (nu *NotifierUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NotifierUpdate) ExecX

func (nu *NotifierUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifierUpdate) Mutation

func (nu *NotifierUpdate) Mutation() *NotifierMutation

Mutation returns the NotifierMutation object of the builder.

func (*NotifierUpdate) Save

func (nu *NotifierUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NotifierUpdate) SaveX

func (nu *NotifierUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NotifierUpdate) SetGroup

func (nu *NotifierUpdate) SetGroup(g *Group) *NotifierUpdate

SetGroup sets the "group" edge to the Group entity.

func (*NotifierUpdate) SetGroupID

func (nu *NotifierUpdate) SetGroupID(u uuid.UUID) *NotifierUpdate

SetGroupID sets the "group_id" field.

func (*NotifierUpdate) SetIsActive

func (nu *NotifierUpdate) SetIsActive(b bool) *NotifierUpdate

SetIsActive sets the "is_active" field.

func (*NotifierUpdate) SetName

func (nu *NotifierUpdate) SetName(s string) *NotifierUpdate

SetName sets the "name" field.

func (*NotifierUpdate) SetNillableGroupID

func (nu *NotifierUpdate) SetNillableGroupID(u *uuid.UUID) *NotifierUpdate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*NotifierUpdate) SetNillableIsActive

func (nu *NotifierUpdate) SetNillableIsActive(b *bool) *NotifierUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*NotifierUpdate) SetNillableName

func (nu *NotifierUpdate) SetNillableName(s *string) *NotifierUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*NotifierUpdate) SetNillableURL

func (nu *NotifierUpdate) SetNillableURL(s *string) *NotifierUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*NotifierUpdate) SetNillableUserID

func (nu *NotifierUpdate) SetNillableUserID(u *uuid.UUID) *NotifierUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*NotifierUpdate) SetURL

func (nu *NotifierUpdate) SetURL(s string) *NotifierUpdate

SetURL sets the "url" field.

func (*NotifierUpdate) SetUpdatedAt

func (nu *NotifierUpdate) SetUpdatedAt(t time.Time) *NotifierUpdate

SetUpdatedAt sets the "updated_at" field.

func (*NotifierUpdate) SetUser

func (nu *NotifierUpdate) SetUser(u *User) *NotifierUpdate

SetUser sets the "user" edge to the User entity.

func (*NotifierUpdate) SetUserID

func (nu *NotifierUpdate) SetUserID(u uuid.UUID) *NotifierUpdate

SetUserID sets the "user_id" field.

func (*NotifierUpdate) Where

func (nu *NotifierUpdate) Where(ps ...predicate.Notifier) *NotifierUpdate

Where appends a list predicates to the NotifierUpdate builder.

type NotifierUpdateOne

type NotifierUpdateOne struct {
	// contains filtered or unexported fields
}

NotifierUpdateOne is the builder for updating a single Notifier entity.

func (*NotifierUpdateOne) ClearGroup

func (nuo *NotifierUpdateOne) ClearGroup() *NotifierUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*NotifierUpdateOne) ClearUser

func (nuo *NotifierUpdateOne) ClearUser() *NotifierUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*NotifierUpdateOne) Exec

func (nuo *NotifierUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NotifierUpdateOne) ExecX

func (nuo *NotifierUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotifierUpdateOne) Mutation

func (nuo *NotifierUpdateOne) Mutation() *NotifierMutation

Mutation returns the NotifierMutation object of the builder.

func (*NotifierUpdateOne) Save

func (nuo *NotifierUpdateOne) Save(ctx context.Context) (*Notifier, error)

Save executes the query and returns the updated Notifier entity.

func (*NotifierUpdateOne) SaveX

func (nuo *NotifierUpdateOne) SaveX(ctx context.Context) *Notifier

SaveX is like Save, but panics if an error occurs.

func (*NotifierUpdateOne) Select

func (nuo *NotifierUpdateOne) Select(field string, fields ...string) *NotifierUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NotifierUpdateOne) SetGroup

func (nuo *NotifierUpdateOne) SetGroup(g *Group) *NotifierUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*NotifierUpdateOne) SetGroupID

func (nuo *NotifierUpdateOne) SetGroupID(u uuid.UUID) *NotifierUpdateOne

SetGroupID sets the "group_id" field.

func (*NotifierUpdateOne) SetIsActive

func (nuo *NotifierUpdateOne) SetIsActive(b bool) *NotifierUpdateOne

SetIsActive sets the "is_active" field.

func (*NotifierUpdateOne) SetName

func (nuo *NotifierUpdateOne) SetName(s string) *NotifierUpdateOne

SetName sets the "name" field.

func (*NotifierUpdateOne) SetNillableGroupID

func (nuo *NotifierUpdateOne) SetNillableGroupID(u *uuid.UUID) *NotifierUpdateOne

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*NotifierUpdateOne) SetNillableIsActive

func (nuo *NotifierUpdateOne) SetNillableIsActive(b *bool) *NotifierUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*NotifierUpdateOne) SetNillableName

func (nuo *NotifierUpdateOne) SetNillableName(s *string) *NotifierUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*NotifierUpdateOne) SetNillableURL

func (nuo *NotifierUpdateOne) SetNillableURL(s *string) *NotifierUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*NotifierUpdateOne) SetNillableUserID

func (nuo *NotifierUpdateOne) SetNillableUserID(u *uuid.UUID) *NotifierUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*NotifierUpdateOne) SetURL

func (nuo *NotifierUpdateOne) SetURL(s string) *NotifierUpdateOne

SetURL sets the "url" field.

func (*NotifierUpdateOne) SetUpdatedAt

func (nuo *NotifierUpdateOne) SetUpdatedAt(t time.Time) *NotifierUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*NotifierUpdateOne) SetUser

func (nuo *NotifierUpdateOne) SetUser(u *User) *NotifierUpdateOne

SetUser sets the "user" edge to the User entity.

func (*NotifierUpdateOne) SetUserID

func (nuo *NotifierUpdateOne) SetUserID(u uuid.UUID) *NotifierUpdateOne

SetUserID sets the "user_id" field.

func (*NotifierUpdateOne) Where

Where appends a list predicates to the NotifierUpdate builder.

type Notifiers

type Notifiers []*Notifier

Notifiers is a parsable slice of Notifier.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type 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 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 {

	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// AuthRoles is the client for interacting with the AuthRoles builders.
	AuthRoles *AuthRolesClient
	// AuthTokens is the client for interacting with the AuthTokens builders.
	AuthTokens *AuthTokensClient
	// Document is the client for interacting with the Document builders.
	Document *DocumentClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupInvitationToken is the client for interacting with the GroupInvitationToken builders.
	GroupInvitationToken *GroupInvitationTokenClient
	// Item is the client for interacting with the Item builders.
	Item *ItemClient
	// ItemField is the client for interacting with the ItemField builders.
	ItemField *ItemFieldClient
	// Label is the client for interacting with the Label builders.
	Label *LabelClient
	// Location is the client for interacting with the Location builders.
	Location *LocationClient
	// MaintenanceEntry is the client for interacting with the MaintenanceEntry builders.
	MaintenanceEntry *MaintenanceEntryClient
	// Notifier is the client for interacting with the Notifier builders.
	Notifier *NotifierClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `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"`
	// 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:"-"`
	// IsSuperuser holds the value of the "is_superuser" field.
	IsSuperuser bool `json:"is_superuser,omitempty"`
	// Superuser holds the value of the "superuser" field.
	Superuser bool `json:"superuser,omitempty"`
	// Role holds the value of the "role" field.
	Role user.Role `json:"role,omitempty"`
	// ActivatedOn holds the value of the "activated_on" field.
	ActivatedOn time.Time `json:"activated_on,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) GetID

func (u *User) GetID() uuid.UUID

func (*User) QueryAuthTokens

func (u *User) QueryAuthTokens() *AuthTokensQuery

QueryAuthTokens queries the "auth_tokens" edge of the User entity.

func (*User) QueryGroup

func (u *User) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the User entity.

func (*User) QueryNotifiers

func (u *User) QueryNotifiers() *NotifierQuery

QueryNotifiers queries the "notifiers" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

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 uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *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) QueryAuthTokens

func (c *UserClient) QueryAuthTokens(u *User) *AuthTokensQuery

QueryAuthTokens queries the auth_tokens edge of a User.

func (*UserClient) QueryGroup

func (c *UserClient) QueryGroup(u *User) *GroupQuery

QueryGroup queries the group edge of a User.

func (*UserClient) QueryNotifiers

func (c *UserClient) QueryNotifiers(u *User) *NotifierQuery

QueryNotifiers queries the notifiers 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 uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddAuthTokenIDs

func (uc *UserCreate) AddAuthTokenIDs(ids ...uuid.UUID) *UserCreate

AddAuthTokenIDs adds the "auth_tokens" edge to the AuthTokens entity by IDs.

func (*UserCreate) AddAuthTokens

func (uc *UserCreate) AddAuthTokens(a ...*AuthTokens) *UserCreate

AddAuthTokens adds the "auth_tokens" edges to the AuthTokens entity.

func (*UserCreate) AddNotifierIDs

func (uc *UserCreate) AddNotifierIDs(ids ...uuid.UUID) *UserCreate

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by IDs.

func (*UserCreate) AddNotifiers

func (uc *UserCreate) AddNotifiers(n ...*Notifier) *UserCreate

AddNotifiers adds the "notifiers" edges to the Notifier entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetActivatedOn

func (uc *UserCreate) SetActivatedOn(t time.Time) *UserCreate

SetActivatedOn sets the "activated_on" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetGroup

func (uc *UserCreate) SetGroup(g *Group) *UserCreate

SetGroup sets the "group" edge to the Group entity.

func (*UserCreate) SetGroupID

func (uc *UserCreate) SetGroupID(id uuid.UUID) *UserCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsSuperuser

func (uc *UserCreate) SetIsSuperuser(b bool) *UserCreate

SetIsSuperuser sets the "is_superuser" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableActivatedOn

func (uc *UserCreate) SetNillableActivatedOn(t *time.Time) *UserCreate

SetNillableActivatedOn sets the "activated_on" field if the given value is not nil.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableIsSuperuser

func (uc *UserCreate) SetNillableIsSuperuser(b *bool) *UserCreate

SetNillableIsSuperuser sets the "is_superuser" field if the given value is not nil.

func (*UserCreate) SetNillableRole

func (uc *UserCreate) SetNillableRole(u *user.Role) *UserCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserCreate) SetNillableSuperuser

func (uc *UserCreate) SetNillableSuperuser(b *bool) *UserCreate

SetNillableSuperuser sets the "superuser" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetRole

func (uc *UserCreate) SetRole(u user.Role) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetSuperuser

func (uc *UserCreate) SetSuperuser(b bool) *UserCreate

SetSuperuser sets the "superuser" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// AuthTokens holds the value of the auth_tokens edge.
	AuthTokens []*AuthTokens `json:"auth_tokens,omitempty"`
	// Notifiers holds the value of the notifiers edge.
	Notifiers []*Notifier `json:"notifiers,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AuthTokensOrErr

func (e UserEdges) AuthTokensOrErr() ([]*AuthTokens, error)

AuthTokensOrErr returns the AuthTokens value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroupOrErr

func (e UserEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) NotifiersOrErr

func (e UserEdges) NotifiersOrErr() ([]*Notifier, error)

NotifiersOrErr returns the Notifiers value or an error if the edge was not loaded in eager-loading.

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) ActivatedOn

func (m *UserMutation) ActivatedOn() (r time.Time, exists bool)

ActivatedOn returns the value of the "activated_on" field in the mutation.

func (*UserMutation) ActivatedOnCleared

func (m *UserMutation) ActivatedOnCleared() bool

ActivatedOnCleared returns if the "activated_on" field was cleared in this mutation.

func (*UserMutation) AddAuthTokenIDs

func (m *UserMutation) AddAuthTokenIDs(ids ...uuid.UUID)

AddAuthTokenIDs adds the "auth_tokens" edge to the AuthTokens entity by ids.

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) AddNotifierIDs

func (m *UserMutation) AddNotifierIDs(ids ...uuid.UUID)

AddNotifierIDs adds the "notifiers" edge to the Notifier 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) AuthTokensCleared

func (m *UserMutation) AuthTokensCleared() bool

AuthTokensCleared reports if the "auth_tokens" edge to the AuthTokens entity was cleared.

func (*UserMutation) AuthTokensIDs

func (m *UserMutation) AuthTokensIDs() (ids []uuid.UUID)

AuthTokensIDs returns the "auth_tokens" edge IDs in the mutation.

func (*UserMutation) ClearActivatedOn

func (m *UserMutation) ClearActivatedOn()

ClearActivatedOn clears the value of the "activated_on" field.

func (*UserMutation) ClearAuthTokens

func (m *UserMutation) ClearAuthTokens()

ClearAuthTokens clears the "auth_tokens" edge to the AuthTokens 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) ClearGroup

func (m *UserMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*UserMutation) ClearNotifiers

func (m *UserMutation) ClearNotifiers()

ClearNotifiers clears the "notifiers" edge to the Notifier 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) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) GroupCleared

func (m *UserMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*UserMutation) GroupID

func (m *UserMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*UserMutation) GroupIDs

func (m *UserMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, 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) ([]uuid.UUID, 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) IsSuperuser

func (m *UserMutation) IsSuperuser() (r bool, exists bool)

IsSuperuser returns the value of the "is_superuser" field in the mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) NotifiersCleared

func (m *UserMutation) NotifiersCleared() bool

NotifiersCleared reports if the "notifiers" edge to the Notifier entity was cleared.

func (*UserMutation) NotifiersIDs

func (m *UserMutation) NotifiersIDs() (ids []uuid.UUID)

NotifiersIDs returns the "notifiers" edge IDs in the mutation.

func (*UserMutation) OldActivatedOn

func (m *UserMutation) OldActivatedOn(ctx context.Context) (v time.Time, err error)

OldActivatedOn returns the old "activated_on" 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) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldIsSuperuser

func (m *UserMutation) OldIsSuperuser(ctx context.Context) (v bool, err error)

OldIsSuperuser returns the old "is_superuser" 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) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) 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) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error)

OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldSuperuser

func (m *UserMutation) OldSuperuser(ctx context.Context) (v bool, err error)

OldSuperuser returns the old "superuser" 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) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" 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) RemoveAuthTokenIDs

func (m *UserMutation) RemoveAuthTokenIDs(ids ...uuid.UUID)

RemoveAuthTokenIDs removes the "auth_tokens" edge to the AuthTokens entity by IDs.

func (*UserMutation) RemoveNotifierIDs

func (m *UserMutation) RemoveNotifierIDs(ids ...uuid.UUID)

RemoveNotifierIDs removes the "notifiers" edge to the Notifier entity by IDs.

func (*UserMutation) RemovedAuthTokensIDs

func (m *UserMutation) RemovedAuthTokensIDs() (ids []uuid.UUID)

RemovedAuthTokens returns the removed IDs of the "auth_tokens" edge to the AuthTokens entity.

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) RemovedNotifiersIDs

func (m *UserMutation) RemovedNotifiersIDs() (ids []uuid.UUID)

RemovedNotifiers returns the removed IDs of the "notifiers" edge to the Notifier entity.

func (*UserMutation) ResetActivatedOn

func (m *UserMutation) ResetActivatedOn()

ResetActivatedOn resets all changes to the "activated_on" field.

func (*UserMutation) ResetAuthTokens

func (m *UserMutation) ResetAuthTokens()

ResetAuthTokens resets all changes to the "auth_tokens" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetGroup

func (m *UserMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*UserMutation) ResetIsSuperuser

func (m *UserMutation) ResetIsSuperuser()

ResetIsSuperuser resets all changes to the "is_superuser" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetNotifiers

func (m *UserMutation) ResetNotifiers()

ResetNotifiers resets all changes to the "notifiers" edge.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetSuperuser

func (m *UserMutation) ResetSuperuser()

ResetSuperuser resets all changes to the "superuser" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r user.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetActivatedOn

func (m *UserMutation) SetActivatedOn(t time.Time)

SetActivatedOn sets the "activated_on" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetGroupID

func (m *UserMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIsSuperuser

func (m *UserMutation) SetIsSuperuser(b bool)

SetIsSuperuser sets the "is_superuser" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

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) SetRole

func (m *UserMutation) SetRole(u user.Role)

SetRole sets the "role" field.

func (*UserMutation) SetSuperuser

func (m *UserMutation) SetSuperuser(b bool)

SetSuperuser sets the "superuser" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) Superuser

func (m *UserMutation) Superuser() (r bool, exists bool)

Superuser returns the value of the "superuser" field in the mutation.

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) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, 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) uuid.UUID

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

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 uuid.UUID, 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) uuid.UUID

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) QueryAuthTokens

func (uq *UserQuery) QueryAuthTokens() *AuthTokensQuery

QueryAuthTokens chains the current query on the "auth_tokens" edge.

func (*UserQuery) QueryGroup

func (uq *UserQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*UserQuery) QueryNotifiers

func (uq *UserQuery) QueryNotifiers() *NotifierQuery

QueryNotifiers chains the current query on the "notifiers" 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	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) WithAuthTokens

func (uq *UserQuery) WithAuthTokens(opts ...func(*AuthTokensQuery)) *UserQuery

WithAuthTokens tells the query-builder to eager-load the nodes that are connected to the "auth_tokens" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroup

func (uq *UserQuery) WithGroup(opts ...func(*GroupQuery)) *UserQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNotifiers

func (uq *UserQuery) WithNotifiers(opts ...func(*NotifierQuery)) *UserQuery

WithNotifiers tells the query-builder to eager-load the nodes that are connected to the "notifiers" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddAuthTokenIDs

func (uu *UserUpdate) AddAuthTokenIDs(ids ...uuid.UUID) *UserUpdate

AddAuthTokenIDs adds the "auth_tokens" edge to the AuthTokens entity by IDs.

func (*UserUpdate) AddAuthTokens

func (uu *UserUpdate) AddAuthTokens(a ...*AuthTokens) *UserUpdate

AddAuthTokens adds the "auth_tokens" edges to the AuthTokens entity.

func (*UserUpdate) AddNotifierIDs

func (uu *UserUpdate) AddNotifierIDs(ids ...uuid.UUID) *UserUpdate

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by IDs.

func (*UserUpdate) AddNotifiers

func (uu *UserUpdate) AddNotifiers(n ...*Notifier) *UserUpdate

AddNotifiers adds the "notifiers" edges to the Notifier entity.

func (*UserUpdate) ClearActivatedOn

func (uu *UserUpdate) ClearActivatedOn() *UserUpdate

ClearActivatedOn clears the value of the "activated_on" field.

func (*UserUpdate) ClearAuthTokens

func (uu *UserUpdate) ClearAuthTokens() *UserUpdate

ClearAuthTokens clears all "auth_tokens" edges to the AuthTokens entity.

func (*UserUpdate) ClearGroup

func (uu *UserUpdate) ClearGroup() *UserUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*UserUpdate) ClearNotifiers

func (uu *UserUpdate) ClearNotifiers() *UserUpdate

ClearNotifiers clears all "notifiers" edges to the Notifier entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveAuthTokenIDs

func (uu *UserUpdate) RemoveAuthTokenIDs(ids ...uuid.UUID) *UserUpdate

RemoveAuthTokenIDs removes the "auth_tokens" edge to AuthTokens entities by IDs.

func (*UserUpdate) RemoveAuthTokens

func (uu *UserUpdate) RemoveAuthTokens(a ...*AuthTokens) *UserUpdate

RemoveAuthTokens removes "auth_tokens" edges to AuthTokens entities.

func (*UserUpdate) RemoveNotifierIDs

func (uu *UserUpdate) RemoveNotifierIDs(ids ...uuid.UUID) *UserUpdate

RemoveNotifierIDs removes the "notifiers" edge to Notifier entities by IDs.

func (*UserUpdate) RemoveNotifiers

func (uu *UserUpdate) RemoveNotifiers(n ...*Notifier) *UserUpdate

RemoveNotifiers removes "notifiers" edges to Notifier 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) SetActivatedOn

func (uu *UserUpdate) SetActivatedOn(t time.Time) *UserUpdate

SetActivatedOn sets the "activated_on" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetGroup

func (uu *UserUpdate) SetGroup(g *Group) *UserUpdate

SetGroup sets the "group" edge to the Group entity.

func (*UserUpdate) SetGroupID

func (uu *UserUpdate) SetGroupID(id uuid.UUID) *UserUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*UserUpdate) SetIsSuperuser

func (uu *UserUpdate) SetIsSuperuser(b bool) *UserUpdate

SetIsSuperuser sets the "is_superuser" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableActivatedOn

func (uu *UserUpdate) SetNillableActivatedOn(t *time.Time) *UserUpdate

SetNillableActivatedOn sets the "activated_on" field 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) SetNillableIsSuperuser

func (uu *UserUpdate) SetNillableIsSuperuser(b *bool) *UserUpdate

SetNillableIsSuperuser sets the "is_superuser" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" 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) SetNillableRole

func (uu *UserUpdate) SetNillableRole(u *user.Role) *UserUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdate) SetNillableSuperuser

func (uu *UserUpdate) SetNillableSuperuser(b *bool) *UserUpdate

SetNillableSuperuser sets the "superuser" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(u user.Role) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetSuperuser

func (uu *UserUpdate) SetSuperuser(b bool) *UserUpdate

SetSuperuser sets the "superuser" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddAuthTokenIDs

func (uuo *UserUpdateOne) AddAuthTokenIDs(ids ...uuid.UUID) *UserUpdateOne

AddAuthTokenIDs adds the "auth_tokens" edge to the AuthTokens entity by IDs.

func (*UserUpdateOne) AddAuthTokens

func (uuo *UserUpdateOne) AddAuthTokens(a ...*AuthTokens) *UserUpdateOne

AddAuthTokens adds the "auth_tokens" edges to the AuthTokens entity.

func (*UserUpdateOne) AddNotifierIDs

func (uuo *UserUpdateOne) AddNotifierIDs(ids ...uuid.UUID) *UserUpdateOne

AddNotifierIDs adds the "notifiers" edge to the Notifier entity by IDs.

func (*UserUpdateOne) AddNotifiers

func (uuo *UserUpdateOne) AddNotifiers(n ...*Notifier) *UserUpdateOne

AddNotifiers adds the "notifiers" edges to the Notifier entity.

func (*UserUpdateOne) ClearActivatedOn

func (uuo *UserUpdateOne) ClearActivatedOn() *UserUpdateOne

ClearActivatedOn clears the value of the "activated_on" field.

func (*UserUpdateOne) ClearAuthTokens

func (uuo *UserUpdateOne) ClearAuthTokens() *UserUpdateOne

ClearAuthTokens clears all "auth_tokens" edges to the AuthTokens entity.

func (*UserUpdateOne) ClearGroup

func (uuo *UserUpdateOne) ClearGroup() *UserUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*UserUpdateOne) ClearNotifiers

func (uuo *UserUpdateOne) ClearNotifiers() *UserUpdateOne

ClearNotifiers clears all "notifiers" edges to the Notifier entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveAuthTokenIDs

func (uuo *UserUpdateOne) RemoveAuthTokenIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveAuthTokenIDs removes the "auth_tokens" edge to AuthTokens entities by IDs.

func (*UserUpdateOne) RemoveAuthTokens

func (uuo *UserUpdateOne) RemoveAuthTokens(a ...*AuthTokens) *UserUpdateOne

RemoveAuthTokens removes "auth_tokens" edges to AuthTokens entities.

func (*UserUpdateOne) RemoveNotifierIDs

func (uuo *UserUpdateOne) RemoveNotifierIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveNotifierIDs removes the "notifiers" edge to Notifier entities by IDs.

func (*UserUpdateOne) RemoveNotifiers

func (uuo *UserUpdateOne) RemoveNotifiers(n ...*Notifier) *UserUpdateOne

RemoveNotifiers removes "notifiers" edges to Notifier 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) SetActivatedOn

func (uuo *UserUpdateOne) SetActivatedOn(t time.Time) *UserUpdateOne

SetActivatedOn sets the "activated_on" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetGroup

func (uuo *UserUpdateOne) SetGroup(g *Group) *UserUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*UserUpdateOne) SetGroupID

func (uuo *UserUpdateOne) SetGroupID(id uuid.UUID) *UserUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*UserUpdateOne) SetIsSuperuser

func (uuo *UserUpdateOne) SetIsSuperuser(b bool) *UserUpdateOne

SetIsSuperuser sets the "is_superuser" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableActivatedOn

func (uuo *UserUpdateOne) SetNillableActivatedOn(t *time.Time) *UserUpdateOne

SetNillableActivatedOn sets the "activated_on" field 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) SetNillableIsSuperuser

func (uuo *UserUpdateOne) SetNillableIsSuperuser(b *bool) *UserUpdateOne

SetNillableIsSuperuser sets the "is_superuser" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" 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) SetNillableRole

func (uuo *UserUpdateOne) SetNillableRole(u *user.Role) *UserUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*UserUpdateOne) SetNillableSuperuser

func (uuo *UserUpdateOne) SetNillableSuperuser(b *bool) *UserUpdateOne

SetNillableSuperuser sets the "superuser" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetSuperuser

func (uuo *UserUpdateOne) SetSuperuser(b bool) *UserUpdateOne

SetSuperuser sets the "superuser" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL