ent

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 28 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"
	TypeGroup           = "Group"
	TypeMultiWordSchema = "MultiWordSchema"
	TypeNilExample      = "NilExample"
	TypePet             = "Pet"
	TypePony            = "Pony"
	TypeSkipEdgeExample = "SkipEdgeExample"
	TypeTodo            = "Todo"
	TypeUser            = "User"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(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"`
	// 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) QueryRecipients

func (a *Attachment) QueryRecipients() *UserQuery

QueryRecipients queries the "recipients" edge of the Attachment entity.

func (*Attachment) QueryUser

func (a *Attachment) QueryUser() *UserQuery

QueryUser queries the "user" 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.

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

DeleteOne 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) Query

func (c *AttachmentClient) Query() *AttachmentQuery

Query returns a query builder for Attachment.

func (*AttachmentClient) QueryRecipients

func (c *AttachmentClient) QueryRecipients(a *Attachment) *UserQuery

QueryRecipients queries the recipients edge of a Attachment.

func (*AttachmentClient) QueryUser

func (c *AttachmentClient) QueryUser(a *Attachment) *UserQuery

QueryUser queries the user 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) AddRecipientIDs

func (ac *AttachmentCreate) AddRecipientIDs(ids ...int) *AttachmentCreate

AddRecipientIDs adds the "recipients" edge to the User entity by IDs.

func (*AttachmentCreate) AddRecipients

func (ac *AttachmentCreate) AddRecipients(u ...*User) *AttachmentCreate

AddRecipients adds the "recipients" edges to the User entity.

func (*AttachmentCreate) Exec added in v0.2.0

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

Exec executes the query.

func (*AttachmentCreate) ExecX added in v0.2.0

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

SetID sets the "id" field.

func (*AttachmentCreate) SetNillableID added in v0.3.0

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

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

func (*AttachmentCreate) SetNillableUserID

func (ac *AttachmentCreate) SetNillableUserID(id *int) *AttachmentCreate

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

func (*AttachmentCreate) SetUser

func (ac *AttachmentCreate) SetUser(u *User) *AttachmentCreate

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

func (*AttachmentCreate) SetUserID

func (ac *AttachmentCreate) SetUserID(id int) *AttachmentCreate

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

type AttachmentCreateBulk

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

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

func (*AttachmentCreateBulk) Exec added in v0.2.0

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

Exec executes the query.

func (*AttachmentCreateBulk) ExecX added in v0.2.0

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.

type AttachmentEdges

type AttachmentEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Recipients holds the value of the recipients edge.
	Recipients []*User `json:"recipients,omitempty"`
	// contains filtered or unexported fields
}

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

func (AttachmentEdges) RecipientsOrErr

func (e AttachmentEdges) RecipientsOrErr() ([]*User, error)

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

func (AttachmentEdges) UserOrErr

func (e AttachmentEdges) 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 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 group-by 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) AddRecipientIDs

func (m *AttachmentMutation) AddRecipientIDs(ids ...int)

AddRecipientIDs adds the "recipients" edge to the User entity by ids.

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

func (m *AttachmentMutation) ClearRecipients()

ClearRecipients clears the "recipients" edge to the User entity.

func (*AttachmentMutation) ClearUser

func (m *AttachmentMutation) ClearUser()

ClearUser clears the "user" edge to the User 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) 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) 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 added in v0.3.0

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

func (m *AttachmentMutation) Op() Op

Op returns the operation name.

func (*AttachmentMutation) RecipientsCleared

func (m *AttachmentMutation) RecipientsCleared() bool

RecipientsCleared reports if the "recipients" edge to the User entity was cleared.

func (*AttachmentMutation) RecipientsIDs

func (m *AttachmentMutation) RecipientsIDs() (ids []int)

RecipientsIDs returns the "recipients" edge IDs in the mutation.

func (*AttachmentMutation) RemoveRecipientIDs

func (m *AttachmentMutation) RemoveRecipientIDs(ids ...int)

RemoveRecipientIDs removes the "recipients" edge to the User entity by IDs.

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

func (m *AttachmentMutation) RemovedRecipientsIDs() (ids []int)

RemovedRecipients returns the removed IDs of the "recipients" edge to the User entity.

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

func (m *AttachmentMutation) ResetRecipients()

ResetRecipients resets all changes to the "recipients" edge.

func (*AttachmentMutation) ResetUser

func (m *AttachmentMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

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

func (m *AttachmentMutation) SetUserID(id int)

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

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

func (m *AttachmentMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AttachmentMutation) UserID

func (m *AttachmentMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*AttachmentMutation) UserIDs

func (m *AttachmentMutation) UserIDs() (ids []int)

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

func (*AttachmentMutation) Where added in v0.2.0

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

Where appends a list predicates to the AttachmentMutation builder.

type AttachmentQuery

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

AttachmentQuery is the builder for querying Attachment entities.

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.

func (*AttachmentQuery) IDs

func (aq *AttachmentQuery) IDs(ctx context.Context) ([]uuid.UUID, 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 adds a limit step to the query.

func (*AttachmentQuery) Offset

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

Offset adds an offset step to the query.

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

func (aq *AttachmentQuery) Order(o ...OrderFunc) *AttachmentQuery

Order adds an order step to the query.

func (*AttachmentQuery) QueryRecipients

func (aq *AttachmentQuery) QueryRecipients() *UserQuery

QueryRecipients chains the current query on the "recipients" edge.

func (*AttachmentQuery) QueryUser

func (aq *AttachmentQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" 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.

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

func (aq *AttachmentQuery) WithRecipients(opts ...func(*UserQuery)) *AttachmentQuery

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

func (*AttachmentQuery) WithUser

func (aq *AttachmentQuery) WithUser(opts ...func(*UserQuery)) *AttachmentQuery

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 AttachmentSelect

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

AttachmentSelect is the builder for selecting fields of Attachment entities.

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

func (au *AttachmentUpdate) AddRecipientIDs(ids ...int) *AttachmentUpdate

AddRecipientIDs adds the "recipients" edge to the User entity by IDs.

func (*AttachmentUpdate) AddRecipients

func (au *AttachmentUpdate) AddRecipients(u ...*User) *AttachmentUpdate

AddRecipients adds the "recipients" edges to the User entity.

func (*AttachmentUpdate) ClearRecipients

func (au *AttachmentUpdate) ClearRecipients() *AttachmentUpdate

ClearRecipients clears all "recipients" edges to the User entity.

func (*AttachmentUpdate) ClearUser

func (au *AttachmentUpdate) ClearUser() *AttachmentUpdate

ClearUser clears the "user" edge to the User 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) RemoveRecipientIDs

func (au *AttachmentUpdate) RemoveRecipientIDs(ids ...int) *AttachmentUpdate

RemoveRecipientIDs removes the "recipients" edge to User entities by IDs.

func (*AttachmentUpdate) RemoveRecipients

func (au *AttachmentUpdate) RemoveRecipients(u ...*User) *AttachmentUpdate

RemoveRecipients removes "recipients" edges to User entities.

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

func (au *AttachmentUpdate) SetNillableUserID(id *int) *AttachmentUpdate

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

func (*AttachmentUpdate) SetUser

func (au *AttachmentUpdate) SetUser(u *User) *AttachmentUpdate

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

func (*AttachmentUpdate) SetUserID

func (au *AttachmentUpdate) SetUserID(id int) *AttachmentUpdate

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

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

func (auo *AttachmentUpdateOne) AddRecipientIDs(ids ...int) *AttachmentUpdateOne

AddRecipientIDs adds the "recipients" edge to the User entity by IDs.

func (*AttachmentUpdateOne) AddRecipients

func (auo *AttachmentUpdateOne) AddRecipients(u ...*User) *AttachmentUpdateOne

AddRecipients adds the "recipients" edges to the User entity.

func (*AttachmentUpdateOne) ClearRecipients

func (auo *AttachmentUpdateOne) ClearRecipients() *AttachmentUpdateOne

ClearRecipients clears all "recipients" edges to the User entity.

func (*AttachmentUpdateOne) ClearUser

func (auo *AttachmentUpdateOne) ClearUser() *AttachmentUpdateOne

ClearUser clears the "user" edge to the User 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) RemoveRecipientIDs

func (auo *AttachmentUpdateOne) RemoveRecipientIDs(ids ...int) *AttachmentUpdateOne

RemoveRecipientIDs removes the "recipients" edge to User entities by IDs.

func (*AttachmentUpdateOne) RemoveRecipients

func (auo *AttachmentUpdateOne) RemoveRecipients(u ...*User) *AttachmentUpdateOne

RemoveRecipients removes "recipients" edges to User entities.

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

func (auo *AttachmentUpdateOne) SetNillableUserID(id *int) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetUser

func (auo *AttachmentUpdateOne) SetUser(u *User) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetUserID

func (auo *AttachmentUpdateOne) SetUserID(id int) *AttachmentUpdateOne

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

type Attachments

type Attachments []*Attachment

Attachments is a parsable slice of Attachment.

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
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// MultiWordSchema is the client for interacting with the MultiWordSchema builders.
	MultiWordSchema *MultiWordSchemaClient
	// NilExample is the client for interacting with the NilExample builders.
	NilExample *NilExampleClient
	// Pet is the client for interacting with the Pet builders.
	Pet *PetClient
	// Pony is the client for interacting with the Pony builders.
	Pony *PonyClient
	// SkipEdgeExample is the client for interacting with the SkipEdgeExample builders.
	SkipEdgeExample *SkipEdgeExampleClient
	// Todo is the client for interacting with the Todo builders.
	Todo *TodoClient
	// 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) 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 Group

type Group struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,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) 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.

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 int) *GroupDeleteOne

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

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id int) *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) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for 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 int) *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) AddUserIDs

func (gc *GroupCreate) AddUserIDs(ids ...int) *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 added in v0.2.0

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX added in v0.2.0

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

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" 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 added in v0.2.0

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX added in v0.2.0

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.

type GroupEdges

type GroupEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

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

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 group-by 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 GroupMutation

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

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

func (m *GroupMutation) AddUserIDs(ids ...int)

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) 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) 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) 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 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 (*GroupMutation) IDs added in v0.3.0

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

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

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

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

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveUserIDs

func (m *GroupMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

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

func (m *GroupMutation) RemovedUsersIDs() (ids []int)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

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

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

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

func (m *GroupMutation) SetName(s string)

SetName sets the "name" 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) 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 []int)

UsersIDs returns the "users" edge IDs in the mutation.

func (*GroupMutation) Where added in v0.2.0

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

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 int, 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) int

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

client.Group.Query().
	GroupBy(group.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

func (gq *GroupQuery) IDs(ctx context.Context) ([]int, error)

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

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []int

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

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit adds a limit step to the query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset adds an offset step to the query.

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 int, 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) int

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 ...OrderFunc) *GroupQuery

Order adds an order step to the query.

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

client.Group.Query().
	Select(group.FieldName).
	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) 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) 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) AddUserIDs

func (gu *GroupUpdate) AddUserIDs(ids ...int) *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) 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) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...int) *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) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" 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) AddUserIDs

func (guo *GroupUpdateOne) AddUserIDs(ids ...int) *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) 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) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...int) *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) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

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 MultiWordSchema added in v0.2.0

type MultiWordSchema struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Unit holds the value of the "unit" field.
	Unit multiwordschema.Unit `json:"unit,omitempty"`
	// contains filtered or unexported fields
}

MultiWordSchema is the model entity for the MultiWordSchema schema.

func (*MultiWordSchema) String added in v0.2.0

func (mws *MultiWordSchema) String() string

String implements the fmt.Stringer.

func (*MultiWordSchema) Unwrap added in v0.2.0

func (mws *MultiWordSchema) Unwrap() *MultiWordSchema

Unwrap unwraps the MultiWordSchema 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 (*MultiWordSchema) Update added in v0.2.0

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

type MultiWordSchemaClient added in v0.2.0

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

MultiWordSchemaClient is a client for the MultiWordSchema schema.

func NewMultiWordSchemaClient added in v0.2.0

func NewMultiWordSchemaClient(c config) *MultiWordSchemaClient

NewMultiWordSchemaClient returns a client for the MultiWordSchema from the given config.

func (*MultiWordSchemaClient) Create added in v0.2.0

Create returns a builder for creating a MultiWordSchema entity.

func (*MultiWordSchemaClient) CreateBulk added in v0.2.0

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

func (*MultiWordSchemaClient) Delete added in v0.2.0

Delete returns a delete builder for MultiWordSchema.

func (*MultiWordSchemaClient) DeleteOne added in v0.2.0

DeleteOne returns a builder for deleting the given entity.

func (*MultiWordSchemaClient) DeleteOneID added in v0.2.0

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

func (*MultiWordSchemaClient) Get added in v0.2.0

Get returns a MultiWordSchema entity by its id.

func (*MultiWordSchemaClient) GetX added in v0.2.0

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

func (*MultiWordSchemaClient) Hooks added in v0.2.0

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

Hooks returns the client hooks.

func (*MultiWordSchemaClient) Query added in v0.2.0

Query returns a query builder for MultiWordSchema.

func (*MultiWordSchemaClient) Update added in v0.2.0

Update returns an update builder for MultiWordSchema.

func (*MultiWordSchemaClient) UpdateOne added in v0.2.0

UpdateOne returns an update builder for the given entity.

func (*MultiWordSchemaClient) UpdateOneID added in v0.2.0

UpdateOneID returns an update builder for the given id.

func (*MultiWordSchemaClient) Use added in v0.2.0

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

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

type MultiWordSchemaCreate added in v0.2.0

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

MultiWordSchemaCreate is the builder for creating a MultiWordSchema entity.

func (*MultiWordSchemaCreate) Exec added in v0.2.0

func (mwsc *MultiWordSchemaCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MultiWordSchemaCreate) ExecX added in v0.2.0

func (mwsc *MultiWordSchemaCreate) ExecX(ctx context.Context)

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

func (*MultiWordSchemaCreate) Mutation added in v0.2.0

Mutation returns the MultiWordSchemaMutation object of the builder.

func (*MultiWordSchemaCreate) Save added in v0.2.0

Save creates the MultiWordSchema in the database.

func (*MultiWordSchemaCreate) SaveX added in v0.2.0

SaveX calls Save and panics if Save returns an error.

func (*MultiWordSchemaCreate) SetNillableUnit added in v0.2.0

SetNillableUnit sets the "unit" field if the given value is not nil.

func (*MultiWordSchemaCreate) SetUnit added in v0.2.0

SetUnit sets the "unit" field.

type MultiWordSchemaCreateBulk added in v0.2.0

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

MultiWordSchemaCreateBulk is the builder for creating many MultiWordSchema entities in bulk.

func (*MultiWordSchemaCreateBulk) Exec added in v0.2.0

Exec executes the query.

func (*MultiWordSchemaCreateBulk) ExecX added in v0.2.0

func (mwscb *MultiWordSchemaCreateBulk) ExecX(ctx context.Context)

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

func (*MultiWordSchemaCreateBulk) Save added in v0.2.0

Save creates the MultiWordSchema entities in the database.

func (*MultiWordSchemaCreateBulk) SaveX added in v0.2.0

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

type MultiWordSchemaDelete added in v0.2.0

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

MultiWordSchemaDelete is the builder for deleting a MultiWordSchema entity.

func (*MultiWordSchemaDelete) Exec added in v0.2.0

func (mwsd *MultiWordSchemaDelete) Exec(ctx context.Context) (int, error)

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

func (*MultiWordSchemaDelete) ExecX added in v0.2.0

func (mwsd *MultiWordSchemaDelete) ExecX(ctx context.Context) int

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

func (*MultiWordSchemaDelete) Where added in v0.2.0

Where appends a list predicates to the MultiWordSchemaDelete builder.

type MultiWordSchemaDeleteOne added in v0.2.0

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

MultiWordSchemaDeleteOne is the builder for deleting a single MultiWordSchema entity.

func (*MultiWordSchemaDeleteOne) Exec added in v0.2.0

func (mwsdo *MultiWordSchemaDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MultiWordSchemaDeleteOne) ExecX added in v0.2.0

func (mwsdo *MultiWordSchemaDeleteOne) ExecX(ctx context.Context)

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

type MultiWordSchemaGroupBy added in v0.2.0

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

MultiWordSchemaGroupBy is the group-by builder for MultiWordSchema entities.

func (*MultiWordSchemaGroupBy) Aggregate added in v0.2.0

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

func (*MultiWordSchemaGroupBy) Bool added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) BoolX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Bools added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) BoolsX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Float64 added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Float64X added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Float64s added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Float64sX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Int added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) IntX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Ints added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) IntsX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Scan added in v0.2.0

func (mwsgb *MultiWordSchemaGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*MultiWordSchemaGroupBy) ScanX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) String added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) StringX added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) Strings added in v0.2.0

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

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

func (*MultiWordSchemaGroupBy) StringsX added in v0.2.0

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

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

type MultiWordSchemaMutation added in v0.2.0

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

MultiWordSchemaMutation represents an operation that mutates the MultiWordSchema nodes in the graph.

func (*MultiWordSchemaMutation) AddField added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) AddedEdges added in v0.2.0

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

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

func (*MultiWordSchemaMutation) AddedField added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) AddedFields added in v0.2.0

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

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

func (*MultiWordSchemaMutation) AddedIDs added in v0.2.0

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

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

func (*MultiWordSchemaMutation) ClearEdge added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) ClearField added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) ClearedEdges added in v0.2.0

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

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

func (*MultiWordSchemaMutation) ClearedFields added in v0.2.0

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

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

func (MultiWordSchemaMutation) Client added in v0.2.0

func (m MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) EdgeCleared added in v0.2.0

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

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

func (*MultiWordSchemaMutation) Field added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) FieldCleared added in v0.2.0

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

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

func (*MultiWordSchemaMutation) Fields added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) ID added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) IDs added in v0.3.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) OldField added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) OldUnit added in v0.2.0

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

func (*MultiWordSchemaMutation) Op added in v0.2.0

func (m *MultiWordSchemaMutation) Op() Op

Op returns the operation name.

func (*MultiWordSchemaMutation) RemovedEdges added in v0.2.0

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

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

func (*MultiWordSchemaMutation) RemovedIDs added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) ResetEdge added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) ResetField added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) ResetUnit added in v0.2.0

func (m *MultiWordSchemaMutation) ResetUnit()

ResetUnit resets all changes to the "unit" field.

func (*MultiWordSchemaMutation) SetField added in v0.2.0

func (m *MultiWordSchemaMutation) 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 (*MultiWordSchemaMutation) SetUnit added in v0.2.0

func (m *MultiWordSchemaMutation) SetUnit(value multiwordschema.Unit)

SetUnit sets the "unit" field.

func (MultiWordSchemaMutation) Tx added in v0.2.0

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

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

func (*MultiWordSchemaMutation) Type added in v0.2.0

func (m *MultiWordSchemaMutation) Type() string

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

func (*MultiWordSchemaMutation) Unit added in v0.2.0

func (m *MultiWordSchemaMutation) Unit() (r multiwordschema.Unit, exists bool)

Unit returns the value of the "unit" field in the mutation.

func (*MultiWordSchemaMutation) Where added in v0.2.0

Where appends a list predicates to the MultiWordSchemaMutation builder.

type MultiWordSchemaQuery added in v0.2.0

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

MultiWordSchemaQuery is the builder for querying MultiWordSchema entities.

func (*MultiWordSchemaQuery) All added in v0.2.0

All executes the query and returns a list of MultiWordSchemas.

func (*MultiWordSchemaQuery) AllX added in v0.2.0

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

func (*MultiWordSchemaQuery) Clone added in v0.2.0

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

func (*MultiWordSchemaQuery) Count added in v0.2.0

func (mwsq *MultiWordSchemaQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MultiWordSchemaQuery) CountX added in v0.2.0

func (mwsq *MultiWordSchemaQuery) CountX(ctx context.Context) int

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

func (*MultiWordSchemaQuery) Exist added in v0.2.0

func (mwsq *MultiWordSchemaQuery) Exist(ctx context.Context) (bool, error)

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

func (*MultiWordSchemaQuery) ExistX added in v0.2.0

func (mwsq *MultiWordSchemaQuery) ExistX(ctx context.Context) bool

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

func (*MultiWordSchemaQuery) First added in v0.2.0

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

func (*MultiWordSchemaQuery) FirstID added in v0.2.0

func (mwsq *MultiWordSchemaQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MultiWordSchemaQuery) FirstIDX added in v0.2.0

func (mwsq *MultiWordSchemaQuery) FirstIDX(ctx context.Context) int

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

func (*MultiWordSchemaQuery) FirstX added in v0.2.0

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

func (*MultiWordSchemaQuery) GroupBy added in v0.2.0

func (mwsq *MultiWordSchemaQuery) GroupBy(field string, fields ...string) *MultiWordSchemaGroupBy

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 {
	Unit multiwordschema.Unit `json:"unit,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MultiWordSchema.Query().
	GroupBy(multiwordschema.FieldUnit).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MultiWordSchemaQuery) IDs added in v0.2.0

func (mwsq *MultiWordSchemaQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MultiWordSchemaQuery) IDsX added in v0.2.0

func (mwsq *MultiWordSchemaQuery) IDsX(ctx context.Context) []int

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

func (*MultiWordSchemaQuery) Limit added in v0.2.0

func (mwsq *MultiWordSchemaQuery) Limit(limit int) *MultiWordSchemaQuery

Limit adds a limit step to the query.

func (*MultiWordSchemaQuery) Offset added in v0.2.0

func (mwsq *MultiWordSchemaQuery) Offset(offset int) *MultiWordSchemaQuery

Offset adds an offset step to the query.

func (*MultiWordSchemaQuery) Only added in v0.2.0

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

func (*MultiWordSchemaQuery) OnlyID added in v0.2.0

func (mwsq *MultiWordSchemaQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MultiWordSchemaQuery) OnlyIDX added in v0.2.0

func (mwsq *MultiWordSchemaQuery) OnlyIDX(ctx context.Context) int

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

func (*MultiWordSchemaQuery) OnlyX added in v0.2.0

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

func (*MultiWordSchemaQuery) Order added in v0.2.0

Order adds an order step to the query.

func (*MultiWordSchemaQuery) Select added in v0.2.0

func (mwsq *MultiWordSchemaQuery) Select(fields ...string) *MultiWordSchemaSelect

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 {
	Unit multiwordschema.Unit `json:"unit,omitempty"`
}

client.MultiWordSchema.Query().
	Select(multiwordschema.FieldUnit).
	Scan(ctx, &v)

func (*MultiWordSchemaQuery) Unique added in v0.2.0

func (mwsq *MultiWordSchemaQuery) Unique(unique bool) *MultiWordSchemaQuery

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 (*MultiWordSchemaQuery) Where added in v0.2.0

Where adds a new predicate for the MultiWordSchemaQuery builder.

type MultiWordSchemaSelect added in v0.2.0

type MultiWordSchemaSelect struct {
	*MultiWordSchemaQuery
	// contains filtered or unexported fields
}

MultiWordSchemaSelect is the builder for selecting fields of MultiWordSchema entities.

func (*MultiWordSchemaSelect) Bool added in v0.2.0

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

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

func (*MultiWordSchemaSelect) BoolX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Bools added in v0.2.0

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

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

func (*MultiWordSchemaSelect) BoolsX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Float64 added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Float64X added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Float64s added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Float64sX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Int added in v0.2.0

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

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

func (*MultiWordSchemaSelect) IntX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Ints added in v0.2.0

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

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

func (*MultiWordSchemaSelect) IntsX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Scan added in v0.2.0

func (mwss *MultiWordSchemaSelect) Scan(ctx context.Context, v any) error

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

func (*MultiWordSchemaSelect) ScanX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) String added in v0.2.0

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

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

func (*MultiWordSchemaSelect) StringX added in v0.2.0

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

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

func (*MultiWordSchemaSelect) Strings added in v0.2.0

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

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

func (*MultiWordSchemaSelect) StringsX added in v0.2.0

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

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

type MultiWordSchemaUpdate added in v0.2.0

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

MultiWordSchemaUpdate is the builder for updating MultiWordSchema entities.

func (*MultiWordSchemaUpdate) Exec added in v0.2.0

func (mwsu *MultiWordSchemaUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MultiWordSchemaUpdate) ExecX added in v0.2.0

func (mwsu *MultiWordSchemaUpdate) ExecX(ctx context.Context)

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

func (*MultiWordSchemaUpdate) Mutation added in v0.2.0

Mutation returns the MultiWordSchemaMutation object of the builder.

func (*MultiWordSchemaUpdate) Save added in v0.2.0

func (mwsu *MultiWordSchemaUpdate) Save(ctx context.Context) (int, error)

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

func (*MultiWordSchemaUpdate) SaveX added in v0.2.0

func (mwsu *MultiWordSchemaUpdate) SaveX(ctx context.Context) int

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

func (*MultiWordSchemaUpdate) SetNillableUnit added in v0.2.0

SetNillableUnit sets the "unit" field if the given value is not nil.

func (*MultiWordSchemaUpdate) SetUnit added in v0.2.0

SetUnit sets the "unit" field.

func (*MultiWordSchemaUpdate) Where added in v0.2.0

Where appends a list predicates to the MultiWordSchemaUpdate builder.

type MultiWordSchemaUpdateOne added in v0.2.0

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

MultiWordSchemaUpdateOne is the builder for updating a single MultiWordSchema entity.

func (*MultiWordSchemaUpdateOne) Exec added in v0.2.0

func (mwsuo *MultiWordSchemaUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MultiWordSchemaUpdateOne) ExecX added in v0.2.0

func (mwsuo *MultiWordSchemaUpdateOne) ExecX(ctx context.Context)

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

func (*MultiWordSchemaUpdateOne) Mutation added in v0.2.0

Mutation returns the MultiWordSchemaMutation object of the builder.

func (*MultiWordSchemaUpdateOne) Save added in v0.2.0

Save executes the query and returns the updated MultiWordSchema entity.

func (*MultiWordSchemaUpdateOne) SaveX added in v0.2.0

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

func (*MultiWordSchemaUpdateOne) Select added in v0.2.0

func (mwsuo *MultiWordSchemaUpdateOne) Select(field string, fields ...string) *MultiWordSchemaUpdateOne

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

func (*MultiWordSchemaUpdateOne) SetNillableUnit added in v0.2.0

SetNillableUnit sets the "unit" field if the given value is not nil.

func (*MultiWordSchemaUpdateOne) SetUnit added in v0.2.0

SetUnit sets the "unit" field.

type MultiWordSchemas added in v0.2.0

type MultiWordSchemas []*MultiWordSchema

MultiWordSchemas is a parsable slice of MultiWordSchema.

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 NilExample added in v0.2.0

type NilExample struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// StrNil holds the value of the "str_nil" field.
	StrNil *string `json:"str_nil,omitempty"`
	// TimeNil holds the value of the "time_nil" field.
	TimeNil *time.Time `json:"time_nil,omitempty"`
	// contains filtered or unexported fields
}

NilExample is the model entity for the NilExample schema.

func (*NilExample) String added in v0.2.0

func (ne *NilExample) String() string

String implements the fmt.Stringer.

func (*NilExample) Unwrap added in v0.2.0

func (ne *NilExample) Unwrap() *NilExample

Unwrap unwraps the NilExample 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 (*NilExample) Update added in v0.2.0

func (ne *NilExample) Update() *NilExampleUpdateOne

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

type NilExampleClient added in v0.2.0

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

NilExampleClient is a client for the NilExample schema.

func NewNilExampleClient added in v0.2.0

func NewNilExampleClient(c config) *NilExampleClient

NewNilExampleClient returns a client for the NilExample from the given config.

func (*NilExampleClient) Create added in v0.2.0

func (c *NilExampleClient) Create() *NilExampleCreate

Create returns a builder for creating a NilExample entity.

func (*NilExampleClient) CreateBulk added in v0.2.0

func (c *NilExampleClient) CreateBulk(builders ...*NilExampleCreate) *NilExampleCreateBulk

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

func (*NilExampleClient) Delete added in v0.2.0

func (c *NilExampleClient) Delete() *NilExampleDelete

Delete returns a delete builder for NilExample.

func (*NilExampleClient) DeleteOne added in v0.2.0

func (c *NilExampleClient) DeleteOne(ne *NilExample) *NilExampleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NilExampleClient) DeleteOneID added in v0.2.0

func (c *NilExampleClient) DeleteOneID(id int) *NilExampleDeleteOne

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

func (*NilExampleClient) Get added in v0.2.0

func (c *NilExampleClient) Get(ctx context.Context, id int) (*NilExample, error)

Get returns a NilExample entity by its id.

func (*NilExampleClient) GetX added in v0.2.0

func (c *NilExampleClient) GetX(ctx context.Context, id int) *NilExample

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

func (*NilExampleClient) Hooks added in v0.2.0

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

Hooks returns the client hooks.

func (*NilExampleClient) Query added in v0.2.0

func (c *NilExampleClient) Query() *NilExampleQuery

Query returns a query builder for NilExample.

func (*NilExampleClient) Update added in v0.2.0

func (c *NilExampleClient) Update() *NilExampleUpdate

Update returns an update builder for NilExample.

func (*NilExampleClient) UpdateOne added in v0.2.0

func (c *NilExampleClient) UpdateOne(ne *NilExample) *NilExampleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NilExampleClient) UpdateOneID added in v0.2.0

func (c *NilExampleClient) UpdateOneID(id int) *NilExampleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NilExampleClient) Use added in v0.2.0

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

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

type NilExampleCreate added in v0.2.0

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

NilExampleCreate is the builder for creating a NilExample entity.

func (*NilExampleCreate) Exec added in v0.2.0

func (nec *NilExampleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NilExampleCreate) ExecX added in v0.2.0

func (nec *NilExampleCreate) ExecX(ctx context.Context)

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

func (*NilExampleCreate) Mutation added in v0.2.0

func (nec *NilExampleCreate) Mutation() *NilExampleMutation

Mutation returns the NilExampleMutation object of the builder.

func (*NilExampleCreate) Save added in v0.2.0

func (nec *NilExampleCreate) Save(ctx context.Context) (*NilExample, error)

Save creates the NilExample in the database.

func (*NilExampleCreate) SaveX added in v0.2.0

func (nec *NilExampleCreate) SaveX(ctx context.Context) *NilExample

SaveX calls Save and panics if Save returns an error.

func (*NilExampleCreate) SetNillableStrNil added in v0.2.0

func (nec *NilExampleCreate) SetNillableStrNil(s *string) *NilExampleCreate

SetNillableStrNil sets the "str_nil" field if the given value is not nil.

func (*NilExampleCreate) SetNillableTimeNil added in v0.2.0

func (nec *NilExampleCreate) SetNillableTimeNil(t *time.Time) *NilExampleCreate

SetNillableTimeNil sets the "time_nil" field if the given value is not nil.

func (*NilExampleCreate) SetStrNil added in v0.2.0

func (nec *NilExampleCreate) SetStrNil(s string) *NilExampleCreate

SetStrNil sets the "str_nil" field.

func (*NilExampleCreate) SetTimeNil added in v0.2.0

func (nec *NilExampleCreate) SetTimeNil(t time.Time) *NilExampleCreate

SetTimeNil sets the "time_nil" field.

type NilExampleCreateBulk added in v0.2.0

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

NilExampleCreateBulk is the builder for creating many NilExample entities in bulk.

func (*NilExampleCreateBulk) Exec added in v0.2.0

func (necb *NilExampleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NilExampleCreateBulk) ExecX added in v0.2.0

func (necb *NilExampleCreateBulk) ExecX(ctx context.Context)

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

func (*NilExampleCreateBulk) Save added in v0.2.0

func (necb *NilExampleCreateBulk) Save(ctx context.Context) ([]*NilExample, error)

Save creates the NilExample entities in the database.

func (*NilExampleCreateBulk) SaveX added in v0.2.0

func (necb *NilExampleCreateBulk) SaveX(ctx context.Context) []*NilExample

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

type NilExampleDelete added in v0.2.0

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

NilExampleDelete is the builder for deleting a NilExample entity.

func (*NilExampleDelete) Exec added in v0.2.0

func (ned *NilExampleDelete) Exec(ctx context.Context) (int, error)

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

func (*NilExampleDelete) ExecX added in v0.2.0

func (ned *NilExampleDelete) ExecX(ctx context.Context) int

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

func (*NilExampleDelete) Where added in v0.2.0

Where appends a list predicates to the NilExampleDelete builder.

type NilExampleDeleteOne added in v0.2.0

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

NilExampleDeleteOne is the builder for deleting a single NilExample entity.

func (*NilExampleDeleteOne) Exec added in v0.2.0

func (nedo *NilExampleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NilExampleDeleteOne) ExecX added in v0.2.0

func (nedo *NilExampleDeleteOne) ExecX(ctx context.Context)

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

type NilExampleGroupBy added in v0.2.0

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

NilExampleGroupBy is the group-by builder for NilExample entities.

func (*NilExampleGroupBy) Aggregate added in v0.2.0

func (negb *NilExampleGroupBy) Aggregate(fns ...AggregateFunc) *NilExampleGroupBy

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

func (*NilExampleGroupBy) Bool added in v0.2.0

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

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

func (*NilExampleGroupBy) BoolX added in v0.2.0

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

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

func (*NilExampleGroupBy) Bools added in v0.2.0

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

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

func (*NilExampleGroupBy) BoolsX added in v0.2.0

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

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

func (*NilExampleGroupBy) Float64 added in v0.2.0

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

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

func (*NilExampleGroupBy) Float64X added in v0.2.0

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

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

func (*NilExampleGroupBy) Float64s added in v0.2.0

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

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

func (*NilExampleGroupBy) Float64sX added in v0.2.0

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

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

func (*NilExampleGroupBy) Int added in v0.2.0

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

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

func (*NilExampleGroupBy) IntX added in v0.2.0

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

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

func (*NilExampleGroupBy) Ints added in v0.2.0

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

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

func (*NilExampleGroupBy) IntsX added in v0.2.0

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

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

func (*NilExampleGroupBy) Scan added in v0.2.0

func (negb *NilExampleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*NilExampleGroupBy) ScanX added in v0.2.0

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

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

func (*NilExampleGroupBy) String added in v0.2.0

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

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

func (*NilExampleGroupBy) StringX added in v0.2.0

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

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

func (*NilExampleGroupBy) Strings added in v0.2.0

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

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

func (*NilExampleGroupBy) StringsX added in v0.2.0

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

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

type NilExampleMutation added in v0.2.0

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

NilExampleMutation represents an operation that mutates the NilExample nodes in the graph.

func (*NilExampleMutation) AddField added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) AddedEdges added in v0.2.0

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

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

func (*NilExampleMutation) AddedField added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) AddedFields added in v0.2.0

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

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

func (*NilExampleMutation) AddedIDs added in v0.2.0

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

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

func (*NilExampleMutation) ClearEdge added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) ClearField added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) ClearStrNil added in v0.2.0

func (m *NilExampleMutation) ClearStrNil()

ClearStrNil clears the value of the "str_nil" field.

func (*NilExampleMutation) ClearTimeNil added in v0.2.0

func (m *NilExampleMutation) ClearTimeNil()

ClearTimeNil clears the value of the "time_nil" field.

func (*NilExampleMutation) ClearedEdges added in v0.2.0

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

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

func (*NilExampleMutation) ClearedFields added in v0.2.0

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

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

func (NilExampleMutation) Client added in v0.2.0

func (m NilExampleMutation) 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 (*NilExampleMutation) EdgeCleared added in v0.2.0

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

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

func (*NilExampleMutation) Field added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) FieldCleared added in v0.2.0

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

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

func (*NilExampleMutation) Fields added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) ID added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) IDs added in v0.3.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) OldField added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) OldStrNil added in v0.2.0

func (m *NilExampleMutation) OldStrNil(ctx context.Context) (v *string, err error)

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

func (*NilExampleMutation) OldTimeNil added in v0.2.0

func (m *NilExampleMutation) OldTimeNil(ctx context.Context) (v *time.Time, err error)

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

func (*NilExampleMutation) Op added in v0.2.0

func (m *NilExampleMutation) Op() Op

Op returns the operation name.

func (*NilExampleMutation) RemovedEdges added in v0.2.0

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

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

func (*NilExampleMutation) RemovedIDs added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) ResetEdge added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) ResetField added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) ResetStrNil added in v0.2.0

func (m *NilExampleMutation) ResetStrNil()

ResetStrNil resets all changes to the "str_nil" field.

func (*NilExampleMutation) ResetTimeNil added in v0.2.0

func (m *NilExampleMutation) ResetTimeNil()

ResetTimeNil resets all changes to the "time_nil" field.

func (*NilExampleMutation) SetField added in v0.2.0

func (m *NilExampleMutation) 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 (*NilExampleMutation) SetStrNil added in v0.2.0

func (m *NilExampleMutation) SetStrNil(s string)

SetStrNil sets the "str_nil" field.

func (*NilExampleMutation) SetTimeNil added in v0.2.0

func (m *NilExampleMutation) SetTimeNil(t time.Time)

SetTimeNil sets the "time_nil" field.

func (*NilExampleMutation) StrNil added in v0.2.0

func (m *NilExampleMutation) StrNil() (r string, exists bool)

StrNil returns the value of the "str_nil" field in the mutation.

func (*NilExampleMutation) StrNilCleared added in v0.2.0

func (m *NilExampleMutation) StrNilCleared() bool

StrNilCleared returns if the "str_nil" field was cleared in this mutation.

func (*NilExampleMutation) TimeNil added in v0.2.0

func (m *NilExampleMutation) TimeNil() (r time.Time, exists bool)

TimeNil returns the value of the "time_nil" field in the mutation.

func (*NilExampleMutation) TimeNilCleared added in v0.2.0

func (m *NilExampleMutation) TimeNilCleared() bool

TimeNilCleared returns if the "time_nil" field was cleared in this mutation.

func (NilExampleMutation) Tx added in v0.2.0

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

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

func (*NilExampleMutation) Type added in v0.2.0

func (m *NilExampleMutation) Type() string

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

func (*NilExampleMutation) Where added in v0.2.0

func (m *NilExampleMutation) Where(ps ...predicate.NilExample)

Where appends a list predicates to the NilExampleMutation builder.

type NilExampleQuery added in v0.2.0

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

NilExampleQuery is the builder for querying NilExample entities.

func (*NilExampleQuery) All added in v0.2.0

func (neq *NilExampleQuery) All(ctx context.Context) ([]*NilExample, error)

All executes the query and returns a list of NilExamples.

func (*NilExampleQuery) AllX added in v0.2.0

func (neq *NilExampleQuery) AllX(ctx context.Context) []*NilExample

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

func (*NilExampleQuery) Clone added in v0.2.0

func (neq *NilExampleQuery) Clone() *NilExampleQuery

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

func (*NilExampleQuery) Count added in v0.2.0

func (neq *NilExampleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NilExampleQuery) CountX added in v0.2.0

func (neq *NilExampleQuery) CountX(ctx context.Context) int

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

func (*NilExampleQuery) Exist added in v0.2.0

func (neq *NilExampleQuery) Exist(ctx context.Context) (bool, error)

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

func (*NilExampleQuery) ExistX added in v0.2.0

func (neq *NilExampleQuery) ExistX(ctx context.Context) bool

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

func (*NilExampleQuery) First added in v0.2.0

func (neq *NilExampleQuery) First(ctx context.Context) (*NilExample, error)

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

func (*NilExampleQuery) FirstID added in v0.2.0

func (neq *NilExampleQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NilExampleQuery) FirstIDX added in v0.2.0

func (neq *NilExampleQuery) FirstIDX(ctx context.Context) int

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

func (*NilExampleQuery) FirstX added in v0.2.0

func (neq *NilExampleQuery) FirstX(ctx context.Context) *NilExample

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

func (*NilExampleQuery) GroupBy added in v0.2.0

func (neq *NilExampleQuery) GroupBy(field string, fields ...string) *NilExampleGroupBy

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

client.NilExample.Query().
	GroupBy(nilexample.FieldStrNil).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NilExampleQuery) IDs added in v0.2.0

func (neq *NilExampleQuery) IDs(ctx context.Context) ([]int, error)

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

func (*NilExampleQuery) IDsX added in v0.2.0

func (neq *NilExampleQuery) IDsX(ctx context.Context) []int

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

func (*NilExampleQuery) Limit added in v0.2.0

func (neq *NilExampleQuery) Limit(limit int) *NilExampleQuery

Limit adds a limit step to the query.

func (*NilExampleQuery) Offset added in v0.2.0

func (neq *NilExampleQuery) Offset(offset int) *NilExampleQuery

Offset adds an offset step to the query.

func (*NilExampleQuery) Only added in v0.2.0

func (neq *NilExampleQuery) Only(ctx context.Context) (*NilExample, error)

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

func (*NilExampleQuery) OnlyID added in v0.2.0

func (neq *NilExampleQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NilExampleQuery) OnlyIDX added in v0.2.0

func (neq *NilExampleQuery) OnlyIDX(ctx context.Context) int

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

func (*NilExampleQuery) OnlyX added in v0.2.0

func (neq *NilExampleQuery) OnlyX(ctx context.Context) *NilExample

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

func (*NilExampleQuery) Order added in v0.2.0

func (neq *NilExampleQuery) Order(o ...OrderFunc) *NilExampleQuery

Order adds an order step to the query.

func (*NilExampleQuery) Select added in v0.2.0

func (neq *NilExampleQuery) Select(fields ...string) *NilExampleSelect

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

client.NilExample.Query().
	Select(nilexample.FieldStrNil).
	Scan(ctx, &v)

func (*NilExampleQuery) Unique added in v0.2.0

func (neq *NilExampleQuery) Unique(unique bool) *NilExampleQuery

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 (*NilExampleQuery) Where added in v0.2.0

Where adds a new predicate for the NilExampleQuery builder.

type NilExampleSelect added in v0.2.0

type NilExampleSelect struct {
	*NilExampleQuery
	// contains filtered or unexported fields
}

NilExampleSelect is the builder for selecting fields of NilExample entities.

func (*NilExampleSelect) Bool added in v0.2.0

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

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

func (*NilExampleSelect) BoolX added in v0.2.0

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

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

func (*NilExampleSelect) Bools added in v0.2.0

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

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

func (*NilExampleSelect) BoolsX added in v0.2.0

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

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

func (*NilExampleSelect) Float64 added in v0.2.0

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

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

func (*NilExampleSelect) Float64X added in v0.2.0

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

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

func (*NilExampleSelect) Float64s added in v0.2.0

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

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

func (*NilExampleSelect) Float64sX added in v0.2.0

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

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

func (*NilExampleSelect) Int added in v0.2.0

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

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

func (*NilExampleSelect) IntX added in v0.2.0

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

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

func (*NilExampleSelect) Ints added in v0.2.0

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

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

func (*NilExampleSelect) IntsX added in v0.2.0

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

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

func (*NilExampleSelect) Scan added in v0.2.0

func (nes *NilExampleSelect) Scan(ctx context.Context, v any) error

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

func (*NilExampleSelect) ScanX added in v0.2.0

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

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

func (*NilExampleSelect) String added in v0.2.0

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

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

func (*NilExampleSelect) StringX added in v0.2.0

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

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

func (*NilExampleSelect) Strings added in v0.2.0

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

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

func (*NilExampleSelect) StringsX added in v0.2.0

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

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

type NilExampleUpdate added in v0.2.0

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

NilExampleUpdate is the builder for updating NilExample entities.

func (*NilExampleUpdate) ClearStrNil added in v0.2.0

func (neu *NilExampleUpdate) ClearStrNil() *NilExampleUpdate

ClearStrNil clears the value of the "str_nil" field.

func (*NilExampleUpdate) ClearTimeNil added in v0.2.0

func (neu *NilExampleUpdate) ClearTimeNil() *NilExampleUpdate

ClearTimeNil clears the value of the "time_nil" field.

func (*NilExampleUpdate) Exec added in v0.2.0

func (neu *NilExampleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NilExampleUpdate) ExecX added in v0.2.0

func (neu *NilExampleUpdate) ExecX(ctx context.Context)

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

func (*NilExampleUpdate) Mutation added in v0.2.0

func (neu *NilExampleUpdate) Mutation() *NilExampleMutation

Mutation returns the NilExampleMutation object of the builder.

func (*NilExampleUpdate) Save added in v0.2.0

func (neu *NilExampleUpdate) Save(ctx context.Context) (int, error)

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

func (*NilExampleUpdate) SaveX added in v0.2.0

func (neu *NilExampleUpdate) SaveX(ctx context.Context) int

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

func (*NilExampleUpdate) SetNillableStrNil added in v0.2.0

func (neu *NilExampleUpdate) SetNillableStrNil(s *string) *NilExampleUpdate

SetNillableStrNil sets the "str_nil" field if the given value is not nil.

func (*NilExampleUpdate) SetNillableTimeNil added in v0.2.0

func (neu *NilExampleUpdate) SetNillableTimeNil(t *time.Time) *NilExampleUpdate

SetNillableTimeNil sets the "time_nil" field if the given value is not nil.

func (*NilExampleUpdate) SetStrNil added in v0.2.0

func (neu *NilExampleUpdate) SetStrNil(s string) *NilExampleUpdate

SetStrNil sets the "str_nil" field.

func (*NilExampleUpdate) SetTimeNil added in v0.2.0

func (neu *NilExampleUpdate) SetTimeNil(t time.Time) *NilExampleUpdate

SetTimeNil sets the "time_nil" field.

func (*NilExampleUpdate) Where added in v0.2.0

Where appends a list predicates to the NilExampleUpdate builder.

type NilExampleUpdateOne added in v0.2.0

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

NilExampleUpdateOne is the builder for updating a single NilExample entity.

func (*NilExampleUpdateOne) ClearStrNil added in v0.2.0

func (neuo *NilExampleUpdateOne) ClearStrNil() *NilExampleUpdateOne

ClearStrNil clears the value of the "str_nil" field.

func (*NilExampleUpdateOne) ClearTimeNil added in v0.2.0

func (neuo *NilExampleUpdateOne) ClearTimeNil() *NilExampleUpdateOne

ClearTimeNil clears the value of the "time_nil" field.

func (*NilExampleUpdateOne) Exec added in v0.2.0

func (neuo *NilExampleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NilExampleUpdateOne) ExecX added in v0.2.0

func (neuo *NilExampleUpdateOne) ExecX(ctx context.Context)

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

func (*NilExampleUpdateOne) Mutation added in v0.2.0

func (neuo *NilExampleUpdateOne) Mutation() *NilExampleMutation

Mutation returns the NilExampleMutation object of the builder.

func (*NilExampleUpdateOne) Save added in v0.2.0

func (neuo *NilExampleUpdateOne) Save(ctx context.Context) (*NilExample, error)

Save executes the query and returns the updated NilExample entity.

func (*NilExampleUpdateOne) SaveX added in v0.2.0

func (neuo *NilExampleUpdateOne) SaveX(ctx context.Context) *NilExample

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

func (*NilExampleUpdateOne) Select added in v0.2.0

func (neuo *NilExampleUpdateOne) Select(field string, fields ...string) *NilExampleUpdateOne

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

func (*NilExampleUpdateOne) SetNillableStrNil added in v0.2.0

func (neuo *NilExampleUpdateOne) SetNillableStrNil(s *string) *NilExampleUpdateOne

SetNillableStrNil sets the "str_nil" field if the given value is not nil.

func (*NilExampleUpdateOne) SetNillableTimeNil added in v0.2.0

func (neuo *NilExampleUpdateOne) SetNillableTimeNil(t *time.Time) *NilExampleUpdateOne

SetNillableTimeNil sets the "time_nil" field if the given value is not nil.

func (*NilExampleUpdateOne) SetStrNil added in v0.2.0

func (neuo *NilExampleUpdateOne) SetStrNil(s string) *NilExampleUpdateOne

SetStrNil sets the "str_nil" field.

func (*NilExampleUpdateOne) SetTimeNil added in v0.2.0

func (neuo *NilExampleUpdateOne) SetTimeNil(t time.Time) *NilExampleUpdateOne

SetTimeNil sets the "time_nil" field.

type NilExamples added in v0.2.0

type NilExamples []*NilExample

NilExamples is a parsable slice of NilExample.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Pet added in v0.3.0

type Pet struct {

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

Pet is the model entity for the Pet schema.

func (*Pet) QueryAttachment added in v0.3.0

func (pe *Pet) QueryAttachment() *AttachmentQuery

QueryAttachment queries the "attachment" edge of the Pet entity.

func (*Pet) QueryOwner added in v0.3.0

func (pe *Pet) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Pet entity.

func (*Pet) String added in v0.3.0

func (pe *Pet) String() string

String implements the fmt.Stringer.

func (*Pet) Unwrap added in v0.3.0

func (pe *Pet) Unwrap() *Pet

Unwrap unwraps the Pet 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 (*Pet) Update added in v0.3.0

func (pe *Pet) Update() *PetUpdateOne

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

type PetClient added in v0.3.0

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

PetClient is a client for the Pet schema.

func NewPetClient added in v0.3.0

func NewPetClient(c config) *PetClient

NewPetClient returns a client for the Pet from the given config.

func (*PetClient) Create added in v0.3.0

func (c *PetClient) Create() *PetCreate

Create returns a builder for creating a Pet entity.

func (*PetClient) CreateBulk added in v0.3.0

func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk

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

func (*PetClient) Delete added in v0.3.0

func (c *PetClient) Delete() *PetDelete

Delete returns a delete builder for Pet.

func (*PetClient) DeleteOne added in v0.3.0

func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PetClient) DeleteOneID added in v0.3.0

func (c *PetClient) DeleteOneID(id int) *PetDeleteOne

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

func (*PetClient) Get added in v0.3.0

func (c *PetClient) Get(ctx context.Context, id int) (*Pet, error)

Get returns a Pet entity by its id.

func (*PetClient) GetX added in v0.3.0

func (c *PetClient) GetX(ctx context.Context, id int) *Pet

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

func (*PetClient) Hooks added in v0.3.0

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

Hooks returns the client hooks.

func (*PetClient) Query added in v0.3.0

func (c *PetClient) Query() *PetQuery

Query returns a query builder for Pet.

func (*PetClient) QueryAttachment added in v0.3.0

func (c *PetClient) QueryAttachment(pe *Pet) *AttachmentQuery

QueryAttachment queries the attachment edge of a Pet.

func (*PetClient) QueryOwner added in v0.3.0

func (c *PetClient) QueryOwner(pe *Pet) *UserQuery

QueryOwner queries the owner edge of a Pet.

func (*PetClient) Update added in v0.3.0

func (c *PetClient) Update() *PetUpdate

Update returns an update builder for Pet.

func (*PetClient) UpdateOne added in v0.3.0

func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PetClient) UpdateOneID added in v0.3.0

func (c *PetClient) UpdateOneID(id int) *PetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PetClient) Use added in v0.3.0

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

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

type PetCreate added in v0.3.0

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

PetCreate is the builder for creating a Pet entity.

func (*PetCreate) AddAttachment added in v0.3.0

func (pc *PetCreate) AddAttachment(a ...*Attachment) *PetCreate

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*PetCreate) AddAttachmentIDs added in v0.3.0

func (pc *PetCreate) AddAttachmentIDs(ids ...uuid.UUID) *PetCreate

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*PetCreate) Exec added in v0.3.0

func (pc *PetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PetCreate) ExecX added in v0.3.0

func (pc *PetCreate) ExecX(ctx context.Context)

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

func (*PetCreate) Mutation added in v0.3.0

func (pc *PetCreate) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetCreate) Save added in v0.3.0

func (pc *PetCreate) Save(ctx context.Context) (*Pet, error)

Save creates the Pet in the database.

func (*PetCreate) SaveX added in v0.3.0

func (pc *PetCreate) SaveX(ctx context.Context) *Pet

SaveX calls Save and panics if Save returns an error.

func (*PetCreate) SetNillableOwnerID added in v0.3.0

func (pc *PetCreate) SetNillableOwnerID(id *int) *PetCreate

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

func (*PetCreate) SetOwner added in v0.3.0

func (pc *PetCreate) SetOwner(u *User) *PetCreate

SetOwner sets the "owner" edge to the User entity.

func (*PetCreate) SetOwnerID added in v0.3.0

func (pc *PetCreate) SetOwnerID(id int) *PetCreate

SetOwnerID sets the "owner" edge to the User entity by ID.

type PetCreateBulk added in v0.3.0

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

PetCreateBulk is the builder for creating many Pet entities in bulk.

func (*PetCreateBulk) Exec added in v0.3.0

func (pcb *PetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PetCreateBulk) ExecX added in v0.3.0

func (pcb *PetCreateBulk) ExecX(ctx context.Context)

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

func (*PetCreateBulk) Save added in v0.3.0

func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error)

Save creates the Pet entities in the database.

func (*PetCreateBulk) SaveX added in v0.3.0

func (pcb *PetCreateBulk) SaveX(ctx context.Context) []*Pet

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

type PetDelete added in v0.3.0

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

PetDelete is the builder for deleting a Pet entity.

func (*PetDelete) Exec added in v0.3.0

func (pd *PetDelete) Exec(ctx context.Context) (int, error)

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

func (*PetDelete) ExecX added in v0.3.0

func (pd *PetDelete) ExecX(ctx context.Context) int

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

func (*PetDelete) Where added in v0.3.0

func (pd *PetDelete) Where(ps ...predicate.Pet) *PetDelete

Where appends a list predicates to the PetDelete builder.

type PetDeleteOne added in v0.3.0

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

PetDeleteOne is the builder for deleting a single Pet entity.

func (*PetDeleteOne) Exec added in v0.3.0

func (pdo *PetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PetDeleteOne) ExecX added in v0.3.0

func (pdo *PetDeleteOne) ExecX(ctx context.Context)

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

type PetEdges added in v0.3.0

type PetEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// Attachment holds the value of the attachment edge.
	Attachment []*Attachment `json:"attachment,omitempty"`
	// contains filtered or unexported fields
}

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

func (PetEdges) AttachmentOrErr added in v0.3.0

func (e PetEdges) AttachmentOrErr() ([]*Attachment, error)

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

func (PetEdges) OwnerOrErr added in v0.3.0

func (e PetEdges) OwnerOrErr() (*User, error)

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

type PetGroupBy added in v0.3.0

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

PetGroupBy is the group-by builder for Pet entities.

func (*PetGroupBy) Aggregate added in v0.3.0

func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy

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

func (*PetGroupBy) Bool added in v0.3.0

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

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

func (*PetGroupBy) BoolX added in v0.3.0

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

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

func (*PetGroupBy) Bools added in v0.3.0

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

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

func (*PetGroupBy) BoolsX added in v0.3.0

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

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

func (*PetGroupBy) Float64 added in v0.3.0

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

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

func (*PetGroupBy) Float64X added in v0.3.0

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

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

func (*PetGroupBy) Float64s added in v0.3.0

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

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

func (*PetGroupBy) Float64sX added in v0.3.0

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

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

func (*PetGroupBy) Int added in v0.3.0

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

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

func (*PetGroupBy) IntX added in v0.3.0

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

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

func (*PetGroupBy) Ints added in v0.3.0

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

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

func (*PetGroupBy) IntsX added in v0.3.0

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

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

func (*PetGroupBy) Scan added in v0.3.0

func (pgb *PetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*PetGroupBy) ScanX added in v0.3.0

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

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

func (*PetGroupBy) String added in v0.3.0

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

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

func (*PetGroupBy) StringX added in v0.3.0

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

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

func (*PetGroupBy) Strings added in v0.3.0

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

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

func (*PetGroupBy) StringsX added in v0.3.0

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

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

type PetMutation added in v0.3.0

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

PetMutation represents an operation that mutates the Pet nodes in the graph.

func (*PetMutation) AddAttachmentIDs added in v0.3.0

func (m *PetMutation) AddAttachmentIDs(ids ...uuid.UUID)

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by ids.

func (*PetMutation) AddField added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) AddedEdges added in v0.3.0

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

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

func (*PetMutation) AddedField added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) AddedFields added in v0.3.0

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

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

func (*PetMutation) AddedIDs added in v0.3.0

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

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

func (*PetMutation) AttachmentCleared added in v0.3.0

func (m *PetMutation) AttachmentCleared() bool

AttachmentCleared reports if the "attachment" edge to the Attachment entity was cleared.

func (*PetMutation) AttachmentIDs added in v0.3.0

func (m *PetMutation) AttachmentIDs() (ids []uuid.UUID)

AttachmentIDs returns the "attachment" edge IDs in the mutation.

func (*PetMutation) ClearAttachment added in v0.3.0

func (m *PetMutation) ClearAttachment()

ClearAttachment clears the "attachment" edge to the Attachment entity.

func (*PetMutation) ClearEdge added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) ClearField added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) ClearOwner added in v0.3.0

func (m *PetMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*PetMutation) ClearedEdges added in v0.3.0

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

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

func (*PetMutation) ClearedFields added in v0.3.0

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

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

func (PetMutation) Client added in v0.3.0

func (m PetMutation) 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 (*PetMutation) EdgeCleared added in v0.3.0

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

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

func (*PetMutation) Field added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) FieldCleared added in v0.3.0

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

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

func (*PetMutation) Fields added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) ID added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) IDs added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) OldField added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) Op added in v0.3.0

func (m *PetMutation) Op() Op

Op returns the operation name.

func (*PetMutation) OwnerCleared added in v0.3.0

func (m *PetMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*PetMutation) OwnerID added in v0.3.0

func (m *PetMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*PetMutation) OwnerIDs added in v0.3.0

func (m *PetMutation) OwnerIDs() (ids []int)

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

func (*PetMutation) RemoveAttachmentIDs added in v0.3.0

func (m *PetMutation) RemoveAttachmentIDs(ids ...uuid.UUID)

RemoveAttachmentIDs removes the "attachment" edge to the Attachment entity by IDs.

func (*PetMutation) RemovedAttachmentIDs added in v0.3.0

func (m *PetMutation) RemovedAttachmentIDs() (ids []uuid.UUID)

RemovedAttachment returns the removed IDs of the "attachment" edge to the Attachment entity.

func (*PetMutation) RemovedEdges added in v0.3.0

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

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

func (*PetMutation) RemovedIDs added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) ResetAttachment added in v0.3.0

func (m *PetMutation) ResetAttachment()

ResetAttachment resets all changes to the "attachment" edge.

func (*PetMutation) ResetEdge added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) ResetField added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) ResetOwner added in v0.3.0

func (m *PetMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*PetMutation) SetField added in v0.3.0

func (m *PetMutation) 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 (*PetMutation) SetOwnerID added in v0.3.0

func (m *PetMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the User entity by id.

func (PetMutation) Tx added in v0.3.0

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

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

func (*PetMutation) Type added in v0.3.0

func (m *PetMutation) Type() string

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

func (*PetMutation) Where added in v0.3.0

func (m *PetMutation) Where(ps ...predicate.Pet)

Where appends a list predicates to the PetMutation builder.

type PetQuery added in v0.3.0

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

PetQuery is the builder for querying Pet entities.

func (*PetQuery) All added in v0.3.0

func (pq *PetQuery) All(ctx context.Context) ([]*Pet, error)

All executes the query and returns a list of Pets.

func (*PetQuery) AllX added in v0.3.0

func (pq *PetQuery) AllX(ctx context.Context) []*Pet

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

func (*PetQuery) Clone added in v0.3.0

func (pq *PetQuery) Clone() *PetQuery

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

func (*PetQuery) Count added in v0.3.0

func (pq *PetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PetQuery) CountX added in v0.3.0

func (pq *PetQuery) CountX(ctx context.Context) int

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

func (*PetQuery) Exist added in v0.3.0

func (pq *PetQuery) Exist(ctx context.Context) (bool, error)

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

func (*PetQuery) ExistX added in v0.3.0

func (pq *PetQuery) ExistX(ctx context.Context) bool

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

func (*PetQuery) First added in v0.3.0

func (pq *PetQuery) First(ctx context.Context) (*Pet, error)

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

func (*PetQuery) FirstID added in v0.3.0

func (pq *PetQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PetQuery) FirstIDX added in v0.3.0

func (pq *PetQuery) FirstIDX(ctx context.Context) int

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

func (*PetQuery) FirstX added in v0.3.0

func (pq *PetQuery) FirstX(ctx context.Context) *Pet

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

func (*PetQuery) GroupBy added in v0.3.0

func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy

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

func (*PetQuery) IDs added in v0.3.0

func (pq *PetQuery) IDs(ctx context.Context) ([]int, error)

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

func (*PetQuery) IDsX added in v0.3.0

func (pq *PetQuery) IDsX(ctx context.Context) []int

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

func (*PetQuery) Limit added in v0.3.0

func (pq *PetQuery) Limit(limit int) *PetQuery

Limit adds a limit step to the query.

func (*PetQuery) Offset added in v0.3.0

func (pq *PetQuery) Offset(offset int) *PetQuery

Offset adds an offset step to the query.

func (*PetQuery) Only added in v0.3.0

func (pq *PetQuery) Only(ctx context.Context) (*Pet, error)

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

func (*PetQuery) OnlyID added in v0.3.0

func (pq *PetQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PetQuery) OnlyIDX added in v0.3.0

func (pq *PetQuery) OnlyIDX(ctx context.Context) int

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

func (*PetQuery) OnlyX added in v0.3.0

func (pq *PetQuery) OnlyX(ctx context.Context) *Pet

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

func (*PetQuery) Order added in v0.3.0

func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery

Order adds an order step to the query.

func (*PetQuery) QueryAttachment added in v0.3.0

func (pq *PetQuery) QueryAttachment() *AttachmentQuery

QueryAttachment chains the current query on the "attachment" edge.

func (*PetQuery) QueryOwner added in v0.3.0

func (pq *PetQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*PetQuery) Select added in v0.3.0

func (pq *PetQuery) Select(fields ...string) *PetSelect

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

func (*PetQuery) Unique added in v0.3.0

func (pq *PetQuery) Unique(unique bool) *PetQuery

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 (*PetQuery) Where added in v0.3.0

func (pq *PetQuery) Where(ps ...predicate.Pet) *PetQuery

Where adds a new predicate for the PetQuery builder.

func (*PetQuery) WithAttachment added in v0.3.0

func (pq *PetQuery) WithAttachment(opts ...func(*AttachmentQuery)) *PetQuery

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

func (*PetQuery) WithOwner added in v0.3.0

func (pq *PetQuery) WithOwner(opts ...func(*UserQuery)) *PetQuery

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

type PetSelect added in v0.3.0

type PetSelect struct {
	*PetQuery
	// contains filtered or unexported fields
}

PetSelect is the builder for selecting fields of Pet entities.

func (*PetSelect) Bool added in v0.3.0

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

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

func (*PetSelect) BoolX added in v0.3.0

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

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

func (*PetSelect) Bools added in v0.3.0

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

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

func (*PetSelect) BoolsX added in v0.3.0

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

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

func (*PetSelect) Float64 added in v0.3.0

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

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

func (*PetSelect) Float64X added in v0.3.0

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

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

func (*PetSelect) Float64s added in v0.3.0

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

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

func (*PetSelect) Float64sX added in v0.3.0

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

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

func (*PetSelect) Int added in v0.3.0

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

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

func (*PetSelect) IntX added in v0.3.0

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

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

func (*PetSelect) Ints added in v0.3.0

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

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

func (*PetSelect) IntsX added in v0.3.0

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

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

func (*PetSelect) Scan added in v0.3.0

func (ps *PetSelect) Scan(ctx context.Context, v any) error

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

func (*PetSelect) ScanX added in v0.3.0

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

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

func (*PetSelect) String added in v0.3.0

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

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

func (*PetSelect) StringX added in v0.3.0

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

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

func (*PetSelect) Strings added in v0.3.0

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

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

func (*PetSelect) StringsX added in v0.3.0

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

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

type PetUpdate added in v0.3.0

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

PetUpdate is the builder for updating Pet entities.

func (*PetUpdate) AddAttachment added in v0.3.0

func (pu *PetUpdate) AddAttachment(a ...*Attachment) *PetUpdate

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*PetUpdate) AddAttachmentIDs added in v0.3.0

func (pu *PetUpdate) AddAttachmentIDs(ids ...uuid.UUID) *PetUpdate

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*PetUpdate) ClearAttachment added in v0.3.0

func (pu *PetUpdate) ClearAttachment() *PetUpdate

ClearAttachment clears all "attachment" edges to the Attachment entity.

func (*PetUpdate) ClearOwner added in v0.3.0

func (pu *PetUpdate) ClearOwner() *PetUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*PetUpdate) Exec added in v0.3.0

func (pu *PetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PetUpdate) ExecX added in v0.3.0

func (pu *PetUpdate) ExecX(ctx context.Context)

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

func (*PetUpdate) Mutation added in v0.3.0

func (pu *PetUpdate) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetUpdate) RemoveAttachment added in v0.3.0

func (pu *PetUpdate) RemoveAttachment(a ...*Attachment) *PetUpdate

RemoveAttachment removes "attachment" edges to Attachment entities.

func (*PetUpdate) RemoveAttachmentIDs added in v0.3.0

func (pu *PetUpdate) RemoveAttachmentIDs(ids ...uuid.UUID) *PetUpdate

RemoveAttachmentIDs removes the "attachment" edge to Attachment entities by IDs.

func (*PetUpdate) Save added in v0.3.0

func (pu *PetUpdate) Save(ctx context.Context) (int, error)

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

func (*PetUpdate) SaveX added in v0.3.0

func (pu *PetUpdate) SaveX(ctx context.Context) int

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

func (*PetUpdate) SetNillableOwnerID added in v0.3.0

func (pu *PetUpdate) SetNillableOwnerID(id *int) *PetUpdate

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

func (*PetUpdate) SetOwner added in v0.3.0

func (pu *PetUpdate) SetOwner(u *User) *PetUpdate

SetOwner sets the "owner" edge to the User entity.

func (*PetUpdate) SetOwnerID added in v0.3.0

func (pu *PetUpdate) SetOwnerID(id int) *PetUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*PetUpdate) Where added in v0.3.0

func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate

Where appends a list predicates to the PetUpdate builder.

type PetUpdateOne added in v0.3.0

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

PetUpdateOne is the builder for updating a single Pet entity.

func (*PetUpdateOne) AddAttachment added in v0.3.0

func (puo *PetUpdateOne) AddAttachment(a ...*Attachment) *PetUpdateOne

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*PetUpdateOne) AddAttachmentIDs added in v0.3.0

func (puo *PetUpdateOne) AddAttachmentIDs(ids ...uuid.UUID) *PetUpdateOne

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*PetUpdateOne) ClearAttachment added in v0.3.0

func (puo *PetUpdateOne) ClearAttachment() *PetUpdateOne

ClearAttachment clears all "attachment" edges to the Attachment entity.

func (*PetUpdateOne) ClearOwner added in v0.3.0

func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*PetUpdateOne) Exec added in v0.3.0

func (puo *PetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PetUpdateOne) ExecX added in v0.3.0

func (puo *PetUpdateOne) ExecX(ctx context.Context)

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

func (*PetUpdateOne) Mutation added in v0.3.0

func (puo *PetUpdateOne) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetUpdateOne) RemoveAttachment added in v0.3.0

func (puo *PetUpdateOne) RemoveAttachment(a ...*Attachment) *PetUpdateOne

RemoveAttachment removes "attachment" edges to Attachment entities.

func (*PetUpdateOne) RemoveAttachmentIDs added in v0.3.0

func (puo *PetUpdateOne) RemoveAttachmentIDs(ids ...uuid.UUID) *PetUpdateOne

RemoveAttachmentIDs removes the "attachment" edge to Attachment entities by IDs.

func (*PetUpdateOne) Save added in v0.3.0

func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)

Save executes the query and returns the updated Pet entity.

func (*PetUpdateOne) SaveX added in v0.3.0

func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet

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

func (*PetUpdateOne) Select added in v0.3.0

func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne

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

func (*PetUpdateOne) SetNillableOwnerID added in v0.3.0

func (puo *PetUpdateOne) SetNillableOwnerID(id *int) *PetUpdateOne

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

func (*PetUpdateOne) SetOwner added in v0.3.0

func (puo *PetUpdateOne) SetOwner(u *User) *PetUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*PetUpdateOne) SetOwnerID added in v0.3.0

func (puo *PetUpdateOne) SetOwnerID(id int) *PetUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

type Pets added in v0.3.0

type Pets []*Pet

Pets is a parsable slice of Pet.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Ponies added in v0.3.0

type Ponies []*Pony

Ponies is a parsable slice of Pony.

type Pony added in v0.3.0

type Pony struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

Pony is the model entity for the Pony schema.

func (*Pony) String added in v0.3.0

func (po *Pony) String() string

String implements the fmt.Stringer.

func (*Pony) Unwrap added in v0.3.0

func (po *Pony) Unwrap() *Pony

Unwrap unwraps the Pony 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 (*Pony) Update added in v0.3.0

func (po *Pony) Update() *PonyUpdateOne

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

type PonyClient added in v0.3.0

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

PonyClient is a client for the Pony schema.

func NewPonyClient added in v0.3.0

func NewPonyClient(c config) *PonyClient

NewPonyClient returns a client for the Pony from the given config.

func (*PonyClient) Create added in v0.3.0

func (c *PonyClient) Create() *PonyCreate

Create returns a builder for creating a Pony entity.

func (*PonyClient) CreateBulk added in v0.3.0

func (c *PonyClient) CreateBulk(builders ...*PonyCreate) *PonyCreateBulk

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

func (*PonyClient) Delete added in v0.3.0

func (c *PonyClient) Delete() *PonyDelete

Delete returns a delete builder for Pony.

func (*PonyClient) DeleteOne added in v0.3.0

func (c *PonyClient) DeleteOne(po *Pony) *PonyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PonyClient) DeleteOneID added in v0.3.0

func (c *PonyClient) DeleteOneID(id int) *PonyDeleteOne

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

func (*PonyClient) Get added in v0.3.0

func (c *PonyClient) Get(ctx context.Context, id int) (*Pony, error)

Get returns a Pony entity by its id.

func (*PonyClient) GetX added in v0.3.0

func (c *PonyClient) GetX(ctx context.Context, id int) *Pony

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

func (*PonyClient) Hooks added in v0.3.0

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

Hooks returns the client hooks.

func (*PonyClient) Query added in v0.3.0

func (c *PonyClient) Query() *PonyQuery

Query returns a query builder for Pony.

func (*PonyClient) Update added in v0.3.0

func (c *PonyClient) Update() *PonyUpdate

Update returns an update builder for Pony.

func (*PonyClient) UpdateOne added in v0.3.0

func (c *PonyClient) UpdateOne(po *Pony) *PonyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PonyClient) UpdateOneID added in v0.3.0

func (c *PonyClient) UpdateOneID(id int) *PonyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PonyClient) Use added in v0.3.0

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

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

type PonyCreate added in v0.3.0

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

PonyCreate is the builder for creating a Pony entity.

func (*PonyCreate) Exec added in v0.3.0

func (pc *PonyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PonyCreate) ExecX added in v0.3.0

func (pc *PonyCreate) ExecX(ctx context.Context)

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

func (*PonyCreate) Mutation added in v0.3.0

func (pc *PonyCreate) Mutation() *PonyMutation

Mutation returns the PonyMutation object of the builder.

func (*PonyCreate) Save added in v0.3.0

func (pc *PonyCreate) Save(ctx context.Context) (*Pony, error)

Save creates the Pony in the database.

func (*PonyCreate) SaveX added in v0.3.0

func (pc *PonyCreate) SaveX(ctx context.Context) *Pony

SaveX calls Save and panics if Save returns an error.

func (*PonyCreate) SetName added in v0.3.0

func (pc *PonyCreate) SetName(s string) *PonyCreate

SetName sets the "name" field.

type PonyCreateBulk added in v0.3.0

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

PonyCreateBulk is the builder for creating many Pony entities in bulk.

func (*PonyCreateBulk) Exec added in v0.3.0

func (pcb *PonyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PonyCreateBulk) ExecX added in v0.3.0

func (pcb *PonyCreateBulk) ExecX(ctx context.Context)

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

func (*PonyCreateBulk) Save added in v0.3.0

func (pcb *PonyCreateBulk) Save(ctx context.Context) ([]*Pony, error)

Save creates the Pony entities in the database.

func (*PonyCreateBulk) SaveX added in v0.3.0

func (pcb *PonyCreateBulk) SaveX(ctx context.Context) []*Pony

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

type PonyDelete added in v0.3.0

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

PonyDelete is the builder for deleting a Pony entity.

func (*PonyDelete) Exec added in v0.3.0

func (pd *PonyDelete) Exec(ctx context.Context) (int, error)

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

func (*PonyDelete) ExecX added in v0.3.0

func (pd *PonyDelete) ExecX(ctx context.Context) int

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

func (*PonyDelete) Where added in v0.3.0

func (pd *PonyDelete) Where(ps ...predicate.Pony) *PonyDelete

Where appends a list predicates to the PonyDelete builder.

type PonyDeleteOne added in v0.3.0

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

PonyDeleteOne is the builder for deleting a single Pony entity.

func (*PonyDeleteOne) Exec added in v0.3.0

func (pdo *PonyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PonyDeleteOne) ExecX added in v0.3.0

func (pdo *PonyDeleteOne) ExecX(ctx context.Context)

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

type PonyGroupBy added in v0.3.0

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

PonyGroupBy is the group-by builder for Pony entities.

func (*PonyGroupBy) Aggregate added in v0.3.0

func (pgb *PonyGroupBy) Aggregate(fns ...AggregateFunc) *PonyGroupBy

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

func (*PonyGroupBy) Bool added in v0.3.0

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

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

func (*PonyGroupBy) BoolX added in v0.3.0

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

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

func (*PonyGroupBy) Bools added in v0.3.0

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

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

func (*PonyGroupBy) BoolsX added in v0.3.0

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

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

func (*PonyGroupBy) Float64 added in v0.3.0

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

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

func (*PonyGroupBy) Float64X added in v0.3.0

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

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

func (*PonyGroupBy) Float64s added in v0.3.0

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

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

func (*PonyGroupBy) Float64sX added in v0.3.0

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

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

func (*PonyGroupBy) Int added in v0.3.0

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

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

func (*PonyGroupBy) IntX added in v0.3.0

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

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

func (*PonyGroupBy) Ints added in v0.3.0

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

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

func (*PonyGroupBy) IntsX added in v0.3.0

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

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

func (*PonyGroupBy) Scan added in v0.3.0

func (pgb *PonyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*PonyGroupBy) ScanX added in v0.3.0

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

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

func (*PonyGroupBy) String added in v0.3.0

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

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

func (*PonyGroupBy) StringX added in v0.3.0

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

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

func (*PonyGroupBy) Strings added in v0.3.0

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

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

func (*PonyGroupBy) StringsX added in v0.3.0

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

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

type PonyMutation added in v0.3.0

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

PonyMutation represents an operation that mutates the Pony nodes in the graph.

func (*PonyMutation) AddField added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) AddedEdges added in v0.3.0

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

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

func (*PonyMutation) AddedField added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) AddedFields added in v0.3.0

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

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

func (*PonyMutation) AddedIDs added in v0.3.0

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

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

func (*PonyMutation) ClearEdge added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) ClearField added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) ClearedEdges added in v0.3.0

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

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

func (*PonyMutation) ClearedFields added in v0.3.0

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

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

func (PonyMutation) Client added in v0.3.0

func (m PonyMutation) 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 (*PonyMutation) EdgeCleared added in v0.3.0

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

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

func (*PonyMutation) Field added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) FieldCleared added in v0.3.0

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

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

func (*PonyMutation) Fields added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) ID added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) IDs added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) Name added in v0.3.0

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

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

func (*PonyMutation) OldField added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) OldName added in v0.3.0

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

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

func (*PonyMutation) Op added in v0.3.0

func (m *PonyMutation) Op() Op

Op returns the operation name.

func (*PonyMutation) RemovedEdges added in v0.3.0

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

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

func (*PonyMutation) RemovedIDs added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) ResetEdge added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) ResetField added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) ResetName added in v0.3.0

func (m *PonyMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PonyMutation) SetField added in v0.3.0

func (m *PonyMutation) 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 (*PonyMutation) SetName added in v0.3.0

func (m *PonyMutation) SetName(s string)

SetName sets the "name" field.

func (PonyMutation) Tx added in v0.3.0

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

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

func (*PonyMutation) Type added in v0.3.0

func (m *PonyMutation) Type() string

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

func (*PonyMutation) Where added in v0.3.0

func (m *PonyMutation) Where(ps ...predicate.Pony)

Where appends a list predicates to the PonyMutation builder.

type PonyQuery added in v0.3.0

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

PonyQuery is the builder for querying Pony entities.

func (*PonyQuery) All added in v0.3.0

func (pq *PonyQuery) All(ctx context.Context) ([]*Pony, error)

All executes the query and returns a list of Ponies.

func (*PonyQuery) AllX added in v0.3.0

func (pq *PonyQuery) AllX(ctx context.Context) []*Pony

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

func (*PonyQuery) Clone added in v0.3.0

func (pq *PonyQuery) Clone() *PonyQuery

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

func (*PonyQuery) Count added in v0.3.0

func (pq *PonyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PonyQuery) CountX added in v0.3.0

func (pq *PonyQuery) CountX(ctx context.Context) int

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

func (*PonyQuery) Exist added in v0.3.0

func (pq *PonyQuery) Exist(ctx context.Context) (bool, error)

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

func (*PonyQuery) ExistX added in v0.3.0

func (pq *PonyQuery) ExistX(ctx context.Context) bool

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

func (*PonyQuery) First added in v0.3.0

func (pq *PonyQuery) First(ctx context.Context) (*Pony, error)

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

func (*PonyQuery) FirstID added in v0.3.0

func (pq *PonyQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PonyQuery) FirstIDX added in v0.3.0

func (pq *PonyQuery) FirstIDX(ctx context.Context) int

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

func (*PonyQuery) FirstX added in v0.3.0

func (pq *PonyQuery) FirstX(ctx context.Context) *Pony

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

func (*PonyQuery) GroupBy added in v0.3.0

func (pq *PonyQuery) GroupBy(field string, fields ...string) *PonyGroupBy

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

Example:

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

client.Pony.Query().
	GroupBy(pony.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PonyQuery) IDs added in v0.3.0

func (pq *PonyQuery) IDs(ctx context.Context) ([]int, error)

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

func (*PonyQuery) IDsX added in v0.3.0

func (pq *PonyQuery) IDsX(ctx context.Context) []int

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

func (*PonyQuery) Limit added in v0.3.0

func (pq *PonyQuery) Limit(limit int) *PonyQuery

Limit adds a limit step to the query.

func (*PonyQuery) Offset added in v0.3.0

func (pq *PonyQuery) Offset(offset int) *PonyQuery

Offset adds an offset step to the query.

func (*PonyQuery) Only added in v0.3.0

func (pq *PonyQuery) Only(ctx context.Context) (*Pony, error)

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

func (*PonyQuery) OnlyID added in v0.3.0

func (pq *PonyQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PonyQuery) OnlyIDX added in v0.3.0

func (pq *PonyQuery) OnlyIDX(ctx context.Context) int

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

func (*PonyQuery) OnlyX added in v0.3.0

func (pq *PonyQuery) OnlyX(ctx context.Context) *Pony

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

func (*PonyQuery) Order added in v0.3.0

func (pq *PonyQuery) Order(o ...OrderFunc) *PonyQuery

Order adds an order step to the query.

func (*PonyQuery) Select added in v0.3.0

func (pq *PonyQuery) Select(fields ...string) *PonySelect

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

Example:

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

client.Pony.Query().
	Select(pony.FieldName).
	Scan(ctx, &v)

func (*PonyQuery) Unique added in v0.3.0

func (pq *PonyQuery) Unique(unique bool) *PonyQuery

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 (*PonyQuery) Where added in v0.3.0

func (pq *PonyQuery) Where(ps ...predicate.Pony) *PonyQuery

Where adds a new predicate for the PonyQuery builder.

type PonySelect added in v0.3.0

type PonySelect struct {
	*PonyQuery
	// contains filtered or unexported fields
}

PonySelect is the builder for selecting fields of Pony entities.

func (*PonySelect) Bool added in v0.3.0

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

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

func (*PonySelect) BoolX added in v0.3.0

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

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

func (*PonySelect) Bools added in v0.3.0

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

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

func (*PonySelect) BoolsX added in v0.3.0

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

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

func (*PonySelect) Float64 added in v0.3.0

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

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

func (*PonySelect) Float64X added in v0.3.0

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

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

func (*PonySelect) Float64s added in v0.3.0

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

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

func (*PonySelect) Float64sX added in v0.3.0

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

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

func (*PonySelect) Int added in v0.3.0

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

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

func (*PonySelect) IntX added in v0.3.0

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

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

func (*PonySelect) Ints added in v0.3.0

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

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

func (*PonySelect) IntsX added in v0.3.0

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

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

func (*PonySelect) Scan added in v0.3.0

func (ps *PonySelect) Scan(ctx context.Context, v any) error

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

func (*PonySelect) ScanX added in v0.3.0

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

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

func (*PonySelect) String added in v0.3.0

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

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

func (*PonySelect) StringX added in v0.3.0

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

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

func (*PonySelect) Strings added in v0.3.0

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

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

func (*PonySelect) StringsX added in v0.3.0

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

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

type PonyUpdate added in v0.3.0

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

PonyUpdate is the builder for updating Pony entities.

func (*PonyUpdate) Exec added in v0.3.0

func (pu *PonyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PonyUpdate) ExecX added in v0.3.0

func (pu *PonyUpdate) ExecX(ctx context.Context)

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

func (*PonyUpdate) Mutation added in v0.3.0

func (pu *PonyUpdate) Mutation() *PonyMutation

Mutation returns the PonyMutation object of the builder.

func (*PonyUpdate) Save added in v0.3.0

func (pu *PonyUpdate) Save(ctx context.Context) (int, error)

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

func (*PonyUpdate) SaveX added in v0.3.0

func (pu *PonyUpdate) SaveX(ctx context.Context) int

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

func (*PonyUpdate) SetName added in v0.3.0

func (pu *PonyUpdate) SetName(s string) *PonyUpdate

SetName sets the "name" field.

func (*PonyUpdate) Where added in v0.3.0

func (pu *PonyUpdate) Where(ps ...predicate.Pony) *PonyUpdate

Where appends a list predicates to the PonyUpdate builder.

type PonyUpdateOne added in v0.3.0

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

PonyUpdateOne is the builder for updating a single Pony entity.

func (*PonyUpdateOne) Exec added in v0.3.0

func (puo *PonyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PonyUpdateOne) ExecX added in v0.3.0

func (puo *PonyUpdateOne) ExecX(ctx context.Context)

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

func (*PonyUpdateOne) Mutation added in v0.3.0

func (puo *PonyUpdateOne) Mutation() *PonyMutation

Mutation returns the PonyMutation object of the builder.

func (*PonyUpdateOne) Save added in v0.3.0

func (puo *PonyUpdateOne) Save(ctx context.Context) (*Pony, error)

Save executes the query and returns the updated Pony entity.

func (*PonyUpdateOne) SaveX added in v0.3.0

func (puo *PonyUpdateOne) SaveX(ctx context.Context) *Pony

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

func (*PonyUpdateOne) Select added in v0.3.0

func (puo *PonyUpdateOne) Select(field string, fields ...string) *PonyUpdateOne

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

func (*PonyUpdateOne) SetName added in v0.3.0

func (puo *PonyUpdateOne) SetName(s string) *PonyUpdateOne

SetName sets the "name" field.

type Query

type Query = ent.Query

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 SkipEdgeExample added in v0.3.0

type SkipEdgeExample struct {

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

SkipEdgeExample is the model entity for the SkipEdgeExample schema.

func (*SkipEdgeExample) QueryUser added in v0.3.0

func (see *SkipEdgeExample) QueryUser() *UserQuery

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

func (*SkipEdgeExample) String added in v0.3.0

func (see *SkipEdgeExample) String() string

String implements the fmt.Stringer.

func (*SkipEdgeExample) Unwrap added in v0.3.0

func (see *SkipEdgeExample) Unwrap() *SkipEdgeExample

Unwrap unwraps the SkipEdgeExample 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 (*SkipEdgeExample) Update added in v0.3.0

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

type SkipEdgeExampleClient added in v0.3.0

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

SkipEdgeExampleClient is a client for the SkipEdgeExample schema.

func NewSkipEdgeExampleClient added in v0.3.0

func NewSkipEdgeExampleClient(c config) *SkipEdgeExampleClient

NewSkipEdgeExampleClient returns a client for the SkipEdgeExample from the given config.

func (*SkipEdgeExampleClient) Create added in v0.3.0

Create returns a builder for creating a SkipEdgeExample entity.

func (*SkipEdgeExampleClient) CreateBulk added in v0.3.0

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

func (*SkipEdgeExampleClient) Delete added in v0.3.0

Delete returns a delete builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) DeleteOne added in v0.3.0

DeleteOne returns a builder for deleting the given entity.

func (*SkipEdgeExampleClient) DeleteOneID added in v0.3.0

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

func (*SkipEdgeExampleClient) Get added in v0.3.0

Get returns a SkipEdgeExample entity by its id.

func (*SkipEdgeExampleClient) GetX added in v0.3.0

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

func (*SkipEdgeExampleClient) Hooks added in v0.3.0

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

Hooks returns the client hooks.

func (*SkipEdgeExampleClient) Query added in v0.3.0

Query returns a query builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) QueryUser added in v0.3.0

func (c *SkipEdgeExampleClient) QueryUser(see *SkipEdgeExample) *UserQuery

QueryUser queries the user edge of a SkipEdgeExample.

func (*SkipEdgeExampleClient) Update added in v0.3.0

Update returns an update builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) UpdateOne added in v0.3.0

UpdateOne returns an update builder for the given entity.

func (*SkipEdgeExampleClient) UpdateOneID added in v0.3.0

UpdateOneID returns an update builder for the given id.

func (*SkipEdgeExampleClient) Use added in v0.3.0

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

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

type SkipEdgeExampleCreate added in v0.3.0

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

SkipEdgeExampleCreate is the builder for creating a SkipEdgeExample entity.

func (*SkipEdgeExampleCreate) Exec added in v0.3.0

func (seec *SkipEdgeExampleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SkipEdgeExampleCreate) ExecX added in v0.3.0

func (seec *SkipEdgeExampleCreate) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleCreate) Mutation added in v0.3.0

Mutation returns the SkipEdgeExampleMutation object of the builder.

func (*SkipEdgeExampleCreate) Save added in v0.3.0

Save creates the SkipEdgeExample in the database.

func (*SkipEdgeExampleCreate) SaveX added in v0.3.0

SaveX calls Save and panics if Save returns an error.

func (*SkipEdgeExampleCreate) SetNillableUserID added in v0.3.0

func (seec *SkipEdgeExampleCreate) SetNillableUserID(id *int) *SkipEdgeExampleCreate

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

func (*SkipEdgeExampleCreate) SetUser added in v0.3.0

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

func (*SkipEdgeExampleCreate) SetUserID added in v0.3.0

func (seec *SkipEdgeExampleCreate) SetUserID(id int) *SkipEdgeExampleCreate

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

type SkipEdgeExampleCreateBulk added in v0.3.0

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

SkipEdgeExampleCreateBulk is the builder for creating many SkipEdgeExample entities in bulk.

func (*SkipEdgeExampleCreateBulk) Exec added in v0.3.0

Exec executes the query.

func (*SkipEdgeExampleCreateBulk) ExecX added in v0.3.0

func (seecb *SkipEdgeExampleCreateBulk) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleCreateBulk) Save added in v0.3.0

Save creates the SkipEdgeExample entities in the database.

func (*SkipEdgeExampleCreateBulk) SaveX added in v0.3.0

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

type SkipEdgeExampleDelete added in v0.3.0

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

SkipEdgeExampleDelete is the builder for deleting a SkipEdgeExample entity.

func (*SkipEdgeExampleDelete) Exec added in v0.3.0

func (seed *SkipEdgeExampleDelete) Exec(ctx context.Context) (int, error)

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

func (*SkipEdgeExampleDelete) ExecX added in v0.3.0

func (seed *SkipEdgeExampleDelete) ExecX(ctx context.Context) int

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

func (*SkipEdgeExampleDelete) Where added in v0.3.0

Where appends a list predicates to the SkipEdgeExampleDelete builder.

type SkipEdgeExampleDeleteOne added in v0.3.0

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

SkipEdgeExampleDeleteOne is the builder for deleting a single SkipEdgeExample entity.

func (*SkipEdgeExampleDeleteOne) Exec added in v0.3.0

func (seedo *SkipEdgeExampleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SkipEdgeExampleDeleteOne) ExecX added in v0.3.0

func (seedo *SkipEdgeExampleDeleteOne) ExecX(ctx context.Context)

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

type SkipEdgeExampleEdges added in v0.3.0

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

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

func (SkipEdgeExampleEdges) UserOrErr added in v0.3.0

func (e SkipEdgeExampleEdges) 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 SkipEdgeExampleGroupBy added in v0.3.0

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

SkipEdgeExampleGroupBy is the group-by builder for SkipEdgeExample entities.

func (*SkipEdgeExampleGroupBy) Aggregate added in v0.3.0

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

func (*SkipEdgeExampleGroupBy) Bool added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) BoolX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Bools added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) BoolsX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Float64 added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Float64X added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Float64s added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Float64sX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Int added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) IntX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Ints added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) IntsX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Scan added in v0.3.0

func (seegb *SkipEdgeExampleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*SkipEdgeExampleGroupBy) ScanX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) String added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) StringX added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) Strings added in v0.3.0

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

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

func (*SkipEdgeExampleGroupBy) StringsX added in v0.3.0

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

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

type SkipEdgeExampleMutation added in v0.3.0

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

SkipEdgeExampleMutation represents an operation that mutates the SkipEdgeExample nodes in the graph.

func (*SkipEdgeExampleMutation) AddField added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) AddedEdges added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) AddedField added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) AddedFields added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) AddedIDs added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) ClearEdge added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) ClearField added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) ClearUser added in v0.3.0

func (m *SkipEdgeExampleMutation) ClearUser()

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

func (*SkipEdgeExampleMutation) ClearedEdges added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) ClearedFields added in v0.3.0

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

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

func (SkipEdgeExampleMutation) Client added in v0.3.0

func (m SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) EdgeCleared added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) Field added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) FieldCleared added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) Fields added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) ID added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) IDs added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) OldField added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) Op added in v0.3.0

func (m *SkipEdgeExampleMutation) Op() Op

Op returns the operation name.

func (*SkipEdgeExampleMutation) RemovedEdges added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) RemovedIDs added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) ResetEdge added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) ResetField added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) ResetUser added in v0.3.0

func (m *SkipEdgeExampleMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SkipEdgeExampleMutation) SetField added in v0.3.0

func (m *SkipEdgeExampleMutation) 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 (*SkipEdgeExampleMutation) SetUserID added in v0.3.0

func (m *SkipEdgeExampleMutation) SetUserID(id int)

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

func (SkipEdgeExampleMutation) Tx added in v0.3.0

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

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

func (*SkipEdgeExampleMutation) Type added in v0.3.0

func (m *SkipEdgeExampleMutation) Type() string

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

func (*SkipEdgeExampleMutation) UserCleared added in v0.3.0

func (m *SkipEdgeExampleMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*SkipEdgeExampleMutation) UserID added in v0.3.0

func (m *SkipEdgeExampleMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*SkipEdgeExampleMutation) UserIDs added in v0.3.0

func (m *SkipEdgeExampleMutation) UserIDs() (ids []int)

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

func (*SkipEdgeExampleMutation) Where added in v0.3.0

Where appends a list predicates to the SkipEdgeExampleMutation builder.

type SkipEdgeExampleQuery added in v0.3.0

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

SkipEdgeExampleQuery is the builder for querying SkipEdgeExample entities.

func (*SkipEdgeExampleQuery) All added in v0.3.0

All executes the query and returns a list of SkipEdgeExamples.

func (*SkipEdgeExampleQuery) AllX added in v0.3.0

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

func (*SkipEdgeExampleQuery) Clone added in v0.3.0

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

func (*SkipEdgeExampleQuery) Count added in v0.3.0

func (seeq *SkipEdgeExampleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SkipEdgeExampleQuery) CountX added in v0.3.0

func (seeq *SkipEdgeExampleQuery) CountX(ctx context.Context) int

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

func (*SkipEdgeExampleQuery) Exist added in v0.3.0

func (seeq *SkipEdgeExampleQuery) Exist(ctx context.Context) (bool, error)

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

func (*SkipEdgeExampleQuery) ExistX added in v0.3.0

func (seeq *SkipEdgeExampleQuery) ExistX(ctx context.Context) bool

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

func (*SkipEdgeExampleQuery) First added in v0.3.0

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

func (*SkipEdgeExampleQuery) FirstID added in v0.3.0

func (seeq *SkipEdgeExampleQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SkipEdgeExampleQuery) FirstIDX added in v0.3.0

func (seeq *SkipEdgeExampleQuery) FirstIDX(ctx context.Context) int

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

func (*SkipEdgeExampleQuery) FirstX added in v0.3.0

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

func (*SkipEdgeExampleQuery) GroupBy added in v0.3.0

func (seeq *SkipEdgeExampleQuery) GroupBy(field string, fields ...string) *SkipEdgeExampleGroupBy

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

func (*SkipEdgeExampleQuery) IDs added in v0.3.0

func (seeq *SkipEdgeExampleQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SkipEdgeExampleQuery) IDsX added in v0.3.0

func (seeq *SkipEdgeExampleQuery) IDsX(ctx context.Context) []int

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

func (*SkipEdgeExampleQuery) Limit added in v0.3.0

func (seeq *SkipEdgeExampleQuery) Limit(limit int) *SkipEdgeExampleQuery

Limit adds a limit step to the query.

func (*SkipEdgeExampleQuery) Offset added in v0.3.0

func (seeq *SkipEdgeExampleQuery) Offset(offset int) *SkipEdgeExampleQuery

Offset adds an offset step to the query.

func (*SkipEdgeExampleQuery) Only added in v0.3.0

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

func (*SkipEdgeExampleQuery) OnlyID added in v0.3.0

func (seeq *SkipEdgeExampleQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SkipEdgeExampleQuery) OnlyIDX added in v0.3.0

func (seeq *SkipEdgeExampleQuery) OnlyIDX(ctx context.Context) int

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

func (*SkipEdgeExampleQuery) OnlyX added in v0.3.0

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

func (*SkipEdgeExampleQuery) Order added in v0.3.0

Order adds an order step to the query.

func (*SkipEdgeExampleQuery) QueryUser added in v0.3.0

func (seeq *SkipEdgeExampleQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SkipEdgeExampleQuery) Select added in v0.3.0

func (seeq *SkipEdgeExampleQuery) Select(fields ...string) *SkipEdgeExampleSelect

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

func (*SkipEdgeExampleQuery) Unique added in v0.3.0

func (seeq *SkipEdgeExampleQuery) Unique(unique bool) *SkipEdgeExampleQuery

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 (*SkipEdgeExampleQuery) Where added in v0.3.0

Where adds a new predicate for the SkipEdgeExampleQuery builder.

func (*SkipEdgeExampleQuery) WithUser added in v0.3.0

func (seeq *SkipEdgeExampleQuery) WithUser(opts ...func(*UserQuery)) *SkipEdgeExampleQuery

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 SkipEdgeExampleSelect added in v0.3.0

type SkipEdgeExampleSelect struct {
	*SkipEdgeExampleQuery
	// contains filtered or unexported fields
}

SkipEdgeExampleSelect is the builder for selecting fields of SkipEdgeExample entities.

func (*SkipEdgeExampleSelect) Bool added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) BoolX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Bools added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) BoolsX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Float64 added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Float64X added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Float64s added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Float64sX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Int added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) IntX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Ints added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) IntsX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Scan added in v0.3.0

func (sees *SkipEdgeExampleSelect) Scan(ctx context.Context, v any) error

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

func (*SkipEdgeExampleSelect) ScanX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) String added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) StringX added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) Strings added in v0.3.0

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

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

func (*SkipEdgeExampleSelect) StringsX added in v0.3.0

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

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

type SkipEdgeExampleUpdate added in v0.3.0

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

SkipEdgeExampleUpdate is the builder for updating SkipEdgeExample entities.

func (*SkipEdgeExampleUpdate) ClearUser added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) ClearUser() *SkipEdgeExampleUpdate

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

func (*SkipEdgeExampleUpdate) Exec added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SkipEdgeExampleUpdate) ExecX added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleUpdate) Mutation added in v0.3.0

Mutation returns the SkipEdgeExampleMutation object of the builder.

func (*SkipEdgeExampleUpdate) Save added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) Save(ctx context.Context) (int, error)

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

func (*SkipEdgeExampleUpdate) SaveX added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) SaveX(ctx context.Context) int

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

func (*SkipEdgeExampleUpdate) SetNillableUserID added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) SetNillableUserID(id *int) *SkipEdgeExampleUpdate

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

func (*SkipEdgeExampleUpdate) SetUser added in v0.3.0

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

func (*SkipEdgeExampleUpdate) SetUserID added in v0.3.0

func (seeu *SkipEdgeExampleUpdate) SetUserID(id int) *SkipEdgeExampleUpdate

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

func (*SkipEdgeExampleUpdate) Where added in v0.3.0

Where appends a list predicates to the SkipEdgeExampleUpdate builder.

type SkipEdgeExampleUpdateOne added in v0.3.0

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

SkipEdgeExampleUpdateOne is the builder for updating a single SkipEdgeExample entity.

func (*SkipEdgeExampleUpdateOne) ClearUser added in v0.3.0

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

func (*SkipEdgeExampleUpdateOne) Exec added in v0.3.0

func (seeuo *SkipEdgeExampleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SkipEdgeExampleUpdateOne) ExecX added in v0.3.0

func (seeuo *SkipEdgeExampleUpdateOne) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleUpdateOne) Mutation added in v0.3.0

Mutation returns the SkipEdgeExampleMutation object of the builder.

func (*SkipEdgeExampleUpdateOne) Save added in v0.3.0

Save executes the query and returns the updated SkipEdgeExample entity.

func (*SkipEdgeExampleUpdateOne) SaveX added in v0.3.0

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

func (*SkipEdgeExampleUpdateOne) Select added in v0.3.0

func (seeuo *SkipEdgeExampleUpdateOne) Select(field string, fields ...string) *SkipEdgeExampleUpdateOne

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

func (*SkipEdgeExampleUpdateOne) SetNillableUserID added in v0.3.0

func (seeuo *SkipEdgeExampleUpdateOne) SetNillableUserID(id *int) *SkipEdgeExampleUpdateOne

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

func (*SkipEdgeExampleUpdateOne) SetUser added in v0.3.0

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

func (*SkipEdgeExampleUpdateOne) SetUserID added in v0.3.0

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

type SkipEdgeExamples added in v0.3.0

type SkipEdgeExamples []*SkipEdgeExample

SkipEdgeExamples is a parsable slice of SkipEdgeExample.

type Todo

type Todo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Task holds the value of the "task" field.
	Task string `json:"task,omitempty"`
	// Status holds the value of the "status" field.
	Status todo.Status `json:"status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TodoQuery when eager-loading is set.
	Edges TodoEdges `json:"edges"`
	// contains filtered or unexported fields
}

Todo is the model entity for the Todo schema.

func (*Todo) QueryUser

func (t *Todo) QueryUser() *UserQuery

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

func (*Todo) String

func (t *Todo) String() string

String implements the fmt.Stringer.

func (*Todo) Unwrap

func (t *Todo) Unwrap() *Todo

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

func (t *Todo) Update() *TodoUpdateOne

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

type TodoClient

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

TodoClient is a client for the Todo schema.

func NewTodoClient

func NewTodoClient(c config) *TodoClient

NewTodoClient returns a client for the Todo from the given config.

func (*TodoClient) Create

func (c *TodoClient) Create() *TodoCreate

Create returns a builder for creating a Todo entity.

func (*TodoClient) CreateBulk

func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk

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

func (*TodoClient) Delete

func (c *TodoClient) Delete() *TodoDelete

Delete returns a delete builder for Todo.

func (*TodoClient) DeleteOne

func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TodoClient) DeleteOneID

func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne

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

func (*TodoClient) Get

func (c *TodoClient) Get(ctx context.Context, id int) (*Todo, error)

Get returns a Todo entity by its id.

func (*TodoClient) GetX

func (c *TodoClient) GetX(ctx context.Context, id int) *Todo

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

func (*TodoClient) Hooks

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

Hooks returns the client hooks.

func (*TodoClient) Query

func (c *TodoClient) Query() *TodoQuery

Query returns a query builder for Todo.

func (*TodoClient) QueryUser

func (c *TodoClient) QueryUser(t *Todo) *UserQuery

QueryUser queries the user edge of a Todo.

func (*TodoClient) Update

func (c *TodoClient) Update() *TodoUpdate

Update returns an update builder for Todo.

func (*TodoClient) UpdateOne

func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TodoClient) UpdateOneID

func (c *TodoClient) UpdateOneID(id int) *TodoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TodoClient) Use

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

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

type TodoCreate

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

TodoCreate is the builder for creating a Todo entity.

func (*TodoCreate) Exec added in v0.2.0

func (tc *TodoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreate) ExecX added in v0.2.0

func (tc *TodoCreate) ExecX(ctx context.Context)

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

func (*TodoCreate) Mutation

func (tc *TodoCreate) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoCreate) Save

func (tc *TodoCreate) Save(ctx context.Context) (*Todo, error)

Save creates the Todo in the database.

func (*TodoCreate) SaveX

func (tc *TodoCreate) SaveX(ctx context.Context) *Todo

SaveX calls Save and panics if Save returns an error.

func (*TodoCreate) SetNillableStatus

func (tc *TodoCreate) SetNillableStatus(t *todo.Status) *TodoCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TodoCreate) SetNillableUserID

func (tc *TodoCreate) SetNillableUserID(id *int) *TodoCreate

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

func (*TodoCreate) SetStatus

func (tc *TodoCreate) SetStatus(t todo.Status) *TodoCreate

SetStatus sets the "status" field.

func (*TodoCreate) SetTask

func (tc *TodoCreate) SetTask(s string) *TodoCreate

SetTask sets the "task" field.

func (*TodoCreate) SetUser

func (tc *TodoCreate) SetUser(u *User) *TodoCreate

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

func (*TodoCreate) SetUserID

func (tc *TodoCreate) SetUserID(id int) *TodoCreate

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

type TodoCreateBulk

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

TodoCreateBulk is the builder for creating many Todo entities in bulk.

func (*TodoCreateBulk) Exec added in v0.2.0

func (tcb *TodoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreateBulk) ExecX added in v0.2.0

func (tcb *TodoCreateBulk) ExecX(ctx context.Context)

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

func (*TodoCreateBulk) Save

func (tcb *TodoCreateBulk) Save(ctx context.Context) ([]*Todo, error)

Save creates the Todo entities in the database.

func (*TodoCreateBulk) SaveX

func (tcb *TodoCreateBulk) SaveX(ctx context.Context) []*Todo

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

type TodoDelete

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

TodoDelete is the builder for deleting a Todo entity.

func (*TodoDelete) Exec

func (td *TodoDelete) Exec(ctx context.Context) (int, error)

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

func (*TodoDelete) ExecX

func (td *TodoDelete) ExecX(ctx context.Context) int

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

func (*TodoDelete) Where

func (td *TodoDelete) Where(ps ...predicate.Todo) *TodoDelete

Where appends a list predicates to the TodoDelete builder.

type TodoDeleteOne

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

TodoDeleteOne is the builder for deleting a single Todo entity.

func (*TodoDeleteOne) Exec

func (tdo *TodoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TodoDeleteOne) ExecX

func (tdo *TodoDeleteOne) ExecX(ctx context.Context)

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

type TodoEdges

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

TodoEdges holds the relations/edges for other nodes in the graph.

func (TodoEdges) UserOrErr

func (e TodoEdges) 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 TodoGroupBy

type TodoGroupBy struct {
	// contains filtered or unexported fields
}

TodoGroupBy is the group-by builder for Todo entities.

func (*TodoGroupBy) Aggregate

func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TodoGroupBy) Bool

func (s *TodoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) BoolX

func (s *TodoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TodoGroupBy) Bools

func (s *TodoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) BoolsX

func (s *TodoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TodoGroupBy) Float64

func (s *TodoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) Float64X

func (s *TodoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TodoGroupBy) Float64s

func (s *TodoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) Float64sX

func (s *TodoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TodoGroupBy) Int

func (s *TodoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) IntX

func (s *TodoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TodoGroupBy) Ints

func (s *TodoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) IntsX

func (s *TodoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TodoGroupBy) Scan

func (tgb *TodoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*TodoGroupBy) ScanX

func (s *TodoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TodoGroupBy) String

func (s *TodoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) StringX

func (s *TodoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TodoGroupBy) Strings

func (s *TodoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) StringsX

func (s *TodoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TodoMutation

type TodoMutation struct {
	// contains filtered or unexported fields
}

TodoMutation represents an operation that mutates the Todo nodes in the graph.

func (*TodoMutation) AddField

func (m *TodoMutation) 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 (*TodoMutation) AddedEdges

func (m *TodoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TodoMutation) AddedField

func (m *TodoMutation) 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 (*TodoMutation) AddedFields

func (m *TodoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TodoMutation) AddedIDs

func (m *TodoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TodoMutation) ClearEdge

func (m *TodoMutation) 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 (*TodoMutation) ClearField

func (m *TodoMutation) 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 (*TodoMutation) ClearUser

func (m *TodoMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*TodoMutation) ClearedEdges

func (m *TodoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TodoMutation) ClearedFields

func (m *TodoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TodoMutation) Client

func (m TodoMutation) 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 (*TodoMutation) EdgeCleared

func (m *TodoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TodoMutation) Field

func (m *TodoMutation) 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 (*TodoMutation) FieldCleared

func (m *TodoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TodoMutation) Fields

func (m *TodoMutation) 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 (*TodoMutation) ID

func (m *TodoMutation) 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 (*TodoMutation) IDs added in v0.3.0

func (m *TodoMutation) 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 (*TodoMutation) OldField

func (m *TodoMutation) 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 (*TodoMutation) OldStatus

func (m *TodoMutation) OldStatus(ctx context.Context) (v todo.Status, err error)

OldStatus returns the old "status" field's value of the Todo entity. If the Todo object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TodoMutation) OldTask

func (m *TodoMutation) OldTask(ctx context.Context) (v string, err error)

OldTask returns the old "task" field's value of the Todo entity. If the Todo object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TodoMutation) Op

func (m *TodoMutation) Op() Op

Op returns the operation name.

func (*TodoMutation) RemovedEdges

func (m *TodoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TodoMutation) RemovedIDs

func (m *TodoMutation) 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 (*TodoMutation) ResetEdge

func (m *TodoMutation) 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 (*TodoMutation) ResetField

func (m *TodoMutation) 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 (*TodoMutation) ResetStatus

func (m *TodoMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TodoMutation) ResetTask

func (m *TodoMutation) ResetTask()

ResetTask resets all changes to the "task" field.

func (*TodoMutation) ResetUser

func (m *TodoMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*TodoMutation) SetField

func (m *TodoMutation) 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 (*TodoMutation) SetStatus

func (m *TodoMutation) SetStatus(t todo.Status)

SetStatus sets the "status" field.

func (*TodoMutation) SetTask

func (m *TodoMutation) SetTask(s string)

SetTask sets the "task" field.

func (*TodoMutation) SetUserID

func (m *TodoMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*TodoMutation) Status

func (m *TodoMutation) Status() (r todo.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TodoMutation) Task

func (m *TodoMutation) Task() (r string, exists bool)

Task returns the value of the "task" field in the mutation.

func (TodoMutation) Tx

func (m TodoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TodoMutation) Type

func (m *TodoMutation) Type() string

Type returns the node type of this mutation (Todo).

func (*TodoMutation) UserCleared

func (m *TodoMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*TodoMutation) UserID

func (m *TodoMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*TodoMutation) UserIDs

func (m *TodoMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*TodoMutation) Where added in v0.2.0

func (m *TodoMutation) Where(ps ...predicate.Todo)

Where appends a list predicates to the TodoMutation builder.

type TodoQuery

type TodoQuery struct {
	// contains filtered or unexported fields
}

TodoQuery is the builder for querying Todo entities.

func (*TodoQuery) All

func (tq *TodoQuery) All(ctx context.Context) ([]*Todo, error)

All executes the query and returns a list of Todos.

func (*TodoQuery) AllX

func (tq *TodoQuery) AllX(ctx context.Context) []*Todo

AllX is like All, but panics if an error occurs.

func (*TodoQuery) Clone

func (tq *TodoQuery) Clone() *TodoQuery

Clone returns a duplicate of the TodoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TodoQuery) Count

func (tq *TodoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TodoQuery) CountX

func (tq *TodoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TodoQuery) Exist

func (tq *TodoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TodoQuery) ExistX

func (tq *TodoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TodoQuery) First

func (tq *TodoQuery) First(ctx context.Context) (*Todo, error)

First returns the first Todo entity from the query. Returns a *NotFoundError when no Todo was found.

func (*TodoQuery) FirstID

func (tq *TodoQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Todo ID from the query. Returns a *NotFoundError when no Todo ID was found.

func (*TodoQuery) FirstIDX

func (tq *TodoQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TodoQuery) FirstX

func (tq *TodoQuery) FirstX(ctx context.Context) *Todo

FirstX is like First, but panics if an error occurs.

func (*TodoQuery) GroupBy

func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy

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 {
	Task string `json:"task,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Todo.Query().
	GroupBy(todo.FieldTask).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TodoQuery) IDs

func (tq *TodoQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Todo IDs.

func (*TodoQuery) IDsX

func (tq *TodoQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TodoQuery) Limit

func (tq *TodoQuery) Limit(limit int) *TodoQuery

Limit adds a limit step to the query.

func (*TodoQuery) Offset

func (tq *TodoQuery) Offset(offset int) *TodoQuery

Offset adds an offset step to the query.

func (*TodoQuery) Only

func (tq *TodoQuery) Only(ctx context.Context) (*Todo, error)

Only returns a single Todo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Todo entity is found. Returns a *NotFoundError when no Todo entities are found.

func (*TodoQuery) OnlyID

func (tq *TodoQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Todo ID in the query. Returns a *NotSingularError when more than one Todo ID is found. Returns a *NotFoundError when no entities are found.

func (*TodoQuery) OnlyIDX

func (tq *TodoQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TodoQuery) OnlyX

func (tq *TodoQuery) OnlyX(ctx context.Context) *Todo

OnlyX is like Only, but panics if an error occurs.

func (*TodoQuery) Order

func (tq *TodoQuery) Order(o ...OrderFunc) *TodoQuery

Order adds an order step to the query.

func (*TodoQuery) QueryUser

func (tq *TodoQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*TodoQuery) Select

func (tq *TodoQuery) Select(fields ...string) *TodoSelect

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 {
	Task string `json:"task,omitempty"`
}

client.Todo.Query().
	Select(todo.FieldTask).
	Scan(ctx, &v)

func (*TodoQuery) Unique

func (tq *TodoQuery) Unique(unique bool) *TodoQuery

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 (*TodoQuery) Where

func (tq *TodoQuery) Where(ps ...predicate.Todo) *TodoQuery

Where adds a new predicate for the TodoQuery builder.

func (*TodoQuery) WithUser

func (tq *TodoQuery) WithUser(opts ...func(*UserQuery)) *TodoQuery

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 TodoSelect

type TodoSelect struct {
	*TodoQuery
	// contains filtered or unexported fields
}

TodoSelect is the builder for selecting fields of Todo entities.

func (*TodoSelect) Bool

func (s *TodoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TodoSelect) BoolX

func (s *TodoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TodoSelect) Bools

func (s *TodoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TodoSelect) BoolsX

func (s *TodoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TodoSelect) Float64

func (s *TodoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TodoSelect) Float64X

func (s *TodoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TodoSelect) Float64s

func (s *TodoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TodoSelect) Float64sX

func (s *TodoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TodoSelect) Int

func (s *TodoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TodoSelect) IntX

func (s *TodoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TodoSelect) Ints

func (s *TodoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TodoSelect) IntsX

func (s *TodoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TodoSelect) Scan

func (ts *TodoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TodoSelect) ScanX

func (s *TodoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TodoSelect) String

func (s *TodoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TodoSelect) StringX

func (s *TodoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TodoSelect) Strings

func (s *TodoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TodoSelect) StringsX

func (s *TodoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TodoUpdate

type TodoUpdate struct {
	// contains filtered or unexported fields
}

TodoUpdate is the builder for updating Todo entities.

func (*TodoUpdate) ClearUser

func (tu *TodoUpdate) ClearUser() *TodoUpdate

ClearUser clears the "user" edge to the User entity.

func (*TodoUpdate) Exec

func (tu *TodoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoUpdate) ExecX

func (tu *TodoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoUpdate) Mutation

func (tu *TodoUpdate) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoUpdate) Save

func (tu *TodoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TodoUpdate) SaveX

func (tu *TodoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TodoUpdate) SetNillableStatus

func (tu *TodoUpdate) SetNillableStatus(t *todo.Status) *TodoUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TodoUpdate) SetNillableUserID

func (tu *TodoUpdate) SetNillableUserID(id *int) *TodoUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*TodoUpdate) SetStatus

func (tu *TodoUpdate) SetStatus(t todo.Status) *TodoUpdate

SetStatus sets the "status" field.

func (*TodoUpdate) SetTask

func (tu *TodoUpdate) SetTask(s string) *TodoUpdate

SetTask sets the "task" field.

func (*TodoUpdate) SetUser

func (tu *TodoUpdate) SetUser(u *User) *TodoUpdate

SetUser sets the "user" edge to the User entity.

func (*TodoUpdate) SetUserID

func (tu *TodoUpdate) SetUserID(id int) *TodoUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*TodoUpdate) Where

func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate

Where appends a list predicates to the TodoUpdate builder.

type TodoUpdateOne

type TodoUpdateOne struct {
	// contains filtered or unexported fields
}

TodoUpdateOne is the builder for updating a single Todo entity.

func (*TodoUpdateOne) ClearUser

func (tuo *TodoUpdateOne) ClearUser() *TodoUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*TodoUpdateOne) Exec

func (tuo *TodoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TodoUpdateOne) ExecX

func (tuo *TodoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoUpdateOne) Mutation

func (tuo *TodoUpdateOne) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoUpdateOne) Save

func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error)

Save executes the query and returns the updated Todo entity.

func (*TodoUpdateOne) SaveX

func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo

SaveX is like Save, but panics if an error occurs.

func (*TodoUpdateOne) Select

func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TodoUpdateOne) SetNillableStatus

func (tuo *TodoUpdateOne) SetNillableStatus(t *todo.Status) *TodoUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TodoUpdateOne) SetNillableUserID

func (tuo *TodoUpdateOne) SetNillableUserID(id *int) *TodoUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*TodoUpdateOne) SetStatus

func (tuo *TodoUpdateOne) SetStatus(t todo.Status) *TodoUpdateOne

SetStatus sets the "status" field.

func (*TodoUpdateOne) SetTask

func (tuo *TodoUpdateOne) SetTask(s string) *TodoUpdateOne

SetTask sets the "task" field.

func (*TodoUpdateOne) SetUser

func (tuo *TodoUpdateOne) SetUser(u *User) *TodoUpdateOne

SetUser sets the "user" edge to the User entity.

func (*TodoUpdateOne) SetUserID

func (tuo *TodoUpdateOne) SetUserID(id int) *TodoUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

type Todos

type Todos []*Todo

Todos is a parsable slice of Todo.

type Tx

type Tx struct {

	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// MultiWordSchema is the client for interacting with the MultiWordSchema builders.
	MultiWordSchema *MultiWordSchemaClient
	// NilExample is the client for interacting with the NilExample builders.
	NilExample *NilExampleClient
	// Pet is the client for interacting with the Pet builders.
	Pet *PetClient
	// Pony is the client for interacting with the Pony builders.
	Pony *PonyClient
	// SkipEdgeExample is the client for interacting with the SkipEdgeExample builders.
	SkipEdgeExample *SkipEdgeExampleClient
	// Todo is the client for interacting with the Todo builders.
	Todo *TodoClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserName holds the value of the "user_name" field.
	UserName string `json:"user_name,omitempty"`
	// Joined holds the value of the "joined" field.
	Joined time.Time `json:"joined,omitempty"`
	// Points holds the value of the "points" field.
	Points uint `json:"points,omitempty"`
	// Exp holds the value of the "exp" field.
	Exp uint64 `json:"exp,omitempty"`
	// Status holds the value of the "status" field.
	Status user.Status `json:"status,omitempty"`
	// ExternalID holds the value of the "external_id" field.
	ExternalID int `json:"external_id,omitempty"`
	// CrmID holds the value of the "crm_id" field.
	CrmID uuid.UUID `json:"crm_id,omitempty"`
	// Banned holds the value of the "banned" field.
	Banned bool `json:"banned,omitempty"`
	// CustomPb holds the value of the "custom_pb" field.
	CustomPb uint8 `json:"custom_pb,omitempty"`
	// OptNum holds the value of the "opt_num" field.
	OptNum int `json:"opt_num,omitempty"`
	// OptStr holds the value of the "opt_str" field.
	OptStr string `json:"opt_str,omitempty"`
	// OptBool holds the value of the "opt_bool" field.
	OptBool bool `json:"opt_bool,omitempty"`
	// BigInt holds the value of the "big_int" field.
	BigInt schema.BigInt `json:"big_int,omitempty"`
	// BUser1 holds the value of the "b_user_1" field.
	BUser1 int `json:"b_user_1,omitempty"`
	// HeightInCm holds the value of the "height_in_cm" field.
	HeightInCm float32 `json:"height_in_cm,omitempty"`
	// AccountBalance holds the value of the "account_balance" field.
	AccountBalance float64 `json:"account_balance,omitempty"`
	// Unnecessary holds the value of the "unnecessary" field.
	Unnecessary string `json:"unnecessary,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Labels holds the value of the "labels" field.
	Labels []string `json:"labels,omitempty"`
	// DeviceType holds the value of the "device_type" field.
	DeviceType user.DeviceType `json:"device_type,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) QueryAttachment

func (u *User) QueryAttachment() *AttachmentQuery

QueryAttachment queries the "attachment" edge of the User entity.

func (*User) QueryGroup

func (u *User) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the User entity.

func (*User) QueryPet added in v0.3.0

func (u *User) QueryPet() *PetQuery

QueryPet queries the "pet" edge of the User entity.

func (*User) QueryReceived1 added in v0.2.0

func (u *User) QueryReceived1() *AttachmentQuery

QueryReceived1 queries the "received_1" edge of the User entity.

func (*User) QuerySkipEdge added in v0.3.0

func (u *User) QuerySkipEdge() *SkipEdgeExampleQuery

QuerySkipEdge queries the "skip_edge" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAttachment

func (c *UserClient) QueryAttachment(u *User) *AttachmentQuery

QueryAttachment queries the attachment edge of a User.

func (*UserClient) QueryGroup

func (c *UserClient) QueryGroup(u *User) *GroupQuery

QueryGroup queries the group edge of a User.

func (*UserClient) QueryPet added in v0.3.0

func (c *UserClient) QueryPet(u *User) *PetQuery

QueryPet queries the pet edge of a User.

func (*UserClient) QueryReceived1 added in v0.2.0

func (c *UserClient) QueryReceived1(u *User) *AttachmentQuery

QueryReceived1 queries the received_1 edge of a User.

func (*UserClient) QuerySkipEdge added in v0.3.0

func (c *UserClient) QuerySkipEdge(u *User) *SkipEdgeExampleQuery

QuerySkipEdge queries the skip_edge edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddReceived1 added in v0.2.0

func (uc *UserCreate) AddReceived1(a ...*Attachment) *UserCreate

AddReceived1 adds the "received_1" edges to the Attachment entity.

func (*UserCreate) AddReceived1IDs added in v0.2.0

func (uc *UserCreate) AddReceived1IDs(ids ...uuid.UUID) *UserCreate

AddReceived1IDs adds the "received_1" edge to the Attachment entity by IDs.

func (*UserCreate) Exec added in v0.2.0

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX added in v0.2.0

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) SetAccountBalance added in v0.2.0

func (uc *UserCreate) SetAccountBalance(f float64) *UserCreate

SetAccountBalance sets the "account_balance" field.

func (*UserCreate) SetAttachment

func (uc *UserCreate) SetAttachment(a *Attachment) *UserCreate

SetAttachment sets the "attachment" edge to the Attachment entity.

func (*UserCreate) SetAttachmentID

func (uc *UserCreate) SetAttachmentID(id uuid.UUID) *UserCreate

SetAttachmentID sets the "attachment" edge to the Attachment entity by ID.

func (*UserCreate) SetBUser1 added in v0.2.0

func (uc *UserCreate) SetBUser1(i int) *UserCreate

SetBUser1 sets the "b_user_1" field.

func (*UserCreate) SetBanned

func (uc *UserCreate) SetBanned(b bool) *UserCreate

SetBanned sets the "banned" field.

func (*UserCreate) SetBigInt

func (uc *UserCreate) SetBigInt(si schema.BigInt) *UserCreate

SetBigInt sets the "big_int" field.

func (*UserCreate) SetCrmID

func (uc *UserCreate) SetCrmID(u uuid.UUID) *UserCreate

SetCrmID sets the "crm_id" field.

func (*UserCreate) SetCustomPb

func (uc *UserCreate) SetCustomPb(u uint8) *UserCreate

SetCustomPb sets the "custom_pb" field.

func (*UserCreate) SetDeviceType added in v0.3.0

func (uc *UserCreate) SetDeviceType(ut user.DeviceType) *UserCreate

SetDeviceType sets the "device_type" field.

func (*UserCreate) SetExp

func (uc *UserCreate) SetExp(u uint64) *UserCreate

SetExp sets the "exp" field.

func (*UserCreate) SetExternalID

func (uc *UserCreate) SetExternalID(i int) *UserCreate

SetExternalID sets the "external_id" 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 int) *UserCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*UserCreate) SetHeightInCm added in v0.2.0

func (uc *UserCreate) SetHeightInCm(f float32) *UserCreate

SetHeightInCm sets the "height_in_cm" field.

func (*UserCreate) SetJoined

func (uc *UserCreate) SetJoined(t time.Time) *UserCreate

SetJoined sets the "joined" field.

func (*UserCreate) SetLabels added in v0.3.0

func (uc *UserCreate) SetLabels(s []string) *UserCreate

SetLabels sets the "labels" field.

func (*UserCreate) SetNillableAccountBalance added in v0.2.0

func (uc *UserCreate) SetNillableAccountBalance(f *float64) *UserCreate

SetNillableAccountBalance sets the "account_balance" field if the given value is not nil.

func (*UserCreate) SetNillableAttachmentID

func (uc *UserCreate) SetNillableAttachmentID(id *uuid.UUID) *UserCreate

SetNillableAttachmentID sets the "attachment" edge to the Attachment entity by ID if the given value is not nil.

func (*UserCreate) SetNillableBUser1 added in v0.2.0

func (uc *UserCreate) SetNillableBUser1(i *int) *UserCreate

SetNillableBUser1 sets the "b_user_1" field if the given value is not nil.

func (*UserCreate) SetNillableBanned

func (uc *UserCreate) SetNillableBanned(b *bool) *UserCreate

SetNillableBanned sets the "banned" field if the given value is not nil.

func (*UserCreate) SetNillableBigInt

func (uc *UserCreate) SetNillableBigInt(si *schema.BigInt) *UserCreate

SetNillableBigInt sets the "big_int" field if the given value is not nil.

func (*UserCreate) SetNillableDeviceType added in v0.3.0

func (uc *UserCreate) SetNillableDeviceType(ut *user.DeviceType) *UserCreate

SetNillableDeviceType sets the "device_type" field if the given value is not nil.

func (*UserCreate) SetNillableGroupID

func (uc *UserCreate) SetNillableGroupID(id *int) *UserCreate

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*UserCreate) SetNillableHeightInCm added in v0.2.0

func (uc *UserCreate) SetNillableHeightInCm(f *float32) *UserCreate

SetNillableHeightInCm sets the "height_in_cm" field if the given value is not nil.

func (*UserCreate) SetNillableOptBool

func (uc *UserCreate) SetNillableOptBool(b *bool) *UserCreate

SetNillableOptBool sets the "opt_bool" field if the given value is not nil.

func (*UserCreate) SetNillableOptNum

func (uc *UserCreate) SetNillableOptNum(i *int) *UserCreate

SetNillableOptNum sets the "opt_num" field if the given value is not nil.

func (*UserCreate) SetNillableOptStr

func (uc *UserCreate) SetNillableOptStr(s *string) *UserCreate

SetNillableOptStr sets the "opt_str" field if the given value is not nil.

func (*UserCreate) SetNillablePetID added in v0.3.0

func (uc *UserCreate) SetNillablePetID(id *int) *UserCreate

SetNillablePetID sets the "pet" edge to the Pet entity by ID if the given value is not nil.

func (*UserCreate) SetNillableSkipEdgeID added in v0.3.0

func (uc *UserCreate) SetNillableSkipEdgeID(id *int) *UserCreate

SetNillableSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by ID if the given value is not nil.

func (*UserCreate) SetNillableType added in v0.3.0

func (uc *UserCreate) SetNillableType(s *string) *UserCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*UserCreate) SetNillableUnnecessary added in v0.3.0

func (uc *UserCreate) SetNillableUnnecessary(s *string) *UserCreate

SetNillableUnnecessary sets the "unnecessary" field if the given value is not nil.

func (*UserCreate) SetOptBool

func (uc *UserCreate) SetOptBool(b bool) *UserCreate

SetOptBool sets the "opt_bool" field.

func (*UserCreate) SetOptNum

func (uc *UserCreate) SetOptNum(i int) *UserCreate

SetOptNum sets the "opt_num" field.

func (*UserCreate) SetOptStr

func (uc *UserCreate) SetOptStr(s string) *UserCreate

SetOptStr sets the "opt_str" field.

func (*UserCreate) SetPet added in v0.3.0

func (uc *UserCreate) SetPet(p *Pet) *UserCreate

SetPet sets the "pet" edge to the Pet entity.

func (*UserCreate) SetPetID added in v0.3.0

func (uc *UserCreate) SetPetID(id int) *UserCreate

SetPetID sets the "pet" edge to the Pet entity by ID.

func (*UserCreate) SetPoints

func (uc *UserCreate) SetPoints(u uint) *UserCreate

SetPoints sets the "points" field.

func (*UserCreate) SetSkipEdge added in v0.3.0

func (uc *UserCreate) SetSkipEdge(s *SkipEdgeExample) *UserCreate

SetSkipEdge sets the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserCreate) SetSkipEdgeID added in v0.3.0

func (uc *UserCreate) SetSkipEdgeID(id int) *UserCreate

SetSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by ID.

func (*UserCreate) SetStatus

func (uc *UserCreate) SetStatus(u user.Status) *UserCreate

SetStatus sets the "status" field.

func (*UserCreate) SetType added in v0.3.0

func (uc *UserCreate) SetType(s string) *UserCreate

SetType sets the "type" field.

func (*UserCreate) SetUnnecessary added in v0.3.0

func (uc *UserCreate) SetUnnecessary(s string) *UserCreate

SetUnnecessary sets the "unnecessary" field.

func (*UserCreate) SetUserName

func (uc *UserCreate) SetUserName(s string) *UserCreate

SetUserName sets the "user_name" 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 added in v0.2.0

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX added in v0.2.0

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.

type UserEdges

type UserEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Attachment holds the value of the attachment edge.
	Attachment *Attachment `json:"attachment,omitempty"`
	// Received1 holds the value of the received_1 edge.
	Received1 []*Attachment `json:"received_1,omitempty"`
	// Pet holds the value of the pet edge.
	Pet *Pet `json:"pet,omitempty"`
	// SkipEdge holds the value of the skip_edge edge.
	SkipEdge *SkipEdgeExample `json:"skip_edge,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AttachmentOrErr

func (e UserEdges) AttachmentOrErr() (*Attachment, error)

AttachmentOrErr returns the Attachment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

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) PetOrErr added in v0.3.0

func (e UserEdges) PetOrErr() (*Pet, error)

PetOrErr returns the Pet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) Received1OrErr added in v0.2.0

func (e UserEdges) Received1OrErr() ([]*Attachment, error)

Received1OrErr returns the Received1 value or an error if the edge was not loaded in eager-loading.

func (UserEdges) SkipEdgeOrErr added in v0.3.0

func (e UserEdges) SkipEdgeOrErr() (*SkipEdgeExample, error)

SkipEdgeOrErr returns the SkipEdge value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by 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) AccountBalance added in v0.2.0

func (m *UserMutation) AccountBalance() (r float64, exists bool)

AccountBalance returns the value of the "account_balance" field in the mutation.

func (*UserMutation) AddAccountBalance added in v0.2.0

func (m *UserMutation) AddAccountBalance(f float64)

AddAccountBalance adds f to the "account_balance" field.

func (*UserMutation) AddBUser1 added in v0.2.0

func (m *UserMutation) AddBUser1(i int)

AddBUser1 adds i to the "b_user_1" field.

func (*UserMutation) AddCustomPb

func (m *UserMutation) AddCustomPb(u int8)

AddCustomPb adds u to the "custom_pb" field.

func (*UserMutation) AddExp

func (m *UserMutation) AddExp(u int64)

AddExp adds u to the "exp" field.

func (*UserMutation) AddExternalID

func (m *UserMutation) AddExternalID(i int)

AddExternalID adds i to the "external_id" field.

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) AddHeightInCm added in v0.2.0

func (m *UserMutation) AddHeightInCm(f float32)

AddHeightInCm adds f to the "height_in_cm" field.

func (*UserMutation) AddOptNum

func (m *UserMutation) AddOptNum(i int)

AddOptNum adds i to the "opt_num" field.

func (*UserMutation) AddPoints

func (m *UserMutation) AddPoints(u int)

AddPoints adds u to the "points" field.

func (*UserMutation) AddReceived1IDs added in v0.2.0

func (m *UserMutation) AddReceived1IDs(ids ...uuid.UUID)

AddReceived1IDs adds the "received_1" edge to the Attachment entity by ids.

func (*UserMutation) AddedAccountBalance added in v0.2.0

func (m *UserMutation) AddedAccountBalance() (r float64, exists bool)

AddedAccountBalance returns the value that was added to the "account_balance" field in this mutation.

func (*UserMutation) AddedBUser1 added in v0.2.0

func (m *UserMutation) AddedBUser1() (r int, exists bool)

AddedBUser1 returns the value that was added to the "b_user_1" field in this mutation.

func (*UserMutation) AddedCustomPb

func (m *UserMutation) AddedCustomPb() (r int8, exists bool)

AddedCustomPb returns the value that was added to the "custom_pb" field in this mutation.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedExp

func (m *UserMutation) AddedExp() (r int64, exists bool)

AddedExp returns the value that was added to the "exp" field in this mutation.

func (*UserMutation) AddedExternalID

func (m *UserMutation) AddedExternalID() (r int, exists bool)

AddedExternalID returns the value that was added to the "external_id" field 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) AddedHeightInCm added in v0.2.0

func (m *UserMutation) AddedHeightInCm() (r float32, exists bool)

AddedHeightInCm returns the value that was added to the "height_in_cm" field in 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) AddedOptNum

func (m *UserMutation) AddedOptNum() (r int, exists bool)

AddedOptNum returns the value that was added to the "opt_num" field in this mutation.

func (*UserMutation) AddedPoints

func (m *UserMutation) AddedPoints() (r int, exists bool)

AddedPoints returns the value that was added to the "points" field in this mutation.

func (*UserMutation) AttachmentCleared

func (m *UserMutation) AttachmentCleared() bool

AttachmentCleared reports if the "attachment" edge to the Attachment entity was cleared.

func (*UserMutation) AttachmentID

func (m *UserMutation) AttachmentID() (id uuid.UUID, exists bool)

AttachmentID returns the "attachment" edge ID in the mutation.

func (*UserMutation) AttachmentIDs

func (m *UserMutation) AttachmentIDs() (ids []uuid.UUID)

AttachmentIDs returns the "attachment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AttachmentID instead. It exists only for internal usage by the builders.

func (*UserMutation) BUser1 added in v0.2.0

func (m *UserMutation) BUser1() (r int, exists bool)

BUser1 returns the value of the "b_user_1" field in the mutation.

func (*UserMutation) BUser1Cleared added in v0.2.0

func (m *UserMutation) BUser1Cleared() bool

BUser1Cleared returns if the "b_user_1" field was cleared in this mutation.

func (*UserMutation) Banned

func (m *UserMutation) Banned() (r bool, exists bool)

Banned returns the value of the "banned" field in the mutation.

func (*UserMutation) BigInt

func (m *UserMutation) BigInt() (r schema.BigInt, exists bool)

BigInt returns the value of the "big_int" field in the mutation.

func (*UserMutation) BigIntCleared

func (m *UserMutation) BigIntCleared() bool

BigIntCleared returns if the "big_int" field was cleared in this mutation.

func (*UserMutation) ClearAttachment

func (m *UserMutation) ClearAttachment()

ClearAttachment clears the "attachment" edge to the Attachment entity.

func (*UserMutation) ClearBUser1 added in v0.2.0

func (m *UserMutation) ClearBUser1()

ClearBUser1 clears the value of the "b_user_1" field.

func (*UserMutation) ClearBigInt

func (m *UserMutation) ClearBigInt()

ClearBigInt clears the value of the "big_int" field.

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) ClearLabels added in v0.3.0

func (m *UserMutation) ClearLabels()

ClearLabels clears the value of the "labels" field.

func (*UserMutation) ClearOptBool

func (m *UserMutation) ClearOptBool()

ClearOptBool clears the value of the "opt_bool" field.

func (*UserMutation) ClearOptNum

func (m *UserMutation) ClearOptNum()

ClearOptNum clears the value of the "opt_num" field.

func (*UserMutation) ClearOptStr

func (m *UserMutation) ClearOptStr()

ClearOptStr clears the value of the "opt_str" field.

func (*UserMutation) ClearPet added in v0.3.0

func (m *UserMutation) ClearPet()

ClearPet clears the "pet" edge to the Pet entity.

func (*UserMutation) ClearReceived1 added in v0.2.0

func (m *UserMutation) ClearReceived1()

ClearReceived1 clears the "received_1" edge to the Attachment entity.

func (*UserMutation) ClearSkipEdge added in v0.3.0

func (m *UserMutation) ClearSkipEdge()

ClearSkipEdge clears the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserMutation) ClearType added in v0.3.0

func (m *UserMutation) ClearType()

ClearType clears the value of the "type" field.

func (*UserMutation) ClearUnnecessary added in v0.3.0

func (m *UserMutation) ClearUnnecessary()

ClearUnnecessary clears the value of the "unnecessary" field.

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) CrmID

func (m *UserMutation) CrmID() (r uuid.UUID, exists bool)

CrmID returns the value of the "crm_id" field in the mutation.

func (*UserMutation) CustomPb

func (m *UserMutation) CustomPb() (r uint8, exists bool)

CustomPb returns the value of the "custom_pb" field in the mutation.

func (*UserMutation) DeviceType added in v0.3.0

func (m *UserMutation) DeviceType() (r user.DeviceType, exists bool)

DeviceType returns the value of the "device_type" 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) Exp

func (m *UserMutation) Exp() (r uint64, exists bool)

Exp returns the value of the "exp" field in the mutation.

func (*UserMutation) ExternalID

func (m *UserMutation) ExternalID() (r int, exists bool)

ExternalID returns the value of the "external_id" 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) GetType added in v0.3.0

func (m *UserMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

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 int, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*UserMutation) GroupIDs

func (m *UserMutation) GroupIDs() (ids []int)

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) HeightInCm added in v0.2.0

func (m *UserMutation) HeightInCm() (r float32, exists bool)

HeightInCm returns the value of the "height_in_cm" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs added in v0.3.0

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Joined

func (m *UserMutation) Joined() (r time.Time, exists bool)

Joined returns the value of the "joined" field in the mutation.

func (*UserMutation) Labels added in v0.3.0

func (m *UserMutation) Labels() (r []string, exists bool)

Labels returns the value of the "labels" field in the mutation.

func (*UserMutation) LabelsCleared added in v0.3.0

func (m *UserMutation) LabelsCleared() bool

LabelsCleared returns if the "labels" field was cleared in this mutation.

func (*UserMutation) OldAccountBalance added in v0.2.0

func (m *UserMutation) OldAccountBalance(ctx context.Context) (v float64, err error)

OldAccountBalance returns the old "account_balance" 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) OldBUser1 added in v0.2.0

func (m *UserMutation) OldBUser1(ctx context.Context) (v int, err error)

OldBUser1 returns the old "b_user_1" 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) OldBanned

func (m *UserMutation) OldBanned(ctx context.Context) (v bool, err error)

OldBanned returns the old "banned" 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) OldBigInt

func (m *UserMutation) OldBigInt(ctx context.Context) (v schema.BigInt, err error)

OldBigInt returns the old "big_int" 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) OldCrmID

func (m *UserMutation) OldCrmID(ctx context.Context) (v uuid.UUID, err error)

OldCrmID returns the old "crm_id" 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) OldCustomPb

func (m *UserMutation) OldCustomPb(ctx context.Context) (v uint8, err error)

OldCustomPb returns the old "custom_pb" 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) OldDeviceType added in v0.3.0

func (m *UserMutation) OldDeviceType(ctx context.Context) (v user.DeviceType, err error)

OldDeviceType returns the old "device_type" 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) OldExp

func (m *UserMutation) OldExp(ctx context.Context) (v uint64, err error)

OldExp returns the old "exp" 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) OldExternalID

func (m *UserMutation) OldExternalID(ctx context.Context) (v int, err error)

OldExternalID returns the old "external_id" 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) OldHeightInCm added in v0.2.0

func (m *UserMutation) OldHeightInCm(ctx context.Context) (v float32, err error)

OldHeightInCm returns the old "height_in_cm" 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) OldJoined

func (m *UserMutation) OldJoined(ctx context.Context) (v time.Time, err error)

OldJoined returns the old "joined" 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) OldLabels added in v0.3.0

func (m *UserMutation) OldLabels(ctx context.Context) (v []string, err error)

OldLabels returns the old "labels" 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) OldOptBool

func (m *UserMutation) OldOptBool(ctx context.Context) (v bool, err error)

OldOptBool returns the old "opt_bool" 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) OldOptNum

func (m *UserMutation) OldOptNum(ctx context.Context) (v int, err error)

OldOptNum returns the old "opt_num" 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) OldOptStr

func (m *UserMutation) OldOptStr(ctx context.Context) (v string, err error)

OldOptStr returns the old "opt_str" 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) OldPoints

func (m *UserMutation) OldPoints(ctx context.Context) (v uint, err error)

OldPoints returns the old "points" 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) OldStatus

func (m *UserMutation) OldStatus(ctx context.Context) (v user.Status, err error)

OldStatus returns the old "status" 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) OldType added in v0.3.0

func (m *UserMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" 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) OldUnnecessary added in v0.3.0

func (m *UserMutation) OldUnnecessary(ctx context.Context) (v string, err error)

OldUnnecessary returns the old "unnecessary" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUserName

func (m *UserMutation) OldUserName(ctx context.Context) (v string, err error)

OldUserName returns the old "user_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) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OptBool

func (m *UserMutation) OptBool() (r bool, exists bool)

OptBool returns the value of the "opt_bool" field in the mutation.

func (*UserMutation) OptBoolCleared

func (m *UserMutation) OptBoolCleared() bool

OptBoolCleared returns if the "opt_bool" field was cleared in this mutation.

func (*UserMutation) OptNum

func (m *UserMutation) OptNum() (r int, exists bool)

OptNum returns the value of the "opt_num" field in the mutation.

func (*UserMutation) OptNumCleared

func (m *UserMutation) OptNumCleared() bool

OptNumCleared returns if the "opt_num" field was cleared in this mutation.

func (*UserMutation) OptStr

func (m *UserMutation) OptStr() (r string, exists bool)

OptStr returns the value of the "opt_str" field in the mutation.

func (*UserMutation) OptStrCleared

func (m *UserMutation) OptStrCleared() bool

OptStrCleared returns if the "opt_str" field was cleared in this mutation.

func (*UserMutation) PetCleared added in v0.3.0

func (m *UserMutation) PetCleared() bool

PetCleared reports if the "pet" edge to the Pet entity was cleared.

func (*UserMutation) PetID added in v0.3.0

func (m *UserMutation) PetID() (id int, exists bool)

PetID returns the "pet" edge ID in the mutation.

func (*UserMutation) PetIDs added in v0.3.0

func (m *UserMutation) PetIDs() (ids []int)

PetIDs returns the "pet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PetID instead. It exists only for internal usage by the builders.

func (*UserMutation) Points

func (m *UserMutation) Points() (r uint, exists bool)

Points returns the value of the "points" field in the mutation.

func (*UserMutation) Received1Cleared added in v0.2.0

func (m *UserMutation) Received1Cleared() bool

Received1Cleared reports if the "received_1" edge to the Attachment entity was cleared.

func (*UserMutation) Received1IDs added in v0.2.0

func (m *UserMutation) Received1IDs() (ids []uuid.UUID)

Received1IDs returns the "received_1" edge IDs in the mutation.

func (*UserMutation) RemoveReceived1IDs added in v0.2.0

func (m *UserMutation) RemoveReceived1IDs(ids ...uuid.UUID)

RemoveReceived1IDs removes the "received_1" edge to the Attachment entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedReceived1IDs added in v0.2.0

func (m *UserMutation) RemovedReceived1IDs() (ids []uuid.UUID)

RemovedReceived1 returns the removed IDs of the "received_1" edge to the Attachment entity.

func (*UserMutation) ResetAccountBalance added in v0.2.0

func (m *UserMutation) ResetAccountBalance()

ResetAccountBalance resets all changes to the "account_balance" field.

func (*UserMutation) ResetAttachment

func (m *UserMutation) ResetAttachment()

ResetAttachment resets all changes to the "attachment" edge.

func (*UserMutation) ResetBUser1 added in v0.2.0

func (m *UserMutation) ResetBUser1()

ResetBUser1 resets all changes to the "b_user_1" field.

func (*UserMutation) ResetBanned

func (m *UserMutation) ResetBanned()

ResetBanned resets all changes to the "banned" field.

func (*UserMutation) ResetBigInt

func (m *UserMutation) ResetBigInt()

ResetBigInt resets all changes to the "big_int" field.

func (*UserMutation) ResetCrmID

func (m *UserMutation) ResetCrmID()

ResetCrmID resets all changes to the "crm_id" field.

func (*UserMutation) ResetCustomPb

func (m *UserMutation) ResetCustomPb()

ResetCustomPb resets all changes to the "custom_pb" field.

func (*UserMutation) ResetDeviceType added in v0.3.0

func (m *UserMutation) ResetDeviceType()

ResetDeviceType resets all changes to the "device_type" 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) ResetExp

func (m *UserMutation) ResetExp()

ResetExp resets all changes to the "exp" field.

func (*UserMutation) ResetExternalID

func (m *UserMutation) ResetExternalID()

ResetExternalID resets all changes to the "external_id" 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) ResetHeightInCm added in v0.2.0

func (m *UserMutation) ResetHeightInCm()

ResetHeightInCm resets all changes to the "height_in_cm" field.

func (*UserMutation) ResetJoined

func (m *UserMutation) ResetJoined()

ResetJoined resets all changes to the "joined" field.

func (*UserMutation) ResetLabels added in v0.3.0

func (m *UserMutation) ResetLabels()

ResetLabels resets all changes to the "labels" field.

func (*UserMutation) ResetOptBool

func (m *UserMutation) ResetOptBool()

ResetOptBool resets all changes to the "opt_bool" field.

func (*UserMutation) ResetOptNum

func (m *UserMutation) ResetOptNum()

ResetOptNum resets all changes to the "opt_num" field.

func (*UserMutation) ResetOptStr

func (m *UserMutation) ResetOptStr()

ResetOptStr resets all changes to the "opt_str" field.

func (*UserMutation) ResetPet added in v0.3.0

func (m *UserMutation) ResetPet()

ResetPet resets all changes to the "pet" edge.

func (*UserMutation) ResetPoints

func (m *UserMutation) ResetPoints()

ResetPoints resets all changes to the "points" field.

func (*UserMutation) ResetReceived1 added in v0.2.0

func (m *UserMutation) ResetReceived1()

ResetReceived1 resets all changes to the "received_1" edge.

func (*UserMutation) ResetSkipEdge added in v0.3.0

func (m *UserMutation) ResetSkipEdge()

ResetSkipEdge resets all changes to the "skip_edge" edge.

func (*UserMutation) ResetStatus

func (m *UserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*UserMutation) ResetType added in v0.3.0

func (m *UserMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*UserMutation) ResetUnnecessary added in v0.3.0

func (m *UserMutation) ResetUnnecessary()

ResetUnnecessary resets all changes to the "unnecessary" field.

func (*UserMutation) ResetUserName

func (m *UserMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*UserMutation) SetAccountBalance added in v0.2.0

func (m *UserMutation) SetAccountBalance(f float64)

SetAccountBalance sets the "account_balance" field.

func (*UserMutation) SetAttachmentID

func (m *UserMutation) SetAttachmentID(id uuid.UUID)

SetAttachmentID sets the "attachment" edge to the Attachment entity by id.

func (*UserMutation) SetBUser1 added in v0.2.0

func (m *UserMutation) SetBUser1(i int)

SetBUser1 sets the "b_user_1" field.

func (*UserMutation) SetBanned

func (m *UserMutation) SetBanned(b bool)

SetBanned sets the "banned" field.

func (*UserMutation) SetBigInt

func (m *UserMutation) SetBigInt(si schema.BigInt)

SetBigInt sets the "big_int" field.

func (*UserMutation) SetCrmID

func (m *UserMutation) SetCrmID(u uuid.UUID)

SetCrmID sets the "crm_id" field.

func (*UserMutation) SetCustomPb

func (m *UserMutation) SetCustomPb(u uint8)

SetCustomPb sets the "custom_pb" field.

func (*UserMutation) SetDeviceType added in v0.3.0

func (m *UserMutation) SetDeviceType(ut user.DeviceType)

SetDeviceType sets the "device_type" field.

func (*UserMutation) SetExp

func (m *UserMutation) SetExp(u uint64)

SetExp sets the "exp" field.

func (*UserMutation) SetExternalID

func (m *UserMutation) SetExternalID(i int)

SetExternalID sets the "external_id" 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 int)

SetGroupID sets the "group" edge to the Group entity by id.

func (*UserMutation) SetHeightInCm added in v0.2.0

func (m *UserMutation) SetHeightInCm(f float32)

SetHeightInCm sets the "height_in_cm" field.

func (*UserMutation) SetJoined

func (m *UserMutation) SetJoined(t time.Time)

SetJoined sets the "joined" field.

func (*UserMutation) SetLabels added in v0.3.0

func (m *UserMutation) SetLabels(s []string)

SetLabels sets the "labels" field.

func (*UserMutation) SetOptBool

func (m *UserMutation) SetOptBool(b bool)

SetOptBool sets the "opt_bool" field.

func (*UserMutation) SetOptNum

func (m *UserMutation) SetOptNum(i int)

SetOptNum sets the "opt_num" field.

func (*UserMutation) SetOptStr

func (m *UserMutation) SetOptStr(s string)

SetOptStr sets the "opt_str" field.

func (*UserMutation) SetPetID added in v0.3.0

func (m *UserMutation) SetPetID(id int)

SetPetID sets the "pet" edge to the Pet entity by id.

func (*UserMutation) SetPoints

func (m *UserMutation) SetPoints(u uint)

SetPoints sets the "points" field.

func (*UserMutation) SetSkipEdgeID added in v0.3.0

func (m *UserMutation) SetSkipEdgeID(id int)

SetSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by id.

func (*UserMutation) SetStatus

func (m *UserMutation) SetStatus(u user.Status)

SetStatus sets the "status" field.

func (*UserMutation) SetType added in v0.3.0

func (m *UserMutation) SetType(s string)

SetType sets the "type" field.

func (*UserMutation) SetUnnecessary added in v0.3.0

func (m *UserMutation) SetUnnecessary(s string)

SetUnnecessary sets the "unnecessary" field.

func (*UserMutation) SetUserName

func (m *UserMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (*UserMutation) SkipEdgeCleared added in v0.3.0

func (m *UserMutation) SkipEdgeCleared() bool

SkipEdgeCleared reports if the "skip_edge" edge to the SkipEdgeExample entity was cleared.

func (*UserMutation) SkipEdgeID added in v0.3.0

func (m *UserMutation) SkipEdgeID() (id int, exists bool)

SkipEdgeID returns the "skip_edge" edge ID in the mutation.

func (*UserMutation) SkipEdgeIDs added in v0.3.0

func (m *UserMutation) SkipEdgeIDs() (ids []int)

SkipEdgeIDs returns the "skip_edge" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SkipEdgeID instead. It exists only for internal usage by the builders.

func (*UserMutation) Status

func (m *UserMutation) Status() (r user.Status, exists bool)

Status returns the value of the "status" 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) TypeCleared added in v0.3.0

func (m *UserMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*UserMutation) Unnecessary added in v0.3.0

func (m *UserMutation) Unnecessary() (r string, exists bool)

Unnecessary returns the value of the "unnecessary" field in the mutation.

func (*UserMutation) UnnecessaryCleared added in v0.3.0

func (m *UserMutation) UnnecessaryCleared() bool

UnnecessaryCleared returns if the "unnecessary" field was cleared in this mutation.

func (*UserMutation) UserName

func (m *UserMutation) UserName() (r string, exists bool)

UserName returns the value of the "user_name" field in the mutation.

func (*UserMutation) Where added in v0.2.0

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UserName string `json:"user_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUserName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryAttachment

func (uq *UserQuery) QueryAttachment() *AttachmentQuery

QueryAttachment chains the current query on the "attachment" edge.

func (*UserQuery) QueryGroup

func (uq *UserQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*UserQuery) QueryPet added in v0.3.0

func (uq *UserQuery) QueryPet() *PetQuery

QueryPet chains the current query on the "pet" edge.

func (*UserQuery) QueryReceived1 added in v0.2.0

func (uq *UserQuery) QueryReceived1() *AttachmentQuery

QueryReceived1 chains the current query on the "received_1" edge.

func (*UserQuery) QuerySkipEdge added in v0.3.0

func (uq *UserQuery) QuerySkipEdge() *SkipEdgeExampleQuery

QuerySkipEdge chains the current query on the "skip_edge" 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 {
	UserName string `json:"user_name,omitempty"`
}

client.User.Query().
	Select(user.FieldUserName).
	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) WithAttachment

func (uq *UserQuery) WithAttachment(opts ...func(*AttachmentQuery)) *UserQuery

WithAttachment tells the query-builder to eager-load the nodes that are connected to the "attachment" 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) WithPet added in v0.3.0

func (uq *UserQuery) WithPet(opts ...func(*PetQuery)) *UserQuery

WithPet tells the query-builder to eager-load the nodes that are connected to the "pet" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithReceived1 added in v0.2.0

func (uq *UserQuery) WithReceived1(opts ...func(*AttachmentQuery)) *UserQuery

WithReceived1 tells the query-builder to eager-load the nodes that are connected to the "received_1" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSkipEdge added in v0.3.0

func (uq *UserQuery) WithSkipEdge(opts ...func(*SkipEdgeExampleQuery)) *UserQuery

WithSkipEdge tells the query-builder to eager-load the nodes that are connected to the "skip_edge" 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) 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) AddAccountBalance added in v0.2.0

func (uu *UserUpdate) AddAccountBalance(f float64) *UserUpdate

AddAccountBalance adds f to the "account_balance" field.

func (*UserUpdate) AddBUser1 added in v0.2.0

func (uu *UserUpdate) AddBUser1(i int) *UserUpdate

AddBUser1 adds i to the "b_user_1" field.

func (*UserUpdate) AddCustomPb

func (uu *UserUpdate) AddCustomPb(u int8) *UserUpdate

AddCustomPb adds u to the "custom_pb" field.

func (*UserUpdate) AddExp

func (uu *UserUpdate) AddExp(u int64) *UserUpdate

AddExp adds u to the "exp" field.

func (*UserUpdate) AddExternalID

func (uu *UserUpdate) AddExternalID(i int) *UserUpdate

AddExternalID adds i to the "external_id" field.

func (*UserUpdate) AddHeightInCm added in v0.2.0

func (uu *UserUpdate) AddHeightInCm(f float32) *UserUpdate

AddHeightInCm adds f to the "height_in_cm" field.

func (*UserUpdate) AddOptNum

func (uu *UserUpdate) AddOptNum(i int) *UserUpdate

AddOptNum adds i to the "opt_num" field.

func (*UserUpdate) AddPoints

func (uu *UserUpdate) AddPoints(u int) *UserUpdate

AddPoints adds u to the "points" field.

func (*UserUpdate) AddReceived1 added in v0.2.0

func (uu *UserUpdate) AddReceived1(a ...*Attachment) *UserUpdate

AddReceived1 adds the "received_1" edges to the Attachment entity.

func (*UserUpdate) AddReceived1IDs added in v0.2.0

func (uu *UserUpdate) AddReceived1IDs(ids ...uuid.UUID) *UserUpdate

AddReceived1IDs adds the "received_1" edge to the Attachment entity by IDs.

func (*UserUpdate) ClearAttachment

func (uu *UserUpdate) ClearAttachment() *UserUpdate

ClearAttachment clears the "attachment" edge to the Attachment entity.

func (*UserUpdate) ClearBUser1 added in v0.2.0

func (uu *UserUpdate) ClearBUser1() *UserUpdate

ClearBUser1 clears the value of the "b_user_1" field.

func (*UserUpdate) ClearBigInt

func (uu *UserUpdate) ClearBigInt() *UserUpdate

ClearBigInt clears the value of the "big_int" field.

func (*UserUpdate) ClearGroup

func (uu *UserUpdate) ClearGroup() *UserUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*UserUpdate) ClearLabels added in v0.3.0

func (uu *UserUpdate) ClearLabels() *UserUpdate

ClearLabels clears the value of the "labels" field.

func (*UserUpdate) ClearOptBool

func (uu *UserUpdate) ClearOptBool() *UserUpdate

ClearOptBool clears the value of the "opt_bool" field.

func (*UserUpdate) ClearOptNum

func (uu *UserUpdate) ClearOptNum() *UserUpdate

ClearOptNum clears the value of the "opt_num" field.

func (*UserUpdate) ClearOptStr

func (uu *UserUpdate) ClearOptStr() *UserUpdate

ClearOptStr clears the value of the "opt_str" field.

func (*UserUpdate) ClearPet added in v0.3.0

func (uu *UserUpdate) ClearPet() *UserUpdate

ClearPet clears the "pet" edge to the Pet entity.

func (*UserUpdate) ClearReceived1 added in v0.2.0

func (uu *UserUpdate) ClearReceived1() *UserUpdate

ClearReceived1 clears all "received_1" edges to the Attachment entity.

func (*UserUpdate) ClearSkipEdge added in v0.3.0

func (uu *UserUpdate) ClearSkipEdge() *UserUpdate

ClearSkipEdge clears the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdate) ClearType added in v0.3.0

func (uu *UserUpdate) ClearType() *UserUpdate

ClearType clears the value of the "type" field.

func (*UserUpdate) ClearUnnecessary added in v0.3.0

func (uu *UserUpdate) ClearUnnecessary() *UserUpdate

ClearUnnecessary clears the value of the "unnecessary" field.

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) RemoveReceived1 added in v0.2.0

func (uu *UserUpdate) RemoveReceived1(a ...*Attachment) *UserUpdate

RemoveReceived1 removes "received_1" edges to Attachment entities.

func (*UserUpdate) RemoveReceived1IDs added in v0.2.0

func (uu *UserUpdate) RemoveReceived1IDs(ids ...uuid.UUID) *UserUpdate

RemoveReceived1IDs removes the "received_1" edge to Attachment entities by IDs.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAccountBalance added in v0.2.0

func (uu *UserUpdate) SetAccountBalance(f float64) *UserUpdate

SetAccountBalance sets the "account_balance" field.

func (*UserUpdate) SetAttachment

func (uu *UserUpdate) SetAttachment(a *Attachment) *UserUpdate

SetAttachment sets the "attachment" edge to the Attachment entity.

func (*UserUpdate) SetAttachmentID

func (uu *UserUpdate) SetAttachmentID(id uuid.UUID) *UserUpdate

SetAttachmentID sets the "attachment" edge to the Attachment entity by ID.

func (*UserUpdate) SetBUser1 added in v0.2.0

func (uu *UserUpdate) SetBUser1(i int) *UserUpdate

SetBUser1 sets the "b_user_1" field.

func (*UserUpdate) SetBanned

func (uu *UserUpdate) SetBanned(b bool) *UserUpdate

SetBanned sets the "banned" field.

func (*UserUpdate) SetBigInt

func (uu *UserUpdate) SetBigInt(si schema.BigInt) *UserUpdate

SetBigInt sets the "big_int" field.

func (*UserUpdate) SetCrmID

func (uu *UserUpdate) SetCrmID(u uuid.UUID) *UserUpdate

SetCrmID sets the "crm_id" field.

func (*UserUpdate) SetCustomPb

func (uu *UserUpdate) SetCustomPb(u uint8) *UserUpdate

SetCustomPb sets the "custom_pb" field.

func (*UserUpdate) SetDeviceType added in v0.3.0

func (uu *UserUpdate) SetDeviceType(ut user.DeviceType) *UserUpdate

SetDeviceType sets the "device_type" field.

func (*UserUpdate) SetExp

func (uu *UserUpdate) SetExp(u uint64) *UserUpdate

SetExp sets the "exp" field.

func (*UserUpdate) SetExternalID

func (uu *UserUpdate) SetExternalID(i int) *UserUpdate

SetExternalID sets the "external_id" 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 int) *UserUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*UserUpdate) SetHeightInCm added in v0.2.0

func (uu *UserUpdate) SetHeightInCm(f float32) *UserUpdate

SetHeightInCm sets the "height_in_cm" field.

func (*UserUpdate) SetLabels added in v0.3.0

func (uu *UserUpdate) SetLabels(s []string) *UserUpdate

SetLabels sets the "labels" field.

func (*UserUpdate) SetNillableAccountBalance added in v0.2.0

func (uu *UserUpdate) SetNillableAccountBalance(f *float64) *UserUpdate

SetNillableAccountBalance sets the "account_balance" field if the given value is not nil.

func (*UserUpdate) SetNillableAttachmentID

func (uu *UserUpdate) SetNillableAttachmentID(id *uuid.UUID) *UserUpdate

SetNillableAttachmentID sets the "attachment" edge to the Attachment entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableBUser1 added in v0.2.0

func (uu *UserUpdate) SetNillableBUser1(i *int) *UserUpdate

SetNillableBUser1 sets the "b_user_1" field if the given value is not nil.

func (*UserUpdate) SetNillableBanned

func (uu *UserUpdate) SetNillableBanned(b *bool) *UserUpdate

SetNillableBanned sets the "banned" field if the given value is not nil.

func (*UserUpdate) SetNillableBigInt

func (uu *UserUpdate) SetNillableBigInt(si *schema.BigInt) *UserUpdate

SetNillableBigInt sets the "big_int" field if the given value is not nil.

func (*UserUpdate) SetNillableDeviceType added in v0.3.0

func (uu *UserUpdate) SetNillableDeviceType(ut *user.DeviceType) *UserUpdate

SetNillableDeviceType sets the "device_type" field if the given value is not nil.

func (*UserUpdate) SetNillableGroupID

func (uu *UserUpdate) SetNillableGroupID(id *int) *UserUpdate

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableHeightInCm added in v0.2.0

func (uu *UserUpdate) SetNillableHeightInCm(f *float32) *UserUpdate

SetNillableHeightInCm sets the "height_in_cm" field if the given value is not nil.

func (*UserUpdate) SetNillableOptBool

func (uu *UserUpdate) SetNillableOptBool(b *bool) *UserUpdate

SetNillableOptBool sets the "opt_bool" field if the given value is not nil.

func (*UserUpdate) SetNillableOptNum

func (uu *UserUpdate) SetNillableOptNum(i *int) *UserUpdate

SetNillableOptNum sets the "opt_num" field if the given value is not nil.

func (*UserUpdate) SetNillableOptStr

func (uu *UserUpdate) SetNillableOptStr(s *string) *UserUpdate

SetNillableOptStr sets the "opt_str" field if the given value is not nil.

func (*UserUpdate) SetNillablePetID added in v0.3.0

func (uu *UserUpdate) SetNillablePetID(id *int) *UserUpdate

SetNillablePetID sets the "pet" edge to the Pet entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableSkipEdgeID added in v0.3.0

func (uu *UserUpdate) SetNillableSkipEdgeID(id *int) *UserUpdate

SetNillableSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableType added in v0.3.0

func (uu *UserUpdate) SetNillableType(s *string) *UserUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*UserUpdate) SetNillableUnnecessary added in v0.3.0

func (uu *UserUpdate) SetNillableUnnecessary(s *string) *UserUpdate

SetNillableUnnecessary sets the "unnecessary" field if the given value is not nil.

func (*UserUpdate) SetOptBool

func (uu *UserUpdate) SetOptBool(b bool) *UserUpdate

SetOptBool sets the "opt_bool" field.

func (*UserUpdate) SetOptNum

func (uu *UserUpdate) SetOptNum(i int) *UserUpdate

SetOptNum sets the "opt_num" field.

func (*UserUpdate) SetOptStr

func (uu *UserUpdate) SetOptStr(s string) *UserUpdate

SetOptStr sets the "opt_str" field.

func (*UserUpdate) SetPet added in v0.3.0

func (uu *UserUpdate) SetPet(p *Pet) *UserUpdate

SetPet sets the "pet" edge to the Pet entity.

func (*UserUpdate) SetPetID added in v0.3.0

func (uu *UserUpdate) SetPetID(id int) *UserUpdate

SetPetID sets the "pet" edge to the Pet entity by ID.

func (*UserUpdate) SetPoints

func (uu *UserUpdate) SetPoints(u uint) *UserUpdate

SetPoints sets the "points" field.

func (*UserUpdate) SetSkipEdge added in v0.3.0

func (uu *UserUpdate) SetSkipEdge(s *SkipEdgeExample) *UserUpdate

SetSkipEdge sets the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdate) SetSkipEdgeID added in v0.3.0

func (uu *UserUpdate) SetSkipEdgeID(id int) *UserUpdate

SetSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by ID.

func (*UserUpdate) SetStatus

func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate

SetStatus sets the "status" field.

func (*UserUpdate) SetType added in v0.3.0

func (uu *UserUpdate) SetType(s string) *UserUpdate

SetType sets the "type" field.

func (*UserUpdate) SetUnnecessary added in v0.3.0

func (uu *UserUpdate) SetUnnecessary(s string) *UserUpdate

SetUnnecessary sets the "unnecessary" field.

func (*UserUpdate) SetUserName

func (uu *UserUpdate) SetUserName(s string) *UserUpdate

SetUserName sets the "user_name" 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) AddAccountBalance added in v0.2.0

func (uuo *UserUpdateOne) AddAccountBalance(f float64) *UserUpdateOne

AddAccountBalance adds f to the "account_balance" field.

func (*UserUpdateOne) AddBUser1 added in v0.2.0

func (uuo *UserUpdateOne) AddBUser1(i int) *UserUpdateOne

AddBUser1 adds i to the "b_user_1" field.

func (*UserUpdateOne) AddCustomPb

func (uuo *UserUpdateOne) AddCustomPb(u int8) *UserUpdateOne

AddCustomPb adds u to the "custom_pb" field.

func (*UserUpdateOne) AddExp

func (uuo *UserUpdateOne) AddExp(u int64) *UserUpdateOne

AddExp adds u to the "exp" field.

func (*UserUpdateOne) AddExternalID

func (uuo *UserUpdateOne) AddExternalID(i int) *UserUpdateOne

AddExternalID adds i to the "external_id" field.

func (*UserUpdateOne) AddHeightInCm added in v0.2.0

func (uuo *UserUpdateOne) AddHeightInCm(f float32) *UserUpdateOne

AddHeightInCm adds f to the "height_in_cm" field.

func (*UserUpdateOne) AddOptNum

func (uuo *UserUpdateOne) AddOptNum(i int) *UserUpdateOne

AddOptNum adds i to the "opt_num" field.

func (*UserUpdateOne) AddPoints

func (uuo *UserUpdateOne) AddPoints(u int) *UserUpdateOne

AddPoints adds u to the "points" field.

func (*UserUpdateOne) AddReceived1 added in v0.2.0

func (uuo *UserUpdateOne) AddReceived1(a ...*Attachment) *UserUpdateOne

AddReceived1 adds the "received_1" edges to the Attachment entity.

func (*UserUpdateOne) AddReceived1IDs added in v0.2.0

func (uuo *UserUpdateOne) AddReceived1IDs(ids ...uuid.UUID) *UserUpdateOne

AddReceived1IDs adds the "received_1" edge to the Attachment entity by IDs.

func (*UserUpdateOne) ClearAttachment

func (uuo *UserUpdateOne) ClearAttachment() *UserUpdateOne

ClearAttachment clears the "attachment" edge to the Attachment entity.

func (*UserUpdateOne) ClearBUser1 added in v0.2.0

func (uuo *UserUpdateOne) ClearBUser1() *UserUpdateOne

ClearBUser1 clears the value of the "b_user_1" field.

func (*UserUpdateOne) ClearBigInt

func (uuo *UserUpdateOne) ClearBigInt() *UserUpdateOne

ClearBigInt clears the value of the "big_int" field.

func (*UserUpdateOne) ClearGroup

func (uuo *UserUpdateOne) ClearGroup() *UserUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*UserUpdateOne) ClearLabels added in v0.3.0

func (uuo *UserUpdateOne) ClearLabels() *UserUpdateOne

ClearLabels clears the value of the "labels" field.

func (*UserUpdateOne) ClearOptBool

func (uuo *UserUpdateOne) ClearOptBool() *UserUpdateOne

ClearOptBool clears the value of the "opt_bool" field.

func (*UserUpdateOne) ClearOptNum

func (uuo *UserUpdateOne) ClearOptNum() *UserUpdateOne

ClearOptNum clears the value of the "opt_num" field.

func (*UserUpdateOne) ClearOptStr

func (uuo *UserUpdateOne) ClearOptStr() *UserUpdateOne

ClearOptStr clears the value of the "opt_str" field.

func (*UserUpdateOne) ClearPet added in v0.3.0

func (uuo *UserUpdateOne) ClearPet() *UserUpdateOne

ClearPet clears the "pet" edge to the Pet entity.

func (*UserUpdateOne) ClearReceived1 added in v0.2.0

func (uuo *UserUpdateOne) ClearReceived1() *UserUpdateOne

ClearReceived1 clears all "received_1" edges to the Attachment entity.

func (*UserUpdateOne) ClearSkipEdge added in v0.3.0

func (uuo *UserUpdateOne) ClearSkipEdge() *UserUpdateOne

ClearSkipEdge clears the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdateOne) ClearType added in v0.3.0

func (uuo *UserUpdateOne) ClearType() *UserUpdateOne

ClearType clears the value of the "type" field.

func (*UserUpdateOne) ClearUnnecessary added in v0.3.0

func (uuo *UserUpdateOne) ClearUnnecessary() *UserUpdateOne

ClearUnnecessary clears the value of the "unnecessary" field.

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) RemoveReceived1 added in v0.2.0

func (uuo *UserUpdateOne) RemoveReceived1(a ...*Attachment) *UserUpdateOne

RemoveReceived1 removes "received_1" edges to Attachment entities.

func (*UserUpdateOne) RemoveReceived1IDs added in v0.2.0

func (uuo *UserUpdateOne) RemoveReceived1IDs(ids ...uuid.UUID) *UserUpdateOne

RemoveReceived1IDs removes the "received_1" edge to Attachment entities by IDs.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAccountBalance added in v0.2.0

func (uuo *UserUpdateOne) SetAccountBalance(f float64) *UserUpdateOne

SetAccountBalance sets the "account_balance" field.

func (*UserUpdateOne) SetAttachment

func (uuo *UserUpdateOne) SetAttachment(a *Attachment) *UserUpdateOne

SetAttachment sets the "attachment" edge to the Attachment entity.

func (*UserUpdateOne) SetAttachmentID

func (uuo *UserUpdateOne) SetAttachmentID(id uuid.UUID) *UserUpdateOne

SetAttachmentID sets the "attachment" edge to the Attachment entity by ID.

func (*UserUpdateOne) SetBUser1 added in v0.2.0

func (uuo *UserUpdateOne) SetBUser1(i int) *UserUpdateOne

SetBUser1 sets the "b_user_1" field.

func (*UserUpdateOne) SetBanned

func (uuo *UserUpdateOne) SetBanned(b bool) *UserUpdateOne

SetBanned sets the "banned" field.

func (*UserUpdateOne) SetBigInt

func (uuo *UserUpdateOne) SetBigInt(si schema.BigInt) *UserUpdateOne

SetBigInt sets the "big_int" field.

func (*UserUpdateOne) SetCrmID

func (uuo *UserUpdateOne) SetCrmID(u uuid.UUID) *UserUpdateOne

SetCrmID sets the "crm_id" field.

func (*UserUpdateOne) SetCustomPb

func (uuo *UserUpdateOne) SetCustomPb(u uint8) *UserUpdateOne

SetCustomPb sets the "custom_pb" field.

func (*UserUpdateOne) SetDeviceType added in v0.3.0

func (uuo *UserUpdateOne) SetDeviceType(ut user.DeviceType) *UserUpdateOne

SetDeviceType sets the "device_type" field.

func (*UserUpdateOne) SetExp

func (uuo *UserUpdateOne) SetExp(u uint64) *UserUpdateOne

SetExp sets the "exp" field.

func (*UserUpdateOne) SetExternalID

func (uuo *UserUpdateOne) SetExternalID(i int) *UserUpdateOne

SetExternalID sets the "external_id" 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 int) *UserUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*UserUpdateOne) SetHeightInCm added in v0.2.0

func (uuo *UserUpdateOne) SetHeightInCm(f float32) *UserUpdateOne

SetHeightInCm sets the "height_in_cm" field.

func (*UserUpdateOne) SetLabels added in v0.3.0

func (uuo *UserUpdateOne) SetLabels(s []string) *UserUpdateOne

SetLabels sets the "labels" field.

func (*UserUpdateOne) SetNillableAccountBalance added in v0.2.0

func (uuo *UserUpdateOne) SetNillableAccountBalance(f *float64) *UserUpdateOne

SetNillableAccountBalance sets the "account_balance" field if the given value is not nil.

func (*UserUpdateOne) SetNillableAttachmentID

func (uuo *UserUpdateOne) SetNillableAttachmentID(id *uuid.UUID) *UserUpdateOne

SetNillableAttachmentID sets the "attachment" edge to the Attachment entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableBUser1 added in v0.2.0

func (uuo *UserUpdateOne) SetNillableBUser1(i *int) *UserUpdateOne

SetNillableBUser1 sets the "b_user_1" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBanned

func (uuo *UserUpdateOne) SetNillableBanned(b *bool) *UserUpdateOne

SetNillableBanned sets the "banned" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBigInt

func (uuo *UserUpdateOne) SetNillableBigInt(si *schema.BigInt) *UserUpdateOne

SetNillableBigInt sets the "big_int" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDeviceType added in v0.3.0

func (uuo *UserUpdateOne) SetNillableDeviceType(ut *user.DeviceType) *UserUpdateOne

SetNillableDeviceType sets the "device_type" field if the given value is not nil.

func (*UserUpdateOne) SetNillableGroupID

func (uuo *UserUpdateOne) SetNillableGroupID(id *int) *UserUpdateOne

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableHeightInCm added in v0.2.0

func (uuo *UserUpdateOne) SetNillableHeightInCm(f *float32) *UserUpdateOne

SetNillableHeightInCm sets the "height_in_cm" field if the given value is not nil.

func (*UserUpdateOne) SetNillableOptBool

func (uuo *UserUpdateOne) SetNillableOptBool(b *bool) *UserUpdateOne

SetNillableOptBool sets the "opt_bool" field if the given value is not nil.

func (*UserUpdateOne) SetNillableOptNum

func (uuo *UserUpdateOne) SetNillableOptNum(i *int) *UserUpdateOne

SetNillableOptNum sets the "opt_num" field if the given value is not nil.

func (*UserUpdateOne) SetNillableOptStr

func (uuo *UserUpdateOne) SetNillableOptStr(s *string) *UserUpdateOne

SetNillableOptStr sets the "opt_str" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePetID added in v0.3.0

func (uuo *UserUpdateOne) SetNillablePetID(id *int) *UserUpdateOne

SetNillablePetID sets the "pet" edge to the Pet entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableSkipEdgeID added in v0.3.0

func (uuo *UserUpdateOne) SetNillableSkipEdgeID(id *int) *UserUpdateOne

SetNillableSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableType added in v0.3.0

func (uuo *UserUpdateOne) SetNillableType(s *string) *UserUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUnnecessary added in v0.3.0

func (uuo *UserUpdateOne) SetNillableUnnecessary(s *string) *UserUpdateOne

SetNillableUnnecessary sets the "unnecessary" field if the given value is not nil.

func (*UserUpdateOne) SetOptBool

func (uuo *UserUpdateOne) SetOptBool(b bool) *UserUpdateOne

SetOptBool sets the "opt_bool" field.

func (*UserUpdateOne) SetOptNum

func (uuo *UserUpdateOne) SetOptNum(i int) *UserUpdateOne

SetOptNum sets the "opt_num" field.

func (*UserUpdateOne) SetOptStr

func (uuo *UserUpdateOne) SetOptStr(s string) *UserUpdateOne

SetOptStr sets the "opt_str" field.

func (*UserUpdateOne) SetPet added in v0.3.0

func (uuo *UserUpdateOne) SetPet(p *Pet) *UserUpdateOne

SetPet sets the "pet" edge to the Pet entity.

func (*UserUpdateOne) SetPetID added in v0.3.0

func (uuo *UserUpdateOne) SetPetID(id int) *UserUpdateOne

SetPetID sets the "pet" edge to the Pet entity by ID.

func (*UserUpdateOne) SetPoints

func (uuo *UserUpdateOne) SetPoints(u uint) *UserUpdateOne

SetPoints sets the "points" field.

func (*UserUpdateOne) SetSkipEdge added in v0.3.0

func (uuo *UserUpdateOne) SetSkipEdge(s *SkipEdgeExample) *UserUpdateOne

SetSkipEdge sets the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdateOne) SetSkipEdgeID added in v0.3.0

func (uuo *UserUpdateOne) SetSkipEdgeID(id int) *UserUpdateOne

SetSkipEdgeID sets the "skip_edge" edge to the SkipEdgeExample entity by ID.

func (*UserUpdateOne) SetStatus

func (uuo *UserUpdateOne) SetStatus(u user.Status) *UserUpdateOne

SetStatus sets the "status" field.

func (*UserUpdateOne) SetType added in v0.3.0

func (uuo *UserUpdateOne) SetType(s string) *UserUpdateOne

SetType sets the "type" field.

func (*UserUpdateOne) SetUnnecessary added in v0.3.0

func (uuo *UserUpdateOne) SetUnnecessary(s string) *UserUpdateOne

SetUnnecessary sets the "unnecessary" field.

func (*UserUpdateOne) SetUserName

func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne

SetUserName sets the "user_name" field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
proto
entpb
Code generated by protoc-gen-entgrpc.
Code generated by protoc-gen-entgrpc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL