ent

package
v0.0.0-...-a77d1df Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 22 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.
	TypeMatch      = "Match"
	TypeOsnMap     = "OsnMap"
	TypePlayer     = "Player"
	TypePlayerRole = "PlayerRole"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Match is the client for interacting with the Match builders.
	Match *MatchClient
	// OsnMap is the client for interacting with the OsnMap builders.
	OsnMap *OsnMapClient
	// Player is the client for interacting with the Player builders.
	Player *PlayerClient
	// PlayerRole is the client for interacting with the PlayerRole builders.
	PlayerRole *PlayerRoleClient
	// 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().
	Match.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

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

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type Match

type Match struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Identifier, a base-64 encoded hash-id of the match.
	MatchHash string `json:"match_hash,omitempty"`
	// Which runtime version this match was played on.  Latest version is 1603.
	Version int `json:"version,omitempty"`
	// Zero value also implies non-competitive play.
	Season int8 `json:"season,omitempty"`
	// The timestamp when this match was recorded.  Nillable so it is not required in JSON responses.
	CreatedTs *time.Time `json:"created_ts,omitempty"`
	// TurnCount holds the value of the "turn_count" field.
	TurnCount int `json:"turn_count,omitempty"`
	// Where in the fetch/minify/convert process the replay is.  Nillable so that it is not required in JSON responses.
	FetchStatus *match.FetchStatus `json:"fetch_status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MatchQuery when eager-loading is set.
	Edges MatchEdges `json:"edges"`
	// contains filtered or unexported fields
}

Match is the model entity for the Match schema.

func (*Match) QueryMap

func (m *Match) QueryMap() *OsnMapQuery

QueryMap queries the "map" edge of the Match entity.

func (*Match) QueryRoles

func (m *Match) QueryRoles() *PlayerRoleQuery

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

func (*Match) String

func (m *Match) String() string

String implements the fmt.Stringer.

func (*Match) Unwrap

func (m *Match) Unwrap() *Match

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

func (m *Match) Update() *MatchUpdateOne

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

func (*Match) Value

func (m *Match) Value(name string) (ent.Value, error)

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

type MatchClient

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

MatchClient is a client for the Match schema.

func NewMatchClient

func NewMatchClient(c config) *MatchClient

NewMatchClient returns a client for the Match from the given config.

func (*MatchClient) Create

func (c *MatchClient) Create() *MatchCreate

Create returns a builder for creating a Match entity.

func (*MatchClient) CreateBulk

func (c *MatchClient) CreateBulk(builders ...*MatchCreate) *MatchCreateBulk

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

func (*MatchClient) Delete

func (c *MatchClient) Delete() *MatchDelete

Delete returns a delete builder for Match.

func (*MatchClient) DeleteOne

func (c *MatchClient) DeleteOne(m *Match) *MatchDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MatchClient) DeleteOneID

func (c *MatchClient) DeleteOneID(id int) *MatchDeleteOne

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

func (*MatchClient) Get

func (c *MatchClient) Get(ctx context.Context, id int) (*Match, error)

Get returns a Match entity by its id.

func (*MatchClient) GetX

func (c *MatchClient) GetX(ctx context.Context, id int) *Match

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

func (*MatchClient) Hooks

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

Hooks returns the client hooks.

func (*MatchClient) Intercept

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

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

func (*MatchClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MatchClient) MapCreateBulk

func (c *MatchClient) MapCreateBulk(slice any, setFunc func(*MatchCreate, int)) *MatchCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MatchClient) Query

func (c *MatchClient) Query() *MatchQuery

Query returns a query builder for Match.

func (*MatchClient) QueryMap

func (c *MatchClient) QueryMap(m *Match) *OsnMapQuery

QueryMap queries the map edge of a Match.

func (*MatchClient) QueryRoles

func (c *MatchClient) QueryRoles(m *Match) *PlayerRoleQuery

QueryRoles queries the roles edge of a Match.

func (*MatchClient) Update

func (c *MatchClient) Update() *MatchUpdate

Update returns an update builder for Match.

func (*MatchClient) UpdateOne

func (c *MatchClient) UpdateOne(m *Match) *MatchUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MatchClient) UpdateOneID

func (c *MatchClient) UpdateOneID(id int) *MatchUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MatchClient) Use

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

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

type MatchCreate

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

MatchCreate is the builder for creating a Match entity.

func (*MatchCreate) AddRoleIDs

func (mc *MatchCreate) AddRoleIDs(ids ...int) *MatchCreate

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

func (*MatchCreate) AddRoles

func (mc *MatchCreate) AddRoles(p ...*PlayerRole) *MatchCreate

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

func (*MatchCreate) Exec

func (mc *MatchCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MatchCreate) ExecX

func (mc *MatchCreate) ExecX(ctx context.Context)

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

func (*MatchCreate) Mutation

func (mc *MatchCreate) Mutation() *MatchMutation

Mutation returns the MatchMutation object of the builder.

func (*MatchCreate) Save

func (mc *MatchCreate) Save(ctx context.Context) (*Match, error)

Save creates the Match in the database.

func (*MatchCreate) SaveX

func (mc *MatchCreate) SaveX(ctx context.Context) *Match

SaveX calls Save and panics if Save returns an error.

func (*MatchCreate) SetCreatedTs

func (mc *MatchCreate) SetCreatedTs(t time.Time) *MatchCreate

SetCreatedTs sets the "created_ts" field.

func (*MatchCreate) SetFetchStatus

func (mc *MatchCreate) SetFetchStatus(ms match.FetchStatus) *MatchCreate

SetFetchStatus sets the "fetch_status" field.

func (*MatchCreate) SetMap

func (mc *MatchCreate) SetMap(o *OsnMap) *MatchCreate

SetMap sets the "map" edge to the OsnMap entity.

func (*MatchCreate) SetMapID

func (mc *MatchCreate) SetMapID(id int) *MatchCreate

SetMapID sets the "map" edge to the OsnMap entity by ID.

func (*MatchCreate) SetMatchHash

func (mc *MatchCreate) SetMatchHash(s string) *MatchCreate

SetMatchHash sets the "match_hash" field.

func (*MatchCreate) SetNillableCreatedTs

func (mc *MatchCreate) SetNillableCreatedTs(t *time.Time) *MatchCreate

SetNillableCreatedTs sets the "created_ts" field if the given value is not nil.

func (*MatchCreate) SetNillableFetchStatus

func (mc *MatchCreate) SetNillableFetchStatus(ms *match.FetchStatus) *MatchCreate

SetNillableFetchStatus sets the "fetch_status" field if the given value is not nil.

func (*MatchCreate) SetNillableMapID

func (mc *MatchCreate) SetNillableMapID(id *int) *MatchCreate

SetNillableMapID sets the "map" edge to the OsnMap entity by ID if the given value is not nil.

func (*MatchCreate) SetNillableSeason

func (mc *MatchCreate) SetNillableSeason(i *int8) *MatchCreate

SetNillableSeason sets the "season" field if the given value is not nil.

func (*MatchCreate) SetSeason

func (mc *MatchCreate) SetSeason(i int8) *MatchCreate

SetSeason sets the "season" field.

func (*MatchCreate) SetTurnCount

func (mc *MatchCreate) SetTurnCount(i int) *MatchCreate

SetTurnCount sets the "turn_count" field.

func (*MatchCreate) SetVersion

func (mc *MatchCreate) SetVersion(i int) *MatchCreate

SetVersion sets the "version" field.

type MatchCreateBulk

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

MatchCreateBulk is the builder for creating many Match entities in bulk.

func (*MatchCreateBulk) Exec

func (mcb *MatchCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MatchCreateBulk) ExecX

func (mcb *MatchCreateBulk) ExecX(ctx context.Context)

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

func (*MatchCreateBulk) Save

func (mcb *MatchCreateBulk) Save(ctx context.Context) ([]*Match, error)

Save creates the Match entities in the database.

func (*MatchCreateBulk) SaveX

func (mcb *MatchCreateBulk) SaveX(ctx context.Context) []*Match

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

type MatchDelete

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

MatchDelete is the builder for deleting a Match entity.

func (*MatchDelete) Exec

func (md *MatchDelete) Exec(ctx context.Context) (int, error)

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

func (*MatchDelete) ExecX

func (md *MatchDelete) ExecX(ctx context.Context) int

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

func (*MatchDelete) Where

func (md *MatchDelete) Where(ps ...predicate.Match) *MatchDelete

Where appends a list predicates to the MatchDelete builder.

type MatchDeleteOne

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

MatchDeleteOne is the builder for deleting a single Match entity.

func (*MatchDeleteOne) Exec

func (mdo *MatchDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MatchDeleteOne) ExecX

func (mdo *MatchDeleteOne) ExecX(ctx context.Context)

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

func (*MatchDeleteOne) Where

func (mdo *MatchDeleteOne) Where(ps ...predicate.Match) *MatchDeleteOne

Where appends a list predicates to the MatchDelete builder.

type MatchEdges

type MatchEdges struct {
	// Map holds the value of the map edge.
	Map *OsnMap `json:"map,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*PlayerRole `json:"roles,omitempty"`
	// contains filtered or unexported fields
}

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

func (MatchEdges) MapOrErr

func (e MatchEdges) MapOrErr() (*OsnMap, error)

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

func (MatchEdges) RolesOrErr

func (e MatchEdges) RolesOrErr() ([]*PlayerRole, error)

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

type MatchGroupBy

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

MatchGroupBy is the group-by builder for Match entities.

func (*MatchGroupBy) Aggregate

func (mgb *MatchGroupBy) Aggregate(fns ...AggregateFunc) *MatchGroupBy

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

func (*MatchGroupBy) Bool

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

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

func (*MatchGroupBy) BoolX

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

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

func (*MatchGroupBy) Bools

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

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

func (*MatchGroupBy) BoolsX

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

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

func (*MatchGroupBy) Float64

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

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

func (*MatchGroupBy) Float64X

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

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

func (*MatchGroupBy) Float64s

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

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

func (*MatchGroupBy) Float64sX

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

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

func (*MatchGroupBy) Int

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

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

func (*MatchGroupBy) IntX

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

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

func (*MatchGroupBy) Ints

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

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

func (*MatchGroupBy) IntsX

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

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

func (*MatchGroupBy) Scan

func (mgb *MatchGroupBy) Scan(ctx context.Context, v any) error

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

func (*MatchGroupBy) ScanX

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

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

func (*MatchGroupBy) String

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

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

func (*MatchGroupBy) StringX

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

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

func (*MatchGroupBy) Strings

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

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

func (*MatchGroupBy) StringsX

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

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

type MatchMutation

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

MatchMutation represents an operation that mutates the Match nodes in the graph.

func (*MatchMutation) AddField

func (m *MatchMutation) 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 (*MatchMutation) AddRoleIDs

func (m *MatchMutation) AddRoleIDs(ids ...int)

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

func (*MatchMutation) AddSeason

func (m *MatchMutation) AddSeason(i int8)

AddSeason adds i to the "season" field.

func (*MatchMutation) AddTurnCount

func (m *MatchMutation) AddTurnCount(i int)

AddTurnCount adds i to the "turn_count" field.

func (*MatchMutation) AddVersion

func (m *MatchMutation) AddVersion(i int)

AddVersion adds i to the "version" field.

func (*MatchMutation) AddedEdges

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

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

func (*MatchMutation) AddedField

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

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

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

func (*MatchMutation) AddedIDs

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

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

func (*MatchMutation) AddedSeason

func (m *MatchMutation) AddedSeason() (r int8, exists bool)

AddedSeason returns the value that was added to the "season" field in this mutation.

func (*MatchMutation) AddedTurnCount

func (m *MatchMutation) AddedTurnCount() (r int, exists bool)

AddedTurnCount returns the value that was added to the "turn_count" field in this mutation.

func (*MatchMutation) AddedVersion

func (m *MatchMutation) AddedVersion() (r int, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*MatchMutation) ClearEdge

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

func (m *MatchMutation) 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 (*MatchMutation) ClearMap

func (m *MatchMutation) ClearMap()

ClearMap clears the "map" edge to the OsnMap entity.

func (*MatchMutation) ClearRoles

func (m *MatchMutation) ClearRoles()

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

func (*MatchMutation) ClearedEdges

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

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

func (*MatchMutation) ClearedFields

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

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

func (MatchMutation) Client

func (m MatchMutation) 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 (*MatchMutation) CreatedTs

func (m *MatchMutation) CreatedTs() (r time.Time, exists bool)

CreatedTs returns the value of the "created_ts" field in the mutation.

func (*MatchMutation) EdgeCleared

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

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

func (*MatchMutation) FetchStatus

func (m *MatchMutation) FetchStatus() (r match.FetchStatus, exists bool)

FetchStatus returns the value of the "fetch_status" field in the mutation.

func (*MatchMutation) Field

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

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

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

func (*MatchMutation) Fields

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

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

func (m *MatchMutation) 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 (*MatchMutation) MapCleared

func (m *MatchMutation) MapCleared() bool

MapCleared reports if the "map" edge to the OsnMap entity was cleared.

func (*MatchMutation) MapID

func (m *MatchMutation) MapID() (id int, exists bool)

MapID returns the "map" edge ID in the mutation.

func (*MatchMutation) MapIDs

func (m *MatchMutation) MapIDs() (ids []int)

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

func (*MatchMutation) MatchHash

func (m *MatchMutation) MatchHash() (r string, exists bool)

MatchHash returns the value of the "match_hash" field in the mutation.

func (*MatchMutation) OldCreatedTs

func (m *MatchMutation) OldCreatedTs(ctx context.Context) (v *time.Time, err error)

OldCreatedTs returns the old "created_ts" field's value of the Match entity. If the Match 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 (*MatchMutation) OldFetchStatus

func (m *MatchMutation) OldFetchStatus(ctx context.Context) (v *match.FetchStatus, err error)

OldFetchStatus returns the old "fetch_status" field's value of the Match entity. If the Match 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 (*MatchMutation) OldField

func (m *MatchMutation) 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 (*MatchMutation) OldMatchHash

func (m *MatchMutation) OldMatchHash(ctx context.Context) (v string, err error)

OldMatchHash returns the old "match_hash" field's value of the Match entity. If the Match 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 (*MatchMutation) OldSeason

func (m *MatchMutation) OldSeason(ctx context.Context) (v int8, err error)

OldSeason returns the old "season" field's value of the Match entity. If the Match 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 (*MatchMutation) OldTurnCount

func (m *MatchMutation) OldTurnCount(ctx context.Context) (v int, err error)

OldTurnCount returns the old "turn_count" field's value of the Match entity. If the Match 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 (*MatchMutation) OldVersion

func (m *MatchMutation) OldVersion(ctx context.Context) (v int, err error)

OldVersion returns the old "version" field's value of the Match entity. If the Match 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 (*MatchMutation) Op

func (m *MatchMutation) Op() Op

Op returns the operation name.

func (*MatchMutation) RemoveRoleIDs

func (m *MatchMutation) RemoveRoleIDs(ids ...int)

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

func (*MatchMutation) RemovedEdges

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

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

func (*MatchMutation) RemovedIDs

func (m *MatchMutation) 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 (*MatchMutation) RemovedRolesIDs

func (m *MatchMutation) RemovedRolesIDs() (ids []int)

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

func (*MatchMutation) ResetCreatedTs

func (m *MatchMutation) ResetCreatedTs()

ResetCreatedTs resets all changes to the "created_ts" field.

func (*MatchMutation) ResetEdge

func (m *MatchMutation) 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 (*MatchMutation) ResetFetchStatus

func (m *MatchMutation) ResetFetchStatus()

ResetFetchStatus resets all changes to the "fetch_status" field.

func (*MatchMutation) ResetField

func (m *MatchMutation) 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 (*MatchMutation) ResetMap

func (m *MatchMutation) ResetMap()

ResetMap resets all changes to the "map" edge.

func (*MatchMutation) ResetMatchHash

func (m *MatchMutation) ResetMatchHash()

ResetMatchHash resets all changes to the "match_hash" field.

func (*MatchMutation) ResetRoles

func (m *MatchMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*MatchMutation) ResetSeason

func (m *MatchMutation) ResetSeason()

ResetSeason resets all changes to the "season" field.

func (*MatchMutation) ResetTurnCount

func (m *MatchMutation) ResetTurnCount()

ResetTurnCount resets all changes to the "turn_count" field.

func (*MatchMutation) ResetVersion

func (m *MatchMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*MatchMutation) RolesCleared

func (m *MatchMutation) RolesCleared() bool

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

func (*MatchMutation) RolesIDs

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

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

func (*MatchMutation) Season

func (m *MatchMutation) Season() (r int8, exists bool)

Season returns the value of the "season" field in the mutation.

func (*MatchMutation) SetCreatedTs

func (m *MatchMutation) SetCreatedTs(t time.Time)

SetCreatedTs sets the "created_ts" field.

func (*MatchMutation) SetFetchStatus

func (m *MatchMutation) SetFetchStatus(ms match.FetchStatus)

SetFetchStatus sets the "fetch_status" field.

func (*MatchMutation) SetField

func (m *MatchMutation) 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 (*MatchMutation) SetMapID

func (m *MatchMutation) SetMapID(id int)

SetMapID sets the "map" edge to the OsnMap entity by id.

func (*MatchMutation) SetMatchHash

func (m *MatchMutation) SetMatchHash(s string)

SetMatchHash sets the "match_hash" field.

func (*MatchMutation) SetOp

func (m *MatchMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MatchMutation) SetSeason

func (m *MatchMutation) SetSeason(i int8)

SetSeason sets the "season" field.

func (*MatchMutation) SetTurnCount

func (m *MatchMutation) SetTurnCount(i int)

SetTurnCount sets the "turn_count" field.

func (*MatchMutation) SetVersion

func (m *MatchMutation) SetVersion(i int)

SetVersion sets the "version" field.

func (*MatchMutation) TurnCount

func (m *MatchMutation) TurnCount() (r int, exists bool)

TurnCount returns the value of the "turn_count" field in the mutation.

func (MatchMutation) Tx

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

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

func (*MatchMutation) Type

func (m *MatchMutation) Type() string

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

func (*MatchMutation) Version

func (m *MatchMutation) Version() (r int, exists bool)

Version returns the value of the "version" field in the mutation.

func (*MatchMutation) Where

func (m *MatchMutation) Where(ps ...predicate.Match)

Where appends a list predicates to the MatchMutation builder.

func (*MatchMutation) WhereP

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

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

type MatchQuery

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

MatchQuery is the builder for querying Match entities.

func (*MatchQuery) Aggregate

func (mq *MatchQuery) Aggregate(fns ...AggregateFunc) *MatchSelect

Aggregate returns a MatchSelect configured with the given aggregations.

func (*MatchQuery) All

func (mq *MatchQuery) All(ctx context.Context) ([]*Match, error)

All executes the query and returns a list of Matches.

func (*MatchQuery) AllX

func (mq *MatchQuery) AllX(ctx context.Context) []*Match

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

func (*MatchQuery) Clone

func (mq *MatchQuery) Clone() *MatchQuery

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

func (*MatchQuery) Count

func (mq *MatchQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MatchQuery) CountX

func (mq *MatchQuery) CountX(ctx context.Context) int

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

func (*MatchQuery) Exist

func (mq *MatchQuery) Exist(ctx context.Context) (bool, error)

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

func (*MatchQuery) ExistX

func (mq *MatchQuery) ExistX(ctx context.Context) bool

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

func (*MatchQuery) First

func (mq *MatchQuery) First(ctx context.Context) (*Match, error)

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

func (*MatchQuery) FirstID

func (mq *MatchQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MatchQuery) FirstIDX

func (mq *MatchQuery) FirstIDX(ctx context.Context) int

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

func (*MatchQuery) FirstX

func (mq *MatchQuery) FirstX(ctx context.Context) *Match

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

func (*MatchQuery) GroupBy

func (mq *MatchQuery) GroupBy(field string, fields ...string) *MatchGroupBy

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

client.Match.Query().
	GroupBy(match.FieldMatchHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MatchQuery) IDs

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

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

func (*MatchQuery) IDsX

func (mq *MatchQuery) IDsX(ctx context.Context) []int

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

func (*MatchQuery) Limit

func (mq *MatchQuery) Limit(limit int) *MatchQuery

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

func (*MatchQuery) Offset

func (mq *MatchQuery) Offset(offset int) *MatchQuery

Offset to start from.

func (*MatchQuery) Only

func (mq *MatchQuery) Only(ctx context.Context) (*Match, error)

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

func (*MatchQuery) OnlyID

func (mq *MatchQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MatchQuery) OnlyIDX

func (mq *MatchQuery) OnlyIDX(ctx context.Context) int

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

func (*MatchQuery) OnlyX

func (mq *MatchQuery) OnlyX(ctx context.Context) *Match

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

func (*MatchQuery) Order

func (mq *MatchQuery) Order(o ...match.OrderOption) *MatchQuery

Order specifies how the records should be ordered.

func (*MatchQuery) QueryMap

func (mq *MatchQuery) QueryMap() *OsnMapQuery

QueryMap chains the current query on the "map" edge.

func (*MatchQuery) QueryRoles

func (mq *MatchQuery) QueryRoles() *PlayerRoleQuery

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

func (*MatchQuery) Select

func (mq *MatchQuery) Select(fields ...string) *MatchSelect

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

client.Match.Query().
	Select(match.FieldMatchHash).
	Scan(ctx, &v)

func (*MatchQuery) Unique

func (mq *MatchQuery) Unique(unique bool) *MatchQuery

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

func (mq *MatchQuery) Where(ps ...predicate.Match) *MatchQuery

Where adds a new predicate for the MatchQuery builder.

func (*MatchQuery) WithMap

func (mq *MatchQuery) WithMap(opts ...func(*OsnMapQuery)) *MatchQuery

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

func (*MatchQuery) WithRoles

func (mq *MatchQuery) WithRoles(opts ...func(*PlayerRoleQuery)) *MatchQuery

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 MatchSelect

type MatchSelect struct {
	*MatchQuery
	// contains filtered or unexported fields
}

MatchSelect is the builder for selecting fields of Match entities.

func (*MatchSelect) Aggregate

func (ms *MatchSelect) Aggregate(fns ...AggregateFunc) *MatchSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MatchSelect) Bool

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

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

func (*MatchSelect) BoolX

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

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

func (*MatchSelect) Bools

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

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

func (*MatchSelect) BoolsX

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

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

func (*MatchSelect) Float64

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

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

func (*MatchSelect) Float64X

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

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

func (*MatchSelect) Float64s

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

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

func (*MatchSelect) Float64sX

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

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

func (*MatchSelect) Int

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

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

func (*MatchSelect) IntX

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

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

func (*MatchSelect) Ints

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

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

func (*MatchSelect) IntsX

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

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

func (*MatchSelect) Scan

func (ms *MatchSelect) Scan(ctx context.Context, v any) error

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

func (*MatchSelect) ScanX

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

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

func (*MatchSelect) String

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

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

func (*MatchSelect) StringX

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

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

func (*MatchSelect) Strings

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

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

func (*MatchSelect) StringsX

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

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

type MatchUpdate

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

MatchUpdate is the builder for updating Match entities.

func (*MatchUpdate) AddRoleIDs

func (mu *MatchUpdate) AddRoleIDs(ids ...int) *MatchUpdate

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

func (*MatchUpdate) AddRoles

func (mu *MatchUpdate) AddRoles(p ...*PlayerRole) *MatchUpdate

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

func (*MatchUpdate) AddSeason

func (mu *MatchUpdate) AddSeason(i int8) *MatchUpdate

AddSeason adds i to the "season" field.

func (*MatchUpdate) AddTurnCount

func (mu *MatchUpdate) AddTurnCount(i int) *MatchUpdate

AddTurnCount adds i to the "turn_count" field.

func (*MatchUpdate) ClearMap

func (mu *MatchUpdate) ClearMap() *MatchUpdate

ClearMap clears the "map" edge to the OsnMap entity.

func (*MatchUpdate) ClearRoles

func (mu *MatchUpdate) ClearRoles() *MatchUpdate

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

func (*MatchUpdate) Exec

func (mu *MatchUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MatchUpdate) ExecX

func (mu *MatchUpdate) ExecX(ctx context.Context)

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

func (*MatchUpdate) Mutation

func (mu *MatchUpdate) Mutation() *MatchMutation

Mutation returns the MatchMutation object of the builder.

func (*MatchUpdate) RemoveRoleIDs

func (mu *MatchUpdate) RemoveRoleIDs(ids ...int) *MatchUpdate

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

func (*MatchUpdate) RemoveRoles

func (mu *MatchUpdate) RemoveRoles(p ...*PlayerRole) *MatchUpdate

RemoveRoles removes "roles" edges to PlayerRole entities.

func (*MatchUpdate) Save

func (mu *MatchUpdate) Save(ctx context.Context) (int, error)

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

func (*MatchUpdate) SaveX

func (mu *MatchUpdate) SaveX(ctx context.Context) int

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

func (*MatchUpdate) SetCreatedTs

func (mu *MatchUpdate) SetCreatedTs(t time.Time) *MatchUpdate

SetCreatedTs sets the "created_ts" field.

func (*MatchUpdate) SetFetchStatus

func (mu *MatchUpdate) SetFetchStatus(ms match.FetchStatus) *MatchUpdate

SetFetchStatus sets the "fetch_status" field.

func (*MatchUpdate) SetMap

func (mu *MatchUpdate) SetMap(o *OsnMap) *MatchUpdate

SetMap sets the "map" edge to the OsnMap entity.

func (*MatchUpdate) SetMapID

func (mu *MatchUpdate) SetMapID(id int) *MatchUpdate

SetMapID sets the "map" edge to the OsnMap entity by ID.

func (*MatchUpdate) SetNillableCreatedTs

func (mu *MatchUpdate) SetNillableCreatedTs(t *time.Time) *MatchUpdate

SetNillableCreatedTs sets the "created_ts" field if the given value is not nil.

func (*MatchUpdate) SetNillableFetchStatus

func (mu *MatchUpdate) SetNillableFetchStatus(ms *match.FetchStatus) *MatchUpdate

SetNillableFetchStatus sets the "fetch_status" field if the given value is not nil.

func (*MatchUpdate) SetNillableMapID

func (mu *MatchUpdate) SetNillableMapID(id *int) *MatchUpdate

SetNillableMapID sets the "map" edge to the OsnMap entity by ID if the given value is not nil.

func (*MatchUpdate) SetNillableSeason

func (mu *MatchUpdate) SetNillableSeason(i *int8) *MatchUpdate

SetNillableSeason sets the "season" field if the given value is not nil.

func (*MatchUpdate) SetNillableTurnCount

func (mu *MatchUpdate) SetNillableTurnCount(i *int) *MatchUpdate

SetNillableTurnCount sets the "turn_count" field if the given value is not nil.

func (*MatchUpdate) SetSeason

func (mu *MatchUpdate) SetSeason(i int8) *MatchUpdate

SetSeason sets the "season" field.

func (*MatchUpdate) SetTurnCount

func (mu *MatchUpdate) SetTurnCount(i int) *MatchUpdate

SetTurnCount sets the "turn_count" field.

func (*MatchUpdate) Where

func (mu *MatchUpdate) Where(ps ...predicate.Match) *MatchUpdate

Where appends a list predicates to the MatchUpdate builder.

type MatchUpdateOne

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

MatchUpdateOne is the builder for updating a single Match entity.

func (*MatchUpdateOne) AddRoleIDs

func (muo *MatchUpdateOne) AddRoleIDs(ids ...int) *MatchUpdateOne

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

func (*MatchUpdateOne) AddRoles

func (muo *MatchUpdateOne) AddRoles(p ...*PlayerRole) *MatchUpdateOne

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

func (*MatchUpdateOne) AddSeason

func (muo *MatchUpdateOne) AddSeason(i int8) *MatchUpdateOne

AddSeason adds i to the "season" field.

func (*MatchUpdateOne) AddTurnCount

func (muo *MatchUpdateOne) AddTurnCount(i int) *MatchUpdateOne

AddTurnCount adds i to the "turn_count" field.

func (*MatchUpdateOne) ClearMap

func (muo *MatchUpdateOne) ClearMap() *MatchUpdateOne

ClearMap clears the "map" edge to the OsnMap entity.

func (*MatchUpdateOne) ClearRoles

func (muo *MatchUpdateOne) ClearRoles() *MatchUpdateOne

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

func (*MatchUpdateOne) Exec

func (muo *MatchUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MatchUpdateOne) ExecX

func (muo *MatchUpdateOne) ExecX(ctx context.Context)

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

func (*MatchUpdateOne) Mutation

func (muo *MatchUpdateOne) Mutation() *MatchMutation

Mutation returns the MatchMutation object of the builder.

func (*MatchUpdateOne) RemoveRoleIDs

func (muo *MatchUpdateOne) RemoveRoleIDs(ids ...int) *MatchUpdateOne

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

func (*MatchUpdateOne) RemoveRoles

func (muo *MatchUpdateOne) RemoveRoles(p ...*PlayerRole) *MatchUpdateOne

RemoveRoles removes "roles" edges to PlayerRole entities.

func (*MatchUpdateOne) Save

func (muo *MatchUpdateOne) Save(ctx context.Context) (*Match, error)

Save executes the query and returns the updated Match entity.

func (*MatchUpdateOne) SaveX

func (muo *MatchUpdateOne) SaveX(ctx context.Context) *Match

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

func (*MatchUpdateOne) Select

func (muo *MatchUpdateOne) Select(field string, fields ...string) *MatchUpdateOne

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

func (*MatchUpdateOne) SetCreatedTs

func (muo *MatchUpdateOne) SetCreatedTs(t time.Time) *MatchUpdateOne

SetCreatedTs sets the "created_ts" field.

func (*MatchUpdateOne) SetFetchStatus

func (muo *MatchUpdateOne) SetFetchStatus(ms match.FetchStatus) *MatchUpdateOne

SetFetchStatus sets the "fetch_status" field.

func (*MatchUpdateOne) SetMap

func (muo *MatchUpdateOne) SetMap(o *OsnMap) *MatchUpdateOne

SetMap sets the "map" edge to the OsnMap entity.

func (*MatchUpdateOne) SetMapID

func (muo *MatchUpdateOne) SetMapID(id int) *MatchUpdateOne

SetMapID sets the "map" edge to the OsnMap entity by ID.

func (*MatchUpdateOne) SetNillableCreatedTs

func (muo *MatchUpdateOne) SetNillableCreatedTs(t *time.Time) *MatchUpdateOne

SetNillableCreatedTs sets the "created_ts" field if the given value is not nil.

func (*MatchUpdateOne) SetNillableFetchStatus

func (muo *MatchUpdateOne) SetNillableFetchStatus(ms *match.FetchStatus) *MatchUpdateOne

SetNillableFetchStatus sets the "fetch_status" field if the given value is not nil.

func (*MatchUpdateOne) SetNillableMapID

func (muo *MatchUpdateOne) SetNillableMapID(id *int) *MatchUpdateOne

SetNillableMapID sets the "map" edge to the OsnMap entity by ID if the given value is not nil.

func (*MatchUpdateOne) SetNillableSeason

func (muo *MatchUpdateOne) SetNillableSeason(i *int8) *MatchUpdateOne

SetNillableSeason sets the "season" field if the given value is not nil.

func (*MatchUpdateOne) SetNillableTurnCount

func (muo *MatchUpdateOne) SetNillableTurnCount(i *int) *MatchUpdateOne

SetNillableTurnCount sets the "turn_count" field if the given value is not nil.

func (*MatchUpdateOne) SetSeason

func (muo *MatchUpdateOne) SetSeason(i int8) *MatchUpdateOne

SetSeason sets the "season" field.

func (*MatchUpdateOne) SetTurnCount

func (muo *MatchUpdateOne) SetTurnCount(i int) *MatchUpdateOne

SetTurnCount sets the "turn_count" field.

func (*MatchUpdateOne) Where

func (muo *MatchUpdateOne) Where(ps ...predicate.Match) *MatchUpdateOne

Where appends a list predicates to the MatchUpdate builder.

type Matches

type Matches []*Match

Matches is a parsable slice of Match.

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. Deprecated: Use Asc/Desc functions or the package builders instead.

type OsnMap

type OsnMap struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Shortname holds the value of the "shortname" field.
	Shortname string `json:"shortname,omitempty"`
	// RoleCount holds the value of the "role_count" field.
	RoleCount int `json:"role_count,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OsnMapQuery when eager-loading is set.
	Edges OsnMapEdges `json:"edges"`
	// contains filtered or unexported fields
}

OsnMap is the model entity for the OsnMap schema.

func (*OsnMap) QueryMatches

func (om *OsnMap) QueryMatches() *MatchQuery

QueryMatches queries the "matches" edge of the OsnMap entity.

func (*OsnMap) String

func (om *OsnMap) String() string

String implements the fmt.Stringer.

func (*OsnMap) Unwrap

func (om *OsnMap) Unwrap() *OsnMap

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

func (om *OsnMap) Update() *OsnMapUpdateOne

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

func (*OsnMap) Value

func (om *OsnMap) Value(name string) (ent.Value, error)

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

type OsnMapClient

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

OsnMapClient is a client for the OsnMap schema.

func NewOsnMapClient

func NewOsnMapClient(c config) *OsnMapClient

NewOsnMapClient returns a client for the OsnMap from the given config.

func (*OsnMapClient) Create

func (c *OsnMapClient) Create() *OsnMapCreate

Create returns a builder for creating a OsnMap entity.

func (*OsnMapClient) CreateBulk

func (c *OsnMapClient) CreateBulk(builders ...*OsnMapCreate) *OsnMapCreateBulk

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

func (*OsnMapClient) Delete

func (c *OsnMapClient) Delete() *OsnMapDelete

Delete returns a delete builder for OsnMap.

func (*OsnMapClient) DeleteOne

func (c *OsnMapClient) DeleteOne(om *OsnMap) *OsnMapDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OsnMapClient) DeleteOneID

func (c *OsnMapClient) DeleteOneID(id int) *OsnMapDeleteOne

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

func (*OsnMapClient) Get

func (c *OsnMapClient) Get(ctx context.Context, id int) (*OsnMap, error)

Get returns a OsnMap entity by its id.

func (*OsnMapClient) GetX

func (c *OsnMapClient) GetX(ctx context.Context, id int) *OsnMap

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

func (*OsnMapClient) Hooks

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

Hooks returns the client hooks.

func (*OsnMapClient) Intercept

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

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

func (*OsnMapClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OsnMapClient) MapCreateBulk

func (c *OsnMapClient) MapCreateBulk(slice any, setFunc func(*OsnMapCreate, int)) *OsnMapCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*OsnMapClient) Query

func (c *OsnMapClient) Query() *OsnMapQuery

Query returns a query builder for OsnMap.

func (*OsnMapClient) QueryMatches

func (c *OsnMapClient) QueryMatches(om *OsnMap) *MatchQuery

QueryMatches queries the matches edge of a OsnMap.

func (*OsnMapClient) Update

func (c *OsnMapClient) Update() *OsnMapUpdate

Update returns an update builder for OsnMap.

func (*OsnMapClient) UpdateOne

func (c *OsnMapClient) UpdateOne(om *OsnMap) *OsnMapUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OsnMapClient) UpdateOneID

func (c *OsnMapClient) UpdateOneID(id int) *OsnMapUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OsnMapClient) Use

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

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

type OsnMapCreate

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

OsnMapCreate is the builder for creating a OsnMap entity.

func (*OsnMapCreate) AddMatchIDs

func (omc *OsnMapCreate) AddMatchIDs(ids ...int) *OsnMapCreate

AddMatchIDs adds the "matches" edge to the Match entity by IDs.

func (*OsnMapCreate) AddMatches

func (omc *OsnMapCreate) AddMatches(m ...*Match) *OsnMapCreate

AddMatches adds the "matches" edges to the Match entity.

func (*OsnMapCreate) Exec

func (omc *OsnMapCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OsnMapCreate) ExecX

func (omc *OsnMapCreate) ExecX(ctx context.Context)

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

func (*OsnMapCreate) Mutation

func (omc *OsnMapCreate) Mutation() *OsnMapMutation

Mutation returns the OsnMapMutation object of the builder.

func (*OsnMapCreate) Save

func (omc *OsnMapCreate) Save(ctx context.Context) (*OsnMap, error)

Save creates the OsnMap in the database.

func (*OsnMapCreate) SaveX

func (omc *OsnMapCreate) SaveX(ctx context.Context) *OsnMap

SaveX calls Save and panics if Save returns an error.

func (*OsnMapCreate) SetName

func (omc *OsnMapCreate) SetName(s string) *OsnMapCreate

SetName sets the "name" field.

func (*OsnMapCreate) SetRoleCount

func (omc *OsnMapCreate) SetRoleCount(i int) *OsnMapCreate

SetRoleCount sets the "role_count" field.

func (*OsnMapCreate) SetShortname

func (omc *OsnMapCreate) SetShortname(s string) *OsnMapCreate

SetShortname sets the "shortname" field.

type OsnMapCreateBulk

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

OsnMapCreateBulk is the builder for creating many OsnMap entities in bulk.

func (*OsnMapCreateBulk) Exec

func (omcb *OsnMapCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OsnMapCreateBulk) ExecX

func (omcb *OsnMapCreateBulk) ExecX(ctx context.Context)

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

func (*OsnMapCreateBulk) Save

func (omcb *OsnMapCreateBulk) Save(ctx context.Context) ([]*OsnMap, error)

Save creates the OsnMap entities in the database.

func (*OsnMapCreateBulk) SaveX

func (omcb *OsnMapCreateBulk) SaveX(ctx context.Context) []*OsnMap

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

type OsnMapDelete

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

OsnMapDelete is the builder for deleting a OsnMap entity.

func (*OsnMapDelete) Exec

func (omd *OsnMapDelete) Exec(ctx context.Context) (int, error)

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

func (*OsnMapDelete) ExecX

func (omd *OsnMapDelete) ExecX(ctx context.Context) int

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

func (*OsnMapDelete) Where

func (omd *OsnMapDelete) Where(ps ...predicate.OsnMap) *OsnMapDelete

Where appends a list predicates to the OsnMapDelete builder.

type OsnMapDeleteOne

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

OsnMapDeleteOne is the builder for deleting a single OsnMap entity.

func (*OsnMapDeleteOne) Exec

func (omdo *OsnMapDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OsnMapDeleteOne) ExecX

func (omdo *OsnMapDeleteOne) ExecX(ctx context.Context)

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

func (*OsnMapDeleteOne) Where

func (omdo *OsnMapDeleteOne) Where(ps ...predicate.OsnMap) *OsnMapDeleteOne

Where appends a list predicates to the OsnMapDelete builder.

type OsnMapEdges

type OsnMapEdges struct {
	// Matches holds the value of the matches edge.
	Matches []*Match `json:"matches,omitempty"`
	// contains filtered or unexported fields
}

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

func (OsnMapEdges) MatchesOrErr

func (e OsnMapEdges) MatchesOrErr() ([]*Match, error)

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

type OsnMapGroupBy

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

OsnMapGroupBy is the group-by builder for OsnMap entities.

func (*OsnMapGroupBy) Aggregate

func (omgb *OsnMapGroupBy) Aggregate(fns ...AggregateFunc) *OsnMapGroupBy

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

func (*OsnMapGroupBy) Bool

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

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

func (*OsnMapGroupBy) BoolX

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

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

func (*OsnMapGroupBy) Bools

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

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

func (*OsnMapGroupBy) BoolsX

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

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

func (*OsnMapGroupBy) Float64

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

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

func (*OsnMapGroupBy) Float64X

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

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

func (*OsnMapGroupBy) Float64s

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

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

func (*OsnMapGroupBy) Float64sX

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

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

func (*OsnMapGroupBy) Int

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

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

func (*OsnMapGroupBy) IntX

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

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

func (*OsnMapGroupBy) Ints

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

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

func (*OsnMapGroupBy) IntsX

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

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

func (*OsnMapGroupBy) Scan

func (omgb *OsnMapGroupBy) Scan(ctx context.Context, v any) error

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

func (*OsnMapGroupBy) ScanX

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

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

func (*OsnMapGroupBy) String

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

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

func (*OsnMapGroupBy) StringX

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

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

func (*OsnMapGroupBy) Strings

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

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

func (*OsnMapGroupBy) StringsX

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

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

type OsnMapMutation

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

OsnMapMutation represents an operation that mutates the OsnMap nodes in the graph.

func (*OsnMapMutation) AddField

func (m *OsnMapMutation) 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 (*OsnMapMutation) AddMatchIDs

func (m *OsnMapMutation) AddMatchIDs(ids ...int)

AddMatchIDs adds the "matches" edge to the Match entity by ids.

func (*OsnMapMutation) AddRoleCount

func (m *OsnMapMutation) AddRoleCount(i int)

AddRoleCount adds i to the "role_count" field.

func (*OsnMapMutation) AddedEdges

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

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

func (*OsnMapMutation) AddedField

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

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

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

func (*OsnMapMutation) AddedIDs

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

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

func (*OsnMapMutation) AddedRoleCount

func (m *OsnMapMutation) AddedRoleCount() (r int, exists bool)

AddedRoleCount returns the value that was added to the "role_count" field in this mutation.

func (*OsnMapMutation) ClearEdge

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

func (m *OsnMapMutation) 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 (*OsnMapMutation) ClearMatches

func (m *OsnMapMutation) ClearMatches()

ClearMatches clears the "matches" edge to the Match entity.

func (*OsnMapMutation) ClearedEdges

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

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

func (*OsnMapMutation) ClearedFields

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

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

func (OsnMapMutation) Client

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

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

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

func (*OsnMapMutation) Field

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

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

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

func (*OsnMapMutation) Fields

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

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

func (m *OsnMapMutation) 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 (*OsnMapMutation) MatchesCleared

func (m *OsnMapMutation) MatchesCleared() bool

MatchesCleared reports if the "matches" edge to the Match entity was cleared.

func (*OsnMapMutation) MatchesIDs

func (m *OsnMapMutation) MatchesIDs() (ids []int)

MatchesIDs returns the "matches" edge IDs in the mutation.

func (*OsnMapMutation) Name

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

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

func (*OsnMapMutation) OldField

func (m *OsnMapMutation) 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 (*OsnMapMutation) OldName

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

OldName returns the old "name" field's value of the OsnMap entity. If the OsnMap 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 (*OsnMapMutation) OldRoleCount

func (m *OsnMapMutation) OldRoleCount(ctx context.Context) (v int, err error)

OldRoleCount returns the old "role_count" field's value of the OsnMap entity. If the OsnMap 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 (*OsnMapMutation) OldShortname

func (m *OsnMapMutation) OldShortname(ctx context.Context) (v string, err error)

OldShortname returns the old "shortname" field's value of the OsnMap entity. If the OsnMap 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 (*OsnMapMutation) Op

func (m *OsnMapMutation) Op() Op

Op returns the operation name.

func (*OsnMapMutation) RemoveMatchIDs

func (m *OsnMapMutation) RemoveMatchIDs(ids ...int)

RemoveMatchIDs removes the "matches" edge to the Match entity by IDs.

func (*OsnMapMutation) RemovedEdges

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

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

func (*OsnMapMutation) RemovedIDs

func (m *OsnMapMutation) 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 (*OsnMapMutation) RemovedMatchesIDs

func (m *OsnMapMutation) RemovedMatchesIDs() (ids []int)

RemovedMatches returns the removed IDs of the "matches" edge to the Match entity.

func (*OsnMapMutation) ResetEdge

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

func (m *OsnMapMutation) 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 (*OsnMapMutation) ResetMatches

func (m *OsnMapMutation) ResetMatches()

ResetMatches resets all changes to the "matches" edge.

func (*OsnMapMutation) ResetName

func (m *OsnMapMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OsnMapMutation) ResetRoleCount

func (m *OsnMapMutation) ResetRoleCount()

ResetRoleCount resets all changes to the "role_count" field.

func (*OsnMapMutation) ResetShortname

func (m *OsnMapMutation) ResetShortname()

ResetShortname resets all changes to the "shortname" field.

func (*OsnMapMutation) RoleCount

func (m *OsnMapMutation) RoleCount() (r int, exists bool)

RoleCount returns the value of the "role_count" field in the mutation.

func (*OsnMapMutation) SetField

func (m *OsnMapMutation) 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 (*OsnMapMutation) SetName

func (m *OsnMapMutation) SetName(s string)

SetName sets the "name" field.

func (*OsnMapMutation) SetOp

func (m *OsnMapMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OsnMapMutation) SetRoleCount

func (m *OsnMapMutation) SetRoleCount(i int)

SetRoleCount sets the "role_count" field.

func (*OsnMapMutation) SetShortname

func (m *OsnMapMutation) SetShortname(s string)

SetShortname sets the "shortname" field.

func (*OsnMapMutation) Shortname

func (m *OsnMapMutation) Shortname() (r string, exists bool)

Shortname returns the value of the "shortname" field in the mutation.

func (OsnMapMutation) Tx

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

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

func (*OsnMapMutation) Type

func (m *OsnMapMutation) Type() string

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

func (*OsnMapMutation) Where

func (m *OsnMapMutation) Where(ps ...predicate.OsnMap)

Where appends a list predicates to the OsnMapMutation builder.

func (*OsnMapMutation) WhereP

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

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

type OsnMapQuery

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

OsnMapQuery is the builder for querying OsnMap entities.

func (*OsnMapQuery) Aggregate

func (omq *OsnMapQuery) Aggregate(fns ...AggregateFunc) *OsnMapSelect

Aggregate returns a OsnMapSelect configured with the given aggregations.

func (*OsnMapQuery) All

func (omq *OsnMapQuery) All(ctx context.Context) ([]*OsnMap, error)

All executes the query and returns a list of OsnMaps.

func (*OsnMapQuery) AllX

func (omq *OsnMapQuery) AllX(ctx context.Context) []*OsnMap

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

func (*OsnMapQuery) Clone

func (omq *OsnMapQuery) Clone() *OsnMapQuery

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

func (*OsnMapQuery) Count

func (omq *OsnMapQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OsnMapQuery) CountX

func (omq *OsnMapQuery) CountX(ctx context.Context) int

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

func (*OsnMapQuery) Exist

func (omq *OsnMapQuery) Exist(ctx context.Context) (bool, error)

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

func (*OsnMapQuery) ExistX

func (omq *OsnMapQuery) ExistX(ctx context.Context) bool

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

func (*OsnMapQuery) First

func (omq *OsnMapQuery) First(ctx context.Context) (*OsnMap, error)

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

func (*OsnMapQuery) FirstID

func (omq *OsnMapQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OsnMapQuery) FirstIDX

func (omq *OsnMapQuery) FirstIDX(ctx context.Context) int

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

func (*OsnMapQuery) FirstX

func (omq *OsnMapQuery) FirstX(ctx context.Context) *OsnMap

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

func (*OsnMapQuery) GroupBy

func (omq *OsnMapQuery) GroupBy(field string, fields ...string) *OsnMapGroupBy

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

Example:

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

client.OsnMap.Query().
	GroupBy(osnmap.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OsnMapQuery) IDs

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

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

func (*OsnMapQuery) IDsX

func (omq *OsnMapQuery) IDsX(ctx context.Context) []int

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

func (*OsnMapQuery) Limit

func (omq *OsnMapQuery) Limit(limit int) *OsnMapQuery

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

func (*OsnMapQuery) Offset

func (omq *OsnMapQuery) Offset(offset int) *OsnMapQuery

Offset to start from.

func (*OsnMapQuery) Only

func (omq *OsnMapQuery) Only(ctx context.Context) (*OsnMap, error)

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

func (*OsnMapQuery) OnlyID

func (omq *OsnMapQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OsnMapQuery) OnlyIDX

func (omq *OsnMapQuery) OnlyIDX(ctx context.Context) int

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

func (*OsnMapQuery) OnlyX

func (omq *OsnMapQuery) OnlyX(ctx context.Context) *OsnMap

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

func (*OsnMapQuery) Order

func (omq *OsnMapQuery) Order(o ...osnmap.OrderOption) *OsnMapQuery

Order specifies how the records should be ordered.

func (*OsnMapQuery) QueryMatches

func (omq *OsnMapQuery) QueryMatches() *MatchQuery

QueryMatches chains the current query on the "matches" edge.

func (*OsnMapQuery) Select

func (omq *OsnMapQuery) Select(fields ...string) *OsnMapSelect

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

Example:

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

client.OsnMap.Query().
	Select(osnmap.FieldName).
	Scan(ctx, &v)

func (*OsnMapQuery) Unique

func (omq *OsnMapQuery) Unique(unique bool) *OsnMapQuery

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

func (omq *OsnMapQuery) Where(ps ...predicate.OsnMap) *OsnMapQuery

Where adds a new predicate for the OsnMapQuery builder.

func (*OsnMapQuery) WithMatches

func (omq *OsnMapQuery) WithMatches(opts ...func(*MatchQuery)) *OsnMapQuery

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

type OsnMapSelect

type OsnMapSelect struct {
	*OsnMapQuery
	// contains filtered or unexported fields
}

OsnMapSelect is the builder for selecting fields of OsnMap entities.

func (*OsnMapSelect) Aggregate

func (oms *OsnMapSelect) Aggregate(fns ...AggregateFunc) *OsnMapSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OsnMapSelect) Bool

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

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

func (*OsnMapSelect) BoolX

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

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

func (*OsnMapSelect) Bools

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

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

func (*OsnMapSelect) BoolsX

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

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

func (*OsnMapSelect) Float64

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

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

func (*OsnMapSelect) Float64X

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

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

func (*OsnMapSelect) Float64s

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

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

func (*OsnMapSelect) Float64sX

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

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

func (*OsnMapSelect) Int

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

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

func (*OsnMapSelect) IntX

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

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

func (*OsnMapSelect) Ints

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

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

func (*OsnMapSelect) IntsX

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

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

func (*OsnMapSelect) Scan

func (oms *OsnMapSelect) Scan(ctx context.Context, v any) error

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

func (*OsnMapSelect) ScanX

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

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

func (*OsnMapSelect) String

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

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

func (*OsnMapSelect) StringX

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

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

func (*OsnMapSelect) Strings

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

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

func (*OsnMapSelect) StringsX

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

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

type OsnMapUpdate

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

OsnMapUpdate is the builder for updating OsnMap entities.

func (*OsnMapUpdate) AddMatchIDs

func (omu *OsnMapUpdate) AddMatchIDs(ids ...int) *OsnMapUpdate

AddMatchIDs adds the "matches" edge to the Match entity by IDs.

func (*OsnMapUpdate) AddMatches

func (omu *OsnMapUpdate) AddMatches(m ...*Match) *OsnMapUpdate

AddMatches adds the "matches" edges to the Match entity.

func (*OsnMapUpdate) AddRoleCount

func (omu *OsnMapUpdate) AddRoleCount(i int) *OsnMapUpdate

AddRoleCount adds i to the "role_count" field.

func (*OsnMapUpdate) ClearMatches

func (omu *OsnMapUpdate) ClearMatches() *OsnMapUpdate

ClearMatches clears all "matches" edges to the Match entity.

func (*OsnMapUpdate) Exec

func (omu *OsnMapUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OsnMapUpdate) ExecX

func (omu *OsnMapUpdate) ExecX(ctx context.Context)

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

func (*OsnMapUpdate) Mutation

func (omu *OsnMapUpdate) Mutation() *OsnMapMutation

Mutation returns the OsnMapMutation object of the builder.

func (*OsnMapUpdate) RemoveMatchIDs

func (omu *OsnMapUpdate) RemoveMatchIDs(ids ...int) *OsnMapUpdate

RemoveMatchIDs removes the "matches" edge to Match entities by IDs.

func (*OsnMapUpdate) RemoveMatches

func (omu *OsnMapUpdate) RemoveMatches(m ...*Match) *OsnMapUpdate

RemoveMatches removes "matches" edges to Match entities.

func (*OsnMapUpdate) Save

func (omu *OsnMapUpdate) Save(ctx context.Context) (int, error)

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

func (*OsnMapUpdate) SaveX

func (omu *OsnMapUpdate) SaveX(ctx context.Context) int

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

func (*OsnMapUpdate) SetName

func (omu *OsnMapUpdate) SetName(s string) *OsnMapUpdate

SetName sets the "name" field.

func (*OsnMapUpdate) SetNillableName

func (omu *OsnMapUpdate) SetNillableName(s *string) *OsnMapUpdate

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

func (*OsnMapUpdate) SetNillableRoleCount

func (omu *OsnMapUpdate) SetNillableRoleCount(i *int) *OsnMapUpdate

SetNillableRoleCount sets the "role_count" field if the given value is not nil.

func (*OsnMapUpdate) SetNillableShortname

func (omu *OsnMapUpdate) SetNillableShortname(s *string) *OsnMapUpdate

SetNillableShortname sets the "shortname" field if the given value is not nil.

func (*OsnMapUpdate) SetRoleCount

func (omu *OsnMapUpdate) SetRoleCount(i int) *OsnMapUpdate

SetRoleCount sets the "role_count" field.

func (*OsnMapUpdate) SetShortname

func (omu *OsnMapUpdate) SetShortname(s string) *OsnMapUpdate

SetShortname sets the "shortname" field.

func (*OsnMapUpdate) Where

func (omu *OsnMapUpdate) Where(ps ...predicate.OsnMap) *OsnMapUpdate

Where appends a list predicates to the OsnMapUpdate builder.

type OsnMapUpdateOne

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

OsnMapUpdateOne is the builder for updating a single OsnMap entity.

func (*OsnMapUpdateOne) AddMatchIDs

func (omuo *OsnMapUpdateOne) AddMatchIDs(ids ...int) *OsnMapUpdateOne

AddMatchIDs adds the "matches" edge to the Match entity by IDs.

func (*OsnMapUpdateOne) AddMatches

func (omuo *OsnMapUpdateOne) AddMatches(m ...*Match) *OsnMapUpdateOne

AddMatches adds the "matches" edges to the Match entity.

func (*OsnMapUpdateOne) AddRoleCount

func (omuo *OsnMapUpdateOne) AddRoleCount(i int) *OsnMapUpdateOne

AddRoleCount adds i to the "role_count" field.

func (*OsnMapUpdateOne) ClearMatches

func (omuo *OsnMapUpdateOne) ClearMatches() *OsnMapUpdateOne

ClearMatches clears all "matches" edges to the Match entity.

func (*OsnMapUpdateOne) Exec

func (omuo *OsnMapUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OsnMapUpdateOne) ExecX

func (omuo *OsnMapUpdateOne) ExecX(ctx context.Context)

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

func (*OsnMapUpdateOne) Mutation

func (omuo *OsnMapUpdateOne) Mutation() *OsnMapMutation

Mutation returns the OsnMapMutation object of the builder.

func (*OsnMapUpdateOne) RemoveMatchIDs

func (omuo *OsnMapUpdateOne) RemoveMatchIDs(ids ...int) *OsnMapUpdateOne

RemoveMatchIDs removes the "matches" edge to Match entities by IDs.

func (*OsnMapUpdateOne) RemoveMatches

func (omuo *OsnMapUpdateOne) RemoveMatches(m ...*Match) *OsnMapUpdateOne

RemoveMatches removes "matches" edges to Match entities.

func (*OsnMapUpdateOne) Save

func (omuo *OsnMapUpdateOne) Save(ctx context.Context) (*OsnMap, error)

Save executes the query and returns the updated OsnMap entity.

func (*OsnMapUpdateOne) SaveX

func (omuo *OsnMapUpdateOne) SaveX(ctx context.Context) *OsnMap

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

func (*OsnMapUpdateOne) Select

func (omuo *OsnMapUpdateOne) Select(field string, fields ...string) *OsnMapUpdateOne

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

func (*OsnMapUpdateOne) SetName

func (omuo *OsnMapUpdateOne) SetName(s string) *OsnMapUpdateOne

SetName sets the "name" field.

func (*OsnMapUpdateOne) SetNillableName

func (omuo *OsnMapUpdateOne) SetNillableName(s *string) *OsnMapUpdateOne

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

func (*OsnMapUpdateOne) SetNillableRoleCount

func (omuo *OsnMapUpdateOne) SetNillableRoleCount(i *int) *OsnMapUpdateOne

SetNillableRoleCount sets the "role_count" field if the given value is not nil.

func (*OsnMapUpdateOne) SetNillableShortname

func (omuo *OsnMapUpdateOne) SetNillableShortname(s *string) *OsnMapUpdateOne

SetNillableShortname sets the "shortname" field if the given value is not nil.

func (*OsnMapUpdateOne) SetRoleCount

func (omuo *OsnMapUpdateOne) SetRoleCount(i int) *OsnMapUpdateOne

SetRoleCount sets the "role_count" field.

func (*OsnMapUpdateOne) SetShortname

func (omuo *OsnMapUpdateOne) SetShortname(s string) *OsnMapUpdateOne

SetShortname sets the "shortname" field.

func (*OsnMapUpdateOne) Where

func (omuo *OsnMapUpdateOne) Where(ps ...predicate.OsnMap) *OsnMapUpdateOne

Where appends a list predicates to the OsnMapUpdate builder.

type OsnMaps

type OsnMaps []*OsnMap

OsnMaps is a parsable slice of OsnMap.

type Player

type Player struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Gcid holds the value of the "gcid" field.
	Gcid *string `json:"-"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PlayerQuery when eager-loading is set.
	Edges PlayerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Player is the model entity for the Player schema.

func (*Player) QueryRoles

func (pl *Player) QueryRoles() *PlayerRoleQuery

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

func (*Player) String

func (pl *Player) String() string

String implements the fmt.Stringer.

func (*Player) Unwrap

func (pl *Player) Unwrap() *Player

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

func (pl *Player) Update() *PlayerUpdateOne

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

func (*Player) Value

func (pl *Player) Value(name string) (ent.Value, error)

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

type PlayerClient

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

PlayerClient is a client for the Player schema.

func NewPlayerClient

func NewPlayerClient(c config) *PlayerClient

NewPlayerClient returns a client for the Player from the given config.

func (*PlayerClient) Create

func (c *PlayerClient) Create() *PlayerCreate

Create returns a builder for creating a Player entity.

func (*PlayerClient) CreateBulk

func (c *PlayerClient) CreateBulk(builders ...*PlayerCreate) *PlayerCreateBulk

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

func (*PlayerClient) Delete

func (c *PlayerClient) Delete() *PlayerDelete

Delete returns a delete builder for Player.

func (*PlayerClient) DeleteOne

func (c *PlayerClient) DeleteOne(pl *Player) *PlayerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PlayerClient) DeleteOneID

func (c *PlayerClient) DeleteOneID(id int) *PlayerDeleteOne

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

func (*PlayerClient) Get

func (c *PlayerClient) Get(ctx context.Context, id int) (*Player, error)

Get returns a Player entity by its id.

func (*PlayerClient) GetX

func (c *PlayerClient) GetX(ctx context.Context, id int) *Player

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

func (*PlayerClient) Hooks

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

Hooks returns the client hooks.

func (*PlayerClient) Intercept

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

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

func (*PlayerClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PlayerClient) MapCreateBulk

func (c *PlayerClient) MapCreateBulk(slice any, setFunc func(*PlayerCreate, int)) *PlayerCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PlayerClient) Query

func (c *PlayerClient) Query() *PlayerQuery

Query returns a query builder for Player.

func (*PlayerClient) QueryRoles

func (c *PlayerClient) QueryRoles(pl *Player) *PlayerRoleQuery

QueryRoles queries the roles edge of a Player.

func (*PlayerClient) Update

func (c *PlayerClient) Update() *PlayerUpdate

Update returns an update builder for Player.

func (*PlayerClient) UpdateOne

func (c *PlayerClient) UpdateOne(pl *Player) *PlayerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PlayerClient) UpdateOneID

func (c *PlayerClient) UpdateOneID(id int) *PlayerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PlayerClient) Use

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

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

type PlayerCreate

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

PlayerCreate is the builder for creating a Player entity.

func (*PlayerCreate) AddRoleIDs

func (pc *PlayerCreate) AddRoleIDs(ids ...int) *PlayerCreate

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

func (*PlayerCreate) AddRoles

func (pc *PlayerCreate) AddRoles(p ...*PlayerRole) *PlayerCreate

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

func (*PlayerCreate) Exec

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

Exec executes the query.

func (*PlayerCreate) ExecX

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

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

func (*PlayerCreate) Mutation

func (pc *PlayerCreate) Mutation() *PlayerMutation

Mutation returns the PlayerMutation object of the builder.

func (*PlayerCreate) Save

func (pc *PlayerCreate) Save(ctx context.Context) (*Player, error)

Save creates the Player in the database.

func (*PlayerCreate) SaveX

func (pc *PlayerCreate) SaveX(ctx context.Context) *Player

SaveX calls Save and panics if Save returns an error.

func (*PlayerCreate) SetGcid

func (pc *PlayerCreate) SetGcid(s string) *PlayerCreate

SetGcid sets the "gcid" field.

func (*PlayerCreate) SetName

func (pc *PlayerCreate) SetName(s string) *PlayerCreate

SetName sets the "name" field.

type PlayerCreateBulk

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

PlayerCreateBulk is the builder for creating many Player entities in bulk.

func (*PlayerCreateBulk) Exec

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

Exec executes the query.

func (*PlayerCreateBulk) ExecX

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

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

func (*PlayerCreateBulk) Save

func (pcb *PlayerCreateBulk) Save(ctx context.Context) ([]*Player, error)

Save creates the Player entities in the database.

func (*PlayerCreateBulk) SaveX

func (pcb *PlayerCreateBulk) SaveX(ctx context.Context) []*Player

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

type PlayerDelete

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

PlayerDelete is the builder for deleting a Player entity.

func (*PlayerDelete) Exec

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

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

func (*PlayerDelete) ExecX

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

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

func (*PlayerDelete) Where

func (pd *PlayerDelete) Where(ps ...predicate.Player) *PlayerDelete

Where appends a list predicates to the PlayerDelete builder.

type PlayerDeleteOne

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

PlayerDeleteOne is the builder for deleting a single Player entity.

func (*PlayerDeleteOne) Exec

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

Exec executes the deletion query.

func (*PlayerDeleteOne) ExecX

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

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

func (*PlayerDeleteOne) Where

func (pdo *PlayerDeleteOne) Where(ps ...predicate.Player) *PlayerDeleteOne

Where appends a list predicates to the PlayerDelete builder.

type PlayerEdges

type PlayerEdges struct {
	// Roles holds the value of the roles edge.
	Roles []*PlayerRole `json:"roles,omitempty"`
	// contains filtered or unexported fields
}

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

func (PlayerEdges) RolesOrErr

func (e PlayerEdges) RolesOrErr() ([]*PlayerRole, error)

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

type PlayerGroupBy

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

PlayerGroupBy is the group-by builder for Player entities.

func (*PlayerGroupBy) Aggregate

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

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

func (*PlayerGroupBy) Bool

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

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

func (*PlayerGroupBy) BoolX

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

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

func (*PlayerGroupBy) Bools

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

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

func (*PlayerGroupBy) BoolsX

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

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

func (*PlayerGroupBy) Float64

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

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

func (*PlayerGroupBy) Float64X

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

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

func (*PlayerGroupBy) Float64s

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

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

func (*PlayerGroupBy) Float64sX

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

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

func (*PlayerGroupBy) Int

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

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

func (*PlayerGroupBy) IntX

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

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

func (*PlayerGroupBy) Ints

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

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

func (*PlayerGroupBy) IntsX

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

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

func (*PlayerGroupBy) Scan

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

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

func (*PlayerGroupBy) ScanX

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

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

func (*PlayerGroupBy) String

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

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

func (*PlayerGroupBy) StringX

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

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

func (*PlayerGroupBy) Strings

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

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

func (*PlayerGroupBy) StringsX

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

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

type PlayerMutation

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

PlayerMutation represents an operation that mutates the Player nodes in the graph.

func (*PlayerMutation) AddField

func (m *PlayerMutation) 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 (*PlayerMutation) AddRoleIDs

func (m *PlayerMutation) AddRoleIDs(ids ...int)

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

func (*PlayerMutation) AddedEdges

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

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

func (*PlayerMutation) AddedField

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

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

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

func (*PlayerMutation) AddedIDs

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

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

func (*PlayerMutation) ClearEdge

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

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

func (m *PlayerMutation) ClearRoles()

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

func (*PlayerMutation) ClearedEdges

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

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

func (*PlayerMutation) ClearedFields

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

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

func (PlayerMutation) Client

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

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

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

func (*PlayerMutation) Field

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

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

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

func (*PlayerMutation) Fields

func (m *PlayerMutation) 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 (*PlayerMutation) Gcid

func (m *PlayerMutation) Gcid() (r string, exists bool)

Gcid returns the value of the "gcid" field in the mutation.

func (*PlayerMutation) ID

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

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

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

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

func (*PlayerMutation) OldField

func (m *PlayerMutation) 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 (*PlayerMutation) OldGcid

func (m *PlayerMutation) OldGcid(ctx context.Context) (v *string, err error)

OldGcid returns the old "gcid" field's value of the Player entity. If the Player 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 (*PlayerMutation) OldName

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

OldName returns the old "name" field's value of the Player entity. If the Player 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 (*PlayerMutation) Op

func (m *PlayerMutation) Op() Op

Op returns the operation name.

func (*PlayerMutation) RemoveRoleIDs

func (m *PlayerMutation) RemoveRoleIDs(ids ...int)

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

func (*PlayerMutation) RemovedEdges

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

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

func (*PlayerMutation) RemovedIDs

func (m *PlayerMutation) 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 (*PlayerMutation) RemovedRolesIDs

func (m *PlayerMutation) RemovedRolesIDs() (ids []int)

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

func (*PlayerMutation) ResetEdge

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

func (m *PlayerMutation) 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 (*PlayerMutation) ResetGcid

func (m *PlayerMutation) ResetGcid()

ResetGcid resets all changes to the "gcid" field.

func (*PlayerMutation) ResetName

func (m *PlayerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PlayerMutation) ResetRoles

func (m *PlayerMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*PlayerMutation) RolesCleared

func (m *PlayerMutation) RolesCleared() bool

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

func (*PlayerMutation) RolesIDs

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

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

func (*PlayerMutation) SetField

func (m *PlayerMutation) 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 (*PlayerMutation) SetGcid

func (m *PlayerMutation) SetGcid(s string)

SetGcid sets the "gcid" field.

func (*PlayerMutation) SetName

func (m *PlayerMutation) SetName(s string)

SetName sets the "name" field.

func (*PlayerMutation) SetOp

func (m *PlayerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (PlayerMutation) Tx

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

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

func (*PlayerMutation) Type

func (m *PlayerMutation) Type() string

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

func (*PlayerMutation) Where

func (m *PlayerMutation) Where(ps ...predicate.Player)

Where appends a list predicates to the PlayerMutation builder.

func (*PlayerMutation) WhereP

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

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

type PlayerQuery

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

PlayerQuery is the builder for querying Player entities.

func (*PlayerQuery) Aggregate

func (pq *PlayerQuery) Aggregate(fns ...AggregateFunc) *PlayerSelect

Aggregate returns a PlayerSelect configured with the given aggregations.

func (*PlayerQuery) All

func (pq *PlayerQuery) All(ctx context.Context) ([]*Player, error)

All executes the query and returns a list of Players.

func (*PlayerQuery) AllX

func (pq *PlayerQuery) AllX(ctx context.Context) []*Player

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

func (*PlayerQuery) Clone

func (pq *PlayerQuery) Clone() *PlayerQuery

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

func (*PlayerQuery) Count

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

Count returns the count of the given query.

func (*PlayerQuery) CountX

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

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

func (*PlayerQuery) Exist

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

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

func (*PlayerQuery) ExistX

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

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

func (*PlayerQuery) First

func (pq *PlayerQuery) First(ctx context.Context) (*Player, error)

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

func (*PlayerQuery) FirstID

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

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

func (*PlayerQuery) FirstIDX

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

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

func (*PlayerQuery) FirstX

func (pq *PlayerQuery) FirstX(ctx context.Context) *Player

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

func (*PlayerQuery) GroupBy

func (pq *PlayerQuery) GroupBy(field string, fields ...string) *PlayerGroupBy

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

client.Player.Query().
	GroupBy(player.FieldGcid).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PlayerQuery) IDs

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

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

func (*PlayerQuery) IDsX

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

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

func (*PlayerQuery) Limit

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

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

func (*PlayerQuery) Offset

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

Offset to start from.

func (*PlayerQuery) Only

func (pq *PlayerQuery) Only(ctx context.Context) (*Player, error)

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

func (*PlayerQuery) OnlyID

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

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

func (*PlayerQuery) OnlyIDX

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

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

func (*PlayerQuery) OnlyX

func (pq *PlayerQuery) OnlyX(ctx context.Context) *Player

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

func (*PlayerQuery) Order

func (pq *PlayerQuery) Order(o ...player.OrderOption) *PlayerQuery

Order specifies how the records should be ordered.

func (*PlayerQuery) QueryRoles

func (pq *PlayerQuery) QueryRoles() *PlayerRoleQuery

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

func (*PlayerQuery) Select

func (pq *PlayerQuery) Select(fields ...string) *PlayerSelect

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

client.Player.Query().
	Select(player.FieldGcid).
	Scan(ctx, &v)

func (*PlayerQuery) Unique

func (pq *PlayerQuery) Unique(unique bool) *PlayerQuery

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

func (pq *PlayerQuery) Where(ps ...predicate.Player) *PlayerQuery

Where adds a new predicate for the PlayerQuery builder.

func (*PlayerQuery) WithRoles

func (pq *PlayerQuery) WithRoles(opts ...func(*PlayerRoleQuery)) *PlayerQuery

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 PlayerRole

type PlayerRole struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// MatchID holds the value of the "match_id" field.
	MatchID int `json:"match_id,omitempty"`
	// PlayerID holds the value of the "player_id" field.
	PlayerID int `json:"player_id,omitempty"`
	// Position holds the value of the "position" field.
	Position int `json:"position,omitempty"`
	// TurnOrder holds the value of the "turn_order" field.
	TurnOrder int `json:"turn_order,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PlayerRoleQuery when eager-loading is set.
	Edges PlayerRoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

PlayerRole is the model entity for the PlayerRole schema.

func (*PlayerRole) QueryMatch

func (pr *PlayerRole) QueryMatch() *MatchQuery

QueryMatch queries the "match" edge of the PlayerRole entity.

func (*PlayerRole) QueryPlayers

func (pr *PlayerRole) QueryPlayers() *PlayerQuery

QueryPlayers queries the "players" edge of the PlayerRole entity.

func (*PlayerRole) String

func (pr *PlayerRole) String() string

String implements the fmt.Stringer.

func (*PlayerRole) Unwrap

func (pr *PlayerRole) Unwrap() *PlayerRole

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

func (pr *PlayerRole) Update() *PlayerRoleUpdateOne

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

func (*PlayerRole) Value

func (pr *PlayerRole) Value(name string) (ent.Value, error)

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

type PlayerRoleClient

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

PlayerRoleClient is a client for the PlayerRole schema.

func NewPlayerRoleClient

func NewPlayerRoleClient(c config) *PlayerRoleClient

NewPlayerRoleClient returns a client for the PlayerRole from the given config.

func (*PlayerRoleClient) Create

func (c *PlayerRoleClient) Create() *PlayerRoleCreate

Create returns a builder for creating a PlayerRole entity.

func (*PlayerRoleClient) CreateBulk

func (c *PlayerRoleClient) CreateBulk(builders ...*PlayerRoleCreate) *PlayerRoleCreateBulk

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

func (*PlayerRoleClient) Delete

func (c *PlayerRoleClient) Delete() *PlayerRoleDelete

Delete returns a delete builder for PlayerRole.

func (*PlayerRoleClient) DeleteOne

func (c *PlayerRoleClient) DeleteOne(pr *PlayerRole) *PlayerRoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PlayerRoleClient) DeleteOneID

func (c *PlayerRoleClient) DeleteOneID(id int) *PlayerRoleDeleteOne

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

func (*PlayerRoleClient) Get

func (c *PlayerRoleClient) Get(ctx context.Context, id int) (*PlayerRole, error)

Get returns a PlayerRole entity by its id.

func (*PlayerRoleClient) GetX

func (c *PlayerRoleClient) GetX(ctx context.Context, id int) *PlayerRole

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

func (*PlayerRoleClient) Hooks

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

Hooks returns the client hooks.

func (*PlayerRoleClient) Intercept

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

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

func (*PlayerRoleClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PlayerRoleClient) MapCreateBulk

func (c *PlayerRoleClient) MapCreateBulk(slice any, setFunc func(*PlayerRoleCreate, int)) *PlayerRoleCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PlayerRoleClient) Query

func (c *PlayerRoleClient) Query() *PlayerRoleQuery

Query returns a query builder for PlayerRole.

func (*PlayerRoleClient) QueryMatch

func (c *PlayerRoleClient) QueryMatch(pr *PlayerRole) *MatchQuery

QueryMatch queries the match edge of a PlayerRole.

func (*PlayerRoleClient) QueryPlayers

func (c *PlayerRoleClient) QueryPlayers(pr *PlayerRole) *PlayerQuery

QueryPlayers queries the players edge of a PlayerRole.

func (*PlayerRoleClient) Update

func (c *PlayerRoleClient) Update() *PlayerRoleUpdate

Update returns an update builder for PlayerRole.

func (*PlayerRoleClient) UpdateOne

func (c *PlayerRoleClient) UpdateOne(pr *PlayerRole) *PlayerRoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PlayerRoleClient) UpdateOneID

func (c *PlayerRoleClient) UpdateOneID(id int) *PlayerRoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PlayerRoleClient) Use

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

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

type PlayerRoleCreate

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

PlayerRoleCreate is the builder for creating a PlayerRole entity.

func (*PlayerRoleCreate) AddMatch

func (prc *PlayerRoleCreate) AddMatch(m ...*Match) *PlayerRoleCreate

AddMatch adds the "match" edges to the Match entity.

func (*PlayerRoleCreate) AddMatchIDs

func (prc *PlayerRoleCreate) AddMatchIDs(ids ...int) *PlayerRoleCreate

AddMatchIDs adds the "match" edge to the Match entity by IDs.

func (*PlayerRoleCreate) AddPlayerIDs

func (prc *PlayerRoleCreate) AddPlayerIDs(ids ...int) *PlayerRoleCreate

AddPlayerIDs adds the "players" edge to the Player entity by IDs.

func (*PlayerRoleCreate) AddPlayers

func (prc *PlayerRoleCreate) AddPlayers(p ...*Player) *PlayerRoleCreate

AddPlayers adds the "players" edges to the Player entity.

func (*PlayerRoleCreate) Exec

func (prc *PlayerRoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlayerRoleCreate) ExecX

func (prc *PlayerRoleCreate) ExecX(ctx context.Context)

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

func (*PlayerRoleCreate) Mutation

func (prc *PlayerRoleCreate) Mutation() *PlayerRoleMutation

Mutation returns the PlayerRoleMutation object of the builder.

func (*PlayerRoleCreate) Save

func (prc *PlayerRoleCreate) Save(ctx context.Context) (*PlayerRole, error)

Save creates the PlayerRole in the database.

func (*PlayerRoleCreate) SaveX

func (prc *PlayerRoleCreate) SaveX(ctx context.Context) *PlayerRole

SaveX calls Save and panics if Save returns an error.

func (*PlayerRoleCreate) SetMatchID

func (prc *PlayerRoleCreate) SetMatchID(i int) *PlayerRoleCreate

SetMatchID sets the "match_id" field.

func (*PlayerRoleCreate) SetPlayerID

func (prc *PlayerRoleCreate) SetPlayerID(i int) *PlayerRoleCreate

SetPlayerID sets the "player_id" field.

func (*PlayerRoleCreate) SetPosition

func (prc *PlayerRoleCreate) SetPosition(i int) *PlayerRoleCreate

SetPosition sets the "position" field.

func (*PlayerRoleCreate) SetTurnOrder

func (prc *PlayerRoleCreate) SetTurnOrder(i int) *PlayerRoleCreate

SetTurnOrder sets the "turn_order" field.

type PlayerRoleCreateBulk

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

PlayerRoleCreateBulk is the builder for creating many PlayerRole entities in bulk.

func (*PlayerRoleCreateBulk) Exec

func (prcb *PlayerRoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PlayerRoleCreateBulk) ExecX

func (prcb *PlayerRoleCreateBulk) ExecX(ctx context.Context)

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

func (*PlayerRoleCreateBulk) Save

func (prcb *PlayerRoleCreateBulk) Save(ctx context.Context) ([]*PlayerRole, error)

Save creates the PlayerRole entities in the database.

func (*PlayerRoleCreateBulk) SaveX

func (prcb *PlayerRoleCreateBulk) SaveX(ctx context.Context) []*PlayerRole

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

type PlayerRoleDelete

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

PlayerRoleDelete is the builder for deleting a PlayerRole entity.

func (*PlayerRoleDelete) Exec

func (prd *PlayerRoleDelete) Exec(ctx context.Context) (int, error)

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

func (*PlayerRoleDelete) ExecX

func (prd *PlayerRoleDelete) ExecX(ctx context.Context) int

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

func (*PlayerRoleDelete) Where

Where appends a list predicates to the PlayerRoleDelete builder.

type PlayerRoleDeleteOne

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

PlayerRoleDeleteOne is the builder for deleting a single PlayerRole entity.

func (*PlayerRoleDeleteOne) Exec

func (prdo *PlayerRoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PlayerRoleDeleteOne) ExecX

func (prdo *PlayerRoleDeleteOne) ExecX(ctx context.Context)

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

func (*PlayerRoleDeleteOne) Where

Where appends a list predicates to the PlayerRoleDelete builder.

type PlayerRoleEdges

type PlayerRoleEdges struct {
	// Match holds the value of the match edge.
	Match []*Match `json:"match,omitempty"`
	// Players holds the value of the players edge.
	Players []*Player `json:"players,omitempty"`
	// contains filtered or unexported fields
}

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

func (PlayerRoleEdges) MatchOrErr

func (e PlayerRoleEdges) MatchOrErr() ([]*Match, error)

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

func (PlayerRoleEdges) PlayersOrErr

func (e PlayerRoleEdges) PlayersOrErr() ([]*Player, error)

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

type PlayerRoleGroupBy

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

PlayerRoleGroupBy is the group-by builder for PlayerRole entities.

func (*PlayerRoleGroupBy) Aggregate

func (prgb *PlayerRoleGroupBy) Aggregate(fns ...AggregateFunc) *PlayerRoleGroupBy

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

func (*PlayerRoleGroupBy) Bool

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

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

func (*PlayerRoleGroupBy) BoolX

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

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

func (*PlayerRoleGroupBy) Bools

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

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

func (*PlayerRoleGroupBy) BoolsX

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

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

func (*PlayerRoleGroupBy) Float64

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

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

func (*PlayerRoleGroupBy) Float64X

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

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

func (*PlayerRoleGroupBy) Float64s

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

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

func (*PlayerRoleGroupBy) Float64sX

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

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

func (*PlayerRoleGroupBy) Int

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

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

func (*PlayerRoleGroupBy) IntX

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

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

func (*PlayerRoleGroupBy) Ints

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

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

func (*PlayerRoleGroupBy) IntsX

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

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

func (*PlayerRoleGroupBy) Scan

func (prgb *PlayerRoleGroupBy) Scan(ctx context.Context, v any) error

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

func (*PlayerRoleGroupBy) ScanX

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

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

func (*PlayerRoleGroupBy) String

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

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

func (*PlayerRoleGroupBy) StringX

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

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

func (*PlayerRoleGroupBy) Strings

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

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

func (*PlayerRoleGroupBy) StringsX

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

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

type PlayerRoleMutation

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

PlayerRoleMutation represents an operation that mutates the PlayerRole nodes in the graph.

func (*PlayerRoleMutation) AddField

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) AddMatchID

func (m *PlayerRoleMutation) AddMatchID(i int)

AddMatchID adds i to the "match_id" field.

func (*PlayerRoleMutation) AddMatchIDs

func (m *PlayerRoleMutation) AddMatchIDs(ids ...int)

AddMatchIDs adds the "match" edge to the Match entity by ids.

func (*PlayerRoleMutation) AddPlayerID

func (m *PlayerRoleMutation) AddPlayerID(i int)

AddPlayerID adds i to the "player_id" field.

func (*PlayerRoleMutation) AddPlayerIDs

func (m *PlayerRoleMutation) AddPlayerIDs(ids ...int)

AddPlayerIDs adds the "players" edge to the Player entity by ids.

func (*PlayerRoleMutation) AddPosition

func (m *PlayerRoleMutation) AddPosition(i int)

AddPosition adds i to the "position" field.

func (*PlayerRoleMutation) AddTurnOrder

func (m *PlayerRoleMutation) AddTurnOrder(i int)

AddTurnOrder adds i to the "turn_order" field.

func (*PlayerRoleMutation) AddedEdges

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

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

func (*PlayerRoleMutation) AddedField

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

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

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

func (*PlayerRoleMutation) AddedIDs

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

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

func (*PlayerRoleMutation) AddedMatchID

func (m *PlayerRoleMutation) AddedMatchID() (r int, exists bool)

AddedMatchID returns the value that was added to the "match_id" field in this mutation.

func (*PlayerRoleMutation) AddedPlayerID

func (m *PlayerRoleMutation) AddedPlayerID() (r int, exists bool)

AddedPlayerID returns the value that was added to the "player_id" field in this mutation.

func (*PlayerRoleMutation) AddedPosition

func (m *PlayerRoleMutation) AddedPosition() (r int, exists bool)

AddedPosition returns the value that was added to the "position" field in this mutation.

func (*PlayerRoleMutation) AddedTurnOrder

func (m *PlayerRoleMutation) AddedTurnOrder() (r int, exists bool)

AddedTurnOrder returns the value that was added to the "turn_order" field in this mutation.

func (*PlayerRoleMutation) ClearEdge

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

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) ClearMatch

func (m *PlayerRoleMutation) ClearMatch()

ClearMatch clears the "match" edge to the Match entity.

func (*PlayerRoleMutation) ClearPlayers

func (m *PlayerRoleMutation) ClearPlayers()

ClearPlayers clears the "players" edge to the Player entity.

func (*PlayerRoleMutation) ClearedEdges

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

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

func (*PlayerRoleMutation) ClearedFields

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

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

func (PlayerRoleMutation) Client

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

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

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

func (*PlayerRoleMutation) Field

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

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

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

func (*PlayerRoleMutation) Fields

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

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

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) MatchCleared

func (m *PlayerRoleMutation) MatchCleared() bool

MatchCleared reports if the "match" edge to the Match entity was cleared.

func (*PlayerRoleMutation) MatchID

func (m *PlayerRoleMutation) MatchID() (r int, exists bool)

MatchID returns the value of the "match_id" field in the mutation.

func (*PlayerRoleMutation) MatchIDs

func (m *PlayerRoleMutation) MatchIDs() (ids []int)

MatchIDs returns the "match" edge IDs in the mutation.

func (*PlayerRoleMutation) OldField

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) OldMatchID

func (m *PlayerRoleMutation) OldMatchID(ctx context.Context) (v int, err error)

OldMatchID returns the old "match_id" field's value of the PlayerRole entity. If the PlayerRole 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 (*PlayerRoleMutation) OldPlayerID

func (m *PlayerRoleMutation) OldPlayerID(ctx context.Context) (v int, err error)

OldPlayerID returns the old "player_id" field's value of the PlayerRole entity. If the PlayerRole 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 (*PlayerRoleMutation) OldPosition

func (m *PlayerRoleMutation) OldPosition(ctx context.Context) (v int, err error)

OldPosition returns the old "position" field's value of the PlayerRole entity. If the PlayerRole 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 (*PlayerRoleMutation) OldTurnOrder

func (m *PlayerRoleMutation) OldTurnOrder(ctx context.Context) (v int, err error)

OldTurnOrder returns the old "turn_order" field's value of the PlayerRole entity. If the PlayerRole 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 (*PlayerRoleMutation) Op

func (m *PlayerRoleMutation) Op() Op

Op returns the operation name.

func (*PlayerRoleMutation) PlayerID

func (m *PlayerRoleMutation) PlayerID() (r int, exists bool)

PlayerID returns the value of the "player_id" field in the mutation.

func (*PlayerRoleMutation) PlayersCleared

func (m *PlayerRoleMutation) PlayersCleared() bool

PlayersCleared reports if the "players" edge to the Player entity was cleared.

func (*PlayerRoleMutation) PlayersIDs

func (m *PlayerRoleMutation) PlayersIDs() (ids []int)

PlayersIDs returns the "players" edge IDs in the mutation.

func (*PlayerRoleMutation) Position

func (m *PlayerRoleMutation) Position() (r int, exists bool)

Position returns the value of the "position" field in the mutation.

func (*PlayerRoleMutation) RemoveMatchIDs

func (m *PlayerRoleMutation) RemoveMatchIDs(ids ...int)

RemoveMatchIDs removes the "match" edge to the Match entity by IDs.

func (*PlayerRoleMutation) RemovePlayerIDs

func (m *PlayerRoleMutation) RemovePlayerIDs(ids ...int)

RemovePlayerIDs removes the "players" edge to the Player entity by IDs.

func (*PlayerRoleMutation) RemovedEdges

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

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

func (*PlayerRoleMutation) RemovedIDs

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) RemovedMatchIDs

func (m *PlayerRoleMutation) RemovedMatchIDs() (ids []int)

RemovedMatch returns the removed IDs of the "match" edge to the Match entity.

func (*PlayerRoleMutation) RemovedPlayersIDs

func (m *PlayerRoleMutation) RemovedPlayersIDs() (ids []int)

RemovedPlayers returns the removed IDs of the "players" edge to the Player entity.

func (*PlayerRoleMutation) ResetEdge

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

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) ResetMatch

func (m *PlayerRoleMutation) ResetMatch()

ResetMatch resets all changes to the "match" edge.

func (*PlayerRoleMutation) ResetMatchID

func (m *PlayerRoleMutation) ResetMatchID()

ResetMatchID resets all changes to the "match_id" field.

func (*PlayerRoleMutation) ResetPlayerID

func (m *PlayerRoleMutation) ResetPlayerID()

ResetPlayerID resets all changes to the "player_id" field.

func (*PlayerRoleMutation) ResetPlayers

func (m *PlayerRoleMutation) ResetPlayers()

ResetPlayers resets all changes to the "players" edge.

func (*PlayerRoleMutation) ResetPosition

func (m *PlayerRoleMutation) ResetPosition()

ResetPosition resets all changes to the "position" field.

func (*PlayerRoleMutation) ResetTurnOrder

func (m *PlayerRoleMutation) ResetTurnOrder()

ResetTurnOrder resets all changes to the "turn_order" field.

func (*PlayerRoleMutation) SetField

func (m *PlayerRoleMutation) 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 (*PlayerRoleMutation) SetMatchID

func (m *PlayerRoleMutation) SetMatchID(i int)

SetMatchID sets the "match_id" field.

func (*PlayerRoleMutation) SetOp

func (m *PlayerRoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PlayerRoleMutation) SetPlayerID

func (m *PlayerRoleMutation) SetPlayerID(i int)

SetPlayerID sets the "player_id" field.

func (*PlayerRoleMutation) SetPosition

func (m *PlayerRoleMutation) SetPosition(i int)

SetPosition sets the "position" field.

func (*PlayerRoleMutation) SetTurnOrder

func (m *PlayerRoleMutation) SetTurnOrder(i int)

SetTurnOrder sets the "turn_order" field.

func (*PlayerRoleMutation) TurnOrder

func (m *PlayerRoleMutation) TurnOrder() (r int, exists bool)

TurnOrder returns the value of the "turn_order" field in the mutation.

func (PlayerRoleMutation) Tx

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

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

func (*PlayerRoleMutation) Type

func (m *PlayerRoleMutation) Type() string

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

func (*PlayerRoleMutation) Where

func (m *PlayerRoleMutation) Where(ps ...predicate.PlayerRole)

Where appends a list predicates to the PlayerRoleMutation builder.

func (*PlayerRoleMutation) WhereP

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

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

type PlayerRoleQuery

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

PlayerRoleQuery is the builder for querying PlayerRole entities.

func (*PlayerRoleQuery) Aggregate

func (prq *PlayerRoleQuery) Aggregate(fns ...AggregateFunc) *PlayerRoleSelect

Aggregate returns a PlayerRoleSelect configured with the given aggregations.

func (*PlayerRoleQuery) All

func (prq *PlayerRoleQuery) All(ctx context.Context) ([]*PlayerRole, error)

All executes the query and returns a list of PlayerRoles.

func (*PlayerRoleQuery) AllX

func (prq *PlayerRoleQuery) AllX(ctx context.Context) []*PlayerRole

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

func (*PlayerRoleQuery) Clone

func (prq *PlayerRoleQuery) Clone() *PlayerRoleQuery

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

func (*PlayerRoleQuery) Count

func (prq *PlayerRoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PlayerRoleQuery) CountX

func (prq *PlayerRoleQuery) CountX(ctx context.Context) int

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

func (*PlayerRoleQuery) Exist

func (prq *PlayerRoleQuery) Exist(ctx context.Context) (bool, error)

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

func (*PlayerRoleQuery) ExistX

func (prq *PlayerRoleQuery) ExistX(ctx context.Context) bool

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

func (*PlayerRoleQuery) First

func (prq *PlayerRoleQuery) First(ctx context.Context) (*PlayerRole, error)

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

func (*PlayerRoleQuery) FirstID

func (prq *PlayerRoleQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PlayerRoleQuery) FirstIDX

func (prq *PlayerRoleQuery) FirstIDX(ctx context.Context) int

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

func (*PlayerRoleQuery) FirstX

func (prq *PlayerRoleQuery) FirstX(ctx context.Context) *PlayerRole

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

func (*PlayerRoleQuery) GroupBy

func (prq *PlayerRoleQuery) GroupBy(field string, fields ...string) *PlayerRoleGroupBy

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 {
	MatchID int `json:"match_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.PlayerRole.Query().
	GroupBy(playerrole.FieldMatchID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PlayerRoleQuery) IDs

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

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

func (*PlayerRoleQuery) IDsX

func (prq *PlayerRoleQuery) IDsX(ctx context.Context) []int

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

func (*PlayerRoleQuery) Limit

func (prq *PlayerRoleQuery) Limit(limit int) *PlayerRoleQuery

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

func (*PlayerRoleQuery) Offset

func (prq *PlayerRoleQuery) Offset(offset int) *PlayerRoleQuery

Offset to start from.

func (*PlayerRoleQuery) Only

func (prq *PlayerRoleQuery) Only(ctx context.Context) (*PlayerRole, error)

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

func (*PlayerRoleQuery) OnlyID

func (prq *PlayerRoleQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PlayerRoleQuery) OnlyIDX

func (prq *PlayerRoleQuery) OnlyIDX(ctx context.Context) int

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

func (*PlayerRoleQuery) OnlyX

func (prq *PlayerRoleQuery) OnlyX(ctx context.Context) *PlayerRole

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

func (*PlayerRoleQuery) Order

Order specifies how the records should be ordered.

func (*PlayerRoleQuery) QueryMatch

func (prq *PlayerRoleQuery) QueryMatch() *MatchQuery

QueryMatch chains the current query on the "match" edge.

func (*PlayerRoleQuery) QueryPlayers

func (prq *PlayerRoleQuery) QueryPlayers() *PlayerQuery

QueryPlayers chains the current query on the "players" edge.

func (*PlayerRoleQuery) Select

func (prq *PlayerRoleQuery) Select(fields ...string) *PlayerRoleSelect

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 {
	MatchID int `json:"match_id,omitempty"`
}

client.PlayerRole.Query().
	Select(playerrole.FieldMatchID).
	Scan(ctx, &v)

func (*PlayerRoleQuery) Unique

func (prq *PlayerRoleQuery) Unique(unique bool) *PlayerRoleQuery

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

Where adds a new predicate for the PlayerRoleQuery builder.

func (*PlayerRoleQuery) WithMatch

func (prq *PlayerRoleQuery) WithMatch(opts ...func(*MatchQuery)) *PlayerRoleQuery

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

func (*PlayerRoleQuery) WithPlayers

func (prq *PlayerRoleQuery) WithPlayers(opts ...func(*PlayerQuery)) *PlayerRoleQuery

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

type PlayerRoleSelect

type PlayerRoleSelect struct {
	*PlayerRoleQuery
	// contains filtered or unexported fields
}

PlayerRoleSelect is the builder for selecting fields of PlayerRole entities.

func (*PlayerRoleSelect) Aggregate

func (prs *PlayerRoleSelect) Aggregate(fns ...AggregateFunc) *PlayerRoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PlayerRoleSelect) Bool

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

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

func (*PlayerRoleSelect) BoolX

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

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

func (*PlayerRoleSelect) Bools

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

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

func (*PlayerRoleSelect) BoolsX

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

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

func (*PlayerRoleSelect) Float64

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

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

func (*PlayerRoleSelect) Float64X

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

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

func (*PlayerRoleSelect) Float64s

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

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

func (*PlayerRoleSelect) Float64sX

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

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

func (*PlayerRoleSelect) Int

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

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

func (*PlayerRoleSelect) IntX

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

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

func (*PlayerRoleSelect) Ints

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

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

func (*PlayerRoleSelect) IntsX

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

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

func (*PlayerRoleSelect) Scan

func (prs *PlayerRoleSelect) Scan(ctx context.Context, v any) error

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

func (*PlayerRoleSelect) ScanX

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

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

func (*PlayerRoleSelect) String

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

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

func (*PlayerRoleSelect) StringX

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

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

func (*PlayerRoleSelect) Strings

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

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

func (*PlayerRoleSelect) StringsX

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

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

type PlayerRoleUpdate

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

PlayerRoleUpdate is the builder for updating PlayerRole entities.

func (*PlayerRoleUpdate) AddMatch

func (pru *PlayerRoleUpdate) AddMatch(m ...*Match) *PlayerRoleUpdate

AddMatch adds the "match" edges to the Match entity.

func (*PlayerRoleUpdate) AddMatchID

func (pru *PlayerRoleUpdate) AddMatchID(i int) *PlayerRoleUpdate

AddMatchID adds i to the "match_id" field.

func (*PlayerRoleUpdate) AddMatchIDs

func (pru *PlayerRoleUpdate) AddMatchIDs(ids ...int) *PlayerRoleUpdate

AddMatchIDs adds the "match" edge to the Match entity by IDs.

func (*PlayerRoleUpdate) AddPlayerID

func (pru *PlayerRoleUpdate) AddPlayerID(i int) *PlayerRoleUpdate

AddPlayerID adds i to the "player_id" field.

func (*PlayerRoleUpdate) AddPlayerIDs

func (pru *PlayerRoleUpdate) AddPlayerIDs(ids ...int) *PlayerRoleUpdate

AddPlayerIDs adds the "players" edge to the Player entity by IDs.

func (*PlayerRoleUpdate) AddPlayers

func (pru *PlayerRoleUpdate) AddPlayers(p ...*Player) *PlayerRoleUpdate

AddPlayers adds the "players" edges to the Player entity.

func (*PlayerRoleUpdate) AddPosition

func (pru *PlayerRoleUpdate) AddPosition(i int) *PlayerRoleUpdate

AddPosition adds i to the "position" field.

func (*PlayerRoleUpdate) AddTurnOrder

func (pru *PlayerRoleUpdate) AddTurnOrder(i int) *PlayerRoleUpdate

AddTurnOrder adds i to the "turn_order" field.

func (*PlayerRoleUpdate) ClearMatch

func (pru *PlayerRoleUpdate) ClearMatch() *PlayerRoleUpdate

ClearMatch clears all "match" edges to the Match entity.

func (*PlayerRoleUpdate) ClearPlayers

func (pru *PlayerRoleUpdate) ClearPlayers() *PlayerRoleUpdate

ClearPlayers clears all "players" edges to the Player entity.

func (*PlayerRoleUpdate) Exec

func (pru *PlayerRoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlayerRoleUpdate) ExecX

func (pru *PlayerRoleUpdate) ExecX(ctx context.Context)

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

func (*PlayerRoleUpdate) Mutation

func (pru *PlayerRoleUpdate) Mutation() *PlayerRoleMutation

Mutation returns the PlayerRoleMutation object of the builder.

func (*PlayerRoleUpdate) RemoveMatch

func (pru *PlayerRoleUpdate) RemoveMatch(m ...*Match) *PlayerRoleUpdate

RemoveMatch removes "match" edges to Match entities.

func (*PlayerRoleUpdate) RemoveMatchIDs

func (pru *PlayerRoleUpdate) RemoveMatchIDs(ids ...int) *PlayerRoleUpdate

RemoveMatchIDs removes the "match" edge to Match entities by IDs.

func (*PlayerRoleUpdate) RemovePlayerIDs

func (pru *PlayerRoleUpdate) RemovePlayerIDs(ids ...int) *PlayerRoleUpdate

RemovePlayerIDs removes the "players" edge to Player entities by IDs.

func (*PlayerRoleUpdate) RemovePlayers

func (pru *PlayerRoleUpdate) RemovePlayers(p ...*Player) *PlayerRoleUpdate

RemovePlayers removes "players" edges to Player entities.

func (*PlayerRoleUpdate) Save

func (pru *PlayerRoleUpdate) Save(ctx context.Context) (int, error)

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

func (*PlayerRoleUpdate) SaveX

func (pru *PlayerRoleUpdate) SaveX(ctx context.Context) int

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

func (*PlayerRoleUpdate) SetMatchID

func (pru *PlayerRoleUpdate) SetMatchID(i int) *PlayerRoleUpdate

SetMatchID sets the "match_id" field.

func (*PlayerRoleUpdate) SetNillableMatchID

func (pru *PlayerRoleUpdate) SetNillableMatchID(i *int) *PlayerRoleUpdate

SetNillableMatchID sets the "match_id" field if the given value is not nil.

func (*PlayerRoleUpdate) SetNillablePlayerID

func (pru *PlayerRoleUpdate) SetNillablePlayerID(i *int) *PlayerRoleUpdate

SetNillablePlayerID sets the "player_id" field if the given value is not nil.

func (*PlayerRoleUpdate) SetNillablePosition

func (pru *PlayerRoleUpdate) SetNillablePosition(i *int) *PlayerRoleUpdate

SetNillablePosition sets the "position" field if the given value is not nil.

func (*PlayerRoleUpdate) SetNillableTurnOrder

func (pru *PlayerRoleUpdate) SetNillableTurnOrder(i *int) *PlayerRoleUpdate

SetNillableTurnOrder sets the "turn_order" field if the given value is not nil.

func (*PlayerRoleUpdate) SetPlayerID

func (pru *PlayerRoleUpdate) SetPlayerID(i int) *PlayerRoleUpdate

SetPlayerID sets the "player_id" field.

func (*PlayerRoleUpdate) SetPosition

func (pru *PlayerRoleUpdate) SetPosition(i int) *PlayerRoleUpdate

SetPosition sets the "position" field.

func (*PlayerRoleUpdate) SetTurnOrder

func (pru *PlayerRoleUpdate) SetTurnOrder(i int) *PlayerRoleUpdate

SetTurnOrder sets the "turn_order" field.

func (*PlayerRoleUpdate) Where

Where appends a list predicates to the PlayerRoleUpdate builder.

type PlayerRoleUpdateOne

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

PlayerRoleUpdateOne is the builder for updating a single PlayerRole entity.

func (*PlayerRoleUpdateOne) AddMatch

func (pruo *PlayerRoleUpdateOne) AddMatch(m ...*Match) *PlayerRoleUpdateOne

AddMatch adds the "match" edges to the Match entity.

func (*PlayerRoleUpdateOne) AddMatchID

func (pruo *PlayerRoleUpdateOne) AddMatchID(i int) *PlayerRoleUpdateOne

AddMatchID adds i to the "match_id" field.

func (*PlayerRoleUpdateOne) AddMatchIDs

func (pruo *PlayerRoleUpdateOne) AddMatchIDs(ids ...int) *PlayerRoleUpdateOne

AddMatchIDs adds the "match" edge to the Match entity by IDs.

func (*PlayerRoleUpdateOne) AddPlayerID

func (pruo *PlayerRoleUpdateOne) AddPlayerID(i int) *PlayerRoleUpdateOne

AddPlayerID adds i to the "player_id" field.

func (*PlayerRoleUpdateOne) AddPlayerIDs

func (pruo *PlayerRoleUpdateOne) AddPlayerIDs(ids ...int) *PlayerRoleUpdateOne

AddPlayerIDs adds the "players" edge to the Player entity by IDs.

func (*PlayerRoleUpdateOne) AddPlayers

func (pruo *PlayerRoleUpdateOne) AddPlayers(p ...*Player) *PlayerRoleUpdateOne

AddPlayers adds the "players" edges to the Player entity.

func (*PlayerRoleUpdateOne) AddPosition

func (pruo *PlayerRoleUpdateOne) AddPosition(i int) *PlayerRoleUpdateOne

AddPosition adds i to the "position" field.

func (*PlayerRoleUpdateOne) AddTurnOrder

func (pruo *PlayerRoleUpdateOne) AddTurnOrder(i int) *PlayerRoleUpdateOne

AddTurnOrder adds i to the "turn_order" field.

func (*PlayerRoleUpdateOne) ClearMatch

func (pruo *PlayerRoleUpdateOne) ClearMatch() *PlayerRoleUpdateOne

ClearMatch clears all "match" edges to the Match entity.

func (*PlayerRoleUpdateOne) ClearPlayers

func (pruo *PlayerRoleUpdateOne) ClearPlayers() *PlayerRoleUpdateOne

ClearPlayers clears all "players" edges to the Player entity.

func (*PlayerRoleUpdateOne) Exec

func (pruo *PlayerRoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PlayerRoleUpdateOne) ExecX

func (pruo *PlayerRoleUpdateOne) ExecX(ctx context.Context)

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

func (*PlayerRoleUpdateOne) Mutation

func (pruo *PlayerRoleUpdateOne) Mutation() *PlayerRoleMutation

Mutation returns the PlayerRoleMutation object of the builder.

func (*PlayerRoleUpdateOne) RemoveMatch

func (pruo *PlayerRoleUpdateOne) RemoveMatch(m ...*Match) *PlayerRoleUpdateOne

RemoveMatch removes "match" edges to Match entities.

func (*PlayerRoleUpdateOne) RemoveMatchIDs

func (pruo *PlayerRoleUpdateOne) RemoveMatchIDs(ids ...int) *PlayerRoleUpdateOne

RemoveMatchIDs removes the "match" edge to Match entities by IDs.

func (*PlayerRoleUpdateOne) RemovePlayerIDs

func (pruo *PlayerRoleUpdateOne) RemovePlayerIDs(ids ...int) *PlayerRoleUpdateOne

RemovePlayerIDs removes the "players" edge to Player entities by IDs.

func (*PlayerRoleUpdateOne) RemovePlayers

func (pruo *PlayerRoleUpdateOne) RemovePlayers(p ...*Player) *PlayerRoleUpdateOne

RemovePlayers removes "players" edges to Player entities.

func (*PlayerRoleUpdateOne) Save

func (pruo *PlayerRoleUpdateOne) Save(ctx context.Context) (*PlayerRole, error)

Save executes the query and returns the updated PlayerRole entity.

func (*PlayerRoleUpdateOne) SaveX

func (pruo *PlayerRoleUpdateOne) SaveX(ctx context.Context) *PlayerRole

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

func (*PlayerRoleUpdateOne) Select

func (pruo *PlayerRoleUpdateOne) Select(field string, fields ...string) *PlayerRoleUpdateOne

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

func (*PlayerRoleUpdateOne) SetMatchID

func (pruo *PlayerRoleUpdateOne) SetMatchID(i int) *PlayerRoleUpdateOne

SetMatchID sets the "match_id" field.

func (*PlayerRoleUpdateOne) SetNillableMatchID

func (pruo *PlayerRoleUpdateOne) SetNillableMatchID(i *int) *PlayerRoleUpdateOne

SetNillableMatchID sets the "match_id" field if the given value is not nil.

func (*PlayerRoleUpdateOne) SetNillablePlayerID

func (pruo *PlayerRoleUpdateOne) SetNillablePlayerID(i *int) *PlayerRoleUpdateOne

SetNillablePlayerID sets the "player_id" field if the given value is not nil.

func (*PlayerRoleUpdateOne) SetNillablePosition

func (pruo *PlayerRoleUpdateOne) SetNillablePosition(i *int) *PlayerRoleUpdateOne

SetNillablePosition sets the "position" field if the given value is not nil.

func (*PlayerRoleUpdateOne) SetNillableTurnOrder

func (pruo *PlayerRoleUpdateOne) SetNillableTurnOrder(i *int) *PlayerRoleUpdateOne

SetNillableTurnOrder sets the "turn_order" field if the given value is not nil.

func (*PlayerRoleUpdateOne) SetPlayerID

func (pruo *PlayerRoleUpdateOne) SetPlayerID(i int) *PlayerRoleUpdateOne

SetPlayerID sets the "player_id" field.

func (*PlayerRoleUpdateOne) SetPosition

func (pruo *PlayerRoleUpdateOne) SetPosition(i int) *PlayerRoleUpdateOne

SetPosition sets the "position" field.

func (*PlayerRoleUpdateOne) SetTurnOrder

func (pruo *PlayerRoleUpdateOne) SetTurnOrder(i int) *PlayerRoleUpdateOne

SetTurnOrder sets the "turn_order" field.

func (*PlayerRoleUpdateOne) Where

Where appends a list predicates to the PlayerRoleUpdate builder.

type PlayerRoles

type PlayerRoles []*PlayerRole

PlayerRoles is a parsable slice of PlayerRole.

type PlayerSelect

type PlayerSelect struct {
	*PlayerQuery
	// contains filtered or unexported fields
}

PlayerSelect is the builder for selecting fields of Player entities.

func (*PlayerSelect) Aggregate

func (ps *PlayerSelect) Aggregate(fns ...AggregateFunc) *PlayerSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PlayerSelect) Bool

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

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

func (*PlayerSelect) BoolX

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

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

func (*PlayerSelect) Bools

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

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

func (*PlayerSelect) BoolsX

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

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

func (*PlayerSelect) Float64

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

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

func (*PlayerSelect) Float64X

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

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

func (*PlayerSelect) Float64s

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

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

func (*PlayerSelect) Float64sX

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

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

func (*PlayerSelect) Int

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

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

func (*PlayerSelect) IntX

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

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

func (*PlayerSelect) Ints

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

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

func (*PlayerSelect) IntsX

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

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

func (*PlayerSelect) Scan

func (ps *PlayerSelect) Scan(ctx context.Context, v any) error

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

func (*PlayerSelect) ScanX

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

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

func (*PlayerSelect) String

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

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

func (*PlayerSelect) StringX

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

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

func (*PlayerSelect) Strings

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

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

func (*PlayerSelect) StringsX

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

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

type PlayerUpdate

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

PlayerUpdate is the builder for updating Player entities.

func (*PlayerUpdate) AddRoleIDs

func (pu *PlayerUpdate) AddRoleIDs(ids ...int) *PlayerUpdate

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

func (*PlayerUpdate) AddRoles

func (pu *PlayerUpdate) AddRoles(p ...*PlayerRole) *PlayerUpdate

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

func (*PlayerUpdate) ClearRoles

func (pu *PlayerUpdate) ClearRoles() *PlayerUpdate

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

func (*PlayerUpdate) Exec

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

Exec executes the query.

func (*PlayerUpdate) ExecX

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

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

func (*PlayerUpdate) Mutation

func (pu *PlayerUpdate) Mutation() *PlayerMutation

Mutation returns the PlayerMutation object of the builder.

func (*PlayerUpdate) RemoveRoleIDs

func (pu *PlayerUpdate) RemoveRoleIDs(ids ...int) *PlayerUpdate

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

func (*PlayerUpdate) RemoveRoles

func (pu *PlayerUpdate) RemoveRoles(p ...*PlayerRole) *PlayerUpdate

RemoveRoles removes "roles" edges to PlayerRole entities.

func (*PlayerUpdate) Save

func (pu *PlayerUpdate) Save(ctx context.Context) (int, error)

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

func (*PlayerUpdate) SaveX

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

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

func (*PlayerUpdate) SetGcid

func (pu *PlayerUpdate) SetGcid(s string) *PlayerUpdate

SetGcid sets the "gcid" field.

func (*PlayerUpdate) SetName

func (pu *PlayerUpdate) SetName(s string) *PlayerUpdate

SetName sets the "name" field.

func (*PlayerUpdate) SetNillableGcid

func (pu *PlayerUpdate) SetNillableGcid(s *string) *PlayerUpdate

SetNillableGcid sets the "gcid" field if the given value is not nil.

func (*PlayerUpdate) SetNillableName

func (pu *PlayerUpdate) SetNillableName(s *string) *PlayerUpdate

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

func (*PlayerUpdate) Where

func (pu *PlayerUpdate) Where(ps ...predicate.Player) *PlayerUpdate

Where appends a list predicates to the PlayerUpdate builder.

type PlayerUpdateOne

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

PlayerUpdateOne is the builder for updating a single Player entity.

func (*PlayerUpdateOne) AddRoleIDs

func (puo *PlayerUpdateOne) AddRoleIDs(ids ...int) *PlayerUpdateOne

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

func (*PlayerUpdateOne) AddRoles

func (puo *PlayerUpdateOne) AddRoles(p ...*PlayerRole) *PlayerUpdateOne

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

func (*PlayerUpdateOne) ClearRoles

func (puo *PlayerUpdateOne) ClearRoles() *PlayerUpdateOne

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

func (*PlayerUpdateOne) Exec

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

Exec executes the query on the entity.

func (*PlayerUpdateOne) ExecX

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

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

func (*PlayerUpdateOne) Mutation

func (puo *PlayerUpdateOne) Mutation() *PlayerMutation

Mutation returns the PlayerMutation object of the builder.

func (*PlayerUpdateOne) RemoveRoleIDs

func (puo *PlayerUpdateOne) RemoveRoleIDs(ids ...int) *PlayerUpdateOne

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

func (*PlayerUpdateOne) RemoveRoles

func (puo *PlayerUpdateOne) RemoveRoles(p ...*PlayerRole) *PlayerUpdateOne

RemoveRoles removes "roles" edges to PlayerRole entities.

func (*PlayerUpdateOne) Save

func (puo *PlayerUpdateOne) Save(ctx context.Context) (*Player, error)

Save executes the query and returns the updated Player entity.

func (*PlayerUpdateOne) SaveX

func (puo *PlayerUpdateOne) SaveX(ctx context.Context) *Player

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

func (*PlayerUpdateOne) Select

func (puo *PlayerUpdateOne) Select(field string, fields ...string) *PlayerUpdateOne

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

func (*PlayerUpdateOne) SetGcid

func (puo *PlayerUpdateOne) SetGcid(s string) *PlayerUpdateOne

SetGcid sets the "gcid" field.

func (*PlayerUpdateOne) SetName

func (puo *PlayerUpdateOne) SetName(s string) *PlayerUpdateOne

SetName sets the "name" field.

func (*PlayerUpdateOne) SetNillableGcid

func (puo *PlayerUpdateOne) SetNillableGcid(s *string) *PlayerUpdateOne

SetNillableGcid sets the "gcid" field if the given value is not nil.

func (*PlayerUpdateOne) SetNillableName

func (puo *PlayerUpdateOne) SetNillableName(s *string) *PlayerUpdateOne

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

func (*PlayerUpdateOne) Where

func (puo *PlayerUpdateOne) Where(ps ...predicate.Player) *PlayerUpdateOne

Where appends a list predicates to the PlayerUpdate builder.

type Players

type Players []*Player

Players is a parsable slice of Player.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Match is the client for interacting with the Match builders.
	Match *MatchClient
	// OsnMap is the client for interacting with the OsnMap builders.
	OsnMap *OsnMapClient
	// Player is the client for interacting with the Player builders.
	Player *PlayerClient
	// PlayerRole is the client for interacting with the PlayerRole builders.
	PlayerRole *PlayerRoleClient
	// 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 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