ent

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 26 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"
	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 create builder for Attachment.

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 delete builder for the given entity.

func (*AttachmentClient) DeleteOneID

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

DeleteOneID returns a delete builder for the given 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

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

Exec executes the query.

func (*AttachmentCreate) ExecX

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

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

func (*AttachmentCreate) Mutation

func (ac *AttachmentCreate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentCreate) Save

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

Save creates the Attachment in the database.

func (*AttachmentCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*AttachmentCreate) SetID

SetID sets the "id" field.

func (*AttachmentCreate) SetNillableID

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

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

func (*AttachmentCreate) 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

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

Exec executes the query.

func (*AttachmentCreateBulk) ExecX

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

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

func (*AttachmentCreateBulk) Save

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

Save creates the Attachment entities in the database.

func (*AttachmentCreateBulk) SaveX

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

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

type AttachmentDelete

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

AttachmentDelete is the builder for deleting a Attachment entity.

func (*AttachmentDelete) Exec

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

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

func (*AttachmentDelete) ExecX

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

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

func (*AttachmentDelete) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentDeleteOne

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

AttachmentDeleteOne is the builder for deleting a single Attachment entity.

func (*AttachmentDeleteOne) Exec

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

Exec executes the deletion query.

func (*AttachmentDeleteOne) ExecX

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

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

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 interface{}) 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 interface{})

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

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

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 interface{}) 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 interface{})

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
	// 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 create builder for Group.

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 delete builder for the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne

DeleteOneID returns a delete builder for the given 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

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

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) 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

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

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

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 interface{}) 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 interface{})

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

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

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 interface{}) 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 interface{})

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

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

func (mws *MultiWordSchema) String() string

String implements the fmt.Stringer.

func (*MultiWordSchema) Unwrap

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

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

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

MultiWordSchemaClient is a client for the MultiWordSchema schema.

func NewMultiWordSchemaClient

func NewMultiWordSchemaClient(c config) *MultiWordSchemaClient

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

func (*MultiWordSchemaClient) Create

Create returns a create builder for MultiWordSchema.

func (*MultiWordSchemaClient) CreateBulk

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

func (*MultiWordSchemaClient) Delete

Delete returns a delete builder for MultiWordSchema.

func (*MultiWordSchemaClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MultiWordSchemaClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*MultiWordSchemaClient) Get

Get returns a MultiWordSchema entity by its id.

func (*MultiWordSchemaClient) GetX

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

func (*MultiWordSchemaClient) Hooks

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

Hooks returns the client hooks.

func (*MultiWordSchemaClient) Query

Query returns a query builder for MultiWordSchema.

func (*MultiWordSchemaClient) Update

Update returns an update builder for MultiWordSchema.

func (*MultiWordSchemaClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MultiWordSchemaClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MultiWordSchemaClient) Use

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

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

MultiWordSchemaCreate is the builder for creating a MultiWordSchema entity.

func (*MultiWordSchemaCreate) Exec

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

Exec executes the query.

func (*MultiWordSchemaCreate) ExecX

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

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

func (*MultiWordSchemaCreate) Mutation

Mutation returns the MultiWordSchemaMutation object of the builder.

func (*MultiWordSchemaCreate) Save

Save creates the MultiWordSchema in the database.

func (*MultiWordSchemaCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MultiWordSchemaCreate) SetNillableUnit

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

func (*MultiWordSchemaCreate) SetUnit

SetUnit sets the "unit" field.

type MultiWordSchemaCreateBulk

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

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

func (*MultiWordSchemaCreateBulk) Exec

Exec executes the query.

func (*MultiWordSchemaCreateBulk) ExecX

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

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

func (*MultiWordSchemaCreateBulk) Save

Save creates the MultiWordSchema entities in the database.

func (*MultiWordSchemaCreateBulk) SaveX

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

type MultiWordSchemaDelete

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

MultiWordSchemaDelete is the builder for deleting a MultiWordSchema entity.

func (*MultiWordSchemaDelete) Exec

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

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

func (*MultiWordSchemaDelete) ExecX

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

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

func (*MultiWordSchemaDelete) Where

Where appends a list predicates to the MultiWordSchemaDelete builder.

type MultiWordSchemaDeleteOne

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

MultiWordSchemaDeleteOne is the builder for deleting a single MultiWordSchema entity.

func (*MultiWordSchemaDeleteOne) Exec

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

Exec executes the deletion query.

func (*MultiWordSchemaDeleteOne) ExecX

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

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

type MultiWordSchemaGroupBy

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

MultiWordSchemaGroupBy is the group-by builder for MultiWordSchema entities.

func (*MultiWordSchemaGroupBy) Aggregate

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

func (*MultiWordSchemaGroupBy) Bool

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

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

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

func (*MultiWordSchemaGroupBy) Bools

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

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

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

func (*MultiWordSchemaGroupBy) Float64

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

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

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

func (*MultiWordSchemaGroupBy) Float64s

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

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

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

func (*MultiWordSchemaGroupBy) Int

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

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

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

func (*MultiWordSchemaGroupBy) Ints

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

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

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

func (*MultiWordSchemaGroupBy) Scan

func (mwsgb *MultiWordSchemaGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MultiWordSchemaGroupBy) ScanX

func (s *MultiWordSchemaGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MultiWordSchemaGroupBy) String

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

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

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

func (*MultiWordSchemaGroupBy) Strings

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

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

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

type MultiWordSchemaMutation

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

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

func (*MultiWordSchemaMutation) AddField

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

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

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

func (*MultiWordSchemaMutation) AddedField

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

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

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

func (*MultiWordSchemaMutation) AddedIDs

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

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

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

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

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

func (*MultiWordSchemaMutation) ClearedFields

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

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

func (MultiWordSchemaMutation) Client

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

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

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

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

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

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

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

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

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

func (m *MultiWordSchemaMutation) Op() Op

Op returns the operation name.

func (*MultiWordSchemaMutation) RemovedEdges

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

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

func (*MultiWordSchemaMutation) RemovedIDs

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

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

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

func (m *MultiWordSchemaMutation) ResetUnit()

ResetUnit resets all changes to the "unit" field.

func (*MultiWordSchemaMutation) SetField

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

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

SetUnit sets the "unit" field.

func (MultiWordSchemaMutation) Tx

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

func (m *MultiWordSchemaMutation) Type() string

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

func (*MultiWordSchemaMutation) Unit

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

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

func (*MultiWordSchemaMutation) Where

Where appends a list predicates to the MultiWordSchemaMutation builder.

type MultiWordSchemaQuery

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

MultiWordSchemaQuery is the builder for querying MultiWordSchema entities.

func (*MultiWordSchemaQuery) All

All executes the query and returns a list of MultiWordSchemas.

func (*MultiWordSchemaQuery) AllX

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

func (*MultiWordSchemaQuery) Clone

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

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

Count returns the count of the given query.

func (*MultiWordSchemaQuery) CountX

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

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

func (*MultiWordSchemaQuery) Exist

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

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

func (*MultiWordSchemaQuery) ExistX

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

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

func (*MultiWordSchemaQuery) First

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

func (*MultiWordSchemaQuery) FirstID

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

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

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

func (*MultiWordSchemaQuery) FirstX

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

func (*MultiWordSchemaQuery) GroupBy

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

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

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

func (*MultiWordSchemaQuery) IDsX

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

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

func (*MultiWordSchemaQuery) Limit

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

Limit adds a limit step to the query.

func (*MultiWordSchemaQuery) Offset

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

Offset adds an offset step to the query.

func (*MultiWordSchemaQuery) Only

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

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

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

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

func (*MultiWordSchemaQuery) OnlyX

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

func (*MultiWordSchemaQuery) Order

Order adds an order step to the query.

func (*MultiWordSchemaQuery) Select

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

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

Where adds a new predicate for the MultiWordSchemaQuery builder.

type MultiWordSchemaSelect

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

MultiWordSchemaSelect is the builder for selecting fields of MultiWordSchema entities.

func (*MultiWordSchemaSelect) Bool

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

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

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

func (*MultiWordSchemaSelect) Bools

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

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

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

func (*MultiWordSchemaSelect) Float64

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

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

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

func (*MultiWordSchemaSelect) Float64s

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

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

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

func (*MultiWordSchemaSelect) Int

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

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

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

func (*MultiWordSchemaSelect) Ints

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

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

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

func (*MultiWordSchemaSelect) Scan

func (mwss *MultiWordSchemaSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MultiWordSchemaSelect) ScanX

func (s *MultiWordSchemaSelect) ScanX(ctx context.Context, v interface{})

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

func (*MultiWordSchemaSelect) String

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

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

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

func (*MultiWordSchemaSelect) Strings

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

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

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

type MultiWordSchemaUpdate

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

MultiWordSchemaUpdate is the builder for updating MultiWordSchema entities.

func (*MultiWordSchemaUpdate) Exec

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

Exec executes the query.

func (*MultiWordSchemaUpdate) ExecX

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

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

func (*MultiWordSchemaUpdate) Mutation

Mutation returns the MultiWordSchemaMutation object of the builder.

func (*MultiWordSchemaUpdate) Save

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

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

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

func (*MultiWordSchemaUpdate) SetNillableUnit

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

func (*MultiWordSchemaUpdate) SetUnit

SetUnit sets the "unit" field.

func (*MultiWordSchemaUpdate) Where

Where appends a list predicates to the MultiWordSchemaUpdate builder.

type MultiWordSchemaUpdateOne

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

MultiWordSchemaUpdateOne is the builder for updating a single MultiWordSchema entity.

func (*MultiWordSchemaUpdateOne) Exec

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

Exec executes the query on the entity.

func (*MultiWordSchemaUpdateOne) ExecX

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

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

func (*MultiWordSchemaUpdateOne) Mutation

Mutation returns the MultiWordSchemaMutation object of the builder.

func (*MultiWordSchemaUpdateOne) Save

Save executes the query and returns the updated MultiWordSchema entity.

func (*MultiWordSchemaUpdateOne) SaveX

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

func (*MultiWordSchemaUpdateOne) Select

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

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

func (*MultiWordSchemaUpdateOne) SetUnit

SetUnit sets the "unit" field.

type MultiWordSchemas

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

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

func (ne *NilExample) String() string

String implements the fmt.Stringer.

func (*NilExample) Unwrap

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

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

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

NilExampleClient is a client for the NilExample schema.

func NewNilExampleClient

func NewNilExampleClient(c config) *NilExampleClient

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

func (*NilExampleClient) Create

func (c *NilExampleClient) Create() *NilExampleCreate

Create returns a create builder for NilExample.

func (*NilExampleClient) CreateBulk

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

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

func (*NilExampleClient) Delete

func (c *NilExampleClient) Delete() *NilExampleDelete

Delete returns a delete builder for NilExample.

func (*NilExampleClient) DeleteOne

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

DeleteOne returns a delete builder for the given entity.

func (*NilExampleClient) DeleteOneID

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

DeleteOneID returns a delete builder for the given id.

func (*NilExampleClient) Get

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

Get returns a NilExample entity by its id.

func (*NilExampleClient) GetX

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

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

func (*NilExampleClient) Hooks

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

Hooks returns the client hooks.

func (*NilExampleClient) Query

func (c *NilExampleClient) Query() *NilExampleQuery

Query returns a query builder for NilExample.

func (*NilExampleClient) Update

func (c *NilExampleClient) Update() *NilExampleUpdate

Update returns an update builder for NilExample.

func (*NilExampleClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*NilExampleClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*NilExampleClient) Use

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

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

NilExampleCreate is the builder for creating a NilExample entity.

func (*NilExampleCreate) Exec

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

Exec executes the query.

func (*NilExampleCreate) ExecX

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

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

func (*NilExampleCreate) Mutation

func (nec *NilExampleCreate) Mutation() *NilExampleMutation

Mutation returns the NilExampleMutation object of the builder.

func (*NilExampleCreate) Save

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

Save creates the NilExample in the database.

func (*NilExampleCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*NilExampleCreate) SetNillableStrNil

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

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

func (*NilExampleCreate) SetNillableTimeNil

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

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

func (*NilExampleCreate) SetStrNil

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

SetStrNil sets the "str_nil" field.

func (*NilExampleCreate) SetTimeNil

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

SetTimeNil sets the "time_nil" field.

type NilExampleCreateBulk

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

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

func (*NilExampleCreateBulk) Exec

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

Exec executes the query.

func (*NilExampleCreateBulk) ExecX

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

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

func (*NilExampleCreateBulk) Save

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

Save creates the NilExample entities in the database.

func (*NilExampleCreateBulk) SaveX

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

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

type NilExampleDelete

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

NilExampleDelete is the builder for deleting a NilExample entity.

func (*NilExampleDelete) Exec

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

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

func (*NilExampleDelete) ExecX

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

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

func (*NilExampleDelete) Where

Where appends a list predicates to the NilExampleDelete builder.

type NilExampleDeleteOne

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

NilExampleDeleteOne is the builder for deleting a single NilExample entity.

func (*NilExampleDeleteOne) Exec

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

Exec executes the deletion query.

func (*NilExampleDeleteOne) ExecX

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

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

type NilExampleGroupBy

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

NilExampleGroupBy is the group-by builder for NilExample entities.

func (*NilExampleGroupBy) Aggregate

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

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

func (*NilExampleGroupBy) Bool

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

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

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

func (*NilExampleGroupBy) Bools

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

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

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

func (*NilExampleGroupBy) Float64

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

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

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

func (*NilExampleGroupBy) Float64s

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

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

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

func (*NilExampleGroupBy) Int

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

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

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

func (*NilExampleGroupBy) Ints

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

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

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

func (*NilExampleGroupBy) Scan

func (negb *NilExampleGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*NilExampleGroupBy) ScanX

func (s *NilExampleGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*NilExampleGroupBy) String

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

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

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

func (*NilExampleGroupBy) Strings

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

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

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

type NilExampleMutation

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

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

func (*NilExampleMutation) AddField

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

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

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

func (*NilExampleMutation) AddedField

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

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

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

func (*NilExampleMutation) AddedIDs

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

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

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

func (m *NilExampleMutation) ClearStrNil()

ClearStrNil clears the value of the "str_nil" field.

func (*NilExampleMutation) ClearTimeNil

func (m *NilExampleMutation) ClearTimeNil()

ClearTimeNil clears the value of the "time_nil" field.

func (*NilExampleMutation) ClearedEdges

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

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

func (*NilExampleMutation) ClearedFields

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

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

func (NilExampleMutation) Client

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

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

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

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

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

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

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

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

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

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

func (m *NilExampleMutation) Op() Op

Op returns the operation name.

func (*NilExampleMutation) RemovedEdges

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

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

func (*NilExampleMutation) RemovedIDs

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

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

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

func (m *NilExampleMutation) ResetStrNil()

ResetStrNil resets all changes to the "str_nil" field.

func (*NilExampleMutation) ResetTimeNil

func (m *NilExampleMutation) ResetTimeNil()

ResetTimeNil resets all changes to the "time_nil" field.

func (*NilExampleMutation) SetField

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

func (m *NilExampleMutation) SetStrNil(s string)

SetStrNil sets the "str_nil" field.

func (*NilExampleMutation) SetTimeNil

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

SetTimeNil sets the "time_nil" field.

func (*NilExampleMutation) StrNil

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

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

func (*NilExampleMutation) StrNilCleared

func (m *NilExampleMutation) StrNilCleared() bool

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

func (*NilExampleMutation) TimeNil

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

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

func (*NilExampleMutation) TimeNilCleared

func (m *NilExampleMutation) TimeNilCleared() bool

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

func (NilExampleMutation) Tx

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

func (m *NilExampleMutation) Type() string

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

func (*NilExampleMutation) Where

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

Where appends a list predicates to the NilExampleMutation builder.

type NilExampleQuery

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

NilExampleQuery is the builder for querying NilExample entities.

func (*NilExampleQuery) All

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

All executes the query and returns a list of NilExamples.

func (*NilExampleQuery) AllX

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

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

func (*NilExampleQuery) Clone

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

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

Count returns the count of the given query.

func (*NilExampleQuery) CountX

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

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

func (*NilExampleQuery) Exist

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

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

func (*NilExampleQuery) ExistX

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

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

func (*NilExampleQuery) First

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

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

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

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

func (*NilExampleQuery) FirstX

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

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

func (*NilExampleQuery) GroupBy

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

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

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

func (*NilExampleQuery) IDsX

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

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

func (*NilExampleQuery) Limit

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

Limit adds a limit step to the query.

func (*NilExampleQuery) Offset

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

Offset adds an offset step to the query.

func (*NilExampleQuery) Only

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

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

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

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

func (*NilExampleQuery) OnlyX

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

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

func (*NilExampleQuery) Order

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

Order adds an order step to the query.

func (*NilExampleQuery) Select

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

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

Where adds a new predicate for the NilExampleQuery builder.

type NilExampleSelect

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

NilExampleSelect is the builder for selecting fields of NilExample entities.

func (*NilExampleSelect) Bool

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

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

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

func (*NilExampleSelect) Bools

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

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

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

func (*NilExampleSelect) Float64

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

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

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

func (*NilExampleSelect) Float64s

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

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

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

func (*NilExampleSelect) Int

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

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

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

func (*NilExampleSelect) Ints

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

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

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

func (*NilExampleSelect) Scan

func (nes *NilExampleSelect) Scan(ctx context.Context, v interface{}) error

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

func (*NilExampleSelect) ScanX

func (s *NilExampleSelect) ScanX(ctx context.Context, v interface{})

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

func (*NilExampleSelect) String

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

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

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

func (*NilExampleSelect) Strings

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

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

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

type NilExampleUpdate

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

NilExampleUpdate is the builder for updating NilExample entities.

func (*NilExampleUpdate) ClearStrNil

func (neu *NilExampleUpdate) ClearStrNil() *NilExampleUpdate

ClearStrNil clears the value of the "str_nil" field.

func (*NilExampleUpdate) ClearTimeNil

func (neu *NilExampleUpdate) ClearTimeNil() *NilExampleUpdate

ClearTimeNil clears the value of the "time_nil" field.

func (*NilExampleUpdate) Exec

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

Exec executes the query.

func (*NilExampleUpdate) ExecX

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

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

func (*NilExampleUpdate) Mutation

func (neu *NilExampleUpdate) Mutation() *NilExampleMutation

Mutation returns the NilExampleMutation object of the builder.

func (*NilExampleUpdate) Save

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

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

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

func (*NilExampleUpdate) SetNillableStrNil

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

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

func (*NilExampleUpdate) SetNillableTimeNil

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

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

func (*NilExampleUpdate) SetStrNil

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

SetStrNil sets the "str_nil" field.

func (*NilExampleUpdate) SetTimeNil

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

SetTimeNil sets the "time_nil" field.

func (*NilExampleUpdate) Where

Where appends a list predicates to the NilExampleUpdate builder.

type NilExampleUpdateOne

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

NilExampleUpdateOne is the builder for updating a single NilExample entity.

func (*NilExampleUpdateOne) ClearStrNil

func (neuo *NilExampleUpdateOne) ClearStrNil() *NilExampleUpdateOne

ClearStrNil clears the value of the "str_nil" field.

func (*NilExampleUpdateOne) ClearTimeNil

func (neuo *NilExampleUpdateOne) ClearTimeNil() *NilExampleUpdateOne

ClearTimeNil clears the value of the "time_nil" field.

func (*NilExampleUpdateOne) Exec

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

Exec executes the query on the entity.

func (*NilExampleUpdateOne) ExecX

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

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

func (*NilExampleUpdateOne) Mutation

func (neuo *NilExampleUpdateOne) Mutation() *NilExampleMutation

Mutation returns the NilExampleMutation object of the builder.

func (*NilExampleUpdateOne) Save

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

Save executes the query and returns the updated NilExample entity.

func (*NilExampleUpdateOne) SaveX

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

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

func (*NilExampleUpdateOne) Select

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

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

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

func (*NilExampleUpdateOne) SetNillableTimeNil

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

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

func (*NilExampleUpdateOne) SetStrNil

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

SetStrNil sets the "str_nil" field.

func (*NilExampleUpdateOne) SetTimeNil

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

SetTimeNil sets the "time_nil" field.

type NilExamples

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(...interface{})) 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

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

func (pe *Pet) QueryOwner() *UserQuery

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

func (*Pet) String

func (pe *Pet) String() string

String implements the fmt.Stringer.

func (*Pet) Unwrap

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

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

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

PetClient is a client for the Pet schema.

func NewPetClient

func NewPetClient(c config) *PetClient

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

func (*PetClient) Create

func (c *PetClient) Create() *PetCreate

Create returns a create builder for Pet.

func (*PetClient) CreateBulk

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

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

func (*PetClient) Delete

func (c *PetClient) Delete() *PetDelete

Delete returns a delete builder for Pet.

func (*PetClient) DeleteOne

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

DeleteOne returns a delete builder for the given entity.

func (*PetClient) DeleteOneID

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

DeleteOneID returns a delete builder for the given id.

func (*PetClient) Get

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

Get returns a Pet entity by its id.

func (*PetClient) GetX

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

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

func (*PetClient) Hooks

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

Hooks returns the client hooks.

func (*PetClient) Query

func (c *PetClient) Query() *PetQuery

Query returns a query builder for Pet.

func (*PetClient) QueryOwner

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

QueryOwner queries the owner edge of a Pet.

func (*PetClient) Update

func (c *PetClient) Update() *PetUpdate

Update returns an update builder for Pet.

func (*PetClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*PetClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*PetClient) Use

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

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

PetCreate is the builder for creating a Pet entity.

func (*PetCreate) Exec

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

Exec executes the query.

func (*PetCreate) ExecX

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

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

func (*PetCreate) Mutation

func (pc *PetCreate) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetCreate) Save

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

Save creates the Pet in the database.

func (*PetCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*PetCreate) SetNillableOwnerID

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

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

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

func (*PetCreate) SetOwnerID

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

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

type PetCreateBulk

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

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

func (*PetCreateBulk) Exec

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

Exec executes the query.

func (*PetCreateBulk) ExecX

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

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

func (*PetCreateBulk) Save

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

Save creates the Pet entities in the database.

func (*PetCreateBulk) SaveX

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

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

type PetDelete

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

PetDelete is the builder for deleting a Pet entity.

func (*PetDelete) Exec

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

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

func (*PetDelete) ExecX

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

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

func (*PetDelete) Where

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

Where appends a list predicates to the PetDelete builder.

type PetDeleteOne

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

PetDeleteOne is the builder for deleting a single Pet entity.

func (*PetDeleteOne) Exec

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

Exec executes the deletion query.

func (*PetDeleteOne) ExecX

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

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

type PetEdges

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

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

func (PetEdges) OwnerOrErr

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

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

PetGroupBy is the group-by builder for Pet entities.

func (*PetGroupBy) Aggregate

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

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

func (*PetGroupBy) Bool

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

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

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

func (*PetGroupBy) Bools

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

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

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

func (*PetGroupBy) Float64

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

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

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

func (*PetGroupBy) Float64s

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

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

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

func (*PetGroupBy) Int

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

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

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

func (*PetGroupBy) Ints

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

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

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

func (*PetGroupBy) Scan

func (pgb *PetGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*PetGroupBy) ScanX

func (s *PetGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*PetGroupBy) String

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

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

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

func (*PetGroupBy) Strings

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

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

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

type PetMutation

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

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

func (*PetMutation) AddField

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

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

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

func (*PetMutation) AddedField

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

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

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

func (*PetMutation) AddedIDs

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

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

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

func (m *PetMutation) ClearOwner()

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

func (*PetMutation) ClearedEdges

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

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

func (*PetMutation) ClearedFields

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

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

func (PetMutation) Client

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

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

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

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

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

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

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

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

func (m *PetMutation) Op() Op

Op returns the operation name.

func (*PetMutation) OwnerCleared

func (m *PetMutation) OwnerCleared() bool

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

func (*PetMutation) OwnerID

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

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

func (*PetMutation) OwnerIDs

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

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

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

func (*PetMutation) RemovedIDs

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

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

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

func (m *PetMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*PetMutation) SetField

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

func (m *PetMutation) SetOwnerID(id int)

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

func (PetMutation) Tx

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

func (m *PetMutation) Type() string

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

func (*PetMutation) Where

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

Where appends a list predicates to the PetMutation builder.

type PetQuery

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

PetQuery is the builder for querying Pet entities.

func (*PetQuery) All

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

All executes the query and returns a list of Pets.

func (*PetQuery) AllX

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

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

func (*PetQuery) Clone

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

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

Count returns the count of the given query.

func (*PetQuery) CountX

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

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

func (*PetQuery) Exist

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

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

func (*PetQuery) ExistX

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

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

func (*PetQuery) First

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

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

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

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

func (*PetQuery) FirstX

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

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

func (*PetQuery) GroupBy

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

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

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

func (*PetQuery) IDsX

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

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

func (*PetQuery) Limit

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

Limit adds a limit step to the query.

func (*PetQuery) Offset

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

Offset adds an offset step to the query.

func (*PetQuery) Only

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

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

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

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

func (*PetQuery) OnlyX

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

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

func (*PetQuery) Order

func (pq *PetQuery) Order(o ...OrderFunc) *PetQuery

Order adds an order step to the query.

func (*PetQuery) QueryOwner

func (pq *PetQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*PetQuery) Select

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

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

func (pq *PetQuery) Where(ps ...predicate.Pet) *PetQuery

Where adds a new predicate for the PetQuery builder.

func (*PetQuery) WithOwner

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

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

PetSelect is the builder for selecting fields of Pet entities.

func (*PetSelect) Bool

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

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

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

func (*PetSelect) Bools

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

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

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

func (*PetSelect) Float64

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

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

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

func (*PetSelect) Float64s

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

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

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

func (*PetSelect) Int

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

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

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

func (*PetSelect) Ints

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

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

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

func (*PetSelect) Scan

func (ps *PetSelect) Scan(ctx context.Context, v interface{}) error

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

func (*PetSelect) ScanX

func (s *PetSelect) ScanX(ctx context.Context, v interface{})

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

func (*PetSelect) String

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

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

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

func (*PetSelect) Strings

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

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

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

type PetUpdate

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

PetUpdate is the builder for updating Pet entities.

func (*PetUpdate) ClearOwner

func (pu *PetUpdate) ClearOwner() *PetUpdate

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

func (*PetUpdate) Exec

func (pu *PetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PetUpdate) ExecX

func (pu *PetUpdate) ExecX(ctx context.Context)

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

func (*PetUpdate) Mutation

func (pu *PetUpdate) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetUpdate) Save

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

func (pu *PetUpdate) SaveX(ctx context.Context) int

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

func (*PetUpdate) SetNillableOwnerID

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

func (pu *PetUpdate) SetOwner(u *User) *PetUpdate

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

func (*PetUpdate) SetOwnerID

func (pu *PetUpdate) SetOwnerID(id int) *PetUpdate

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

func (*PetUpdate) Where

func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate

Where appends a list predicates to the PetUpdate builder.

type PetUpdateOne

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

PetUpdateOne is the builder for updating a single Pet entity.

func (*PetUpdateOne) ClearOwner

func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne

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

func (*PetUpdateOne) Exec

func (puo *PetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PetUpdateOne) ExecX

func (puo *PetUpdateOne) ExecX(ctx context.Context)

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

func (*PetUpdateOne) Mutation

func (puo *PetUpdateOne) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetUpdateOne) Save

func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)

Save executes the query and returns the updated Pet entity.

func (*PetUpdateOne) SaveX

func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet

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

func (*PetUpdateOne) Select

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

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

func (puo *PetUpdateOne) SetOwner(u *User) *PetUpdateOne

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

func (*PetUpdateOne) SetOwnerID

func (puo *PetUpdateOne) SetOwnerID(id int) *PetUpdateOne

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

type Pets

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

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

func (see *SkipEdgeExample) QueryUser() *UserQuery

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

func (*SkipEdgeExample) String

func (see *SkipEdgeExample) String() string

String implements the fmt.Stringer.

func (*SkipEdgeExample) Unwrap

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

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

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

SkipEdgeExampleClient is a client for the SkipEdgeExample schema.

func NewSkipEdgeExampleClient

func NewSkipEdgeExampleClient(c config) *SkipEdgeExampleClient

NewSkipEdgeExampleClient returns a client for the SkipEdgeExample from the given config.

func (*SkipEdgeExampleClient) Create

Create returns a create builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) CreateBulk

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

func (*SkipEdgeExampleClient) Delete

Delete returns a delete builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*SkipEdgeExampleClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*SkipEdgeExampleClient) Get

Get returns a SkipEdgeExample entity by its id.

func (*SkipEdgeExampleClient) GetX

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

func (*SkipEdgeExampleClient) Hooks

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

Hooks returns the client hooks.

func (*SkipEdgeExampleClient) Query

Query returns a query builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) QueryUser

func (c *SkipEdgeExampleClient) QueryUser(see *SkipEdgeExample) *UserQuery

QueryUser queries the user edge of a SkipEdgeExample.

func (*SkipEdgeExampleClient) Update

Update returns an update builder for SkipEdgeExample.

func (*SkipEdgeExampleClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SkipEdgeExampleClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*SkipEdgeExampleClient) Use

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

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

SkipEdgeExampleCreate is the builder for creating a SkipEdgeExample entity.

func (*SkipEdgeExampleCreate) Exec

func (seec *SkipEdgeExampleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SkipEdgeExampleCreate) ExecX

func (seec *SkipEdgeExampleCreate) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleCreate) Mutation

Mutation returns the SkipEdgeExampleMutation object of the builder.

func (*SkipEdgeExampleCreate) Save

Save creates the SkipEdgeExample in the database.

func (*SkipEdgeExampleCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SkipEdgeExampleCreate) SetNillableUserID

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

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

func (*SkipEdgeExampleCreate) SetUserID

func (seec *SkipEdgeExampleCreate) SetUserID(id int) *SkipEdgeExampleCreate

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

type SkipEdgeExampleCreateBulk

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

SkipEdgeExampleCreateBulk is the builder for creating many SkipEdgeExample entities in bulk.

func (*SkipEdgeExampleCreateBulk) Exec

Exec executes the query.

func (*SkipEdgeExampleCreateBulk) ExecX

func (seecb *SkipEdgeExampleCreateBulk) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleCreateBulk) Save

Save creates the SkipEdgeExample entities in the database.

func (*SkipEdgeExampleCreateBulk) SaveX

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

type SkipEdgeExampleDelete

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

SkipEdgeExampleDelete is the builder for deleting a SkipEdgeExample entity.

func (*SkipEdgeExampleDelete) Exec

func (seed *SkipEdgeExampleDelete) Exec(ctx context.Context) (int, error)

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

func (*SkipEdgeExampleDelete) ExecX

func (seed *SkipEdgeExampleDelete) ExecX(ctx context.Context) int

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

func (*SkipEdgeExampleDelete) Where

Where appends a list predicates to the SkipEdgeExampleDelete builder.

type SkipEdgeExampleDeleteOne

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

SkipEdgeExampleDeleteOne is the builder for deleting a single SkipEdgeExample entity.

func (*SkipEdgeExampleDeleteOne) Exec

func (seedo *SkipEdgeExampleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SkipEdgeExampleDeleteOne) ExecX

func (seedo *SkipEdgeExampleDeleteOne) ExecX(ctx context.Context)

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

type SkipEdgeExampleEdges

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

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

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

SkipEdgeExampleGroupBy is the group-by builder for SkipEdgeExample entities.

func (*SkipEdgeExampleGroupBy) Aggregate

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

func (*SkipEdgeExampleGroupBy) Bool

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

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

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

func (*SkipEdgeExampleGroupBy) Bools

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

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

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

func (*SkipEdgeExampleGroupBy) Float64

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

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

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

func (*SkipEdgeExampleGroupBy) Float64s

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

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

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

func (*SkipEdgeExampleGroupBy) Int

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

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

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

func (*SkipEdgeExampleGroupBy) Ints

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

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

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

func (*SkipEdgeExampleGroupBy) Scan

func (seegb *SkipEdgeExampleGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SkipEdgeExampleGroupBy) ScanX

func (s *SkipEdgeExampleGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SkipEdgeExampleGroupBy) String

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

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

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

func (*SkipEdgeExampleGroupBy) Strings

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

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

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

type SkipEdgeExampleMutation

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

SkipEdgeExampleMutation represents an operation that mutates the SkipEdgeExample nodes in the graph.

func (*SkipEdgeExampleMutation) AddField

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

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

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

func (*SkipEdgeExampleMutation) AddedField

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

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

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

func (*SkipEdgeExampleMutation) AddedIDs

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

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

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

func (m *SkipEdgeExampleMutation) ClearUser()

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

func (*SkipEdgeExampleMutation) ClearedEdges

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

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

func (*SkipEdgeExampleMutation) ClearedFields

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

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

func (SkipEdgeExampleMutation) Client

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

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

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

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

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

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

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

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

func (m *SkipEdgeExampleMutation) Op() Op

Op returns the operation name.

func (*SkipEdgeExampleMutation) RemovedEdges

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

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

func (*SkipEdgeExampleMutation) RemovedIDs

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

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

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

func (m *SkipEdgeExampleMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SkipEdgeExampleMutation) SetField

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

func (m *SkipEdgeExampleMutation) SetUserID(id int)

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

func (SkipEdgeExampleMutation) Tx

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

func (m *SkipEdgeExampleMutation) Type() string

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

func (*SkipEdgeExampleMutation) UserCleared

func (m *SkipEdgeExampleMutation) UserCleared() bool

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

func (*SkipEdgeExampleMutation) UserID

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

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

func (*SkipEdgeExampleMutation) UserIDs

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

Where appends a list predicates to the SkipEdgeExampleMutation builder.

type SkipEdgeExampleQuery

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

SkipEdgeExampleQuery is the builder for querying SkipEdgeExample entities.

func (*SkipEdgeExampleQuery) All

All executes the query and returns a list of SkipEdgeExamples.

func (*SkipEdgeExampleQuery) AllX

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

func (*SkipEdgeExampleQuery) Clone

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

func (seeq *SkipEdgeExampleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SkipEdgeExampleQuery) CountX

func (seeq *SkipEdgeExampleQuery) CountX(ctx context.Context) int

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

func (*SkipEdgeExampleQuery) Exist

func (seeq *SkipEdgeExampleQuery) Exist(ctx context.Context) (bool, error)

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

func (*SkipEdgeExampleQuery) ExistX

func (seeq *SkipEdgeExampleQuery) ExistX(ctx context.Context) bool

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

func (*SkipEdgeExampleQuery) First

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

func (*SkipEdgeExampleQuery) FirstID

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

func (seeq *SkipEdgeExampleQuery) FirstIDX(ctx context.Context) int

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

func (*SkipEdgeExampleQuery) FirstX

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

func (*SkipEdgeExampleQuery) GroupBy

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

func (seeq *SkipEdgeExampleQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SkipEdgeExampleQuery) IDsX

func (seeq *SkipEdgeExampleQuery) IDsX(ctx context.Context) []int

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

func (*SkipEdgeExampleQuery) Limit

func (seeq *SkipEdgeExampleQuery) Limit(limit int) *SkipEdgeExampleQuery

Limit adds a limit step to the query.

func (*SkipEdgeExampleQuery) Offset

func (seeq *SkipEdgeExampleQuery) Offset(offset int) *SkipEdgeExampleQuery

Offset adds an offset step to the query.

func (*SkipEdgeExampleQuery) Only

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

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

func (seeq *SkipEdgeExampleQuery) OnlyIDX(ctx context.Context) int

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

func (*SkipEdgeExampleQuery) OnlyX

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

func (*SkipEdgeExampleQuery) Order

Order adds an order step to the query.

func (*SkipEdgeExampleQuery) QueryUser

func (seeq *SkipEdgeExampleQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SkipEdgeExampleQuery) Select

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

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

Where adds a new predicate for the SkipEdgeExampleQuery builder.

func (*SkipEdgeExampleQuery) WithUser

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

type SkipEdgeExampleSelect struct {
	*SkipEdgeExampleQuery
	// contains filtered or unexported fields
}

SkipEdgeExampleSelect is the builder for selecting fields of SkipEdgeExample entities.

func (*SkipEdgeExampleSelect) Bool

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

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

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

func (*SkipEdgeExampleSelect) Bools

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

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

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

func (*SkipEdgeExampleSelect) Float64

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

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

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

func (*SkipEdgeExampleSelect) Float64s

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

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

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

func (*SkipEdgeExampleSelect) Int

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

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

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

func (*SkipEdgeExampleSelect) Ints

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

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

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

func (*SkipEdgeExampleSelect) Scan

func (sees *SkipEdgeExampleSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SkipEdgeExampleSelect) ScanX

func (s *SkipEdgeExampleSelect) ScanX(ctx context.Context, v interface{})

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

func (*SkipEdgeExampleSelect) String

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

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

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

func (*SkipEdgeExampleSelect) Strings

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

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

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

type SkipEdgeExampleUpdate

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

SkipEdgeExampleUpdate is the builder for updating SkipEdgeExample entities.

func (*SkipEdgeExampleUpdate) ClearUser

func (seeu *SkipEdgeExampleUpdate) ClearUser() *SkipEdgeExampleUpdate

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

func (*SkipEdgeExampleUpdate) Exec

func (seeu *SkipEdgeExampleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SkipEdgeExampleUpdate) ExecX

func (seeu *SkipEdgeExampleUpdate) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleUpdate) Mutation

Mutation returns the SkipEdgeExampleMutation object of the builder.

func (*SkipEdgeExampleUpdate) Save

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

func (seeu *SkipEdgeExampleUpdate) SaveX(ctx context.Context) int

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

func (*SkipEdgeExampleUpdate) SetNillableUserID

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

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

func (*SkipEdgeExampleUpdate) SetUserID

func (seeu *SkipEdgeExampleUpdate) SetUserID(id int) *SkipEdgeExampleUpdate

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

func (*SkipEdgeExampleUpdate) Where

Where appends a list predicates to the SkipEdgeExampleUpdate builder.

type SkipEdgeExampleUpdateOne

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

SkipEdgeExampleUpdateOne is the builder for updating a single SkipEdgeExample entity.

func (*SkipEdgeExampleUpdateOne) ClearUser

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

func (*SkipEdgeExampleUpdateOne) Exec

func (seeuo *SkipEdgeExampleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SkipEdgeExampleUpdateOne) ExecX

func (seeuo *SkipEdgeExampleUpdateOne) ExecX(ctx context.Context)

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

func (*SkipEdgeExampleUpdateOne) Mutation

Mutation returns the SkipEdgeExampleMutation object of the builder.

func (*SkipEdgeExampleUpdateOne) Save

Save executes the query and returns the updated SkipEdgeExample entity.

func (*SkipEdgeExampleUpdateOne) SaveX

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

func (*SkipEdgeExampleUpdateOne) Select

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

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

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

func (*SkipEdgeExampleUpdateOne) SetUserID

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

type SkipEdgeExamples

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 create builder for Todo.

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 delete builder for the given entity.

func (*TodoClient) DeleteOneID

func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne

DeleteOneID returns a delete builder for the given 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

func (tc *TodoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreate) ExecX

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

func (tcb *TodoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreateBulk) ExecX

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 interface{}) 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 interface{})

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

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

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 interface{}) 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 interface{})

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
	// 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"`
	// 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

func (u *User) QueryPet() *PetQuery

QueryPet queries the "pet" edge of the User entity.

func (*User) QueryReceived1

func (u *User) QueryReceived1() *AttachmentQuery

QueryReceived1 queries the "received_1" edge of the User entity.

func (*User) QuerySkipEdge

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 create builder for User.

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 delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given 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

func (c *UserClient) QueryPet(u *User) *PetQuery

QueryPet queries the pet edge of a User.

func (*UserClient) QueryReceived1

func (c *UserClient) QueryReceived1(u *User) *AttachmentQuery

QueryReceived1 queries the received_1 edge of a User.

func (*UserClient) QuerySkipEdge

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

func (uc *UserCreate) AddReceived1(a ...*Attachment) *UserCreate

AddReceived1 adds the "received_1" edges to the Attachment entity.

func (*UserCreate) AddReceived1IDs

func (uc *UserCreate) AddReceived1IDs(ids ...uuid.UUID) *UserCreate

AddReceived1IDs adds the "received_1" edge to the Attachment entity by IDs.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAccountBalance

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

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

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

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

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

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

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

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

func (uc *UserCreate) SetNillableType(s *string) *UserCreate

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

func (*UserCreate) SetNillableUnnecessary

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

func (uc *UserCreate) SetPet(p *Pet) *UserCreate

SetPet sets the "pet" edge to the Pet entity.

func (*UserCreate) SetPetID

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

func (uc *UserCreate) SetSkipEdge(s *SkipEdgeExample) *UserCreate

SetSkipEdge sets the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserCreate) SetSkipEdgeID

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

func (uc *UserCreate) SetType(s string) *UserCreate

SetType sets the "type" field.

func (*UserCreate) SetUnnecessary

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

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

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

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

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

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 interface{}) 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 interface{})

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

func (m *UserMutation) AccountBalance() (r float64, exists bool)

AccountBalance returns the value of the "account_balance" field in the mutation.

func (*UserMutation) AddAccountBalance

func (m *UserMutation) AddAccountBalance(f float64)

AddAccountBalance adds f to the "account_balance" field.

func (*UserMutation) AddBUser1

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

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

func (m *UserMutation) AddReceived1IDs(ids ...uuid.UUID)

AddReceived1IDs adds the "received_1" edge to the Attachment entity by ids.

func (*UserMutation) AddedAccountBalance

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

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

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

func (m *UserMutation) BUser1() (r int, exists bool)

BUser1 returns the value of the "b_user_1" field in the mutation.

func (*UserMutation) BUser1Cleared

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

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

func (m *UserMutation) ClearPet()

ClearPet clears the "pet" edge to the Pet entity.

func (*UserMutation) ClearReceived1

func (m *UserMutation) ClearReceived1()

ClearReceived1 clears the "received_1" edge to the Attachment entity.

func (*UserMutation) ClearSkipEdge

func (m *UserMutation) ClearSkipEdge()

ClearSkipEdge clears the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserMutation) ClearType

func (m *UserMutation) ClearType()

ClearType clears the value of the "type" field.

func (*UserMutation) ClearUnnecessary

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

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

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

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

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

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

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

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

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

func (m *UserMutation) PetCleared() bool

PetCleared reports if the "pet" edge to the Pet entity was cleared.

func (*UserMutation) PetID

func (m *UserMutation) PetID() (id int, exists bool)

PetID returns the "pet" edge ID in the mutation.

func (*UserMutation) PetIDs

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

func (m *UserMutation) Received1Cleared() bool

Received1Cleared reports if the "received_1" edge to the Attachment entity was cleared.

func (*UserMutation) Received1IDs

func (m *UserMutation) Received1IDs() (ids []uuid.UUID)

Received1IDs returns the "received_1" edge IDs in the mutation.

func (*UserMutation) RemoveReceived1IDs

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

func (m *UserMutation) RemovedReceived1IDs() (ids []uuid.UUID)

RemovedReceived1 returns the removed IDs of the "received_1" edge to the Attachment entity.

func (*UserMutation) ResetAccountBalance

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

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

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

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

func (m *UserMutation) ResetReceived1()

ResetReceived1 resets all changes to the "received_1" edge.

func (*UserMutation) ResetSkipEdge

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

func (m *UserMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*UserMutation) ResetUnnecessary

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

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

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

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

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

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

func (m *UserMutation) SetType(s string)

SetType sets the "type" field.

func (*UserMutation) SetUnnecessary

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

func (m *UserMutation) SkipEdgeCleared() bool

SkipEdgeCleared reports if the "skip_edge" edge to the SkipEdgeExample entity was cleared.

func (*UserMutation) SkipEdgeID

func (m *UserMutation) SkipEdgeID() (id int, exists bool)

SkipEdgeID returns the "skip_edge" edge ID in the mutation.

func (*UserMutation) SkipEdgeIDs

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

func (m *UserMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*UserMutation) Unnecessary

func (m *UserMutation) Unnecessary() (r string, exists bool)

Unnecessary returns the value of the "unnecessary" field in the mutation.

func (*UserMutation) UnnecessaryCleared

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

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

func (uq *UserQuery) QueryPet() *PetQuery

QueryPet chains the current query on the "pet" edge.

func (*UserQuery) QueryReceived1

func (uq *UserQuery) QueryReceived1() *AttachmentQuery

QueryReceived1 chains the current query on the "received_1" edge.

func (*UserQuery) QuerySkipEdge

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

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

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

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 interface{}) 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 interface{})

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

func (uu *UserUpdate) AddAccountBalance(f float64) *UserUpdate

AddAccountBalance adds f to the "account_balance" field.

func (*UserUpdate) AddBUser1

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

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

func (uu *UserUpdate) AddReceived1(a ...*Attachment) *UserUpdate

AddReceived1 adds the "received_1" edges to the Attachment entity.

func (*UserUpdate) AddReceived1IDs

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

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

func (uu *UserUpdate) ClearPet() *UserUpdate

ClearPet clears the "pet" edge to the Pet entity.

func (*UserUpdate) ClearReceived1

func (uu *UserUpdate) ClearReceived1() *UserUpdate

ClearReceived1 clears all "received_1" edges to the Attachment entity.

func (*UserUpdate) ClearSkipEdge

func (uu *UserUpdate) ClearSkipEdge() *UserUpdate

ClearSkipEdge clears the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdate) ClearType

func (uu *UserUpdate) ClearType() *UserUpdate

ClearType clears the value of the "type" field.

func (*UserUpdate) ClearUnnecessary

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

func (uu *UserUpdate) RemoveReceived1(a ...*Attachment) *UserUpdate

RemoveReceived1 removes "received_1" edges to Attachment entities.

func (*UserUpdate) RemoveReceived1IDs

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

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

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

func (uu *UserUpdate) SetHeightInCm(f float32) *UserUpdate

SetHeightInCm sets the "height_in_cm" field.

func (*UserUpdate) SetNillableAccountBalance

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

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

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

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

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

func (uu *UserUpdate) SetNillableType(s *string) *UserUpdate

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

func (*UserUpdate) SetNillableUnnecessary

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

func (uu *UserUpdate) SetPet(p *Pet) *UserUpdate

SetPet sets the "pet" edge to the Pet entity.

func (*UserUpdate) SetPetID

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

func (uu *UserUpdate) SetSkipEdge(s *SkipEdgeExample) *UserUpdate

SetSkipEdge sets the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdate) SetSkipEdgeID

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

func (uu *UserUpdate) SetType(s string) *UserUpdate

SetType sets the "type" field.

func (*UserUpdate) SetUnnecessary

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

func (uuo *UserUpdateOne) AddAccountBalance(f float64) *UserUpdateOne

AddAccountBalance adds f to the "account_balance" field.

func (*UserUpdateOne) AddBUser1

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

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

func (uuo *UserUpdateOne) AddReceived1(a ...*Attachment) *UserUpdateOne

AddReceived1 adds the "received_1" edges to the Attachment entity.

func (*UserUpdateOne) AddReceived1IDs

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

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

func (uuo *UserUpdateOne) ClearPet() *UserUpdateOne

ClearPet clears the "pet" edge to the Pet entity.

func (*UserUpdateOne) ClearReceived1

func (uuo *UserUpdateOne) ClearReceived1() *UserUpdateOne

ClearReceived1 clears all "received_1" edges to the Attachment entity.

func (*UserUpdateOne) ClearSkipEdge

func (uuo *UserUpdateOne) ClearSkipEdge() *UserUpdateOne

ClearSkipEdge clears the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdateOne) ClearType

func (uuo *UserUpdateOne) ClearType() *UserUpdateOne

ClearType clears the value of the "type" field.

func (*UserUpdateOne) ClearUnnecessary

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

func (uuo *UserUpdateOne) RemoveReceived1(a ...*Attachment) *UserUpdateOne

RemoveReceived1 removes "received_1" edges to Attachment entities.

func (*UserUpdateOne) RemoveReceived1IDs

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

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

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

func (uuo *UserUpdateOne) SetHeightInCm(f float32) *UserUpdateOne

SetHeightInCm sets the "height_in_cm" field.

func (*UserUpdateOne) SetNillableAccountBalance

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

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

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

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

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

func (uuo *UserUpdateOne) SetNillableType(s *string) *UserUpdateOne

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

func (*UserUpdateOne) SetNillableUnnecessary

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

func (uuo *UserUpdateOne) SetPet(p *Pet) *UserUpdateOne

SetPet sets the "pet" edge to the Pet entity.

func (*UserUpdateOne) SetPetID

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

func (uuo *UserUpdateOne) SetSkipEdge(s *SkipEdgeExample) *UserUpdateOne

SetSkipEdge sets the "skip_edge" edge to the SkipEdgeExample entity.

func (*UserUpdateOne) SetSkipEdgeID

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

func (uuo *UserUpdateOne) SetType(s string) *UserUpdateOne

SetType sets the "type" field.

func (*UserUpdateOne) SetUnnecessary

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