ent

package
v0.0.0-...-905e761 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeGuild          = "Guild"
	TypeGuildRole      = "GuildRole"
	TypeUser           = "User"
	TypeUserMembership = "UserMembership"
	TypeYouTubeTalent  = "YouTubeTalent"
)

Variables

This section is empty.

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
	// Guild is the client for interacting with the Guild builders.
	Guild *GuildClient
	// GuildRole is the client for interacting with the GuildRole builders.
	GuildRole *GuildRoleClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserMembership is the client for interacting with the UserMembership builders.
	UserMembership *UserMembershipClient
	// YouTubeTalent is the client for interacting with the YouTubeTalent builders.
	YouTubeTalent *YouTubeTalentClient
	// 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().
	Guild.
	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 Guild

type Guild struct {

	// ID of the ent.
	// Discord guild ID
	ID uint64 `json:"id,omitempty"`
	// Discord guild name
	Name string `json:"name,omitempty"`
	// Discord guild icon hash
	IconHash string `json:"icon_hash,omitempty"`
	// Audit log channel ID
	AuditChannel uint64 `json:"audit_channel,omitempty"`
	// IETF BCP 47 language tag
	Language guild.Language `json:"language,omitempty"`
	// Discord snowflakes of users and groups that can modify server settings. The first snowflake is always the server owner.
	AdminSnowflakes []uint64 `json:"admin_snowflakes,omitempty"`
	// Discord snowflakes of users and groups that can read server settings
	ModeratorSnowflakes []uint64 `json:"moderator_snowflakes,omitempty"`
	// Settings holds the value of the "settings" field.
	Settings *schema.GuildSettings `json:"settings,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GuildQuery when eager-loading is set.
	Edges GuildEdges `json:"edges"`
	// contains filtered or unexported fields
}

Guild is the model entity for the Guild schema.

func (*Guild) QueryAdmins

func (gu *Guild) QueryAdmins() *UserQuery

QueryAdmins queries the "admins" edge of the Guild entity.

func (*Guild) QueryMembers

func (gu *Guild) QueryMembers() *UserQuery

QueryMembers queries the "members" edge of the Guild entity.

func (*Guild) QueryRoles

func (gu *Guild) QueryRoles() *GuildRoleQuery

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

func (*Guild) QueryYoutubeTalents

func (gu *Guild) QueryYoutubeTalents() *YouTubeTalentQuery

QueryYoutubeTalents queries the "youtube_talents" edge of the Guild entity.

func (*Guild) String

func (gu *Guild) String() string

String implements the fmt.Stringer.

func (*Guild) Unwrap

func (gu *Guild) Unwrap() *Guild

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

func (gu *Guild) Update() *GuildUpdateOne

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

func (*Guild) Value

func (gu *Guild) Value(name string) (ent.Value, error)

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

type GuildClient

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

GuildClient is a client for the Guild schema.

func NewGuildClient

func NewGuildClient(c config) *GuildClient

NewGuildClient returns a client for the Guild from the given config.

func (*GuildClient) Create

func (c *GuildClient) Create() *GuildCreate

Create returns a builder for creating a Guild entity.

func (*GuildClient) CreateBulk

func (c *GuildClient) CreateBulk(builders ...*GuildCreate) *GuildCreateBulk

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

func (*GuildClient) Delete

func (c *GuildClient) Delete() *GuildDelete

Delete returns a delete builder for Guild.

func (*GuildClient) DeleteOne

func (c *GuildClient) DeleteOne(gu *Guild) *GuildDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GuildClient) DeleteOneID

func (c *GuildClient) DeleteOneID(id uint64) *GuildDeleteOne

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

func (*GuildClient) Get

func (c *GuildClient) Get(ctx context.Context, id uint64) (*Guild, error)

Get returns a Guild entity by its id.

func (*GuildClient) GetX

func (c *GuildClient) GetX(ctx context.Context, id uint64) *Guild

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

func (*GuildClient) Hooks

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

Hooks returns the client hooks.

func (*GuildClient) Intercept

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

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

func (*GuildClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GuildClient) Query

func (c *GuildClient) Query() *GuildQuery

Query returns a query builder for Guild.

func (*GuildClient) QueryAdmins

func (c *GuildClient) QueryAdmins(gu *Guild) *UserQuery

QueryAdmins queries the admins edge of a Guild.

func (*GuildClient) QueryMembers

func (c *GuildClient) QueryMembers(gu *Guild) *UserQuery

QueryMembers queries the members edge of a Guild.

func (*GuildClient) QueryRoles

func (c *GuildClient) QueryRoles(gu *Guild) *GuildRoleQuery

QueryRoles queries the roles edge of a Guild.

func (*GuildClient) QueryYoutubeTalents

func (c *GuildClient) QueryYoutubeTalents(gu *Guild) *YouTubeTalentQuery

QueryYoutubeTalents queries the youtube_talents edge of a Guild.

func (*GuildClient) Update

func (c *GuildClient) Update() *GuildUpdate

Update returns an update builder for Guild.

func (*GuildClient) UpdateOne

func (c *GuildClient) UpdateOne(gu *Guild) *GuildUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GuildClient) UpdateOneID

func (c *GuildClient) UpdateOneID(id uint64) *GuildUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GuildClient) Use

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

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

type GuildCreate

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

GuildCreate is the builder for creating a Guild entity.

func (*GuildCreate) AddAdminIDs

func (gc *GuildCreate) AddAdminIDs(ids ...uint64) *GuildCreate

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*GuildCreate) AddAdmins

func (gc *GuildCreate) AddAdmins(u ...*User) *GuildCreate

AddAdmins adds the "admins" edges to the User entity.

func (*GuildCreate) AddMemberIDs

func (gc *GuildCreate) AddMemberIDs(ids ...uint64) *GuildCreate

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*GuildCreate) AddMembers

func (gc *GuildCreate) AddMembers(u ...*User) *GuildCreate

AddMembers adds the "members" edges to the User entity.

func (*GuildCreate) AddRoleIDs

func (gc *GuildCreate) AddRoleIDs(ids ...uint64) *GuildCreate

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

func (*GuildCreate) AddRoles

func (gc *GuildCreate) AddRoles(g ...*GuildRole) *GuildCreate

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

func (*GuildCreate) AddYoutubeTalentIDs

func (gc *GuildCreate) AddYoutubeTalentIDs(ids ...string) *GuildCreate

AddYoutubeTalentIDs adds the "youtube_talents" edge to the YouTubeTalent entity by IDs.

func (*GuildCreate) AddYoutubeTalents

func (gc *GuildCreate) AddYoutubeTalents(y ...*YouTubeTalent) *GuildCreate

AddYoutubeTalents adds the "youtube_talents" edges to the YouTubeTalent entity.

func (*GuildCreate) Exec

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

Exec executes the query.

func (*GuildCreate) ExecX

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

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

func (*GuildCreate) Mutation

func (gc *GuildCreate) Mutation() *GuildMutation

Mutation returns the GuildMutation object of the builder.

func (*GuildCreate) OnConflict

func (gc *GuildCreate) OnConflict(opts ...sql.ConflictOption) *GuildUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Guild.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GuildUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GuildCreate) OnConflictColumns

func (gc *GuildCreate) OnConflictColumns(columns ...string) *GuildUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Guild.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GuildCreate) Save

func (gc *GuildCreate) Save(ctx context.Context) (*Guild, error)

Save creates the Guild in the database.

func (*GuildCreate) SaveX

func (gc *GuildCreate) SaveX(ctx context.Context) *Guild

SaveX calls Save and panics if Save returns an error.

func (*GuildCreate) SetAdminSnowflakes

func (gc *GuildCreate) SetAdminSnowflakes(u []uint64) *GuildCreate

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildCreate) SetAuditChannel

func (gc *GuildCreate) SetAuditChannel(u uint64) *GuildCreate

SetAuditChannel sets the "audit_channel" field.

func (*GuildCreate) SetID

func (gc *GuildCreate) SetID(u uint64) *GuildCreate

SetID sets the "id" field.

func (*GuildCreate) SetIconHash

func (gc *GuildCreate) SetIconHash(s string) *GuildCreate

SetIconHash sets the "icon_hash" field.

func (*GuildCreate) SetLanguage

func (gc *GuildCreate) SetLanguage(gu guild.Language) *GuildCreate

SetLanguage sets the "language" field.

func (*GuildCreate) SetModeratorSnowflakes

func (gc *GuildCreate) SetModeratorSnowflakes(u []uint64) *GuildCreate

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildCreate) SetName

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

SetName sets the "name" field.

func (*GuildCreate) SetNillableAuditChannel

func (gc *GuildCreate) SetNillableAuditChannel(u *uint64) *GuildCreate

SetNillableAuditChannel sets the "audit_channel" field if the given value is not nil.

func (*GuildCreate) SetNillableIconHash

func (gc *GuildCreate) SetNillableIconHash(s *string) *GuildCreate

SetNillableIconHash sets the "icon_hash" field if the given value is not nil.

func (*GuildCreate) SetNillableLanguage

func (gc *GuildCreate) SetNillableLanguage(gu *guild.Language) *GuildCreate

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*GuildCreate) SetSettings

func (gc *GuildCreate) SetSettings(ss *schema.GuildSettings) *GuildCreate

SetSettings sets the "settings" field.

type GuildCreateBulk

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

GuildCreateBulk is the builder for creating many Guild entities in bulk.

func (*GuildCreateBulk) Exec

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

Exec executes the query.

func (*GuildCreateBulk) ExecX

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

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

func (*GuildCreateBulk) OnConflict

func (gcb *GuildCreateBulk) OnConflict(opts ...sql.ConflictOption) *GuildUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Guild.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GuildUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GuildCreateBulk) OnConflictColumns

func (gcb *GuildCreateBulk) OnConflictColumns(columns ...string) *GuildUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Guild.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GuildCreateBulk) Save

func (gcb *GuildCreateBulk) Save(ctx context.Context) ([]*Guild, error)

Save creates the Guild entities in the database.

func (*GuildCreateBulk) SaveX

func (gcb *GuildCreateBulk) SaveX(ctx context.Context) []*Guild

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

type GuildDelete

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

GuildDelete is the builder for deleting a Guild entity.

func (*GuildDelete) Exec

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

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

func (*GuildDelete) ExecX

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

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

func (*GuildDelete) Where

func (gd *GuildDelete) Where(ps ...predicate.Guild) *GuildDelete

Where appends a list predicates to the GuildDelete builder.

type GuildDeleteOne

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

GuildDeleteOne is the builder for deleting a single Guild entity.

func (*GuildDeleteOne) Exec

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

Exec executes the deletion query.

func (*GuildDeleteOne) ExecX

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

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

func (*GuildDeleteOne) Where

func (gdo *GuildDeleteOne) Where(ps ...predicate.Guild) *GuildDeleteOne

Where appends a list predicates to the GuildDelete builder.

type GuildEdges

type GuildEdges struct {
	// Members holds the value of the members edge.
	Members []*User `json:"members,omitempty"`
	// Admins holds the value of the admins edge.
	Admins []*User `json:"admins,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*GuildRole `json:"roles,omitempty"`
	// YoutubeTalents holds the value of the youtube_talents edge.
	YoutubeTalents []*YouTubeTalent `json:"youtube_talents,omitempty"`
	// contains filtered or unexported fields
}

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

func (GuildEdges) AdminsOrErr

func (e GuildEdges) AdminsOrErr() ([]*User, error)

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

func (GuildEdges) MembersOrErr

func (e GuildEdges) MembersOrErr() ([]*User, error)

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

func (GuildEdges) RolesOrErr

func (e GuildEdges) RolesOrErr() ([]*GuildRole, error)

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

func (GuildEdges) YoutubeTalentsOrErr

func (e GuildEdges) YoutubeTalentsOrErr() ([]*YouTubeTalent, error)

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

type GuildGroupBy

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

GuildGroupBy is the group-by builder for Guild entities.

func (*GuildGroupBy) Aggregate

func (ggb *GuildGroupBy) Aggregate(fns ...AggregateFunc) *GuildGroupBy

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

func (*GuildGroupBy) Bool

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

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

func (*GuildGroupBy) BoolX

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

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

func (*GuildGroupBy) Bools

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

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

func (*GuildGroupBy) BoolsX

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

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

func (*GuildGroupBy) Float64

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

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

func (*GuildGroupBy) Float64X

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

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

func (*GuildGroupBy) Float64s

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

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

func (*GuildGroupBy) Float64sX

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

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

func (*GuildGroupBy) Int

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

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

func (*GuildGroupBy) IntX

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

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

func (*GuildGroupBy) Ints

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

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

func (*GuildGroupBy) IntsX

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

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

func (*GuildGroupBy) Scan

func (ggb *GuildGroupBy) Scan(ctx context.Context, v any) error

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

func (*GuildGroupBy) ScanX

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

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

func (*GuildGroupBy) String

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

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

func (*GuildGroupBy) StringX

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

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

func (*GuildGroupBy) Strings

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

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

func (*GuildGroupBy) StringsX

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

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

type GuildMutation

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

GuildMutation represents an operation that mutates the Guild nodes in the graph.

func (*GuildMutation) AddAdminIDs

func (m *GuildMutation) AddAdminIDs(ids ...uint64)

AddAdminIDs adds the "admins" edge to the User entity by ids.

func (*GuildMutation) AddAuditChannel

func (m *GuildMutation) AddAuditChannel(u int64)

AddAuditChannel adds u to the "audit_channel" field.

func (*GuildMutation) AddField

func (m *GuildMutation) 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 (*GuildMutation) AddMemberIDs

func (m *GuildMutation) AddMemberIDs(ids ...uint64)

AddMemberIDs adds the "members" edge to the User entity by ids.

func (*GuildMutation) AddRoleIDs

func (m *GuildMutation) AddRoleIDs(ids ...uint64)

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

func (*GuildMutation) AddYoutubeTalentIDs

func (m *GuildMutation) AddYoutubeTalentIDs(ids ...string)

AddYoutubeTalentIDs adds the "youtube_talents" edge to the YouTubeTalent entity by ids.

func (*GuildMutation) AddedAuditChannel

func (m *GuildMutation) AddedAuditChannel() (r int64, exists bool)

AddedAuditChannel returns the value that was added to the "audit_channel" field in this mutation.

func (*GuildMutation) AddedEdges

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

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

func (*GuildMutation) AddedField

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

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

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

func (*GuildMutation) AddedIDs

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

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

func (*GuildMutation) AdminSnowflakes

func (m *GuildMutation) AdminSnowflakes() (r []uint64, exists bool)

AdminSnowflakes returns the value of the "admin_snowflakes" field in the mutation.

func (*GuildMutation) AdminsCleared

func (m *GuildMutation) AdminsCleared() bool

AdminsCleared reports if the "admins" edge to the User entity was cleared.

func (*GuildMutation) AdminsIDs

func (m *GuildMutation) AdminsIDs() (ids []uint64)

AdminsIDs returns the "admins" edge IDs in the mutation.

func (*GuildMutation) AppendAdminSnowflakes

func (m *GuildMutation) AppendAdminSnowflakes(u []uint64)

AppendAdminSnowflakes adds u to the "admin_snowflakes" field.

func (*GuildMutation) AppendModeratorSnowflakes

func (m *GuildMutation) AppendModeratorSnowflakes(u []uint64)

AppendModeratorSnowflakes adds u to the "moderator_snowflakes" field.

func (*GuildMutation) AppendedAdminSnowflakes

func (m *GuildMutation) AppendedAdminSnowflakes() ([]uint64, bool)

AppendedAdminSnowflakes returns the list of values that were appended to the "admin_snowflakes" field in this mutation.

func (*GuildMutation) AppendedModeratorSnowflakes

func (m *GuildMutation) AppendedModeratorSnowflakes() ([]uint64, bool)

AppendedModeratorSnowflakes returns the list of values that were appended to the "moderator_snowflakes" field in this mutation.

func (*GuildMutation) AuditChannel

func (m *GuildMutation) AuditChannel() (r uint64, exists bool)

AuditChannel returns the value of the "audit_channel" field in the mutation.

func (*GuildMutation) AuditChannelCleared

func (m *GuildMutation) AuditChannelCleared() bool

AuditChannelCleared returns if the "audit_channel" field was cleared in this mutation.

func (*GuildMutation) ClearAdmins

func (m *GuildMutation) ClearAdmins()

ClearAdmins clears the "admins" edge to the User entity.

func (*GuildMutation) ClearAuditChannel

func (m *GuildMutation) ClearAuditChannel()

ClearAuditChannel clears the value of the "audit_channel" field.

func (*GuildMutation) ClearEdge

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

func (m *GuildMutation) 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 (*GuildMutation) ClearIconHash

func (m *GuildMutation) ClearIconHash()

ClearIconHash clears the value of the "icon_hash" field.

func (*GuildMutation) ClearMembers

func (m *GuildMutation) ClearMembers()

ClearMembers clears the "members" edge to the User entity.

func (*GuildMutation) ClearModeratorSnowflakes

func (m *GuildMutation) ClearModeratorSnowflakes()

ClearModeratorSnowflakes clears the value of the "moderator_snowflakes" field.

func (*GuildMutation) ClearRoles

func (m *GuildMutation) ClearRoles()

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

func (*GuildMutation) ClearSettings

func (m *GuildMutation) ClearSettings()

ClearSettings clears the value of the "settings" field.

func (*GuildMutation) ClearYoutubeTalents

func (m *GuildMutation) ClearYoutubeTalents()

ClearYoutubeTalents clears the "youtube_talents" edge to the YouTubeTalent entity.

func (*GuildMutation) ClearedEdges

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

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

func (*GuildMutation) ClearedFields

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

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

func (GuildMutation) Client

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

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

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

func (*GuildMutation) Field

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

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

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

func (*GuildMutation) Fields

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

func (m *GuildMutation) ID() (id uint64, 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 (*GuildMutation) IDs

func (m *GuildMutation) IDs(ctx context.Context) ([]uint64, 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 (*GuildMutation) IconHash

func (m *GuildMutation) IconHash() (r string, exists bool)

IconHash returns the value of the "icon_hash" field in the mutation.

func (*GuildMutation) IconHashCleared

func (m *GuildMutation) IconHashCleared() bool

IconHashCleared returns if the "icon_hash" field was cleared in this mutation.

func (*GuildMutation) Language

func (m *GuildMutation) Language() (r guild.Language, exists bool)

Language returns the value of the "language" field in the mutation.

func (*GuildMutation) MembersCleared

func (m *GuildMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the User entity was cleared.

func (*GuildMutation) MembersIDs

func (m *GuildMutation) MembersIDs() (ids []uint64)

MembersIDs returns the "members" edge IDs in the mutation.

func (*GuildMutation) ModeratorSnowflakes

func (m *GuildMutation) ModeratorSnowflakes() (r []uint64, exists bool)

ModeratorSnowflakes returns the value of the "moderator_snowflakes" field in the mutation.

func (*GuildMutation) ModeratorSnowflakesCleared

func (m *GuildMutation) ModeratorSnowflakesCleared() bool

ModeratorSnowflakesCleared returns if the "moderator_snowflakes" field was cleared in this mutation.

func (*GuildMutation) Name

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

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

func (*GuildMutation) OldAdminSnowflakes

func (m *GuildMutation) OldAdminSnowflakes(ctx context.Context) (v []uint64, err error)

OldAdminSnowflakes returns the old "admin_snowflakes" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldAuditChannel

func (m *GuildMutation) OldAuditChannel(ctx context.Context) (v uint64, err error)

OldAuditChannel returns the old "audit_channel" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldField

func (m *GuildMutation) 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 (*GuildMutation) OldIconHash

func (m *GuildMutation) OldIconHash(ctx context.Context) (v string, err error)

OldIconHash returns the old "icon_hash" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldLanguage

func (m *GuildMutation) OldLanguage(ctx context.Context) (v guild.Language, err error)

OldLanguage returns the old "language" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldModeratorSnowflakes

func (m *GuildMutation) OldModeratorSnowflakes(ctx context.Context) (v []uint64, err error)

OldModeratorSnowflakes returns the old "moderator_snowflakes" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldName

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

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

func (m *GuildMutation) OldSettings(ctx context.Context) (v *schema.GuildSettings, err error)

OldSettings returns the old "settings" field's value of the Guild entity. If the Guild 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 (*GuildMutation) Op

func (m *GuildMutation) Op() Op

Op returns the operation name.

func (*GuildMutation) RemoveAdminIDs

func (m *GuildMutation) RemoveAdminIDs(ids ...uint64)

RemoveAdminIDs removes the "admins" edge to the User entity by IDs.

func (*GuildMutation) RemoveMemberIDs

func (m *GuildMutation) RemoveMemberIDs(ids ...uint64)

RemoveMemberIDs removes the "members" edge to the User entity by IDs.

func (*GuildMutation) RemoveRoleIDs

func (m *GuildMutation) RemoveRoleIDs(ids ...uint64)

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

func (*GuildMutation) RemoveYoutubeTalentIDs

func (m *GuildMutation) RemoveYoutubeTalentIDs(ids ...string)

RemoveYoutubeTalentIDs removes the "youtube_talents" edge to the YouTubeTalent entity by IDs.

func (*GuildMutation) RemovedAdminsIDs

func (m *GuildMutation) RemovedAdminsIDs() (ids []uint64)

RemovedAdmins returns the removed IDs of the "admins" edge to the User entity.

func (*GuildMutation) RemovedEdges

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

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

func (*GuildMutation) RemovedIDs

func (m *GuildMutation) 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 (*GuildMutation) RemovedMembersIDs

func (m *GuildMutation) RemovedMembersIDs() (ids []uint64)

RemovedMembers returns the removed IDs of the "members" edge to the User entity.

func (*GuildMutation) RemovedRolesIDs

func (m *GuildMutation) RemovedRolesIDs() (ids []uint64)

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

func (*GuildMutation) RemovedYoutubeTalentsIDs

func (m *GuildMutation) RemovedYoutubeTalentsIDs() (ids []string)

RemovedYoutubeTalents returns the removed IDs of the "youtube_talents" edge to the YouTubeTalent entity.

func (*GuildMutation) ResetAdminSnowflakes

func (m *GuildMutation) ResetAdminSnowflakes()

ResetAdminSnowflakes resets all changes to the "admin_snowflakes" field.

func (*GuildMutation) ResetAdmins

func (m *GuildMutation) ResetAdmins()

ResetAdmins resets all changes to the "admins" edge.

func (*GuildMutation) ResetAuditChannel

func (m *GuildMutation) ResetAuditChannel()

ResetAuditChannel resets all changes to the "audit_channel" field.

func (*GuildMutation) ResetEdge

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

func (m *GuildMutation) 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 (*GuildMutation) ResetIconHash

func (m *GuildMutation) ResetIconHash()

ResetIconHash resets all changes to the "icon_hash" field.

func (*GuildMutation) ResetLanguage

func (m *GuildMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*GuildMutation) ResetMembers

func (m *GuildMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*GuildMutation) ResetModeratorSnowflakes

func (m *GuildMutation) ResetModeratorSnowflakes()

ResetModeratorSnowflakes resets all changes to the "moderator_snowflakes" field.

func (*GuildMutation) ResetName

func (m *GuildMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GuildMutation) ResetRoles

func (m *GuildMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*GuildMutation) ResetSettings

func (m *GuildMutation) ResetSettings()

ResetSettings resets all changes to the "settings" field.

func (*GuildMutation) ResetYoutubeTalents

func (m *GuildMutation) ResetYoutubeTalents()

ResetYoutubeTalents resets all changes to the "youtube_talents" edge.

func (*GuildMutation) RolesCleared

func (m *GuildMutation) RolesCleared() bool

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

func (*GuildMutation) RolesIDs

func (m *GuildMutation) RolesIDs() (ids []uint64)

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

func (*GuildMutation) SetAdminSnowflakes

func (m *GuildMutation) SetAdminSnowflakes(u []uint64)

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildMutation) SetAuditChannel

func (m *GuildMutation) SetAuditChannel(u uint64)

SetAuditChannel sets the "audit_channel" field.

func (*GuildMutation) SetField

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

func (m *GuildMutation) SetID(id uint64)

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

func (*GuildMutation) SetIconHash

func (m *GuildMutation) SetIconHash(s string)

SetIconHash sets the "icon_hash" field.

func (*GuildMutation) SetLanguage

func (m *GuildMutation) SetLanguage(gu guild.Language)

SetLanguage sets the "language" field.

func (*GuildMutation) SetModeratorSnowflakes

func (m *GuildMutation) SetModeratorSnowflakes(u []uint64)

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildMutation) SetName

func (m *GuildMutation) SetName(s string)

SetName sets the "name" field.

func (*GuildMutation) SetOp

func (m *GuildMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GuildMutation) SetSettings

func (m *GuildMutation) SetSettings(ss *schema.GuildSettings)

SetSettings sets the "settings" field.

func (*GuildMutation) Settings

func (m *GuildMutation) Settings() (r *schema.GuildSettings, exists bool)

Settings returns the value of the "settings" field in the mutation.

func (*GuildMutation) SettingsCleared

func (m *GuildMutation) SettingsCleared() bool

SettingsCleared returns if the "settings" field was cleared in this mutation.

func (GuildMutation) Tx

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

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

func (*GuildMutation) Type

func (m *GuildMutation) Type() string

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

func (*GuildMutation) Where

func (m *GuildMutation) Where(ps ...predicate.Guild)

Where appends a list predicates to the GuildMutation builder.

func (*GuildMutation) WhereP

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

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

func (*GuildMutation) YoutubeTalentsCleared

func (m *GuildMutation) YoutubeTalentsCleared() bool

YoutubeTalentsCleared reports if the "youtube_talents" edge to the YouTubeTalent entity was cleared.

func (*GuildMutation) YoutubeTalentsIDs

func (m *GuildMutation) YoutubeTalentsIDs() (ids []string)

YoutubeTalentsIDs returns the "youtube_talents" edge IDs in the mutation.

type GuildQuery

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

GuildQuery is the builder for querying Guild entities.

func (*GuildQuery) Aggregate

func (gq *GuildQuery) Aggregate(fns ...AggregateFunc) *GuildSelect

Aggregate returns a GuildSelect configured with the given aggregations.

func (*GuildQuery) All

func (gq *GuildQuery) All(ctx context.Context) ([]*Guild, error)

All executes the query and returns a list of Guilds.

func (*GuildQuery) AllX

func (gq *GuildQuery) AllX(ctx context.Context) []*Guild

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

func (*GuildQuery) Clone

func (gq *GuildQuery) Clone() *GuildQuery

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

func (*GuildQuery) Count

func (gq *GuildQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GuildQuery) CountX

func (gq *GuildQuery) CountX(ctx context.Context) int

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

func (*GuildQuery) Exist

func (gq *GuildQuery) Exist(ctx context.Context) (bool, error)

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

func (*GuildQuery) ExistX

func (gq *GuildQuery) ExistX(ctx context.Context) bool

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

func (*GuildQuery) First

func (gq *GuildQuery) First(ctx context.Context) (*Guild, error)

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

func (*GuildQuery) FirstID

func (gq *GuildQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*GuildQuery) FirstIDX

func (gq *GuildQuery) FirstIDX(ctx context.Context) uint64

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

func (*GuildQuery) FirstX

func (gq *GuildQuery) FirstX(ctx context.Context) *Guild

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

func (*GuildQuery) ForShare

func (gq *GuildQuery) ForShare(opts ...sql.LockOption) *GuildQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GuildQuery) ForUpdate

func (gq *GuildQuery) ForUpdate(opts ...sql.LockOption) *GuildQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GuildQuery) GroupBy

func (gq *GuildQuery) GroupBy(field string, fields ...string) *GuildGroupBy

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.Guild.Query().
	GroupBy(guild.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GuildQuery) IDs

func (gq *GuildQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*GuildQuery) IDsX

func (gq *GuildQuery) IDsX(ctx context.Context) []uint64

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

func (*GuildQuery) Limit

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

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

func (*GuildQuery) Offset

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

Offset to start from.

func (*GuildQuery) Only

func (gq *GuildQuery) Only(ctx context.Context) (*Guild, error)

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

func (*GuildQuery) OnlyID

func (gq *GuildQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*GuildQuery) OnlyIDX

func (gq *GuildQuery) OnlyIDX(ctx context.Context) uint64

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

func (*GuildQuery) OnlyX

func (gq *GuildQuery) OnlyX(ctx context.Context) *Guild

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

func (*GuildQuery) Order

func (gq *GuildQuery) Order(o ...guild.OrderOption) *GuildQuery

Order specifies how the records should be ordered.

func (*GuildQuery) QueryAdmins

func (gq *GuildQuery) QueryAdmins() *UserQuery

QueryAdmins chains the current query on the "admins" edge.

func (*GuildQuery) QueryMembers

func (gq *GuildQuery) QueryMembers() *UserQuery

QueryMembers chains the current query on the "members" edge.

func (*GuildQuery) QueryRoles

func (gq *GuildQuery) QueryRoles() *GuildRoleQuery

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

func (*GuildQuery) QueryYoutubeTalents

func (gq *GuildQuery) QueryYoutubeTalents() *YouTubeTalentQuery

QueryYoutubeTalents chains the current query on the "youtube_talents" edge.

func (*GuildQuery) Select

func (gq *GuildQuery) Select(fields ...string) *GuildSelect

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.Guild.Query().
	Select(guild.FieldName).
	Scan(ctx, &v)

func (*GuildQuery) Unique

func (gq *GuildQuery) Unique(unique bool) *GuildQuery

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

func (gq *GuildQuery) Where(ps ...predicate.Guild) *GuildQuery

Where adds a new predicate for the GuildQuery builder.

func (*GuildQuery) WithAdmins

func (gq *GuildQuery) WithAdmins(opts ...func(*UserQuery)) *GuildQuery

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

func (*GuildQuery) WithMembers

func (gq *GuildQuery) WithMembers(opts ...func(*UserQuery)) *GuildQuery

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

func (*GuildQuery) WithRoles

func (gq *GuildQuery) WithRoles(opts ...func(*GuildRoleQuery)) *GuildQuery

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

func (*GuildQuery) WithYoutubeTalents

func (gq *GuildQuery) WithYoutubeTalents(opts ...func(*YouTubeTalentQuery)) *GuildQuery

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

type GuildRole

type GuildRole struct {

	// ID of the ent.
	// Discord snowflake for this role
	ID uint64 `json:"id,omitempty"`
	// Human name for this role
	Name string `json:"name,omitempty"`
	// When the name was last synchronized for this role
	LastUpdated time.Time `json:"last_updated,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GuildRoleQuery when eager-loading is set.
	Edges GuildRoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

GuildRole is the model entity for the GuildRole schema.

func (*GuildRole) QueryGuild

func (gr *GuildRole) QueryGuild() *GuildQuery

QueryGuild queries the "guild" edge of the GuildRole entity.

func (*GuildRole) QueryTalent

func (gr *GuildRole) QueryTalent() *YouTubeTalentQuery

QueryTalent queries the "talent" edge of the GuildRole entity.

func (*GuildRole) QueryUserMemberships

func (gr *GuildRole) QueryUserMemberships() *UserMembershipQuery

QueryUserMemberships queries the "user_memberships" edge of the GuildRole entity.

func (*GuildRole) String

func (gr *GuildRole) String() string

String implements the fmt.Stringer.

func (*GuildRole) Unwrap

func (gr *GuildRole) Unwrap() *GuildRole

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

func (gr *GuildRole) Update() *GuildRoleUpdateOne

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

func (*GuildRole) Value

func (gr *GuildRole) Value(name string) (ent.Value, error)

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

type GuildRoleClient

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

GuildRoleClient is a client for the GuildRole schema.

func NewGuildRoleClient

func NewGuildRoleClient(c config) *GuildRoleClient

NewGuildRoleClient returns a client for the GuildRole from the given config.

func (*GuildRoleClient) Create

func (c *GuildRoleClient) Create() *GuildRoleCreate

Create returns a builder for creating a GuildRole entity.

func (*GuildRoleClient) CreateBulk

func (c *GuildRoleClient) CreateBulk(builders ...*GuildRoleCreate) *GuildRoleCreateBulk

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

func (*GuildRoleClient) Delete

func (c *GuildRoleClient) Delete() *GuildRoleDelete

Delete returns a delete builder for GuildRole.

func (*GuildRoleClient) DeleteOne

func (c *GuildRoleClient) DeleteOne(gr *GuildRole) *GuildRoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GuildRoleClient) DeleteOneID

func (c *GuildRoleClient) DeleteOneID(id uint64) *GuildRoleDeleteOne

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

func (*GuildRoleClient) Get

func (c *GuildRoleClient) Get(ctx context.Context, id uint64) (*GuildRole, error)

Get returns a GuildRole entity by its id.

func (*GuildRoleClient) GetX

func (c *GuildRoleClient) GetX(ctx context.Context, id uint64) *GuildRole

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

func (*GuildRoleClient) Hooks

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

Hooks returns the client hooks.

func (*GuildRoleClient) Intercept

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

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

func (*GuildRoleClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GuildRoleClient) Query

func (c *GuildRoleClient) Query() *GuildRoleQuery

Query returns a query builder for GuildRole.

func (*GuildRoleClient) QueryGuild

func (c *GuildRoleClient) QueryGuild(gr *GuildRole) *GuildQuery

QueryGuild queries the guild edge of a GuildRole.

func (*GuildRoleClient) QueryTalent

func (c *GuildRoleClient) QueryTalent(gr *GuildRole) *YouTubeTalentQuery

QueryTalent queries the talent edge of a GuildRole.

func (*GuildRoleClient) QueryUserMemberships

func (c *GuildRoleClient) QueryUserMemberships(gr *GuildRole) *UserMembershipQuery

QueryUserMemberships queries the user_memberships edge of a GuildRole.

func (*GuildRoleClient) Update

func (c *GuildRoleClient) Update() *GuildRoleUpdate

Update returns an update builder for GuildRole.

func (*GuildRoleClient) UpdateOne

func (c *GuildRoleClient) UpdateOne(gr *GuildRole) *GuildRoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GuildRoleClient) UpdateOneID

func (c *GuildRoleClient) UpdateOneID(id uint64) *GuildRoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GuildRoleClient) Use

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

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

type GuildRoleCreate

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

GuildRoleCreate is the builder for creating a GuildRole entity.

func (*GuildRoleCreate) AddUserMembershipIDs

func (grc *GuildRoleCreate) AddUserMembershipIDs(ids ...int) *GuildRoleCreate

AddUserMembershipIDs adds the "user_memberships" edge to the UserMembership entity by IDs.

func (*GuildRoleCreate) AddUserMemberships

func (grc *GuildRoleCreate) AddUserMemberships(u ...*UserMembership) *GuildRoleCreate

AddUserMemberships adds the "user_memberships" edges to the UserMembership entity.

func (*GuildRoleCreate) Exec

func (grc *GuildRoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildRoleCreate) ExecX

func (grc *GuildRoleCreate) ExecX(ctx context.Context)

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

func (*GuildRoleCreate) Mutation

func (grc *GuildRoleCreate) Mutation() *GuildRoleMutation

Mutation returns the GuildRoleMutation object of the builder.

func (*GuildRoleCreate) OnConflict

func (grc *GuildRoleCreate) OnConflict(opts ...sql.ConflictOption) *GuildRoleUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GuildRole.Create().
	SetName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GuildRoleUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GuildRoleCreate) OnConflictColumns

func (grc *GuildRoleCreate) OnConflictColumns(columns ...string) *GuildRoleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GuildRole.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GuildRoleCreate) Save

func (grc *GuildRoleCreate) Save(ctx context.Context) (*GuildRole, error)

Save creates the GuildRole in the database.

func (*GuildRoleCreate) SaveX

func (grc *GuildRoleCreate) SaveX(ctx context.Context) *GuildRole

SaveX calls Save and panics if Save returns an error.

func (*GuildRoleCreate) SetGuild

func (grc *GuildRoleCreate) SetGuild(g *Guild) *GuildRoleCreate

SetGuild sets the "guild" edge to the Guild entity.

func (*GuildRoleCreate) SetGuildID

func (grc *GuildRoleCreate) SetGuildID(id uint64) *GuildRoleCreate

SetGuildID sets the "guild" edge to the Guild entity by ID.

func (*GuildRoleCreate) SetID

func (grc *GuildRoleCreate) SetID(u uint64) *GuildRoleCreate

SetID sets the "id" field.

func (*GuildRoleCreate) SetLastUpdated

func (grc *GuildRoleCreate) SetLastUpdated(t time.Time) *GuildRoleCreate

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleCreate) SetName

func (grc *GuildRoleCreate) SetName(s string) *GuildRoleCreate

SetName sets the "name" field.

func (*GuildRoleCreate) SetNillableLastUpdated

func (grc *GuildRoleCreate) SetNillableLastUpdated(t *time.Time) *GuildRoleCreate

SetNillableLastUpdated sets the "last_updated" field if the given value is not nil.

func (*GuildRoleCreate) SetNillableTalentID

func (grc *GuildRoleCreate) SetNillableTalentID(id *string) *GuildRoleCreate

SetNillableTalentID sets the "talent" edge to the YouTubeTalent entity by ID if the given value is not nil.

func (*GuildRoleCreate) SetTalent

func (grc *GuildRoleCreate) SetTalent(y *YouTubeTalent) *GuildRoleCreate

SetTalent sets the "talent" edge to the YouTubeTalent entity.

func (*GuildRoleCreate) SetTalentID

func (grc *GuildRoleCreate) SetTalentID(id string) *GuildRoleCreate

SetTalentID sets the "talent" edge to the YouTubeTalent entity by ID.

type GuildRoleCreateBulk

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

GuildRoleCreateBulk is the builder for creating many GuildRole entities in bulk.

func (*GuildRoleCreateBulk) Exec

func (grcb *GuildRoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildRoleCreateBulk) ExecX

func (grcb *GuildRoleCreateBulk) ExecX(ctx context.Context)

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

func (*GuildRoleCreateBulk) OnConflict

func (grcb *GuildRoleCreateBulk) OnConflict(opts ...sql.ConflictOption) *GuildRoleUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GuildRole.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GuildRoleUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GuildRoleCreateBulk) OnConflictColumns

func (grcb *GuildRoleCreateBulk) OnConflictColumns(columns ...string) *GuildRoleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GuildRole.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GuildRoleCreateBulk) Save

func (grcb *GuildRoleCreateBulk) Save(ctx context.Context) ([]*GuildRole, error)

Save creates the GuildRole entities in the database.

func (*GuildRoleCreateBulk) SaveX

func (grcb *GuildRoleCreateBulk) SaveX(ctx context.Context) []*GuildRole

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

type GuildRoleDelete

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

GuildRoleDelete is the builder for deleting a GuildRole entity.

func (*GuildRoleDelete) Exec

func (grd *GuildRoleDelete) Exec(ctx context.Context) (int, error)

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

func (*GuildRoleDelete) ExecX

func (grd *GuildRoleDelete) ExecX(ctx context.Context) int

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

func (*GuildRoleDelete) Where

Where appends a list predicates to the GuildRoleDelete builder.

type GuildRoleDeleteOne

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

GuildRoleDeleteOne is the builder for deleting a single GuildRole entity.

func (*GuildRoleDeleteOne) Exec

func (grdo *GuildRoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GuildRoleDeleteOne) ExecX

func (grdo *GuildRoleDeleteOne) ExecX(ctx context.Context)

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

func (*GuildRoleDeleteOne) Where

Where appends a list predicates to the GuildRoleDelete builder.

type GuildRoleEdges

type GuildRoleEdges struct {
	// Guild holds the value of the guild edge.
	Guild *Guild `json:"guild,omitempty"`
	// UserMemberships holds the value of the user_memberships edge.
	UserMemberships []*UserMembership `json:"user_memberships,omitempty"`
	// Talent holds the value of the talent edge.
	Talent *YouTubeTalent `json:"talent,omitempty"`
	// contains filtered or unexported fields
}

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

func (GuildRoleEdges) GuildOrErr

func (e GuildRoleEdges) GuildOrErr() (*Guild, error)

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

func (GuildRoleEdges) TalentOrErr

func (e GuildRoleEdges) TalentOrErr() (*YouTubeTalent, error)

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

func (GuildRoleEdges) UserMembershipsOrErr

func (e GuildRoleEdges) UserMembershipsOrErr() ([]*UserMembership, error)

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

type GuildRoleGroupBy

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

GuildRoleGroupBy is the group-by builder for GuildRole entities.

func (*GuildRoleGroupBy) Aggregate

func (grgb *GuildRoleGroupBy) Aggregate(fns ...AggregateFunc) *GuildRoleGroupBy

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

func (*GuildRoleGroupBy) Bool

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

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

func (*GuildRoleGroupBy) BoolX

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

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

func (*GuildRoleGroupBy) Bools

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

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

func (*GuildRoleGroupBy) BoolsX

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

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

func (*GuildRoleGroupBy) Float64

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

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

func (*GuildRoleGroupBy) Float64X

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

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

func (*GuildRoleGroupBy) Float64s

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

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

func (*GuildRoleGroupBy) Float64sX

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

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

func (*GuildRoleGroupBy) Int

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

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

func (*GuildRoleGroupBy) IntX

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

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

func (*GuildRoleGroupBy) Ints

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

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

func (*GuildRoleGroupBy) IntsX

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

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

func (*GuildRoleGroupBy) Scan

func (grgb *GuildRoleGroupBy) Scan(ctx context.Context, v any) error

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

func (*GuildRoleGroupBy) ScanX

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

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

func (*GuildRoleGroupBy) String

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

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

func (*GuildRoleGroupBy) StringX

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

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

func (*GuildRoleGroupBy) Strings

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

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

func (*GuildRoleGroupBy) StringsX

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

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

type GuildRoleMutation

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

GuildRoleMutation represents an operation that mutates the GuildRole nodes in the graph.

func (*GuildRoleMutation) AddField

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) AddUserMembershipIDs

func (m *GuildRoleMutation) AddUserMembershipIDs(ids ...int)

AddUserMembershipIDs adds the "user_memberships" edge to the UserMembership entity by ids.

func (*GuildRoleMutation) AddedEdges

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

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

func (*GuildRoleMutation) AddedField

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

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

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

func (*GuildRoleMutation) AddedIDs

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

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

func (*GuildRoleMutation) ClearEdge

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

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) ClearGuild

func (m *GuildRoleMutation) ClearGuild()

ClearGuild clears the "guild" edge to the Guild entity.

func (*GuildRoleMutation) ClearTalent

func (m *GuildRoleMutation) ClearTalent()

ClearTalent clears the "talent" edge to the YouTubeTalent entity.

func (*GuildRoleMutation) ClearUserMemberships

func (m *GuildRoleMutation) ClearUserMemberships()

ClearUserMemberships clears the "user_memberships" edge to the UserMembership entity.

func (*GuildRoleMutation) ClearedEdges

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

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

func (*GuildRoleMutation) ClearedFields

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

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

func (GuildRoleMutation) Client

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

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

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

func (*GuildRoleMutation) Field

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

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

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

func (*GuildRoleMutation) Fields

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) GuildCleared

func (m *GuildRoleMutation) GuildCleared() bool

GuildCleared reports if the "guild" edge to the Guild entity was cleared.

func (*GuildRoleMutation) GuildID

func (m *GuildRoleMutation) GuildID() (id uint64, exists bool)

GuildID returns the "guild" edge ID in the mutation.

func (*GuildRoleMutation) GuildIDs

func (m *GuildRoleMutation) GuildIDs() (ids []uint64)

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

func (*GuildRoleMutation) ID

func (m *GuildRoleMutation) ID() (id uint64, 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 (*GuildRoleMutation) IDs

func (m *GuildRoleMutation) IDs(ctx context.Context) ([]uint64, 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 (*GuildRoleMutation) LastUpdated

func (m *GuildRoleMutation) LastUpdated() (r time.Time, exists bool)

LastUpdated returns the value of the "last_updated" field in the mutation.

func (*GuildRoleMutation) Name

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

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

func (*GuildRoleMutation) OldField

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) OldLastUpdated

func (m *GuildRoleMutation) OldLastUpdated(ctx context.Context) (v time.Time, err error)

OldLastUpdated returns the old "last_updated" field's value of the GuildRole entity. If the GuildRole 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 (*GuildRoleMutation) OldName

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

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

func (m *GuildRoleMutation) Op() Op

Op returns the operation name.

func (*GuildRoleMutation) RemoveUserMembershipIDs

func (m *GuildRoleMutation) RemoveUserMembershipIDs(ids ...int)

RemoveUserMembershipIDs removes the "user_memberships" edge to the UserMembership entity by IDs.

func (*GuildRoleMutation) RemovedEdges

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

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

func (*GuildRoleMutation) RemovedIDs

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) RemovedUserMembershipsIDs

func (m *GuildRoleMutation) RemovedUserMembershipsIDs() (ids []int)

RemovedUserMemberships returns the removed IDs of the "user_memberships" edge to the UserMembership entity.

func (*GuildRoleMutation) ResetEdge

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

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) ResetGuild

func (m *GuildRoleMutation) ResetGuild()

ResetGuild resets all changes to the "guild" edge.

func (*GuildRoleMutation) ResetLastUpdated

func (m *GuildRoleMutation) ResetLastUpdated()

ResetLastUpdated resets all changes to the "last_updated" field.

func (*GuildRoleMutation) ResetName

func (m *GuildRoleMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GuildRoleMutation) ResetTalent

func (m *GuildRoleMutation) ResetTalent()

ResetTalent resets all changes to the "talent" edge.

func (*GuildRoleMutation) ResetUserMemberships

func (m *GuildRoleMutation) ResetUserMemberships()

ResetUserMemberships resets all changes to the "user_memberships" edge.

func (*GuildRoleMutation) SetField

func (m *GuildRoleMutation) 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 (*GuildRoleMutation) SetGuildID

func (m *GuildRoleMutation) SetGuildID(id uint64)

SetGuildID sets the "guild" edge to the Guild entity by id.

func (*GuildRoleMutation) SetID

func (m *GuildRoleMutation) SetID(id uint64)

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

func (*GuildRoleMutation) SetLastUpdated

func (m *GuildRoleMutation) SetLastUpdated(t time.Time)

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleMutation) SetName

func (m *GuildRoleMutation) SetName(s string)

SetName sets the "name" field.

func (*GuildRoleMutation) SetOp

func (m *GuildRoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GuildRoleMutation) SetTalentID

func (m *GuildRoleMutation) SetTalentID(id string)

SetTalentID sets the "talent" edge to the YouTubeTalent entity by id.

func (*GuildRoleMutation) TalentCleared

func (m *GuildRoleMutation) TalentCleared() bool

TalentCleared reports if the "talent" edge to the YouTubeTalent entity was cleared.

func (*GuildRoleMutation) TalentID

func (m *GuildRoleMutation) TalentID() (id string, exists bool)

TalentID returns the "talent" edge ID in the mutation.

func (*GuildRoleMutation) TalentIDs

func (m *GuildRoleMutation) TalentIDs() (ids []string)

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

func (GuildRoleMutation) Tx

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

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

func (*GuildRoleMutation) Type

func (m *GuildRoleMutation) Type() string

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

func (*GuildRoleMutation) UserMembershipsCleared

func (m *GuildRoleMutation) UserMembershipsCleared() bool

UserMembershipsCleared reports if the "user_memberships" edge to the UserMembership entity was cleared.

func (*GuildRoleMutation) UserMembershipsIDs

func (m *GuildRoleMutation) UserMembershipsIDs() (ids []int)

UserMembershipsIDs returns the "user_memberships" edge IDs in the mutation.

func (*GuildRoleMutation) Where

func (m *GuildRoleMutation) Where(ps ...predicate.GuildRole)

Where appends a list predicates to the GuildRoleMutation builder.

func (*GuildRoleMutation) WhereP

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

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

type GuildRoleQuery

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

GuildRoleQuery is the builder for querying GuildRole entities.

func (*GuildRoleQuery) Aggregate

func (grq *GuildRoleQuery) Aggregate(fns ...AggregateFunc) *GuildRoleSelect

Aggregate returns a GuildRoleSelect configured with the given aggregations.

func (*GuildRoleQuery) All

func (grq *GuildRoleQuery) All(ctx context.Context) ([]*GuildRole, error)

All executes the query and returns a list of GuildRoles.

func (*GuildRoleQuery) AllX

func (grq *GuildRoleQuery) AllX(ctx context.Context) []*GuildRole

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

func (*GuildRoleQuery) Clone

func (grq *GuildRoleQuery) Clone() *GuildRoleQuery

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

func (*GuildRoleQuery) Count

func (grq *GuildRoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GuildRoleQuery) CountX

func (grq *GuildRoleQuery) CountX(ctx context.Context) int

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

func (*GuildRoleQuery) Exist

func (grq *GuildRoleQuery) Exist(ctx context.Context) (bool, error)

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

func (*GuildRoleQuery) ExistX

func (grq *GuildRoleQuery) ExistX(ctx context.Context) bool

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

func (*GuildRoleQuery) First

func (grq *GuildRoleQuery) First(ctx context.Context) (*GuildRole, error)

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

func (*GuildRoleQuery) FirstID

func (grq *GuildRoleQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*GuildRoleQuery) FirstIDX

func (grq *GuildRoleQuery) FirstIDX(ctx context.Context) uint64

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

func (*GuildRoleQuery) FirstX

func (grq *GuildRoleQuery) FirstX(ctx context.Context) *GuildRole

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

func (*GuildRoleQuery) ForShare

func (grq *GuildRoleQuery) ForShare(opts ...sql.LockOption) *GuildRoleQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GuildRoleQuery) ForUpdate

func (grq *GuildRoleQuery) ForUpdate(opts ...sql.LockOption) *GuildRoleQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GuildRoleQuery) GroupBy

func (grq *GuildRoleQuery) GroupBy(field string, fields ...string) *GuildRoleGroupBy

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.GuildRole.Query().
	GroupBy(guildrole.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GuildRoleQuery) IDs

func (grq *GuildRoleQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*GuildRoleQuery) IDsX

func (grq *GuildRoleQuery) IDsX(ctx context.Context) []uint64

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

func (*GuildRoleQuery) Limit

func (grq *GuildRoleQuery) Limit(limit int) *GuildRoleQuery

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

func (*GuildRoleQuery) Offset

func (grq *GuildRoleQuery) Offset(offset int) *GuildRoleQuery

Offset to start from.

func (*GuildRoleQuery) Only

func (grq *GuildRoleQuery) Only(ctx context.Context) (*GuildRole, error)

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

func (*GuildRoleQuery) OnlyID

func (grq *GuildRoleQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*GuildRoleQuery) OnlyIDX

func (grq *GuildRoleQuery) OnlyIDX(ctx context.Context) uint64

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

func (*GuildRoleQuery) OnlyX

func (grq *GuildRoleQuery) OnlyX(ctx context.Context) *GuildRole

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

func (*GuildRoleQuery) Order

Order specifies how the records should be ordered.

func (*GuildRoleQuery) QueryGuild

func (grq *GuildRoleQuery) QueryGuild() *GuildQuery

QueryGuild chains the current query on the "guild" edge.

func (*GuildRoleQuery) QueryTalent

func (grq *GuildRoleQuery) QueryTalent() *YouTubeTalentQuery

QueryTalent chains the current query on the "talent" edge.

func (*GuildRoleQuery) QueryUserMemberships

func (grq *GuildRoleQuery) QueryUserMemberships() *UserMembershipQuery

QueryUserMemberships chains the current query on the "user_memberships" edge.

func (*GuildRoleQuery) Select

func (grq *GuildRoleQuery) Select(fields ...string) *GuildRoleSelect

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.GuildRole.Query().
	Select(guildrole.FieldName).
	Scan(ctx, &v)

func (*GuildRoleQuery) Unique

func (grq *GuildRoleQuery) Unique(unique bool) *GuildRoleQuery

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

func (grq *GuildRoleQuery) Where(ps ...predicate.GuildRole) *GuildRoleQuery

Where adds a new predicate for the GuildRoleQuery builder.

func (*GuildRoleQuery) WithGuild

func (grq *GuildRoleQuery) WithGuild(opts ...func(*GuildQuery)) *GuildRoleQuery

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

func (*GuildRoleQuery) WithTalent

func (grq *GuildRoleQuery) WithTalent(opts ...func(*YouTubeTalentQuery)) *GuildRoleQuery

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

func (*GuildRoleQuery) WithUserMemberships

func (grq *GuildRoleQuery) WithUserMemberships(opts ...func(*UserMembershipQuery)) *GuildRoleQuery

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

type GuildRoleSelect

type GuildRoleSelect struct {
	*GuildRoleQuery
	// contains filtered or unexported fields
}

GuildRoleSelect is the builder for selecting fields of GuildRole entities.

func (*GuildRoleSelect) Aggregate

func (grs *GuildRoleSelect) Aggregate(fns ...AggregateFunc) *GuildRoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GuildRoleSelect) Bool

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

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

func (*GuildRoleSelect) BoolX

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

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

func (*GuildRoleSelect) Bools

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

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

func (*GuildRoleSelect) BoolsX

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

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

func (*GuildRoleSelect) Float64

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

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

func (*GuildRoleSelect) Float64X

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

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

func (*GuildRoleSelect) Float64s

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

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

func (*GuildRoleSelect) Float64sX

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

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

func (*GuildRoleSelect) Int

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

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

func (*GuildRoleSelect) IntX

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

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

func (*GuildRoleSelect) Ints

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

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

func (*GuildRoleSelect) IntsX

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

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

func (*GuildRoleSelect) Scan

func (grs *GuildRoleSelect) Scan(ctx context.Context, v any) error

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

func (*GuildRoleSelect) ScanX

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

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

func (*GuildRoleSelect) String

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

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

func (*GuildRoleSelect) StringX

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

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

func (*GuildRoleSelect) Strings

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

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

func (*GuildRoleSelect) StringsX

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

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

type GuildRoleUpdate

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

GuildRoleUpdate is the builder for updating GuildRole entities.

func (*GuildRoleUpdate) AddUserMembershipIDs

func (gru *GuildRoleUpdate) AddUserMembershipIDs(ids ...int) *GuildRoleUpdate

AddUserMembershipIDs adds the "user_memberships" edge to the UserMembership entity by IDs.

func (*GuildRoleUpdate) AddUserMemberships

func (gru *GuildRoleUpdate) AddUserMemberships(u ...*UserMembership) *GuildRoleUpdate

AddUserMemberships adds the "user_memberships" edges to the UserMembership entity.

func (*GuildRoleUpdate) ClearGuild

func (gru *GuildRoleUpdate) ClearGuild() *GuildRoleUpdate

ClearGuild clears the "guild" edge to the Guild entity.

func (*GuildRoleUpdate) ClearTalent

func (gru *GuildRoleUpdate) ClearTalent() *GuildRoleUpdate

ClearTalent clears the "talent" edge to the YouTubeTalent entity.

func (*GuildRoleUpdate) ClearUserMemberships

func (gru *GuildRoleUpdate) ClearUserMemberships() *GuildRoleUpdate

ClearUserMemberships clears all "user_memberships" edges to the UserMembership entity.

func (*GuildRoleUpdate) Exec

func (gru *GuildRoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildRoleUpdate) ExecX

func (gru *GuildRoleUpdate) ExecX(ctx context.Context)

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

func (*GuildRoleUpdate) Mutation

func (gru *GuildRoleUpdate) Mutation() *GuildRoleMutation

Mutation returns the GuildRoleMutation object of the builder.

func (*GuildRoleUpdate) RemoveUserMembershipIDs

func (gru *GuildRoleUpdate) RemoveUserMembershipIDs(ids ...int) *GuildRoleUpdate

RemoveUserMembershipIDs removes the "user_memberships" edge to UserMembership entities by IDs.

func (*GuildRoleUpdate) RemoveUserMemberships

func (gru *GuildRoleUpdate) RemoveUserMemberships(u ...*UserMembership) *GuildRoleUpdate

RemoveUserMemberships removes "user_memberships" edges to UserMembership entities.

func (*GuildRoleUpdate) Save

func (gru *GuildRoleUpdate) Save(ctx context.Context) (int, error)

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

func (*GuildRoleUpdate) SaveX

func (gru *GuildRoleUpdate) SaveX(ctx context.Context) int

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

func (*GuildRoleUpdate) SetGuild

func (gru *GuildRoleUpdate) SetGuild(g *Guild) *GuildRoleUpdate

SetGuild sets the "guild" edge to the Guild entity.

func (*GuildRoleUpdate) SetGuildID

func (gru *GuildRoleUpdate) SetGuildID(id uint64) *GuildRoleUpdate

SetGuildID sets the "guild" edge to the Guild entity by ID.

func (*GuildRoleUpdate) SetLastUpdated

func (gru *GuildRoleUpdate) SetLastUpdated(t time.Time) *GuildRoleUpdate

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleUpdate) SetName

func (gru *GuildRoleUpdate) SetName(s string) *GuildRoleUpdate

SetName sets the "name" field.

func (*GuildRoleUpdate) SetNillableLastUpdated

func (gru *GuildRoleUpdate) SetNillableLastUpdated(t *time.Time) *GuildRoleUpdate

SetNillableLastUpdated sets the "last_updated" field if the given value is not nil.

func (*GuildRoleUpdate) SetNillableTalentID

func (gru *GuildRoleUpdate) SetNillableTalentID(id *string) *GuildRoleUpdate

SetNillableTalentID sets the "talent" edge to the YouTubeTalent entity by ID if the given value is not nil.

func (*GuildRoleUpdate) SetTalent

func (gru *GuildRoleUpdate) SetTalent(y *YouTubeTalent) *GuildRoleUpdate

SetTalent sets the "talent" edge to the YouTubeTalent entity.

func (*GuildRoleUpdate) SetTalentID

func (gru *GuildRoleUpdate) SetTalentID(id string) *GuildRoleUpdate

SetTalentID sets the "talent" edge to the YouTubeTalent entity by ID.

func (*GuildRoleUpdate) Where

Where appends a list predicates to the GuildRoleUpdate builder.

type GuildRoleUpdateOne

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

GuildRoleUpdateOne is the builder for updating a single GuildRole entity.

func (*GuildRoleUpdateOne) AddUserMembershipIDs

func (gruo *GuildRoleUpdateOne) AddUserMembershipIDs(ids ...int) *GuildRoleUpdateOne

AddUserMembershipIDs adds the "user_memberships" edge to the UserMembership entity by IDs.

func (*GuildRoleUpdateOne) AddUserMemberships

func (gruo *GuildRoleUpdateOne) AddUserMemberships(u ...*UserMembership) *GuildRoleUpdateOne

AddUserMemberships adds the "user_memberships" edges to the UserMembership entity.

func (*GuildRoleUpdateOne) ClearGuild

func (gruo *GuildRoleUpdateOne) ClearGuild() *GuildRoleUpdateOne

ClearGuild clears the "guild" edge to the Guild entity.

func (*GuildRoleUpdateOne) ClearTalent

func (gruo *GuildRoleUpdateOne) ClearTalent() *GuildRoleUpdateOne

ClearTalent clears the "talent" edge to the YouTubeTalent entity.

func (*GuildRoleUpdateOne) ClearUserMemberships

func (gruo *GuildRoleUpdateOne) ClearUserMemberships() *GuildRoleUpdateOne

ClearUserMemberships clears all "user_memberships" edges to the UserMembership entity.

func (*GuildRoleUpdateOne) Exec

func (gruo *GuildRoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GuildRoleUpdateOne) ExecX

func (gruo *GuildRoleUpdateOne) ExecX(ctx context.Context)

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

func (*GuildRoleUpdateOne) Mutation

func (gruo *GuildRoleUpdateOne) Mutation() *GuildRoleMutation

Mutation returns the GuildRoleMutation object of the builder.

func (*GuildRoleUpdateOne) RemoveUserMembershipIDs

func (gruo *GuildRoleUpdateOne) RemoveUserMembershipIDs(ids ...int) *GuildRoleUpdateOne

RemoveUserMembershipIDs removes the "user_memberships" edge to UserMembership entities by IDs.

func (*GuildRoleUpdateOne) RemoveUserMemberships

func (gruo *GuildRoleUpdateOne) RemoveUserMemberships(u ...*UserMembership) *GuildRoleUpdateOne

RemoveUserMemberships removes "user_memberships" edges to UserMembership entities.

func (*GuildRoleUpdateOne) Save

func (gruo *GuildRoleUpdateOne) Save(ctx context.Context) (*GuildRole, error)

Save executes the query and returns the updated GuildRole entity.

func (*GuildRoleUpdateOne) SaveX

func (gruo *GuildRoleUpdateOne) SaveX(ctx context.Context) *GuildRole

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

func (*GuildRoleUpdateOne) Select

func (gruo *GuildRoleUpdateOne) Select(field string, fields ...string) *GuildRoleUpdateOne

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

func (*GuildRoleUpdateOne) SetGuild

func (gruo *GuildRoleUpdateOne) SetGuild(g *Guild) *GuildRoleUpdateOne

SetGuild sets the "guild" edge to the Guild entity.

func (*GuildRoleUpdateOne) SetGuildID

func (gruo *GuildRoleUpdateOne) SetGuildID(id uint64) *GuildRoleUpdateOne

SetGuildID sets the "guild" edge to the Guild entity by ID.

func (*GuildRoleUpdateOne) SetLastUpdated

func (gruo *GuildRoleUpdateOne) SetLastUpdated(t time.Time) *GuildRoleUpdateOne

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleUpdateOne) SetName

func (gruo *GuildRoleUpdateOne) SetName(s string) *GuildRoleUpdateOne

SetName sets the "name" field.

func (*GuildRoleUpdateOne) SetNillableLastUpdated

func (gruo *GuildRoleUpdateOne) SetNillableLastUpdated(t *time.Time) *GuildRoleUpdateOne

SetNillableLastUpdated sets the "last_updated" field if the given value is not nil.

func (*GuildRoleUpdateOne) SetNillableTalentID

func (gruo *GuildRoleUpdateOne) SetNillableTalentID(id *string) *GuildRoleUpdateOne

SetNillableTalentID sets the "talent" edge to the YouTubeTalent entity by ID if the given value is not nil.

func (*GuildRoleUpdateOne) SetTalent

SetTalent sets the "talent" edge to the YouTubeTalent entity.

func (*GuildRoleUpdateOne) SetTalentID

func (gruo *GuildRoleUpdateOne) SetTalentID(id string) *GuildRoleUpdateOne

SetTalentID sets the "talent" edge to the YouTubeTalent entity by ID.

func (*GuildRoleUpdateOne) Where

Where appends a list predicates to the GuildRoleUpdate builder.

type GuildRoleUpsert

type GuildRoleUpsert struct {
	*sql.UpdateSet
}

GuildRoleUpsert is the "OnConflict" setter.

func (*GuildRoleUpsert) SetLastUpdated

func (u *GuildRoleUpsert) SetLastUpdated(v time.Time) *GuildRoleUpsert

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleUpsert) SetName

func (u *GuildRoleUpsert) SetName(v string) *GuildRoleUpsert

SetName sets the "name" field.

func (*GuildRoleUpsert) UpdateLastUpdated

func (u *GuildRoleUpsert) UpdateLastUpdated() *GuildRoleUpsert

UpdateLastUpdated sets the "last_updated" field to the value that was provided on create.

func (*GuildRoleUpsert) UpdateName

func (u *GuildRoleUpsert) UpdateName() *GuildRoleUpsert

UpdateName sets the "name" field to the value that was provided on create.

type GuildRoleUpsertBulk

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

GuildRoleUpsertBulk is the builder for "upsert"-ing a bulk of GuildRole nodes.

func (*GuildRoleUpsertBulk) DoNothing

func (u *GuildRoleUpsertBulk) DoNothing() *GuildRoleUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GuildRoleUpsertBulk) Exec

Exec executes the query.

func (*GuildRoleUpsertBulk) ExecX

func (u *GuildRoleUpsertBulk) ExecX(ctx context.Context)

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

func (*GuildRoleUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GuildRole.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GuildRoleUpsertBulk) SetLastUpdated

func (u *GuildRoleUpsertBulk) SetLastUpdated(v time.Time) *GuildRoleUpsertBulk

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleUpsertBulk) SetName

SetName sets the "name" field.

func (*GuildRoleUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the GuildRoleCreateBulk.OnConflict documentation for more info.

func (*GuildRoleUpsertBulk) UpdateLastUpdated

func (u *GuildRoleUpsertBulk) UpdateLastUpdated() *GuildRoleUpsertBulk

UpdateLastUpdated sets the "last_updated" field to the value that was provided on create.

func (*GuildRoleUpsertBulk) UpdateName

func (u *GuildRoleUpsertBulk) UpdateName() *GuildRoleUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*GuildRoleUpsertBulk) UpdateNewValues

func (u *GuildRoleUpsertBulk) UpdateNewValues() *GuildRoleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GuildRole.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(guildrole.FieldID)
		}),
	).
	Exec(ctx)

type GuildRoleUpsertOne

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

GuildRoleUpsertOne is the builder for "upsert"-ing

one GuildRole node.

func (*GuildRoleUpsertOne) DoNothing

func (u *GuildRoleUpsertOne) DoNothing() *GuildRoleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GuildRoleUpsertOne) Exec

func (u *GuildRoleUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildRoleUpsertOne) ExecX

func (u *GuildRoleUpsertOne) ExecX(ctx context.Context)

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

func (*GuildRoleUpsertOne) ID

func (u *GuildRoleUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GuildRoleUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*GuildRoleUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GuildRole.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GuildRoleUpsertOne) SetLastUpdated

func (u *GuildRoleUpsertOne) SetLastUpdated(v time.Time) *GuildRoleUpsertOne

SetLastUpdated sets the "last_updated" field.

func (*GuildRoleUpsertOne) SetName

SetName sets the "name" field.

func (*GuildRoleUpsertOne) Update

func (u *GuildRoleUpsertOne) Update(set func(*GuildRoleUpsert)) *GuildRoleUpsertOne

Update allows overriding fields `UPDATE` values. See the GuildRoleCreate.OnConflict documentation for more info.

func (*GuildRoleUpsertOne) UpdateLastUpdated

func (u *GuildRoleUpsertOne) UpdateLastUpdated() *GuildRoleUpsertOne

UpdateLastUpdated sets the "last_updated" field to the value that was provided on create.

func (*GuildRoleUpsertOne) UpdateName

func (u *GuildRoleUpsertOne) UpdateName() *GuildRoleUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*GuildRoleUpsertOne) UpdateNewValues

func (u *GuildRoleUpsertOne) UpdateNewValues() *GuildRoleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.GuildRole.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(guildrole.FieldID)
		}),
	).
	Exec(ctx)

type GuildRoles

type GuildRoles []*GuildRole

GuildRoles is a parsable slice of GuildRole.

type GuildSelect

type GuildSelect struct {
	*GuildQuery
	// contains filtered or unexported fields
}

GuildSelect is the builder for selecting fields of Guild entities.

func (*GuildSelect) Aggregate

func (gs *GuildSelect) Aggregate(fns ...AggregateFunc) *GuildSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GuildSelect) Bool

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

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

func (*GuildSelect) BoolX

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

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

func (*GuildSelect) Bools

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

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

func (*GuildSelect) BoolsX

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

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

func (*GuildSelect) Float64

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

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

func (*GuildSelect) Float64X

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

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

func (*GuildSelect) Float64s

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

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

func (*GuildSelect) Float64sX

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

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

func (*GuildSelect) Int

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

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

func (*GuildSelect) IntX

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

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

func (*GuildSelect) Ints

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

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

func (*GuildSelect) IntsX

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

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

func (*GuildSelect) Scan

func (gs *GuildSelect) Scan(ctx context.Context, v any) error

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

func (*GuildSelect) ScanX

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

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

func (*GuildSelect) String

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

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

func (*GuildSelect) StringX

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

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

func (*GuildSelect) Strings

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

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

func (*GuildSelect) StringsX

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

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

type GuildUpdate

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

GuildUpdate is the builder for updating Guild entities.

func (*GuildUpdate) AddAdminIDs

func (gu *GuildUpdate) AddAdminIDs(ids ...uint64) *GuildUpdate

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*GuildUpdate) AddAdmins

func (gu *GuildUpdate) AddAdmins(u ...*User) *GuildUpdate

AddAdmins adds the "admins" edges to the User entity.

func (*GuildUpdate) AddAuditChannel

func (gu *GuildUpdate) AddAuditChannel(u int64) *GuildUpdate

AddAuditChannel adds u to the "audit_channel" field.

func (*GuildUpdate) AddMemberIDs

func (gu *GuildUpdate) AddMemberIDs(ids ...uint64) *GuildUpdate

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*GuildUpdate) AddMembers

func (gu *GuildUpdate) AddMembers(u ...*User) *GuildUpdate

AddMembers adds the "members" edges to the User entity.

func (*GuildUpdate) AddRoleIDs

func (gu *GuildUpdate) AddRoleIDs(ids ...uint64) *GuildUpdate

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

func (*GuildUpdate) AddRoles

func (gu *GuildUpdate) AddRoles(g ...*GuildRole) *GuildUpdate

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

func (*GuildUpdate) AddYoutubeTalentIDs

func (gu *GuildUpdate) AddYoutubeTalentIDs(ids ...string) *GuildUpdate

AddYoutubeTalentIDs adds the "youtube_talents" edge to the YouTubeTalent entity by IDs.

func (*GuildUpdate) AddYoutubeTalents

func (gu *GuildUpdate) AddYoutubeTalents(y ...*YouTubeTalent) *GuildUpdate

AddYoutubeTalents adds the "youtube_talents" edges to the YouTubeTalent entity.

func (*GuildUpdate) AppendAdminSnowflakes

func (gu *GuildUpdate) AppendAdminSnowflakes(u []uint64) *GuildUpdate

AppendAdminSnowflakes appends u to the "admin_snowflakes" field.

func (*GuildUpdate) AppendModeratorSnowflakes

func (gu *GuildUpdate) AppendModeratorSnowflakes(u []uint64) *GuildUpdate

AppendModeratorSnowflakes appends u to the "moderator_snowflakes" field.

func (*GuildUpdate) ClearAdmins

func (gu *GuildUpdate) ClearAdmins() *GuildUpdate

ClearAdmins clears all "admins" edges to the User entity.

func (*GuildUpdate) ClearAuditChannel

func (gu *GuildUpdate) ClearAuditChannel() *GuildUpdate

ClearAuditChannel clears the value of the "audit_channel" field.

func (*GuildUpdate) ClearIconHash

func (gu *GuildUpdate) ClearIconHash() *GuildUpdate

ClearIconHash clears the value of the "icon_hash" field.

func (*GuildUpdate) ClearMembers

func (gu *GuildUpdate) ClearMembers() *GuildUpdate

ClearMembers clears all "members" edges to the User entity.

func (*GuildUpdate) ClearModeratorSnowflakes

func (gu *GuildUpdate) ClearModeratorSnowflakes() *GuildUpdate

ClearModeratorSnowflakes clears the value of the "moderator_snowflakes" field.

func (*GuildUpdate) ClearRoles

func (gu *GuildUpdate) ClearRoles() *GuildUpdate

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

func (*GuildUpdate) ClearSettings

func (gu *GuildUpdate) ClearSettings() *GuildUpdate

ClearSettings clears the value of the "settings" field.

func (*GuildUpdate) ClearYoutubeTalents

func (gu *GuildUpdate) ClearYoutubeTalents() *GuildUpdate

ClearYoutubeTalents clears all "youtube_talents" edges to the YouTubeTalent entity.

func (*GuildUpdate) Exec

func (gu *GuildUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildUpdate) ExecX

func (gu *GuildUpdate) ExecX(ctx context.Context)

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

func (*GuildUpdate) Mutation

func (gu *GuildUpdate) Mutation() *GuildMutation

Mutation returns the GuildMutation object of the builder.

func (*GuildUpdate) RemoveAdminIDs

func (gu *GuildUpdate) RemoveAdminIDs(ids ...uint64) *GuildUpdate

RemoveAdminIDs removes the "admins" edge to User entities by IDs.

func (*GuildUpdate) RemoveAdmins

func (gu *GuildUpdate) RemoveAdmins(u ...*User) *GuildUpdate

RemoveAdmins removes "admins" edges to User entities.

func (*GuildUpdate) RemoveMemberIDs

func (gu *GuildUpdate) RemoveMemberIDs(ids ...uint64) *GuildUpdate

RemoveMemberIDs removes the "members" edge to User entities by IDs.

func (*GuildUpdate) RemoveMembers

func (gu *GuildUpdate) RemoveMembers(u ...*User) *GuildUpdate

RemoveMembers removes "members" edges to User entities.

func (*GuildUpdate) RemoveRoleIDs

func (gu *GuildUpdate) RemoveRoleIDs(ids ...uint64) *GuildUpdate

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

func (*GuildUpdate) RemoveRoles

func (gu *GuildUpdate) RemoveRoles(g ...*GuildRole) *GuildUpdate

RemoveRoles removes "roles" edges to GuildRole entities.

func (*GuildUpdate) RemoveYoutubeTalentIDs

func (gu *GuildUpdate) RemoveYoutubeTalentIDs(ids ...string) *GuildUpdate

RemoveYoutubeTalentIDs removes the "youtube_talents" edge to YouTubeTalent entities by IDs.

func (*GuildUpdate) RemoveYoutubeTalents

func (gu *GuildUpdate) RemoveYoutubeTalents(y ...*YouTubeTalent) *GuildUpdate

RemoveYoutubeTalents removes "youtube_talents" edges to YouTubeTalent entities.

func (*GuildUpdate) Save

func (gu *GuildUpdate) Save(ctx context.Context) (int, error)

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

func (*GuildUpdate) SaveX

func (gu *GuildUpdate) SaveX(ctx context.Context) int

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

func (*GuildUpdate) SetAdminSnowflakes

func (gu *GuildUpdate) SetAdminSnowflakes(u []uint64) *GuildUpdate

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildUpdate) SetAuditChannel

func (gu *GuildUpdate) SetAuditChannel(u uint64) *GuildUpdate

SetAuditChannel sets the "audit_channel" field.

func (*GuildUpdate) SetIconHash

func (gu *GuildUpdate) SetIconHash(s string) *GuildUpdate

SetIconHash sets the "icon_hash" field.

func (*GuildUpdate) SetLanguage

func (gu *GuildUpdate) SetLanguage(value guild.Language) *GuildUpdate

SetLanguage sets the "language" field.

func (*GuildUpdate) SetModeratorSnowflakes

func (gu *GuildUpdate) SetModeratorSnowflakes(u []uint64) *GuildUpdate

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildUpdate) SetName

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

SetName sets the "name" field.

func (*GuildUpdate) SetNillableAuditChannel

func (gu *GuildUpdate) SetNillableAuditChannel(u *uint64) *GuildUpdate

SetNillableAuditChannel sets the "audit_channel" field if the given value is not nil.

func (*GuildUpdate) SetNillableIconHash

func (gu *GuildUpdate) SetNillableIconHash(s *string) *GuildUpdate

SetNillableIconHash sets the "icon_hash" field if the given value is not nil.

func (*GuildUpdate) SetNillableLanguage

func (gu *GuildUpdate) SetNillableLanguage(value *guild.Language) *GuildUpdate

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*GuildUpdate) SetSettings

func (gu *GuildUpdate) SetSettings(ss *schema.GuildSettings) *GuildUpdate

SetSettings sets the "settings" field.

func (*GuildUpdate) Where

func (gu *GuildUpdate) Where(ps ...predicate.Guild) *GuildUpdate

Where appends a list predicates to the GuildUpdate builder.

type GuildUpdateOne

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

GuildUpdateOne is the builder for updating a single Guild entity.

func (*GuildUpdateOne) AddAdminIDs

func (guo *GuildUpdateOne) AddAdminIDs(ids ...uint64) *GuildUpdateOne

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*GuildUpdateOne) AddAdmins

func (guo *GuildUpdateOne) AddAdmins(u ...*User) *GuildUpdateOne

AddAdmins adds the "admins" edges to the User entity.

func (*GuildUpdateOne) AddAuditChannel

func (guo *GuildUpdateOne) AddAuditChannel(u int64) *GuildUpdateOne

AddAuditChannel adds u to the "audit_channel" field.

func (*GuildUpdateOne) AddMemberIDs

func (guo *GuildUpdateOne) AddMemberIDs(ids ...uint64) *GuildUpdateOne

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*GuildUpdateOne) AddMembers

func (guo *GuildUpdateOne) AddMembers(u ...*User) *GuildUpdateOne

AddMembers adds the "members" edges to the User entity.

func (*GuildUpdateOne) AddRoleIDs

func (guo *GuildUpdateOne) AddRoleIDs(ids ...uint64) *GuildUpdateOne

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

func (*GuildUpdateOne) AddRoles

func (guo *GuildUpdateOne) AddRoles(g ...*GuildRole) *GuildUpdateOne

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

func (*GuildUpdateOne) AddYoutubeTalentIDs

func (guo *GuildUpdateOne) AddYoutubeTalentIDs(ids ...string) *GuildUpdateOne

AddYoutubeTalentIDs adds the "youtube_talents" edge to the YouTubeTalent entity by IDs.

func (*GuildUpdateOne) AddYoutubeTalents

func (guo *GuildUpdateOne) AddYoutubeTalents(y ...*YouTubeTalent) *GuildUpdateOne

AddYoutubeTalents adds the "youtube_talents" edges to the YouTubeTalent entity.

func (*GuildUpdateOne) AppendAdminSnowflakes

func (guo *GuildUpdateOne) AppendAdminSnowflakes(u []uint64) *GuildUpdateOne

AppendAdminSnowflakes appends u to the "admin_snowflakes" field.

func (*GuildUpdateOne) AppendModeratorSnowflakes

func (guo *GuildUpdateOne) AppendModeratorSnowflakes(u []uint64) *GuildUpdateOne

AppendModeratorSnowflakes appends u to the "moderator_snowflakes" field.

func (*GuildUpdateOne) ClearAdmins

func (guo *GuildUpdateOne) ClearAdmins() *GuildUpdateOne

ClearAdmins clears all "admins" edges to the User entity.

func (*GuildUpdateOne) ClearAuditChannel

func (guo *GuildUpdateOne) ClearAuditChannel() *GuildUpdateOne

ClearAuditChannel clears the value of the "audit_channel" field.

func (*GuildUpdateOne) ClearIconHash

func (guo *GuildUpdateOne) ClearIconHash() *GuildUpdateOne

ClearIconHash clears the value of the "icon_hash" field.

func (*GuildUpdateOne) ClearMembers

func (guo *GuildUpdateOne) ClearMembers() *GuildUpdateOne

ClearMembers clears all "members" edges to the User entity.

func (*GuildUpdateOne) ClearModeratorSnowflakes

func (guo *GuildUpdateOne) ClearModeratorSnowflakes() *GuildUpdateOne

ClearModeratorSnowflakes clears the value of the "moderator_snowflakes" field.

func (*GuildUpdateOne) ClearRoles

func (guo *GuildUpdateOne) ClearRoles() *GuildUpdateOne

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

func (*GuildUpdateOne) ClearSettings

func (guo *GuildUpdateOne) ClearSettings() *GuildUpdateOne

ClearSettings clears the value of the "settings" field.

func (*GuildUpdateOne) ClearYoutubeTalents

func (guo *GuildUpdateOne) ClearYoutubeTalents() *GuildUpdateOne

ClearYoutubeTalents clears all "youtube_talents" edges to the YouTubeTalent entity.

func (*GuildUpdateOne) Exec

func (guo *GuildUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GuildUpdateOne) ExecX

func (guo *GuildUpdateOne) ExecX(ctx context.Context)

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

func (*GuildUpdateOne) Mutation

func (guo *GuildUpdateOne) Mutation() *GuildMutation

Mutation returns the GuildMutation object of the builder.

func (*GuildUpdateOne) RemoveAdminIDs

func (guo *GuildUpdateOne) RemoveAdminIDs(ids ...uint64) *GuildUpdateOne

RemoveAdminIDs removes the "admins" edge to User entities by IDs.

func (*GuildUpdateOne) RemoveAdmins

func (guo *GuildUpdateOne) RemoveAdmins(u ...*User) *GuildUpdateOne

RemoveAdmins removes "admins" edges to User entities.

func (*GuildUpdateOne) RemoveMemberIDs

func (guo *GuildUpdateOne) RemoveMemberIDs(ids ...uint64) *GuildUpdateOne

RemoveMemberIDs removes the "members" edge to User entities by IDs.

func (*GuildUpdateOne) RemoveMembers

func (guo *GuildUpdateOne) RemoveMembers(u ...*User) *GuildUpdateOne

RemoveMembers removes "members" edges to User entities.

func (*GuildUpdateOne) RemoveRoleIDs

func (guo *GuildUpdateOne) RemoveRoleIDs(ids ...uint64) *GuildUpdateOne

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

func (*GuildUpdateOne) RemoveRoles

func (guo *GuildUpdateOne) RemoveRoles(g ...*GuildRole) *GuildUpdateOne

RemoveRoles removes "roles" edges to GuildRole entities.

func (*GuildUpdateOne) RemoveYoutubeTalentIDs

func (guo *GuildUpdateOne) RemoveYoutubeTalentIDs(ids ...string) *GuildUpdateOne

RemoveYoutubeTalentIDs removes the "youtube_talents" edge to YouTubeTalent entities by IDs.

func (*GuildUpdateOne) RemoveYoutubeTalents

func (guo *GuildUpdateOne) RemoveYoutubeTalents(y ...*YouTubeTalent) *GuildUpdateOne

RemoveYoutubeTalents removes "youtube_talents" edges to YouTubeTalent entities.

func (*GuildUpdateOne) Save

func (guo *GuildUpdateOne) Save(ctx context.Context) (*Guild, error)

Save executes the query and returns the updated Guild entity.

func (*GuildUpdateOne) SaveX

func (guo *GuildUpdateOne) SaveX(ctx context.Context) *Guild

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

func (*GuildUpdateOne) Select

func (guo *GuildUpdateOne) Select(field string, fields ...string) *GuildUpdateOne

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

func (*GuildUpdateOne) SetAdminSnowflakes

func (guo *GuildUpdateOne) SetAdminSnowflakes(u []uint64) *GuildUpdateOne

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildUpdateOne) SetAuditChannel

func (guo *GuildUpdateOne) SetAuditChannel(u uint64) *GuildUpdateOne

SetAuditChannel sets the "audit_channel" field.

func (*GuildUpdateOne) SetIconHash

func (guo *GuildUpdateOne) SetIconHash(s string) *GuildUpdateOne

SetIconHash sets the "icon_hash" field.

func (*GuildUpdateOne) SetLanguage

func (guo *GuildUpdateOne) SetLanguage(gu guild.Language) *GuildUpdateOne

SetLanguage sets the "language" field.

func (*GuildUpdateOne) SetModeratorSnowflakes

func (guo *GuildUpdateOne) SetModeratorSnowflakes(u []uint64) *GuildUpdateOne

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildUpdateOne) SetName

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

SetName sets the "name" field.

func (*GuildUpdateOne) SetNillableAuditChannel

func (guo *GuildUpdateOne) SetNillableAuditChannel(u *uint64) *GuildUpdateOne

SetNillableAuditChannel sets the "audit_channel" field if the given value is not nil.

func (*GuildUpdateOne) SetNillableIconHash

func (guo *GuildUpdateOne) SetNillableIconHash(s *string) *GuildUpdateOne

SetNillableIconHash sets the "icon_hash" field if the given value is not nil.

func (*GuildUpdateOne) SetNillableLanguage

func (guo *GuildUpdateOne) SetNillableLanguage(gu *guild.Language) *GuildUpdateOne

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*GuildUpdateOne) SetSettings

func (guo *GuildUpdateOne) SetSettings(ss *schema.GuildSettings) *GuildUpdateOne

SetSettings sets the "settings" field.

func (*GuildUpdateOne) Where

func (guo *GuildUpdateOne) Where(ps ...predicate.Guild) *GuildUpdateOne

Where appends a list predicates to the GuildUpdate builder.

type GuildUpsert

type GuildUpsert struct {
	*sql.UpdateSet
}

GuildUpsert is the "OnConflict" setter.

func (*GuildUpsert) AddAuditChannel

func (u *GuildUpsert) AddAuditChannel(v uint64) *GuildUpsert

AddAuditChannel adds v to the "audit_channel" field.

func (*GuildUpsert) ClearAuditChannel

func (u *GuildUpsert) ClearAuditChannel() *GuildUpsert

ClearAuditChannel clears the value of the "audit_channel" field.

func (*GuildUpsert) ClearIconHash

func (u *GuildUpsert) ClearIconHash() *GuildUpsert

ClearIconHash clears the value of the "icon_hash" field.

func (*GuildUpsert) ClearModeratorSnowflakes

func (u *GuildUpsert) ClearModeratorSnowflakes() *GuildUpsert

ClearModeratorSnowflakes clears the value of the "moderator_snowflakes" field.

func (*GuildUpsert) ClearSettings

func (u *GuildUpsert) ClearSettings() *GuildUpsert

ClearSettings clears the value of the "settings" field.

func (*GuildUpsert) SetAdminSnowflakes

func (u *GuildUpsert) SetAdminSnowflakes(v []uint64) *GuildUpsert

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildUpsert) SetAuditChannel

func (u *GuildUpsert) SetAuditChannel(v uint64) *GuildUpsert

SetAuditChannel sets the "audit_channel" field.

func (*GuildUpsert) SetIconHash

func (u *GuildUpsert) SetIconHash(v string) *GuildUpsert

SetIconHash sets the "icon_hash" field.

func (*GuildUpsert) SetLanguage

func (u *GuildUpsert) SetLanguage(v guild.Language) *GuildUpsert

SetLanguage sets the "language" field.

func (*GuildUpsert) SetModeratorSnowflakes

func (u *GuildUpsert) SetModeratorSnowflakes(v []uint64) *GuildUpsert

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildUpsert) SetName

func (u *GuildUpsert) SetName(v string) *GuildUpsert

SetName sets the "name" field.

func (*GuildUpsert) SetSettings

func (u *GuildUpsert) SetSettings(v *schema.GuildSettings) *GuildUpsert

SetSettings sets the "settings" field.

func (*GuildUpsert) UpdateAdminSnowflakes

func (u *GuildUpsert) UpdateAdminSnowflakes() *GuildUpsert

UpdateAdminSnowflakes sets the "admin_snowflakes" field to the value that was provided on create.

func (*GuildUpsert) UpdateAuditChannel

func (u *GuildUpsert) UpdateAuditChannel() *GuildUpsert

UpdateAuditChannel sets the "audit_channel" field to the value that was provided on create.

func (*GuildUpsert) UpdateIconHash

func (u *GuildUpsert) UpdateIconHash() *GuildUpsert

UpdateIconHash sets the "icon_hash" field to the value that was provided on create.

func (*GuildUpsert) UpdateLanguage

func (u *GuildUpsert) UpdateLanguage() *GuildUpsert

UpdateLanguage sets the "language" field to the value that was provided on create.

func (*GuildUpsert) UpdateModeratorSnowflakes

func (u *GuildUpsert) UpdateModeratorSnowflakes() *GuildUpsert

UpdateModeratorSnowflakes sets the "moderator_snowflakes" field to the value that was provided on create.

func (*GuildUpsert) UpdateName

func (u *GuildUpsert) UpdateName() *GuildUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*GuildUpsert) UpdateSettings

func (u *GuildUpsert) UpdateSettings() *GuildUpsert

UpdateSettings sets the "settings" field to the value that was provided on create.

type GuildUpsertBulk

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

GuildUpsertBulk is the builder for "upsert"-ing a bulk of Guild nodes.

func (*GuildUpsertBulk) AddAuditChannel

func (u *GuildUpsertBulk) AddAuditChannel(v uint64) *GuildUpsertBulk

AddAuditChannel adds v to the "audit_channel" field.

func (*GuildUpsertBulk) ClearAuditChannel

func (u *GuildUpsertBulk) ClearAuditChannel() *GuildUpsertBulk

ClearAuditChannel clears the value of the "audit_channel" field.

func (*GuildUpsertBulk) ClearIconHash

func (u *GuildUpsertBulk) ClearIconHash() *GuildUpsertBulk

ClearIconHash clears the value of the "icon_hash" field.

func (*GuildUpsertBulk) ClearModeratorSnowflakes

func (u *GuildUpsertBulk) ClearModeratorSnowflakes() *GuildUpsertBulk

ClearModeratorSnowflakes clears the value of the "moderator_snowflakes" field.

func (*GuildUpsertBulk) ClearSettings

func (u *GuildUpsertBulk) ClearSettings() *GuildUpsertBulk

ClearSettings clears the value of the "settings" field.

func (*GuildUpsertBulk) DoNothing

func (u *GuildUpsertBulk) DoNothing() *GuildUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GuildUpsertBulk) Exec

func (u *GuildUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildUpsertBulk) ExecX

func (u *GuildUpsertBulk) ExecX(ctx context.Context)

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

func (*GuildUpsertBulk) Ignore

func (u *GuildUpsertBulk) Ignore() *GuildUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Guild.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GuildUpsertBulk) SetAdminSnowflakes

func (u *GuildUpsertBulk) SetAdminSnowflakes(v []uint64) *GuildUpsertBulk

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildUpsertBulk) SetAuditChannel

func (u *GuildUpsertBulk) SetAuditChannel(v uint64) *GuildUpsertBulk

SetAuditChannel sets the "audit_channel" field.

func (*GuildUpsertBulk) SetIconHash

func (u *GuildUpsertBulk) SetIconHash(v string) *GuildUpsertBulk

SetIconHash sets the "icon_hash" field.

func (*GuildUpsertBulk) SetLanguage

func (u *GuildUpsertBulk) SetLanguage(v guild.Language) *GuildUpsertBulk

SetLanguage sets the "language" field.

func (*GuildUpsertBulk) SetModeratorSnowflakes

func (u *GuildUpsertBulk) SetModeratorSnowflakes(v []uint64) *GuildUpsertBulk

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildUpsertBulk) SetName

func (u *GuildUpsertBulk) SetName(v string) *GuildUpsertBulk

SetName sets the "name" field.

func (*GuildUpsertBulk) SetSettings

SetSettings sets the "settings" field.

func (*GuildUpsertBulk) Update

func (u *GuildUpsertBulk) Update(set func(*GuildUpsert)) *GuildUpsertBulk

Update allows overriding fields `UPDATE` values. See the GuildCreateBulk.OnConflict documentation for more info.

func (*GuildUpsertBulk) UpdateAdminSnowflakes

func (u *GuildUpsertBulk) UpdateAdminSnowflakes() *GuildUpsertBulk

UpdateAdminSnowflakes sets the "admin_snowflakes" field to the value that was provided on create.

func (*GuildUpsertBulk) UpdateAuditChannel

func (u *GuildUpsertBulk) UpdateAuditChannel() *GuildUpsertBulk

UpdateAuditChannel sets the "audit_channel" field to the value that was provided on create.

func (*GuildUpsertBulk) UpdateIconHash

func (u *GuildUpsertBulk) UpdateIconHash() *GuildUpsertBulk

UpdateIconHash sets the "icon_hash" field to the value that was provided on create.

func (*GuildUpsertBulk) UpdateLanguage

func (u *GuildUpsertBulk) UpdateLanguage() *GuildUpsertBulk

UpdateLanguage sets the "language" field to the value that was provided on create.

func (*GuildUpsertBulk) UpdateModeratorSnowflakes

func (u *GuildUpsertBulk) UpdateModeratorSnowflakes() *GuildUpsertBulk

UpdateModeratorSnowflakes sets the "moderator_snowflakes" field to the value that was provided on create.

func (*GuildUpsertBulk) UpdateName

func (u *GuildUpsertBulk) UpdateName() *GuildUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*GuildUpsertBulk) UpdateNewValues

func (u *GuildUpsertBulk) UpdateNewValues() *GuildUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Guild.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(guild.FieldID)
		}),
	).
	Exec(ctx)

func (*GuildUpsertBulk) UpdateSettings

func (u *GuildUpsertBulk) UpdateSettings() *GuildUpsertBulk

UpdateSettings sets the "settings" field to the value that was provided on create.

type GuildUpsertOne

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

GuildUpsertOne is the builder for "upsert"-ing

one Guild node.

func (*GuildUpsertOne) AddAuditChannel

func (u *GuildUpsertOne) AddAuditChannel(v uint64) *GuildUpsertOne

AddAuditChannel adds v to the "audit_channel" field.

func (*GuildUpsertOne) ClearAuditChannel

func (u *GuildUpsertOne) ClearAuditChannel() *GuildUpsertOne

ClearAuditChannel clears the value of the "audit_channel" field.

func (*GuildUpsertOne) ClearIconHash

func (u *GuildUpsertOne) ClearIconHash() *GuildUpsertOne

ClearIconHash clears the value of the "icon_hash" field.

func (*GuildUpsertOne) ClearModeratorSnowflakes

func (u *GuildUpsertOne) ClearModeratorSnowflakes() *GuildUpsertOne

ClearModeratorSnowflakes clears the value of the "moderator_snowflakes" field.

func (*GuildUpsertOne) ClearSettings

func (u *GuildUpsertOne) ClearSettings() *GuildUpsertOne

ClearSettings clears the value of the "settings" field.

func (*GuildUpsertOne) DoNothing

func (u *GuildUpsertOne) DoNothing() *GuildUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GuildUpsertOne) Exec

func (u *GuildUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GuildUpsertOne) ExecX

func (u *GuildUpsertOne) ExecX(ctx context.Context)

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

func (*GuildUpsertOne) ID

func (u *GuildUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GuildUpsertOne) IDX

func (u *GuildUpsertOne) IDX(ctx context.Context) uint64

IDX is like ID, but panics if an error occurs.

func (*GuildUpsertOne) Ignore

func (u *GuildUpsertOne) Ignore() *GuildUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Guild.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GuildUpsertOne) SetAdminSnowflakes

func (u *GuildUpsertOne) SetAdminSnowflakes(v []uint64) *GuildUpsertOne

SetAdminSnowflakes sets the "admin_snowflakes" field.

func (*GuildUpsertOne) SetAuditChannel

func (u *GuildUpsertOne) SetAuditChannel(v uint64) *GuildUpsertOne

SetAuditChannel sets the "audit_channel" field.

func (*GuildUpsertOne) SetIconHash

func (u *GuildUpsertOne) SetIconHash(v string) *GuildUpsertOne

SetIconHash sets the "icon_hash" field.

func (*GuildUpsertOne) SetLanguage

func (u *GuildUpsertOne) SetLanguage(v guild.Language) *GuildUpsertOne

SetLanguage sets the "language" field.

func (*GuildUpsertOne) SetModeratorSnowflakes

func (u *GuildUpsertOne) SetModeratorSnowflakes(v []uint64) *GuildUpsertOne

SetModeratorSnowflakes sets the "moderator_snowflakes" field.

func (*GuildUpsertOne) SetName

func (u *GuildUpsertOne) SetName(v string) *GuildUpsertOne

SetName sets the "name" field.

func (*GuildUpsertOne) SetSettings

func (u *GuildUpsertOne) SetSettings(v *schema.GuildSettings) *GuildUpsertOne

SetSettings sets the "settings" field.

func (*GuildUpsertOne) Update

func (u *GuildUpsertOne) Update(set func(*GuildUpsert)) *GuildUpsertOne

Update allows overriding fields `UPDATE` values. See the GuildCreate.OnConflict documentation for more info.

func (*GuildUpsertOne) UpdateAdminSnowflakes

func (u *GuildUpsertOne) UpdateAdminSnowflakes() *GuildUpsertOne

UpdateAdminSnowflakes sets the "admin_snowflakes" field to the value that was provided on create.

func (*GuildUpsertOne) UpdateAuditChannel

func (u *GuildUpsertOne) UpdateAuditChannel() *GuildUpsertOne

UpdateAuditChannel sets the "audit_channel" field to the value that was provided on create.

func (*GuildUpsertOne) UpdateIconHash

func (u *GuildUpsertOne) UpdateIconHash() *GuildUpsertOne

UpdateIconHash sets the "icon_hash" field to the value that was provided on create.

func (*GuildUpsertOne) UpdateLanguage

func (u *GuildUpsertOne) UpdateLanguage() *GuildUpsertOne

UpdateLanguage sets the "language" field to the value that was provided on create.

func (*GuildUpsertOne) UpdateModeratorSnowflakes

func (u *GuildUpsertOne) UpdateModeratorSnowflakes() *GuildUpsertOne

UpdateModeratorSnowflakes sets the "moderator_snowflakes" field to the value that was provided on create.

func (*GuildUpsertOne) UpdateName

func (u *GuildUpsertOne) UpdateName() *GuildUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*GuildUpsertOne) UpdateNewValues

func (u *GuildUpsertOne) UpdateNewValues() *GuildUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Guild.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(guild.FieldID)
		}),
	).
	Exec(ctx)

func (*GuildUpsertOne) UpdateSettings

func (u *GuildUpsertOne) UpdateSettings() *GuildUpsertOne

UpdateSettings sets the "settings" field to the value that was provided on create.

type Guilds

type Guilds []*Guild

Guilds is a parsable slice of Guild.

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

	// Guild is the client for interacting with the Guild builders.
	Guild *GuildClient
	// GuildRole is the client for interacting with the GuildRole builders.
	GuildRole *GuildRoleClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserMembership is the client for interacting with the UserMembership builders.
	UserMembership *UserMembershipClient
	// YouTubeTalent is the client for interacting with the YouTubeTalent builders.
	YouTubeTalent *YouTubeTalentClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	// Discord user snowflake
	ID uint64 `json:"id,omitempty"`
	// Username + discriminator
	FullName string `json:"full_name,omitempty"`
	// AvatarHash holds the value of the "avatar_hash" field.
	AvatarHash string `json:"avatar_hash,omitempty"`
	// Timestamp of last membership check
	LastCheck time.Time `json:"last_check,omitempty"`
	// user's YouTube channel ID
	YoutubeID *string `json:"youtube_id,omitempty"`
	// YoutubeToken holds the value of the "youtube_token" field.
	YoutubeToken *oauth2.Token `json:"youtube_token,omitempty"`
	// DiscordToken holds the value of the "discord_token" field.
	DiscordToken *oauth2.Token `json:"discord_token,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryGuilds

func (u *User) QueryGuilds() *GuildQuery

QueryGuilds queries the "guilds" edge of the User entity.

func (*User) QueryGuildsAdmin

func (u *User) QueryGuildsAdmin() *GuildQuery

QueryGuildsAdmin queries the "guilds_admin" edge of the User entity.

func (*User) QueryMemberships

func (u *User) QueryMemberships() *UserMembershipQuery

QueryMemberships queries the "memberships" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

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

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uint64) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uint64) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryGuilds

func (c *UserClient) QueryGuilds(u *User) *GuildQuery

QueryGuilds queries the guilds edge of a User.

func (*UserClient) QueryGuildsAdmin

func (c *UserClient) QueryGuildsAdmin(u *User) *GuildQuery

QueryGuildsAdmin queries the guilds_admin edge of a User.

func (*UserClient) QueryMemberships

func (c *UserClient) QueryMemberships(u *User) *UserMembershipQuery

QueryMemberships queries the memberships edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uint64) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddGuildIDs

func (uc *UserCreate) AddGuildIDs(ids ...uint64) *UserCreate

AddGuildIDs adds the "guilds" edge to the Guild entity by IDs.

func (*UserCreate) AddGuilds

func (uc *UserCreate) AddGuilds(g ...*Guild) *UserCreate

AddGuilds adds the "guilds" edges to the Guild entity.

func (*UserCreate) AddGuildsAdmin

func (uc *UserCreate) AddGuildsAdmin(g ...*Guild) *UserCreate

AddGuildsAdmin adds the "guilds_admin" edges to the Guild entity.

func (*UserCreate) AddGuildsAdminIDs

func (uc *UserCreate) AddGuildsAdminIDs(ids ...uint64) *UserCreate

AddGuildsAdminIDs adds the "guilds_admin" edge to the Guild entity by IDs.

func (*UserCreate) AddMembershipIDs

func (uc *UserCreate) AddMembershipIDs(ids ...int) *UserCreate

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by IDs.

func (*UserCreate) AddMemberships

func (uc *UserCreate) AddMemberships(u ...*UserMembership) *UserCreate

AddMemberships adds the "memberships" edges to the UserMembership entity.

func (*UserCreate) Exec

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

Exec executes the query.

func (*UserCreate) ExecX

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

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetFullName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetFullName(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) Save

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

Save creates the User in the database.

func (*UserCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAvatarHash

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

SetAvatarHash sets the "avatar_hash" field.

func (*UserCreate) SetDiscordToken

func (uc *UserCreate) SetDiscordToken(o *oauth2.Token) *UserCreate

SetDiscordToken sets the "discord_token" field.

func (*UserCreate) SetFullName

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

SetFullName sets the "full_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uint64) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetLastCheck

func (uc *UserCreate) SetLastCheck(t time.Time) *UserCreate

SetLastCheck sets the "last_check" field.

func (*UserCreate) SetNillableLastCheck

func (uc *UserCreate) SetNillableLastCheck(t *time.Time) *UserCreate

SetNillableLastCheck sets the "last_check" field if the given value is not nil.

func (*UserCreate) SetNillableYoutubeID

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

SetNillableYoutubeID sets the "youtube_id" field if the given value is not nil.

func (*UserCreate) SetYoutubeID

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

SetYoutubeID sets the "youtube_id" field.

func (*UserCreate) SetYoutubeToken

func (uc *UserCreate) SetYoutubeToken(o *oauth2.Token) *UserCreate

SetYoutubeToken sets the "youtube_token" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

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

Exec executes the query.

func (*UserCreateBulk) ExecX

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

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

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetFullName(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) Save

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

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

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

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

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

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

func (*UserDelete) ExecX

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

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

func (*UserDelete) Where

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

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

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

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

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

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

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Guild that this user has joined
	Guilds []*Guild `json:"guilds,omitempty"`
	// GuildsAdmin holds the value of the guilds_admin edge.
	GuildsAdmin []*Guild `json:"guilds_admin,omitempty"`
	// Memberships holds the value of the memberships edge.
	Memberships []*UserMembership `json:"memberships,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) GuildsAdminOrErr

func (e UserEdges) GuildsAdminOrErr() ([]*Guild, error)

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

func (UserEdges) GuildsOrErr

func (e UserEdges) GuildsOrErr() ([]*Guild, error)

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

func (UserEdges) MembershipsOrErr

func (e UserEdges) MembershipsOrErr() ([]*UserMembership, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

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

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserMembership

type UserMembership struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// FirstFailed holds the value of the "first_failed" field.
	FirstFailed time.Time `json:"first_failed,omitempty"`
	// LastVerified holds the value of the "last_verified" field.
	LastVerified time.Time `json:"last_verified,omitempty"`
	// FailCount holds the value of the "fail_count" field.
	FailCount int `json:"fail_count,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserMembershipQuery when eager-loading is set.
	Edges UserMembershipEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserMembership is the model entity for the UserMembership schema.

func (*UserMembership) QueryRoles

func (um *UserMembership) QueryRoles() *GuildRoleQuery

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

func (*UserMembership) QueryUser

func (um *UserMembership) QueryUser() *UserQuery

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

func (*UserMembership) QueryYoutubeTalent

func (um *UserMembership) QueryYoutubeTalent() *YouTubeTalentQuery

QueryYoutubeTalent queries the "youtube_talent" edge of the UserMembership entity.

func (*UserMembership) String

func (um *UserMembership) String() string

String implements the fmt.Stringer.

func (*UserMembership) Unwrap

func (um *UserMembership) Unwrap() *UserMembership

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

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

func (*UserMembership) Value

func (um *UserMembership) Value(name string) (ent.Value, error)

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

type UserMembershipClient

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

UserMembershipClient is a client for the UserMembership schema.

func NewUserMembershipClient

func NewUserMembershipClient(c config) *UserMembershipClient

NewUserMembershipClient returns a client for the UserMembership from the given config.

func (*UserMembershipClient) Create

Create returns a builder for creating a UserMembership entity.

func (*UserMembershipClient) CreateBulk

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

func (*UserMembershipClient) Delete

Delete returns a delete builder for UserMembership.

func (*UserMembershipClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserMembershipClient) DeleteOneID

func (c *UserMembershipClient) DeleteOneID(id int) *UserMembershipDeleteOne

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

func (*UserMembershipClient) Get

Get returns a UserMembership entity by its id.

func (*UserMembershipClient) GetX

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

func (*UserMembershipClient) Hooks

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

Hooks returns the client hooks.

func (*UserMembershipClient) Intercept

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

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

func (*UserMembershipClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserMembershipClient) Query

Query returns a query builder for UserMembership.

func (*UserMembershipClient) QueryRoles

QueryRoles queries the roles edge of a UserMembership.

func (*UserMembershipClient) QueryUser

func (c *UserMembershipClient) QueryUser(um *UserMembership) *UserQuery

QueryUser queries the user edge of a UserMembership.

func (*UserMembershipClient) QueryYoutubeTalent

func (c *UserMembershipClient) QueryYoutubeTalent(um *UserMembership) *YouTubeTalentQuery

QueryYoutubeTalent queries the youtube_talent edge of a UserMembership.

func (*UserMembershipClient) Update

Update returns an update builder for UserMembership.

func (*UserMembershipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserMembershipClient) UpdateOneID

func (c *UserMembershipClient) UpdateOneID(id int) *UserMembershipUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserMembershipClient) Use

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

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

type UserMembershipCreate

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

UserMembershipCreate is the builder for creating a UserMembership entity.

func (*UserMembershipCreate) AddRoleIDs

func (umc *UserMembershipCreate) AddRoleIDs(ids ...uint64) *UserMembershipCreate

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

func (*UserMembershipCreate) AddRoles

func (umc *UserMembershipCreate) AddRoles(g ...*GuildRole) *UserMembershipCreate

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

func (*UserMembershipCreate) Exec

func (umc *UserMembershipCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserMembershipCreate) ExecX

func (umc *UserMembershipCreate) ExecX(ctx context.Context)

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

func (*UserMembershipCreate) Mutation

Mutation returns the UserMembershipMutation object of the builder.

func (*UserMembershipCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserMembership.Create().
	SetFirstFailed(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserMembershipUpsert) {
		SetFirstFailed(v+v).
	}).
	Exec(ctx)

func (*UserMembershipCreate) OnConflictColumns

func (umc *UserMembershipCreate) OnConflictColumns(columns ...string) *UserMembershipUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserMembership.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserMembershipCreate) Save

Save creates the UserMembership in the database.

func (*UserMembershipCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*UserMembershipCreate) SetFailCount

func (umc *UserMembershipCreate) SetFailCount(i int) *UserMembershipCreate

SetFailCount sets the "fail_count" field.

func (*UserMembershipCreate) SetFirstFailed

func (umc *UserMembershipCreate) SetFirstFailed(t time.Time) *UserMembershipCreate

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipCreate) SetLastVerified

func (umc *UserMembershipCreate) SetLastVerified(t time.Time) *UserMembershipCreate

SetLastVerified sets the "last_verified" field.

func (*UserMembershipCreate) SetNillableFailCount

func (umc *UserMembershipCreate) SetNillableFailCount(i *int) *UserMembershipCreate

SetNillableFailCount sets the "fail_count" field if the given value is not nil.

func (*UserMembershipCreate) SetNillableFirstFailed

func (umc *UserMembershipCreate) SetNillableFirstFailed(t *time.Time) *UserMembershipCreate

SetNillableFirstFailed sets the "first_failed" field if the given value is not nil.

func (*UserMembershipCreate) SetNillableUserID

func (umc *UserMembershipCreate) SetNillableUserID(id *uint64) *UserMembershipCreate

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

func (*UserMembershipCreate) SetUser

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

func (*UserMembershipCreate) SetUserID

func (umc *UserMembershipCreate) SetUserID(id uint64) *UserMembershipCreate

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

func (*UserMembershipCreate) SetYoutubeTalent

func (umc *UserMembershipCreate) SetYoutubeTalent(y *YouTubeTalent) *UserMembershipCreate

SetYoutubeTalent sets the "youtube_talent" edge to the YouTubeTalent entity.

func (*UserMembershipCreate) SetYoutubeTalentID

func (umc *UserMembershipCreate) SetYoutubeTalentID(id string) *UserMembershipCreate

SetYoutubeTalentID sets the "youtube_talent" edge to the YouTubeTalent entity by ID.

type UserMembershipCreateBulk

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

UserMembershipCreateBulk is the builder for creating many UserMembership entities in bulk.

func (*UserMembershipCreateBulk) Exec

Exec executes the query.

func (*UserMembershipCreateBulk) ExecX

func (umcb *UserMembershipCreateBulk) ExecX(ctx context.Context)

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

func (*UserMembershipCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserMembership.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserMembershipUpsert) {
		SetFirstFailed(v+v).
	}).
	Exec(ctx)

func (*UserMembershipCreateBulk) OnConflictColumns

func (umcb *UserMembershipCreateBulk) OnConflictColumns(columns ...string) *UserMembershipUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserMembership.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserMembershipCreateBulk) Save

Save creates the UserMembership entities in the database.

func (*UserMembershipCreateBulk) SaveX

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

type UserMembershipDelete

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

UserMembershipDelete is the builder for deleting a UserMembership entity.

func (*UserMembershipDelete) Exec

func (umd *UserMembershipDelete) Exec(ctx context.Context) (int, error)

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

func (*UserMembershipDelete) ExecX

func (umd *UserMembershipDelete) ExecX(ctx context.Context) int

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

func (*UserMembershipDelete) Where

Where appends a list predicates to the UserMembershipDelete builder.

type UserMembershipDeleteOne

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

UserMembershipDeleteOne is the builder for deleting a single UserMembership entity.

func (*UserMembershipDeleteOne) Exec

func (umdo *UserMembershipDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserMembershipDeleteOne) ExecX

func (umdo *UserMembershipDeleteOne) ExecX(ctx context.Context)

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

func (*UserMembershipDeleteOne) Where

Where appends a list predicates to the UserMembershipDelete builder.

type UserMembershipEdges

type UserMembershipEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// YoutubeTalent holds the value of the youtube_talent edge.
	YoutubeTalent *YouTubeTalent `json:"youtube_talent,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*GuildRole `json:"roles,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserMembershipEdges) RolesOrErr

func (e UserMembershipEdges) RolesOrErr() ([]*GuildRole, error)

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

func (UserMembershipEdges) UserOrErr

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

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

func (UserMembershipEdges) YoutubeTalentOrErr

func (e UserMembershipEdges) YoutubeTalentOrErr() (*YouTubeTalent, error)

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

type UserMembershipGroupBy

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

UserMembershipGroupBy is the group-by builder for UserMembership entities.

func (*UserMembershipGroupBy) Aggregate

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

func (*UserMembershipGroupBy) Bool

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

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

func (*UserMembershipGroupBy) BoolX

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

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

func (*UserMembershipGroupBy) Bools

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

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

func (*UserMembershipGroupBy) BoolsX

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

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

func (*UserMembershipGroupBy) Float64

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

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

func (*UserMembershipGroupBy) Float64X

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

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

func (*UserMembershipGroupBy) Float64s

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

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

func (*UserMembershipGroupBy) Float64sX

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

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

func (*UserMembershipGroupBy) Int

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

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

func (*UserMembershipGroupBy) IntX

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

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

func (*UserMembershipGroupBy) Ints

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

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

func (*UserMembershipGroupBy) IntsX

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

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

func (*UserMembershipGroupBy) Scan

func (umgb *UserMembershipGroupBy) Scan(ctx context.Context, v any) error

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

func (*UserMembershipGroupBy) ScanX

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

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

func (*UserMembershipGroupBy) String

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

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

func (*UserMembershipGroupBy) StringX

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

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

func (*UserMembershipGroupBy) Strings

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

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

func (*UserMembershipGroupBy) StringsX

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

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

type UserMembershipMutation

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

UserMembershipMutation represents an operation that mutates the UserMembership nodes in the graph.

func (*UserMembershipMutation) AddFailCount

func (m *UserMembershipMutation) AddFailCount(i int)

AddFailCount adds i to the "fail_count" field.

func (*UserMembershipMutation) AddField

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

func (m *UserMembershipMutation) AddRoleIDs(ids ...uint64)

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

func (*UserMembershipMutation) AddedEdges

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

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

func (*UserMembershipMutation) AddedFailCount

func (m *UserMembershipMutation) AddedFailCount() (r int, exists bool)

AddedFailCount returns the value that was added to the "fail_count" field in this mutation.

func (*UserMembershipMutation) AddedField

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

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

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

func (*UserMembershipMutation) AddedIDs

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

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

func (*UserMembershipMutation) ClearEdge

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

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) ClearFirstFailed

func (m *UserMembershipMutation) ClearFirstFailed()

ClearFirstFailed clears the value of the "first_failed" field.

func (*UserMembershipMutation) ClearRoles

func (m *UserMembershipMutation) ClearRoles()

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

func (*UserMembershipMutation) ClearUser

func (m *UserMembershipMutation) ClearUser()

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

func (*UserMembershipMutation) ClearYoutubeTalent

func (m *UserMembershipMutation) ClearYoutubeTalent()

ClearYoutubeTalent clears the "youtube_talent" edge to the YouTubeTalent entity.

func (*UserMembershipMutation) ClearedEdges

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

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

func (*UserMembershipMutation) ClearedFields

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

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

func (UserMembershipMutation) Client

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

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

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

func (*UserMembershipMutation) FailCount

func (m *UserMembershipMutation) FailCount() (r int, exists bool)

FailCount returns the value of the "fail_count" field in the mutation.

func (*UserMembershipMutation) Field

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

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

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

func (*UserMembershipMutation) Fields

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) FirstFailed

func (m *UserMembershipMutation) FirstFailed() (r time.Time, exists bool)

FirstFailed returns the value of the "first_failed" field in the mutation.

func (*UserMembershipMutation) FirstFailedCleared

func (m *UserMembershipMutation) FirstFailedCleared() bool

FirstFailedCleared returns if the "first_failed" field was cleared in this mutation.

func (*UserMembershipMutation) ID

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

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) LastVerified

func (m *UserMembershipMutation) LastVerified() (r time.Time, exists bool)

LastVerified returns the value of the "last_verified" field in the mutation.

func (*UserMembershipMutation) OldFailCount

func (m *UserMembershipMutation) OldFailCount(ctx context.Context) (v int, err error)

OldFailCount returns the old "fail_count" field's value of the UserMembership entity. If the UserMembership 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 (*UserMembershipMutation) OldField

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) OldFirstFailed

func (m *UserMembershipMutation) OldFirstFailed(ctx context.Context) (v time.Time, err error)

OldFirstFailed returns the old "first_failed" field's value of the UserMembership entity. If the UserMembership 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 (*UserMembershipMutation) OldLastVerified

func (m *UserMembershipMutation) OldLastVerified(ctx context.Context) (v time.Time, err error)

OldLastVerified returns the old "last_verified" field's value of the UserMembership entity. If the UserMembership 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 (*UserMembershipMutation) Op

func (m *UserMembershipMutation) Op() Op

Op returns the operation name.

func (*UserMembershipMutation) RemoveRoleIDs

func (m *UserMembershipMutation) RemoveRoleIDs(ids ...uint64)

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

func (*UserMembershipMutation) RemovedEdges

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

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

func (*UserMembershipMutation) RemovedIDs

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

func (m *UserMembershipMutation) RemovedRolesIDs() (ids []uint64)

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

func (*UserMembershipMutation) ResetEdge

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) ResetFailCount

func (m *UserMembershipMutation) ResetFailCount()

ResetFailCount resets all changes to the "fail_count" field.

func (*UserMembershipMutation) ResetField

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) ResetFirstFailed

func (m *UserMembershipMutation) ResetFirstFailed()

ResetFirstFailed resets all changes to the "first_failed" field.

func (*UserMembershipMutation) ResetLastVerified

func (m *UserMembershipMutation) ResetLastVerified()

ResetLastVerified resets all changes to the "last_verified" field.

func (*UserMembershipMutation) ResetRoles

func (m *UserMembershipMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMembershipMutation) ResetUser

func (m *UserMembershipMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserMembershipMutation) ResetYoutubeTalent

func (m *UserMembershipMutation) ResetYoutubeTalent()

ResetYoutubeTalent resets all changes to the "youtube_talent" edge.

func (*UserMembershipMutation) RolesCleared

func (m *UserMembershipMutation) RolesCleared() bool

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

func (*UserMembershipMutation) RolesIDs

func (m *UserMembershipMutation) RolesIDs() (ids []uint64)

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

func (*UserMembershipMutation) SetFailCount

func (m *UserMembershipMutation) SetFailCount(i int)

SetFailCount sets the "fail_count" field.

func (*UserMembershipMutation) SetField

func (m *UserMembershipMutation) 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 (*UserMembershipMutation) SetFirstFailed

func (m *UserMembershipMutation) SetFirstFailed(t time.Time)

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipMutation) SetLastVerified

func (m *UserMembershipMutation) SetLastVerified(t time.Time)

SetLastVerified sets the "last_verified" field.

func (*UserMembershipMutation) SetOp

func (m *UserMembershipMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMembershipMutation) SetUserID

func (m *UserMembershipMutation) SetUserID(id uint64)

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

func (*UserMembershipMutation) SetYoutubeTalentID

func (m *UserMembershipMutation) SetYoutubeTalentID(id string)

SetYoutubeTalentID sets the "youtube_talent" edge to the YouTubeTalent entity by id.

func (UserMembershipMutation) Tx

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

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

func (*UserMembershipMutation) Type

func (m *UserMembershipMutation) Type() string

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

func (*UserMembershipMutation) UserCleared

func (m *UserMembershipMutation) UserCleared() bool

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

func (*UserMembershipMutation) UserID

func (m *UserMembershipMutation) UserID() (id uint64, exists bool)

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

func (*UserMembershipMutation) UserIDs

func (m *UserMembershipMutation) UserIDs() (ids []uint64)

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

func (*UserMembershipMutation) Where

Where appends a list predicates to the UserMembershipMutation builder.

func (*UserMembershipMutation) WhereP

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

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

func (*UserMembershipMutation) YoutubeTalentCleared

func (m *UserMembershipMutation) YoutubeTalentCleared() bool

YoutubeTalentCleared reports if the "youtube_talent" edge to the YouTubeTalent entity was cleared.

func (*UserMembershipMutation) YoutubeTalentID

func (m *UserMembershipMutation) YoutubeTalentID() (id string, exists bool)

YoutubeTalentID returns the "youtube_talent" edge ID in the mutation.

func (*UserMembershipMutation) YoutubeTalentIDs

func (m *UserMembershipMutation) YoutubeTalentIDs() (ids []string)

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

type UserMembershipQuery

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

UserMembershipQuery is the builder for querying UserMembership entities.

func (*UserMembershipQuery) Aggregate

func (umq *UserMembershipQuery) Aggregate(fns ...AggregateFunc) *UserMembershipSelect

Aggregate returns a UserMembershipSelect configured with the given aggregations.

func (*UserMembershipQuery) All

All executes the query and returns a list of UserMemberships.

func (*UserMembershipQuery) AllX

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

func (*UserMembershipQuery) Clone

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

func (*UserMembershipQuery) Count

func (umq *UserMembershipQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserMembershipQuery) CountX

func (umq *UserMembershipQuery) CountX(ctx context.Context) int

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

func (*UserMembershipQuery) Exist

func (umq *UserMembershipQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserMembershipQuery) ExistX

func (umq *UserMembershipQuery) ExistX(ctx context.Context) bool

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

func (*UserMembershipQuery) First

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

func (*UserMembershipQuery) FirstID

func (umq *UserMembershipQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserMembershipQuery) FirstIDX

func (umq *UserMembershipQuery) FirstIDX(ctx context.Context) int

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

func (*UserMembershipQuery) FirstX

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

func (*UserMembershipQuery) ForShare

func (umq *UserMembershipQuery) ForShare(opts ...sql.LockOption) *UserMembershipQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserMembershipQuery) ForUpdate

func (umq *UserMembershipQuery) ForUpdate(opts ...sql.LockOption) *UserMembershipQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserMembershipQuery) GroupBy

func (umq *UserMembershipQuery) GroupBy(field string, fields ...string) *UserMembershipGroupBy

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

client.UserMembership.Query().
	GroupBy(usermembership.FieldFirstFailed).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserMembershipQuery) IDs

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

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

func (*UserMembershipQuery) IDsX

func (umq *UserMembershipQuery) IDsX(ctx context.Context) []int

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

func (*UserMembershipQuery) Limit

func (umq *UserMembershipQuery) Limit(limit int) *UserMembershipQuery

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

func (*UserMembershipQuery) Offset

func (umq *UserMembershipQuery) Offset(offset int) *UserMembershipQuery

Offset to start from.

func (*UserMembershipQuery) Only

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

func (*UserMembershipQuery) OnlyID

func (umq *UserMembershipQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserMembershipQuery) OnlyIDX

func (umq *UserMembershipQuery) OnlyIDX(ctx context.Context) int

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

func (*UserMembershipQuery) OnlyX

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

func (*UserMembershipQuery) Order

Order specifies how the records should be ordered.

func (*UserMembershipQuery) QueryRoles

func (umq *UserMembershipQuery) QueryRoles() *GuildRoleQuery

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

func (*UserMembershipQuery) QueryUser

func (umq *UserMembershipQuery) QueryUser() *UserQuery

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

func (*UserMembershipQuery) QueryYoutubeTalent

func (umq *UserMembershipQuery) QueryYoutubeTalent() *YouTubeTalentQuery

QueryYoutubeTalent chains the current query on the "youtube_talent" edge.

func (*UserMembershipQuery) Select

func (umq *UserMembershipQuery) Select(fields ...string) *UserMembershipSelect

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

client.UserMembership.Query().
	Select(usermembership.FieldFirstFailed).
	Scan(ctx, &v)

func (*UserMembershipQuery) Unique

func (umq *UserMembershipQuery) Unique(unique bool) *UserMembershipQuery

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

Where adds a new predicate for the UserMembershipQuery builder.

func (*UserMembershipQuery) WithRoles

func (umq *UserMembershipQuery) WithRoles(opts ...func(*GuildRoleQuery)) *UserMembershipQuery

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

func (*UserMembershipQuery) WithUser

func (umq *UserMembershipQuery) WithUser(opts ...func(*UserQuery)) *UserMembershipQuery

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

func (*UserMembershipQuery) WithYoutubeTalent

func (umq *UserMembershipQuery) WithYoutubeTalent(opts ...func(*YouTubeTalentQuery)) *UserMembershipQuery

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

type UserMembershipSelect

type UserMembershipSelect struct {
	*UserMembershipQuery
	// contains filtered or unexported fields
}

UserMembershipSelect is the builder for selecting fields of UserMembership entities.

func (*UserMembershipSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*UserMembershipSelect) Bool

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

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

func (*UserMembershipSelect) BoolX

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

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

func (*UserMembershipSelect) Bools

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

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

func (*UserMembershipSelect) BoolsX

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

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

func (*UserMembershipSelect) Float64

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

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

func (*UserMembershipSelect) Float64X

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

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

func (*UserMembershipSelect) Float64s

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

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

func (*UserMembershipSelect) Float64sX

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

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

func (*UserMembershipSelect) Int

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

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

func (*UserMembershipSelect) IntX

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

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

func (*UserMembershipSelect) Ints

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

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

func (*UserMembershipSelect) IntsX

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

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

func (*UserMembershipSelect) Scan

func (ums *UserMembershipSelect) Scan(ctx context.Context, v any) error

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

func (*UserMembershipSelect) ScanX

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

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

func (*UserMembershipSelect) String

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

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

func (*UserMembershipSelect) StringX

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

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

func (*UserMembershipSelect) Strings

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

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

func (*UserMembershipSelect) StringsX

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

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

type UserMembershipUpdate

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

UserMembershipUpdate is the builder for updating UserMembership entities.

func (*UserMembershipUpdate) AddFailCount

func (umu *UserMembershipUpdate) AddFailCount(i int) *UserMembershipUpdate

AddFailCount adds i to the "fail_count" field.

func (*UserMembershipUpdate) AddRoleIDs

func (umu *UserMembershipUpdate) AddRoleIDs(ids ...uint64) *UserMembershipUpdate

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

func (*UserMembershipUpdate) AddRoles

func (umu *UserMembershipUpdate) AddRoles(g ...*GuildRole) *UserMembershipUpdate

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

func (*UserMembershipUpdate) ClearFirstFailed

func (umu *UserMembershipUpdate) ClearFirstFailed() *UserMembershipUpdate

ClearFirstFailed clears the value of the "first_failed" field.

func (*UserMembershipUpdate) ClearRoles

func (umu *UserMembershipUpdate) ClearRoles() *UserMembershipUpdate

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

func (*UserMembershipUpdate) ClearUser

func (umu *UserMembershipUpdate) ClearUser() *UserMembershipUpdate

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

func (*UserMembershipUpdate) ClearYoutubeTalent

func (umu *UserMembershipUpdate) ClearYoutubeTalent() *UserMembershipUpdate

ClearYoutubeTalent clears the "youtube_talent" edge to the YouTubeTalent entity.

func (*UserMembershipUpdate) Exec

func (umu *UserMembershipUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserMembershipUpdate) ExecX

func (umu *UserMembershipUpdate) ExecX(ctx context.Context)

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

func (*UserMembershipUpdate) Mutation

Mutation returns the UserMembershipMutation object of the builder.

func (*UserMembershipUpdate) RemoveRoleIDs

func (umu *UserMembershipUpdate) RemoveRoleIDs(ids ...uint64) *UserMembershipUpdate

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

func (*UserMembershipUpdate) RemoveRoles

func (umu *UserMembershipUpdate) RemoveRoles(g ...*GuildRole) *UserMembershipUpdate

RemoveRoles removes "roles" edges to GuildRole entities.

func (*UserMembershipUpdate) Save

func (umu *UserMembershipUpdate) Save(ctx context.Context) (int, error)

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

func (*UserMembershipUpdate) SaveX

func (umu *UserMembershipUpdate) SaveX(ctx context.Context) int

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

func (*UserMembershipUpdate) SetFailCount

func (umu *UserMembershipUpdate) SetFailCount(i int) *UserMembershipUpdate

SetFailCount sets the "fail_count" field.

func (*UserMembershipUpdate) SetFirstFailed

func (umu *UserMembershipUpdate) SetFirstFailed(t time.Time) *UserMembershipUpdate

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipUpdate) SetLastVerified

func (umu *UserMembershipUpdate) SetLastVerified(t time.Time) *UserMembershipUpdate

SetLastVerified sets the "last_verified" field.

func (*UserMembershipUpdate) SetNillableFailCount

func (umu *UserMembershipUpdate) SetNillableFailCount(i *int) *UserMembershipUpdate

SetNillableFailCount sets the "fail_count" field if the given value is not nil.

func (*UserMembershipUpdate) SetNillableFirstFailed

func (umu *UserMembershipUpdate) SetNillableFirstFailed(t *time.Time) *UserMembershipUpdate

SetNillableFirstFailed sets the "first_failed" field if the given value is not nil.

func (*UserMembershipUpdate) SetNillableUserID

func (umu *UserMembershipUpdate) SetNillableUserID(id *uint64) *UserMembershipUpdate

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

func (*UserMembershipUpdate) SetUser

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

func (*UserMembershipUpdate) SetUserID

func (umu *UserMembershipUpdate) SetUserID(id uint64) *UserMembershipUpdate

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

func (*UserMembershipUpdate) SetYoutubeTalent

func (umu *UserMembershipUpdate) SetYoutubeTalent(y *YouTubeTalent) *UserMembershipUpdate

SetYoutubeTalent sets the "youtube_talent" edge to the YouTubeTalent entity.

func (*UserMembershipUpdate) SetYoutubeTalentID

func (umu *UserMembershipUpdate) SetYoutubeTalentID(id string) *UserMembershipUpdate

SetYoutubeTalentID sets the "youtube_talent" edge to the YouTubeTalent entity by ID.

func (*UserMembershipUpdate) Where

Where appends a list predicates to the UserMembershipUpdate builder.

type UserMembershipUpdateOne

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

UserMembershipUpdateOne is the builder for updating a single UserMembership entity.

func (*UserMembershipUpdateOne) AddFailCount

func (umuo *UserMembershipUpdateOne) AddFailCount(i int) *UserMembershipUpdateOne

AddFailCount adds i to the "fail_count" field.

func (*UserMembershipUpdateOne) AddRoleIDs

func (umuo *UserMembershipUpdateOne) AddRoleIDs(ids ...uint64) *UserMembershipUpdateOne

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

func (*UserMembershipUpdateOne) AddRoles

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

func (*UserMembershipUpdateOne) ClearFirstFailed

func (umuo *UserMembershipUpdateOne) ClearFirstFailed() *UserMembershipUpdateOne

ClearFirstFailed clears the value of the "first_failed" field.

func (*UserMembershipUpdateOne) ClearRoles

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

func (*UserMembershipUpdateOne) ClearUser

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

func (*UserMembershipUpdateOne) ClearYoutubeTalent

func (umuo *UserMembershipUpdateOne) ClearYoutubeTalent() *UserMembershipUpdateOne

ClearYoutubeTalent clears the "youtube_talent" edge to the YouTubeTalent entity.

func (*UserMembershipUpdateOne) Exec

func (umuo *UserMembershipUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserMembershipUpdateOne) ExecX

func (umuo *UserMembershipUpdateOne) ExecX(ctx context.Context)

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

func (*UserMembershipUpdateOne) Mutation

Mutation returns the UserMembershipMutation object of the builder.

func (*UserMembershipUpdateOne) RemoveRoleIDs

func (umuo *UserMembershipUpdateOne) RemoveRoleIDs(ids ...uint64) *UserMembershipUpdateOne

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

func (*UserMembershipUpdateOne) RemoveRoles

func (umuo *UserMembershipUpdateOne) RemoveRoles(g ...*GuildRole) *UserMembershipUpdateOne

RemoveRoles removes "roles" edges to GuildRole entities.

func (*UserMembershipUpdateOne) Save

Save executes the query and returns the updated UserMembership entity.

func (*UserMembershipUpdateOne) SaveX

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

func (*UserMembershipUpdateOne) Select

func (umuo *UserMembershipUpdateOne) Select(field string, fields ...string) *UserMembershipUpdateOne

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

func (*UserMembershipUpdateOne) SetFailCount

func (umuo *UserMembershipUpdateOne) SetFailCount(i int) *UserMembershipUpdateOne

SetFailCount sets the "fail_count" field.

func (*UserMembershipUpdateOne) SetFirstFailed

func (umuo *UserMembershipUpdateOne) SetFirstFailed(t time.Time) *UserMembershipUpdateOne

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipUpdateOne) SetLastVerified

func (umuo *UserMembershipUpdateOne) SetLastVerified(t time.Time) *UserMembershipUpdateOne

SetLastVerified sets the "last_verified" field.

func (*UserMembershipUpdateOne) SetNillableFailCount

func (umuo *UserMembershipUpdateOne) SetNillableFailCount(i *int) *UserMembershipUpdateOne

SetNillableFailCount sets the "fail_count" field if the given value is not nil.

func (*UserMembershipUpdateOne) SetNillableFirstFailed

func (umuo *UserMembershipUpdateOne) SetNillableFirstFailed(t *time.Time) *UserMembershipUpdateOne

SetNillableFirstFailed sets the "first_failed" field if the given value is not nil.

func (*UserMembershipUpdateOne) SetNillableUserID

func (umuo *UserMembershipUpdateOne) SetNillableUserID(id *uint64) *UserMembershipUpdateOne

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

func (*UserMembershipUpdateOne) SetUser

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

func (*UserMembershipUpdateOne) SetUserID

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

func (*UserMembershipUpdateOne) SetYoutubeTalent

SetYoutubeTalent sets the "youtube_talent" edge to the YouTubeTalent entity.

func (*UserMembershipUpdateOne) SetYoutubeTalentID

func (umuo *UserMembershipUpdateOne) SetYoutubeTalentID(id string) *UserMembershipUpdateOne

SetYoutubeTalentID sets the "youtube_talent" edge to the YouTubeTalent entity by ID.

func (*UserMembershipUpdateOne) Where

Where appends a list predicates to the UserMembershipUpdate builder.

type UserMembershipUpsert

type UserMembershipUpsert struct {
	*sql.UpdateSet
}

UserMembershipUpsert is the "OnConflict" setter.

func (*UserMembershipUpsert) AddFailCount

func (u *UserMembershipUpsert) AddFailCount(v int) *UserMembershipUpsert

AddFailCount adds v to the "fail_count" field.

func (*UserMembershipUpsert) ClearFirstFailed

func (u *UserMembershipUpsert) ClearFirstFailed() *UserMembershipUpsert

ClearFirstFailed clears the value of the "first_failed" field.

func (*UserMembershipUpsert) SetFailCount

func (u *UserMembershipUpsert) SetFailCount(v int) *UserMembershipUpsert

SetFailCount sets the "fail_count" field.

func (*UserMembershipUpsert) SetFirstFailed

func (u *UserMembershipUpsert) SetFirstFailed(v time.Time) *UserMembershipUpsert

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipUpsert) SetLastVerified

func (u *UserMembershipUpsert) SetLastVerified(v time.Time) *UserMembershipUpsert

SetLastVerified sets the "last_verified" field.

func (*UserMembershipUpsert) UpdateFailCount

func (u *UserMembershipUpsert) UpdateFailCount() *UserMembershipUpsert

UpdateFailCount sets the "fail_count" field to the value that was provided on create.

func (*UserMembershipUpsert) UpdateFirstFailed

func (u *UserMembershipUpsert) UpdateFirstFailed() *UserMembershipUpsert

UpdateFirstFailed sets the "first_failed" field to the value that was provided on create.

func (*UserMembershipUpsert) UpdateLastVerified

func (u *UserMembershipUpsert) UpdateLastVerified() *UserMembershipUpsert

UpdateLastVerified sets the "last_verified" field to the value that was provided on create.

type UserMembershipUpsertBulk

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

UserMembershipUpsertBulk is the builder for "upsert"-ing a bulk of UserMembership nodes.

func (*UserMembershipUpsertBulk) AddFailCount

AddFailCount adds v to the "fail_count" field.

func (*UserMembershipUpsertBulk) ClearFirstFailed

func (u *UserMembershipUpsertBulk) ClearFirstFailed() *UserMembershipUpsertBulk

ClearFirstFailed clears the value of the "first_failed" field.

func (*UserMembershipUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserMembershipUpsertBulk) Exec

Exec executes the query.

func (*UserMembershipUpsertBulk) ExecX

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

func (*UserMembershipUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserMembership.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserMembershipUpsertBulk) SetFailCount

SetFailCount sets the "fail_count" field.

func (*UserMembershipUpsertBulk) SetFirstFailed

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipUpsertBulk) SetLastVerified

SetLastVerified sets the "last_verified" field.

func (*UserMembershipUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the UserMembershipCreateBulk.OnConflict documentation for more info.

func (*UserMembershipUpsertBulk) UpdateFailCount

func (u *UserMembershipUpsertBulk) UpdateFailCount() *UserMembershipUpsertBulk

UpdateFailCount sets the "fail_count" field to the value that was provided on create.

func (*UserMembershipUpsertBulk) UpdateFirstFailed

func (u *UserMembershipUpsertBulk) UpdateFirstFailed() *UserMembershipUpsertBulk

UpdateFirstFailed sets the "first_failed" field to the value that was provided on create.

func (*UserMembershipUpsertBulk) UpdateLastVerified

func (u *UserMembershipUpsertBulk) UpdateLastVerified() *UserMembershipUpsertBulk

UpdateLastVerified sets the "last_verified" field to the value that was provided on create.

func (*UserMembershipUpsertBulk) UpdateNewValues

func (u *UserMembershipUpsertBulk) UpdateNewValues() *UserMembershipUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserMembership.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type UserMembershipUpsertOne

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

UserMembershipUpsertOne is the builder for "upsert"-ing

one UserMembership node.

func (*UserMembershipUpsertOne) AddFailCount

AddFailCount adds v to the "fail_count" field.

func (*UserMembershipUpsertOne) ClearFirstFailed

func (u *UserMembershipUpsertOne) ClearFirstFailed() *UserMembershipUpsertOne

ClearFirstFailed clears the value of the "first_failed" field.

func (*UserMembershipUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserMembershipUpsertOne) Exec

Exec executes the query.

func (*UserMembershipUpsertOne) ExecX

func (u *UserMembershipUpsertOne) ExecX(ctx context.Context)

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

func (*UserMembershipUpsertOne) ID

func (u *UserMembershipUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserMembershipUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*UserMembershipUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserMembership.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserMembershipUpsertOne) SetFailCount

SetFailCount sets the "fail_count" field.

func (*UserMembershipUpsertOne) SetFirstFailed

SetFirstFailed sets the "first_failed" field.

func (*UserMembershipUpsertOne) SetLastVerified

SetLastVerified sets the "last_verified" field.

func (*UserMembershipUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the UserMembershipCreate.OnConflict documentation for more info.

func (*UserMembershipUpsertOne) UpdateFailCount

func (u *UserMembershipUpsertOne) UpdateFailCount() *UserMembershipUpsertOne

UpdateFailCount sets the "fail_count" field to the value that was provided on create.

func (*UserMembershipUpsertOne) UpdateFirstFailed

func (u *UserMembershipUpsertOne) UpdateFirstFailed() *UserMembershipUpsertOne

UpdateFirstFailed sets the "first_failed" field to the value that was provided on create.

func (*UserMembershipUpsertOne) UpdateLastVerified

func (u *UserMembershipUpsertOne) UpdateLastVerified() *UserMembershipUpsertOne

UpdateLastVerified sets the "last_verified" field to the value that was provided on create.

func (*UserMembershipUpsertOne) UpdateNewValues

func (u *UserMembershipUpsertOne) UpdateNewValues() *UserMembershipUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserMembership.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type UserMemberships

type UserMemberships []*UserMembership

UserMemberships is a parsable slice of UserMembership.

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddGuildIDs

func (m *UserMutation) AddGuildIDs(ids ...uint64)

AddGuildIDs adds the "guilds" edge to the Guild entity by ids.

func (*UserMutation) AddGuildsAdminIDs

func (m *UserMutation) AddGuildsAdminIDs(ids ...uint64)

AddGuildsAdminIDs adds the "guilds_admin" edge to the Guild entity by ids.

func (*UserMutation) AddMembershipIDs

func (m *UserMutation) AddMembershipIDs(ids ...int)

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by ids.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) AvatarHash

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

AvatarHash returns the value of the "avatar_hash" field in the mutation.

func (*UserMutation) ClearDiscordToken

func (m *UserMutation) ClearDiscordToken()

ClearDiscordToken clears the value of the "discord_token" field.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearGuilds

func (m *UserMutation) ClearGuilds()

ClearGuilds clears the "guilds" edge to the Guild entity.

func (*UserMutation) ClearGuildsAdmin

func (m *UserMutation) ClearGuildsAdmin()

ClearGuildsAdmin clears the "guilds_admin" edge to the Guild entity.

func (*UserMutation) ClearMemberships

func (m *UserMutation) ClearMemberships()

ClearMemberships clears the "memberships" edge to the UserMembership entity.

func (*UserMutation) ClearYoutubeID

func (m *UserMutation) ClearYoutubeID()

ClearYoutubeID clears the value of the "youtube_id" field.

func (*UserMutation) ClearYoutubeToken

func (m *UserMutation) ClearYoutubeToken()

ClearYoutubeToken clears the value of the "youtube_token" field.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) DiscordToken

func (m *UserMutation) DiscordToken() (r *oauth2.Token, exists bool)

DiscordToken returns the value of the "discord_token" field in the mutation.

func (*UserMutation) DiscordTokenCleared

func (m *UserMutation) DiscordTokenCleared() bool

DiscordTokenCleared returns if the "discord_token" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) FullName

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

FullName returns the value of the "full_name" field in the mutation.

func (*UserMutation) GuildsAdminCleared

func (m *UserMutation) GuildsAdminCleared() bool

GuildsAdminCleared reports if the "guilds_admin" edge to the Guild entity was cleared.

func (*UserMutation) GuildsAdminIDs

func (m *UserMutation) GuildsAdminIDs() (ids []uint64)

GuildsAdminIDs returns the "guilds_admin" edge IDs in the mutation.

func (*UserMutation) GuildsCleared

func (m *UserMutation) GuildsCleared() bool

GuildsCleared reports if the "guilds" edge to the Guild entity was cleared.

func (*UserMutation) GuildsIDs

func (m *UserMutation) GuildsIDs() (ids []uint64)

GuildsIDs returns the "guilds" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uint64, exists bool)

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

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uint64, error)

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

func (*UserMutation) LastCheck

func (m *UserMutation) LastCheck() (r time.Time, exists bool)

LastCheck returns the value of the "last_check" field in the mutation.

func (*UserMutation) MembershipsCleared

func (m *UserMutation) MembershipsCleared() bool

MembershipsCleared reports if the "memberships" edge to the UserMembership entity was cleared.

func (*UserMutation) MembershipsIDs

func (m *UserMutation) MembershipsIDs() (ids []int)

MembershipsIDs returns the "memberships" edge IDs in the mutation.

func (*UserMutation) OldAvatarHash

func (m *UserMutation) OldAvatarHash(ctx context.Context) (v string, err error)

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

func (*UserMutation) OldDiscordToken

func (m *UserMutation) OldDiscordToken(ctx context.Context) (v *oauth2.Token, err error)

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

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldFullName

func (m *UserMutation) OldFullName(ctx context.Context) (v string, err error)

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

func (*UserMutation) OldLastCheck

func (m *UserMutation) OldLastCheck(ctx context.Context) (v time.Time, err error)

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

func (*UserMutation) OldYoutubeID

func (m *UserMutation) OldYoutubeID(ctx context.Context) (v *string, err error)

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

func (*UserMutation) OldYoutubeToken

func (m *UserMutation) OldYoutubeToken(ctx context.Context) (v *oauth2.Token, err error)

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

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemoveGuildIDs

func (m *UserMutation) RemoveGuildIDs(ids ...uint64)

RemoveGuildIDs removes the "guilds" edge to the Guild entity by IDs.

func (*UserMutation) RemoveGuildsAdminIDs

func (m *UserMutation) RemoveGuildsAdminIDs(ids ...uint64)

RemoveGuildsAdminIDs removes the "guilds_admin" edge to the Guild entity by IDs.

func (*UserMutation) RemoveMembershipIDs

func (m *UserMutation) RemoveMembershipIDs(ids ...int)

RemoveMembershipIDs removes the "memberships" edge to the UserMembership entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedGuildsAdminIDs

func (m *UserMutation) RemovedGuildsAdminIDs() (ids []uint64)

RemovedGuildsAdmin returns the removed IDs of the "guilds_admin" edge to the Guild entity.

func (*UserMutation) RemovedGuildsIDs

func (m *UserMutation) RemovedGuildsIDs() (ids []uint64)

RemovedGuilds returns the removed IDs of the "guilds" edge to the Guild entity.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedMembershipsIDs

func (m *UserMutation) RemovedMembershipsIDs() (ids []int)

RemovedMemberships returns the removed IDs of the "memberships" edge to the UserMembership entity.

func (*UserMutation) ResetAvatarHash

func (m *UserMutation) ResetAvatarHash()

ResetAvatarHash resets all changes to the "avatar_hash" field.

func (*UserMutation) ResetDiscordToken

func (m *UserMutation) ResetDiscordToken()

ResetDiscordToken resets all changes to the "discord_token" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetFullName

func (m *UserMutation) ResetFullName()

ResetFullName resets all changes to the "full_name" field.

func (*UserMutation) ResetGuilds

func (m *UserMutation) ResetGuilds()

ResetGuilds resets all changes to the "guilds" edge.

func (*UserMutation) ResetGuildsAdmin

func (m *UserMutation) ResetGuildsAdmin()

ResetGuildsAdmin resets all changes to the "guilds_admin" edge.

func (*UserMutation) ResetLastCheck

func (m *UserMutation) ResetLastCheck()

ResetLastCheck resets all changes to the "last_check" field.

func (*UserMutation) ResetMemberships

func (m *UserMutation) ResetMemberships()

ResetMemberships resets all changes to the "memberships" edge.

func (*UserMutation) ResetYoutubeID

func (m *UserMutation) ResetYoutubeID()

ResetYoutubeID resets all changes to the "youtube_id" field.

func (*UserMutation) ResetYoutubeToken

func (m *UserMutation) ResetYoutubeToken()

ResetYoutubeToken resets all changes to the "youtube_token" field.

func (*UserMutation) SetAvatarHash

func (m *UserMutation) SetAvatarHash(s string)

SetAvatarHash sets the "avatar_hash" field.

func (*UserMutation) SetDiscordToken

func (m *UserMutation) SetDiscordToken(o *oauth2.Token)

SetDiscordToken sets the "discord_token" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetFullName

func (m *UserMutation) SetFullName(s string)

SetFullName sets the "full_name" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uint64)

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

func (*UserMutation) SetLastCheck

func (m *UserMutation) SetLastCheck(t time.Time)

SetLastCheck sets the "last_check" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetYoutubeID

func (m *UserMutation) SetYoutubeID(s string)

SetYoutubeID sets the "youtube_id" field.

func (*UserMutation) SetYoutubeToken

func (m *UserMutation) SetYoutubeToken(o *oauth2.Token)

SetYoutubeToken sets the "youtube_token" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

func (*UserMutation) YoutubeID

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

YoutubeID returns the value of the "youtube_id" field in the mutation.

func (*UserMutation) YoutubeIDCleared

func (m *UserMutation) YoutubeIDCleared() bool

YoutubeIDCleared returns if the "youtube_id" field was cleared in this mutation.

func (*UserMutation) YoutubeToken

func (m *UserMutation) YoutubeToken() (r *oauth2.Token, exists bool)

YoutubeToken returns the value of the "youtube_token" field in the mutation.

func (*UserMutation) YoutubeTokenCleared

func (m *UserMutation) YoutubeTokenCleared() bool

YoutubeTokenCleared returns if the "youtube_token" field was cleared in this mutation.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uint64

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) ForShare

func (uq *UserQuery) ForShare(opts ...sql.LockOption) *UserQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserQuery) ForUpdate

func (uq *UserQuery) ForUpdate(opts ...sql.LockOption) *UserQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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

Example:

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

client.User.Query().
	GroupBy(user.FieldFullName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uint64, err error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uint64

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

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

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uint64

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryGuilds

func (uq *UserQuery) QueryGuilds() *GuildQuery

QueryGuilds chains the current query on the "guilds" edge.

func (*UserQuery) QueryGuildsAdmin

func (uq *UserQuery) QueryGuildsAdmin() *GuildQuery

QueryGuildsAdmin chains the current query on the "guilds_admin" edge.

func (*UserQuery) QueryMemberships

func (uq *UserQuery) QueryMemberships() *UserMembershipQuery

QueryMemberships chains the current query on the "memberships" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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

Example:

var v []struct {
	FullName string `json:"full_name,omitempty"`
}

client.User.Query().
	Select(user.FieldFullName).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithGuilds

func (uq *UserQuery) WithGuilds(opts ...func(*GuildQuery)) *UserQuery

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

func (*UserQuery) WithGuildsAdmin

func (uq *UserQuery) WithGuildsAdmin(opts ...func(*GuildQuery)) *UserQuery

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

func (*UserQuery) WithMemberships

func (uq *UserQuery) WithMemberships(opts ...func(*UserMembershipQuery)) *UserQuery

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

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddGuildIDs

func (uu *UserUpdate) AddGuildIDs(ids ...uint64) *UserUpdate

AddGuildIDs adds the "guilds" edge to the Guild entity by IDs.

func (*UserUpdate) AddGuilds

func (uu *UserUpdate) AddGuilds(g ...*Guild) *UserUpdate

AddGuilds adds the "guilds" edges to the Guild entity.

func (*UserUpdate) AddGuildsAdmin

func (uu *UserUpdate) AddGuildsAdmin(g ...*Guild) *UserUpdate

AddGuildsAdmin adds the "guilds_admin" edges to the Guild entity.

func (*UserUpdate) AddGuildsAdminIDs

func (uu *UserUpdate) AddGuildsAdminIDs(ids ...uint64) *UserUpdate

AddGuildsAdminIDs adds the "guilds_admin" edge to the Guild entity by IDs.

func (*UserUpdate) AddMembershipIDs

func (uu *UserUpdate) AddMembershipIDs(ids ...int) *UserUpdate

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by IDs.

func (*UserUpdate) AddMemberships

func (uu *UserUpdate) AddMemberships(u ...*UserMembership) *UserUpdate

AddMemberships adds the "memberships" edges to the UserMembership entity.

func (*UserUpdate) ClearDiscordToken

func (uu *UserUpdate) ClearDiscordToken() *UserUpdate

ClearDiscordToken clears the value of the "discord_token" field.

func (*UserUpdate) ClearGuilds

func (uu *UserUpdate) ClearGuilds() *UserUpdate

ClearGuilds clears all "guilds" edges to the Guild entity.

func (*UserUpdate) ClearGuildsAdmin

func (uu *UserUpdate) ClearGuildsAdmin() *UserUpdate

ClearGuildsAdmin clears all "guilds_admin" edges to the Guild entity.

func (*UserUpdate) ClearMemberships

func (uu *UserUpdate) ClearMemberships() *UserUpdate

ClearMemberships clears all "memberships" edges to the UserMembership entity.

func (*UserUpdate) ClearYoutubeID

func (uu *UserUpdate) ClearYoutubeID() *UserUpdate

ClearYoutubeID clears the value of the "youtube_id" field.

func (*UserUpdate) ClearYoutubeToken

func (uu *UserUpdate) ClearYoutubeToken() *UserUpdate

ClearYoutubeToken clears the value of the "youtube_token" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveGuildIDs

func (uu *UserUpdate) RemoveGuildIDs(ids ...uint64) *UserUpdate

RemoveGuildIDs removes the "guilds" edge to Guild entities by IDs.

func (*UserUpdate) RemoveGuilds

func (uu *UserUpdate) RemoveGuilds(g ...*Guild) *UserUpdate

RemoveGuilds removes "guilds" edges to Guild entities.

func (*UserUpdate) RemoveGuildsAdmin

func (uu *UserUpdate) RemoveGuildsAdmin(g ...*Guild) *UserUpdate

RemoveGuildsAdmin removes "guilds_admin" edges to Guild entities.

func (*UserUpdate) RemoveGuildsAdminIDs

func (uu *UserUpdate) RemoveGuildsAdminIDs(ids ...uint64) *UserUpdate

RemoveGuildsAdminIDs removes the "guilds_admin" edge to Guild entities by IDs.

func (*UserUpdate) RemoveMembershipIDs

func (uu *UserUpdate) RemoveMembershipIDs(ids ...int) *UserUpdate

RemoveMembershipIDs removes the "memberships" edge to UserMembership entities by IDs.

func (*UserUpdate) RemoveMemberships

func (uu *UserUpdate) RemoveMemberships(u ...*UserMembership) *UserUpdate

RemoveMemberships removes "memberships" edges to UserMembership entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetAvatarHash

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

SetAvatarHash sets the "avatar_hash" field.

func (*UserUpdate) SetDiscordToken

func (uu *UserUpdate) SetDiscordToken(o *oauth2.Token) *UserUpdate

SetDiscordToken sets the "discord_token" field.

func (*UserUpdate) SetFullName

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

SetFullName sets the "full_name" field.

func (*UserUpdate) SetLastCheck

func (uu *UserUpdate) SetLastCheck(t time.Time) *UserUpdate

SetLastCheck sets the "last_check" field.

func (*UserUpdate) SetNillableLastCheck

func (uu *UserUpdate) SetNillableLastCheck(t *time.Time) *UserUpdate

SetNillableLastCheck sets the "last_check" field if the given value is not nil.

func (*UserUpdate) SetNillableYoutubeID

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

SetNillableYoutubeID sets the "youtube_id" field if the given value is not nil.

func (*UserUpdate) SetYoutubeID

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

SetYoutubeID sets the "youtube_id" field.

func (*UserUpdate) SetYoutubeToken

func (uu *UserUpdate) SetYoutubeToken(o *oauth2.Token) *UserUpdate

SetYoutubeToken sets the "youtube_token" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddGuildIDs

func (uuo *UserUpdateOne) AddGuildIDs(ids ...uint64) *UserUpdateOne

AddGuildIDs adds the "guilds" edge to the Guild entity by IDs.

func (*UserUpdateOne) AddGuilds

func (uuo *UserUpdateOne) AddGuilds(g ...*Guild) *UserUpdateOne

AddGuilds adds the "guilds" edges to the Guild entity.

func (*UserUpdateOne) AddGuildsAdmin

func (uuo *UserUpdateOne) AddGuildsAdmin(g ...*Guild) *UserUpdateOne

AddGuildsAdmin adds the "guilds_admin" edges to the Guild entity.

func (*UserUpdateOne) AddGuildsAdminIDs

func (uuo *UserUpdateOne) AddGuildsAdminIDs(ids ...uint64) *UserUpdateOne

AddGuildsAdminIDs adds the "guilds_admin" edge to the Guild entity by IDs.

func (*UserUpdateOne) AddMembershipIDs

func (uuo *UserUpdateOne) AddMembershipIDs(ids ...int) *UserUpdateOne

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by IDs.

func (*UserUpdateOne) AddMemberships

func (uuo *UserUpdateOne) AddMemberships(u ...*UserMembership) *UserUpdateOne

AddMemberships adds the "memberships" edges to the UserMembership entity.

func (*UserUpdateOne) ClearDiscordToken

func (uuo *UserUpdateOne) ClearDiscordToken() *UserUpdateOne

ClearDiscordToken clears the value of the "discord_token" field.

func (*UserUpdateOne) ClearGuilds

func (uuo *UserUpdateOne) ClearGuilds() *UserUpdateOne

ClearGuilds clears all "guilds" edges to the Guild entity.

func (*UserUpdateOne) ClearGuildsAdmin

func (uuo *UserUpdateOne) ClearGuildsAdmin() *UserUpdateOne

ClearGuildsAdmin clears all "guilds_admin" edges to the Guild entity.

func (*UserUpdateOne) ClearMemberships

func (uuo *UserUpdateOne) ClearMemberships() *UserUpdateOne

ClearMemberships clears all "memberships" edges to the UserMembership entity.

func (*UserUpdateOne) ClearYoutubeID

func (uuo *UserUpdateOne) ClearYoutubeID() *UserUpdateOne

ClearYoutubeID clears the value of the "youtube_id" field.

func (*UserUpdateOne) ClearYoutubeToken

func (uuo *UserUpdateOne) ClearYoutubeToken() *UserUpdateOne

ClearYoutubeToken clears the value of the "youtube_token" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveGuildIDs

func (uuo *UserUpdateOne) RemoveGuildIDs(ids ...uint64) *UserUpdateOne

RemoveGuildIDs removes the "guilds" edge to Guild entities by IDs.

func (*UserUpdateOne) RemoveGuilds

func (uuo *UserUpdateOne) RemoveGuilds(g ...*Guild) *UserUpdateOne

RemoveGuilds removes "guilds" edges to Guild entities.

func (*UserUpdateOne) RemoveGuildsAdmin

func (uuo *UserUpdateOne) RemoveGuildsAdmin(g ...*Guild) *UserUpdateOne

RemoveGuildsAdmin removes "guilds_admin" edges to Guild entities.

func (*UserUpdateOne) RemoveGuildsAdminIDs

func (uuo *UserUpdateOne) RemoveGuildsAdminIDs(ids ...uint64) *UserUpdateOne

RemoveGuildsAdminIDs removes the "guilds_admin" edge to Guild entities by IDs.

func (*UserUpdateOne) RemoveMembershipIDs

func (uuo *UserUpdateOne) RemoveMembershipIDs(ids ...int) *UserUpdateOne

RemoveMembershipIDs removes the "memberships" edge to UserMembership entities by IDs.

func (*UserUpdateOne) RemoveMemberships

func (uuo *UserUpdateOne) RemoveMemberships(u ...*UserMembership) *UserUpdateOne

RemoveMemberships removes "memberships" edges to UserMembership entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetAvatarHash

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

SetAvatarHash sets the "avatar_hash" field.

func (*UserUpdateOne) SetDiscordToken

func (uuo *UserUpdateOne) SetDiscordToken(o *oauth2.Token) *UserUpdateOne

SetDiscordToken sets the "discord_token" field.

func (*UserUpdateOne) SetFullName

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

SetFullName sets the "full_name" field.

func (*UserUpdateOne) SetLastCheck

func (uuo *UserUpdateOne) SetLastCheck(t time.Time) *UserUpdateOne

SetLastCheck sets the "last_check" field.

func (*UserUpdateOne) SetNillableLastCheck

func (uuo *UserUpdateOne) SetNillableLastCheck(t *time.Time) *UserUpdateOne

SetNillableLastCheck sets the "last_check" field if the given value is not nil.

func (*UserUpdateOne) SetNillableYoutubeID

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

SetNillableYoutubeID sets the "youtube_id" field if the given value is not nil.

func (*UserUpdateOne) SetYoutubeID

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

SetYoutubeID sets the "youtube_id" field.

func (*UserUpdateOne) SetYoutubeToken

func (uuo *UserUpdateOne) SetYoutubeToken(o *oauth2.Token) *UserUpdateOne

SetYoutubeToken sets the "youtube_token" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) ClearDiscordToken

func (u *UserUpsert) ClearDiscordToken() *UserUpsert

ClearDiscordToken clears the value of the "discord_token" field.

func (*UserUpsert) ClearYoutubeID

func (u *UserUpsert) ClearYoutubeID() *UserUpsert

ClearYoutubeID clears the value of the "youtube_id" field.

func (*UserUpsert) ClearYoutubeToken

func (u *UserUpsert) ClearYoutubeToken() *UserUpsert

ClearYoutubeToken clears the value of the "youtube_token" field.

func (*UserUpsert) SetAvatarHash

func (u *UserUpsert) SetAvatarHash(v string) *UserUpsert

SetAvatarHash sets the "avatar_hash" field.

func (*UserUpsert) SetDiscordToken

func (u *UserUpsert) SetDiscordToken(v *oauth2.Token) *UserUpsert

SetDiscordToken sets the "discord_token" field.

func (*UserUpsert) SetFullName

func (u *UserUpsert) SetFullName(v string) *UserUpsert

SetFullName sets the "full_name" field.

func (*UserUpsert) SetLastCheck

func (u *UserUpsert) SetLastCheck(v time.Time) *UserUpsert

SetLastCheck sets the "last_check" field.

func (*UserUpsert) SetYoutubeID

func (u *UserUpsert) SetYoutubeID(v string) *UserUpsert

SetYoutubeID sets the "youtube_id" field.

func (*UserUpsert) SetYoutubeToken

func (u *UserUpsert) SetYoutubeToken(v *oauth2.Token) *UserUpsert

SetYoutubeToken sets the "youtube_token" field.

func (*UserUpsert) UpdateAvatarHash

func (u *UserUpsert) UpdateAvatarHash() *UserUpsert

UpdateAvatarHash sets the "avatar_hash" field to the value that was provided on create.

func (*UserUpsert) UpdateDiscordToken

func (u *UserUpsert) UpdateDiscordToken() *UserUpsert

UpdateDiscordToken sets the "discord_token" field to the value that was provided on create.

func (*UserUpsert) UpdateFullName

func (u *UserUpsert) UpdateFullName() *UserUpsert

UpdateFullName sets the "full_name" field to the value that was provided on create.

func (*UserUpsert) UpdateLastCheck

func (u *UserUpsert) UpdateLastCheck() *UserUpsert

UpdateLastCheck sets the "last_check" field to the value that was provided on create.

func (*UserUpsert) UpdateYoutubeID

func (u *UserUpsert) UpdateYoutubeID() *UserUpsert

UpdateYoutubeID sets the "youtube_id" field to the value that was provided on create.

func (*UserUpsert) UpdateYoutubeToken

func (u *UserUpsert) UpdateYoutubeToken() *UserUpsert

UpdateYoutubeToken sets the "youtube_token" field to the value that was provided on create.

type UserUpsertBulk

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

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) ClearDiscordToken

func (u *UserUpsertBulk) ClearDiscordToken() *UserUpsertBulk

ClearDiscordToken clears the value of the "discord_token" field.

func (*UserUpsertBulk) ClearYoutubeID

func (u *UserUpsertBulk) ClearYoutubeID() *UserUpsertBulk

ClearYoutubeID clears the value of the "youtube_id" field.

func (*UserUpsertBulk) ClearYoutubeToken

func (u *UserUpsertBulk) ClearYoutubeToken() *UserUpsertBulk

ClearYoutubeToken clears the value of the "youtube_token" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

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

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetAvatarHash

func (u *UserUpsertBulk) SetAvatarHash(v string) *UserUpsertBulk

SetAvatarHash sets the "avatar_hash" field.

func (*UserUpsertBulk) SetDiscordToken

func (u *UserUpsertBulk) SetDiscordToken(v *oauth2.Token) *UserUpsertBulk

SetDiscordToken sets the "discord_token" field.

func (*UserUpsertBulk) SetFullName

func (u *UserUpsertBulk) SetFullName(v string) *UserUpsertBulk

SetFullName sets the "full_name" field.

func (*UserUpsertBulk) SetLastCheck

func (u *UserUpsertBulk) SetLastCheck(v time.Time) *UserUpsertBulk

SetLastCheck sets the "last_check" field.

func (*UserUpsertBulk) SetYoutubeID

func (u *UserUpsertBulk) SetYoutubeID(v string) *UserUpsertBulk

SetYoutubeID sets the "youtube_id" field.

func (*UserUpsertBulk) SetYoutubeToken

func (u *UserUpsertBulk) SetYoutubeToken(v *oauth2.Token) *UserUpsertBulk

SetYoutubeToken sets the "youtube_token" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateAvatarHash

func (u *UserUpsertBulk) UpdateAvatarHash() *UserUpsertBulk

UpdateAvatarHash sets the "avatar_hash" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateDiscordToken

func (u *UserUpsertBulk) UpdateDiscordToken() *UserUpsertBulk

UpdateDiscordToken sets the "discord_token" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateFullName

func (u *UserUpsertBulk) UpdateFullName() *UserUpsertBulk

UpdateFullName sets the "full_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateLastCheck

func (u *UserUpsertBulk) UpdateLastCheck() *UserUpsertBulk

UpdateLastCheck sets the "last_check" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateYoutubeID

func (u *UserUpsertBulk) UpdateYoutubeID() *UserUpsertBulk

UpdateYoutubeID sets the "youtube_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateYoutubeToken

func (u *UserUpsertBulk) UpdateYoutubeToken() *UserUpsertBulk

UpdateYoutubeToken sets the "youtube_token" field to the value that was provided on create.

type UserUpsertOne

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

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) ClearDiscordToken

func (u *UserUpsertOne) ClearDiscordToken() *UserUpsertOne

ClearDiscordToken clears the value of the "discord_token" field.

func (*UserUpsertOne) ClearYoutubeID

func (u *UserUpsertOne) ClearYoutubeID() *UserUpsertOne

ClearYoutubeID clears the value of the "youtube_id" field.

func (*UserUpsertOne) ClearYoutubeToken

func (u *UserUpsertOne) ClearYoutubeToken() *UserUpsertOne

ClearYoutubeToken clears the value of the "youtube_token" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

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

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uint64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uint64

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetAvatarHash

func (u *UserUpsertOne) SetAvatarHash(v string) *UserUpsertOne

SetAvatarHash sets the "avatar_hash" field.

func (*UserUpsertOne) SetDiscordToken

func (u *UserUpsertOne) SetDiscordToken(v *oauth2.Token) *UserUpsertOne

SetDiscordToken sets the "discord_token" field.

func (*UserUpsertOne) SetFullName

func (u *UserUpsertOne) SetFullName(v string) *UserUpsertOne

SetFullName sets the "full_name" field.

func (*UserUpsertOne) SetLastCheck

func (u *UserUpsertOne) SetLastCheck(v time.Time) *UserUpsertOne

SetLastCheck sets the "last_check" field.

func (*UserUpsertOne) SetYoutubeID

func (u *UserUpsertOne) SetYoutubeID(v string) *UserUpsertOne

SetYoutubeID sets the "youtube_id" field.

func (*UserUpsertOne) SetYoutubeToken

func (u *UserUpsertOne) SetYoutubeToken(v *oauth2.Token) *UserUpsertOne

SetYoutubeToken sets the "youtube_token" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateAvatarHash

func (u *UserUpsertOne) UpdateAvatarHash() *UserUpsertOne

UpdateAvatarHash sets the "avatar_hash" field to the value that was provided on create.

func (*UserUpsertOne) UpdateDiscordToken

func (u *UserUpsertOne) UpdateDiscordToken() *UserUpsertOne

UpdateDiscordToken sets the "discord_token" field to the value that was provided on create.

func (*UserUpsertOne) UpdateFullName

func (u *UserUpsertOne) UpdateFullName() *UserUpsertOne

UpdateFullName sets the "full_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateLastCheck

func (u *UserUpsertOne) UpdateLastCheck() *UserUpsertOne

UpdateLastCheck sets the "last_check" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateYoutubeID

func (u *UserUpsertOne) UpdateYoutubeID() *UserUpsertOne

UpdateYoutubeID sets the "youtube_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateYoutubeToken

func (u *UserUpsertOne) UpdateYoutubeToken() *UserUpsertOne

UpdateYoutubeToken sets the "youtube_token" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

type YouTubeTalent

type YouTubeTalent struct {

	// ID of the ent.
	// YouTube channel ID
	ID string `json:"id,omitempty"`
	// YouTube channel name
	ChannelName string `json:"channel_name,omitempty"`
	// URL of the talent's YouTube thumbnail
	ThumbnailURL string `json:"thumbnail_url,omitempty"`
	// ID of a members-only video
	MembershipVideoID string `json:"membership_video_id,omitempty"`
	// Last time membership_video_id returned no results
	LastMembershipVideoIDMiss time.Time `json:"last_membership_video_id_miss,omitempty"`
	// Last time data was fetched
	LastUpdated time.Time `json:"last_updated,omitempty"`
	// When refresh/membership checks were disabled. Set to zero/nil to re-enable.
	Disabled time.Time `json:"disabled,omitempty"`
	// Administratively toggled for deleted/deactivated channels
	DisabledPermanently bool `json:"disabled_permanently,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the YouTubeTalentQuery when eager-loading is set.
	Edges YouTubeTalentEdges `json:"edges"`
	// contains filtered or unexported fields
}

YouTubeTalent is the model entity for the YouTubeTalent schema.

func (*YouTubeTalent) QueryGuilds

func (ytt *YouTubeTalent) QueryGuilds() *GuildQuery

QueryGuilds queries the "guilds" edge of the YouTubeTalent entity.

func (*YouTubeTalent) QueryMemberships

func (ytt *YouTubeTalent) QueryMemberships() *UserMembershipQuery

QueryMemberships queries the "memberships" edge of the YouTubeTalent entity.

func (*YouTubeTalent) QueryRoles

func (ytt *YouTubeTalent) QueryRoles() *GuildRoleQuery

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

func (*YouTubeTalent) String

func (ytt *YouTubeTalent) String() string

String implements the fmt.Stringer.

func (*YouTubeTalent) Unwrap

func (ytt *YouTubeTalent) Unwrap() *YouTubeTalent

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

func (ytt *YouTubeTalent) Update() *YouTubeTalentUpdateOne

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

func (*YouTubeTalent) Value

func (ytt *YouTubeTalent) Value(name string) (ent.Value, error)

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

type YouTubeTalentClient

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

YouTubeTalentClient is a client for the YouTubeTalent schema.

func NewYouTubeTalentClient

func NewYouTubeTalentClient(c config) *YouTubeTalentClient

NewYouTubeTalentClient returns a client for the YouTubeTalent from the given config.

func (*YouTubeTalentClient) Create

Create returns a builder for creating a YouTubeTalent entity.

func (*YouTubeTalentClient) CreateBulk

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

func (*YouTubeTalentClient) Delete

Delete returns a delete builder for YouTubeTalent.

func (*YouTubeTalentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*YouTubeTalentClient) DeleteOneID

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

func (*YouTubeTalentClient) Get

Get returns a YouTubeTalent entity by its id.

func (*YouTubeTalentClient) GetX

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

func (*YouTubeTalentClient) Hooks

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

Hooks returns the client hooks.

func (*YouTubeTalentClient) Intercept

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

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

func (*YouTubeTalentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*YouTubeTalentClient) Query

Query returns a query builder for YouTubeTalent.

func (*YouTubeTalentClient) QueryGuilds

func (c *YouTubeTalentClient) QueryGuilds(ytt *YouTubeTalent) *GuildQuery

QueryGuilds queries the guilds edge of a YouTubeTalent.

func (*YouTubeTalentClient) QueryMemberships

func (c *YouTubeTalentClient) QueryMemberships(ytt *YouTubeTalent) *UserMembershipQuery

QueryMemberships queries the memberships edge of a YouTubeTalent.

func (*YouTubeTalentClient) QueryRoles

func (c *YouTubeTalentClient) QueryRoles(ytt *YouTubeTalent) *GuildRoleQuery

QueryRoles queries the roles edge of a YouTubeTalent.

func (*YouTubeTalentClient) Update

Update returns an update builder for YouTubeTalent.

func (*YouTubeTalentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*YouTubeTalentClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*YouTubeTalentClient) Use

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

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

type YouTubeTalentCreate

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

YouTubeTalentCreate is the builder for creating a YouTubeTalent entity.

func (*YouTubeTalentCreate) AddGuildIDs

func (yttc *YouTubeTalentCreate) AddGuildIDs(ids ...uint64) *YouTubeTalentCreate

AddGuildIDs adds the "guilds" edge to the Guild entity by IDs.

func (*YouTubeTalentCreate) AddGuilds

func (yttc *YouTubeTalentCreate) AddGuilds(g ...*Guild) *YouTubeTalentCreate

AddGuilds adds the "guilds" edges to the Guild entity.

func (*YouTubeTalentCreate) AddMembershipIDs

func (yttc *YouTubeTalentCreate) AddMembershipIDs(ids ...int) *YouTubeTalentCreate

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by IDs.

func (*YouTubeTalentCreate) AddMemberships

func (yttc *YouTubeTalentCreate) AddMemberships(u ...*UserMembership) *YouTubeTalentCreate

AddMemberships adds the "memberships" edges to the UserMembership entity.

func (*YouTubeTalentCreate) AddRoleIDs

func (yttc *YouTubeTalentCreate) AddRoleIDs(ids ...uint64) *YouTubeTalentCreate

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

func (*YouTubeTalentCreate) AddRoles

func (yttc *YouTubeTalentCreate) AddRoles(g ...*GuildRole) *YouTubeTalentCreate

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

func (*YouTubeTalentCreate) Exec

func (yttc *YouTubeTalentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*YouTubeTalentCreate) ExecX

func (yttc *YouTubeTalentCreate) ExecX(ctx context.Context)

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

func (*YouTubeTalentCreate) Mutation

func (yttc *YouTubeTalentCreate) Mutation() *YouTubeTalentMutation

Mutation returns the YouTubeTalentMutation object of the builder.

func (*YouTubeTalentCreate) OnConflict

func (yttc *YouTubeTalentCreate) OnConflict(opts ...sql.ConflictOption) *YouTubeTalentUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.YouTubeTalent.Create().
	SetChannelName(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.YouTubeTalentUpsert) {
		SetChannelName(v+v).
	}).
	Exec(ctx)

func (*YouTubeTalentCreate) OnConflictColumns

func (yttc *YouTubeTalentCreate) OnConflictColumns(columns ...string) *YouTubeTalentUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.YouTubeTalent.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*YouTubeTalentCreate) Save

Save creates the YouTubeTalent in the database.

func (*YouTubeTalentCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*YouTubeTalentCreate) SetChannelName

func (yttc *YouTubeTalentCreate) SetChannelName(s string) *YouTubeTalentCreate

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentCreate) SetDisabled

func (yttc *YouTubeTalentCreate) SetDisabled(t time.Time) *YouTubeTalentCreate

SetDisabled sets the "disabled" field.

func (*YouTubeTalentCreate) SetDisabledPermanently

func (yttc *YouTubeTalentCreate) SetDisabledPermanently(b bool) *YouTubeTalentCreate

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentCreate) SetID

SetID sets the "id" field.

func (*YouTubeTalentCreate) SetLastMembershipVideoIDMiss

func (yttc *YouTubeTalentCreate) SetLastMembershipVideoIDMiss(t time.Time) *YouTubeTalentCreate

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentCreate) SetLastUpdated

func (yttc *YouTubeTalentCreate) SetLastUpdated(t time.Time) *YouTubeTalentCreate

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentCreate) SetMembershipVideoID

func (yttc *YouTubeTalentCreate) SetMembershipVideoID(s string) *YouTubeTalentCreate

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentCreate) SetNillableDisabled

func (yttc *YouTubeTalentCreate) SetNillableDisabled(t *time.Time) *YouTubeTalentCreate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*YouTubeTalentCreate) SetNillableDisabledPermanently

func (yttc *YouTubeTalentCreate) SetNillableDisabledPermanently(b *bool) *YouTubeTalentCreate

SetNillableDisabledPermanently sets the "disabled_permanently" field if the given value is not nil.

func (*YouTubeTalentCreate) SetNillableLastMembershipVideoIDMiss

func (yttc *YouTubeTalentCreate) SetNillableLastMembershipVideoIDMiss(t *time.Time) *YouTubeTalentCreate

SetNillableLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field if the given value is not nil.

func (*YouTubeTalentCreate) SetNillableLastUpdated

func (yttc *YouTubeTalentCreate) SetNillableLastUpdated(t *time.Time) *YouTubeTalentCreate

SetNillableLastUpdated sets the "last_updated" field if the given value is not nil.

func (*YouTubeTalentCreate) SetNillableMembershipVideoID

func (yttc *YouTubeTalentCreate) SetNillableMembershipVideoID(s *string) *YouTubeTalentCreate

SetNillableMembershipVideoID sets the "membership_video_id" field if the given value is not nil.

func (*YouTubeTalentCreate) SetThumbnailURL

func (yttc *YouTubeTalentCreate) SetThumbnailURL(s string) *YouTubeTalentCreate

SetThumbnailURL sets the "thumbnail_url" field.

type YouTubeTalentCreateBulk

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

YouTubeTalentCreateBulk is the builder for creating many YouTubeTalent entities in bulk.

func (*YouTubeTalentCreateBulk) Exec

func (yttcb *YouTubeTalentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*YouTubeTalentCreateBulk) ExecX

func (yttcb *YouTubeTalentCreateBulk) ExecX(ctx context.Context)

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

func (*YouTubeTalentCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.YouTubeTalent.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.YouTubeTalentUpsert) {
		SetChannelName(v+v).
	}).
	Exec(ctx)

func (*YouTubeTalentCreateBulk) OnConflictColumns

func (yttcb *YouTubeTalentCreateBulk) OnConflictColumns(columns ...string) *YouTubeTalentUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.YouTubeTalent.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*YouTubeTalentCreateBulk) Save

Save creates the YouTubeTalent entities in the database.

func (*YouTubeTalentCreateBulk) SaveX

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

type YouTubeTalentDelete

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

YouTubeTalentDelete is the builder for deleting a YouTubeTalent entity.

func (*YouTubeTalentDelete) Exec

func (yttd *YouTubeTalentDelete) Exec(ctx context.Context) (int, error)

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

func (*YouTubeTalentDelete) ExecX

func (yttd *YouTubeTalentDelete) ExecX(ctx context.Context) int

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

func (*YouTubeTalentDelete) Where

Where appends a list predicates to the YouTubeTalentDelete builder.

type YouTubeTalentDeleteOne

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

YouTubeTalentDeleteOne is the builder for deleting a single YouTubeTalent entity.

func (*YouTubeTalentDeleteOne) Exec

func (yttdo *YouTubeTalentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*YouTubeTalentDeleteOne) ExecX

func (yttdo *YouTubeTalentDeleteOne) ExecX(ctx context.Context)

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

func (*YouTubeTalentDeleteOne) Where

Where appends a list predicates to the YouTubeTalentDelete builder.

type YouTubeTalentEdges

type YouTubeTalentEdges struct {
	// Guilds holds the value of the guilds edge.
	Guilds []*Guild `json:"guilds,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*GuildRole `json:"roles,omitempty"`
	// Memberships holds the value of the memberships edge.
	Memberships []*UserMembership `json:"memberships,omitempty"`
	// contains filtered or unexported fields
}

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

func (YouTubeTalentEdges) GuildsOrErr

func (e YouTubeTalentEdges) GuildsOrErr() ([]*Guild, error)

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

func (YouTubeTalentEdges) MembershipsOrErr

func (e YouTubeTalentEdges) MembershipsOrErr() ([]*UserMembership, error)

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

func (YouTubeTalentEdges) RolesOrErr

func (e YouTubeTalentEdges) RolesOrErr() ([]*GuildRole, error)

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

type YouTubeTalentGroupBy

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

YouTubeTalentGroupBy is the group-by builder for YouTubeTalent entities.

func (*YouTubeTalentGroupBy) Aggregate

func (yttgb *YouTubeTalentGroupBy) Aggregate(fns ...AggregateFunc) *YouTubeTalentGroupBy

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

func (*YouTubeTalentGroupBy) Bool

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

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

func (*YouTubeTalentGroupBy) BoolX

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

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

func (*YouTubeTalentGroupBy) Bools

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

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) BoolsX

func (s *YouTubeTalentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*YouTubeTalentGroupBy) Float64

func (s *YouTubeTalentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) Float64X

func (s *YouTubeTalentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*YouTubeTalentGroupBy) Float64s

func (s *YouTubeTalentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) Float64sX

func (s *YouTubeTalentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*YouTubeTalentGroupBy) Int

func (s *YouTubeTalentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) IntX

func (s *YouTubeTalentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*YouTubeTalentGroupBy) Ints

func (s *YouTubeTalentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) IntsX

func (s *YouTubeTalentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*YouTubeTalentGroupBy) Scan

func (yttgb *YouTubeTalentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*YouTubeTalentGroupBy) ScanX

func (s *YouTubeTalentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*YouTubeTalentGroupBy) String

func (s *YouTubeTalentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) StringX

func (s *YouTubeTalentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*YouTubeTalentGroupBy) Strings

func (s *YouTubeTalentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentGroupBy) StringsX

func (s *YouTubeTalentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type YouTubeTalentMutation

type YouTubeTalentMutation struct {
	// contains filtered or unexported fields
}

YouTubeTalentMutation represents an operation that mutates the YouTubeTalent nodes in the graph.

func (*YouTubeTalentMutation) AddField

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) AddGuildIDs

func (m *YouTubeTalentMutation) AddGuildIDs(ids ...uint64)

AddGuildIDs adds the "guilds" edge to the Guild entity by ids.

func (*YouTubeTalentMutation) AddMembershipIDs

func (m *YouTubeTalentMutation) AddMembershipIDs(ids ...int)

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by ids.

func (*YouTubeTalentMutation) AddRoleIDs

func (m *YouTubeTalentMutation) AddRoleIDs(ids ...uint64)

AddRoleIDs adds the "roles" edge to the GuildRole entity by ids.

func (*YouTubeTalentMutation) AddedEdges

func (m *YouTubeTalentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*YouTubeTalentMutation) AddedField

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) AddedFields

func (m *YouTubeTalentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*YouTubeTalentMutation) AddedIDs

func (m *YouTubeTalentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*YouTubeTalentMutation) ChannelName

func (m *YouTubeTalentMutation) ChannelName() (r string, exists bool)

ChannelName returns the value of the "channel_name" field in the mutation.

func (*YouTubeTalentMutation) ClearDisabled

func (m *YouTubeTalentMutation) ClearDisabled()

ClearDisabled clears the value of the "disabled" field.

func (*YouTubeTalentMutation) ClearEdge

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) ClearField

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) ClearGuilds

func (m *YouTubeTalentMutation) ClearGuilds()

ClearGuilds clears the "guilds" edge to the Guild entity.

func (*YouTubeTalentMutation) ClearLastMembershipVideoIDMiss

func (m *YouTubeTalentMutation) ClearLastMembershipVideoIDMiss()

ClearLastMembershipVideoIDMiss clears the value of the "last_membership_video_id_miss" field.

func (*YouTubeTalentMutation) ClearMembershipVideoID

func (m *YouTubeTalentMutation) ClearMembershipVideoID()

ClearMembershipVideoID clears the value of the "membership_video_id" field.

func (*YouTubeTalentMutation) ClearMemberships

func (m *YouTubeTalentMutation) ClearMemberships()

ClearMemberships clears the "memberships" edge to the UserMembership entity.

func (*YouTubeTalentMutation) ClearRoles

func (m *YouTubeTalentMutation) ClearRoles()

ClearRoles clears the "roles" edge to the GuildRole entity.

func (*YouTubeTalentMutation) ClearedEdges

func (m *YouTubeTalentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*YouTubeTalentMutation) ClearedFields

func (m *YouTubeTalentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (YouTubeTalentMutation) Client

func (m YouTubeTalentMutation) 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 (*YouTubeTalentMutation) Disabled

func (m *YouTubeTalentMutation) Disabled() (r time.Time, exists bool)

Disabled returns the value of the "disabled" field in the mutation.

func (*YouTubeTalentMutation) DisabledCleared

func (m *YouTubeTalentMutation) DisabledCleared() bool

DisabledCleared returns if the "disabled" field was cleared in this mutation.

func (*YouTubeTalentMutation) DisabledPermanently

func (m *YouTubeTalentMutation) DisabledPermanently() (r bool, exists bool)

DisabledPermanently returns the value of the "disabled_permanently" field in the mutation.

func (*YouTubeTalentMutation) EdgeCleared

func (m *YouTubeTalentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*YouTubeTalentMutation) Field

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) FieldCleared

func (m *YouTubeTalentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*YouTubeTalentMutation) Fields

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) GuildsCleared

func (m *YouTubeTalentMutation) GuildsCleared() bool

GuildsCleared reports if the "guilds" edge to the Guild entity was cleared.

func (*YouTubeTalentMutation) GuildsIDs

func (m *YouTubeTalentMutation) GuildsIDs() (ids []uint64)

GuildsIDs returns the "guilds" edge IDs in the mutation.

func (*YouTubeTalentMutation) ID

func (m *YouTubeTalentMutation) ID() (id string, 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 (*YouTubeTalentMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*YouTubeTalentMutation) LastMembershipVideoIDMiss

func (m *YouTubeTalentMutation) LastMembershipVideoIDMiss() (r time.Time, exists bool)

LastMembershipVideoIDMiss returns the value of the "last_membership_video_id_miss" field in the mutation.

func (*YouTubeTalentMutation) LastMembershipVideoIDMissCleared

func (m *YouTubeTalentMutation) LastMembershipVideoIDMissCleared() bool

LastMembershipVideoIDMissCleared returns if the "last_membership_video_id_miss" field was cleared in this mutation.

func (*YouTubeTalentMutation) LastUpdated

func (m *YouTubeTalentMutation) LastUpdated() (r time.Time, exists bool)

LastUpdated returns the value of the "last_updated" field in the mutation.

func (*YouTubeTalentMutation) MembershipVideoID

func (m *YouTubeTalentMutation) MembershipVideoID() (r string, exists bool)

MembershipVideoID returns the value of the "membership_video_id" field in the mutation.

func (*YouTubeTalentMutation) MembershipVideoIDCleared

func (m *YouTubeTalentMutation) MembershipVideoIDCleared() bool

MembershipVideoIDCleared returns if the "membership_video_id" field was cleared in this mutation.

func (*YouTubeTalentMutation) MembershipsCleared

func (m *YouTubeTalentMutation) MembershipsCleared() bool

MembershipsCleared reports if the "memberships" edge to the UserMembership entity was cleared.

func (*YouTubeTalentMutation) MembershipsIDs

func (m *YouTubeTalentMutation) MembershipsIDs() (ids []int)

MembershipsIDs returns the "memberships" edge IDs in the mutation.

func (*YouTubeTalentMutation) OldChannelName

func (m *YouTubeTalentMutation) OldChannelName(ctx context.Context) (v string, err error)

OldChannelName returns the old "channel_name" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) OldDisabled

func (m *YouTubeTalentMutation) OldDisabled(ctx context.Context) (v time.Time, err error)

OldDisabled returns the old "disabled" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) OldDisabledPermanently

func (m *YouTubeTalentMutation) OldDisabledPermanently(ctx context.Context) (v bool, err error)

OldDisabledPermanently returns the old "disabled_permanently" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) OldField

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) OldLastMembershipVideoIDMiss

func (m *YouTubeTalentMutation) OldLastMembershipVideoIDMiss(ctx context.Context) (v time.Time, err error)

OldLastMembershipVideoIDMiss returns the old "last_membership_video_id_miss" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) OldLastUpdated

func (m *YouTubeTalentMutation) OldLastUpdated(ctx context.Context) (v time.Time, err error)

OldLastUpdated returns the old "last_updated" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) OldMembershipVideoID

func (m *YouTubeTalentMutation) OldMembershipVideoID(ctx context.Context) (v string, err error)

OldMembershipVideoID returns the old "membership_video_id" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) OldThumbnailURL

func (m *YouTubeTalentMutation) OldThumbnailURL(ctx context.Context) (v string, err error)

OldThumbnailURL returns the old "thumbnail_url" field's value of the YouTubeTalent entity. If the YouTubeTalent 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 (*YouTubeTalentMutation) Op

func (m *YouTubeTalentMutation) Op() Op

Op returns the operation name.

func (*YouTubeTalentMutation) RemoveGuildIDs

func (m *YouTubeTalentMutation) RemoveGuildIDs(ids ...uint64)

RemoveGuildIDs removes the "guilds" edge to the Guild entity by IDs.

func (*YouTubeTalentMutation) RemoveMembershipIDs

func (m *YouTubeTalentMutation) RemoveMembershipIDs(ids ...int)

RemoveMembershipIDs removes the "memberships" edge to the UserMembership entity by IDs.

func (*YouTubeTalentMutation) RemoveRoleIDs

func (m *YouTubeTalentMutation) RemoveRoleIDs(ids ...uint64)

RemoveRoleIDs removes the "roles" edge to the GuildRole entity by IDs.

func (*YouTubeTalentMutation) RemovedEdges

func (m *YouTubeTalentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*YouTubeTalentMutation) RemovedGuildsIDs

func (m *YouTubeTalentMutation) RemovedGuildsIDs() (ids []uint64)

RemovedGuilds returns the removed IDs of the "guilds" edge to the Guild entity.

func (*YouTubeTalentMutation) RemovedIDs

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) RemovedMembershipsIDs

func (m *YouTubeTalentMutation) RemovedMembershipsIDs() (ids []int)

RemovedMemberships returns the removed IDs of the "memberships" edge to the UserMembership entity.

func (*YouTubeTalentMutation) RemovedRolesIDs

func (m *YouTubeTalentMutation) RemovedRolesIDs() (ids []uint64)

RemovedRoles returns the removed IDs of the "roles" edge to the GuildRole entity.

func (*YouTubeTalentMutation) ResetChannelName

func (m *YouTubeTalentMutation) ResetChannelName()

ResetChannelName resets all changes to the "channel_name" field.

func (*YouTubeTalentMutation) ResetDisabled

func (m *YouTubeTalentMutation) ResetDisabled()

ResetDisabled resets all changes to the "disabled" field.

func (*YouTubeTalentMutation) ResetDisabledPermanently

func (m *YouTubeTalentMutation) ResetDisabledPermanently()

ResetDisabledPermanently resets all changes to the "disabled_permanently" field.

func (*YouTubeTalentMutation) ResetEdge

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) ResetField

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) ResetGuilds

func (m *YouTubeTalentMutation) ResetGuilds()

ResetGuilds resets all changes to the "guilds" edge.

func (*YouTubeTalentMutation) ResetLastMembershipVideoIDMiss

func (m *YouTubeTalentMutation) ResetLastMembershipVideoIDMiss()

ResetLastMembershipVideoIDMiss resets all changes to the "last_membership_video_id_miss" field.

func (*YouTubeTalentMutation) ResetLastUpdated

func (m *YouTubeTalentMutation) ResetLastUpdated()

ResetLastUpdated resets all changes to the "last_updated" field.

func (*YouTubeTalentMutation) ResetMembershipVideoID

func (m *YouTubeTalentMutation) ResetMembershipVideoID()

ResetMembershipVideoID resets all changes to the "membership_video_id" field.

func (*YouTubeTalentMutation) ResetMemberships

func (m *YouTubeTalentMutation) ResetMemberships()

ResetMemberships resets all changes to the "memberships" edge.

func (*YouTubeTalentMutation) ResetRoles

func (m *YouTubeTalentMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*YouTubeTalentMutation) ResetThumbnailURL

func (m *YouTubeTalentMutation) ResetThumbnailURL()

ResetThumbnailURL resets all changes to the "thumbnail_url" field.

func (*YouTubeTalentMutation) RolesCleared

func (m *YouTubeTalentMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the GuildRole entity was cleared.

func (*YouTubeTalentMutation) RolesIDs

func (m *YouTubeTalentMutation) RolesIDs() (ids []uint64)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*YouTubeTalentMutation) SetChannelName

func (m *YouTubeTalentMutation) SetChannelName(s string)

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentMutation) SetDisabled

func (m *YouTubeTalentMutation) SetDisabled(t time.Time)

SetDisabled sets the "disabled" field.

func (*YouTubeTalentMutation) SetDisabledPermanently

func (m *YouTubeTalentMutation) SetDisabledPermanently(b bool)

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentMutation) SetField

func (m *YouTubeTalentMutation) 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 (*YouTubeTalentMutation) SetID

func (m *YouTubeTalentMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of YouTubeTalent entities.

func (*YouTubeTalentMutation) SetLastMembershipVideoIDMiss

func (m *YouTubeTalentMutation) SetLastMembershipVideoIDMiss(t time.Time)

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentMutation) SetLastUpdated

func (m *YouTubeTalentMutation) SetLastUpdated(t time.Time)

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentMutation) SetMembershipVideoID

func (m *YouTubeTalentMutation) SetMembershipVideoID(s string)

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentMutation) SetOp

func (m *YouTubeTalentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*YouTubeTalentMutation) SetThumbnailURL

func (m *YouTubeTalentMutation) SetThumbnailURL(s string)

SetThumbnailURL sets the "thumbnail_url" field.

func (*YouTubeTalentMutation) ThumbnailURL

func (m *YouTubeTalentMutation) ThumbnailURL() (r string, exists bool)

ThumbnailURL returns the value of the "thumbnail_url" field in the mutation.

func (YouTubeTalentMutation) Tx

func (m YouTubeTalentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*YouTubeTalentMutation) Type

func (m *YouTubeTalentMutation) Type() string

Type returns the node type of this mutation (YouTubeTalent).

func (*YouTubeTalentMutation) Where

Where appends a list predicates to the YouTubeTalentMutation builder.

func (*YouTubeTalentMutation) WhereP

func (m *YouTubeTalentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the YouTubeTalentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type YouTubeTalentQuery

type YouTubeTalentQuery struct {
	// contains filtered or unexported fields
}

YouTubeTalentQuery is the builder for querying YouTubeTalent entities.

func (*YouTubeTalentQuery) Aggregate

func (yttq *YouTubeTalentQuery) Aggregate(fns ...AggregateFunc) *YouTubeTalentSelect

Aggregate returns a YouTubeTalentSelect configured with the given aggregations.

func (*YouTubeTalentQuery) All

func (yttq *YouTubeTalentQuery) All(ctx context.Context) ([]*YouTubeTalent, error)

All executes the query and returns a list of YouTubeTalents.

func (*YouTubeTalentQuery) AllX

func (yttq *YouTubeTalentQuery) AllX(ctx context.Context) []*YouTubeTalent

AllX is like All, but panics if an error occurs.

func (*YouTubeTalentQuery) Clone

func (yttq *YouTubeTalentQuery) Clone() *YouTubeTalentQuery

Clone returns a duplicate of the YouTubeTalentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*YouTubeTalentQuery) Count

func (yttq *YouTubeTalentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*YouTubeTalentQuery) CountX

func (yttq *YouTubeTalentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*YouTubeTalentQuery) Exist

func (yttq *YouTubeTalentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*YouTubeTalentQuery) ExistX

func (yttq *YouTubeTalentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*YouTubeTalentQuery) First

func (yttq *YouTubeTalentQuery) First(ctx context.Context) (*YouTubeTalent, error)

First returns the first YouTubeTalent entity from the query. Returns a *NotFoundError when no YouTubeTalent was found.

func (*YouTubeTalentQuery) FirstID

func (yttq *YouTubeTalentQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first YouTubeTalent ID from the query. Returns a *NotFoundError when no YouTubeTalent ID was found.

func (*YouTubeTalentQuery) FirstIDX

func (yttq *YouTubeTalentQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*YouTubeTalentQuery) FirstX

func (yttq *YouTubeTalentQuery) FirstX(ctx context.Context) *YouTubeTalent

FirstX is like First, but panics if an error occurs.

func (*YouTubeTalentQuery) ForShare

func (yttq *YouTubeTalentQuery) ForShare(opts ...sql.LockOption) *YouTubeTalentQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*YouTubeTalentQuery) ForUpdate

func (yttq *YouTubeTalentQuery) ForUpdate(opts ...sql.LockOption) *YouTubeTalentQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*YouTubeTalentQuery) GroupBy

func (yttq *YouTubeTalentQuery) GroupBy(field string, fields ...string) *YouTubeTalentGroupBy

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 {
	ChannelName string `json:"channel_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.YouTubeTalent.Query().
	GroupBy(youtubetalent.FieldChannelName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*YouTubeTalentQuery) IDs

func (yttq *YouTubeTalentQuery) IDs(ctx context.Context) (ids []string, err error)

IDs executes the query and returns a list of YouTubeTalent IDs.

func (*YouTubeTalentQuery) IDsX

func (yttq *YouTubeTalentQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*YouTubeTalentQuery) Limit

func (yttq *YouTubeTalentQuery) Limit(limit int) *YouTubeTalentQuery

Limit the number of records to be returned by this query.

func (*YouTubeTalentQuery) Offset

func (yttq *YouTubeTalentQuery) Offset(offset int) *YouTubeTalentQuery

Offset to start from.

func (*YouTubeTalentQuery) Only

Only returns a single YouTubeTalent entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one YouTubeTalent entity is found. Returns a *NotFoundError when no YouTubeTalent entities are found.

func (*YouTubeTalentQuery) OnlyID

func (yttq *YouTubeTalentQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only YouTubeTalent ID in the query. Returns a *NotSingularError when more than one YouTubeTalent ID is found. Returns a *NotFoundError when no entities are found.

func (*YouTubeTalentQuery) OnlyIDX

func (yttq *YouTubeTalentQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*YouTubeTalentQuery) OnlyX

func (yttq *YouTubeTalentQuery) OnlyX(ctx context.Context) *YouTubeTalent

OnlyX is like Only, but panics if an error occurs.

func (*YouTubeTalentQuery) Order

Order specifies how the records should be ordered.

func (*YouTubeTalentQuery) QueryGuilds

func (yttq *YouTubeTalentQuery) QueryGuilds() *GuildQuery

QueryGuilds chains the current query on the "guilds" edge.

func (*YouTubeTalentQuery) QueryMemberships

func (yttq *YouTubeTalentQuery) QueryMemberships() *UserMembershipQuery

QueryMemberships chains the current query on the "memberships" edge.

func (*YouTubeTalentQuery) QueryRoles

func (yttq *YouTubeTalentQuery) QueryRoles() *GuildRoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*YouTubeTalentQuery) Select

func (yttq *YouTubeTalentQuery) Select(fields ...string) *YouTubeTalentSelect

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 {
	ChannelName string `json:"channel_name,omitempty"`
}

client.YouTubeTalent.Query().
	Select(youtubetalent.FieldChannelName).
	Scan(ctx, &v)

func (*YouTubeTalentQuery) Unique

func (yttq *YouTubeTalentQuery) Unique(unique bool) *YouTubeTalentQuery

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 (*YouTubeTalentQuery) Where

Where adds a new predicate for the YouTubeTalentQuery builder.

func (*YouTubeTalentQuery) WithGuilds

func (yttq *YouTubeTalentQuery) WithGuilds(opts ...func(*GuildQuery)) *YouTubeTalentQuery

WithGuilds tells the query-builder to eager-load the nodes that are connected to the "guilds" edge. The optional arguments are used to configure the query builder of the edge.

func (*YouTubeTalentQuery) WithMemberships

func (yttq *YouTubeTalentQuery) WithMemberships(opts ...func(*UserMembershipQuery)) *YouTubeTalentQuery

WithMemberships tells the query-builder to eager-load the nodes that are connected to the "memberships" edge. The optional arguments are used to configure the query builder of the edge.

func (*YouTubeTalentQuery) WithRoles

func (yttq *YouTubeTalentQuery) WithRoles(opts ...func(*GuildRoleQuery)) *YouTubeTalentQuery

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 YouTubeTalentSelect

type YouTubeTalentSelect struct {
	*YouTubeTalentQuery
	// contains filtered or unexported fields
}

YouTubeTalentSelect is the builder for selecting fields of YouTubeTalent entities.

func (*YouTubeTalentSelect) Aggregate

func (ytts *YouTubeTalentSelect) Aggregate(fns ...AggregateFunc) *YouTubeTalentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*YouTubeTalentSelect) Bool

func (s *YouTubeTalentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) BoolX

func (s *YouTubeTalentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*YouTubeTalentSelect) Bools

func (s *YouTubeTalentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) BoolsX

func (s *YouTubeTalentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*YouTubeTalentSelect) Float64

func (s *YouTubeTalentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) Float64X

func (s *YouTubeTalentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*YouTubeTalentSelect) Float64s

func (s *YouTubeTalentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) Float64sX

func (s *YouTubeTalentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*YouTubeTalentSelect) Int

func (s *YouTubeTalentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) IntX

func (s *YouTubeTalentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*YouTubeTalentSelect) Ints

func (s *YouTubeTalentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) IntsX

func (s *YouTubeTalentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*YouTubeTalentSelect) Scan

func (ytts *YouTubeTalentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*YouTubeTalentSelect) ScanX

func (s *YouTubeTalentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*YouTubeTalentSelect) String

func (s *YouTubeTalentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) StringX

func (s *YouTubeTalentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*YouTubeTalentSelect) Strings

func (s *YouTubeTalentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*YouTubeTalentSelect) StringsX

func (s *YouTubeTalentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type YouTubeTalentUpdate

type YouTubeTalentUpdate struct {
	// contains filtered or unexported fields
}

YouTubeTalentUpdate is the builder for updating YouTubeTalent entities.

func (*YouTubeTalentUpdate) AddGuildIDs

func (yttu *YouTubeTalentUpdate) AddGuildIDs(ids ...uint64) *YouTubeTalentUpdate

AddGuildIDs adds the "guilds" edge to the Guild entity by IDs.

func (*YouTubeTalentUpdate) AddGuilds

func (yttu *YouTubeTalentUpdate) AddGuilds(g ...*Guild) *YouTubeTalentUpdate

AddGuilds adds the "guilds" edges to the Guild entity.

func (*YouTubeTalentUpdate) AddMembershipIDs

func (yttu *YouTubeTalentUpdate) AddMembershipIDs(ids ...int) *YouTubeTalentUpdate

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by IDs.

func (*YouTubeTalentUpdate) AddMemberships

func (yttu *YouTubeTalentUpdate) AddMemberships(u ...*UserMembership) *YouTubeTalentUpdate

AddMemberships adds the "memberships" edges to the UserMembership entity.

func (*YouTubeTalentUpdate) AddRoleIDs

func (yttu *YouTubeTalentUpdate) AddRoleIDs(ids ...uint64) *YouTubeTalentUpdate

AddRoleIDs adds the "roles" edge to the GuildRole entity by IDs.

func (*YouTubeTalentUpdate) AddRoles

func (yttu *YouTubeTalentUpdate) AddRoles(g ...*GuildRole) *YouTubeTalentUpdate

AddRoles adds the "roles" edges to the GuildRole entity.

func (*YouTubeTalentUpdate) ClearDisabled

func (yttu *YouTubeTalentUpdate) ClearDisabled() *YouTubeTalentUpdate

ClearDisabled clears the value of the "disabled" field.

func (*YouTubeTalentUpdate) ClearGuilds

func (yttu *YouTubeTalentUpdate) ClearGuilds() *YouTubeTalentUpdate

ClearGuilds clears all "guilds" edges to the Guild entity.

func (*YouTubeTalentUpdate) ClearLastMembershipVideoIDMiss

func (yttu *YouTubeTalentUpdate) ClearLastMembershipVideoIDMiss() *YouTubeTalentUpdate

ClearLastMembershipVideoIDMiss clears the value of the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpdate) ClearMembershipVideoID

func (yttu *YouTubeTalentUpdate) ClearMembershipVideoID() *YouTubeTalentUpdate

ClearMembershipVideoID clears the value of the "membership_video_id" field.

func (*YouTubeTalentUpdate) ClearMemberships

func (yttu *YouTubeTalentUpdate) ClearMemberships() *YouTubeTalentUpdate

ClearMemberships clears all "memberships" edges to the UserMembership entity.

func (*YouTubeTalentUpdate) ClearRoles

func (yttu *YouTubeTalentUpdate) ClearRoles() *YouTubeTalentUpdate

ClearRoles clears all "roles" edges to the GuildRole entity.

func (*YouTubeTalentUpdate) Exec

func (yttu *YouTubeTalentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*YouTubeTalentUpdate) ExecX

func (yttu *YouTubeTalentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*YouTubeTalentUpdate) Mutation

func (yttu *YouTubeTalentUpdate) Mutation() *YouTubeTalentMutation

Mutation returns the YouTubeTalentMutation object of the builder.

func (*YouTubeTalentUpdate) RemoveGuildIDs

func (yttu *YouTubeTalentUpdate) RemoveGuildIDs(ids ...uint64) *YouTubeTalentUpdate

RemoveGuildIDs removes the "guilds" edge to Guild entities by IDs.

func (*YouTubeTalentUpdate) RemoveGuilds

func (yttu *YouTubeTalentUpdate) RemoveGuilds(g ...*Guild) *YouTubeTalentUpdate

RemoveGuilds removes "guilds" edges to Guild entities.

func (*YouTubeTalentUpdate) RemoveMembershipIDs

func (yttu *YouTubeTalentUpdate) RemoveMembershipIDs(ids ...int) *YouTubeTalentUpdate

RemoveMembershipIDs removes the "memberships" edge to UserMembership entities by IDs.

func (*YouTubeTalentUpdate) RemoveMemberships

func (yttu *YouTubeTalentUpdate) RemoveMemberships(u ...*UserMembership) *YouTubeTalentUpdate

RemoveMemberships removes "memberships" edges to UserMembership entities.

func (*YouTubeTalentUpdate) RemoveRoleIDs

func (yttu *YouTubeTalentUpdate) RemoveRoleIDs(ids ...uint64) *YouTubeTalentUpdate

RemoveRoleIDs removes the "roles" edge to GuildRole entities by IDs.

func (*YouTubeTalentUpdate) RemoveRoles

func (yttu *YouTubeTalentUpdate) RemoveRoles(g ...*GuildRole) *YouTubeTalentUpdate

RemoveRoles removes "roles" edges to GuildRole entities.

func (*YouTubeTalentUpdate) Save

func (yttu *YouTubeTalentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*YouTubeTalentUpdate) SaveX

func (yttu *YouTubeTalentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*YouTubeTalentUpdate) SetChannelName

func (yttu *YouTubeTalentUpdate) SetChannelName(s string) *YouTubeTalentUpdate

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentUpdate) SetDisabled

func (yttu *YouTubeTalentUpdate) SetDisabled(t time.Time) *YouTubeTalentUpdate

SetDisabled sets the "disabled" field.

func (*YouTubeTalentUpdate) SetDisabledPermanently

func (yttu *YouTubeTalentUpdate) SetDisabledPermanently(b bool) *YouTubeTalentUpdate

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentUpdate) SetLastMembershipVideoIDMiss

func (yttu *YouTubeTalentUpdate) SetLastMembershipVideoIDMiss(t time.Time) *YouTubeTalentUpdate

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpdate) SetLastUpdated

func (yttu *YouTubeTalentUpdate) SetLastUpdated(t time.Time) *YouTubeTalentUpdate

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentUpdate) SetMembershipVideoID

func (yttu *YouTubeTalentUpdate) SetMembershipVideoID(s string) *YouTubeTalentUpdate

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentUpdate) SetNillableDisabled

func (yttu *YouTubeTalentUpdate) SetNillableDisabled(t *time.Time) *YouTubeTalentUpdate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*YouTubeTalentUpdate) SetNillableDisabledPermanently

func (yttu *YouTubeTalentUpdate) SetNillableDisabledPermanently(b *bool) *YouTubeTalentUpdate

SetNillableDisabledPermanently sets the "disabled_permanently" field if the given value is not nil.

func (*YouTubeTalentUpdate) SetNillableLastMembershipVideoIDMiss

func (yttu *YouTubeTalentUpdate) SetNillableLastMembershipVideoIDMiss(t *time.Time) *YouTubeTalentUpdate

SetNillableLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field if the given value is not nil.

func (*YouTubeTalentUpdate) SetNillableLastUpdated

func (yttu *YouTubeTalentUpdate) SetNillableLastUpdated(t *time.Time) *YouTubeTalentUpdate

SetNillableLastUpdated sets the "last_updated" field if the given value is not nil.

func (*YouTubeTalentUpdate) SetNillableMembershipVideoID

func (yttu *YouTubeTalentUpdate) SetNillableMembershipVideoID(s *string) *YouTubeTalentUpdate

SetNillableMembershipVideoID sets the "membership_video_id" field if the given value is not nil.

func (*YouTubeTalentUpdate) SetThumbnailURL

func (yttu *YouTubeTalentUpdate) SetThumbnailURL(s string) *YouTubeTalentUpdate

SetThumbnailURL sets the "thumbnail_url" field.

func (*YouTubeTalentUpdate) Where

Where appends a list predicates to the YouTubeTalentUpdate builder.

type YouTubeTalentUpdateOne

type YouTubeTalentUpdateOne struct {
	// contains filtered or unexported fields
}

YouTubeTalentUpdateOne is the builder for updating a single YouTubeTalent entity.

func (*YouTubeTalentUpdateOne) AddGuildIDs

func (yttuo *YouTubeTalentUpdateOne) AddGuildIDs(ids ...uint64) *YouTubeTalentUpdateOne

AddGuildIDs adds the "guilds" edge to the Guild entity by IDs.

func (*YouTubeTalentUpdateOne) AddGuilds

func (yttuo *YouTubeTalentUpdateOne) AddGuilds(g ...*Guild) *YouTubeTalentUpdateOne

AddGuilds adds the "guilds" edges to the Guild entity.

func (*YouTubeTalentUpdateOne) AddMembershipIDs

func (yttuo *YouTubeTalentUpdateOne) AddMembershipIDs(ids ...int) *YouTubeTalentUpdateOne

AddMembershipIDs adds the "memberships" edge to the UserMembership entity by IDs.

func (*YouTubeTalentUpdateOne) AddMemberships

func (yttuo *YouTubeTalentUpdateOne) AddMemberships(u ...*UserMembership) *YouTubeTalentUpdateOne

AddMemberships adds the "memberships" edges to the UserMembership entity.

func (*YouTubeTalentUpdateOne) AddRoleIDs

func (yttuo *YouTubeTalentUpdateOne) AddRoleIDs(ids ...uint64) *YouTubeTalentUpdateOne

AddRoleIDs adds the "roles" edge to the GuildRole entity by IDs.

func (*YouTubeTalentUpdateOne) AddRoles

AddRoles adds the "roles" edges to the GuildRole entity.

func (*YouTubeTalentUpdateOne) ClearDisabled

func (yttuo *YouTubeTalentUpdateOne) ClearDisabled() *YouTubeTalentUpdateOne

ClearDisabled clears the value of the "disabled" field.

func (*YouTubeTalentUpdateOne) ClearGuilds

func (yttuo *YouTubeTalentUpdateOne) ClearGuilds() *YouTubeTalentUpdateOne

ClearGuilds clears all "guilds" edges to the Guild entity.

func (*YouTubeTalentUpdateOne) ClearLastMembershipVideoIDMiss

func (yttuo *YouTubeTalentUpdateOne) ClearLastMembershipVideoIDMiss() *YouTubeTalentUpdateOne

ClearLastMembershipVideoIDMiss clears the value of the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpdateOne) ClearMembershipVideoID

func (yttuo *YouTubeTalentUpdateOne) ClearMembershipVideoID() *YouTubeTalentUpdateOne

ClearMembershipVideoID clears the value of the "membership_video_id" field.

func (*YouTubeTalentUpdateOne) ClearMemberships

func (yttuo *YouTubeTalentUpdateOne) ClearMemberships() *YouTubeTalentUpdateOne

ClearMemberships clears all "memberships" edges to the UserMembership entity.

func (*YouTubeTalentUpdateOne) ClearRoles

func (yttuo *YouTubeTalentUpdateOne) ClearRoles() *YouTubeTalentUpdateOne

ClearRoles clears all "roles" edges to the GuildRole entity.

func (*YouTubeTalentUpdateOne) Exec

func (yttuo *YouTubeTalentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*YouTubeTalentUpdateOne) ExecX

func (yttuo *YouTubeTalentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*YouTubeTalentUpdateOne) Mutation

func (yttuo *YouTubeTalentUpdateOne) Mutation() *YouTubeTalentMutation

Mutation returns the YouTubeTalentMutation object of the builder.

func (*YouTubeTalentUpdateOne) RemoveGuildIDs

func (yttuo *YouTubeTalentUpdateOne) RemoveGuildIDs(ids ...uint64) *YouTubeTalentUpdateOne

RemoveGuildIDs removes the "guilds" edge to Guild entities by IDs.

func (*YouTubeTalentUpdateOne) RemoveGuilds

func (yttuo *YouTubeTalentUpdateOne) RemoveGuilds(g ...*Guild) *YouTubeTalentUpdateOne

RemoveGuilds removes "guilds" edges to Guild entities.

func (*YouTubeTalentUpdateOne) RemoveMembershipIDs

func (yttuo *YouTubeTalentUpdateOne) RemoveMembershipIDs(ids ...int) *YouTubeTalentUpdateOne

RemoveMembershipIDs removes the "memberships" edge to UserMembership entities by IDs.

func (*YouTubeTalentUpdateOne) RemoveMemberships

func (yttuo *YouTubeTalentUpdateOne) RemoveMemberships(u ...*UserMembership) *YouTubeTalentUpdateOne

RemoveMemberships removes "memberships" edges to UserMembership entities.

func (*YouTubeTalentUpdateOne) RemoveRoleIDs

func (yttuo *YouTubeTalentUpdateOne) RemoveRoleIDs(ids ...uint64) *YouTubeTalentUpdateOne

RemoveRoleIDs removes the "roles" edge to GuildRole entities by IDs.

func (*YouTubeTalentUpdateOne) RemoveRoles

func (yttuo *YouTubeTalentUpdateOne) RemoveRoles(g ...*GuildRole) *YouTubeTalentUpdateOne

RemoveRoles removes "roles" edges to GuildRole entities.

func (*YouTubeTalentUpdateOne) Save

Save executes the query and returns the updated YouTubeTalent entity.

func (*YouTubeTalentUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*YouTubeTalentUpdateOne) Select

func (yttuo *YouTubeTalentUpdateOne) Select(field string, fields ...string) *YouTubeTalentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*YouTubeTalentUpdateOne) SetChannelName

func (yttuo *YouTubeTalentUpdateOne) SetChannelName(s string) *YouTubeTalentUpdateOne

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentUpdateOne) SetDisabled

func (yttuo *YouTubeTalentUpdateOne) SetDisabled(t time.Time) *YouTubeTalentUpdateOne

SetDisabled sets the "disabled" field.

func (*YouTubeTalentUpdateOne) SetDisabledPermanently

func (yttuo *YouTubeTalentUpdateOne) SetDisabledPermanently(b bool) *YouTubeTalentUpdateOne

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentUpdateOne) SetLastMembershipVideoIDMiss

func (yttuo *YouTubeTalentUpdateOne) SetLastMembershipVideoIDMiss(t time.Time) *YouTubeTalentUpdateOne

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpdateOne) SetLastUpdated

func (yttuo *YouTubeTalentUpdateOne) SetLastUpdated(t time.Time) *YouTubeTalentUpdateOne

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentUpdateOne) SetMembershipVideoID

func (yttuo *YouTubeTalentUpdateOne) SetMembershipVideoID(s string) *YouTubeTalentUpdateOne

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentUpdateOne) SetNillableDisabled

func (yttuo *YouTubeTalentUpdateOne) SetNillableDisabled(t *time.Time) *YouTubeTalentUpdateOne

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (*YouTubeTalentUpdateOne) SetNillableDisabledPermanently

func (yttuo *YouTubeTalentUpdateOne) SetNillableDisabledPermanently(b *bool) *YouTubeTalentUpdateOne

SetNillableDisabledPermanently sets the "disabled_permanently" field if the given value is not nil.

func (*YouTubeTalentUpdateOne) SetNillableLastMembershipVideoIDMiss

func (yttuo *YouTubeTalentUpdateOne) SetNillableLastMembershipVideoIDMiss(t *time.Time) *YouTubeTalentUpdateOne

SetNillableLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field if the given value is not nil.

func (*YouTubeTalentUpdateOne) SetNillableLastUpdated

func (yttuo *YouTubeTalentUpdateOne) SetNillableLastUpdated(t *time.Time) *YouTubeTalentUpdateOne

SetNillableLastUpdated sets the "last_updated" field if the given value is not nil.

func (*YouTubeTalentUpdateOne) SetNillableMembershipVideoID

func (yttuo *YouTubeTalentUpdateOne) SetNillableMembershipVideoID(s *string) *YouTubeTalentUpdateOne

SetNillableMembershipVideoID sets the "membership_video_id" field if the given value is not nil.

func (*YouTubeTalentUpdateOne) SetThumbnailURL

func (yttuo *YouTubeTalentUpdateOne) SetThumbnailURL(s string) *YouTubeTalentUpdateOne

SetThumbnailURL sets the "thumbnail_url" field.

func (*YouTubeTalentUpdateOne) Where

Where appends a list predicates to the YouTubeTalentUpdate builder.

type YouTubeTalentUpsert

type YouTubeTalentUpsert struct {
	*sql.UpdateSet
}

YouTubeTalentUpsert is the "OnConflict" setter.

func (*YouTubeTalentUpsert) ClearDisabled

func (u *YouTubeTalentUpsert) ClearDisabled() *YouTubeTalentUpsert

ClearDisabled clears the value of the "disabled" field.

func (*YouTubeTalentUpsert) ClearLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsert) ClearLastMembershipVideoIDMiss() *YouTubeTalentUpsert

ClearLastMembershipVideoIDMiss clears the value of the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpsert) ClearMembershipVideoID

func (u *YouTubeTalentUpsert) ClearMembershipVideoID() *YouTubeTalentUpsert

ClearMembershipVideoID clears the value of the "membership_video_id" field.

func (*YouTubeTalentUpsert) SetChannelName

func (u *YouTubeTalentUpsert) SetChannelName(v string) *YouTubeTalentUpsert

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentUpsert) SetDisabled

func (u *YouTubeTalentUpsert) SetDisabled(v time.Time) *YouTubeTalentUpsert

SetDisabled sets the "disabled" field.

func (*YouTubeTalentUpsert) SetDisabledPermanently

func (u *YouTubeTalentUpsert) SetDisabledPermanently(v bool) *YouTubeTalentUpsert

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentUpsert) SetLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsert) SetLastMembershipVideoIDMiss(v time.Time) *YouTubeTalentUpsert

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpsert) SetLastUpdated

func (u *YouTubeTalentUpsert) SetLastUpdated(v time.Time) *YouTubeTalentUpsert

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentUpsert) SetMembershipVideoID

func (u *YouTubeTalentUpsert) SetMembershipVideoID(v string) *YouTubeTalentUpsert

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentUpsert) SetThumbnailURL

func (u *YouTubeTalentUpsert) SetThumbnailURL(v string) *YouTubeTalentUpsert

SetThumbnailURL sets the "thumbnail_url" field.

func (*YouTubeTalentUpsert) UpdateChannelName

func (u *YouTubeTalentUpsert) UpdateChannelName() *YouTubeTalentUpsert

UpdateChannelName sets the "channel_name" field to the value that was provided on create.

func (*YouTubeTalentUpsert) UpdateDisabled

func (u *YouTubeTalentUpsert) UpdateDisabled() *YouTubeTalentUpsert

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*YouTubeTalentUpsert) UpdateDisabledPermanently

func (u *YouTubeTalentUpsert) UpdateDisabledPermanently() *YouTubeTalentUpsert

UpdateDisabledPermanently sets the "disabled_permanently" field to the value that was provided on create.

func (*YouTubeTalentUpsert) UpdateLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsert) UpdateLastMembershipVideoIDMiss() *YouTubeTalentUpsert

UpdateLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field to the value that was provided on create.

func (*YouTubeTalentUpsert) UpdateLastUpdated

func (u *YouTubeTalentUpsert) UpdateLastUpdated() *YouTubeTalentUpsert

UpdateLastUpdated sets the "last_updated" field to the value that was provided on create.

func (*YouTubeTalentUpsert) UpdateMembershipVideoID

func (u *YouTubeTalentUpsert) UpdateMembershipVideoID() *YouTubeTalentUpsert

UpdateMembershipVideoID sets the "membership_video_id" field to the value that was provided on create.

func (*YouTubeTalentUpsert) UpdateThumbnailURL

func (u *YouTubeTalentUpsert) UpdateThumbnailURL() *YouTubeTalentUpsert

UpdateThumbnailURL sets the "thumbnail_url" field to the value that was provided on create.

type YouTubeTalentUpsertBulk

type YouTubeTalentUpsertBulk struct {
	// contains filtered or unexported fields
}

YouTubeTalentUpsertBulk is the builder for "upsert"-ing a bulk of YouTubeTalent nodes.

func (*YouTubeTalentUpsertBulk) ClearDisabled

ClearDisabled clears the value of the "disabled" field.

func (*YouTubeTalentUpsertBulk) ClearLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsertBulk) ClearLastMembershipVideoIDMiss() *YouTubeTalentUpsertBulk

ClearLastMembershipVideoIDMiss clears the value of the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpsertBulk) ClearMembershipVideoID

func (u *YouTubeTalentUpsertBulk) ClearMembershipVideoID() *YouTubeTalentUpsertBulk

ClearMembershipVideoID clears the value of the "membership_video_id" field.

func (*YouTubeTalentUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*YouTubeTalentUpsertBulk) Exec

Exec executes the query.

func (*YouTubeTalentUpsertBulk) ExecX

func (u *YouTubeTalentUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*YouTubeTalentUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.YouTubeTalent.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*YouTubeTalentUpsertBulk) SetChannelName

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentUpsertBulk) SetDisabled

SetDisabled sets the "disabled" field.

func (*YouTubeTalentUpsertBulk) SetDisabledPermanently

func (u *YouTubeTalentUpsertBulk) SetDisabledPermanently(v bool) *YouTubeTalentUpsertBulk

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentUpsertBulk) SetLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsertBulk) SetLastMembershipVideoIDMiss(v time.Time) *YouTubeTalentUpsertBulk

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpsertBulk) SetLastUpdated

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentUpsertBulk) SetMembershipVideoID

func (u *YouTubeTalentUpsertBulk) SetMembershipVideoID(v string) *YouTubeTalentUpsertBulk

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentUpsertBulk) SetThumbnailURL

SetThumbnailURL sets the "thumbnail_url" field.

func (*YouTubeTalentUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the YouTubeTalentCreateBulk.OnConflict documentation for more info.

func (*YouTubeTalentUpsertBulk) UpdateChannelName

func (u *YouTubeTalentUpsertBulk) UpdateChannelName() *YouTubeTalentUpsertBulk

UpdateChannelName sets the "channel_name" field to the value that was provided on create.

func (*YouTubeTalentUpsertBulk) UpdateDisabled

func (u *YouTubeTalentUpsertBulk) UpdateDisabled() *YouTubeTalentUpsertBulk

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*YouTubeTalentUpsertBulk) UpdateDisabledPermanently

func (u *YouTubeTalentUpsertBulk) UpdateDisabledPermanently() *YouTubeTalentUpsertBulk

UpdateDisabledPermanently sets the "disabled_permanently" field to the value that was provided on create.

func (*YouTubeTalentUpsertBulk) UpdateLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsertBulk) UpdateLastMembershipVideoIDMiss() *YouTubeTalentUpsertBulk

UpdateLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field to the value that was provided on create.

func (*YouTubeTalentUpsertBulk) UpdateLastUpdated

func (u *YouTubeTalentUpsertBulk) UpdateLastUpdated() *YouTubeTalentUpsertBulk

UpdateLastUpdated sets the "last_updated" field to the value that was provided on create.

func (*YouTubeTalentUpsertBulk) UpdateMembershipVideoID

func (u *YouTubeTalentUpsertBulk) UpdateMembershipVideoID() *YouTubeTalentUpsertBulk

UpdateMembershipVideoID sets the "membership_video_id" field to the value that was provided on create.

func (*YouTubeTalentUpsertBulk) UpdateNewValues

func (u *YouTubeTalentUpsertBulk) UpdateNewValues() *YouTubeTalentUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.YouTubeTalent.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(youtubetalent.FieldID)
		}),
	).
	Exec(ctx)

func (*YouTubeTalentUpsertBulk) UpdateThumbnailURL

func (u *YouTubeTalentUpsertBulk) UpdateThumbnailURL() *YouTubeTalentUpsertBulk

UpdateThumbnailURL sets the "thumbnail_url" field to the value that was provided on create.

type YouTubeTalentUpsertOne

type YouTubeTalentUpsertOne struct {
	// contains filtered or unexported fields
}

YouTubeTalentUpsertOne is the builder for "upsert"-ing

one YouTubeTalent node.

func (*YouTubeTalentUpsertOne) ClearDisabled

func (u *YouTubeTalentUpsertOne) ClearDisabled() *YouTubeTalentUpsertOne

ClearDisabled clears the value of the "disabled" field.

func (*YouTubeTalentUpsertOne) ClearLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsertOne) ClearLastMembershipVideoIDMiss() *YouTubeTalentUpsertOne

ClearLastMembershipVideoIDMiss clears the value of the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpsertOne) ClearMembershipVideoID

func (u *YouTubeTalentUpsertOne) ClearMembershipVideoID() *YouTubeTalentUpsertOne

ClearMembershipVideoID clears the value of the "membership_video_id" field.

func (*YouTubeTalentUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*YouTubeTalentUpsertOne) Exec

Exec executes the query.

func (*YouTubeTalentUpsertOne) ExecX

func (u *YouTubeTalentUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*YouTubeTalentUpsertOne) ID

func (u *YouTubeTalentUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*YouTubeTalentUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*YouTubeTalentUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.YouTubeTalent.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*YouTubeTalentUpsertOne) SetChannelName

SetChannelName sets the "channel_name" field.

func (*YouTubeTalentUpsertOne) SetDisabled

SetDisabled sets the "disabled" field.

func (*YouTubeTalentUpsertOne) SetDisabledPermanently

func (u *YouTubeTalentUpsertOne) SetDisabledPermanently(v bool) *YouTubeTalentUpsertOne

SetDisabledPermanently sets the "disabled_permanently" field.

func (*YouTubeTalentUpsertOne) SetLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsertOne) SetLastMembershipVideoIDMiss(v time.Time) *YouTubeTalentUpsertOne

SetLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field.

func (*YouTubeTalentUpsertOne) SetLastUpdated

SetLastUpdated sets the "last_updated" field.

func (*YouTubeTalentUpsertOne) SetMembershipVideoID

func (u *YouTubeTalentUpsertOne) SetMembershipVideoID(v string) *YouTubeTalentUpsertOne

SetMembershipVideoID sets the "membership_video_id" field.

func (*YouTubeTalentUpsertOne) SetThumbnailURL

func (u *YouTubeTalentUpsertOne) SetThumbnailURL(v string) *YouTubeTalentUpsertOne

SetThumbnailURL sets the "thumbnail_url" field.

func (*YouTubeTalentUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the YouTubeTalentCreate.OnConflict documentation for more info.

func (*YouTubeTalentUpsertOne) UpdateChannelName

func (u *YouTubeTalentUpsertOne) UpdateChannelName() *YouTubeTalentUpsertOne

UpdateChannelName sets the "channel_name" field to the value that was provided on create.

func (*YouTubeTalentUpsertOne) UpdateDisabled

func (u *YouTubeTalentUpsertOne) UpdateDisabled() *YouTubeTalentUpsertOne

UpdateDisabled sets the "disabled" field to the value that was provided on create.

func (*YouTubeTalentUpsertOne) UpdateDisabledPermanently

func (u *YouTubeTalentUpsertOne) UpdateDisabledPermanently() *YouTubeTalentUpsertOne

UpdateDisabledPermanently sets the "disabled_permanently" field to the value that was provided on create.

func (*YouTubeTalentUpsertOne) UpdateLastMembershipVideoIDMiss

func (u *YouTubeTalentUpsertOne) UpdateLastMembershipVideoIDMiss() *YouTubeTalentUpsertOne

UpdateLastMembershipVideoIDMiss sets the "last_membership_video_id_miss" field to the value that was provided on create.

func (*YouTubeTalentUpsertOne) UpdateLastUpdated

func (u *YouTubeTalentUpsertOne) UpdateLastUpdated() *YouTubeTalentUpsertOne

UpdateLastUpdated sets the "last_updated" field to the value that was provided on create.

func (*YouTubeTalentUpsertOne) UpdateMembershipVideoID

func (u *YouTubeTalentUpsertOne) UpdateMembershipVideoID() *YouTubeTalentUpsertOne

UpdateMembershipVideoID sets the "membership_video_id" field to the value that was provided on create.

func (*YouTubeTalentUpsertOne) UpdateNewValues

func (u *YouTubeTalentUpsertOne) UpdateNewValues() *YouTubeTalentUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.YouTubeTalent.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(youtubetalent.FieldID)
		}),
	).
	Exec(ctx)

func (*YouTubeTalentUpsertOne) UpdateThumbnailURL

func (u *YouTubeTalentUpsertOne) UpdateThumbnailURL() *YouTubeTalentUpsertOne

UpdateThumbnailURL sets the "thumbnail_url" field to the value that was provided on create.

type YouTubeTalents

type YouTubeTalents []*YouTubeTalent

YouTubeTalents is a parsable slice of YouTubeTalent.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL