ent

package
v0.0.0-...-11b8a5d Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0 Imports: 25 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.
	TypeInteraction = "Interaction"
	TypePool        = "Pool"
	TypePoolPass    = "PoolPass"
	TypeRole        = "Role"
	TypeSqueak      = "Squeak"
	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 Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Interaction is the client for interacting with the Interaction builders.
	Interaction *InteractionClient
	// Pool is the client for interacting with the Pool builders.
	Pool *PoolClient
	// PoolPass is the client for interacting with the PoolPass builders.
	PoolPass *PoolPassClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Squeak is the client for interacting with the Squeak builders.
	Squeak *SqueakClient
	// 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().
	Interaction.
	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 Hook

type Hook = ent.Hook

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

type Interaction

type Interaction struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// Type holds the value of the "type" field.
	Type enums.Interaction `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InteractionQuery when eager-loading is set.
	Edges InteractionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Interaction is the model entity for the Interaction schema.

func (*Interaction) QuerySqueak

func (i *Interaction) QuerySqueak() *SqueakQuery

QuerySqueak queries the "squeak" edge of the Interaction entity.

func (*Interaction) QueryUser

func (i *Interaction) QueryUser() *UserQuery

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

func (*Interaction) String

func (i *Interaction) String() string

String implements the fmt.Stringer.

func (*Interaction) Unwrap

func (i *Interaction) Unwrap() *Interaction

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

func (i *Interaction) Update() *InteractionUpdateOne

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

type InteractionClient

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

InteractionClient is a client for the Interaction schema.

func NewInteractionClient

func NewInteractionClient(c config) *InteractionClient

NewInteractionClient returns a client for the Interaction from the given config.

func (*InteractionClient) Create

func (c *InteractionClient) Create() *InteractionCreate

Create returns a builder for creating a Interaction entity.

func (*InteractionClient) CreateBulk

func (c *InteractionClient) CreateBulk(builders ...*InteractionCreate) *InteractionCreateBulk

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

func (*InteractionClient) Delete

func (c *InteractionClient) Delete() *InteractionDelete

Delete returns a delete builder for Interaction.

func (*InteractionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InteractionClient) DeleteOneID

func (c *InteractionClient) DeleteOneID(id int) *InteractionDeleteOne

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

func (*InteractionClient) Get

func (c *InteractionClient) Get(ctx context.Context, id int) (*Interaction, error)

Get returns a Interaction entity by its id.

func (*InteractionClient) GetX

func (c *InteractionClient) GetX(ctx context.Context, id int) *Interaction

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

func (*InteractionClient) Hooks

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

Hooks returns the client hooks.

func (*InteractionClient) Query

func (c *InteractionClient) Query() *InteractionQuery

Query returns a query builder for Interaction.

func (*InteractionClient) QuerySqueak

func (c *InteractionClient) QuerySqueak(i *Interaction) *SqueakQuery

QuerySqueak queries the squeak edge of a Interaction.

func (*InteractionClient) QueryUser

func (c *InteractionClient) QueryUser(i *Interaction) *UserQuery

QueryUser queries the user edge of a Interaction.

func (*InteractionClient) Update

func (c *InteractionClient) Update() *InteractionUpdate

Update returns an update builder for Interaction.

func (*InteractionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InteractionClient) UpdateOneID

func (c *InteractionClient) UpdateOneID(id int) *InteractionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InteractionClient) Use

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

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

type InteractionCreate

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

InteractionCreate is the builder for creating a Interaction entity.

func (*InteractionCreate) Exec

func (ic *InteractionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InteractionCreate) ExecX

func (ic *InteractionCreate) ExecX(ctx context.Context)

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

func (*InteractionCreate) Mutation

func (ic *InteractionCreate) Mutation() *InteractionMutation

Mutation returns the InteractionMutation object of the builder.

func (*InteractionCreate) Save

Save creates the Interaction in the database.

func (*InteractionCreate) SaveX

func (ic *InteractionCreate) SaveX(ctx context.Context) *Interaction

SaveX calls Save and panics if Save returns an error.

func (*InteractionCreate) SetCreateTime

func (ic *InteractionCreate) SetCreateTime(t time.Time) *InteractionCreate

SetCreateTime sets the "create_time" field.

func (*InteractionCreate) SetNillableCreateTime

func (ic *InteractionCreate) SetNillableCreateTime(t *time.Time) *InteractionCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*InteractionCreate) SetNillableSqueakID

func (ic *InteractionCreate) SetNillableSqueakID(id *int) *InteractionCreate

SetNillableSqueakID sets the "squeak" edge to the Squeak entity by ID if the given value is not nil.

func (*InteractionCreate) SetNillableUserID

func (ic *InteractionCreate) SetNillableUserID(id *int) *InteractionCreate

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

func (*InteractionCreate) SetSqueak

func (ic *InteractionCreate) SetSqueak(s *Squeak) *InteractionCreate

SetSqueak sets the "squeak" edge to the Squeak entity.

func (*InteractionCreate) SetSqueakID

func (ic *InteractionCreate) SetSqueakID(id int) *InteractionCreate

SetSqueakID sets the "squeak" edge to the Squeak entity by ID.

func (*InteractionCreate) SetType

SetType sets the "type" field.

func (*InteractionCreate) SetUser

func (ic *InteractionCreate) SetUser(u *User) *InteractionCreate

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

func (*InteractionCreate) SetUserID

func (ic *InteractionCreate) SetUserID(id int) *InteractionCreate

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

type InteractionCreateBulk

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

InteractionCreateBulk is the builder for creating many Interaction entities in bulk.

func (*InteractionCreateBulk) Exec

func (icb *InteractionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*InteractionCreateBulk) ExecX

func (icb *InteractionCreateBulk) ExecX(ctx context.Context)

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

func (*InteractionCreateBulk) Save

func (icb *InteractionCreateBulk) Save(ctx context.Context) ([]*Interaction, error)

Save creates the Interaction entities in the database.

func (*InteractionCreateBulk) SaveX

func (icb *InteractionCreateBulk) SaveX(ctx context.Context) []*Interaction

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

type InteractionDelete

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

InteractionDelete is the builder for deleting a Interaction entity.

func (*InteractionDelete) Exec

func (id *InteractionDelete) Exec(ctx context.Context) (int, error)

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

func (*InteractionDelete) ExecX

func (id *InteractionDelete) ExecX(ctx context.Context) int

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

func (*InteractionDelete) Where

Where appends a list predicates to the InteractionDelete builder.

type InteractionDeleteOne

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

InteractionDeleteOne is the builder for deleting a single Interaction entity.

func (*InteractionDeleteOne) Exec

func (ido *InteractionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InteractionDeleteOne) ExecX

func (ido *InteractionDeleteOne) ExecX(ctx context.Context)

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

type InteractionEdges

type InteractionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Squeak holds the value of the squeak edge.
	Squeak *Squeak `json:"squeak,omitempty"`
	// contains filtered or unexported fields
}

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

func (InteractionEdges) SqueakOrErr

func (e InteractionEdges) SqueakOrErr() (*Squeak, error)

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

func (InteractionEdges) UserOrErr

func (e InteractionEdges) 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 InteractionGroupBy

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

InteractionGroupBy is the group-by builder for Interaction entities.

func (*InteractionGroupBy) Aggregate

func (igb *InteractionGroupBy) Aggregate(fns ...AggregateFunc) *InteractionGroupBy

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

func (*InteractionGroupBy) Bool

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

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

func (*InteractionGroupBy) BoolX

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

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

func (*InteractionGroupBy) Bools

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

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

func (*InteractionGroupBy) BoolsX

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

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

func (*InteractionGroupBy) Float64

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

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

func (*InteractionGroupBy) Float64X

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

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

func (*InteractionGroupBy) Float64s

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

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

func (*InteractionGroupBy) Float64sX

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

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

func (*InteractionGroupBy) Int

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

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

func (*InteractionGroupBy) IntX

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

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

func (*InteractionGroupBy) Ints

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

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

func (*InteractionGroupBy) IntsX

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

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

func (*InteractionGroupBy) Scan

func (igb *InteractionGroupBy) Scan(ctx context.Context, v any) error

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

func (*InteractionGroupBy) ScanX

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

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

func (*InteractionGroupBy) String

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

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

func (*InteractionGroupBy) StringX

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

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

func (*InteractionGroupBy) Strings

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

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

func (*InteractionGroupBy) StringsX

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

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

type InteractionMutation

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

InteractionMutation represents an operation that mutates the Interaction nodes in the graph.

func (*InteractionMutation) AddField

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

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

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

func (*InteractionMutation) AddedField

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

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

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

func (*InteractionMutation) AddedIDs

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

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

func (*InteractionMutation) ClearEdge

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

func (m *InteractionMutation) 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 (*InteractionMutation) ClearSqueak

func (m *InteractionMutation) ClearSqueak()

ClearSqueak clears the "squeak" edge to the Squeak entity.

func (*InteractionMutation) ClearUser

func (m *InteractionMutation) ClearUser()

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

func (*InteractionMutation) ClearedEdges

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

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

func (*InteractionMutation) ClearedFields

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

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

func (InteractionMutation) Client

func (m InteractionMutation) 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 (*InteractionMutation) CreateTime

func (m *InteractionMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*InteractionMutation) EdgeCleared

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

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

func (*InteractionMutation) Field

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

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

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

func (*InteractionMutation) Fields

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

func (m *InteractionMutation) GetType() (r enums.Interaction, exists bool)

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

func (*InteractionMutation) ID

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

func (m *InteractionMutation) 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 (*InteractionMutation) OldCreateTime

func (m *InteractionMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*InteractionMutation) OldField

func (m *InteractionMutation) 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 (*InteractionMutation) OldType

func (m *InteractionMutation) OldType(ctx context.Context) (v enums.Interaction, err error)

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

func (*InteractionMutation) Op

func (m *InteractionMutation) Op() Op

Op returns the operation name.

func (*InteractionMutation) RemovedEdges

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

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

func (*InteractionMutation) RemovedIDs

func (m *InteractionMutation) 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 (*InteractionMutation) ResetCreateTime

func (m *InteractionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*InteractionMutation) ResetEdge

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

func (m *InteractionMutation) 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 (*InteractionMutation) ResetSqueak

func (m *InteractionMutation) ResetSqueak()

ResetSqueak resets all changes to the "squeak" edge.

func (*InteractionMutation) ResetType

func (m *InteractionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*InteractionMutation) ResetUser

func (m *InteractionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*InteractionMutation) SetCreateTime

func (m *InteractionMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*InteractionMutation) SetField

func (m *InteractionMutation) 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 (*InteractionMutation) SetSqueakID

func (m *InteractionMutation) SetSqueakID(id int)

SetSqueakID sets the "squeak" edge to the Squeak entity by id.

func (*InteractionMutation) SetType

func (m *InteractionMutation) SetType(e enums.Interaction)

SetType sets the "type" field.

func (*InteractionMutation) SetUserID

func (m *InteractionMutation) SetUserID(id int)

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

func (*InteractionMutation) SqueakCleared

func (m *InteractionMutation) SqueakCleared() bool

SqueakCleared reports if the "squeak" edge to the Squeak entity was cleared.

func (*InteractionMutation) SqueakID

func (m *InteractionMutation) SqueakID() (id int, exists bool)

SqueakID returns the "squeak" edge ID in the mutation.

func (*InteractionMutation) SqueakIDs

func (m *InteractionMutation) SqueakIDs() (ids []int)

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

func (InteractionMutation) Tx

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

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

func (*InteractionMutation) Type

func (m *InteractionMutation) Type() string

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

func (*InteractionMutation) UserCleared

func (m *InteractionMutation) UserCleared() bool

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

func (*InteractionMutation) UserID

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

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

func (*InteractionMutation) UserIDs

func (m *InteractionMutation) 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 (*InteractionMutation) Where

func (m *InteractionMutation) Where(ps ...predicate.Interaction)

Where appends a list predicates to the InteractionMutation builder.

type InteractionQuery

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

InteractionQuery is the builder for querying Interaction entities.

func (*InteractionQuery) Aggregate

func (iq *InteractionQuery) Aggregate(fns ...AggregateFunc) *InteractionSelect

Aggregate returns a InteractionSelect configured with the given aggregations.

func (*InteractionQuery) All

func (iq *InteractionQuery) All(ctx context.Context) ([]*Interaction, error)

All executes the query and returns a list of Interactions.

func (*InteractionQuery) AllX

func (iq *InteractionQuery) AllX(ctx context.Context) []*Interaction

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

func (*InteractionQuery) Clone

func (iq *InteractionQuery) Clone() *InteractionQuery

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

func (*InteractionQuery) Count

func (iq *InteractionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InteractionQuery) CountX

func (iq *InteractionQuery) CountX(ctx context.Context) int

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

func (*InteractionQuery) Exist

func (iq *InteractionQuery) Exist(ctx context.Context) (bool, error)

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

func (*InteractionQuery) ExistX

func (iq *InteractionQuery) ExistX(ctx context.Context) bool

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

func (*InteractionQuery) First

func (iq *InteractionQuery) First(ctx context.Context) (*Interaction, error)

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

func (*InteractionQuery) FirstID

func (iq *InteractionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*InteractionQuery) FirstIDX

func (iq *InteractionQuery) FirstIDX(ctx context.Context) int

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

func (*InteractionQuery) FirstX

func (iq *InteractionQuery) FirstX(ctx context.Context) *Interaction

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

func (*InteractionQuery) GroupBy

func (iq *InteractionQuery) GroupBy(field string, fields ...string) *InteractionGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Interaction.Query().
	GroupBy(interaction.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InteractionQuery) IDs

func (iq *InteractionQuery) IDs(ctx context.Context) ([]int, error)

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

func (*InteractionQuery) IDsX

func (iq *InteractionQuery) IDsX(ctx context.Context) []int

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

func (*InteractionQuery) Limit

func (iq *InteractionQuery) Limit(limit int) *InteractionQuery

Limit adds a limit step to the query.

func (*InteractionQuery) Offset

func (iq *InteractionQuery) Offset(offset int) *InteractionQuery

Offset adds an offset step to the query.

func (*InteractionQuery) Only

func (iq *InteractionQuery) Only(ctx context.Context) (*Interaction, error)

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

func (*InteractionQuery) OnlyID

func (iq *InteractionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*InteractionQuery) OnlyIDX

func (iq *InteractionQuery) OnlyIDX(ctx context.Context) int

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

func (*InteractionQuery) OnlyX

func (iq *InteractionQuery) OnlyX(ctx context.Context) *Interaction

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

func (*InteractionQuery) Order

func (iq *InteractionQuery) Order(o ...OrderFunc) *InteractionQuery

Order adds an order step to the query.

func (*InteractionQuery) QuerySqueak

func (iq *InteractionQuery) QuerySqueak() *SqueakQuery

QuerySqueak chains the current query on the "squeak" edge.

func (*InteractionQuery) QueryUser

func (iq *InteractionQuery) QueryUser() *UserQuery

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

func (*InteractionQuery) Select

func (iq *InteractionQuery) Select(fields ...string) *InteractionSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Interaction.Query().
	Select(interaction.FieldCreateTime).
	Scan(ctx, &v)

func (*InteractionQuery) Unique

func (iq *InteractionQuery) Unique(unique bool) *InteractionQuery

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

Where adds a new predicate for the InteractionQuery builder.

func (*InteractionQuery) WithSqueak

func (iq *InteractionQuery) WithSqueak(opts ...func(*SqueakQuery)) *InteractionQuery

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

func (*InteractionQuery) WithUser

func (iq *InteractionQuery) WithUser(opts ...func(*UserQuery)) *InteractionQuery

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 InteractionSelect

type InteractionSelect struct {
	*InteractionQuery
	// contains filtered or unexported fields
}

InteractionSelect is the builder for selecting fields of Interaction entities.

func (*InteractionSelect) Aggregate

func (is *InteractionSelect) Aggregate(fns ...AggregateFunc) *InteractionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*InteractionSelect) Bool

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

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

func (*InteractionSelect) BoolX

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

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

func (*InteractionSelect) Bools

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

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

func (*InteractionSelect) BoolsX

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

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

func (*InteractionSelect) Float64

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

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

func (*InteractionSelect) Float64X

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

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

func (*InteractionSelect) Float64s

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

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

func (*InteractionSelect) Float64sX

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

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

func (*InteractionSelect) Int

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

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

func (*InteractionSelect) IntX

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

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

func (*InteractionSelect) Ints

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

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

func (*InteractionSelect) IntsX

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

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

func (*InteractionSelect) Scan

func (is *InteractionSelect) Scan(ctx context.Context, v any) error

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

func (*InteractionSelect) ScanX

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

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

func (*InteractionSelect) String

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

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

func (*InteractionSelect) StringX

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

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

func (*InteractionSelect) Strings

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

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

func (*InteractionSelect) StringsX

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

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

type InteractionUpdate

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

InteractionUpdate is the builder for updating Interaction entities.

func (*InteractionUpdate) ClearSqueak

func (iu *InteractionUpdate) ClearSqueak() *InteractionUpdate

ClearSqueak clears the "squeak" edge to the Squeak entity.

func (*InteractionUpdate) ClearUser

func (iu *InteractionUpdate) ClearUser() *InteractionUpdate

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

func (*InteractionUpdate) Exec

func (iu *InteractionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InteractionUpdate) ExecX

func (iu *InteractionUpdate) ExecX(ctx context.Context)

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

func (*InteractionUpdate) Mutation

func (iu *InteractionUpdate) Mutation() *InteractionMutation

Mutation returns the InteractionMutation object of the builder.

func (*InteractionUpdate) Save

func (iu *InteractionUpdate) Save(ctx context.Context) (int, error)

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

func (*InteractionUpdate) SaveX

func (iu *InteractionUpdate) SaveX(ctx context.Context) int

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

func (*InteractionUpdate) SetNillableSqueakID

func (iu *InteractionUpdate) SetNillableSqueakID(id *int) *InteractionUpdate

SetNillableSqueakID sets the "squeak" edge to the Squeak entity by ID if the given value is not nil.

func (*InteractionUpdate) SetNillableUserID

func (iu *InteractionUpdate) SetNillableUserID(id *int) *InteractionUpdate

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

func (*InteractionUpdate) SetSqueak

func (iu *InteractionUpdate) SetSqueak(s *Squeak) *InteractionUpdate

SetSqueak sets the "squeak" edge to the Squeak entity.

func (*InteractionUpdate) SetSqueakID

func (iu *InteractionUpdate) SetSqueakID(id int) *InteractionUpdate

SetSqueakID sets the "squeak" edge to the Squeak entity by ID.

func (*InteractionUpdate) SetType

SetType sets the "type" field.

func (*InteractionUpdate) SetUser

func (iu *InteractionUpdate) SetUser(u *User) *InteractionUpdate

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

func (*InteractionUpdate) SetUserID

func (iu *InteractionUpdate) SetUserID(id int) *InteractionUpdate

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

func (*InteractionUpdate) Where

Where appends a list predicates to the InteractionUpdate builder.

type InteractionUpdateOne

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

InteractionUpdateOne is the builder for updating a single Interaction entity.

func (*InteractionUpdateOne) ClearSqueak

func (iuo *InteractionUpdateOne) ClearSqueak() *InteractionUpdateOne

ClearSqueak clears the "squeak" edge to the Squeak entity.

func (*InteractionUpdateOne) ClearUser

func (iuo *InteractionUpdateOne) ClearUser() *InteractionUpdateOne

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

func (*InteractionUpdateOne) Exec

func (iuo *InteractionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InteractionUpdateOne) ExecX

func (iuo *InteractionUpdateOne) ExecX(ctx context.Context)

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

func (*InteractionUpdateOne) Mutation

func (iuo *InteractionUpdateOne) Mutation() *InteractionMutation

Mutation returns the InteractionMutation object of the builder.

func (*InteractionUpdateOne) Save

Save executes the query and returns the updated Interaction entity.

func (*InteractionUpdateOne) SaveX

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

func (*InteractionUpdateOne) Select

func (iuo *InteractionUpdateOne) Select(field string, fields ...string) *InteractionUpdateOne

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

func (*InteractionUpdateOne) SetNillableSqueakID

func (iuo *InteractionUpdateOne) SetNillableSqueakID(id *int) *InteractionUpdateOne

SetNillableSqueakID sets the "squeak" edge to the Squeak entity by ID if the given value is not nil.

func (*InteractionUpdateOne) SetNillableUserID

func (iuo *InteractionUpdateOne) SetNillableUserID(id *int) *InteractionUpdateOne

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

func (*InteractionUpdateOne) SetSqueak

func (iuo *InteractionUpdateOne) SetSqueak(s *Squeak) *InteractionUpdateOne

SetSqueak sets the "squeak" edge to the Squeak entity.

func (*InteractionUpdateOne) SetSqueakID

func (iuo *InteractionUpdateOne) SetSqueakID(id int) *InteractionUpdateOne

SetSqueakID sets the "squeak" edge to the Squeak entity by ID.

func (*InteractionUpdateOne) SetType

SetType sets the "type" field.

func (*InteractionUpdateOne) SetUser

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

func (*InteractionUpdateOne) SetUserID

func (iuo *InteractionUpdateOne) SetUserID(id int) *InteractionUpdateOne

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

type Interactions

type Interactions []*Interaction

Interactions is a parsable slice of Interaction.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Pool

type Pool struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount *types.Uint256 `json:"amount,omitempty"`
	// Shares holds the value of the "shares" field.
	Shares *types.Uint256 `json:"shares,omitempty"`
	// BlockNumber holds the value of the "block_number" field.
	BlockNumber *types.Uint256 `json:"block_number,omitempty"`
	// Score holds the value of the "score" field.
	Score int `json:"score,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PoolQuery when eager-loading is set.
	Edges PoolEdges `json:"edges"`
	// contains filtered or unexported fields
}

Pool is the model entity for the Pool schema.

func (*Pool) QueryPoolPasses

func (po *Pool) QueryPoolPasses() *PoolPassQuery

QueryPoolPasses queries the "pool_passes" edge of the Pool entity.

func (*Pool) QuerySqueak

func (po *Pool) QuerySqueak() *SqueakQuery

QuerySqueak queries the "squeak" edge of the Pool entity.

func (*Pool) String

func (po *Pool) String() string

String implements the fmt.Stringer.

func (*Pool) Unwrap

func (po *Pool) Unwrap() *Pool

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

func (po *Pool) Update() *PoolUpdateOne

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

type PoolClient

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

PoolClient is a client for the Pool schema.

func NewPoolClient

func NewPoolClient(c config) *PoolClient

NewPoolClient returns a client for the Pool from the given config.

func (*PoolClient) Create

func (c *PoolClient) Create() *PoolCreate

Create returns a builder for creating a Pool entity.

func (*PoolClient) CreateBulk

func (c *PoolClient) CreateBulk(builders ...*PoolCreate) *PoolCreateBulk

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

func (*PoolClient) Delete

func (c *PoolClient) Delete() *PoolDelete

Delete returns a delete builder for Pool.

func (*PoolClient) DeleteOne

func (c *PoolClient) DeleteOne(po *Pool) *PoolDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PoolClient) DeleteOneID

func (c *PoolClient) DeleteOneID(id int) *PoolDeleteOne

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

func (*PoolClient) Get

func (c *PoolClient) Get(ctx context.Context, id int) (*Pool, error)

Get returns a Pool entity by its id.

func (*PoolClient) GetX

func (c *PoolClient) GetX(ctx context.Context, id int) *Pool

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

func (*PoolClient) Hooks

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

Hooks returns the client hooks.

func (*PoolClient) Query

func (c *PoolClient) Query() *PoolQuery

Query returns a query builder for Pool.

func (*PoolClient) QueryPoolPasses

func (c *PoolClient) QueryPoolPasses(po *Pool) *PoolPassQuery

QueryPoolPasses queries the pool_passes edge of a Pool.

func (*PoolClient) QuerySqueak

func (c *PoolClient) QuerySqueak(po *Pool) *SqueakQuery

QuerySqueak queries the squeak edge of a Pool.

func (*PoolClient) Update

func (c *PoolClient) Update() *PoolUpdate

Update returns an update builder for Pool.

func (*PoolClient) UpdateOne

func (c *PoolClient) UpdateOne(po *Pool) *PoolUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PoolClient) UpdateOneID

func (c *PoolClient) UpdateOneID(id int) *PoolUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PoolClient) Use

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

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

type PoolCreate

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

PoolCreate is the builder for creating a Pool entity.

func (*PoolCreate) AddPoolPassIDs

func (pc *PoolCreate) AddPoolPassIDs(ids ...int) *PoolCreate

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by IDs.

func (*PoolCreate) AddPoolPasses

func (pc *PoolCreate) AddPoolPasses(p ...*PoolPass) *PoolCreate

AddPoolPasses adds the "pool_passes" edges to the PoolPass entity.

func (*PoolCreate) Exec

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

Exec executes the query.

func (*PoolCreate) ExecX

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

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

func (*PoolCreate) Mutation

func (pc *PoolCreate) Mutation() *PoolMutation

Mutation returns the PoolMutation object of the builder.

func (*PoolCreate) Save

func (pc *PoolCreate) Save(ctx context.Context) (*Pool, error)

Save creates the Pool in the database.

func (*PoolCreate) SaveX

func (pc *PoolCreate) SaveX(ctx context.Context) *Pool

SaveX calls Save and panics if Save returns an error.

func (*PoolCreate) SetAmount

func (pc *PoolCreate) SetAmount(t *types.Uint256) *PoolCreate

SetAmount sets the "amount" field.

func (*PoolCreate) SetBlockNumber

func (pc *PoolCreate) SetBlockNumber(t *types.Uint256) *PoolCreate

SetBlockNumber sets the "block_number" field.

func (*PoolCreate) SetCreateTime

func (pc *PoolCreate) SetCreateTime(t time.Time) *PoolCreate

SetCreateTime sets the "create_time" field.

func (*PoolCreate) SetNillableCreateTime

func (pc *PoolCreate) SetNillableCreateTime(t *time.Time) *PoolCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*PoolCreate) SetNillableSqueakID

func (pc *PoolCreate) SetNillableSqueakID(id *int) *PoolCreate

SetNillableSqueakID sets the "squeak" edge to the Squeak entity by ID if the given value is not nil.

func (*PoolCreate) SetNillableUpdateTime

func (pc *PoolCreate) SetNillableUpdateTime(t *time.Time) *PoolCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*PoolCreate) SetScore

func (pc *PoolCreate) SetScore(i int) *PoolCreate

SetScore sets the "score" field.

func (*PoolCreate) SetShares

func (pc *PoolCreate) SetShares(t *types.Uint256) *PoolCreate

SetShares sets the "shares" field.

func (*PoolCreate) SetSqueak

func (pc *PoolCreate) SetSqueak(s *Squeak) *PoolCreate

SetSqueak sets the "squeak" edge to the Squeak entity.

func (*PoolCreate) SetSqueakID

func (pc *PoolCreate) SetSqueakID(id int) *PoolCreate

SetSqueakID sets the "squeak" edge to the Squeak entity by ID.

func (*PoolCreate) SetUpdateTime

func (pc *PoolCreate) SetUpdateTime(t time.Time) *PoolCreate

SetUpdateTime sets the "update_time" field.

type PoolCreateBulk

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

PoolCreateBulk is the builder for creating many Pool entities in bulk.

func (*PoolCreateBulk) Exec

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

Exec executes the query.

func (*PoolCreateBulk) ExecX

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

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

func (*PoolCreateBulk) Save

func (pcb *PoolCreateBulk) Save(ctx context.Context) ([]*Pool, error)

Save creates the Pool entities in the database.

func (*PoolCreateBulk) SaveX

func (pcb *PoolCreateBulk) SaveX(ctx context.Context) []*Pool

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

type PoolDelete

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

PoolDelete is the builder for deleting a Pool entity.

func (*PoolDelete) Exec

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

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

func (*PoolDelete) ExecX

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

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

func (*PoolDelete) Where

func (pd *PoolDelete) Where(ps ...predicate.Pool) *PoolDelete

Where appends a list predicates to the PoolDelete builder.

type PoolDeleteOne

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

PoolDeleteOne is the builder for deleting a single Pool entity.

func (*PoolDeleteOne) Exec

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

Exec executes the deletion query.

func (*PoolDeleteOne) ExecX

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

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

type PoolEdges

type PoolEdges struct {
	// PoolPasses holds the value of the pool_passes edge.
	PoolPasses []*PoolPass `json:"pool_passes,omitempty"`
	// Squeak holds the value of the squeak edge.
	Squeak *Squeak `json:"squeak,omitempty"`
	// contains filtered or unexported fields
}

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

func (PoolEdges) PoolPassesOrErr

func (e PoolEdges) PoolPassesOrErr() ([]*PoolPass, error)

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

func (PoolEdges) SqueakOrErr

func (e PoolEdges) SqueakOrErr() (*Squeak, error)

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

type PoolGroupBy

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

PoolGroupBy is the group-by builder for Pool entities.

func (*PoolGroupBy) Aggregate

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

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

func (*PoolGroupBy) Bool

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

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

func (*PoolGroupBy) BoolX

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

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

func (*PoolGroupBy) Bools

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

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

func (*PoolGroupBy) BoolsX

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

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

func (*PoolGroupBy) Float64

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

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

func (*PoolGroupBy) Float64X

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

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

func (*PoolGroupBy) Float64s

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

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

func (*PoolGroupBy) Float64sX

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

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

func (*PoolGroupBy) Int

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

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

func (*PoolGroupBy) IntX

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

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

func (*PoolGroupBy) Ints

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

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

func (*PoolGroupBy) IntsX

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

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

func (*PoolGroupBy) Scan

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

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

func (*PoolGroupBy) ScanX

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

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

func (*PoolGroupBy) String

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

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

func (*PoolGroupBy) StringX

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

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

func (*PoolGroupBy) Strings

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

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

func (*PoolGroupBy) StringsX

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

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

type PoolMutation

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

PoolMutation represents an operation that mutates the Pool nodes in the graph.

func (*PoolMutation) AddField

func (m *PoolMutation) 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 (*PoolMutation) AddPoolPassIDs

func (m *PoolMutation) AddPoolPassIDs(ids ...int)

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by ids.

func (*PoolMutation) AddScore

func (m *PoolMutation) AddScore(i int)

AddScore adds i to the "score" field.

func (*PoolMutation) AddedEdges

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

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

func (*PoolMutation) AddedField

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

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

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

func (*PoolMutation) AddedIDs

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

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

func (*PoolMutation) AddedScore

func (m *PoolMutation) AddedScore() (r int, exists bool)

AddedScore returns the value that was added to the "score" field in this mutation.

func (*PoolMutation) Amount

func (m *PoolMutation) Amount() (r *types.Uint256, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*PoolMutation) BlockNumber

func (m *PoolMutation) BlockNumber() (r *types.Uint256, exists bool)

BlockNumber returns the value of the "block_number" field in the mutation.

func (*PoolMutation) ClearEdge

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

func (m *PoolMutation) 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 (*PoolMutation) ClearPoolPasses

func (m *PoolMutation) ClearPoolPasses()

ClearPoolPasses clears the "pool_passes" edge to the PoolPass entity.

func (*PoolMutation) ClearSqueak

func (m *PoolMutation) ClearSqueak()

ClearSqueak clears the "squeak" edge to the Squeak entity.

func (*PoolMutation) ClearedEdges

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

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

func (*PoolMutation) ClearedFields

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

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

func (PoolMutation) Client

func (m PoolMutation) 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 (*PoolMutation) CreateTime

func (m *PoolMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*PoolMutation) EdgeCleared

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

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

func (*PoolMutation) Field

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

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

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

func (*PoolMutation) Fields

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

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

func (m *PoolMutation) 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 (*PoolMutation) OldAmount

func (m *PoolMutation) OldAmount(ctx context.Context) (v *types.Uint256, err error)

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

func (*PoolMutation) OldBlockNumber

func (m *PoolMutation) OldBlockNumber(ctx context.Context) (v *types.Uint256, err error)

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

func (*PoolMutation) OldCreateTime

func (m *PoolMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*PoolMutation) OldField

func (m *PoolMutation) 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 (*PoolMutation) OldScore

func (m *PoolMutation) OldScore(ctx context.Context) (v int, err error)

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

func (*PoolMutation) OldShares

func (m *PoolMutation) OldShares(ctx context.Context) (v *types.Uint256, err error)

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

func (*PoolMutation) OldUpdateTime

func (m *PoolMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

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

func (*PoolMutation) Op

func (m *PoolMutation) Op() Op

Op returns the operation name.

func (*PoolMutation) PoolPassesCleared

func (m *PoolMutation) PoolPassesCleared() bool

PoolPassesCleared reports if the "pool_passes" edge to the PoolPass entity was cleared.

func (*PoolMutation) PoolPassesIDs

func (m *PoolMutation) PoolPassesIDs() (ids []int)

PoolPassesIDs returns the "pool_passes" edge IDs in the mutation.

func (*PoolMutation) RemovePoolPassIDs

func (m *PoolMutation) RemovePoolPassIDs(ids ...int)

RemovePoolPassIDs removes the "pool_passes" edge to the PoolPass entity by IDs.

func (*PoolMutation) RemovedEdges

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

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

func (*PoolMutation) RemovedIDs

func (m *PoolMutation) 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 (*PoolMutation) RemovedPoolPassesIDs

func (m *PoolMutation) RemovedPoolPassesIDs() (ids []int)

RemovedPoolPasses returns the removed IDs of the "pool_passes" edge to the PoolPass entity.

func (*PoolMutation) ResetAmount

func (m *PoolMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*PoolMutation) ResetBlockNumber

func (m *PoolMutation) ResetBlockNumber()

ResetBlockNumber resets all changes to the "block_number" field.

func (*PoolMutation) ResetCreateTime

func (m *PoolMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*PoolMutation) ResetEdge

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

func (m *PoolMutation) 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 (*PoolMutation) ResetPoolPasses

func (m *PoolMutation) ResetPoolPasses()

ResetPoolPasses resets all changes to the "pool_passes" edge.

func (*PoolMutation) ResetScore

func (m *PoolMutation) ResetScore()

ResetScore resets all changes to the "score" field.

func (*PoolMutation) ResetShares

func (m *PoolMutation) ResetShares()

ResetShares resets all changes to the "shares" field.

func (*PoolMutation) ResetSqueak

func (m *PoolMutation) ResetSqueak()

ResetSqueak resets all changes to the "squeak" edge.

func (*PoolMutation) ResetUpdateTime

func (m *PoolMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*PoolMutation) Score

func (m *PoolMutation) Score() (r int, exists bool)

Score returns the value of the "score" field in the mutation.

func (*PoolMutation) SetAmount

func (m *PoolMutation) SetAmount(t *types.Uint256)

SetAmount sets the "amount" field.

func (*PoolMutation) SetBlockNumber

func (m *PoolMutation) SetBlockNumber(t *types.Uint256)

SetBlockNumber sets the "block_number" field.

func (*PoolMutation) SetCreateTime

func (m *PoolMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*PoolMutation) SetField

func (m *PoolMutation) 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 (*PoolMutation) SetScore

func (m *PoolMutation) SetScore(i int)

SetScore sets the "score" field.

func (*PoolMutation) SetShares

func (m *PoolMutation) SetShares(t *types.Uint256)

SetShares sets the "shares" field.

func (*PoolMutation) SetSqueakID

func (m *PoolMutation) SetSqueakID(id int)

SetSqueakID sets the "squeak" edge to the Squeak entity by id.

func (*PoolMutation) SetUpdateTime

func (m *PoolMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*PoolMutation) Shares

func (m *PoolMutation) Shares() (r *types.Uint256, exists bool)

Shares returns the value of the "shares" field in the mutation.

func (*PoolMutation) SqueakCleared

func (m *PoolMutation) SqueakCleared() bool

SqueakCleared reports if the "squeak" edge to the Squeak entity was cleared.

func (*PoolMutation) SqueakID

func (m *PoolMutation) SqueakID() (id int, exists bool)

SqueakID returns the "squeak" edge ID in the mutation.

func (*PoolMutation) SqueakIDs

func (m *PoolMutation) SqueakIDs() (ids []int)

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

func (PoolMutation) Tx

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

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

func (*PoolMutation) Type

func (m *PoolMutation) Type() string

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

func (*PoolMutation) UpdateTime

func (m *PoolMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*PoolMutation) Where

func (m *PoolMutation) Where(ps ...predicate.Pool)

Where appends a list predicates to the PoolMutation builder.

type PoolPass

type PoolPass struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// Shares holds the value of the "shares" field.
	Shares *types.Uint256 `json:"shares,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PoolPassQuery when eager-loading is set.
	Edges PoolPassEdges `json:"edges"`
	// contains filtered or unexported fields
}

PoolPass is the model entity for the PoolPass schema.

func (*PoolPass) QueryPool

func (pp *PoolPass) QueryPool() *PoolQuery

QueryPool queries the "pool" edge of the PoolPass entity.

func (*PoolPass) QueryUser

func (pp *PoolPass) QueryUser() *UserQuery

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

func (*PoolPass) String

func (pp *PoolPass) String() string

String implements the fmt.Stringer.

func (*PoolPass) Unwrap

func (pp *PoolPass) Unwrap() *PoolPass

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

func (pp *PoolPass) Update() *PoolPassUpdateOne

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

type PoolPassClient

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

PoolPassClient is a client for the PoolPass schema.

func NewPoolPassClient

func NewPoolPassClient(c config) *PoolPassClient

NewPoolPassClient returns a client for the PoolPass from the given config.

func (*PoolPassClient) Create

func (c *PoolPassClient) Create() *PoolPassCreate

Create returns a builder for creating a PoolPass entity.

func (*PoolPassClient) CreateBulk

func (c *PoolPassClient) CreateBulk(builders ...*PoolPassCreate) *PoolPassCreateBulk

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

func (*PoolPassClient) Delete

func (c *PoolPassClient) Delete() *PoolPassDelete

Delete returns a delete builder for PoolPass.

func (*PoolPassClient) DeleteOne

func (c *PoolPassClient) DeleteOne(pp *PoolPass) *PoolPassDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PoolPassClient) DeleteOneID

func (c *PoolPassClient) DeleteOneID(id int) *PoolPassDeleteOne

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

func (*PoolPassClient) Get

func (c *PoolPassClient) Get(ctx context.Context, id int) (*PoolPass, error)

Get returns a PoolPass entity by its id.

func (*PoolPassClient) GetX

func (c *PoolPassClient) GetX(ctx context.Context, id int) *PoolPass

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

func (*PoolPassClient) Hooks

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

Hooks returns the client hooks.

func (*PoolPassClient) Query

func (c *PoolPassClient) Query() *PoolPassQuery

Query returns a query builder for PoolPass.

func (*PoolPassClient) QueryPool

func (c *PoolPassClient) QueryPool(pp *PoolPass) *PoolQuery

QueryPool queries the pool edge of a PoolPass.

func (*PoolPassClient) QueryUser

func (c *PoolPassClient) QueryUser(pp *PoolPass) *UserQuery

QueryUser queries the user edge of a PoolPass.

func (*PoolPassClient) Update

func (c *PoolPassClient) Update() *PoolPassUpdate

Update returns an update builder for PoolPass.

func (*PoolPassClient) UpdateOne

func (c *PoolPassClient) UpdateOne(pp *PoolPass) *PoolPassUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PoolPassClient) UpdateOneID

func (c *PoolPassClient) UpdateOneID(id int) *PoolPassUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PoolPassClient) Use

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

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

type PoolPassCreate

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

PoolPassCreate is the builder for creating a PoolPass entity.

func (*PoolPassCreate) Exec

func (ppc *PoolPassCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PoolPassCreate) ExecX

func (ppc *PoolPassCreate) ExecX(ctx context.Context)

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

func (*PoolPassCreate) Mutation

func (ppc *PoolPassCreate) Mutation() *PoolPassMutation

Mutation returns the PoolPassMutation object of the builder.

func (*PoolPassCreate) Save

func (ppc *PoolPassCreate) Save(ctx context.Context) (*PoolPass, error)

Save creates the PoolPass in the database.

func (*PoolPassCreate) SaveX

func (ppc *PoolPassCreate) SaveX(ctx context.Context) *PoolPass

SaveX calls Save and panics if Save returns an error.

func (*PoolPassCreate) SetCreateTime

func (ppc *PoolPassCreate) SetCreateTime(t time.Time) *PoolPassCreate

SetCreateTime sets the "create_time" field.

func (*PoolPassCreate) SetNillableCreateTime

func (ppc *PoolPassCreate) SetNillableCreateTime(t *time.Time) *PoolPassCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*PoolPassCreate) SetNillablePoolID

func (ppc *PoolPassCreate) SetNillablePoolID(id *int) *PoolPassCreate

SetNillablePoolID sets the "pool" edge to the Pool entity by ID if the given value is not nil.

func (*PoolPassCreate) SetNillableUserID

func (ppc *PoolPassCreate) SetNillableUserID(id *int) *PoolPassCreate

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

func (*PoolPassCreate) SetPool

func (ppc *PoolPassCreate) SetPool(p *Pool) *PoolPassCreate

SetPool sets the "pool" edge to the Pool entity.

func (*PoolPassCreate) SetPoolID

func (ppc *PoolPassCreate) SetPoolID(id int) *PoolPassCreate

SetPoolID sets the "pool" edge to the Pool entity by ID.

func (*PoolPassCreate) SetShares

func (ppc *PoolPassCreate) SetShares(t *types.Uint256) *PoolPassCreate

SetShares sets the "shares" field.

func (*PoolPassCreate) SetUser

func (ppc *PoolPassCreate) SetUser(u *User) *PoolPassCreate

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

func (*PoolPassCreate) SetUserID

func (ppc *PoolPassCreate) SetUserID(id int) *PoolPassCreate

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

type PoolPassCreateBulk

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

PoolPassCreateBulk is the builder for creating many PoolPass entities in bulk.

func (*PoolPassCreateBulk) Exec

func (ppcb *PoolPassCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PoolPassCreateBulk) ExecX

func (ppcb *PoolPassCreateBulk) ExecX(ctx context.Context)

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

func (*PoolPassCreateBulk) Save

func (ppcb *PoolPassCreateBulk) Save(ctx context.Context) ([]*PoolPass, error)

Save creates the PoolPass entities in the database.

func (*PoolPassCreateBulk) SaveX

func (ppcb *PoolPassCreateBulk) SaveX(ctx context.Context) []*PoolPass

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

type PoolPassDelete

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

PoolPassDelete is the builder for deleting a PoolPass entity.

func (*PoolPassDelete) Exec

func (ppd *PoolPassDelete) Exec(ctx context.Context) (int, error)

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

func (*PoolPassDelete) ExecX

func (ppd *PoolPassDelete) ExecX(ctx context.Context) int

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

func (*PoolPassDelete) Where

func (ppd *PoolPassDelete) Where(ps ...predicate.PoolPass) *PoolPassDelete

Where appends a list predicates to the PoolPassDelete builder.

type PoolPassDeleteOne

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

PoolPassDeleteOne is the builder for deleting a single PoolPass entity.

func (*PoolPassDeleteOne) Exec

func (ppdo *PoolPassDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PoolPassDeleteOne) ExecX

func (ppdo *PoolPassDeleteOne) ExecX(ctx context.Context)

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

type PoolPassEdges

type PoolPassEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Pool holds the value of the pool edge.
	Pool *Pool `json:"pool,omitempty"`
	// contains filtered or unexported fields
}

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

func (PoolPassEdges) PoolOrErr

func (e PoolPassEdges) PoolOrErr() (*Pool, error)

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

func (PoolPassEdges) UserOrErr

func (e PoolPassEdges) 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 PoolPassGroupBy

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

PoolPassGroupBy is the group-by builder for PoolPass entities.

func (*PoolPassGroupBy) Aggregate

func (ppgb *PoolPassGroupBy) Aggregate(fns ...AggregateFunc) *PoolPassGroupBy

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

func (*PoolPassGroupBy) Bool

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

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

func (*PoolPassGroupBy) BoolX

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

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

func (*PoolPassGroupBy) Bools

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

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

func (*PoolPassGroupBy) BoolsX

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

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

func (*PoolPassGroupBy) Float64

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

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

func (*PoolPassGroupBy) Float64X

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

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

func (*PoolPassGroupBy) Float64s

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

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

func (*PoolPassGroupBy) Float64sX

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

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

func (*PoolPassGroupBy) Int

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

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

func (*PoolPassGroupBy) IntX

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

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

func (*PoolPassGroupBy) Ints

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

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

func (*PoolPassGroupBy) IntsX

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

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

func (*PoolPassGroupBy) Scan

func (ppgb *PoolPassGroupBy) Scan(ctx context.Context, v any) error

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

func (*PoolPassGroupBy) ScanX

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

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

func (*PoolPassGroupBy) String

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

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

func (*PoolPassGroupBy) StringX

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

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

func (*PoolPassGroupBy) Strings

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

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

func (*PoolPassGroupBy) StringsX

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

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

type PoolPassMutation

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

PoolPassMutation represents an operation that mutates the PoolPass nodes in the graph.

func (*PoolPassMutation) AddField

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

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

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

func (*PoolPassMutation) AddedField

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

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

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

func (*PoolPassMutation) AddedIDs

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

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

func (*PoolPassMutation) ClearEdge

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

func (m *PoolPassMutation) 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 (*PoolPassMutation) ClearPool

func (m *PoolPassMutation) ClearPool()

ClearPool clears the "pool" edge to the Pool entity.

func (*PoolPassMutation) ClearUser

func (m *PoolPassMutation) ClearUser()

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

func (*PoolPassMutation) ClearedEdges

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

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

func (*PoolPassMutation) ClearedFields

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

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

func (PoolPassMutation) Client

func (m PoolPassMutation) 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 (*PoolPassMutation) CreateTime

func (m *PoolPassMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*PoolPassMutation) EdgeCleared

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

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

func (*PoolPassMutation) Field

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

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

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

func (*PoolPassMutation) Fields

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

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

func (m *PoolPassMutation) 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 (*PoolPassMutation) OldCreateTime

func (m *PoolPassMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*PoolPassMutation) OldField

func (m *PoolPassMutation) 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 (*PoolPassMutation) OldShares

func (m *PoolPassMutation) OldShares(ctx context.Context) (v *types.Uint256, err error)

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

func (*PoolPassMutation) Op

func (m *PoolPassMutation) Op() Op

Op returns the operation name.

func (*PoolPassMutation) PoolCleared

func (m *PoolPassMutation) PoolCleared() bool

PoolCleared reports if the "pool" edge to the Pool entity was cleared.

func (*PoolPassMutation) PoolID

func (m *PoolPassMutation) PoolID() (id int, exists bool)

PoolID returns the "pool" edge ID in the mutation.

func (*PoolPassMutation) PoolIDs

func (m *PoolPassMutation) PoolIDs() (ids []int)

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

func (*PoolPassMutation) RemovedEdges

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

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

func (*PoolPassMutation) RemovedIDs

func (m *PoolPassMutation) 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 (*PoolPassMutation) ResetCreateTime

func (m *PoolPassMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*PoolPassMutation) ResetEdge

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

func (m *PoolPassMutation) 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 (*PoolPassMutation) ResetPool

func (m *PoolPassMutation) ResetPool()

ResetPool resets all changes to the "pool" edge.

func (*PoolPassMutation) ResetShares

func (m *PoolPassMutation) ResetShares()

ResetShares resets all changes to the "shares" field.

func (*PoolPassMutation) ResetUser

func (m *PoolPassMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*PoolPassMutation) SetCreateTime

func (m *PoolPassMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*PoolPassMutation) SetField

func (m *PoolPassMutation) 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 (*PoolPassMutation) SetPoolID

func (m *PoolPassMutation) SetPoolID(id int)

SetPoolID sets the "pool" edge to the Pool entity by id.

func (*PoolPassMutation) SetShares

func (m *PoolPassMutation) SetShares(t *types.Uint256)

SetShares sets the "shares" field.

func (*PoolPassMutation) SetUserID

func (m *PoolPassMutation) SetUserID(id int)

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

func (*PoolPassMutation) Shares

func (m *PoolPassMutation) Shares() (r *types.Uint256, exists bool)

Shares returns the value of the "shares" field in the mutation.

func (PoolPassMutation) Tx

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

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

func (*PoolPassMutation) Type

func (m *PoolPassMutation) Type() string

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

func (*PoolPassMutation) UserCleared

func (m *PoolPassMutation) UserCleared() bool

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

func (*PoolPassMutation) UserID

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

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

func (*PoolPassMutation) UserIDs

func (m *PoolPassMutation) 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 (*PoolPassMutation) Where

func (m *PoolPassMutation) Where(ps ...predicate.PoolPass)

Where appends a list predicates to the PoolPassMutation builder.

type PoolPassQuery

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

PoolPassQuery is the builder for querying PoolPass entities.

func (*PoolPassQuery) Aggregate

func (ppq *PoolPassQuery) Aggregate(fns ...AggregateFunc) *PoolPassSelect

Aggregate returns a PoolPassSelect configured with the given aggregations.

func (*PoolPassQuery) All

func (ppq *PoolPassQuery) All(ctx context.Context) ([]*PoolPass, error)

All executes the query and returns a list of PoolPasses.

func (*PoolPassQuery) AllX

func (ppq *PoolPassQuery) AllX(ctx context.Context) []*PoolPass

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

func (*PoolPassQuery) Clone

func (ppq *PoolPassQuery) Clone() *PoolPassQuery

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

func (*PoolPassQuery) Count

func (ppq *PoolPassQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PoolPassQuery) CountX

func (ppq *PoolPassQuery) CountX(ctx context.Context) int

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

func (*PoolPassQuery) Exist

func (ppq *PoolPassQuery) Exist(ctx context.Context) (bool, error)

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

func (*PoolPassQuery) ExistX

func (ppq *PoolPassQuery) ExistX(ctx context.Context) bool

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

func (*PoolPassQuery) First

func (ppq *PoolPassQuery) First(ctx context.Context) (*PoolPass, error)

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

func (*PoolPassQuery) FirstID

func (ppq *PoolPassQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PoolPassQuery) FirstIDX

func (ppq *PoolPassQuery) FirstIDX(ctx context.Context) int

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

func (*PoolPassQuery) FirstX

func (ppq *PoolPassQuery) FirstX(ctx context.Context) *PoolPass

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

func (*PoolPassQuery) GroupBy

func (ppq *PoolPassQuery) GroupBy(field string, fields ...string) *PoolPassGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PoolPass.Query().
	GroupBy(poolpass.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PoolPassQuery) IDs

func (ppq *PoolPassQuery) IDs(ctx context.Context) ([]int, error)

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

func (*PoolPassQuery) IDsX

func (ppq *PoolPassQuery) IDsX(ctx context.Context) []int

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

func (*PoolPassQuery) Limit

func (ppq *PoolPassQuery) Limit(limit int) *PoolPassQuery

Limit adds a limit step to the query.

func (*PoolPassQuery) Offset

func (ppq *PoolPassQuery) Offset(offset int) *PoolPassQuery

Offset adds an offset step to the query.

func (*PoolPassQuery) Only

func (ppq *PoolPassQuery) Only(ctx context.Context) (*PoolPass, error)

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

func (*PoolPassQuery) OnlyID

func (ppq *PoolPassQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PoolPassQuery) OnlyIDX

func (ppq *PoolPassQuery) OnlyIDX(ctx context.Context) int

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

func (*PoolPassQuery) OnlyX

func (ppq *PoolPassQuery) OnlyX(ctx context.Context) *PoolPass

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

func (*PoolPassQuery) Order

func (ppq *PoolPassQuery) Order(o ...OrderFunc) *PoolPassQuery

Order adds an order step to the query.

func (*PoolPassQuery) QueryPool

func (ppq *PoolPassQuery) QueryPool() *PoolQuery

QueryPool chains the current query on the "pool" edge.

func (*PoolPassQuery) QueryUser

func (ppq *PoolPassQuery) QueryUser() *UserQuery

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

func (*PoolPassQuery) Select

func (ppq *PoolPassQuery) Select(fields ...string) *PoolPassSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.PoolPass.Query().
	Select(poolpass.FieldCreateTime).
	Scan(ctx, &v)

func (*PoolPassQuery) Unique

func (ppq *PoolPassQuery) Unique(unique bool) *PoolPassQuery

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

func (ppq *PoolPassQuery) Where(ps ...predicate.PoolPass) *PoolPassQuery

Where adds a new predicate for the PoolPassQuery builder.

func (*PoolPassQuery) WithPool

func (ppq *PoolPassQuery) WithPool(opts ...func(*PoolQuery)) *PoolPassQuery

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

func (*PoolPassQuery) WithUser

func (ppq *PoolPassQuery) WithUser(opts ...func(*UserQuery)) *PoolPassQuery

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 PoolPassSelect

type PoolPassSelect struct {
	*PoolPassQuery
	// contains filtered or unexported fields
}

PoolPassSelect is the builder for selecting fields of PoolPass entities.

func (*PoolPassSelect) Aggregate

func (pps *PoolPassSelect) Aggregate(fns ...AggregateFunc) *PoolPassSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PoolPassSelect) Bool

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

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

func (*PoolPassSelect) BoolX

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

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

func (*PoolPassSelect) Bools

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

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

func (*PoolPassSelect) BoolsX

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

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

func (*PoolPassSelect) Float64

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

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

func (*PoolPassSelect) Float64X

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

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

func (*PoolPassSelect) Float64s

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

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

func (*PoolPassSelect) Float64sX

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

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

func (*PoolPassSelect) Int

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

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

func (*PoolPassSelect) IntX

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

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

func (*PoolPassSelect) Ints

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

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

func (*PoolPassSelect) IntsX

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

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

func (*PoolPassSelect) Scan

func (pps *PoolPassSelect) Scan(ctx context.Context, v any) error

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

func (*PoolPassSelect) ScanX

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

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

func (*PoolPassSelect) String

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

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

func (*PoolPassSelect) StringX

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

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

func (*PoolPassSelect) Strings

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

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

func (*PoolPassSelect) StringsX

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

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

type PoolPassUpdate

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

PoolPassUpdate is the builder for updating PoolPass entities.

func (*PoolPassUpdate) ClearPool

func (ppu *PoolPassUpdate) ClearPool() *PoolPassUpdate

ClearPool clears the "pool" edge to the Pool entity.

func (*PoolPassUpdate) ClearUser

func (ppu *PoolPassUpdate) ClearUser() *PoolPassUpdate

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

func (*PoolPassUpdate) Exec

func (ppu *PoolPassUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PoolPassUpdate) ExecX

func (ppu *PoolPassUpdate) ExecX(ctx context.Context)

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

func (*PoolPassUpdate) Mutation

func (ppu *PoolPassUpdate) Mutation() *PoolPassMutation

Mutation returns the PoolPassMutation object of the builder.

func (*PoolPassUpdate) Save

func (ppu *PoolPassUpdate) Save(ctx context.Context) (int, error)

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

func (*PoolPassUpdate) SaveX

func (ppu *PoolPassUpdate) SaveX(ctx context.Context) int

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

func (*PoolPassUpdate) SetNillablePoolID

func (ppu *PoolPassUpdate) SetNillablePoolID(id *int) *PoolPassUpdate

SetNillablePoolID sets the "pool" edge to the Pool entity by ID if the given value is not nil.

func (*PoolPassUpdate) SetNillableUserID

func (ppu *PoolPassUpdate) SetNillableUserID(id *int) *PoolPassUpdate

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

func (*PoolPassUpdate) SetPool

func (ppu *PoolPassUpdate) SetPool(p *Pool) *PoolPassUpdate

SetPool sets the "pool" edge to the Pool entity.

func (*PoolPassUpdate) SetPoolID

func (ppu *PoolPassUpdate) SetPoolID(id int) *PoolPassUpdate

SetPoolID sets the "pool" edge to the Pool entity by ID.

func (*PoolPassUpdate) SetUser

func (ppu *PoolPassUpdate) SetUser(u *User) *PoolPassUpdate

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

func (*PoolPassUpdate) SetUserID

func (ppu *PoolPassUpdate) SetUserID(id int) *PoolPassUpdate

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

func (*PoolPassUpdate) Where

func (ppu *PoolPassUpdate) Where(ps ...predicate.PoolPass) *PoolPassUpdate

Where appends a list predicates to the PoolPassUpdate builder.

type PoolPassUpdateOne

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

PoolPassUpdateOne is the builder for updating a single PoolPass entity.

func (*PoolPassUpdateOne) ClearPool

func (ppuo *PoolPassUpdateOne) ClearPool() *PoolPassUpdateOne

ClearPool clears the "pool" edge to the Pool entity.

func (*PoolPassUpdateOne) ClearUser

func (ppuo *PoolPassUpdateOne) ClearUser() *PoolPassUpdateOne

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

func (*PoolPassUpdateOne) Exec

func (ppuo *PoolPassUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PoolPassUpdateOne) ExecX

func (ppuo *PoolPassUpdateOne) ExecX(ctx context.Context)

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

func (*PoolPassUpdateOne) Mutation

func (ppuo *PoolPassUpdateOne) Mutation() *PoolPassMutation

Mutation returns the PoolPassMutation object of the builder.

func (*PoolPassUpdateOne) Save

func (ppuo *PoolPassUpdateOne) Save(ctx context.Context) (*PoolPass, error)

Save executes the query and returns the updated PoolPass entity.

func (*PoolPassUpdateOne) SaveX

func (ppuo *PoolPassUpdateOne) SaveX(ctx context.Context) *PoolPass

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

func (*PoolPassUpdateOne) Select

func (ppuo *PoolPassUpdateOne) Select(field string, fields ...string) *PoolPassUpdateOne

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

func (*PoolPassUpdateOne) SetNillablePoolID

func (ppuo *PoolPassUpdateOne) SetNillablePoolID(id *int) *PoolPassUpdateOne

SetNillablePoolID sets the "pool" edge to the Pool entity by ID if the given value is not nil.

func (*PoolPassUpdateOne) SetNillableUserID

func (ppuo *PoolPassUpdateOne) SetNillableUserID(id *int) *PoolPassUpdateOne

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

func (*PoolPassUpdateOne) SetPool

func (ppuo *PoolPassUpdateOne) SetPool(p *Pool) *PoolPassUpdateOne

SetPool sets the "pool" edge to the Pool entity.

func (*PoolPassUpdateOne) SetPoolID

func (ppuo *PoolPassUpdateOne) SetPoolID(id int) *PoolPassUpdateOne

SetPoolID sets the "pool" edge to the Pool entity by ID.

func (*PoolPassUpdateOne) SetUser

func (ppuo *PoolPassUpdateOne) SetUser(u *User) *PoolPassUpdateOne

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

func (*PoolPassUpdateOne) SetUserID

func (ppuo *PoolPassUpdateOne) SetUserID(id int) *PoolPassUpdateOne

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

type PoolPasses

type PoolPasses []*PoolPass

PoolPasses is a parsable slice of PoolPass.

type PoolQuery

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

PoolQuery is the builder for querying Pool entities.

func (*PoolQuery) Aggregate

func (pq *PoolQuery) Aggregate(fns ...AggregateFunc) *PoolSelect

Aggregate returns a PoolSelect configured with the given aggregations.

func (*PoolQuery) All

func (pq *PoolQuery) All(ctx context.Context) ([]*Pool, error)

All executes the query and returns a list of Pools.

func (*PoolQuery) AllX

func (pq *PoolQuery) AllX(ctx context.Context) []*Pool

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

func (*PoolQuery) Clone

func (pq *PoolQuery) Clone() *PoolQuery

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

func (*PoolQuery) Count

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

Count returns the count of the given query.

func (*PoolQuery) CountX

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

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

func (*PoolQuery) Exist

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

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

func (*PoolQuery) ExistX

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

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

func (*PoolQuery) First

func (pq *PoolQuery) First(ctx context.Context) (*Pool, error)

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

func (*PoolQuery) FirstID

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

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

func (*PoolQuery) FirstIDX

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

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

func (*PoolQuery) FirstX

func (pq *PoolQuery) FirstX(ctx context.Context) *Pool

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

func (*PoolQuery) GroupBy

func (pq *PoolQuery) GroupBy(field string, fields ...string) *PoolGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Pool.Query().
	GroupBy(pool.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PoolQuery) IDs

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

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

func (*PoolQuery) IDsX

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

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

func (*PoolQuery) Limit

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

Limit adds a limit step to the query.

func (*PoolQuery) Offset

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

Offset adds an offset step to the query.

func (*PoolQuery) Only

func (pq *PoolQuery) Only(ctx context.Context) (*Pool, error)

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

func (*PoolQuery) OnlyID

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

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

func (*PoolQuery) OnlyIDX

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

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

func (*PoolQuery) OnlyX

func (pq *PoolQuery) OnlyX(ctx context.Context) *Pool

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

func (*PoolQuery) Order

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

Order adds an order step to the query.

func (*PoolQuery) QueryPoolPasses

func (pq *PoolQuery) QueryPoolPasses() *PoolPassQuery

QueryPoolPasses chains the current query on the "pool_passes" edge.

func (*PoolQuery) QuerySqueak

func (pq *PoolQuery) QuerySqueak() *SqueakQuery

QuerySqueak chains the current query on the "squeak" edge.

func (*PoolQuery) Select

func (pq *PoolQuery) Select(fields ...string) *PoolSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Pool.Query().
	Select(pool.FieldCreateTime).
	Scan(ctx, &v)

func (*PoolQuery) Unique

func (pq *PoolQuery) Unique(unique bool) *PoolQuery

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

func (pq *PoolQuery) Where(ps ...predicate.Pool) *PoolQuery

Where adds a new predicate for the PoolQuery builder.

func (*PoolQuery) WithPoolPasses

func (pq *PoolQuery) WithPoolPasses(opts ...func(*PoolPassQuery)) *PoolQuery

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

func (*PoolQuery) WithSqueak

func (pq *PoolQuery) WithSqueak(opts ...func(*SqueakQuery)) *PoolQuery

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

type PoolSelect

type PoolSelect struct {
	*PoolQuery
	// contains filtered or unexported fields
}

PoolSelect is the builder for selecting fields of Pool entities.

func (*PoolSelect) Aggregate

func (ps *PoolSelect) Aggregate(fns ...AggregateFunc) *PoolSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PoolSelect) Bool

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

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

func (*PoolSelect) BoolX

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

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

func (*PoolSelect) Bools

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

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

func (*PoolSelect) BoolsX

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

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

func (*PoolSelect) Float64

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

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

func (*PoolSelect) Float64X

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

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

func (*PoolSelect) Float64s

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

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

func (*PoolSelect) Float64sX

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

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

func (*PoolSelect) Int

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

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

func (*PoolSelect) IntX

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

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

func (*PoolSelect) Ints

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

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

func (*PoolSelect) IntsX

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

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

func (*PoolSelect) Scan

func (ps *PoolSelect) Scan(ctx context.Context, v any) error

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

func (*PoolSelect) ScanX

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

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

func (*PoolSelect) String

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

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

func (*PoolSelect) StringX

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

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

func (*PoolSelect) Strings

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

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

func (*PoolSelect) StringsX

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

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

type PoolUpdate

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

PoolUpdate is the builder for updating Pool entities.

func (*PoolUpdate) AddPoolPassIDs

func (pu *PoolUpdate) AddPoolPassIDs(ids ...int) *PoolUpdate

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by IDs.

func (*PoolUpdate) AddPoolPasses

func (pu *PoolUpdate) AddPoolPasses(p ...*PoolPass) *PoolUpdate

AddPoolPasses adds the "pool_passes" edges to the PoolPass entity.

func (*PoolUpdate) ClearPoolPasses

func (pu *PoolUpdate) ClearPoolPasses() *PoolUpdate

ClearPoolPasses clears all "pool_passes" edges to the PoolPass entity.

func (*PoolUpdate) ClearSqueak

func (pu *PoolUpdate) ClearSqueak() *PoolUpdate

ClearSqueak clears the "squeak" edge to the Squeak entity.

func (*PoolUpdate) Exec

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

Exec executes the query.

func (*PoolUpdate) ExecX

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

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

func (*PoolUpdate) Mutation

func (pu *PoolUpdate) Mutation() *PoolMutation

Mutation returns the PoolMutation object of the builder.

func (*PoolUpdate) RemovePoolPassIDs

func (pu *PoolUpdate) RemovePoolPassIDs(ids ...int) *PoolUpdate

RemovePoolPassIDs removes the "pool_passes" edge to PoolPass entities by IDs.

func (*PoolUpdate) RemovePoolPasses

func (pu *PoolUpdate) RemovePoolPasses(p ...*PoolPass) *PoolUpdate

RemovePoolPasses removes "pool_passes" edges to PoolPass entities.

func (*PoolUpdate) Save

func (pu *PoolUpdate) Save(ctx context.Context) (int, error)

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

func (*PoolUpdate) SaveX

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

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

func (*PoolUpdate) SetAmount

func (pu *PoolUpdate) SetAmount(t *types.Uint256) *PoolUpdate

SetAmount sets the "amount" field.

func (*PoolUpdate) SetNillableSqueakID

func (pu *PoolUpdate) SetNillableSqueakID(id *int) *PoolUpdate

SetNillableSqueakID sets the "squeak" edge to the Squeak entity by ID if the given value is not nil.

func (*PoolUpdate) SetShares

func (pu *PoolUpdate) SetShares(t *types.Uint256) *PoolUpdate

SetShares sets the "shares" field.

func (*PoolUpdate) SetSqueak

func (pu *PoolUpdate) SetSqueak(s *Squeak) *PoolUpdate

SetSqueak sets the "squeak" edge to the Squeak entity.

func (*PoolUpdate) SetSqueakID

func (pu *PoolUpdate) SetSqueakID(id int) *PoolUpdate

SetSqueakID sets the "squeak" edge to the Squeak entity by ID.

func (*PoolUpdate) SetUpdateTime

func (pu *PoolUpdate) SetUpdateTime(t time.Time) *PoolUpdate

SetUpdateTime sets the "update_time" field.

func (*PoolUpdate) Where

func (pu *PoolUpdate) Where(ps ...predicate.Pool) *PoolUpdate

Where appends a list predicates to the PoolUpdate builder.

type PoolUpdateOne

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

PoolUpdateOne is the builder for updating a single Pool entity.

func (*PoolUpdateOne) AddPoolPassIDs

func (puo *PoolUpdateOne) AddPoolPassIDs(ids ...int) *PoolUpdateOne

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by IDs.

func (*PoolUpdateOne) AddPoolPasses

func (puo *PoolUpdateOne) AddPoolPasses(p ...*PoolPass) *PoolUpdateOne

AddPoolPasses adds the "pool_passes" edges to the PoolPass entity.

func (*PoolUpdateOne) ClearPoolPasses

func (puo *PoolUpdateOne) ClearPoolPasses() *PoolUpdateOne

ClearPoolPasses clears all "pool_passes" edges to the PoolPass entity.

func (*PoolUpdateOne) ClearSqueak

func (puo *PoolUpdateOne) ClearSqueak() *PoolUpdateOne

ClearSqueak clears the "squeak" edge to the Squeak entity.

func (*PoolUpdateOne) Exec

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

Exec executes the query on the entity.

func (*PoolUpdateOne) ExecX

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

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

func (*PoolUpdateOne) Mutation

func (puo *PoolUpdateOne) Mutation() *PoolMutation

Mutation returns the PoolMutation object of the builder.

func (*PoolUpdateOne) RemovePoolPassIDs

func (puo *PoolUpdateOne) RemovePoolPassIDs(ids ...int) *PoolUpdateOne

RemovePoolPassIDs removes the "pool_passes" edge to PoolPass entities by IDs.

func (*PoolUpdateOne) RemovePoolPasses

func (puo *PoolUpdateOne) RemovePoolPasses(p ...*PoolPass) *PoolUpdateOne

RemovePoolPasses removes "pool_passes" edges to PoolPass entities.

func (*PoolUpdateOne) Save

func (puo *PoolUpdateOne) Save(ctx context.Context) (*Pool, error)

Save executes the query and returns the updated Pool entity.

func (*PoolUpdateOne) SaveX

func (puo *PoolUpdateOne) SaveX(ctx context.Context) *Pool

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

func (*PoolUpdateOne) Select

func (puo *PoolUpdateOne) Select(field string, fields ...string) *PoolUpdateOne

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

func (*PoolUpdateOne) SetAmount

func (puo *PoolUpdateOne) SetAmount(t *types.Uint256) *PoolUpdateOne

SetAmount sets the "amount" field.

func (*PoolUpdateOne) SetNillableSqueakID

func (puo *PoolUpdateOne) SetNillableSqueakID(id *int) *PoolUpdateOne

SetNillableSqueakID sets the "squeak" edge to the Squeak entity by ID if the given value is not nil.

func (*PoolUpdateOne) SetShares

func (puo *PoolUpdateOne) SetShares(t *types.Uint256) *PoolUpdateOne

SetShares sets the "shares" field.

func (*PoolUpdateOne) SetSqueak

func (puo *PoolUpdateOne) SetSqueak(s *Squeak) *PoolUpdateOne

SetSqueak sets the "squeak" edge to the Squeak entity.

func (*PoolUpdateOne) SetSqueakID

func (puo *PoolUpdateOne) SetSqueakID(id int) *PoolUpdateOne

SetSqueakID sets the "squeak" edge to the Squeak entity by ID.

func (*PoolUpdateOne) SetUpdateTime

func (puo *PoolUpdateOne) SetUpdateTime(t time.Time) *PoolUpdateOne

SetUpdateTime sets the "update_time" field.

type Pools

type Pools []*Pool

Pools is a parsable slice of Pool.

type Query

type Query = ent.Query

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

type Role

type Role struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleQuery when eager-loading is set.
	Edges RoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) QueryUsers

func (r *Role) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Role entity.

func (*Role) String

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) Unwrap

func (r *Role) Unwrap() *Role

Unwrap unwraps the Role entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Role) Update

func (r *Role) Update() *RoleUpdateOne

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

type RoleClient

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

RoleClient is a client for the Role schema.

func NewRoleClient

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create

func (c *RoleClient) Create() *RoleCreate

Create returns a builder for creating a Role entity.

func (*RoleClient) CreateBulk

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

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

func (*RoleClient) Delete

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleClient) DeleteOneID

func (c *RoleClient) DeleteOneID(id int) *RoleDeleteOne

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

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id int) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id int) *Role

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

func (*RoleClient) Hooks

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

Hooks returns the client hooks.

func (*RoleClient) Query

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) QueryUsers

func (c *RoleClient) QueryUsers(r *Role) *UserQuery

QueryUsers queries the users edge of a Role.

func (*RoleClient) Update

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID

func (c *RoleClient) UpdateOneID(id int) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use

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

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

type RoleCreate

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

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) AddUserIDs

func (rc *RoleCreate) AddUserIDs(ids ...int) *RoleCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleCreate) AddUsers

func (rc *RoleCreate) AddUsers(u ...*User) *RoleCreate

AddUsers adds the "users" edges to the User entity.

func (*RoleCreate) Exec

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecX

func (rc *RoleCreate) ExecX(ctx context.Context)

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

func (*RoleCreate) Mutation

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) Save

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

func (*RoleCreate) SetCreateTime

func (rc *RoleCreate) SetCreateTime(t time.Time) *RoleCreate

SetCreateTime sets the "create_time" field.

func (*RoleCreate) SetHash

func (rc *RoleCreate) SetHash(s string) *RoleCreate

SetHash sets the "hash" field.

func (*RoleCreate) SetNillableCreateTime

func (rc *RoleCreate) SetNillableCreateTime(t *time.Time) *RoleCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RoleCreate) SetNillableUpdateTime

func (rc *RoleCreate) SetNillableUpdateTime(t *time.Time) *RoleCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*RoleCreate) SetTitle

func (rc *RoleCreate) SetTitle(s string) *RoleCreate

SetTitle sets the "title" field.

func (*RoleCreate) SetUpdateTime

func (rc *RoleCreate) SetUpdateTime(t time.Time) *RoleCreate

SetUpdateTime sets the "update_time" field.

type RoleCreateBulk

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

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

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

func (*RoleCreateBulk) Save

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

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

type RoleDelete

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

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

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

func (*RoleDelete) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

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

func (*RoleDelete) Where

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne

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

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

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

type RoleEdges

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

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

func (RoleEdges) UsersOrErr

func (e RoleEdges) UsersOrErr() ([]*User, error)

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

type RoleGroupBy

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

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

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

func (*RoleGroupBy) Bool

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

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

func (*RoleGroupBy) BoolX

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

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

func (*RoleGroupBy) Bools

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

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

func (*RoleGroupBy) BoolsX

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

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

func (*RoleGroupBy) Float64

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

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

func (*RoleGroupBy) Float64X

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

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

func (*RoleGroupBy) Float64s

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

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

func (*RoleGroupBy) Float64sX

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

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

func (*RoleGroupBy) Int

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

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

func (*RoleGroupBy) IntX

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

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

func (*RoleGroupBy) Ints

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

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

func (*RoleGroupBy) IntsX

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

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

func (*RoleGroupBy) Scan

func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error

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

func (*RoleGroupBy) ScanX

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

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

func (*RoleGroupBy) String

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

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

func (*RoleGroupBy) StringX

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

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

func (*RoleGroupBy) Strings

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

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

func (*RoleGroupBy) StringsX

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

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

type RoleMutation

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

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddField

func (m *RoleMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*RoleMutation) AddUserIDs

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

AddUserIDs adds the "users" edge to the User entity by ids.

func (*RoleMutation) AddedEdges

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

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

func (*RoleMutation) AddedField

func (m *RoleMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*RoleMutation) AddedFields

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

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

func (*RoleMutation) AddedIDs

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

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

func (*RoleMutation) ClearEdge

func (m *RoleMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*RoleMutation) ClearField

func (m *RoleMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*RoleMutation) ClearUsers

func (m *RoleMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*RoleMutation) ClearedEdges

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

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

func (*RoleMutation) ClearedFields

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

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

func (RoleMutation) Client

func (m RoleMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*RoleMutation) CreateTime

func (m *RoleMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*RoleMutation) EdgeCleared

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

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

func (*RoleMutation) Field

func (m *RoleMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*RoleMutation) FieldCleared

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

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

func (*RoleMutation) Fields

func (m *RoleMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*RoleMutation) Hash

func (m *RoleMutation) Hash() (r string, exists bool)

Hash returns the value of the "hash" field in the mutation.

func (*RoleMutation) ID

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

func (m *RoleMutation) 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 (*RoleMutation) OldCreateTime

func (m *RoleMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*RoleMutation) OldField

func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*RoleMutation) OldHash

func (m *RoleMutation) OldHash(ctx context.Context) (v string, err error)

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

func (*RoleMutation) OldTitle

func (m *RoleMutation) OldTitle(ctx context.Context) (v string, err error)

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

func (*RoleMutation) OldUpdateTime

func (m *RoleMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

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

func (*RoleMutation) Op

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) RemoveUserIDs

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

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

func (*RoleMutation) RemovedEdges

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

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

func (*RoleMutation) RemovedIDs

func (m *RoleMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*RoleMutation) RemovedUsersIDs

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

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

func (*RoleMutation) ResetCreateTime

func (m *RoleMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RoleMutation) ResetEdge

func (m *RoleMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*RoleMutation) ResetField

func (m *RoleMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*RoleMutation) ResetHash

func (m *RoleMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*RoleMutation) ResetTitle

func (m *RoleMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*RoleMutation) ResetUpdateTime

func (m *RoleMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*RoleMutation) ResetUsers

func (m *RoleMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*RoleMutation) SetCreateTime

func (m *RoleMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*RoleMutation) SetField

func (m *RoleMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*RoleMutation) SetHash

func (m *RoleMutation) SetHash(s string)

SetHash sets the "hash" field.

func (*RoleMutation) SetTitle

func (m *RoleMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*RoleMutation) SetUpdateTime

func (m *RoleMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*RoleMutation) Title

func (m *RoleMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (RoleMutation) Tx

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

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

func (*RoleMutation) Type

func (m *RoleMutation) Type() string

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

func (*RoleMutation) UpdateTime

func (m *RoleMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*RoleMutation) UsersCleared

func (m *RoleMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*RoleMutation) UsersIDs

func (m *RoleMutation) UsersIDs() (ids []int)

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

func (*RoleMutation) Where

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

type RoleQuery

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

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) Aggregate

func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate returns a RoleSelect configured with the given aggregations.

func (*RoleQuery) All

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

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

func (*RoleQuery) Clone

func (rq *RoleQuery) Clone() *RoleQuery

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

func (*RoleQuery) Count

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX

func (rq *RoleQuery) CountX(ctx context.Context) int

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

func (*RoleQuery) Exist

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

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

func (*RoleQuery) ExistX

func (rq *RoleQuery) ExistX(ctx context.Context) bool

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

func (*RoleQuery) First

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

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

func (*RoleQuery) FirstID

func (rq *RoleQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*RoleQuery) FirstIDX

func (rq *RoleQuery) FirstIDX(ctx context.Context) int

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

func (*RoleQuery) FirstX

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

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

func (*RoleQuery) GroupBy

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

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

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Role.Query().
	GroupBy(role.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoleQuery) IDs

func (rq *RoleQuery) IDs(ctx context.Context) ([]int, error)

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

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []int

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

func (*RoleQuery) Limit

func (rq *RoleQuery) Limit(limit int) *RoleQuery

Limit adds a limit step to the query.

func (*RoleQuery) Offset

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset adds an offset step to the query.

func (*RoleQuery) Only

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

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

func (*RoleQuery) OnlyID

func (rq *RoleQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*RoleQuery) OnlyIDX

func (rq *RoleQuery) OnlyIDX(ctx context.Context) int

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

func (*RoleQuery) OnlyX

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

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

func (*RoleQuery) Order

func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery

Order adds an order step to the query.

func (*RoleQuery) QueryUsers

func (rq *RoleQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*RoleQuery) Select

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

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

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Role.Query().
	Select(role.FieldCreateTime).
	Scan(ctx, &v)

func (*RoleQuery) Unique

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*RoleQuery) Where

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

func (*RoleQuery) WithUsers

func (rq *RoleQuery) WithUsers(opts ...func(*UserQuery)) *RoleQuery

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 RoleSelect

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Aggregate

func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleSelect) Bool

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

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

func (*RoleSelect) BoolX

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

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

func (*RoleSelect) Bools

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

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

func (*RoleSelect) BoolsX

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

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

func (*RoleSelect) Float64

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

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

func (*RoleSelect) Float64X

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

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

func (*RoleSelect) Float64s

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

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

func (*RoleSelect) Float64sX

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

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

func (*RoleSelect) Int

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

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

func (*RoleSelect) IntX

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

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

func (*RoleSelect) Ints

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

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

func (*RoleSelect) IntsX

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

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

func (*RoleSelect) Scan

func (rs *RoleSelect) Scan(ctx context.Context, v any) error

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

func (*RoleSelect) ScanX

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

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

func (*RoleSelect) String

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

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

func (*RoleSelect) StringX

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

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

func (*RoleSelect) Strings

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

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

func (*RoleSelect) StringsX

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

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

type RoleUpdate

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

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) AddUserIDs

func (ru *RoleUpdate) AddUserIDs(ids ...int) *RoleUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleUpdate) AddUsers

func (ru *RoleUpdate) AddUsers(u ...*User) *RoleUpdate

AddUsers adds the "users" edges to the User entity.

func (*RoleUpdate) ClearUsers

func (ru *RoleUpdate) ClearUsers() *RoleUpdate

ClearUsers clears all "users" edges to the User entity.

func (*RoleUpdate) Exec

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

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

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) RemoveUserIDs

func (ru *RoleUpdate) RemoveUserIDs(ids ...int) *RoleUpdate

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

func (*RoleUpdate) RemoveUsers

func (ru *RoleUpdate) RemoveUsers(u ...*User) *RoleUpdate

RemoveUsers removes "users" edges to User entities.

func (*RoleUpdate) Save

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

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

func (*RoleUpdate) SaveX

func (ru *RoleUpdate) SaveX(ctx context.Context) int

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

func (*RoleUpdate) SetUpdateTime

func (ru *RoleUpdate) SetUpdateTime(t time.Time) *RoleUpdate

SetUpdateTime sets the "update_time" field.

func (*RoleUpdate) Where

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne

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

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) AddUserIDs

func (ruo *RoleUpdateOne) AddUserIDs(ids ...int) *RoleUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleUpdateOne) AddUsers

func (ruo *RoleUpdateOne) AddUsers(u ...*User) *RoleUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*RoleUpdateOne) ClearUsers

func (ruo *RoleUpdateOne) ClearUsers() *RoleUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*RoleUpdateOne) Exec

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

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

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) RemoveUserIDs

func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...int) *RoleUpdateOne

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

func (*RoleUpdateOne) RemoveUsers

func (ruo *RoleUpdateOne) RemoveUsers(u ...*User) *RoleUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*RoleUpdateOne) Save

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

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

func (*RoleUpdateOne) Select

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

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

func (*RoleUpdateOne) SetUpdateTime

func (ruo *RoleUpdateOne) SetUpdateTime(t time.Time) *RoleUpdateOne

SetUpdateTime sets the "update_time" field.

type Roles

type Roles []*Role

Roles is a parsable slice of Role.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Squeak

type Squeak struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// BlockNumber holds the value of the "block_number" field.
	BlockNumber *types.Uint256 `json:"block_number,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SqueakQuery when eager-loading is set.
	Edges SqueakEdges `json:"edges"`
	// contains filtered or unexported fields
}

Squeak is the model entity for the Squeak schema.

func (*Squeak) QueryCreator

func (s *Squeak) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Squeak entity.

func (*Squeak) QueryInteractions

func (s *Squeak) QueryInteractions() *InteractionQuery

QueryInteractions queries the "interactions" edge of the Squeak entity.

func (*Squeak) QueryOwner

func (s *Squeak) QueryOwner() *UserQuery

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

func (*Squeak) QueryPool

func (s *Squeak) QueryPool() *PoolQuery

QueryPool queries the "pool" edge of the Squeak entity.

func (*Squeak) String

func (s *Squeak) String() string

String implements the fmt.Stringer.

func (*Squeak) Unwrap

func (s *Squeak) Unwrap() *Squeak

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

func (s *Squeak) Update() *SqueakUpdateOne

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

type SqueakClient

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

SqueakClient is a client for the Squeak schema.

func NewSqueakClient

func NewSqueakClient(c config) *SqueakClient

NewSqueakClient returns a client for the Squeak from the given config.

func (*SqueakClient) Create

func (c *SqueakClient) Create() *SqueakCreate

Create returns a builder for creating a Squeak entity.

func (*SqueakClient) CreateBulk

func (c *SqueakClient) CreateBulk(builders ...*SqueakCreate) *SqueakCreateBulk

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

func (*SqueakClient) Delete

func (c *SqueakClient) Delete() *SqueakDelete

Delete returns a delete builder for Squeak.

func (*SqueakClient) DeleteOne

func (c *SqueakClient) DeleteOne(s *Squeak) *SqueakDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SqueakClient) DeleteOneID

func (c *SqueakClient) DeleteOneID(id int) *SqueakDeleteOne

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

func (*SqueakClient) Get

func (c *SqueakClient) Get(ctx context.Context, id int) (*Squeak, error)

Get returns a Squeak entity by its id.

func (*SqueakClient) GetX

func (c *SqueakClient) GetX(ctx context.Context, id int) *Squeak

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

func (*SqueakClient) Hooks

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

Hooks returns the client hooks.

func (*SqueakClient) Query

func (c *SqueakClient) Query() *SqueakQuery

Query returns a query builder for Squeak.

func (*SqueakClient) QueryCreator

func (c *SqueakClient) QueryCreator(s *Squeak) *UserQuery

QueryCreator queries the creator edge of a Squeak.

func (*SqueakClient) QueryInteractions

func (c *SqueakClient) QueryInteractions(s *Squeak) *InteractionQuery

QueryInteractions queries the interactions edge of a Squeak.

func (*SqueakClient) QueryOwner

func (c *SqueakClient) QueryOwner(s *Squeak) *UserQuery

QueryOwner queries the owner edge of a Squeak.

func (*SqueakClient) QueryPool

func (c *SqueakClient) QueryPool(s *Squeak) *PoolQuery

QueryPool queries the pool edge of a Squeak.

func (*SqueakClient) Update

func (c *SqueakClient) Update() *SqueakUpdate

Update returns an update builder for Squeak.

func (*SqueakClient) UpdateOne

func (c *SqueakClient) UpdateOne(s *Squeak) *SqueakUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SqueakClient) UpdateOneID

func (c *SqueakClient) UpdateOneID(id int) *SqueakUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SqueakClient) Use

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

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

type SqueakCreate

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

SqueakCreate is the builder for creating a Squeak entity.

func (*SqueakCreate) AddInteractionIDs

func (sc *SqueakCreate) AddInteractionIDs(ids ...int) *SqueakCreate

AddInteractionIDs adds the "interactions" edge to the Interaction entity by IDs.

func (*SqueakCreate) AddInteractions

func (sc *SqueakCreate) AddInteractions(i ...*Interaction) *SqueakCreate

AddInteractions adds the "interactions" edges to the Interaction entity.

func (*SqueakCreate) Exec

func (sc *SqueakCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SqueakCreate) ExecX

func (sc *SqueakCreate) ExecX(ctx context.Context)

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

func (*SqueakCreate) Mutation

func (sc *SqueakCreate) Mutation() *SqueakMutation

Mutation returns the SqueakMutation object of the builder.

func (*SqueakCreate) Save

func (sc *SqueakCreate) Save(ctx context.Context) (*Squeak, error)

Save creates the Squeak in the database.

func (*SqueakCreate) SaveX

func (sc *SqueakCreate) SaveX(ctx context.Context) *Squeak

SaveX calls Save and panics if Save returns an error.

func (*SqueakCreate) SetBlockNumber

func (sc *SqueakCreate) SetBlockNumber(t *types.Uint256) *SqueakCreate

SetBlockNumber sets the "block_number" field.

func (*SqueakCreate) SetContent

func (sc *SqueakCreate) SetContent(s string) *SqueakCreate

SetContent sets the "content" field.

func (*SqueakCreate) SetCreateTime

func (sc *SqueakCreate) SetCreateTime(t time.Time) *SqueakCreate

SetCreateTime sets the "create_time" field.

func (*SqueakCreate) SetCreator

func (sc *SqueakCreate) SetCreator(u *User) *SqueakCreate

SetCreator sets the "creator" edge to the User entity.

func (*SqueakCreate) SetCreatorID

func (sc *SqueakCreate) SetCreatorID(id int) *SqueakCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*SqueakCreate) SetNillableCreateTime

func (sc *SqueakCreate) SetNillableCreateTime(t *time.Time) *SqueakCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SqueakCreate) SetNillableCreatorID

func (sc *SqueakCreate) SetNillableCreatorID(id *int) *SqueakCreate

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

func (*SqueakCreate) SetNillableOwnerID

func (sc *SqueakCreate) SetNillableOwnerID(id *int) *SqueakCreate

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

func (*SqueakCreate) SetNillablePoolID

func (sc *SqueakCreate) SetNillablePoolID(id *int) *SqueakCreate

SetNillablePoolID sets the "pool" edge to the Pool entity by ID if the given value is not nil.

func (*SqueakCreate) SetOwner

func (sc *SqueakCreate) SetOwner(u *User) *SqueakCreate

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

func (*SqueakCreate) SetOwnerID

func (sc *SqueakCreate) SetOwnerID(id int) *SqueakCreate

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

func (*SqueakCreate) SetPool

func (sc *SqueakCreate) SetPool(p *Pool) *SqueakCreate

SetPool sets the "pool" edge to the Pool entity.

func (*SqueakCreate) SetPoolID

func (sc *SqueakCreate) SetPoolID(id int) *SqueakCreate

SetPoolID sets the "pool" edge to the Pool entity by ID.

type SqueakCreateBulk

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

SqueakCreateBulk is the builder for creating many Squeak entities in bulk.

func (*SqueakCreateBulk) Exec

func (scb *SqueakCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SqueakCreateBulk) ExecX

func (scb *SqueakCreateBulk) ExecX(ctx context.Context)

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

func (*SqueakCreateBulk) Save

func (scb *SqueakCreateBulk) Save(ctx context.Context) ([]*Squeak, error)

Save creates the Squeak entities in the database.

func (*SqueakCreateBulk) SaveX

func (scb *SqueakCreateBulk) SaveX(ctx context.Context) []*Squeak

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

type SqueakDelete

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

SqueakDelete is the builder for deleting a Squeak entity.

func (*SqueakDelete) Exec

func (sd *SqueakDelete) Exec(ctx context.Context) (int, error)

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

func (*SqueakDelete) ExecX

func (sd *SqueakDelete) ExecX(ctx context.Context) int

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

func (*SqueakDelete) Where

func (sd *SqueakDelete) Where(ps ...predicate.Squeak) *SqueakDelete

Where appends a list predicates to the SqueakDelete builder.

type SqueakDeleteOne

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

SqueakDeleteOne is the builder for deleting a single Squeak entity.

func (*SqueakDeleteOne) Exec

func (sdo *SqueakDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SqueakDeleteOne) ExecX

func (sdo *SqueakDeleteOne) ExecX(ctx context.Context)

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

type SqueakEdges

type SqueakEdges struct {
	// Interactions holds the value of the interactions edge.
	Interactions []*Interaction `json:"interactions,omitempty"`
	// Pool holds the value of the pool edge.
	Pool *Pool `json:"pool,omitempty"`
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (SqueakEdges) CreatorOrErr

func (e SqueakEdges) CreatorOrErr() (*User, error)

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

func (SqueakEdges) InteractionsOrErr

func (e SqueakEdges) InteractionsOrErr() ([]*Interaction, error)

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

func (SqueakEdges) OwnerOrErr

func (e SqueakEdges) 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.

func (SqueakEdges) PoolOrErr

func (e SqueakEdges) PoolOrErr() (*Pool, error)

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

type SqueakGroupBy

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

SqueakGroupBy is the group-by builder for Squeak entities.

func (*SqueakGroupBy) Aggregate

func (sgb *SqueakGroupBy) Aggregate(fns ...AggregateFunc) *SqueakGroupBy

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

func (*SqueakGroupBy) Bool

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

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

func (*SqueakGroupBy) BoolX

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

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

func (*SqueakGroupBy) Bools

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

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

func (*SqueakGroupBy) BoolsX

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

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

func (*SqueakGroupBy) Float64

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

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

func (*SqueakGroupBy) Float64X

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

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

func (*SqueakGroupBy) Float64s

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

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

func (*SqueakGroupBy) Float64sX

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

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

func (*SqueakGroupBy) Int

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

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

func (*SqueakGroupBy) IntX

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

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

func (*SqueakGroupBy) Ints

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

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

func (*SqueakGroupBy) IntsX

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

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

func (*SqueakGroupBy) Scan

func (sgb *SqueakGroupBy) Scan(ctx context.Context, v any) error

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

func (*SqueakGroupBy) ScanX

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

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

func (*SqueakGroupBy) String

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

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

func (*SqueakGroupBy) StringX

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

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

func (*SqueakGroupBy) Strings

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

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

func (*SqueakGroupBy) StringsX

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

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

type SqueakMutation

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

SqueakMutation represents an operation that mutates the Squeak nodes in the graph.

func (*SqueakMutation) AddField

func (m *SqueakMutation) 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 (*SqueakMutation) AddInteractionIDs

func (m *SqueakMutation) AddInteractionIDs(ids ...int)

AddInteractionIDs adds the "interactions" edge to the Interaction entity by ids.

func (*SqueakMutation) AddedEdges

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

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

func (*SqueakMutation) AddedField

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

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

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

func (*SqueakMutation) AddedIDs

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

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

func (*SqueakMutation) BlockNumber

func (m *SqueakMutation) BlockNumber() (r *types.Uint256, exists bool)

BlockNumber returns the value of the "block_number" field in the mutation.

func (*SqueakMutation) ClearCreator

func (m *SqueakMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

func (*SqueakMutation) ClearEdge

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

func (m *SqueakMutation) 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 (*SqueakMutation) ClearInteractions

func (m *SqueakMutation) ClearInteractions()

ClearInteractions clears the "interactions" edge to the Interaction entity.

func (*SqueakMutation) ClearOwner

func (m *SqueakMutation) ClearOwner()

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

func (*SqueakMutation) ClearPool

func (m *SqueakMutation) ClearPool()

ClearPool clears the "pool" edge to the Pool entity.

func (*SqueakMutation) ClearedEdges

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

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

func (*SqueakMutation) ClearedFields

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

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

func (SqueakMutation) Client

func (m SqueakMutation) 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 (*SqueakMutation) Content

func (m *SqueakMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*SqueakMutation) CreateTime

func (m *SqueakMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*SqueakMutation) CreatorCleared

func (m *SqueakMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*SqueakMutation) CreatorID

func (m *SqueakMutation) CreatorID() (id int, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*SqueakMutation) CreatorIDs

func (m *SqueakMutation) CreatorIDs() (ids []int)

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

func (*SqueakMutation) EdgeCleared

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

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

func (*SqueakMutation) Field

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

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

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

func (*SqueakMutation) Fields

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

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

func (m *SqueakMutation) 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 (*SqueakMutation) InteractionsCleared

func (m *SqueakMutation) InteractionsCleared() bool

InteractionsCleared reports if the "interactions" edge to the Interaction entity was cleared.

func (*SqueakMutation) InteractionsIDs

func (m *SqueakMutation) InteractionsIDs() (ids []int)

InteractionsIDs returns the "interactions" edge IDs in the mutation.

func (*SqueakMutation) OldBlockNumber

func (m *SqueakMutation) OldBlockNumber(ctx context.Context) (v *types.Uint256, err error)

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

func (*SqueakMutation) OldContent

func (m *SqueakMutation) OldContent(ctx context.Context) (v string, err error)

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

func (*SqueakMutation) OldCreateTime

func (m *SqueakMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*SqueakMutation) OldField

func (m *SqueakMutation) 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 (*SqueakMutation) Op

func (m *SqueakMutation) Op() Op

Op returns the operation name.

func (*SqueakMutation) OwnerCleared

func (m *SqueakMutation) OwnerCleared() bool

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

func (*SqueakMutation) OwnerID

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

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

func (*SqueakMutation) OwnerIDs

func (m *SqueakMutation) 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 (*SqueakMutation) PoolCleared

func (m *SqueakMutation) PoolCleared() bool

PoolCleared reports if the "pool" edge to the Pool entity was cleared.

func (*SqueakMutation) PoolID

func (m *SqueakMutation) PoolID() (id int, exists bool)

PoolID returns the "pool" edge ID in the mutation.

func (*SqueakMutation) PoolIDs

func (m *SqueakMutation) PoolIDs() (ids []int)

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

func (*SqueakMutation) RemoveInteractionIDs

func (m *SqueakMutation) RemoveInteractionIDs(ids ...int)

RemoveInteractionIDs removes the "interactions" edge to the Interaction entity by IDs.

func (*SqueakMutation) RemovedEdges

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

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

func (*SqueakMutation) RemovedIDs

func (m *SqueakMutation) 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 (*SqueakMutation) RemovedInteractionsIDs

func (m *SqueakMutation) RemovedInteractionsIDs() (ids []int)

RemovedInteractions returns the removed IDs of the "interactions" edge to the Interaction entity.

func (*SqueakMutation) ResetBlockNumber

func (m *SqueakMutation) ResetBlockNumber()

ResetBlockNumber resets all changes to the "block_number" field.

func (*SqueakMutation) ResetContent

func (m *SqueakMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*SqueakMutation) ResetCreateTime

func (m *SqueakMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SqueakMutation) ResetCreator

func (m *SqueakMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*SqueakMutation) ResetEdge

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

func (m *SqueakMutation) 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 (*SqueakMutation) ResetInteractions

func (m *SqueakMutation) ResetInteractions()

ResetInteractions resets all changes to the "interactions" edge.

func (*SqueakMutation) ResetOwner

func (m *SqueakMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*SqueakMutation) ResetPool

func (m *SqueakMutation) ResetPool()

ResetPool resets all changes to the "pool" edge.

func (*SqueakMutation) SetBlockNumber

func (m *SqueakMutation) SetBlockNumber(t *types.Uint256)

SetBlockNumber sets the "block_number" field.

func (*SqueakMutation) SetContent

func (m *SqueakMutation) SetContent(s string)

SetContent sets the "content" field.

func (*SqueakMutation) SetCreateTime

func (m *SqueakMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SqueakMutation) SetCreatorID

func (m *SqueakMutation) SetCreatorID(id int)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*SqueakMutation) SetField

func (m *SqueakMutation) 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 (*SqueakMutation) SetOwnerID

func (m *SqueakMutation) SetOwnerID(id int)

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

func (*SqueakMutation) SetPoolID

func (m *SqueakMutation) SetPoolID(id int)

SetPoolID sets the "pool" edge to the Pool entity by id.

func (SqueakMutation) Tx

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

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

func (*SqueakMutation) Type

func (m *SqueakMutation) Type() string

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

func (*SqueakMutation) Where

func (m *SqueakMutation) Where(ps ...predicate.Squeak)

Where appends a list predicates to the SqueakMutation builder.

type SqueakQuery

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

SqueakQuery is the builder for querying Squeak entities.

func (*SqueakQuery) Aggregate

func (sq *SqueakQuery) Aggregate(fns ...AggregateFunc) *SqueakSelect

Aggregate returns a SqueakSelect configured with the given aggregations.

func (*SqueakQuery) All

func (sq *SqueakQuery) All(ctx context.Context) ([]*Squeak, error)

All executes the query and returns a list of Squeaks.

func (*SqueakQuery) AllX

func (sq *SqueakQuery) AllX(ctx context.Context) []*Squeak

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

func (*SqueakQuery) Clone

func (sq *SqueakQuery) Clone() *SqueakQuery

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

func (*SqueakQuery) Count

func (sq *SqueakQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SqueakQuery) CountX

func (sq *SqueakQuery) CountX(ctx context.Context) int

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

func (*SqueakQuery) Exist

func (sq *SqueakQuery) Exist(ctx context.Context) (bool, error)

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

func (*SqueakQuery) ExistX

func (sq *SqueakQuery) ExistX(ctx context.Context) bool

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

func (*SqueakQuery) First

func (sq *SqueakQuery) First(ctx context.Context) (*Squeak, error)

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

func (*SqueakQuery) FirstID

func (sq *SqueakQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SqueakQuery) FirstIDX

func (sq *SqueakQuery) FirstIDX(ctx context.Context) int

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

func (*SqueakQuery) FirstX

func (sq *SqueakQuery) FirstX(ctx context.Context) *Squeak

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

func (*SqueakQuery) GroupBy

func (sq *SqueakQuery) GroupBy(field string, fields ...string) *SqueakGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Squeak.Query().
	GroupBy(squeak.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SqueakQuery) IDs

func (sq *SqueakQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SqueakQuery) IDsX

func (sq *SqueakQuery) IDsX(ctx context.Context) []int

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

func (*SqueakQuery) Limit

func (sq *SqueakQuery) Limit(limit int) *SqueakQuery

Limit adds a limit step to the query.

func (*SqueakQuery) Offset

func (sq *SqueakQuery) Offset(offset int) *SqueakQuery

Offset adds an offset step to the query.

func (*SqueakQuery) Only

func (sq *SqueakQuery) Only(ctx context.Context) (*Squeak, error)

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

func (*SqueakQuery) OnlyID

func (sq *SqueakQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SqueakQuery) OnlyIDX

func (sq *SqueakQuery) OnlyIDX(ctx context.Context) int

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

func (*SqueakQuery) OnlyX

func (sq *SqueakQuery) OnlyX(ctx context.Context) *Squeak

OnlyX is like Only, but panics if an error occurs.

func (*SqueakQuery) Order

func (sq *SqueakQuery) Order(o ...OrderFunc) *SqueakQuery

Order adds an order step to the query.

func (*SqueakQuery) QueryCreator

func (sq *SqueakQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*SqueakQuery) QueryInteractions

func (sq *SqueakQuery) QueryInteractions() *InteractionQuery

QueryInteractions chains the current query on the "interactions" edge.

func (*SqueakQuery) QueryOwner

func (sq *SqueakQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*SqueakQuery) QueryPool

func (sq *SqueakQuery) QueryPool() *PoolQuery

QueryPool chains the current query on the "pool" edge.

func (*SqueakQuery) Select

func (sq *SqueakQuery) Select(fields ...string) *SqueakSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Squeak.Query().
	Select(squeak.FieldCreateTime).
	Scan(ctx, &v)

func (*SqueakQuery) Unique

func (sq *SqueakQuery) Unique(unique bool) *SqueakQuery

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 (*SqueakQuery) Where

func (sq *SqueakQuery) Where(ps ...predicate.Squeak) *SqueakQuery

Where adds a new predicate for the SqueakQuery builder.

func (*SqueakQuery) WithCreator

func (sq *SqueakQuery) WithCreator(opts ...func(*UserQuery)) *SqueakQuery

WithCreator tells the query-builder to eager-load the nodes that are connected to the "creator" edge. The optional arguments are used to configure the query builder of the edge.

func (*SqueakQuery) WithInteractions

func (sq *SqueakQuery) WithInteractions(opts ...func(*InteractionQuery)) *SqueakQuery

WithInteractions tells the query-builder to eager-load the nodes that are connected to the "interactions" edge. The optional arguments are used to configure the query builder of the edge.

func (*SqueakQuery) WithOwner

func (sq *SqueakQuery) WithOwner(opts ...func(*UserQuery)) *SqueakQuery

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.

func (*SqueakQuery) WithPool

func (sq *SqueakQuery) WithPool(opts ...func(*PoolQuery)) *SqueakQuery

WithPool tells the query-builder to eager-load the nodes that are connected to the "pool" edge. The optional arguments are used to configure the query builder of the edge.

type SqueakSelect

type SqueakSelect struct {
	*SqueakQuery
	// contains filtered or unexported fields
}

SqueakSelect is the builder for selecting fields of Squeak entities.

func (*SqueakSelect) Aggregate

func (ss *SqueakSelect) Aggregate(fns ...AggregateFunc) *SqueakSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SqueakSelect) Bool

func (s *SqueakSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) BoolX

func (s *SqueakSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SqueakSelect) Bools

func (s *SqueakSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) BoolsX

func (s *SqueakSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SqueakSelect) Float64

func (s *SqueakSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) Float64X

func (s *SqueakSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SqueakSelect) Float64s

func (s *SqueakSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) Float64sX

func (s *SqueakSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SqueakSelect) Int

func (s *SqueakSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) IntX

func (s *SqueakSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SqueakSelect) Ints

func (s *SqueakSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) IntsX

func (s *SqueakSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SqueakSelect) Scan

func (ss *SqueakSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SqueakSelect) ScanX

func (s *SqueakSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SqueakSelect) String

func (s *SqueakSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) StringX

func (s *SqueakSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SqueakSelect) Strings

func (s *SqueakSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SqueakSelect) StringsX

func (s *SqueakSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SqueakUpdate

type SqueakUpdate struct {
	// contains filtered or unexported fields
}

SqueakUpdate is the builder for updating Squeak entities.

func (*SqueakUpdate) AddInteractionIDs

func (su *SqueakUpdate) AddInteractionIDs(ids ...int) *SqueakUpdate

AddInteractionIDs adds the "interactions" edge to the Interaction entity by IDs.

func (*SqueakUpdate) AddInteractions

func (su *SqueakUpdate) AddInteractions(i ...*Interaction) *SqueakUpdate

AddInteractions adds the "interactions" edges to the Interaction entity.

func (*SqueakUpdate) ClearCreator

func (su *SqueakUpdate) ClearCreator() *SqueakUpdate

ClearCreator clears the "creator" edge to the User entity.

func (*SqueakUpdate) ClearInteractions

func (su *SqueakUpdate) ClearInteractions() *SqueakUpdate

ClearInteractions clears all "interactions" edges to the Interaction entity.

func (*SqueakUpdate) ClearOwner

func (su *SqueakUpdate) ClearOwner() *SqueakUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*SqueakUpdate) ClearPool

func (su *SqueakUpdate) ClearPool() *SqueakUpdate

ClearPool clears the "pool" edge to the Pool entity.

func (*SqueakUpdate) Exec

func (su *SqueakUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SqueakUpdate) ExecX

func (su *SqueakUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SqueakUpdate) Mutation

func (su *SqueakUpdate) Mutation() *SqueakMutation

Mutation returns the SqueakMutation object of the builder.

func (*SqueakUpdate) RemoveInteractionIDs

func (su *SqueakUpdate) RemoveInteractionIDs(ids ...int) *SqueakUpdate

RemoveInteractionIDs removes the "interactions" edge to Interaction entities by IDs.

func (*SqueakUpdate) RemoveInteractions

func (su *SqueakUpdate) RemoveInteractions(i ...*Interaction) *SqueakUpdate

RemoveInteractions removes "interactions" edges to Interaction entities.

func (*SqueakUpdate) Save

func (su *SqueakUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SqueakUpdate) SaveX

func (su *SqueakUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SqueakUpdate) SetBlockNumber

func (su *SqueakUpdate) SetBlockNumber(t *types.Uint256) *SqueakUpdate

SetBlockNumber sets the "block_number" field.

func (*SqueakUpdate) SetCreator

func (su *SqueakUpdate) SetCreator(u *User) *SqueakUpdate

SetCreator sets the "creator" edge to the User entity.

func (*SqueakUpdate) SetCreatorID

func (su *SqueakUpdate) SetCreatorID(id int) *SqueakUpdate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*SqueakUpdate) SetNillableCreatorID

func (su *SqueakUpdate) SetNillableCreatorID(id *int) *SqueakUpdate

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*SqueakUpdate) SetNillableOwnerID

func (su *SqueakUpdate) SetNillableOwnerID(id *int) *SqueakUpdate

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*SqueakUpdate) SetNillablePoolID

func (su *SqueakUpdate) SetNillablePoolID(id *int) *SqueakUpdate

SetNillablePoolID sets the "pool" edge to the Pool entity by ID if the given value is not nil.

func (*SqueakUpdate) SetOwner

func (su *SqueakUpdate) SetOwner(u *User) *SqueakUpdate

SetOwner sets the "owner" edge to the User entity.

func (*SqueakUpdate) SetOwnerID

func (su *SqueakUpdate) SetOwnerID(id int) *SqueakUpdate

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*SqueakUpdate) SetPool

func (su *SqueakUpdate) SetPool(p *Pool) *SqueakUpdate

SetPool sets the "pool" edge to the Pool entity.

func (*SqueakUpdate) SetPoolID

func (su *SqueakUpdate) SetPoolID(id int) *SqueakUpdate

SetPoolID sets the "pool" edge to the Pool entity by ID.

func (*SqueakUpdate) Where

func (su *SqueakUpdate) Where(ps ...predicate.Squeak) *SqueakUpdate

Where appends a list predicates to the SqueakUpdate builder.

type SqueakUpdateOne

type SqueakUpdateOne struct {
	// contains filtered or unexported fields
}

SqueakUpdateOne is the builder for updating a single Squeak entity.

func (*SqueakUpdateOne) AddInteractionIDs

func (suo *SqueakUpdateOne) AddInteractionIDs(ids ...int) *SqueakUpdateOne

AddInteractionIDs adds the "interactions" edge to the Interaction entity by IDs.

func (*SqueakUpdateOne) AddInteractions

func (suo *SqueakUpdateOne) AddInteractions(i ...*Interaction) *SqueakUpdateOne

AddInteractions adds the "interactions" edges to the Interaction entity.

func (*SqueakUpdateOne) ClearCreator

func (suo *SqueakUpdateOne) ClearCreator() *SqueakUpdateOne

ClearCreator clears the "creator" edge to the User entity.

func (*SqueakUpdateOne) ClearInteractions

func (suo *SqueakUpdateOne) ClearInteractions() *SqueakUpdateOne

ClearInteractions clears all "interactions" edges to the Interaction entity.

func (*SqueakUpdateOne) ClearOwner

func (suo *SqueakUpdateOne) ClearOwner() *SqueakUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*SqueakUpdateOne) ClearPool

func (suo *SqueakUpdateOne) ClearPool() *SqueakUpdateOne

ClearPool clears the "pool" edge to the Pool entity.

func (*SqueakUpdateOne) Exec

func (suo *SqueakUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SqueakUpdateOne) ExecX

func (suo *SqueakUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SqueakUpdateOne) Mutation

func (suo *SqueakUpdateOne) Mutation() *SqueakMutation

Mutation returns the SqueakMutation object of the builder.

func (*SqueakUpdateOne) RemoveInteractionIDs

func (suo *SqueakUpdateOne) RemoveInteractionIDs(ids ...int) *SqueakUpdateOne

RemoveInteractionIDs removes the "interactions" edge to Interaction entities by IDs.

func (*SqueakUpdateOne) RemoveInteractions

func (suo *SqueakUpdateOne) RemoveInteractions(i ...*Interaction) *SqueakUpdateOne

RemoveInteractions removes "interactions" edges to Interaction entities.

func (*SqueakUpdateOne) Save

func (suo *SqueakUpdateOne) Save(ctx context.Context) (*Squeak, error)

Save executes the query and returns the updated Squeak entity.

func (*SqueakUpdateOne) SaveX

func (suo *SqueakUpdateOne) SaveX(ctx context.Context) *Squeak

SaveX is like Save, but panics if an error occurs.

func (*SqueakUpdateOne) Select

func (suo *SqueakUpdateOne) Select(field string, fields ...string) *SqueakUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SqueakUpdateOne) SetBlockNumber

func (suo *SqueakUpdateOne) SetBlockNumber(t *types.Uint256) *SqueakUpdateOne

SetBlockNumber sets the "block_number" field.

func (*SqueakUpdateOne) SetCreator

func (suo *SqueakUpdateOne) SetCreator(u *User) *SqueakUpdateOne

SetCreator sets the "creator" edge to the User entity.

func (*SqueakUpdateOne) SetCreatorID

func (suo *SqueakUpdateOne) SetCreatorID(id int) *SqueakUpdateOne

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*SqueakUpdateOne) SetNillableCreatorID

func (suo *SqueakUpdateOne) SetNillableCreatorID(id *int) *SqueakUpdateOne

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*SqueakUpdateOne) SetNillableOwnerID

func (suo *SqueakUpdateOne) SetNillableOwnerID(id *int) *SqueakUpdateOne

SetNillableOwnerID sets the "owner" edge to the User entity by ID if the given value is not nil.

func (*SqueakUpdateOne) SetNillablePoolID

func (suo *SqueakUpdateOne) SetNillablePoolID(id *int) *SqueakUpdateOne

SetNillablePoolID sets the "pool" edge to the Pool entity by ID if the given value is not nil.

func (*SqueakUpdateOne) SetOwner

func (suo *SqueakUpdateOne) SetOwner(u *User) *SqueakUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*SqueakUpdateOne) SetOwnerID

func (suo *SqueakUpdateOne) SetOwnerID(id int) *SqueakUpdateOne

SetOwnerID sets the "owner" edge to the User entity by ID.

func (*SqueakUpdateOne) SetPool

func (suo *SqueakUpdateOne) SetPool(p *Pool) *SqueakUpdateOne

SetPool sets the "pool" edge to the Pool entity.

func (*SqueakUpdateOne) SetPoolID

func (suo *SqueakUpdateOne) SetPoolID(id int) *SqueakUpdateOne

SetPoolID sets the "pool" edge to the Pool entity by ID.

type Squeaks

type Squeaks []*Squeak

Squeaks is a parsable slice of Squeak.

type Tx

type Tx struct {

	// Interaction is the client for interacting with the Interaction builders.
	Interaction *InteractionClient
	// Pool is the client for interacting with the Pool builders.
	Pool *PoolClient
	// PoolPass is the client for interacting with the PoolPass builders.
	PoolPass *PoolPassClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Squeak is the client for interacting with the Squeak builders.
	Squeak *SqueakClient
	// 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"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Status holds the value of the "status" field.
	Status user.Status `json:"status,omitempty"`
	// Level holds the value of the "level" field.
	Level int8 `json:"level,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) QueryCreated

func (u *User) QueryCreated() *SqueakQuery

QueryCreated queries the "created" edge of the User entity.

func (*User) QueryFollowers

func (u *User) QueryFollowers() *UserQuery

QueryFollowers queries the "followers" edge of the User entity.

func (*User) QueryFollowing

func (u *User) QueryFollowing() *UserQuery

QueryFollowing queries the "following" edge of the User entity.

func (*User) QueryInteractions

func (u *User) QueryInteractions() *InteractionQuery

QueryInteractions queries the "interactions" edge of the User entity.

func (*User) QueryOwned

func (u *User) QueryOwned() *SqueakQuery

QueryOwned queries the "owned" edge of the User entity.

func (*User) QueryPoolPasses

func (u *User) QueryPoolPasses() *PoolPassQuery

QueryPoolPasses queries the "pool_passes" edge of the User entity.

func (*User) QueryRoles

func (u *User) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryCreated

func (c *UserClient) QueryCreated(u *User) *SqueakQuery

QueryCreated queries the created edge of a User.

func (*UserClient) QueryFollowers

func (c *UserClient) QueryFollowers(u *User) *UserQuery

QueryFollowers queries the followers edge of a User.

func (*UserClient) QueryFollowing

func (c *UserClient) QueryFollowing(u *User) *UserQuery

QueryFollowing queries the following edge of a User.

func (*UserClient) QueryInteractions

func (c *UserClient) QueryInteractions(u *User) *InteractionQuery

QueryInteractions queries the interactions edge of a User.

func (*UserClient) QueryOwned

func (c *UserClient) QueryOwned(u *User) *SqueakQuery

QueryOwned queries the owned edge of a User.

func (*UserClient) QueryPoolPasses

func (c *UserClient) QueryPoolPasses(u *User) *PoolPassQuery

QueryPoolPasses queries the pool_passes edge of a User.

func (*UserClient) QueryRoles

func (c *UserClient) QueryRoles(u *User) *RoleQuery

QueryRoles queries the roles 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) AddCreated

func (uc *UserCreate) AddCreated(s ...*Squeak) *UserCreate

AddCreated adds the "created" edges to the Squeak entity.

func (*UserCreate) AddCreatedIDs

func (uc *UserCreate) AddCreatedIDs(ids ...int) *UserCreate

AddCreatedIDs adds the "created" edge to the Squeak entity by IDs.

func (*UserCreate) AddFollowerIDs

func (uc *UserCreate) AddFollowerIDs(ids ...int) *UserCreate

AddFollowerIDs adds the "followers" edge to the User entity by IDs.

func (*UserCreate) AddFollowers

func (uc *UserCreate) AddFollowers(u ...*User) *UserCreate

AddFollowers adds the "followers" edges to the User entity.

func (*UserCreate) AddFollowing

func (uc *UserCreate) AddFollowing(u ...*User) *UserCreate

AddFollowing adds the "following" edges to the User entity.

func (*UserCreate) AddFollowingIDs

func (uc *UserCreate) AddFollowingIDs(ids ...int) *UserCreate

AddFollowingIDs adds the "following" edge to the User entity by IDs.

func (*UserCreate) AddInteractionIDs

func (uc *UserCreate) AddInteractionIDs(ids ...int) *UserCreate

AddInteractionIDs adds the "interactions" edge to the Interaction entity by IDs.

func (*UserCreate) AddInteractions

func (uc *UserCreate) AddInteractions(i ...*Interaction) *UserCreate

AddInteractions adds the "interactions" edges to the Interaction entity.

func (*UserCreate) AddOwned

func (uc *UserCreate) AddOwned(s ...*Squeak) *UserCreate

AddOwned adds the "owned" edges to the Squeak entity.

func (*UserCreate) AddOwnedIDs

func (uc *UserCreate) AddOwnedIDs(ids ...int) *UserCreate

AddOwnedIDs adds the "owned" edge to the Squeak entity by IDs.

func (*UserCreate) AddPoolPassIDs

func (uc *UserCreate) AddPoolPassIDs(ids ...int) *UserCreate

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by IDs.

func (*UserCreate) AddPoolPasses

func (uc *UserCreate) AddPoolPasses(p ...*PoolPass) *UserCreate

AddPoolPasses adds the "pool_passes" edges to the PoolPass entity.

func (*UserCreate) AddRoleIDs

func (uc *UserCreate) AddRoleIDs(ids ...int) *UserCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserCreate) AddRoles

func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate

AddRoles adds the "roles" edges to the Role entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) 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) SetAddress

func (uc *UserCreate) SetAddress(s string) *UserCreate

SetAddress sets the "address" field.

func (*UserCreate) SetCreateTime

func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetLevel

func (uc *UserCreate) SetLevel(i int8) *UserCreate

SetLevel sets the "level" field.

func (*UserCreate) SetNillableCreateTime

func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserCreate) SetNillableLevel

func (uc *UserCreate) SetNillableLevel(i *int8) *UserCreate

SetNillableLevel sets the "level" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime

func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserCreate) SetStatus

func (uc *UserCreate) SetStatus(u user.Status) *UserCreate

SetStatus sets the "status" field.

func (*UserCreate) SetUpdateTime

func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate

SetUpdateTime sets the "update_time" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" 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 {
	// Interactions holds the value of the interactions edge.
	Interactions []*Interaction `json:"interactions,omitempty"`
	// PoolPasses holds the value of the pool_passes edge.
	PoolPasses []*PoolPass `json:"pool_passes,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// Created holds the value of the created edge.
	Created []*Squeak `json:"created,omitempty"`
	// Owned holds the value of the owned edge.
	Owned []*Squeak `json:"owned,omitempty"`
	// Followers holds the value of the followers edge.
	Followers []*User `json:"followers,omitempty"`
	// Following holds the value of the following edge.
	Following []*User `json:"following,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) CreatedOrErr

func (e UserEdges) CreatedOrErr() ([]*Squeak, error)

CreatedOrErr returns the Created value or an error if the edge was not loaded in eager-loading.

func (UserEdges) FollowersOrErr

func (e UserEdges) FollowersOrErr() ([]*User, error)

FollowersOrErr returns the Followers value or an error if the edge was not loaded in eager-loading.

func (UserEdges) FollowingOrErr

func (e UserEdges) FollowingOrErr() ([]*User, error)

FollowingOrErr returns the Following value or an error if the edge was not loaded in eager-loading.

func (UserEdges) InteractionsOrErr

func (e UserEdges) InteractionsOrErr() ([]*Interaction, error)

InteractionsOrErr returns the Interactions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) OwnedOrErr

func (e UserEdges) OwnedOrErr() ([]*Squeak, error)

OwnedOrErr returns the Owned value or an error if the edge was not loaded in eager-loading.

func (UserEdges) PoolPassesOrErr

func (e UserEdges) PoolPassesOrErr() ([]*PoolPass, error)

PoolPassesOrErr returns the PoolPasses value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RolesOrErr

func (e UserEdges) RolesOrErr() ([]*Role, error)

RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddCreatedIDs

func (m *UserMutation) AddCreatedIDs(ids ...int)

AddCreatedIDs adds the "created" edge to the Squeak entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddFollowerIDs

func (m *UserMutation) AddFollowerIDs(ids ...int)

AddFollowerIDs adds the "followers" edge to the User entity by ids.

func (*UserMutation) AddFollowingIDs

func (m *UserMutation) AddFollowingIDs(ids ...int)

AddFollowingIDs adds the "following" edge to the User entity by ids.

func (*UserMutation) AddInteractionIDs

func (m *UserMutation) AddInteractionIDs(ids ...int)

AddInteractionIDs adds the "interactions" edge to the Interaction entity by ids.

func (*UserMutation) AddLevel

func (m *UserMutation) AddLevel(i int8)

AddLevel adds i to the "level" field.

func (*UserMutation) AddOwnedIDs

func (m *UserMutation) AddOwnedIDs(ids ...int)

AddOwnedIDs adds the "owned" edge to the Squeak entity by ids.

func (*UserMutation) AddPoolPassIDs

func (m *UserMutation) AddPoolPassIDs(ids ...int)

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by ids.

func (*UserMutation) AddRoleIDs

func (m *UserMutation) AddRoleIDs(ids ...int)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AddedLevel

func (m *UserMutation) AddedLevel() (r int8, exists bool)

AddedLevel returns the value that was added to the "level" field in this mutation.

func (*UserMutation) Address

func (m *UserMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*UserMutation) ClearCreated

func (m *UserMutation) ClearCreated()

ClearCreated clears the "created" edge to the Squeak entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearFollowers

func (m *UserMutation) ClearFollowers()

ClearFollowers clears the "followers" edge to the User entity.

func (*UserMutation) ClearFollowing

func (m *UserMutation) ClearFollowing()

ClearFollowing clears the "following" edge to the User entity.

func (*UserMutation) ClearInteractions

func (m *UserMutation) ClearInteractions()

ClearInteractions clears the "interactions" edge to the Interaction entity.

func (*UserMutation) ClearOwned

func (m *UserMutation) ClearOwned()

ClearOwned clears the "owned" edge to the Squeak entity.

func (*UserMutation) ClearPoolPasses

func (m *UserMutation) ClearPoolPasses()

ClearPoolPasses clears the "pool_passes" edge to the PoolPass entity.

func (*UserMutation) ClearRoles

func (m *UserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreateTime

func (m *UserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserMutation) CreatedCleared

func (m *UserMutation) CreatedCleared() bool

CreatedCleared reports if the "created" edge to the Squeak entity was cleared.

func (*UserMutation) CreatedIDs

func (m *UserMutation) CreatedIDs() (ids []int)

CreatedIDs returns the "created" edge IDs 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) 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) FollowersCleared

func (m *UserMutation) FollowersCleared() bool

FollowersCleared reports if the "followers" edge to the User entity was cleared.

func (*UserMutation) FollowersIDs

func (m *UserMutation) FollowersIDs() (ids []int)

FollowersIDs returns the "followers" edge IDs in the mutation.

func (*UserMutation) FollowingCleared

func (m *UserMutation) FollowingCleared() bool

FollowingCleared reports if the "following" edge to the User entity was cleared.

func (*UserMutation) FollowingIDs

func (m *UserMutation) FollowingIDs() (ids []int)

FollowingIDs returns the "following" edge IDs 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) InteractionsCleared

func (m *UserMutation) InteractionsCleared() bool

InteractionsCleared reports if the "interactions" edge to the Interaction entity was cleared.

func (*UserMutation) InteractionsIDs

func (m *UserMutation) InteractionsIDs() (ids []int)

InteractionsIDs returns the "interactions" edge IDs in the mutation.

func (*UserMutation) Level

func (m *UserMutation) Level() (r int8, exists bool)

Level returns the value of the "level" field in the mutation.

func (*UserMutation) OldAddress

func (m *UserMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" 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) OldCreateTime

func (m *UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" 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) OldLevel

func (m *UserMutation) OldLevel(ctx context.Context) (v int8, err error)

OldLevel returns the old "level" 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) OldUpdateTime

func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" 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 "username" 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) OwnedCleared

func (m *UserMutation) OwnedCleared() bool

OwnedCleared reports if the "owned" edge to the Squeak entity was cleared.

func (*UserMutation) OwnedIDs

func (m *UserMutation) OwnedIDs() (ids []int)

OwnedIDs returns the "owned" edge IDs in the mutation.

func (*UserMutation) PoolPassesCleared

func (m *UserMutation) PoolPassesCleared() bool

PoolPassesCleared reports if the "pool_passes" edge to the PoolPass entity was cleared.

func (*UserMutation) PoolPassesIDs

func (m *UserMutation) PoolPassesIDs() (ids []int)

PoolPassesIDs returns the "pool_passes" edge IDs in the mutation.

func (*UserMutation) RemoveCreatedIDs

func (m *UserMutation) RemoveCreatedIDs(ids ...int)

RemoveCreatedIDs removes the "created" edge to the Squeak entity by IDs.

func (*UserMutation) RemoveFollowerIDs

func (m *UserMutation) RemoveFollowerIDs(ids ...int)

RemoveFollowerIDs removes the "followers" edge to the User entity by IDs.

func (*UserMutation) RemoveFollowingIDs

func (m *UserMutation) RemoveFollowingIDs(ids ...int)

RemoveFollowingIDs removes the "following" edge to the User entity by IDs.

func (*UserMutation) RemoveInteractionIDs

func (m *UserMutation) RemoveInteractionIDs(ids ...int)

RemoveInteractionIDs removes the "interactions" edge to the Interaction entity by IDs.

func (*UserMutation) RemoveOwnedIDs

func (m *UserMutation) RemoveOwnedIDs(ids ...int)

RemoveOwnedIDs removes the "owned" edge to the Squeak entity by IDs.

func (*UserMutation) RemovePoolPassIDs

func (m *UserMutation) RemovePoolPassIDs(ids ...int)

RemovePoolPassIDs removes the "pool_passes" edge to the PoolPass entity by IDs.

func (*UserMutation) RemoveRoleIDs

func (m *UserMutation) RemoveRoleIDs(ids ...int)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (*UserMutation) RemovedCreatedIDs

func (m *UserMutation) RemovedCreatedIDs() (ids []int)

RemovedCreated returns the removed IDs of the "created" edge to the Squeak entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedFollowersIDs

func (m *UserMutation) RemovedFollowersIDs() (ids []int)

RemovedFollowers returns the removed IDs of the "followers" edge to the User entity.

func (*UserMutation) RemovedFollowingIDs

func (m *UserMutation) RemovedFollowingIDs() (ids []int)

RemovedFollowing returns the removed IDs of the "following" edge to the User entity.

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) RemovedInteractionsIDs

func (m *UserMutation) RemovedInteractionsIDs() (ids []int)

RemovedInteractions returns the removed IDs of the "interactions" edge to the Interaction entity.

func (*UserMutation) RemovedOwnedIDs

func (m *UserMutation) RemovedOwnedIDs() (ids []int)

RemovedOwned returns the removed IDs of the "owned" edge to the Squeak entity.

func (*UserMutation) RemovedPoolPassesIDs

func (m *UserMutation) RemovedPoolPassesIDs() (ids []int)

RemovedPoolPasses returns the removed IDs of the "pool_passes" edge to the PoolPass entity.

func (*UserMutation) RemovedRolesIDs

func (m *UserMutation) RemovedRolesIDs() (ids []int)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*UserMutation) ResetAddress

func (m *UserMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*UserMutation) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserMutation) ResetCreated

func (m *UserMutation) ResetCreated()

ResetCreated resets all changes to the "created" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) 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) ResetFollowers

func (m *UserMutation) ResetFollowers()

ResetFollowers resets all changes to the "followers" edge.

func (*UserMutation) ResetFollowing

func (m *UserMutation) ResetFollowing()

ResetFollowing resets all changes to the "following" edge.

func (*UserMutation) ResetInteractions

func (m *UserMutation) ResetInteractions()

ResetInteractions resets all changes to the "interactions" edge.

func (*UserMutation) ResetLevel

func (m *UserMutation) ResetLevel()

ResetLevel resets all changes to the "level" field.

func (*UserMutation) ResetOwned

func (m *UserMutation) ResetOwned()

ResetOwned resets all changes to the "owned" edge.

func (*UserMutation) ResetPoolPasses

func (m *UserMutation) ResetPoolPasses()

ResetPoolPasses resets all changes to the "pool_passes" edge.

func (*UserMutation) ResetRoles

func (m *UserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMutation) ResetStatus

func (m *UserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*UserMutation) ResetUpdateTime

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) RolesCleared

func (m *UserMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (*UserMutation) RolesIDs

func (m *UserMutation) RolesIDs() (ids []int)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*UserMutation) SetAddress

func (m *UserMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*UserMutation) SetCreateTime

func (m *UserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" 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) SetLevel

func (m *UserMutation) SetLevel(i int8)

SetLevel sets the "level" field.

func (*UserMutation) SetStatus

func (m *UserMutation) SetStatus(u user.Status)

SetStatus sets the "status" field.

func (*UserMutation) SetUpdateTime

func (m *UserMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

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) UpdateTime

func (m *UserMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" 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) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id 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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreateTime).
	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) QueryCreated

func (uq *UserQuery) QueryCreated() *SqueakQuery

QueryCreated chains the current query on the "created" edge.

func (*UserQuery) QueryFollowers

func (uq *UserQuery) QueryFollowers() *UserQuery

QueryFollowers chains the current query on the "followers" edge.

func (*UserQuery) QueryFollowing

func (uq *UserQuery) QueryFollowing() *UserQuery

QueryFollowing chains the current query on the "following" edge.

func (*UserQuery) QueryInteractions

func (uq *UserQuery) QueryInteractions() *InteractionQuery

QueryInteractions chains the current query on the "interactions" edge.

func (*UserQuery) QueryOwned

func (uq *UserQuery) QueryOwned() *SqueakQuery

QueryOwned chains the current query on the "owned" edge.

func (*UserQuery) QueryPoolPasses

func (uq *UserQuery) QueryPoolPasses() *PoolPassQuery

QueryPoolPasses chains the current query on the "pool_passes" edge.

func (*UserQuery) QueryRoles

func (uq *UserQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" 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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.User.Query().
	Select(user.FieldCreateTime).
	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) WithCreated

func (uq *UserQuery) WithCreated(opts ...func(*SqueakQuery)) *UserQuery

WithCreated tells the query-builder to eager-load the nodes that are connected to the "created" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithFollowers

func (uq *UserQuery) WithFollowers(opts ...func(*UserQuery)) *UserQuery

WithFollowers tells the query-builder to eager-load the nodes that are connected to the "followers" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithFollowing

func (uq *UserQuery) WithFollowing(opts ...func(*UserQuery)) *UserQuery

WithFollowing tells the query-builder to eager-load the nodes that are connected to the "following" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithInteractions

func (uq *UserQuery) WithInteractions(opts ...func(*InteractionQuery)) *UserQuery

WithInteractions tells the query-builder to eager-load the nodes that are connected to the "interactions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithOwned

func (uq *UserQuery) WithOwned(opts ...func(*SqueakQuery)) *UserQuery

WithOwned tells the query-builder to eager-load the nodes that are connected to the "owned" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithPoolPasses

func (uq *UserQuery) WithPoolPasses(opts ...func(*PoolPassQuery)) *UserQuery

WithPoolPasses tells the query-builder to eager-load the nodes that are connected to the "pool_passes" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRoles

func (uq *UserQuery) WithRoles(opts ...func(*RoleQuery)) *UserQuery

WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddCreated

func (uu *UserUpdate) AddCreated(s ...*Squeak) *UserUpdate

AddCreated adds the "created" edges to the Squeak entity.

func (*UserUpdate) AddCreatedIDs

func (uu *UserUpdate) AddCreatedIDs(ids ...int) *UserUpdate

AddCreatedIDs adds the "created" edge to the Squeak entity by IDs.

func (*UserUpdate) AddFollowerIDs

func (uu *UserUpdate) AddFollowerIDs(ids ...int) *UserUpdate

AddFollowerIDs adds the "followers" edge to the User entity by IDs.

func (*UserUpdate) AddFollowers

func (uu *UserUpdate) AddFollowers(u ...*User) *UserUpdate

AddFollowers adds the "followers" edges to the User entity.

func (*UserUpdate) AddFollowing

func (uu *UserUpdate) AddFollowing(u ...*User) *UserUpdate

AddFollowing adds the "following" edges to the User entity.

func (*UserUpdate) AddFollowingIDs

func (uu *UserUpdate) AddFollowingIDs(ids ...int) *UserUpdate

AddFollowingIDs adds the "following" edge to the User entity by IDs.

func (*UserUpdate) AddInteractionIDs

func (uu *UserUpdate) AddInteractionIDs(ids ...int) *UserUpdate

AddInteractionIDs adds the "interactions" edge to the Interaction entity by IDs.

func (*UserUpdate) AddInteractions

func (uu *UserUpdate) AddInteractions(i ...*Interaction) *UserUpdate

AddInteractions adds the "interactions" edges to the Interaction entity.

func (*UserUpdate) AddLevel

func (uu *UserUpdate) AddLevel(i int8) *UserUpdate

AddLevel adds i to the "level" field.

func (*UserUpdate) AddOwned

func (uu *UserUpdate) AddOwned(s ...*Squeak) *UserUpdate

AddOwned adds the "owned" edges to the Squeak entity.

func (*UserUpdate) AddOwnedIDs

func (uu *UserUpdate) AddOwnedIDs(ids ...int) *UserUpdate

AddOwnedIDs adds the "owned" edge to the Squeak entity by IDs.

func (*UserUpdate) AddPoolPassIDs

func (uu *UserUpdate) AddPoolPassIDs(ids ...int) *UserUpdate

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by IDs.

func (*UserUpdate) AddPoolPasses

func (uu *UserUpdate) AddPoolPasses(p ...*PoolPass) *UserUpdate

AddPoolPasses adds the "pool_passes" edges to the PoolPass entity.

func (*UserUpdate) AddRoleIDs

func (uu *UserUpdate) AddRoleIDs(ids ...int) *UserUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdate) AddRoles

func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdate) ClearCreated

func (uu *UserUpdate) ClearCreated() *UserUpdate

ClearCreated clears all "created" edges to the Squeak entity.

func (*UserUpdate) ClearFollowers

func (uu *UserUpdate) ClearFollowers() *UserUpdate

ClearFollowers clears all "followers" edges to the User entity.

func (*UserUpdate) ClearFollowing

func (uu *UserUpdate) ClearFollowing() *UserUpdate

ClearFollowing clears all "following" edges to the User entity.

func (*UserUpdate) ClearInteractions

func (uu *UserUpdate) ClearInteractions() *UserUpdate

ClearInteractions clears all "interactions" edges to the Interaction entity.

func (*UserUpdate) ClearOwned

func (uu *UserUpdate) ClearOwned() *UserUpdate

ClearOwned clears all "owned" edges to the Squeak entity.

func (*UserUpdate) ClearPoolPasses

func (uu *UserUpdate) ClearPoolPasses() *UserUpdate

ClearPoolPasses clears all "pool_passes" edges to the PoolPass entity.

func (*UserUpdate) ClearRoles

func (uu *UserUpdate) ClearRoles() *UserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveCreated

func (uu *UserUpdate) RemoveCreated(s ...*Squeak) *UserUpdate

RemoveCreated removes "created" edges to Squeak entities.

func (*UserUpdate) RemoveCreatedIDs

func (uu *UserUpdate) RemoveCreatedIDs(ids ...int) *UserUpdate

RemoveCreatedIDs removes the "created" edge to Squeak entities by IDs.

func (*UserUpdate) RemoveFollowerIDs

func (uu *UserUpdate) RemoveFollowerIDs(ids ...int) *UserUpdate

RemoveFollowerIDs removes the "followers" edge to User entities by IDs.

func (*UserUpdate) RemoveFollowers

func (uu *UserUpdate) RemoveFollowers(u ...*User) *UserUpdate

RemoveFollowers removes "followers" edges to User entities.

func (*UserUpdate) RemoveFollowing

func (uu *UserUpdate) RemoveFollowing(u ...*User) *UserUpdate

RemoveFollowing removes "following" edges to User entities.

func (*UserUpdate) RemoveFollowingIDs

func (uu *UserUpdate) RemoveFollowingIDs(ids ...int) *UserUpdate

RemoveFollowingIDs removes the "following" edge to User entities by IDs.

func (*UserUpdate) RemoveInteractionIDs

func (uu *UserUpdate) RemoveInteractionIDs(ids ...int) *UserUpdate

RemoveInteractionIDs removes the "interactions" edge to Interaction entities by IDs.

func (*UserUpdate) RemoveInteractions

func (uu *UserUpdate) RemoveInteractions(i ...*Interaction) *UserUpdate

RemoveInteractions removes "interactions" edges to Interaction entities.

func (*UserUpdate) RemoveOwned

func (uu *UserUpdate) RemoveOwned(s ...*Squeak) *UserUpdate

RemoveOwned removes "owned" edges to Squeak entities.

func (*UserUpdate) RemoveOwnedIDs

func (uu *UserUpdate) RemoveOwnedIDs(ids ...int) *UserUpdate

RemoveOwnedIDs removes the "owned" edge to Squeak entities by IDs.

func (*UserUpdate) RemovePoolPassIDs

func (uu *UserUpdate) RemovePoolPassIDs(ids ...int) *UserUpdate

RemovePoolPassIDs removes the "pool_passes" edge to PoolPass entities by IDs.

func (*UserUpdate) RemovePoolPasses

func (uu *UserUpdate) RemovePoolPasses(p ...*PoolPass) *UserUpdate

RemovePoolPasses removes "pool_passes" edges to PoolPass entities.

func (*UserUpdate) RemoveRoleIDs

func (uu *UserUpdate) RemoveRoleIDs(ids ...int) *UserUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdate) RemoveRoles

func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetLevel

func (uu *UserUpdate) SetLevel(i int8) *UserUpdate

SetLevel sets the "level" field.

func (*UserUpdate) SetNillableLevel

func (uu *UserUpdate) SetNillableLevel(i *int8) *UserUpdate

SetNillableLevel sets the "level" field if the given value is not nil.

func (*UserUpdate) SetStatus

func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate

SetStatus sets the "status" field.

func (*UserUpdate) SetUpdateTime

func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate

SetUpdateTime sets the "update_time" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" 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) AddCreated

func (uuo *UserUpdateOne) AddCreated(s ...*Squeak) *UserUpdateOne

AddCreated adds the "created" edges to the Squeak entity.

func (*UserUpdateOne) AddCreatedIDs

func (uuo *UserUpdateOne) AddCreatedIDs(ids ...int) *UserUpdateOne

AddCreatedIDs adds the "created" edge to the Squeak entity by IDs.

func (*UserUpdateOne) AddFollowerIDs

func (uuo *UserUpdateOne) AddFollowerIDs(ids ...int) *UserUpdateOne

AddFollowerIDs adds the "followers" edge to the User entity by IDs.

func (*UserUpdateOne) AddFollowers

func (uuo *UserUpdateOne) AddFollowers(u ...*User) *UserUpdateOne

AddFollowers adds the "followers" edges to the User entity.

func (*UserUpdateOne) AddFollowing

func (uuo *UserUpdateOne) AddFollowing(u ...*User) *UserUpdateOne

AddFollowing adds the "following" edges to the User entity.

func (*UserUpdateOne) AddFollowingIDs

func (uuo *UserUpdateOne) AddFollowingIDs(ids ...int) *UserUpdateOne

AddFollowingIDs adds the "following" edge to the User entity by IDs.

func (*UserUpdateOne) AddInteractionIDs

func (uuo *UserUpdateOne) AddInteractionIDs(ids ...int) *UserUpdateOne

AddInteractionIDs adds the "interactions" edge to the Interaction entity by IDs.

func (*UserUpdateOne) AddInteractions

func (uuo *UserUpdateOne) AddInteractions(i ...*Interaction) *UserUpdateOne

AddInteractions adds the "interactions" edges to the Interaction entity.

func (*UserUpdateOne) AddLevel

func (uuo *UserUpdateOne) AddLevel(i int8) *UserUpdateOne

AddLevel adds i to the "level" field.

func (*UserUpdateOne) AddOwned

func (uuo *UserUpdateOne) AddOwned(s ...*Squeak) *UserUpdateOne

AddOwned adds the "owned" edges to the Squeak entity.

func (*UserUpdateOne) AddOwnedIDs

func (uuo *UserUpdateOne) AddOwnedIDs(ids ...int) *UserUpdateOne

AddOwnedIDs adds the "owned" edge to the Squeak entity by IDs.

func (*UserUpdateOne) AddPoolPassIDs

func (uuo *UserUpdateOne) AddPoolPassIDs(ids ...int) *UserUpdateOne

AddPoolPassIDs adds the "pool_passes" edge to the PoolPass entity by IDs.

func (*UserUpdateOne) AddPoolPasses

func (uuo *UserUpdateOne) AddPoolPasses(p ...*PoolPass) *UserUpdateOne

AddPoolPasses adds the "pool_passes" edges to the PoolPass entity.

func (*UserUpdateOne) AddRoleIDs

func (uuo *UserUpdateOne) AddRoleIDs(ids ...int) *UserUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdateOne) AddRoles

func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdateOne) ClearCreated

func (uuo *UserUpdateOne) ClearCreated() *UserUpdateOne

ClearCreated clears all "created" edges to the Squeak entity.

func (*UserUpdateOne) ClearFollowers

func (uuo *UserUpdateOne) ClearFollowers() *UserUpdateOne

ClearFollowers clears all "followers" edges to the User entity.

func (*UserUpdateOne) ClearFollowing

func (uuo *UserUpdateOne) ClearFollowing() *UserUpdateOne

ClearFollowing clears all "following" edges to the User entity.

func (*UserUpdateOne) ClearInteractions

func (uuo *UserUpdateOne) ClearInteractions() *UserUpdateOne

ClearInteractions clears all "interactions" edges to the Interaction entity.

func (*UserUpdateOne) ClearOwned

func (uuo *UserUpdateOne) ClearOwned() *UserUpdateOne

ClearOwned clears all "owned" edges to the Squeak entity.

func (*UserUpdateOne) ClearPoolPasses

func (uuo *UserUpdateOne) ClearPoolPasses() *UserUpdateOne

ClearPoolPasses clears all "pool_passes" edges to the PoolPass entity.

func (*UserUpdateOne) ClearRoles

func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveCreated

func (uuo *UserUpdateOne) RemoveCreated(s ...*Squeak) *UserUpdateOne

RemoveCreated removes "created" edges to Squeak entities.

func (*UserUpdateOne) RemoveCreatedIDs

func (uuo *UserUpdateOne) RemoveCreatedIDs(ids ...int) *UserUpdateOne

RemoveCreatedIDs removes the "created" edge to Squeak entities by IDs.

func (*UserUpdateOne) RemoveFollowerIDs

func (uuo *UserUpdateOne) RemoveFollowerIDs(ids ...int) *UserUpdateOne

RemoveFollowerIDs removes the "followers" edge to User entities by IDs.

func (*UserUpdateOne) RemoveFollowers

func (uuo *UserUpdateOne) RemoveFollowers(u ...*User) *UserUpdateOne

RemoveFollowers removes "followers" edges to User entities.

func (*UserUpdateOne) RemoveFollowing

func (uuo *UserUpdateOne) RemoveFollowing(u ...*User) *UserUpdateOne

RemoveFollowing removes "following" edges to User entities.

func (*UserUpdateOne) RemoveFollowingIDs

func (uuo *UserUpdateOne) RemoveFollowingIDs(ids ...int) *UserUpdateOne

RemoveFollowingIDs removes the "following" edge to User entities by IDs.

func (*UserUpdateOne) RemoveInteractionIDs

func (uuo *UserUpdateOne) RemoveInteractionIDs(ids ...int) *UserUpdateOne

RemoveInteractionIDs removes the "interactions" edge to Interaction entities by IDs.

func (*UserUpdateOne) RemoveInteractions

func (uuo *UserUpdateOne) RemoveInteractions(i ...*Interaction) *UserUpdateOne

RemoveInteractions removes "interactions" edges to Interaction entities.

func (*UserUpdateOne) RemoveOwned

func (uuo *UserUpdateOne) RemoveOwned(s ...*Squeak) *UserUpdateOne

RemoveOwned removes "owned" edges to Squeak entities.

func (*UserUpdateOne) RemoveOwnedIDs

func (uuo *UserUpdateOne) RemoveOwnedIDs(ids ...int) *UserUpdateOne

RemoveOwnedIDs removes the "owned" edge to Squeak entities by IDs.

func (*UserUpdateOne) RemovePoolPassIDs

func (uuo *UserUpdateOne) RemovePoolPassIDs(ids ...int) *UserUpdateOne

RemovePoolPassIDs removes the "pool_passes" edge to PoolPass entities by IDs.

func (*UserUpdateOne) RemovePoolPasses

func (uuo *UserUpdateOne) RemovePoolPasses(p ...*PoolPass) *UserUpdateOne

RemovePoolPasses removes "pool_passes" edges to PoolPass entities.

func (*UserUpdateOne) RemoveRoleIDs

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...int) *UserUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdateOne) RemoveRoles

func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetLevel

func (uuo *UserUpdateOne) SetLevel(i int8) *UserUpdateOne

SetLevel sets the "level" field.

func (*UserUpdateOne) SetNillableLevel

func (uuo *UserUpdateOne) SetNillableLevel(i *int8) *UserUpdateOne

SetNillableLevel sets the "level" field if the given value is not nil.

func (*UserUpdateOne) SetStatus

func (uuo *UserUpdateOne) SetStatus(u user.Status) *UserUpdateOne

SetStatus sets the "status" field.

func (*UserUpdateOne) SetUpdateTime

func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL