ent

package
v0.0.0-...-910bef7 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: GPL-3.0 Imports: 32 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.
	TypeActors     = "Actors"
	TypeAlbums     = "Albums"
	TypeArtists    = "Artists"
	TypeAudiobooks = "Audiobooks"
	TypeCategorys  = "Categorys"
	TypeDevices    = "Devices"
	TypeDirectors  = "Directors"
	TypeFiles      = "Files"
	TypeImages     = "Images"
	TypeMusics     = "Musics"
	TypeOidc       = "Oidc"
	TypePlaylists  = "Playlists"
	TypeUsers      = "Users"
	TypeVideos     = "Videos"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Actors

type Actors struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Actors is the model entity for the Actors schema.

func (*Actors) String

func (a *Actors) String() string

String implements the fmt.Stringer.

func (*Actors) Unwrap

func (a *Actors) Unwrap() *Actors

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

func (a *Actors) Update() *ActorsUpdateOne

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

func (*Actors) Value

func (a *Actors) Value(name string) (ent.Value, error)

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

type ActorsClient

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

ActorsClient is a client for the Actors schema.

func NewActorsClient

func NewActorsClient(c config) *ActorsClient

NewActorsClient returns a client for the Actors from the given config.

func (*ActorsClient) Create

func (c *ActorsClient) Create() *ActorsCreate

Create returns a builder for creating a Actors entity.

func (*ActorsClient) CreateBulk

func (c *ActorsClient) CreateBulk(builders ...*ActorsCreate) *ActorsCreateBulk

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

func (*ActorsClient) Delete

func (c *ActorsClient) Delete() *ActorsDelete

Delete returns a delete builder for Actors.

func (*ActorsClient) DeleteOne

func (c *ActorsClient) DeleteOne(a *Actors) *ActorsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ActorsClient) DeleteOneID

func (c *ActorsClient) DeleteOneID(id int) *ActorsDeleteOne

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

func (*ActorsClient) Get

func (c *ActorsClient) Get(ctx context.Context, id int) (*Actors, error)

Get returns a Actors entity by its id.

func (*ActorsClient) GetX

func (c *ActorsClient) GetX(ctx context.Context, id int) *Actors

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

func (*ActorsClient) Hooks

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

Hooks returns the client hooks.

func (*ActorsClient) Intercept

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

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

func (*ActorsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ActorsClient) MapCreateBulk

func (c *ActorsClient) MapCreateBulk(slice any, setFunc func(*ActorsCreate, int)) *ActorsCreateBulk

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

func (*ActorsClient) Query

func (c *ActorsClient) Query() *ActorsQuery

Query returns a query builder for Actors.

func (*ActorsClient) Update

func (c *ActorsClient) Update() *ActorsUpdate

Update returns an update builder for Actors.

func (*ActorsClient) UpdateOne

func (c *ActorsClient) UpdateOne(a *Actors) *ActorsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ActorsClient) UpdateOneID

func (c *ActorsClient) UpdateOneID(id int) *ActorsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ActorsClient) Use

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

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

type ActorsCreate

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

ActorsCreate is the builder for creating a Actors entity.

func (*ActorsCreate) Exec

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

Exec executes the query.

func (*ActorsCreate) ExecX

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

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

func (*ActorsCreate) Mutation

func (ac *ActorsCreate) Mutation() *ActorsMutation

Mutation returns the ActorsMutation object of the builder.

func (*ActorsCreate) Save

func (ac *ActorsCreate) Save(ctx context.Context) (*Actors, error)

Save creates the Actors in the database.

func (*ActorsCreate) SaveX

func (ac *ActorsCreate) SaveX(ctx context.Context) *Actors

SaveX calls Save and panics if Save returns an error.

type ActorsCreateBulk

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

ActorsCreateBulk is the builder for creating many Actors entities in bulk.

func (*ActorsCreateBulk) Exec

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

Exec executes the query.

func (*ActorsCreateBulk) ExecX

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

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

func (*ActorsCreateBulk) Save

func (acb *ActorsCreateBulk) Save(ctx context.Context) ([]*Actors, error)

Save creates the Actors entities in the database.

func (*ActorsCreateBulk) SaveX

func (acb *ActorsCreateBulk) SaveX(ctx context.Context) []*Actors

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

type ActorsDelete

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

ActorsDelete is the builder for deleting a Actors entity.

func (*ActorsDelete) Exec

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

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

func (*ActorsDelete) ExecX

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

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

func (*ActorsDelete) Where

func (ad *ActorsDelete) Where(ps ...predicate.Actors) *ActorsDelete

Where appends a list predicates to the ActorsDelete builder.

type ActorsDeleteOne

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

ActorsDeleteOne is the builder for deleting a single Actors entity.

func (*ActorsDeleteOne) Exec

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

Exec executes the deletion query.

func (*ActorsDeleteOne) ExecX

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

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

func (*ActorsDeleteOne) Where

func (ado *ActorsDeleteOne) Where(ps ...predicate.Actors) *ActorsDeleteOne

Where appends a list predicates to the ActorsDelete builder.

type ActorsGroupBy

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

ActorsGroupBy is the group-by builder for Actors entities.

func (*ActorsGroupBy) Aggregate

func (agb *ActorsGroupBy) Aggregate(fns ...AggregateFunc) *ActorsGroupBy

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

func (*ActorsGroupBy) Bool

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

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

func (*ActorsGroupBy) BoolX

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

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

func (*ActorsGroupBy) Bools

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

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

func (*ActorsGroupBy) BoolsX

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

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

func (*ActorsGroupBy) Float64

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

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

func (*ActorsGroupBy) Float64X

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

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

func (*ActorsGroupBy) Float64s

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

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

func (*ActorsGroupBy) Float64sX

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

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

func (*ActorsGroupBy) Int

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

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

func (*ActorsGroupBy) IntX

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

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

func (*ActorsGroupBy) Ints

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

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

func (*ActorsGroupBy) IntsX

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

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

func (*ActorsGroupBy) Scan

func (agb *ActorsGroupBy) Scan(ctx context.Context, v any) error

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

func (*ActorsGroupBy) ScanX

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

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

func (*ActorsGroupBy) String

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

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

func (*ActorsGroupBy) StringX

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

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

func (*ActorsGroupBy) Strings

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

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

func (*ActorsGroupBy) StringsX

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

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

type ActorsMutation

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

ActorsMutation represents an operation that mutates the Actors nodes in the graph.

func (*ActorsMutation) AddField

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

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

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

func (*ActorsMutation) AddedField

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

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

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

func (*ActorsMutation) AddedIDs

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

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

func (*ActorsMutation) ClearEdge

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

func (m *ActorsMutation) 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 (*ActorsMutation) ClearedEdges

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

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

func (*ActorsMutation) ClearedFields

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

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

func (ActorsMutation) Client

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

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

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

func (*ActorsMutation) Field

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

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

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

func (*ActorsMutation) Fields

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

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

func (m *ActorsMutation) 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 (*ActorsMutation) OldField

func (m *ActorsMutation) 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 (*ActorsMutation) Op

func (m *ActorsMutation) Op() Op

Op returns the operation name.

func (*ActorsMutation) RemovedEdges

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

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

func (*ActorsMutation) RemovedIDs

func (m *ActorsMutation) 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 (*ActorsMutation) ResetEdge

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

func (m *ActorsMutation) 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 (*ActorsMutation) SetField

func (m *ActorsMutation) 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 (*ActorsMutation) SetOp

func (m *ActorsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ActorsMutation) Tx

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

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

func (*ActorsMutation) Type

func (m *ActorsMutation) Type() string

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

func (*ActorsMutation) Where

func (m *ActorsMutation) Where(ps ...predicate.Actors)

Where appends a list predicates to the ActorsMutation builder.

func (*ActorsMutation) WhereP

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

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

type ActorsQuery

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

ActorsQuery is the builder for querying Actors entities.

func (*ActorsQuery) Aggregate

func (aq *ActorsQuery) Aggregate(fns ...AggregateFunc) *ActorsSelect

Aggregate returns a ActorsSelect configured with the given aggregations.

func (*ActorsQuery) All

func (aq *ActorsQuery) All(ctx context.Context) ([]*Actors, error)

All executes the query and returns a list of ActorsSlice.

func (*ActorsQuery) AllX

func (aq *ActorsQuery) AllX(ctx context.Context) []*Actors

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

func (*ActorsQuery) Clone

func (aq *ActorsQuery) Clone() *ActorsQuery

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

func (*ActorsQuery) Count

func (aq *ActorsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ActorsQuery) CountX

func (aq *ActorsQuery) CountX(ctx context.Context) int

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

func (*ActorsQuery) Exist

func (aq *ActorsQuery) Exist(ctx context.Context) (bool, error)

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

func (*ActorsQuery) ExistX

func (aq *ActorsQuery) ExistX(ctx context.Context) bool

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

func (*ActorsQuery) First

func (aq *ActorsQuery) First(ctx context.Context) (*Actors, error)

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

func (*ActorsQuery) FirstID

func (aq *ActorsQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ActorsQuery) FirstIDX

func (aq *ActorsQuery) FirstIDX(ctx context.Context) int

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

func (*ActorsQuery) FirstX

func (aq *ActorsQuery) FirstX(ctx context.Context) *Actors

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

func (*ActorsQuery) GroupBy

func (aq *ActorsQuery) GroupBy(field string, fields ...string) *ActorsGroupBy

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

func (*ActorsQuery) IDs

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

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

func (*ActorsQuery) IDsX

func (aq *ActorsQuery) IDsX(ctx context.Context) []int

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

func (*ActorsQuery) Limit

func (aq *ActorsQuery) Limit(limit int) *ActorsQuery

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

func (*ActorsQuery) Offset

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

Offset to start from.

func (*ActorsQuery) Only

func (aq *ActorsQuery) Only(ctx context.Context) (*Actors, error)

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

func (*ActorsQuery) OnlyID

func (aq *ActorsQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ActorsQuery) OnlyIDX

func (aq *ActorsQuery) OnlyIDX(ctx context.Context) int

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

func (*ActorsQuery) OnlyX

func (aq *ActorsQuery) OnlyX(ctx context.Context) *Actors

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

func (*ActorsQuery) Order

func (aq *ActorsQuery) Order(o ...actors.OrderOption) *ActorsQuery

Order specifies how the records should be ordered.

func (*ActorsQuery) Select

func (aq *ActorsQuery) Select(fields ...string) *ActorsSelect

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

func (*ActorsQuery) Unique

func (aq *ActorsQuery) Unique(unique bool) *ActorsQuery

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

func (aq *ActorsQuery) Where(ps ...predicate.Actors) *ActorsQuery

Where adds a new predicate for the ActorsQuery builder.

type ActorsSelect

type ActorsSelect struct {
	*ActorsQuery
	// contains filtered or unexported fields
}

ActorsSelect is the builder for selecting fields of Actors entities.

func (*ActorsSelect) Aggregate

func (as *ActorsSelect) Aggregate(fns ...AggregateFunc) *ActorsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ActorsSelect) Bool

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

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

func (*ActorsSelect) BoolX

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

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

func (*ActorsSelect) Bools

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

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

func (*ActorsSelect) BoolsX

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

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

func (*ActorsSelect) Float64

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

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

func (*ActorsSelect) Float64X

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

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

func (*ActorsSelect) Float64s

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

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

func (*ActorsSelect) Float64sX

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

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

func (*ActorsSelect) Int

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

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

func (*ActorsSelect) IntX

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

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

func (*ActorsSelect) Ints

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

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

func (*ActorsSelect) IntsX

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

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

func (*ActorsSelect) Scan

func (as *ActorsSelect) Scan(ctx context.Context, v any) error

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

func (*ActorsSelect) ScanX

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

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

func (*ActorsSelect) String

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

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

func (*ActorsSelect) StringX

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

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

func (*ActorsSelect) Strings

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

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

func (*ActorsSelect) StringsX

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

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

type ActorsSlice

type ActorsSlice []*Actors

ActorsSlice is a parsable slice of Actors.

type ActorsUpdate

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

ActorsUpdate is the builder for updating Actors entities.

func (*ActorsUpdate) Exec

func (au *ActorsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ActorsUpdate) ExecX

func (au *ActorsUpdate) ExecX(ctx context.Context)

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

func (*ActorsUpdate) Mutation

func (au *ActorsUpdate) Mutation() *ActorsMutation

Mutation returns the ActorsMutation object of the builder.

func (*ActorsUpdate) Save

func (au *ActorsUpdate) Save(ctx context.Context) (int, error)

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

func (*ActorsUpdate) SaveX

func (au *ActorsUpdate) SaveX(ctx context.Context) int

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

func (*ActorsUpdate) Where

func (au *ActorsUpdate) Where(ps ...predicate.Actors) *ActorsUpdate

Where appends a list predicates to the ActorsUpdate builder.

type ActorsUpdateOne

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

ActorsUpdateOne is the builder for updating a single Actors entity.

func (*ActorsUpdateOne) Exec

func (auo *ActorsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ActorsUpdateOne) ExecX

func (auo *ActorsUpdateOne) ExecX(ctx context.Context)

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

func (*ActorsUpdateOne) Mutation

func (auo *ActorsUpdateOne) Mutation() *ActorsMutation

Mutation returns the ActorsMutation object of the builder.

func (*ActorsUpdateOne) Save

func (auo *ActorsUpdateOne) Save(ctx context.Context) (*Actors, error)

Save executes the query and returns the updated Actors entity.

func (*ActorsUpdateOne) SaveX

func (auo *ActorsUpdateOne) SaveX(ctx context.Context) *Actors

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

func (*ActorsUpdateOne) Select

func (auo *ActorsUpdateOne) Select(field string, fields ...string) *ActorsUpdateOne

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

func (*ActorsUpdateOne) Where

func (auo *ActorsUpdateOne) Where(ps ...predicate.Actors) *ActorsUpdateOne

Where appends a list predicates to the ActorsUpdate builder.

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 Albums

type Albums struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Date holds the value of the "date" field.
	Date string `json:"date,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AlbumsQuery when eager-loading is set.
	Edges AlbumsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Albums is the model entity for the Albums schema.

func (*Albums) QueryArtists

func (a *Albums) QueryArtists() *ArtistsQuery

QueryArtists queries the "artists" edge of the Albums entity.

func (*Albums) QueryImage

func (a *Albums) QueryImage() *ImagesQuery

QueryImage queries the "image" edge of the Albums entity.

func (*Albums) QueryMusics

func (a *Albums) QueryMusics() *MusicsQuery

QueryMusics queries the "musics" edge of the Albums entity.

func (*Albums) QueryUsers

func (a *Albums) QueryUsers() *UsersQuery

QueryUsers queries the "users" edge of the Albums entity.

func (*Albums) String

func (a *Albums) String() string

String implements the fmt.Stringer.

func (*Albums) Unwrap

func (a *Albums) Unwrap() *Albums

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

func (a *Albums) Update() *AlbumsUpdateOne

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

func (*Albums) Value

func (a *Albums) Value(name string) (ent.Value, error)

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

type AlbumsClient

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

AlbumsClient is a client for the Albums schema.

func NewAlbumsClient

func NewAlbumsClient(c config) *AlbumsClient

NewAlbumsClient returns a client for the Albums from the given config.

func (*AlbumsClient) Create

func (c *AlbumsClient) Create() *AlbumsCreate

Create returns a builder for creating a Albums entity.

func (*AlbumsClient) CreateBulk

func (c *AlbumsClient) CreateBulk(builders ...*AlbumsCreate) *AlbumsCreateBulk

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

func (*AlbumsClient) Delete

func (c *AlbumsClient) Delete() *AlbumsDelete

Delete returns a delete builder for Albums.

func (*AlbumsClient) DeleteOne

func (c *AlbumsClient) DeleteOne(a *Albums) *AlbumsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AlbumsClient) DeleteOneID

func (c *AlbumsClient) DeleteOneID(id uint64) *AlbumsDeleteOne

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

func (*AlbumsClient) Get

func (c *AlbumsClient) Get(ctx context.Context, id uint64) (*Albums, error)

Get returns a Albums entity by its id.

func (*AlbumsClient) GetX

func (c *AlbumsClient) GetX(ctx context.Context, id uint64) *Albums

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

func (*AlbumsClient) Hooks

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

Hooks returns the client hooks.

func (*AlbumsClient) Intercept

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

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

func (*AlbumsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AlbumsClient) MapCreateBulk

func (c *AlbumsClient) MapCreateBulk(slice any, setFunc func(*AlbumsCreate, int)) *AlbumsCreateBulk

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

func (*AlbumsClient) Query

func (c *AlbumsClient) Query() *AlbumsQuery

Query returns a query builder for Albums.

func (*AlbumsClient) QueryArtists

func (c *AlbumsClient) QueryArtists(a *Albums) *ArtistsQuery

QueryArtists queries the artists edge of a Albums.

func (*AlbumsClient) QueryImage

func (c *AlbumsClient) QueryImage(a *Albums) *ImagesQuery

QueryImage queries the image edge of a Albums.

func (*AlbumsClient) QueryMusics

func (c *AlbumsClient) QueryMusics(a *Albums) *MusicsQuery

QueryMusics queries the musics edge of a Albums.

func (*AlbumsClient) QueryUsers

func (c *AlbumsClient) QueryUsers(a *Albums) *UsersQuery

QueryUsers queries the users edge of a Albums.

func (*AlbumsClient) Update

func (c *AlbumsClient) Update() *AlbumsUpdate

Update returns an update builder for Albums.

func (*AlbumsClient) UpdateOne

func (c *AlbumsClient) UpdateOne(a *Albums) *AlbumsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AlbumsClient) UpdateOneID

func (c *AlbumsClient) UpdateOneID(id uint64) *AlbumsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AlbumsClient) Use

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

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

type AlbumsCreate

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

AlbumsCreate is the builder for creating a Albums entity.

func (*AlbumsCreate) AddArtistIDs

func (ac *AlbumsCreate) AddArtistIDs(ids ...uint64) *AlbumsCreate

AddArtistIDs adds the "artists" edge to the Artists entity by IDs.

func (*AlbumsCreate) AddArtists

func (ac *AlbumsCreate) AddArtists(a ...*Artists) *AlbumsCreate

AddArtists adds the "artists" edges to the Artists entity.

func (*AlbumsCreate) AddMusicIDs

func (ac *AlbumsCreate) AddMusicIDs(ids ...uint64) *AlbumsCreate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*AlbumsCreate) AddMusics

func (ac *AlbumsCreate) AddMusics(m ...*Musics) *AlbumsCreate

AddMusics adds the "musics" edges to the Musics entity.

func (*AlbumsCreate) AddUserIDs

func (ac *AlbumsCreate) AddUserIDs(ids ...uint64) *AlbumsCreate

AddUserIDs adds the "users" edge to the Users entity by IDs.

func (*AlbumsCreate) AddUsers

func (ac *AlbumsCreate) AddUsers(u ...*Users) *AlbumsCreate

AddUsers adds the "users" edges to the Users entity.

func (*AlbumsCreate) Exec

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

Exec executes the query.

func (*AlbumsCreate) ExecX

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

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

func (*AlbumsCreate) Mutation

func (ac *AlbumsCreate) Mutation() *AlbumsMutation

Mutation returns the AlbumsMutation object of the builder.

func (*AlbumsCreate) Save

func (ac *AlbumsCreate) Save(ctx context.Context) (*Albums, error)

Save creates the Albums in the database.

func (*AlbumsCreate) SaveX

func (ac *AlbumsCreate) SaveX(ctx context.Context) *Albums

SaveX calls Save and panics if Save returns an error.

func (*AlbumsCreate) SetCreateTime

func (ac *AlbumsCreate) SetCreateTime(t time.Time) *AlbumsCreate

SetCreateTime sets the "create_time" field.

func (*AlbumsCreate) SetDate

func (ac *AlbumsCreate) SetDate(s string) *AlbumsCreate

SetDate sets the "date" field.

func (*AlbumsCreate) SetDescription

func (ac *AlbumsCreate) SetDescription(s string) *AlbumsCreate

SetDescription sets the "description" field.

func (*AlbumsCreate) SetID

func (ac *AlbumsCreate) SetID(u uint64) *AlbumsCreate

SetID sets the "id" field.

func (*AlbumsCreate) SetImage

func (ac *AlbumsCreate) SetImage(i *Images) *AlbumsCreate

SetImage sets the "image" edge to the Images entity.

func (*AlbumsCreate) SetImageID

func (ac *AlbumsCreate) SetImageID(id uint64) *AlbumsCreate

SetImageID sets the "image" edge to the Images entity by ID.

func (*AlbumsCreate) SetNillableCreateTime

func (ac *AlbumsCreate) SetNillableCreateTime(t *time.Time) *AlbumsCreate

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

func (*AlbumsCreate) SetNillableDescription

func (ac *AlbumsCreate) SetNillableDescription(s *string) *AlbumsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AlbumsCreate) SetNillableUpdateTime

func (ac *AlbumsCreate) SetNillableUpdateTime(t *time.Time) *AlbumsCreate

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

func (*AlbumsCreate) SetTitle

func (ac *AlbumsCreate) SetTitle(s string) *AlbumsCreate

SetTitle sets the "title" field.

func (*AlbumsCreate) SetUpdateTime

func (ac *AlbumsCreate) SetUpdateTime(t time.Time) *AlbumsCreate

SetUpdateTime sets the "update_time" field.

type AlbumsCreateBulk

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

AlbumsCreateBulk is the builder for creating many Albums entities in bulk.

func (*AlbumsCreateBulk) Exec

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

Exec executes the query.

func (*AlbumsCreateBulk) ExecX

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

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

func (*AlbumsCreateBulk) Save

func (acb *AlbumsCreateBulk) Save(ctx context.Context) ([]*Albums, error)

Save creates the Albums entities in the database.

func (*AlbumsCreateBulk) SaveX

func (acb *AlbumsCreateBulk) SaveX(ctx context.Context) []*Albums

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

type AlbumsDelete

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

AlbumsDelete is the builder for deleting a Albums entity.

func (*AlbumsDelete) Exec

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

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

func (*AlbumsDelete) ExecX

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

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

func (*AlbumsDelete) Where

func (ad *AlbumsDelete) Where(ps ...predicate.Albums) *AlbumsDelete

Where appends a list predicates to the AlbumsDelete builder.

type AlbumsDeleteOne

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

AlbumsDeleteOne is the builder for deleting a single Albums entity.

func (*AlbumsDeleteOne) Exec

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

Exec executes the deletion query.

func (*AlbumsDeleteOne) ExecX

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

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

func (*AlbumsDeleteOne) Where

func (ado *AlbumsDeleteOne) Where(ps ...predicate.Albums) *AlbumsDeleteOne

Where appends a list predicates to the AlbumsDelete builder.

type AlbumsEdges

type AlbumsEdges struct {
	// Image holds the value of the image edge.
	Image *Images `json:"image,omitempty"`
	// Musics holds the value of the musics edge.
	Musics []*Musics `json:"musics,omitempty"`
	// Users holds the value of the users edge.
	Users []*Users `json:"users,omitempty"`
	// Artists holds the value of the artists edge.
	Artists []*Artists `json:"artists,omitempty"`
	// contains filtered or unexported fields
}

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

func (AlbumsEdges) ArtistsOrErr

func (e AlbumsEdges) ArtistsOrErr() ([]*Artists, error)

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

func (AlbumsEdges) ImageOrErr

func (e AlbumsEdges) ImageOrErr() (*Images, error)

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

func (AlbumsEdges) MusicsOrErr

func (e AlbumsEdges) MusicsOrErr() ([]*Musics, error)

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

func (AlbumsEdges) UsersOrErr

func (e AlbumsEdges) UsersOrErr() ([]*Users, error)

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

type AlbumsGroupBy

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

AlbumsGroupBy is the group-by builder for Albums entities.

func (*AlbumsGroupBy) Aggregate

func (agb *AlbumsGroupBy) Aggregate(fns ...AggregateFunc) *AlbumsGroupBy

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

func (*AlbumsGroupBy) Bool

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

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

func (*AlbumsGroupBy) BoolX

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

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

func (*AlbumsGroupBy) Bools

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

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

func (*AlbumsGroupBy) BoolsX

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

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

func (*AlbumsGroupBy) Float64

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

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

func (*AlbumsGroupBy) Float64X

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

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

func (*AlbumsGroupBy) Float64s

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

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

func (*AlbumsGroupBy) Float64sX

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

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

func (*AlbumsGroupBy) Int

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

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

func (*AlbumsGroupBy) IntX

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

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

func (*AlbumsGroupBy) Ints

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

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

func (*AlbumsGroupBy) IntsX

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

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

func (*AlbumsGroupBy) Scan

func (agb *AlbumsGroupBy) Scan(ctx context.Context, v any) error

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

func (*AlbumsGroupBy) ScanX

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

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

func (*AlbumsGroupBy) String

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

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

func (*AlbumsGroupBy) StringX

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

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

func (*AlbumsGroupBy) Strings

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

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

func (*AlbumsGroupBy) StringsX

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

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

type AlbumsMutation

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

AlbumsMutation represents an operation that mutates the Albums nodes in the graph.

func (*AlbumsMutation) AddArtistIDs

func (m *AlbumsMutation) AddArtistIDs(ids ...uint64)

AddArtistIDs adds the "artists" edge to the Artists entity by ids.

func (*AlbumsMutation) AddField

func (m *AlbumsMutation) 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 (*AlbumsMutation) AddMusicIDs

func (m *AlbumsMutation) AddMusicIDs(ids ...uint64)

AddMusicIDs adds the "musics" edge to the Musics entity by ids.

func (*AlbumsMutation) AddUserIDs

func (m *AlbumsMutation) AddUserIDs(ids ...uint64)

AddUserIDs adds the "users" edge to the Users entity by ids.

func (*AlbumsMutation) AddedEdges

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

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

func (*AlbumsMutation) AddedField

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

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

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

func (*AlbumsMutation) AddedIDs

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

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

func (*AlbumsMutation) ArtistsCleared

func (m *AlbumsMutation) ArtistsCleared() bool

ArtistsCleared reports if the "artists" edge to the Artists entity was cleared.

func (*AlbumsMutation) ArtistsIDs

func (m *AlbumsMutation) ArtistsIDs() (ids []uint64)

ArtistsIDs returns the "artists" edge IDs in the mutation.

func (*AlbumsMutation) ClearArtists

func (m *AlbumsMutation) ClearArtists()

ClearArtists clears the "artists" edge to the Artists entity.

func (*AlbumsMutation) ClearDescription

func (m *AlbumsMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*AlbumsMutation) ClearEdge

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

func (m *AlbumsMutation) 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 (*AlbumsMutation) ClearImage

func (m *AlbumsMutation) ClearImage()

ClearImage clears the "image" edge to the Images entity.

func (*AlbumsMutation) ClearMusics

func (m *AlbumsMutation) ClearMusics()

ClearMusics clears the "musics" edge to the Musics entity.

func (*AlbumsMutation) ClearUsers

func (m *AlbumsMutation) ClearUsers()

ClearUsers clears the "users" edge to the Users entity.

func (*AlbumsMutation) ClearedEdges

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

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

func (*AlbumsMutation) ClearedFields

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

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

func (AlbumsMutation) Client

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

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

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

func (*AlbumsMutation) Date

func (m *AlbumsMutation) Date() (r string, exists bool)

Date returns the value of the "date" field in the mutation.

func (*AlbumsMutation) Description

func (m *AlbumsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*AlbumsMutation) DescriptionCleared

func (m *AlbumsMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*AlbumsMutation) EdgeCleared

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

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

func (*AlbumsMutation) Field

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

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

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

func (*AlbumsMutation) Fields

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

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

func (m *AlbumsMutation) 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 (*AlbumsMutation) ImageCleared

func (m *AlbumsMutation) ImageCleared() bool

ImageCleared reports if the "image" edge to the Images entity was cleared.

func (*AlbumsMutation) ImageID

func (m *AlbumsMutation) ImageID() (id uint64, exists bool)

ImageID returns the "image" edge ID in the mutation.

func (*AlbumsMutation) ImageIDs

func (m *AlbumsMutation) ImageIDs() (ids []uint64)

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

func (*AlbumsMutation) MusicsCleared

func (m *AlbumsMutation) MusicsCleared() bool

MusicsCleared reports if the "musics" edge to the Musics entity was cleared.

func (*AlbumsMutation) MusicsIDs

func (m *AlbumsMutation) MusicsIDs() (ids []uint64)

MusicsIDs returns the "musics" edge IDs in the mutation.

func (*AlbumsMutation) OldCreateTime

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

OldCreateTime returns the old "create_time" field's value of the Albums entity. If the Albums 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 (*AlbumsMutation) OldDate

func (m *AlbumsMutation) OldDate(ctx context.Context) (v string, err error)

OldDate returns the old "date" field's value of the Albums entity. If the Albums 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 (*AlbumsMutation) OldDescription

func (m *AlbumsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Albums entity. If the Albums 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 (*AlbumsMutation) OldField

func (m *AlbumsMutation) 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 (*AlbumsMutation) OldTitle

func (m *AlbumsMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Albums entity. If the Albums 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 (*AlbumsMutation) OldUpdateTime

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

OldUpdateTime returns the old "update_time" field's value of the Albums entity. If the Albums 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 (*AlbumsMutation) Op

func (m *AlbumsMutation) Op() Op

Op returns the operation name.

func (*AlbumsMutation) RemoveArtistIDs

func (m *AlbumsMutation) RemoveArtistIDs(ids ...uint64)

RemoveArtistIDs removes the "artists" edge to the Artists entity by IDs.

func (*AlbumsMutation) RemoveMusicIDs

func (m *AlbumsMutation) RemoveMusicIDs(ids ...uint64)

RemoveMusicIDs removes the "musics" edge to the Musics entity by IDs.

func (*AlbumsMutation) RemoveUserIDs

func (m *AlbumsMutation) RemoveUserIDs(ids ...uint64)

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

func (*AlbumsMutation) RemovedArtistsIDs

func (m *AlbumsMutation) RemovedArtistsIDs() (ids []uint64)

RemovedArtists returns the removed IDs of the "artists" edge to the Artists entity.

func (*AlbumsMutation) RemovedEdges

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

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

func (*AlbumsMutation) RemovedIDs

func (m *AlbumsMutation) 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 (*AlbumsMutation) RemovedMusicsIDs

func (m *AlbumsMutation) RemovedMusicsIDs() (ids []uint64)

RemovedMusics returns the removed IDs of the "musics" edge to the Musics entity.

func (*AlbumsMutation) RemovedUsersIDs

func (m *AlbumsMutation) RemovedUsersIDs() (ids []uint64)

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

func (*AlbumsMutation) ResetArtists

func (m *AlbumsMutation) ResetArtists()

ResetArtists resets all changes to the "artists" edge.

func (*AlbumsMutation) ResetCreateTime

func (m *AlbumsMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*AlbumsMutation) ResetDate

func (m *AlbumsMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*AlbumsMutation) ResetDescription

func (m *AlbumsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AlbumsMutation) ResetEdge

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

func (m *AlbumsMutation) 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 (*AlbumsMutation) ResetImage

func (m *AlbumsMutation) ResetImage()

ResetImage resets all changes to the "image" edge.

func (*AlbumsMutation) ResetMusics

func (m *AlbumsMutation) ResetMusics()

ResetMusics resets all changes to the "musics" edge.

func (*AlbumsMutation) ResetTitle

func (m *AlbumsMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*AlbumsMutation) ResetUpdateTime

func (m *AlbumsMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*AlbumsMutation) ResetUsers

func (m *AlbumsMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*AlbumsMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*AlbumsMutation) SetDate

func (m *AlbumsMutation) SetDate(s string)

SetDate sets the "date" field.

func (*AlbumsMutation) SetDescription

func (m *AlbumsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AlbumsMutation) SetField

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

func (m *AlbumsMutation) SetID(id uint64)

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

func (*AlbumsMutation) SetImageID

func (m *AlbumsMutation) SetImageID(id uint64)

SetImageID sets the "image" edge to the Images entity by id.

func (*AlbumsMutation) SetOp

func (m *AlbumsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AlbumsMutation) SetTitle

func (m *AlbumsMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*AlbumsMutation) SetUpdateTime

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

SetUpdateTime sets the "update_time" field.

func (*AlbumsMutation) Title

func (m *AlbumsMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (AlbumsMutation) Tx

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

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

func (*AlbumsMutation) Type

func (m *AlbumsMutation) Type() string

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

func (*AlbumsMutation) UpdateTime

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

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

func (*AlbumsMutation) UsersCleared

func (m *AlbumsMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the Users entity was cleared.

func (*AlbumsMutation) UsersIDs

func (m *AlbumsMutation) UsersIDs() (ids []uint64)

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

func (*AlbumsMutation) Where

func (m *AlbumsMutation) Where(ps ...predicate.Albums)

Where appends a list predicates to the AlbumsMutation builder.

func (*AlbumsMutation) WhereP

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

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

type AlbumsQuery

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

AlbumsQuery is the builder for querying Albums entities.

func (*AlbumsQuery) Aggregate

func (aq *AlbumsQuery) Aggregate(fns ...AggregateFunc) *AlbumsSelect

Aggregate returns a AlbumsSelect configured with the given aggregations.

func (*AlbumsQuery) All

func (aq *AlbumsQuery) All(ctx context.Context) ([]*Albums, error)

All executes the query and returns a list of AlbumsSlice.

func (*AlbumsQuery) AllX

func (aq *AlbumsQuery) AllX(ctx context.Context) []*Albums

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

func (*AlbumsQuery) Clone

func (aq *AlbumsQuery) Clone() *AlbumsQuery

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

func (*AlbumsQuery) Count

func (aq *AlbumsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AlbumsQuery) CountX

func (aq *AlbumsQuery) CountX(ctx context.Context) int

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

func (*AlbumsQuery) Exist

func (aq *AlbumsQuery) Exist(ctx context.Context) (bool, error)

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

func (*AlbumsQuery) ExistX

func (aq *AlbumsQuery) ExistX(ctx context.Context) bool

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

func (*AlbumsQuery) First

func (aq *AlbumsQuery) First(ctx context.Context) (*Albums, error)

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

func (*AlbumsQuery) FirstID

func (aq *AlbumsQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*AlbumsQuery) FirstIDX

func (aq *AlbumsQuery) FirstIDX(ctx context.Context) uint64

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

func (*AlbumsQuery) FirstX

func (aq *AlbumsQuery) FirstX(ctx context.Context) *Albums

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

func (*AlbumsQuery) GroupBy

func (aq *AlbumsQuery) GroupBy(field string, fields ...string) *AlbumsGroupBy

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

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Albums.Query().
	GroupBy(albums.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AlbumsQuery) IDs

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

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

func (*AlbumsQuery) IDsX

func (aq *AlbumsQuery) IDsX(ctx context.Context) []uint64

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

func (*AlbumsQuery) Limit

func (aq *AlbumsQuery) Limit(limit int) *AlbumsQuery

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

func (*AlbumsQuery) Offset

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

Offset to start from.

func (*AlbumsQuery) Only

func (aq *AlbumsQuery) Only(ctx context.Context) (*Albums, error)

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

func (*AlbumsQuery) OnlyID

func (aq *AlbumsQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*AlbumsQuery) OnlyIDX

func (aq *AlbumsQuery) OnlyIDX(ctx context.Context) uint64

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

func (*AlbumsQuery) OnlyX

func (aq *AlbumsQuery) OnlyX(ctx context.Context) *Albums

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

func (*AlbumsQuery) Order

func (aq *AlbumsQuery) Order(o ...albums.OrderOption) *AlbumsQuery

Order specifies how the records should be ordered.

func (*AlbumsQuery) QueryArtists

func (aq *AlbumsQuery) QueryArtists() *ArtistsQuery

QueryArtists chains the current query on the "artists" edge.

func (*AlbumsQuery) QueryImage

func (aq *AlbumsQuery) QueryImage() *ImagesQuery

QueryImage chains the current query on the "image" edge.

func (*AlbumsQuery) QueryMusics

func (aq *AlbumsQuery) QueryMusics() *MusicsQuery

QueryMusics chains the current query on the "musics" edge.

func (*AlbumsQuery) QueryUsers

func (aq *AlbumsQuery) QueryUsers() *UsersQuery

QueryUsers chains the current query on the "users" edge.

func (*AlbumsQuery) Select

func (aq *AlbumsQuery) Select(fields ...string) *AlbumsSelect

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

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Albums.Query().
	Select(albums.FieldCreateTime).
	Scan(ctx, &v)

func (*AlbumsQuery) Unique

func (aq *AlbumsQuery) Unique(unique bool) *AlbumsQuery

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

func (aq *AlbumsQuery) Where(ps ...predicate.Albums) *AlbumsQuery

Where adds a new predicate for the AlbumsQuery builder.

func (*AlbumsQuery) WithArtists

func (aq *AlbumsQuery) WithArtists(opts ...func(*ArtistsQuery)) *AlbumsQuery

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

func (*AlbumsQuery) WithImage

func (aq *AlbumsQuery) WithImage(opts ...func(*ImagesQuery)) *AlbumsQuery

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

func (*AlbumsQuery) WithMusics

func (aq *AlbumsQuery) WithMusics(opts ...func(*MusicsQuery)) *AlbumsQuery

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

func (*AlbumsQuery) WithUsers

func (aq *AlbumsQuery) WithUsers(opts ...func(*UsersQuery)) *AlbumsQuery

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

type AlbumsSelect

type AlbumsSelect struct {
	*AlbumsQuery
	// contains filtered or unexported fields
}

AlbumsSelect is the builder for selecting fields of Albums entities.

func (*AlbumsSelect) Aggregate

func (as *AlbumsSelect) Aggregate(fns ...AggregateFunc) *AlbumsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AlbumsSelect) Bool

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

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

func (*AlbumsSelect) BoolX

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

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

func (*AlbumsSelect) Bools

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

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

func (*AlbumsSelect) BoolsX

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

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

func (*AlbumsSelect) Float64

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

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

func (*AlbumsSelect) Float64X

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

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

func (*AlbumsSelect) Float64s

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

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

func (*AlbumsSelect) Float64sX

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

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

func (*AlbumsSelect) Int

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

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

func (*AlbumsSelect) IntX

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

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

func (*AlbumsSelect) Ints

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

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

func (*AlbumsSelect) IntsX

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

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

func (*AlbumsSelect) Scan

func (as *AlbumsSelect) Scan(ctx context.Context, v any) error

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

func (*AlbumsSelect) ScanX

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

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

func (*AlbumsSelect) String

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

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

func (*AlbumsSelect) StringX

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

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

func (*AlbumsSelect) Strings

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

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

func (*AlbumsSelect) StringsX

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

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

type AlbumsSlice

type AlbumsSlice []*Albums

AlbumsSlice is a parsable slice of Albums.

type AlbumsUpdate

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

AlbumsUpdate is the builder for updating Albums entities.

func (*AlbumsUpdate) AddArtistIDs

func (au *AlbumsUpdate) AddArtistIDs(ids ...uint64) *AlbumsUpdate

AddArtistIDs adds the "artists" edge to the Artists entity by IDs.

func (*AlbumsUpdate) AddArtists

func (au *AlbumsUpdate) AddArtists(a ...*Artists) *AlbumsUpdate

AddArtists adds the "artists" edges to the Artists entity.

func (*AlbumsUpdate) AddMusicIDs

func (au *AlbumsUpdate) AddMusicIDs(ids ...uint64) *AlbumsUpdate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*AlbumsUpdate) AddMusics

func (au *AlbumsUpdate) AddMusics(m ...*Musics) *AlbumsUpdate

AddMusics adds the "musics" edges to the Musics entity.

func (*AlbumsUpdate) AddUserIDs

func (au *AlbumsUpdate) AddUserIDs(ids ...uint64) *AlbumsUpdate

AddUserIDs adds the "users" edge to the Users entity by IDs.

func (*AlbumsUpdate) AddUsers

func (au *AlbumsUpdate) AddUsers(u ...*Users) *AlbumsUpdate

AddUsers adds the "users" edges to the Users entity.

func (*AlbumsUpdate) ClearArtists

func (au *AlbumsUpdate) ClearArtists() *AlbumsUpdate

ClearArtists clears all "artists" edges to the Artists entity.

func (*AlbumsUpdate) ClearDescription

func (au *AlbumsUpdate) ClearDescription() *AlbumsUpdate

ClearDescription clears the value of the "description" field.

func (*AlbumsUpdate) ClearImage

func (au *AlbumsUpdate) ClearImage() *AlbumsUpdate

ClearImage clears the "image" edge to the Images entity.

func (*AlbumsUpdate) ClearMusics

func (au *AlbumsUpdate) ClearMusics() *AlbumsUpdate

ClearMusics clears all "musics" edges to the Musics entity.

func (*AlbumsUpdate) ClearUsers

func (au *AlbumsUpdate) ClearUsers() *AlbumsUpdate

ClearUsers clears all "users" edges to the Users entity.

func (*AlbumsUpdate) Exec

func (au *AlbumsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AlbumsUpdate) ExecX

func (au *AlbumsUpdate) ExecX(ctx context.Context)

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

func (*AlbumsUpdate) Mutation

func (au *AlbumsUpdate) Mutation() *AlbumsMutation

Mutation returns the AlbumsMutation object of the builder.

func (*AlbumsUpdate) RemoveArtistIDs

func (au *AlbumsUpdate) RemoveArtistIDs(ids ...uint64) *AlbumsUpdate

RemoveArtistIDs removes the "artists" edge to Artists entities by IDs.

func (*AlbumsUpdate) RemoveArtists

func (au *AlbumsUpdate) RemoveArtists(a ...*Artists) *AlbumsUpdate

RemoveArtists removes "artists" edges to Artists entities.

func (*AlbumsUpdate) RemoveMusicIDs

func (au *AlbumsUpdate) RemoveMusicIDs(ids ...uint64) *AlbumsUpdate

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*AlbumsUpdate) RemoveMusics

func (au *AlbumsUpdate) RemoveMusics(m ...*Musics) *AlbumsUpdate

RemoveMusics removes "musics" edges to Musics entities.

func (*AlbumsUpdate) RemoveUserIDs

func (au *AlbumsUpdate) RemoveUserIDs(ids ...uint64) *AlbumsUpdate

RemoveUserIDs removes the "users" edge to Users entities by IDs.

func (*AlbumsUpdate) RemoveUsers

func (au *AlbumsUpdate) RemoveUsers(u ...*Users) *AlbumsUpdate

RemoveUsers removes "users" edges to Users entities.

func (*AlbumsUpdate) Save

func (au *AlbumsUpdate) Save(ctx context.Context) (int, error)

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

func (*AlbumsUpdate) SaveX

func (au *AlbumsUpdate) SaveX(ctx context.Context) int

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

func (*AlbumsUpdate) SetDate

func (au *AlbumsUpdate) SetDate(s string) *AlbumsUpdate

SetDate sets the "date" field.

func (*AlbumsUpdate) SetDescription

func (au *AlbumsUpdate) SetDescription(s string) *AlbumsUpdate

SetDescription sets the "description" field.

func (*AlbumsUpdate) SetImage

func (au *AlbumsUpdate) SetImage(i *Images) *AlbumsUpdate

SetImage sets the "image" edge to the Images entity.

func (*AlbumsUpdate) SetImageID

func (au *AlbumsUpdate) SetImageID(id uint64) *AlbumsUpdate

SetImageID sets the "image" edge to the Images entity by ID.

func (*AlbumsUpdate) SetNillableDate

func (au *AlbumsUpdate) SetNillableDate(s *string) *AlbumsUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*AlbumsUpdate) SetNillableDescription

func (au *AlbumsUpdate) SetNillableDescription(s *string) *AlbumsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AlbumsUpdate) SetNillableTitle

func (au *AlbumsUpdate) SetNillableTitle(s *string) *AlbumsUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*AlbumsUpdate) SetTitle

func (au *AlbumsUpdate) SetTitle(s string) *AlbumsUpdate

SetTitle sets the "title" field.

func (*AlbumsUpdate) SetUpdateTime

func (au *AlbumsUpdate) SetUpdateTime(t time.Time) *AlbumsUpdate

SetUpdateTime sets the "update_time" field.

func (*AlbumsUpdate) Where

func (au *AlbumsUpdate) Where(ps ...predicate.Albums) *AlbumsUpdate

Where appends a list predicates to the AlbumsUpdate builder.

type AlbumsUpdateOne

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

AlbumsUpdateOne is the builder for updating a single Albums entity.

func (*AlbumsUpdateOne) AddArtistIDs

func (auo *AlbumsUpdateOne) AddArtistIDs(ids ...uint64) *AlbumsUpdateOne

AddArtistIDs adds the "artists" edge to the Artists entity by IDs.

func (*AlbumsUpdateOne) AddArtists

func (auo *AlbumsUpdateOne) AddArtists(a ...*Artists) *AlbumsUpdateOne

AddArtists adds the "artists" edges to the Artists entity.

func (*AlbumsUpdateOne) AddMusicIDs

func (auo *AlbumsUpdateOne) AddMusicIDs(ids ...uint64) *AlbumsUpdateOne

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*AlbumsUpdateOne) AddMusics

func (auo *AlbumsUpdateOne) AddMusics(m ...*Musics) *AlbumsUpdateOne

AddMusics adds the "musics" edges to the Musics entity.

func (*AlbumsUpdateOne) AddUserIDs

func (auo *AlbumsUpdateOne) AddUserIDs(ids ...uint64) *AlbumsUpdateOne

AddUserIDs adds the "users" edge to the Users entity by IDs.

func (*AlbumsUpdateOne) AddUsers

func (auo *AlbumsUpdateOne) AddUsers(u ...*Users) *AlbumsUpdateOne

AddUsers adds the "users" edges to the Users entity.

func (*AlbumsUpdateOne) ClearArtists

func (auo *AlbumsUpdateOne) ClearArtists() *AlbumsUpdateOne

ClearArtists clears all "artists" edges to the Artists entity.

func (*AlbumsUpdateOne) ClearDescription

func (auo *AlbumsUpdateOne) ClearDescription() *AlbumsUpdateOne

ClearDescription clears the value of the "description" field.

func (*AlbumsUpdateOne) ClearImage

func (auo *AlbumsUpdateOne) ClearImage() *AlbumsUpdateOne

ClearImage clears the "image" edge to the Images entity.

func (*AlbumsUpdateOne) ClearMusics

func (auo *AlbumsUpdateOne) ClearMusics() *AlbumsUpdateOne

ClearMusics clears all "musics" edges to the Musics entity.

func (*AlbumsUpdateOne) ClearUsers

func (auo *AlbumsUpdateOne) ClearUsers() *AlbumsUpdateOne

ClearUsers clears all "users" edges to the Users entity.

func (*AlbumsUpdateOne) Exec

func (auo *AlbumsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AlbumsUpdateOne) ExecX

func (auo *AlbumsUpdateOne) ExecX(ctx context.Context)

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

func (*AlbumsUpdateOne) Mutation

func (auo *AlbumsUpdateOne) Mutation() *AlbumsMutation

Mutation returns the AlbumsMutation object of the builder.

func (*AlbumsUpdateOne) RemoveArtistIDs

func (auo *AlbumsUpdateOne) RemoveArtistIDs(ids ...uint64) *AlbumsUpdateOne

RemoveArtistIDs removes the "artists" edge to Artists entities by IDs.

func (*AlbumsUpdateOne) RemoveArtists

func (auo *AlbumsUpdateOne) RemoveArtists(a ...*Artists) *AlbumsUpdateOne

RemoveArtists removes "artists" edges to Artists entities.

func (*AlbumsUpdateOne) RemoveMusicIDs

func (auo *AlbumsUpdateOne) RemoveMusicIDs(ids ...uint64) *AlbumsUpdateOne

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*AlbumsUpdateOne) RemoveMusics

func (auo *AlbumsUpdateOne) RemoveMusics(m ...*Musics) *AlbumsUpdateOne

RemoveMusics removes "musics" edges to Musics entities.

func (*AlbumsUpdateOne) RemoveUserIDs

func (auo *AlbumsUpdateOne) RemoveUserIDs(ids ...uint64) *AlbumsUpdateOne

RemoveUserIDs removes the "users" edge to Users entities by IDs.

func (*AlbumsUpdateOne) RemoveUsers

func (auo *AlbumsUpdateOne) RemoveUsers(u ...*Users) *AlbumsUpdateOne

RemoveUsers removes "users" edges to Users entities.

func (*AlbumsUpdateOne) Save

func (auo *AlbumsUpdateOne) Save(ctx context.Context) (*Albums, error)

Save executes the query and returns the updated Albums entity.

func (*AlbumsUpdateOne) SaveX

func (auo *AlbumsUpdateOne) SaveX(ctx context.Context) *Albums

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

func (*AlbumsUpdateOne) Select

func (auo *AlbumsUpdateOne) Select(field string, fields ...string) *AlbumsUpdateOne

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

func (*AlbumsUpdateOne) SetDate

func (auo *AlbumsUpdateOne) SetDate(s string) *AlbumsUpdateOne

SetDate sets the "date" field.

func (*AlbumsUpdateOne) SetDescription

func (auo *AlbumsUpdateOne) SetDescription(s string) *AlbumsUpdateOne

SetDescription sets the "description" field.

func (*AlbumsUpdateOne) SetImage

func (auo *AlbumsUpdateOne) SetImage(i *Images) *AlbumsUpdateOne

SetImage sets the "image" edge to the Images entity.

func (*AlbumsUpdateOne) SetImageID

func (auo *AlbumsUpdateOne) SetImageID(id uint64) *AlbumsUpdateOne

SetImageID sets the "image" edge to the Images entity by ID.

func (*AlbumsUpdateOne) SetNillableDate

func (auo *AlbumsUpdateOne) SetNillableDate(s *string) *AlbumsUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*AlbumsUpdateOne) SetNillableDescription

func (auo *AlbumsUpdateOne) SetNillableDescription(s *string) *AlbumsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AlbumsUpdateOne) SetNillableTitle

func (auo *AlbumsUpdateOne) SetNillableTitle(s *string) *AlbumsUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*AlbumsUpdateOne) SetTitle

func (auo *AlbumsUpdateOne) SetTitle(s string) *AlbumsUpdateOne

SetTitle sets the "title" field.

func (*AlbumsUpdateOne) SetUpdateTime

func (auo *AlbumsUpdateOne) SetUpdateTime(t time.Time) *AlbumsUpdateOne

SetUpdateTime sets the "update_time" field.

func (*AlbumsUpdateOne) Where

func (auo *AlbumsUpdateOne) Where(ps ...predicate.Albums) *AlbumsUpdateOne

Where appends a list predicates to the AlbumsUpdate builder.

type Artists

type Artists struct {

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

Artists is the model entity for the Artists schema.

func (*Artists) QueryAlbums

func (a *Artists) QueryAlbums() *AlbumsQuery

QueryAlbums queries the "albums" edge of the Artists entity.

func (*Artists) QueryMusics

func (a *Artists) QueryMusics() *MusicsQuery

QueryMusics queries the "musics" edge of the Artists entity.

func (*Artists) String

func (a *Artists) String() string

String implements the fmt.Stringer.

func (*Artists) Unwrap

func (a *Artists) Unwrap() *Artists

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

func (a *Artists) Update() *ArtistsUpdateOne

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

func (*Artists) Value

func (a *Artists) Value(name string) (ent.Value, error)

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

type ArtistsClient

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

ArtistsClient is a client for the Artists schema.

func NewArtistsClient

func NewArtistsClient(c config) *ArtistsClient

NewArtistsClient returns a client for the Artists from the given config.

func (*ArtistsClient) Create

func (c *ArtistsClient) Create() *ArtistsCreate

Create returns a builder for creating a Artists entity.

func (*ArtistsClient) CreateBulk

func (c *ArtistsClient) CreateBulk(builders ...*ArtistsCreate) *ArtistsCreateBulk

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

func (*ArtistsClient) Delete

func (c *ArtistsClient) Delete() *ArtistsDelete

Delete returns a delete builder for Artists.

func (*ArtistsClient) DeleteOne

func (c *ArtistsClient) DeleteOne(a *Artists) *ArtistsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ArtistsClient) DeleteOneID

func (c *ArtistsClient) DeleteOneID(id uint64) *ArtistsDeleteOne

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

func (*ArtistsClient) Get

func (c *ArtistsClient) Get(ctx context.Context, id uint64) (*Artists, error)

Get returns a Artists entity by its id.

func (*ArtistsClient) GetX

func (c *ArtistsClient) GetX(ctx context.Context, id uint64) *Artists

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

func (*ArtistsClient) Hooks

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

Hooks returns the client hooks.

func (*ArtistsClient) Intercept

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

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

func (*ArtistsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ArtistsClient) MapCreateBulk

func (c *ArtistsClient) MapCreateBulk(slice any, setFunc func(*ArtistsCreate, int)) *ArtistsCreateBulk

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

func (*ArtistsClient) Query

func (c *ArtistsClient) Query() *ArtistsQuery

Query returns a query builder for Artists.

func (*ArtistsClient) QueryAlbums

func (c *ArtistsClient) QueryAlbums(a *Artists) *AlbumsQuery

QueryAlbums queries the albums edge of a Artists.

func (*ArtistsClient) QueryMusics

func (c *ArtistsClient) QueryMusics(a *Artists) *MusicsQuery

QueryMusics queries the musics edge of a Artists.

func (*ArtistsClient) Update

func (c *ArtistsClient) Update() *ArtistsUpdate

Update returns an update builder for Artists.

func (*ArtistsClient) UpdateOne

func (c *ArtistsClient) UpdateOne(a *Artists) *ArtistsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ArtistsClient) UpdateOneID

func (c *ArtistsClient) UpdateOneID(id uint64) *ArtistsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ArtistsClient) Use

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

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

type ArtistsCreate

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

ArtistsCreate is the builder for creating a Artists entity.

func (*ArtistsCreate) AddAlbumIDs

func (ac *ArtistsCreate) AddAlbumIDs(ids ...uint64) *ArtistsCreate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*ArtistsCreate) AddAlbums

func (ac *ArtistsCreate) AddAlbums(a ...*Albums) *ArtistsCreate

AddAlbums adds the "albums" edges to the Albums entity.

func (*ArtistsCreate) AddMusicIDs

func (ac *ArtistsCreate) AddMusicIDs(ids ...uint64) *ArtistsCreate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*ArtistsCreate) AddMusics

func (ac *ArtistsCreate) AddMusics(m ...*Musics) *ArtistsCreate

AddMusics adds the "musics" edges to the Musics entity.

func (*ArtistsCreate) Exec

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

Exec executes the query.

func (*ArtistsCreate) ExecX

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

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

func (*ArtistsCreate) Mutation

func (ac *ArtistsCreate) Mutation() *ArtistsMutation

Mutation returns the ArtistsMutation object of the builder.

func (*ArtistsCreate) Save

func (ac *ArtistsCreate) Save(ctx context.Context) (*Artists, error)

Save creates the Artists in the database.

func (*ArtistsCreate) SaveX

func (ac *ArtistsCreate) SaveX(ctx context.Context) *Artists

SaveX calls Save and panics if Save returns an error.

func (*ArtistsCreate) SetID

func (ac *ArtistsCreate) SetID(u uint64) *ArtistsCreate

SetID sets the "id" field.

func (*ArtistsCreate) SetName

func (ac *ArtistsCreate) SetName(s string) *ArtistsCreate

SetName sets the "name" field.

type ArtistsCreateBulk

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

ArtistsCreateBulk is the builder for creating many Artists entities in bulk.

func (*ArtistsCreateBulk) Exec

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

Exec executes the query.

func (*ArtistsCreateBulk) ExecX

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

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

func (*ArtistsCreateBulk) Save

func (acb *ArtistsCreateBulk) Save(ctx context.Context) ([]*Artists, error)

Save creates the Artists entities in the database.

func (*ArtistsCreateBulk) SaveX

func (acb *ArtistsCreateBulk) SaveX(ctx context.Context) []*Artists

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

type ArtistsDelete

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

ArtistsDelete is the builder for deleting a Artists entity.

func (*ArtistsDelete) Exec

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

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

func (*ArtistsDelete) ExecX

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

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

func (*ArtistsDelete) Where

func (ad *ArtistsDelete) Where(ps ...predicate.Artists) *ArtistsDelete

Where appends a list predicates to the ArtistsDelete builder.

type ArtistsDeleteOne

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

ArtistsDeleteOne is the builder for deleting a single Artists entity.

func (*ArtistsDeleteOne) Exec

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

Exec executes the deletion query.

func (*ArtistsDeleteOne) ExecX

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

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

func (*ArtistsDeleteOne) Where

Where appends a list predicates to the ArtistsDelete builder.

type ArtistsEdges

type ArtistsEdges struct {
	// Musics holds the value of the musics edge.
	Musics []*Musics `json:"musics,omitempty"`
	// Albums holds the value of the albums edge.
	Albums []*Albums `json:"albums,omitempty"`
	// contains filtered or unexported fields
}

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

func (ArtistsEdges) AlbumsOrErr

func (e ArtistsEdges) AlbumsOrErr() ([]*Albums, error)

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

func (ArtistsEdges) MusicsOrErr

func (e ArtistsEdges) MusicsOrErr() ([]*Musics, error)

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

type ArtistsGroupBy

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

ArtistsGroupBy is the group-by builder for Artists entities.

func (*ArtistsGroupBy) Aggregate

func (agb *ArtistsGroupBy) Aggregate(fns ...AggregateFunc) *ArtistsGroupBy

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

func (*ArtistsGroupBy) Bool

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

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

func (*ArtistsGroupBy) BoolX

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

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

func (*ArtistsGroupBy) Bools

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

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

func (*ArtistsGroupBy) BoolsX

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

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

func (*ArtistsGroupBy) Float64

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

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

func (*ArtistsGroupBy) Float64X

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

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

func (*ArtistsGroupBy) Float64s

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

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

func (*ArtistsGroupBy) Float64sX

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

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

func (*ArtistsGroupBy) Int

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

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

func (*ArtistsGroupBy) IntX

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

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

func (*ArtistsGroupBy) Ints

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

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

func (*ArtistsGroupBy) IntsX

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

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

func (*ArtistsGroupBy) Scan

func (agb *ArtistsGroupBy) Scan(ctx context.Context, v any) error

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

func (*ArtistsGroupBy) ScanX

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

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

func (*ArtistsGroupBy) String

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

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

func (*ArtistsGroupBy) StringX

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

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

func (*ArtistsGroupBy) Strings

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

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

func (*ArtistsGroupBy) StringsX

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

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

type ArtistsMutation

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

ArtistsMutation represents an operation that mutates the Artists nodes in the graph.

func (*ArtistsMutation) AddAlbumIDs

func (m *ArtistsMutation) AddAlbumIDs(ids ...uint64)

AddAlbumIDs adds the "albums" edge to the Albums entity by ids.

func (*ArtistsMutation) AddField

func (m *ArtistsMutation) 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 (*ArtistsMutation) AddMusicIDs

func (m *ArtistsMutation) AddMusicIDs(ids ...uint64)

AddMusicIDs adds the "musics" edge to the Musics entity by ids.

func (*ArtistsMutation) AddedEdges

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

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

func (*ArtistsMutation) AddedField

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

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

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

func (*ArtistsMutation) AddedIDs

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

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

func (*ArtistsMutation) AlbumsCleared

func (m *ArtistsMutation) AlbumsCleared() bool

AlbumsCleared reports if the "albums" edge to the Albums entity was cleared.

func (*ArtistsMutation) AlbumsIDs

func (m *ArtistsMutation) AlbumsIDs() (ids []uint64)

AlbumsIDs returns the "albums" edge IDs in the mutation.

func (*ArtistsMutation) ClearAlbums

func (m *ArtistsMutation) ClearAlbums()

ClearAlbums clears the "albums" edge to the Albums entity.

func (*ArtistsMutation) ClearEdge

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

func (m *ArtistsMutation) 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 (*ArtistsMutation) ClearMusics

func (m *ArtistsMutation) ClearMusics()

ClearMusics clears the "musics" edge to the Musics entity.

func (*ArtistsMutation) ClearedEdges

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

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

func (*ArtistsMutation) ClearedFields

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

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

func (ArtistsMutation) Client

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

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

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

func (*ArtistsMutation) Field

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

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

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

func (*ArtistsMutation) Fields

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

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

func (m *ArtistsMutation) 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 (*ArtistsMutation) MusicsCleared

func (m *ArtistsMutation) MusicsCleared() bool

MusicsCleared reports if the "musics" edge to the Musics entity was cleared.

func (*ArtistsMutation) MusicsIDs

func (m *ArtistsMutation) MusicsIDs() (ids []uint64)

MusicsIDs returns the "musics" edge IDs in the mutation.

func (*ArtistsMutation) Name

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

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

func (*ArtistsMutation) OldField

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

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

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

func (m *ArtistsMutation) Op() Op

Op returns the operation name.

func (*ArtistsMutation) RemoveAlbumIDs

func (m *ArtistsMutation) RemoveAlbumIDs(ids ...uint64)

RemoveAlbumIDs removes the "albums" edge to the Albums entity by IDs.

func (*ArtistsMutation) RemoveMusicIDs

func (m *ArtistsMutation) RemoveMusicIDs(ids ...uint64)

RemoveMusicIDs removes the "musics" edge to the Musics entity by IDs.

func (*ArtistsMutation) RemovedAlbumsIDs

func (m *ArtistsMutation) RemovedAlbumsIDs() (ids []uint64)

RemovedAlbums returns the removed IDs of the "albums" edge to the Albums entity.

func (*ArtistsMutation) RemovedEdges

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

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

func (*ArtistsMutation) RemovedIDs

func (m *ArtistsMutation) 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 (*ArtistsMutation) RemovedMusicsIDs

func (m *ArtistsMutation) RemovedMusicsIDs() (ids []uint64)

RemovedMusics returns the removed IDs of the "musics" edge to the Musics entity.

func (*ArtistsMutation) ResetAlbums

func (m *ArtistsMutation) ResetAlbums()

ResetAlbums resets all changes to the "albums" edge.

func (*ArtistsMutation) ResetEdge

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

func (m *ArtistsMutation) 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 (*ArtistsMutation) ResetMusics

func (m *ArtistsMutation) ResetMusics()

ResetMusics resets all changes to the "musics" edge.

func (*ArtistsMutation) ResetName

func (m *ArtistsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ArtistsMutation) SetField

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

func (m *ArtistsMutation) SetID(id uint64)

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

func (*ArtistsMutation) SetName

func (m *ArtistsMutation) SetName(s string)

SetName sets the "name" field.

func (*ArtistsMutation) SetOp

func (m *ArtistsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ArtistsMutation) Tx

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

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

func (*ArtistsMutation) Type

func (m *ArtistsMutation) Type() string

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

func (*ArtistsMutation) Where

func (m *ArtistsMutation) Where(ps ...predicate.Artists)

Where appends a list predicates to the ArtistsMutation builder.

func (*ArtistsMutation) WhereP

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

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

type ArtistsQuery

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

ArtistsQuery is the builder for querying Artists entities.

func (*ArtistsQuery) Aggregate

func (aq *ArtistsQuery) Aggregate(fns ...AggregateFunc) *ArtistsSelect

Aggregate returns a ArtistsSelect configured with the given aggregations.

func (*ArtistsQuery) All

func (aq *ArtistsQuery) All(ctx context.Context) ([]*Artists, error)

All executes the query and returns a list of ArtistsSlice.

func (*ArtistsQuery) AllX

func (aq *ArtistsQuery) AllX(ctx context.Context) []*Artists

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

func (*ArtistsQuery) Clone

func (aq *ArtistsQuery) Clone() *ArtistsQuery

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

func (*ArtistsQuery) Count

func (aq *ArtistsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ArtistsQuery) CountX

func (aq *ArtistsQuery) CountX(ctx context.Context) int

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

func (*ArtistsQuery) Exist

func (aq *ArtistsQuery) Exist(ctx context.Context) (bool, error)

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

func (*ArtistsQuery) ExistX

func (aq *ArtistsQuery) ExistX(ctx context.Context) bool

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

func (*ArtistsQuery) First

func (aq *ArtistsQuery) First(ctx context.Context) (*Artists, error)

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

func (*ArtistsQuery) FirstID

func (aq *ArtistsQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*ArtistsQuery) FirstIDX

func (aq *ArtistsQuery) FirstIDX(ctx context.Context) uint64

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

func (*ArtistsQuery) FirstX

func (aq *ArtistsQuery) FirstX(ctx context.Context) *Artists

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

func (*ArtistsQuery) GroupBy

func (aq *ArtistsQuery) GroupBy(field string, fields ...string) *ArtistsGroupBy

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

func (*ArtistsQuery) IDs

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

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

func (*ArtistsQuery) IDsX

func (aq *ArtistsQuery) IDsX(ctx context.Context) []uint64

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

func (*ArtistsQuery) Limit

func (aq *ArtistsQuery) Limit(limit int) *ArtistsQuery

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

func (*ArtistsQuery) Offset

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

Offset to start from.

func (*ArtistsQuery) Only

func (aq *ArtistsQuery) Only(ctx context.Context) (*Artists, error)

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

func (*ArtistsQuery) OnlyID

func (aq *ArtistsQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*ArtistsQuery) OnlyIDX

func (aq *ArtistsQuery) OnlyIDX(ctx context.Context) uint64

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

func (*ArtistsQuery) OnlyX

func (aq *ArtistsQuery) OnlyX(ctx context.Context) *Artists

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

func (*ArtistsQuery) Order

func (aq *ArtistsQuery) Order(o ...artists.OrderOption) *ArtistsQuery

Order specifies how the records should be ordered.

func (*ArtistsQuery) QueryAlbums

func (aq *ArtistsQuery) QueryAlbums() *AlbumsQuery

QueryAlbums chains the current query on the "albums" edge.

func (*ArtistsQuery) QueryMusics

func (aq *ArtistsQuery) QueryMusics() *MusicsQuery

QueryMusics chains the current query on the "musics" edge.

func (*ArtistsQuery) Select

func (aq *ArtistsQuery) Select(fields ...string) *ArtistsSelect

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

func (*ArtistsQuery) Unique

func (aq *ArtistsQuery) Unique(unique bool) *ArtistsQuery

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

func (aq *ArtistsQuery) Where(ps ...predicate.Artists) *ArtistsQuery

Where adds a new predicate for the ArtistsQuery builder.

func (*ArtistsQuery) WithAlbums

func (aq *ArtistsQuery) WithAlbums(opts ...func(*AlbumsQuery)) *ArtistsQuery

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

func (*ArtistsQuery) WithMusics

func (aq *ArtistsQuery) WithMusics(opts ...func(*MusicsQuery)) *ArtistsQuery

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

type ArtistsSelect

type ArtistsSelect struct {
	*ArtistsQuery
	// contains filtered or unexported fields
}

ArtistsSelect is the builder for selecting fields of Artists entities.

func (*ArtistsSelect) Aggregate

func (as *ArtistsSelect) Aggregate(fns ...AggregateFunc) *ArtistsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ArtistsSelect) Bool

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

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

func (*ArtistsSelect) BoolX

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

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

func (*ArtistsSelect) Bools

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

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

func (*ArtistsSelect) BoolsX

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

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

func (*ArtistsSelect) Float64

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

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

func (*ArtistsSelect) Float64X

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

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

func (*ArtistsSelect) Float64s

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

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

func (*ArtistsSelect) Float64sX

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

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

func (*ArtistsSelect) Int

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

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

func (*ArtistsSelect) IntX

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

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

func (*ArtistsSelect) Ints

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

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

func (*ArtistsSelect) IntsX

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

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

func (*ArtistsSelect) Scan

func (as *ArtistsSelect) Scan(ctx context.Context, v any) error

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

func (*ArtistsSelect) ScanX

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

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

func (*ArtistsSelect) String

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

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

func (*ArtistsSelect) StringX

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

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

func (*ArtistsSelect) Strings

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

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

func (*ArtistsSelect) StringsX

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

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

type ArtistsSlice

type ArtistsSlice []*Artists

ArtistsSlice is a parsable slice of Artists.

type ArtistsUpdate

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

ArtistsUpdate is the builder for updating Artists entities.

func (*ArtistsUpdate) AddAlbumIDs

func (au *ArtistsUpdate) AddAlbumIDs(ids ...uint64) *ArtistsUpdate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*ArtistsUpdate) AddAlbums

func (au *ArtistsUpdate) AddAlbums(a ...*Albums) *ArtistsUpdate

AddAlbums adds the "albums" edges to the Albums entity.

func (*ArtistsUpdate) AddMusicIDs

func (au *ArtistsUpdate) AddMusicIDs(ids ...uint64) *ArtistsUpdate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*ArtistsUpdate) AddMusics

func (au *ArtistsUpdate) AddMusics(m ...*Musics) *ArtistsUpdate

AddMusics adds the "musics" edges to the Musics entity.

func (*ArtistsUpdate) ClearAlbums

func (au *ArtistsUpdate) ClearAlbums() *ArtistsUpdate

ClearAlbums clears all "albums" edges to the Albums entity.

func (*ArtistsUpdate) ClearMusics

func (au *ArtistsUpdate) ClearMusics() *ArtistsUpdate

ClearMusics clears all "musics" edges to the Musics entity.

func (*ArtistsUpdate) Exec

func (au *ArtistsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ArtistsUpdate) ExecX

func (au *ArtistsUpdate) ExecX(ctx context.Context)

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

func (*ArtistsUpdate) Mutation

func (au *ArtistsUpdate) Mutation() *ArtistsMutation

Mutation returns the ArtistsMutation object of the builder.

func (*ArtistsUpdate) RemoveAlbumIDs

func (au *ArtistsUpdate) RemoveAlbumIDs(ids ...uint64) *ArtistsUpdate

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*ArtistsUpdate) RemoveAlbums

func (au *ArtistsUpdate) RemoveAlbums(a ...*Albums) *ArtistsUpdate

RemoveAlbums removes "albums" edges to Albums entities.

func (*ArtistsUpdate) RemoveMusicIDs

func (au *ArtistsUpdate) RemoveMusicIDs(ids ...uint64) *ArtistsUpdate

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*ArtistsUpdate) RemoveMusics

func (au *ArtistsUpdate) RemoveMusics(m ...*Musics) *ArtistsUpdate

RemoveMusics removes "musics" edges to Musics entities.

func (*ArtistsUpdate) Save

func (au *ArtistsUpdate) Save(ctx context.Context) (int, error)

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

func (*ArtistsUpdate) SaveX

func (au *ArtistsUpdate) SaveX(ctx context.Context) int

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

func (*ArtistsUpdate) SetName

func (au *ArtistsUpdate) SetName(s string) *ArtistsUpdate

SetName sets the "name" field.

func (*ArtistsUpdate) SetNillableName

func (au *ArtistsUpdate) SetNillableName(s *string) *ArtistsUpdate

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

func (*ArtistsUpdate) Where

func (au *ArtistsUpdate) Where(ps ...predicate.Artists) *ArtistsUpdate

Where appends a list predicates to the ArtistsUpdate builder.

type ArtistsUpdateOne

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

ArtistsUpdateOne is the builder for updating a single Artists entity.

func (*ArtistsUpdateOne) AddAlbumIDs

func (auo *ArtistsUpdateOne) AddAlbumIDs(ids ...uint64) *ArtistsUpdateOne

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*ArtistsUpdateOne) AddAlbums

func (auo *ArtistsUpdateOne) AddAlbums(a ...*Albums) *ArtistsUpdateOne

AddAlbums adds the "albums" edges to the Albums entity.

func (*ArtistsUpdateOne) AddMusicIDs

func (auo *ArtistsUpdateOne) AddMusicIDs(ids ...uint64) *ArtistsUpdateOne

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*ArtistsUpdateOne) AddMusics

func (auo *ArtistsUpdateOne) AddMusics(m ...*Musics) *ArtistsUpdateOne

AddMusics adds the "musics" edges to the Musics entity.

func (*ArtistsUpdateOne) ClearAlbums

func (auo *ArtistsUpdateOne) ClearAlbums() *ArtistsUpdateOne

ClearAlbums clears all "albums" edges to the Albums entity.

func (*ArtistsUpdateOne) ClearMusics

func (auo *ArtistsUpdateOne) ClearMusics() *ArtistsUpdateOne

ClearMusics clears all "musics" edges to the Musics entity.

func (*ArtistsUpdateOne) Exec

func (auo *ArtistsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ArtistsUpdateOne) ExecX

func (auo *ArtistsUpdateOne) ExecX(ctx context.Context)

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

func (*ArtistsUpdateOne) Mutation

func (auo *ArtistsUpdateOne) Mutation() *ArtistsMutation

Mutation returns the ArtistsMutation object of the builder.

func (*ArtistsUpdateOne) RemoveAlbumIDs

func (auo *ArtistsUpdateOne) RemoveAlbumIDs(ids ...uint64) *ArtistsUpdateOne

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*ArtistsUpdateOne) RemoveAlbums

func (auo *ArtistsUpdateOne) RemoveAlbums(a ...*Albums) *ArtistsUpdateOne

RemoveAlbums removes "albums" edges to Albums entities.

func (*ArtistsUpdateOne) RemoveMusicIDs

func (auo *ArtistsUpdateOne) RemoveMusicIDs(ids ...uint64) *ArtistsUpdateOne

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*ArtistsUpdateOne) RemoveMusics

func (auo *ArtistsUpdateOne) RemoveMusics(m ...*Musics) *ArtistsUpdateOne

RemoveMusics removes "musics" edges to Musics entities.

func (*ArtistsUpdateOne) Save

func (auo *ArtistsUpdateOne) Save(ctx context.Context) (*Artists, error)

Save executes the query and returns the updated Artists entity.

func (*ArtistsUpdateOne) SaveX

func (auo *ArtistsUpdateOne) SaveX(ctx context.Context) *Artists

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

func (*ArtistsUpdateOne) Select

func (auo *ArtistsUpdateOne) Select(field string, fields ...string) *ArtistsUpdateOne

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

func (*ArtistsUpdateOne) SetName

func (auo *ArtistsUpdateOne) SetName(s string) *ArtistsUpdateOne

SetName sets the "name" field.

func (*ArtistsUpdateOne) SetNillableName

func (auo *ArtistsUpdateOne) SetNillableName(s *string) *ArtistsUpdateOne

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

func (*ArtistsUpdateOne) Where

Where appends a list predicates to the ArtistsUpdate builder.

type Audiobooks

type Audiobooks struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Audiobooks is the model entity for the Audiobooks schema.

func (*Audiobooks) String

func (a *Audiobooks) String() string

String implements the fmt.Stringer.

func (*Audiobooks) Unwrap

func (a *Audiobooks) Unwrap() *Audiobooks

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

func (a *Audiobooks) Update() *AudiobooksUpdateOne

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

func (*Audiobooks) Value

func (a *Audiobooks) Value(name string) (ent.Value, error)

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

type AudiobooksClient

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

AudiobooksClient is a client for the Audiobooks schema.

func NewAudiobooksClient

func NewAudiobooksClient(c config) *AudiobooksClient

NewAudiobooksClient returns a client for the Audiobooks from the given config.

func (*AudiobooksClient) Create

func (c *AudiobooksClient) Create() *AudiobooksCreate

Create returns a builder for creating a Audiobooks entity.

func (*AudiobooksClient) CreateBulk

func (c *AudiobooksClient) CreateBulk(builders ...*AudiobooksCreate) *AudiobooksCreateBulk

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

func (*AudiobooksClient) Delete

func (c *AudiobooksClient) Delete() *AudiobooksDelete

Delete returns a delete builder for Audiobooks.

func (*AudiobooksClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AudiobooksClient) DeleteOneID

func (c *AudiobooksClient) DeleteOneID(id int) *AudiobooksDeleteOne

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

func (*AudiobooksClient) Get

func (c *AudiobooksClient) Get(ctx context.Context, id int) (*Audiobooks, error)

Get returns a Audiobooks entity by its id.

func (*AudiobooksClient) GetX

func (c *AudiobooksClient) GetX(ctx context.Context, id int) *Audiobooks

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

func (*AudiobooksClient) Hooks

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

Hooks returns the client hooks.

func (*AudiobooksClient) Intercept

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

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

func (*AudiobooksClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AudiobooksClient) MapCreateBulk

func (c *AudiobooksClient) MapCreateBulk(slice any, setFunc func(*AudiobooksCreate, int)) *AudiobooksCreateBulk

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

func (*AudiobooksClient) Query

func (c *AudiobooksClient) Query() *AudiobooksQuery

Query returns a query builder for Audiobooks.

func (*AudiobooksClient) Update

func (c *AudiobooksClient) Update() *AudiobooksUpdate

Update returns an update builder for Audiobooks.

func (*AudiobooksClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AudiobooksClient) UpdateOneID

func (c *AudiobooksClient) UpdateOneID(id int) *AudiobooksUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AudiobooksClient) Use

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

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

type AudiobooksCreate

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

AudiobooksCreate is the builder for creating a Audiobooks entity.

func (*AudiobooksCreate) Exec

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

Exec executes the query.

func (*AudiobooksCreate) ExecX

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

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

func (*AudiobooksCreate) Mutation

func (ac *AudiobooksCreate) Mutation() *AudiobooksMutation

Mutation returns the AudiobooksMutation object of the builder.

func (*AudiobooksCreate) Save

func (ac *AudiobooksCreate) Save(ctx context.Context) (*Audiobooks, error)

Save creates the Audiobooks in the database.

func (*AudiobooksCreate) SaveX

func (ac *AudiobooksCreate) SaveX(ctx context.Context) *Audiobooks

SaveX calls Save and panics if Save returns an error.

type AudiobooksCreateBulk

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

AudiobooksCreateBulk is the builder for creating many Audiobooks entities in bulk.

func (*AudiobooksCreateBulk) Exec

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

Exec executes the query.

func (*AudiobooksCreateBulk) ExecX

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

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

func (*AudiobooksCreateBulk) Save

func (acb *AudiobooksCreateBulk) Save(ctx context.Context) ([]*Audiobooks, error)

Save creates the Audiobooks entities in the database.

func (*AudiobooksCreateBulk) SaveX

func (acb *AudiobooksCreateBulk) SaveX(ctx context.Context) []*Audiobooks

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

type AudiobooksDelete

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

AudiobooksDelete is the builder for deleting a Audiobooks entity.

func (*AudiobooksDelete) Exec

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

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

func (*AudiobooksDelete) ExecX

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

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

func (*AudiobooksDelete) Where

Where appends a list predicates to the AudiobooksDelete builder.

type AudiobooksDeleteOne

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

AudiobooksDeleteOne is the builder for deleting a single Audiobooks entity.

func (*AudiobooksDeleteOne) Exec

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

Exec executes the deletion query.

func (*AudiobooksDeleteOne) ExecX

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

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

func (*AudiobooksDeleteOne) Where

Where appends a list predicates to the AudiobooksDelete builder.

type AudiobooksGroupBy

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

AudiobooksGroupBy is the group-by builder for Audiobooks entities.

func (*AudiobooksGroupBy) Aggregate

func (agb *AudiobooksGroupBy) Aggregate(fns ...AggregateFunc) *AudiobooksGroupBy

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

func (*AudiobooksGroupBy) Bool

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

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

func (*AudiobooksGroupBy) BoolX

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

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

func (*AudiobooksGroupBy) Bools

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

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

func (*AudiobooksGroupBy) BoolsX

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

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

func (*AudiobooksGroupBy) Float64

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

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

func (*AudiobooksGroupBy) Float64X

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

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

func (*AudiobooksGroupBy) Float64s

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

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

func (*AudiobooksGroupBy) Float64sX

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

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

func (*AudiobooksGroupBy) Int

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

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

func (*AudiobooksGroupBy) IntX

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

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

func (*AudiobooksGroupBy) Ints

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

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

func (*AudiobooksGroupBy) IntsX

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

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

func (*AudiobooksGroupBy) Scan

func (agb *AudiobooksGroupBy) Scan(ctx context.Context, v any) error

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

func (*AudiobooksGroupBy) ScanX

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

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

func (*AudiobooksGroupBy) String

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

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

func (*AudiobooksGroupBy) StringX

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

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

func (*AudiobooksGroupBy) Strings

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

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

func (*AudiobooksGroupBy) StringsX

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

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

type AudiobooksMutation

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

AudiobooksMutation represents an operation that mutates the Audiobooks nodes in the graph.

func (*AudiobooksMutation) AddField

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

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

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

func (*AudiobooksMutation) AddedField

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

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

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

func (*AudiobooksMutation) AddedIDs

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

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

func (*AudiobooksMutation) ClearEdge

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

func (m *AudiobooksMutation) 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 (*AudiobooksMutation) ClearedEdges

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

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

func (*AudiobooksMutation) ClearedFields

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

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

func (AudiobooksMutation) Client

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

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

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

func (*AudiobooksMutation) Field

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

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

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

func (*AudiobooksMutation) Fields

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

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

func (m *AudiobooksMutation) 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 (*AudiobooksMutation) OldField

func (m *AudiobooksMutation) 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 (*AudiobooksMutation) Op

func (m *AudiobooksMutation) Op() Op

Op returns the operation name.

func (*AudiobooksMutation) RemovedEdges

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

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

func (*AudiobooksMutation) RemovedIDs

func (m *AudiobooksMutation) 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 (*AudiobooksMutation) ResetEdge

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

func (m *AudiobooksMutation) 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 (*AudiobooksMutation) SetField

func (m *AudiobooksMutation) 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 (*AudiobooksMutation) SetOp

func (m *AudiobooksMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (AudiobooksMutation) Tx

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

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

func (*AudiobooksMutation) Type

func (m *AudiobooksMutation) Type() string

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

func (*AudiobooksMutation) Where

func (m *AudiobooksMutation) Where(ps ...predicate.Audiobooks)

Where appends a list predicates to the AudiobooksMutation builder.

func (*AudiobooksMutation) WhereP

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

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

type AudiobooksQuery

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

AudiobooksQuery is the builder for querying Audiobooks entities.

func (*AudiobooksQuery) Aggregate

func (aq *AudiobooksQuery) Aggregate(fns ...AggregateFunc) *AudiobooksSelect

Aggregate returns a AudiobooksSelect configured with the given aggregations.

func (*AudiobooksQuery) All

func (aq *AudiobooksQuery) All(ctx context.Context) ([]*Audiobooks, error)

All executes the query and returns a list of AudiobooksSlice.

func (*AudiobooksQuery) AllX

func (aq *AudiobooksQuery) AllX(ctx context.Context) []*Audiobooks

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

func (*AudiobooksQuery) Clone

func (aq *AudiobooksQuery) Clone() *AudiobooksQuery

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

func (*AudiobooksQuery) Count

func (aq *AudiobooksQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AudiobooksQuery) CountX

func (aq *AudiobooksQuery) CountX(ctx context.Context) int

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

func (*AudiobooksQuery) Exist

func (aq *AudiobooksQuery) Exist(ctx context.Context) (bool, error)

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

func (*AudiobooksQuery) ExistX

func (aq *AudiobooksQuery) ExistX(ctx context.Context) bool

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

func (*AudiobooksQuery) First

func (aq *AudiobooksQuery) First(ctx context.Context) (*Audiobooks, error)

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

func (*AudiobooksQuery) FirstID

func (aq *AudiobooksQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AudiobooksQuery) FirstIDX

func (aq *AudiobooksQuery) FirstIDX(ctx context.Context) int

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

func (*AudiobooksQuery) FirstX

func (aq *AudiobooksQuery) FirstX(ctx context.Context) *Audiobooks

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

func (*AudiobooksQuery) GroupBy

func (aq *AudiobooksQuery) GroupBy(field string, fields ...string) *AudiobooksGroupBy

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

func (*AudiobooksQuery) IDs

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

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

func (*AudiobooksQuery) IDsX

func (aq *AudiobooksQuery) IDsX(ctx context.Context) []int

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

func (*AudiobooksQuery) Limit

func (aq *AudiobooksQuery) Limit(limit int) *AudiobooksQuery

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

func (*AudiobooksQuery) Offset

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

Offset to start from.

func (*AudiobooksQuery) Only

func (aq *AudiobooksQuery) Only(ctx context.Context) (*Audiobooks, error)

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

func (*AudiobooksQuery) OnlyID

func (aq *AudiobooksQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AudiobooksQuery) OnlyIDX

func (aq *AudiobooksQuery) OnlyIDX(ctx context.Context) int

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

func (*AudiobooksQuery) OnlyX

func (aq *AudiobooksQuery) OnlyX(ctx context.Context) *Audiobooks

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

func (*AudiobooksQuery) Order

Order specifies how the records should be ordered.

func (*AudiobooksQuery) Select

func (aq *AudiobooksQuery) Select(fields ...string) *AudiobooksSelect

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

func (*AudiobooksQuery) Unique

func (aq *AudiobooksQuery) Unique(unique bool) *AudiobooksQuery

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

Where adds a new predicate for the AudiobooksQuery builder.

type AudiobooksSelect

type AudiobooksSelect struct {
	*AudiobooksQuery
	// contains filtered or unexported fields
}

AudiobooksSelect is the builder for selecting fields of Audiobooks entities.

func (*AudiobooksSelect) Aggregate

func (as *AudiobooksSelect) Aggregate(fns ...AggregateFunc) *AudiobooksSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AudiobooksSelect) Bool

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

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

func (*AudiobooksSelect) BoolX

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

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

func (*AudiobooksSelect) Bools

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

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

func (*AudiobooksSelect) BoolsX

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

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

func (*AudiobooksSelect) Float64

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

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

func (*AudiobooksSelect) Float64X

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

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

func (*AudiobooksSelect) Float64s

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

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

func (*AudiobooksSelect) Float64sX

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

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

func (*AudiobooksSelect) Int

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

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

func (*AudiobooksSelect) IntX

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

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

func (*AudiobooksSelect) Ints

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

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

func (*AudiobooksSelect) IntsX

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

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

func (*AudiobooksSelect) Scan

func (as *AudiobooksSelect) Scan(ctx context.Context, v any) error

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

func (*AudiobooksSelect) ScanX

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

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

func (*AudiobooksSelect) String

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

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

func (*AudiobooksSelect) StringX

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

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

func (*AudiobooksSelect) Strings

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

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

func (*AudiobooksSelect) StringsX

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

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

type AudiobooksSlice

type AudiobooksSlice []*Audiobooks

AudiobooksSlice is a parsable slice of Audiobooks.

type AudiobooksUpdate

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

AudiobooksUpdate is the builder for updating Audiobooks entities.

func (*AudiobooksUpdate) Exec

func (au *AudiobooksUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AudiobooksUpdate) ExecX

func (au *AudiobooksUpdate) ExecX(ctx context.Context)

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

func (*AudiobooksUpdate) Mutation

func (au *AudiobooksUpdate) Mutation() *AudiobooksMutation

Mutation returns the AudiobooksMutation object of the builder.

func (*AudiobooksUpdate) Save

func (au *AudiobooksUpdate) Save(ctx context.Context) (int, error)

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

func (*AudiobooksUpdate) SaveX

func (au *AudiobooksUpdate) SaveX(ctx context.Context) int

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

func (*AudiobooksUpdate) Where

Where appends a list predicates to the AudiobooksUpdate builder.

type AudiobooksUpdateOne

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

AudiobooksUpdateOne is the builder for updating a single Audiobooks entity.

func (*AudiobooksUpdateOne) Exec

func (auo *AudiobooksUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AudiobooksUpdateOne) ExecX

func (auo *AudiobooksUpdateOne) ExecX(ctx context.Context)

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

func (*AudiobooksUpdateOne) Mutation

func (auo *AudiobooksUpdateOne) Mutation() *AudiobooksMutation

Mutation returns the AudiobooksMutation object of the builder.

func (*AudiobooksUpdateOne) Save

func (auo *AudiobooksUpdateOne) Save(ctx context.Context) (*Audiobooks, error)

Save executes the query and returns the updated Audiobooks entity.

func (*AudiobooksUpdateOne) SaveX

func (auo *AudiobooksUpdateOne) SaveX(ctx context.Context) *Audiobooks

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

func (*AudiobooksUpdateOne) Select

func (auo *AudiobooksUpdateOne) Select(field string, fields ...string) *AudiobooksUpdateOne

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

func (*AudiobooksUpdateOne) Where

Where appends a list predicates to the AudiobooksUpdate builder.

type Categorys

type Categorys struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Categorys is the model entity for the Categorys schema.

func (*Categorys) String

func (c *Categorys) String() string

String implements the fmt.Stringer.

func (*Categorys) Unwrap

func (c *Categorys) Unwrap() *Categorys

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

func (c *Categorys) Update() *CategorysUpdateOne

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

func (*Categorys) Value

func (c *Categorys) Value(name string) (ent.Value, error)

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

type CategorysClient

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

CategorysClient is a client for the Categorys schema.

func NewCategorysClient

func NewCategorysClient(c config) *CategorysClient

NewCategorysClient returns a client for the Categorys from the given config.

func (*CategorysClient) Create

func (c *CategorysClient) Create() *CategorysCreate

Create returns a builder for creating a Categorys entity.

func (*CategorysClient) CreateBulk

func (c *CategorysClient) CreateBulk(builders ...*CategorysCreate) *CategorysCreateBulk

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

func (*CategorysClient) Delete

func (c *CategorysClient) Delete() *CategorysDelete

Delete returns a delete builder for Categorys.

func (*CategorysClient) DeleteOne

func (c *CategorysClient) DeleteOne(ca *Categorys) *CategorysDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CategorysClient) DeleteOneID

func (c *CategorysClient) DeleteOneID(id int) *CategorysDeleteOne

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

func (*CategorysClient) Get

func (c *CategorysClient) Get(ctx context.Context, id int) (*Categorys, error)

Get returns a Categorys entity by its id.

func (*CategorysClient) GetX

func (c *CategorysClient) GetX(ctx context.Context, id int) *Categorys

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

func (*CategorysClient) Hooks

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

Hooks returns the client hooks.

func (*CategorysClient) Intercept

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

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

func (*CategorysClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CategorysClient) MapCreateBulk

func (c *CategorysClient) MapCreateBulk(slice any, setFunc func(*CategorysCreate, int)) *CategorysCreateBulk

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

func (*CategorysClient) Query

func (c *CategorysClient) Query() *CategorysQuery

Query returns a query builder for Categorys.

func (*CategorysClient) Update

func (c *CategorysClient) Update() *CategorysUpdate

Update returns an update builder for Categorys.

func (*CategorysClient) UpdateOne

func (c *CategorysClient) UpdateOne(ca *Categorys) *CategorysUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategorysClient) UpdateOneID

func (c *CategorysClient) UpdateOneID(id int) *CategorysUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategorysClient) Use

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

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

type CategorysCreate

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

CategorysCreate is the builder for creating a Categorys entity.

func (*CategorysCreate) Exec

func (cc *CategorysCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategorysCreate) ExecX

func (cc *CategorysCreate) ExecX(ctx context.Context)

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

func (*CategorysCreate) Mutation

func (cc *CategorysCreate) Mutation() *CategorysMutation

Mutation returns the CategorysMutation object of the builder.

func (*CategorysCreate) Save

func (cc *CategorysCreate) Save(ctx context.Context) (*Categorys, error)

Save creates the Categorys in the database.

func (*CategorysCreate) SaveX

func (cc *CategorysCreate) SaveX(ctx context.Context) *Categorys

SaveX calls Save and panics if Save returns an error.

type CategorysCreateBulk

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

CategorysCreateBulk is the builder for creating many Categorys entities in bulk.

func (*CategorysCreateBulk) Exec

func (ccb *CategorysCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CategorysCreateBulk) ExecX

func (ccb *CategorysCreateBulk) ExecX(ctx context.Context)

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

func (*CategorysCreateBulk) Save

func (ccb *CategorysCreateBulk) Save(ctx context.Context) ([]*Categorys, error)

Save creates the Categorys entities in the database.

func (*CategorysCreateBulk) SaveX

func (ccb *CategorysCreateBulk) SaveX(ctx context.Context) []*Categorys

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

type CategorysDelete

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

CategorysDelete is the builder for deleting a Categorys entity.

func (*CategorysDelete) Exec

func (cd *CategorysDelete) Exec(ctx context.Context) (int, error)

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

func (*CategorysDelete) ExecX

func (cd *CategorysDelete) ExecX(ctx context.Context) int

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

func (*CategorysDelete) Where

Where appends a list predicates to the CategorysDelete builder.

type CategorysDeleteOne

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

CategorysDeleteOne is the builder for deleting a single Categorys entity.

func (*CategorysDeleteOne) Exec

func (cdo *CategorysDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CategorysDeleteOne) ExecX

func (cdo *CategorysDeleteOne) ExecX(ctx context.Context)

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

func (*CategorysDeleteOne) Where

Where appends a list predicates to the CategorysDelete builder.

type CategorysGroupBy

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

CategorysGroupBy is the group-by builder for Categorys entities.

func (*CategorysGroupBy) Aggregate

func (cgb *CategorysGroupBy) Aggregate(fns ...AggregateFunc) *CategorysGroupBy

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

func (*CategorysGroupBy) Bool

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

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

func (*CategorysGroupBy) BoolX

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

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

func (*CategorysGroupBy) Bools

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

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

func (*CategorysGroupBy) BoolsX

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

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

func (*CategorysGroupBy) Float64

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

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

func (*CategorysGroupBy) Float64X

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

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

func (*CategorysGroupBy) Float64s

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

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

func (*CategorysGroupBy) Float64sX

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

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

func (*CategorysGroupBy) Int

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

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

func (*CategorysGroupBy) IntX

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

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

func (*CategorysGroupBy) Ints

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

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

func (*CategorysGroupBy) IntsX

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

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

func (*CategorysGroupBy) Scan

func (cgb *CategorysGroupBy) Scan(ctx context.Context, v any) error

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

func (*CategorysGroupBy) ScanX

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

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

func (*CategorysGroupBy) String

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

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

func (*CategorysGroupBy) StringX

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

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

func (*CategorysGroupBy) Strings

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

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

func (*CategorysGroupBy) StringsX

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

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

type CategorysMutation

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

CategorysMutation represents an operation that mutates the Categorys nodes in the graph.

func (*CategorysMutation) AddField

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

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

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

func (*CategorysMutation) AddedField

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

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

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

func (*CategorysMutation) AddedIDs

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

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

func (*CategorysMutation) ClearEdge

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

func (m *CategorysMutation) 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 (*CategorysMutation) ClearedEdges

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

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

func (*CategorysMutation) ClearedFields

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

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

func (CategorysMutation) Client

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

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

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

func (*CategorysMutation) Field

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

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

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

func (*CategorysMutation) Fields

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

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

func (m *CategorysMutation) 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 (*CategorysMutation) OldField

func (m *CategorysMutation) 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 (*CategorysMutation) Op

func (m *CategorysMutation) Op() Op

Op returns the operation name.

func (*CategorysMutation) RemovedEdges

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

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

func (*CategorysMutation) RemovedIDs

func (m *CategorysMutation) 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 (*CategorysMutation) ResetEdge

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

func (m *CategorysMutation) 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 (*CategorysMutation) SetField

func (m *CategorysMutation) 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 (*CategorysMutation) SetOp

func (m *CategorysMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CategorysMutation) Tx

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

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

func (*CategorysMutation) Type

func (m *CategorysMutation) Type() string

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

func (*CategorysMutation) Where

func (m *CategorysMutation) Where(ps ...predicate.Categorys)

Where appends a list predicates to the CategorysMutation builder.

func (*CategorysMutation) WhereP

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

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

type CategorysQuery

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

CategorysQuery is the builder for querying Categorys entities.

func (*CategorysQuery) Aggregate

func (cq *CategorysQuery) Aggregate(fns ...AggregateFunc) *CategorysSelect

Aggregate returns a CategorysSelect configured with the given aggregations.

func (*CategorysQuery) All

func (cq *CategorysQuery) All(ctx context.Context) ([]*Categorys, error)

All executes the query and returns a list of CategorysSlice.

func (*CategorysQuery) AllX

func (cq *CategorysQuery) AllX(ctx context.Context) []*Categorys

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

func (*CategorysQuery) Clone

func (cq *CategorysQuery) Clone() *CategorysQuery

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

func (*CategorysQuery) Count

func (cq *CategorysQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CategorysQuery) CountX

func (cq *CategorysQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CategorysQuery) Exist

func (cq *CategorysQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CategorysQuery) ExistX

func (cq *CategorysQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CategorysQuery) First

func (cq *CategorysQuery) First(ctx context.Context) (*Categorys, error)

First returns the first Categorys entity from the query. Returns a *NotFoundError when no Categorys was found.

func (*CategorysQuery) FirstID

func (cq *CategorysQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Categorys ID from the query. Returns a *NotFoundError when no Categorys ID was found.

func (*CategorysQuery) FirstIDX

func (cq *CategorysQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*CategorysQuery) FirstX

func (cq *CategorysQuery) FirstX(ctx context.Context) *Categorys

FirstX is like First, but panics if an error occurs.

func (*CategorysQuery) GroupBy

func (cq *CategorysQuery) GroupBy(field string, fields ...string) *CategorysGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*CategorysQuery) IDs

func (cq *CategorysQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Categorys IDs.

func (*CategorysQuery) IDsX

func (cq *CategorysQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*CategorysQuery) Limit

func (cq *CategorysQuery) Limit(limit int) *CategorysQuery

Limit the number of records to be returned by this query.

func (*CategorysQuery) Offset

func (cq *CategorysQuery) Offset(offset int) *CategorysQuery

Offset to start from.

func (*CategorysQuery) Only

func (cq *CategorysQuery) Only(ctx context.Context) (*Categorys, error)

Only returns a single Categorys entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Categorys entity is found. Returns a *NotFoundError when no Categorys entities are found.

func (*CategorysQuery) OnlyID

func (cq *CategorysQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Categorys ID in the query. Returns a *NotSingularError when more than one Categorys ID is found. Returns a *NotFoundError when no entities are found.

func (*CategorysQuery) OnlyIDX

func (cq *CategorysQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CategorysQuery) OnlyX

func (cq *CategorysQuery) OnlyX(ctx context.Context) *Categorys

OnlyX is like Only, but panics if an error occurs.

func (*CategorysQuery) Order

Order specifies how the records should be ordered.

func (*CategorysQuery) Select

func (cq *CategorysQuery) Select(fields ...string) *CategorysSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*CategorysQuery) Unique

func (cq *CategorysQuery) Unique(unique bool) *CategorysQuery

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 (*CategorysQuery) Where

Where adds a new predicate for the CategorysQuery builder.

type CategorysSelect

type CategorysSelect struct {
	*CategorysQuery
	// contains filtered or unexported fields
}

CategorysSelect is the builder for selecting fields of Categorys entities.

func (*CategorysSelect) Aggregate

func (cs *CategorysSelect) Aggregate(fns ...AggregateFunc) *CategorysSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CategorysSelect) Bool

func (s *CategorysSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) BoolX

func (s *CategorysSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CategorysSelect) Bools

func (s *CategorysSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) BoolsX

func (s *CategorysSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CategorysSelect) Float64

func (s *CategorysSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) Float64X

func (s *CategorysSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CategorysSelect) Float64s

func (s *CategorysSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) Float64sX

func (s *CategorysSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CategorysSelect) Int

func (s *CategorysSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) IntX

func (s *CategorysSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CategorysSelect) Ints

func (s *CategorysSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) IntsX

func (s *CategorysSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CategorysSelect) Scan

func (cs *CategorysSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CategorysSelect) ScanX

func (s *CategorysSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CategorysSelect) String

func (s *CategorysSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) StringX

func (s *CategorysSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CategorysSelect) Strings

func (s *CategorysSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CategorysSelect) StringsX

func (s *CategorysSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CategorysSlice

type CategorysSlice []*Categorys

CategorysSlice is a parsable slice of Categorys.

type CategorysUpdate

type CategorysUpdate struct {
	// contains filtered or unexported fields
}

CategorysUpdate is the builder for updating Categorys entities.

func (*CategorysUpdate) Exec

func (cu *CategorysUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CategorysUpdate) ExecX

func (cu *CategorysUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategorysUpdate) Mutation

func (cu *CategorysUpdate) Mutation() *CategorysMutation

Mutation returns the CategorysMutation object of the builder.

func (*CategorysUpdate) Save

func (cu *CategorysUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CategorysUpdate) SaveX

func (cu *CategorysUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CategorysUpdate) Where

Where appends a list predicates to the CategorysUpdate builder.

type CategorysUpdateOne

type CategorysUpdateOne struct {
	// contains filtered or unexported fields
}

CategorysUpdateOne is the builder for updating a single Categorys entity.

func (*CategorysUpdateOne) Exec

func (cuo *CategorysUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CategorysUpdateOne) ExecX

func (cuo *CategorysUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CategorysUpdateOne) Mutation

func (cuo *CategorysUpdateOne) Mutation() *CategorysMutation

Mutation returns the CategorysMutation object of the builder.

func (*CategorysUpdateOne) Save

func (cuo *CategorysUpdateOne) Save(ctx context.Context) (*Categorys, error)

Save executes the query and returns the updated Categorys entity.

func (*CategorysUpdateOne) SaveX

func (cuo *CategorysUpdateOne) SaveX(ctx context.Context) *Categorys

SaveX is like Save, but panics if an error occurs.

func (*CategorysUpdateOne) Select

func (cuo *CategorysUpdateOne) Select(field string, fields ...string) *CategorysUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CategorysUpdateOne) Where

Where appends a list predicates to the CategorysUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Actors is the client for interacting with the Actors builders.
	Actors *ActorsClient
	// Albums is the client for interacting with the Albums builders.
	Albums *AlbumsClient
	// Artists is the client for interacting with the Artists builders.
	Artists *ArtistsClient
	// Audiobooks is the client for interacting with the Audiobooks builders.
	Audiobooks *AudiobooksClient
	// Categorys is the client for interacting with the Categorys builders.
	Categorys *CategorysClient
	// Devices is the client for interacting with the Devices builders.
	Devices *DevicesClient
	// Directors is the client for interacting with the Directors builders.
	Directors *DirectorsClient
	// Files is the client for interacting with the Files builders.
	Files *FilesClient
	// Images is the client for interacting with the Images builders.
	Images *ImagesClient
	// Musics is the client for interacting with the Musics builders.
	Musics *MusicsClient
	// Oidc is the client for interacting with the Oidc builders.
	Oidc *OidcClient
	// Playlists is the client for interacting with the Playlists builders.
	Playlists *PlaylistsClient
	// Users is the client for interacting with the Users builders.
	Users *UsersClient
	// Videos is the client for interacting with the Videos builders.
	Videos *VideosClient
	// 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().
	Actors.
	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 Devices

type Devices struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// IP holds the value of the "ip" field.
	IP string `json:"ip,omitempty"`
	// Device holds the value of the "device" field.
	Device string `json:"device,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DevicesQuery when eager-loading is set.
	Edges DevicesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Devices is the model entity for the Devices schema.

func (*Devices) QueryUser

func (d *Devices) QueryUser() *UsersQuery

QueryUser queries the "user" edge of the Devices entity.

func (*Devices) String

func (d *Devices) String() string

String implements the fmt.Stringer.

func (*Devices) Unwrap

func (d *Devices) Unwrap() *Devices

Unwrap unwraps the Devices 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 (*Devices) Update

func (d *Devices) Update() *DevicesUpdateOne

Update returns a builder for updating this Devices. Note that you need to call Devices.Unwrap() before calling this method if this Devices was returned from a transaction, and the transaction was committed or rolled back.

func (*Devices) Value

func (d *Devices) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Devices. This includes values selected through modifiers, order, etc.

type DevicesClient

type DevicesClient struct {
	// contains filtered or unexported fields
}

DevicesClient is a client for the Devices schema.

func NewDevicesClient

func NewDevicesClient(c config) *DevicesClient

NewDevicesClient returns a client for the Devices from the given config.

func (*DevicesClient) Create

func (c *DevicesClient) Create() *DevicesCreate

Create returns a builder for creating a Devices entity.

func (*DevicesClient) CreateBulk

func (c *DevicesClient) CreateBulk(builders ...*DevicesCreate) *DevicesCreateBulk

CreateBulk returns a builder for creating a bulk of Devices entities.

func (*DevicesClient) Delete

func (c *DevicesClient) Delete() *DevicesDelete

Delete returns a delete builder for Devices.

func (*DevicesClient) DeleteOne

func (c *DevicesClient) DeleteOne(d *Devices) *DevicesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DevicesClient) DeleteOneID

func (c *DevicesClient) DeleteOneID(id uint64) *DevicesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DevicesClient) Get

func (c *DevicesClient) Get(ctx context.Context, id uint64) (*Devices, error)

Get returns a Devices entity by its id.

func (*DevicesClient) GetX

func (c *DevicesClient) GetX(ctx context.Context, id uint64) *Devices

GetX is like Get, but panics if an error occurs.

func (*DevicesClient) Hooks

func (c *DevicesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DevicesClient) Intercept

func (c *DevicesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `devices.Intercept(f(g(h())))`.

func (*DevicesClient) Interceptors

func (c *DevicesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DevicesClient) MapCreateBulk

func (c *DevicesClient) MapCreateBulk(slice any, setFunc func(*DevicesCreate, int)) *DevicesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DevicesClient) Query

func (c *DevicesClient) Query() *DevicesQuery

Query returns a query builder for Devices.

func (*DevicesClient) QueryUser

func (c *DevicesClient) QueryUser(d *Devices) *UsersQuery

QueryUser queries the user edge of a Devices.

func (*DevicesClient) Update

func (c *DevicesClient) Update() *DevicesUpdate

Update returns an update builder for Devices.

func (*DevicesClient) UpdateOne

func (c *DevicesClient) UpdateOne(d *Devices) *DevicesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DevicesClient) UpdateOneID

func (c *DevicesClient) UpdateOneID(id uint64) *DevicesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DevicesClient) Use

func (c *DevicesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `devices.Hooks(f(g(h())))`.

type DevicesCreate

type DevicesCreate struct {
	// contains filtered or unexported fields
}

DevicesCreate is the builder for creating a Devices entity.

func (*DevicesCreate) Exec

func (dc *DevicesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DevicesCreate) ExecX

func (dc *DevicesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DevicesCreate) Mutation

func (dc *DevicesCreate) Mutation() *DevicesMutation

Mutation returns the DevicesMutation object of the builder.

func (*DevicesCreate) Save

func (dc *DevicesCreate) Save(ctx context.Context) (*Devices, error)

Save creates the Devices in the database.

func (*DevicesCreate) SaveX

func (dc *DevicesCreate) SaveX(ctx context.Context) *Devices

SaveX calls Save and panics if Save returns an error.

func (*DevicesCreate) SetCreateTime

func (dc *DevicesCreate) SetCreateTime(t time.Time) *DevicesCreate

SetCreateTime sets the "create_time" field.

func (*DevicesCreate) SetDevice

func (dc *DevicesCreate) SetDevice(s string) *DevicesCreate

SetDevice sets the "device" field.

func (*DevicesCreate) SetID

func (dc *DevicesCreate) SetID(u uint64) *DevicesCreate

SetID sets the "id" field.

func (*DevicesCreate) SetIP

func (dc *DevicesCreate) SetIP(s string) *DevicesCreate

SetIP sets the "ip" field.

func (*DevicesCreate) SetNillableCreateTime

func (dc *DevicesCreate) SetNillableCreateTime(t *time.Time) *DevicesCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*DevicesCreate) SetNillableUpdateTime

func (dc *DevicesCreate) SetNillableUpdateTime(t *time.Time) *DevicesCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*DevicesCreate) SetNillableUserID

func (dc *DevicesCreate) SetNillableUserID(id *uint64) *DevicesCreate

SetNillableUserID sets the "user" edge to the Users entity by ID if the given value is not nil.

func (*DevicesCreate) SetUpdateTime

func (dc *DevicesCreate) SetUpdateTime(t time.Time) *DevicesCreate

SetUpdateTime sets the "update_time" field.

func (*DevicesCreate) SetUser

func (dc *DevicesCreate) SetUser(u *Users) *DevicesCreate

SetUser sets the "user" edge to the Users entity.

func (*DevicesCreate) SetUserID

func (dc *DevicesCreate) SetUserID(id uint64) *DevicesCreate

SetUserID sets the "user" edge to the Users entity by ID.

type DevicesCreateBulk

type DevicesCreateBulk struct {
	// contains filtered or unexported fields
}

DevicesCreateBulk is the builder for creating many Devices entities in bulk.

func (*DevicesCreateBulk) Exec

func (dcb *DevicesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DevicesCreateBulk) ExecX

func (dcb *DevicesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DevicesCreateBulk) Save

func (dcb *DevicesCreateBulk) Save(ctx context.Context) ([]*Devices, error)

Save creates the Devices entities in the database.

func (*DevicesCreateBulk) SaveX

func (dcb *DevicesCreateBulk) SaveX(ctx context.Context) []*Devices

SaveX is like Save, but panics if an error occurs.

type DevicesDelete

type DevicesDelete struct {
	// contains filtered or unexported fields
}

DevicesDelete is the builder for deleting a Devices entity.

func (*DevicesDelete) Exec

func (dd *DevicesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DevicesDelete) ExecX

func (dd *DevicesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DevicesDelete) Where

func (dd *DevicesDelete) Where(ps ...predicate.Devices) *DevicesDelete

Where appends a list predicates to the DevicesDelete builder.

type DevicesDeleteOne

type DevicesDeleteOne struct {
	// contains filtered or unexported fields
}

DevicesDeleteOne is the builder for deleting a single Devices entity.

func (*DevicesDeleteOne) Exec

func (ddo *DevicesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DevicesDeleteOne) ExecX

func (ddo *DevicesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DevicesDeleteOne) Where

Where appends a list predicates to the DevicesDelete builder.

type DevicesEdges

type DevicesEdges struct {
	// User holds the value of the user edge.
	User *Users `json:"user,omitempty"`
	// contains filtered or unexported fields
}

DevicesEdges holds the relations/edges for other nodes in the graph.

func (DevicesEdges) UserOrErr

func (e DevicesEdges) UserOrErr() (*Users, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type DevicesGroupBy

type DevicesGroupBy struct {
	// contains filtered or unexported fields
}

DevicesGroupBy is the group-by builder for Devices entities.

func (*DevicesGroupBy) Aggregate

func (dgb *DevicesGroupBy) Aggregate(fns ...AggregateFunc) *DevicesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DevicesGroupBy) Bool

func (s *DevicesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) BoolX

func (s *DevicesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DevicesGroupBy) Bools

func (s *DevicesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) BoolsX

func (s *DevicesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DevicesGroupBy) Float64

func (s *DevicesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) Float64X

func (s *DevicesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DevicesGroupBy) Float64s

func (s *DevicesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) Float64sX

func (s *DevicesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DevicesGroupBy) Int

func (s *DevicesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) IntX

func (s *DevicesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DevicesGroupBy) Ints

func (s *DevicesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) IntsX

func (s *DevicesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DevicesGroupBy) Scan

func (dgb *DevicesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DevicesGroupBy) ScanX

func (s *DevicesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DevicesGroupBy) String

func (s *DevicesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) StringX

func (s *DevicesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DevicesGroupBy) Strings

func (s *DevicesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DevicesGroupBy) StringsX

func (s *DevicesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DevicesMutation

type DevicesMutation struct {
	// contains filtered or unexported fields
}

DevicesMutation represents an operation that mutates the Devices nodes in the graph.

func (*DevicesMutation) AddField

func (m *DevicesMutation) 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 (*DevicesMutation) AddedEdges

func (m *DevicesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DevicesMutation) AddedField

func (m *DevicesMutation) 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 (*DevicesMutation) AddedFields

func (m *DevicesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DevicesMutation) AddedIDs

func (m *DevicesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DevicesMutation) ClearEdge

func (m *DevicesMutation) 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 (*DevicesMutation) ClearField

func (m *DevicesMutation) 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 (*DevicesMutation) ClearUser

func (m *DevicesMutation) ClearUser()

ClearUser clears the "user" edge to the Users entity.

func (*DevicesMutation) ClearedEdges

func (m *DevicesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DevicesMutation) ClearedFields

func (m *DevicesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DevicesMutation) Client

func (m DevicesMutation) 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 (*DevicesMutation) CreateTime

func (m *DevicesMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DevicesMutation) Device

func (m *DevicesMutation) Device() (r string, exists bool)

Device returns the value of the "device" field in the mutation.

func (*DevicesMutation) EdgeCleared

func (m *DevicesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DevicesMutation) Field

func (m *DevicesMutation) 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 (*DevicesMutation) FieldCleared

func (m *DevicesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DevicesMutation) Fields

func (m *DevicesMutation) 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 (*DevicesMutation) ID

func (m *DevicesMutation) 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 (*DevicesMutation) IDs

func (m *DevicesMutation) 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 (*DevicesMutation) IP

func (m *DevicesMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*DevicesMutation) OldCreateTime

func (m *DevicesMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) OldDevice

func (m *DevicesMutation) OldDevice(ctx context.Context) (v string, err error)

OldDevice returns the old "device" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) OldField

func (m *DevicesMutation) 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 (*DevicesMutation) OldIP

func (m *DevicesMutation) OldIP(ctx context.Context) (v string, err error)

OldIP returns the old "ip" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) OldUpdateTime

func (m *DevicesMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Devices entity. If the Devices 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 (*DevicesMutation) Op

func (m *DevicesMutation) Op() Op

Op returns the operation name.

func (*DevicesMutation) RemovedEdges

func (m *DevicesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DevicesMutation) RemovedIDs

func (m *DevicesMutation) 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 (*DevicesMutation) ResetCreateTime

func (m *DevicesMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DevicesMutation) ResetDevice

func (m *DevicesMutation) ResetDevice()

ResetDevice resets all changes to the "device" field.

func (*DevicesMutation) ResetEdge

func (m *DevicesMutation) 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 (*DevicesMutation) ResetField

func (m *DevicesMutation) 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 (*DevicesMutation) ResetIP

func (m *DevicesMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*DevicesMutation) ResetUpdateTime

func (m *DevicesMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*DevicesMutation) ResetUser

func (m *DevicesMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*DevicesMutation) SetCreateTime

func (m *DevicesMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DevicesMutation) SetDevice

func (m *DevicesMutation) SetDevice(s string)

SetDevice sets the "device" field.

func (*DevicesMutation) SetField

func (m *DevicesMutation) 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 (*DevicesMutation) SetID

func (m *DevicesMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Devices entities.

func (*DevicesMutation) SetIP

func (m *DevicesMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*DevicesMutation) SetOp

func (m *DevicesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DevicesMutation) SetUpdateTime

func (m *DevicesMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*DevicesMutation) SetUserID

func (m *DevicesMutation) SetUserID(id uint64)

SetUserID sets the "user" edge to the Users entity by id.

func (DevicesMutation) Tx

func (m DevicesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DevicesMutation) Type

func (m *DevicesMutation) Type() string

Type returns the node type of this mutation (Devices).

func (*DevicesMutation) UpdateTime

func (m *DevicesMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*DevicesMutation) UserCleared

func (m *DevicesMutation) UserCleared() bool

UserCleared reports if the "user" edge to the Users entity was cleared.

func (*DevicesMutation) UserID

func (m *DevicesMutation) UserID() (id uint64, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*DevicesMutation) UserIDs

func (m *DevicesMutation) 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 (*DevicesMutation) Where

func (m *DevicesMutation) Where(ps ...predicate.Devices)

Where appends a list predicates to the DevicesMutation builder.

func (*DevicesMutation) WhereP

func (m *DevicesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DevicesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DevicesQuery

type DevicesQuery struct {
	// contains filtered or unexported fields
}

DevicesQuery is the builder for querying Devices entities.

func (*DevicesQuery) Aggregate

func (dq *DevicesQuery) Aggregate(fns ...AggregateFunc) *DevicesSelect

Aggregate returns a DevicesSelect configured with the given aggregations.

func (*DevicesQuery) All

func (dq *DevicesQuery) All(ctx context.Context) ([]*Devices, error)

All executes the query and returns a list of DevicesSlice.

func (*DevicesQuery) AllX

func (dq *DevicesQuery) AllX(ctx context.Context) []*Devices

AllX is like All, but panics if an error occurs.

func (*DevicesQuery) Clone

func (dq *DevicesQuery) Clone() *DevicesQuery

Clone returns a duplicate of the DevicesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DevicesQuery) Count

func (dq *DevicesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DevicesQuery) CountX

func (dq *DevicesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DevicesQuery) Exist

func (dq *DevicesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DevicesQuery) ExistX

func (dq *DevicesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DevicesQuery) First

func (dq *DevicesQuery) First(ctx context.Context) (*Devices, error)

First returns the first Devices entity from the query. Returns a *NotFoundError when no Devices was found.

func (*DevicesQuery) FirstID

func (dq *DevicesQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Devices ID from the query. Returns a *NotFoundError when no Devices ID was found.

func (*DevicesQuery) FirstIDX

func (dq *DevicesQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*DevicesQuery) FirstX

func (dq *DevicesQuery) FirstX(ctx context.Context) *Devices

FirstX is like First, but panics if an error occurs.

func (*DevicesQuery) GroupBy

func (dq *DevicesQuery) GroupBy(field string, fields ...string) *DevicesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Devices.Query().
	GroupBy(devices.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DevicesQuery) IDs

func (dq *DevicesQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Devices IDs.

func (*DevicesQuery) IDsX

func (dq *DevicesQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*DevicesQuery) Limit

func (dq *DevicesQuery) Limit(limit int) *DevicesQuery

Limit the number of records to be returned by this query.

func (*DevicesQuery) Offset

func (dq *DevicesQuery) Offset(offset int) *DevicesQuery

Offset to start from.

func (*DevicesQuery) Only

func (dq *DevicesQuery) Only(ctx context.Context) (*Devices, error)

Only returns a single Devices entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Devices entity is found. Returns a *NotFoundError when no Devices entities are found.

func (*DevicesQuery) OnlyID

func (dq *DevicesQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Devices ID in the query. Returns a *NotSingularError when more than one Devices ID is found. Returns a *NotFoundError when no entities are found.

func (*DevicesQuery) OnlyIDX

func (dq *DevicesQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DevicesQuery) OnlyX

func (dq *DevicesQuery) OnlyX(ctx context.Context) *Devices

OnlyX is like Only, but panics if an error occurs.

func (*DevicesQuery) Order

func (dq *DevicesQuery) Order(o ...devices.OrderOption) *DevicesQuery

Order specifies how the records should be ordered.

func (*DevicesQuery) QueryUser

func (dq *DevicesQuery) QueryUser() *UsersQuery

QueryUser chains the current query on the "user" edge.

func (*DevicesQuery) Select

func (dq *DevicesQuery) Select(fields ...string) *DevicesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Devices.Query().
	Select(devices.FieldCreateTime).
	Scan(ctx, &v)

func (*DevicesQuery) Unique

func (dq *DevicesQuery) Unique(unique bool) *DevicesQuery

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 (*DevicesQuery) Where

func (dq *DevicesQuery) Where(ps ...predicate.Devices) *DevicesQuery

Where adds a new predicate for the DevicesQuery builder.

func (*DevicesQuery) WithUser

func (dq *DevicesQuery) WithUser(opts ...func(*UsersQuery)) *DevicesQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type DevicesSelect

type DevicesSelect struct {
	*DevicesQuery
	// contains filtered or unexported fields
}

DevicesSelect is the builder for selecting fields of Devices entities.

func (*DevicesSelect) Aggregate

func (ds *DevicesSelect) Aggregate(fns ...AggregateFunc) *DevicesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DevicesSelect) Bool

func (s *DevicesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) BoolX

func (s *DevicesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DevicesSelect) Bools

func (s *DevicesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) BoolsX

func (s *DevicesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DevicesSelect) Float64

func (s *DevicesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) Float64X

func (s *DevicesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DevicesSelect) Float64s

func (s *DevicesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) Float64sX

func (s *DevicesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DevicesSelect) Int

func (s *DevicesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) IntX

func (s *DevicesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DevicesSelect) Ints

func (s *DevicesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) IntsX

func (s *DevicesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DevicesSelect) Scan

func (ds *DevicesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DevicesSelect) ScanX

func (s *DevicesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DevicesSelect) String

func (s *DevicesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) StringX

func (s *DevicesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DevicesSelect) Strings

func (s *DevicesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DevicesSelect) StringsX

func (s *DevicesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DevicesSlice

type DevicesSlice []*Devices

DevicesSlice is a parsable slice of Devices.

type DevicesUpdate

type DevicesUpdate struct {
	// contains filtered or unexported fields
}

DevicesUpdate is the builder for updating Devices entities.

func (*DevicesUpdate) ClearUser

func (du *DevicesUpdate) ClearUser() *DevicesUpdate

ClearUser clears the "user" edge to the Users entity.

func (*DevicesUpdate) Exec

func (du *DevicesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DevicesUpdate) ExecX

func (du *DevicesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DevicesUpdate) Mutation

func (du *DevicesUpdate) Mutation() *DevicesMutation

Mutation returns the DevicesMutation object of the builder.

func (*DevicesUpdate) Save

func (du *DevicesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DevicesUpdate) SaveX

func (du *DevicesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DevicesUpdate) SetDevice

func (du *DevicesUpdate) SetDevice(s string) *DevicesUpdate

SetDevice sets the "device" field.

func (*DevicesUpdate) SetIP

func (du *DevicesUpdate) SetIP(s string) *DevicesUpdate

SetIP sets the "ip" field.

func (*DevicesUpdate) SetNillableDevice

func (du *DevicesUpdate) SetNillableDevice(s *string) *DevicesUpdate

SetNillableDevice sets the "device" field if the given value is not nil.

func (*DevicesUpdate) SetNillableIP

func (du *DevicesUpdate) SetNillableIP(s *string) *DevicesUpdate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*DevicesUpdate) SetNillableUserID

func (du *DevicesUpdate) SetNillableUserID(id *uint64) *DevicesUpdate

SetNillableUserID sets the "user" edge to the Users entity by ID if the given value is not nil.

func (*DevicesUpdate) SetUpdateTime

func (du *DevicesUpdate) SetUpdateTime(t time.Time) *DevicesUpdate

SetUpdateTime sets the "update_time" field.

func (*DevicesUpdate) SetUser

func (du *DevicesUpdate) SetUser(u *Users) *DevicesUpdate

SetUser sets the "user" edge to the Users entity.

func (*DevicesUpdate) SetUserID

func (du *DevicesUpdate) SetUserID(id uint64) *DevicesUpdate

SetUserID sets the "user" edge to the Users entity by ID.

func (*DevicesUpdate) Where

func (du *DevicesUpdate) Where(ps ...predicate.Devices) *DevicesUpdate

Where appends a list predicates to the DevicesUpdate builder.

type DevicesUpdateOne

type DevicesUpdateOne struct {
	// contains filtered or unexported fields
}

DevicesUpdateOne is the builder for updating a single Devices entity.

func (*DevicesUpdateOne) ClearUser

func (duo *DevicesUpdateOne) ClearUser() *DevicesUpdateOne

ClearUser clears the "user" edge to the Users entity.

func (*DevicesUpdateOne) Exec

func (duo *DevicesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DevicesUpdateOne) ExecX

func (duo *DevicesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DevicesUpdateOne) Mutation

func (duo *DevicesUpdateOne) Mutation() *DevicesMutation

Mutation returns the DevicesMutation object of the builder.

func (*DevicesUpdateOne) Save

func (duo *DevicesUpdateOne) Save(ctx context.Context) (*Devices, error)

Save executes the query and returns the updated Devices entity.

func (*DevicesUpdateOne) SaveX

func (duo *DevicesUpdateOne) SaveX(ctx context.Context) *Devices

SaveX is like Save, but panics if an error occurs.

func (*DevicesUpdateOne) Select

func (duo *DevicesUpdateOne) Select(field string, fields ...string) *DevicesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DevicesUpdateOne) SetDevice

func (duo *DevicesUpdateOne) SetDevice(s string) *DevicesUpdateOne

SetDevice sets the "device" field.

func (*DevicesUpdateOne) SetIP

func (duo *DevicesUpdateOne) SetIP(s string) *DevicesUpdateOne

SetIP sets the "ip" field.

func (*DevicesUpdateOne) SetNillableDevice

func (duo *DevicesUpdateOne) SetNillableDevice(s *string) *DevicesUpdateOne

SetNillableDevice sets the "device" field if the given value is not nil.

func (*DevicesUpdateOne) SetNillableIP

func (duo *DevicesUpdateOne) SetNillableIP(s *string) *DevicesUpdateOne

SetNillableIP sets the "ip" field if the given value is not nil.

func (*DevicesUpdateOne) SetNillableUserID

func (duo *DevicesUpdateOne) SetNillableUserID(id *uint64) *DevicesUpdateOne

SetNillableUserID sets the "user" edge to the Users entity by ID if the given value is not nil.

func (*DevicesUpdateOne) SetUpdateTime

func (duo *DevicesUpdateOne) SetUpdateTime(t time.Time) *DevicesUpdateOne

SetUpdateTime sets the "update_time" field.

func (*DevicesUpdateOne) SetUser

func (duo *DevicesUpdateOne) SetUser(u *Users) *DevicesUpdateOne

SetUser sets the "user" edge to the Users entity.

func (*DevicesUpdateOne) SetUserID

func (duo *DevicesUpdateOne) SetUserID(id uint64) *DevicesUpdateOne

SetUserID sets the "user" edge to the Users entity by ID.

func (*DevicesUpdateOne) Where

Where appends a list predicates to the DevicesUpdate builder.

type Directors

type Directors struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Directors is the model entity for the Directors schema.

func (*Directors) String

func (d *Directors) String() string

String implements the fmt.Stringer.

func (*Directors) Unwrap

func (d *Directors) Unwrap() *Directors

Unwrap unwraps the Directors 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 (*Directors) Update

func (d *Directors) Update() *DirectorsUpdateOne

Update returns a builder for updating this Directors. Note that you need to call Directors.Unwrap() before calling this method if this Directors was returned from a transaction, and the transaction was committed or rolled back.

func (*Directors) Value

func (d *Directors) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Directors. This includes values selected through modifiers, order, etc.

type DirectorsClient

type DirectorsClient struct {
	// contains filtered or unexported fields
}

DirectorsClient is a client for the Directors schema.

func NewDirectorsClient

func NewDirectorsClient(c config) *DirectorsClient

NewDirectorsClient returns a client for the Directors from the given config.

func (*DirectorsClient) Create

func (c *DirectorsClient) Create() *DirectorsCreate

Create returns a builder for creating a Directors entity.

func (*DirectorsClient) CreateBulk

func (c *DirectorsClient) CreateBulk(builders ...*DirectorsCreate) *DirectorsCreateBulk

CreateBulk returns a builder for creating a bulk of Directors entities.

func (*DirectorsClient) Delete

func (c *DirectorsClient) Delete() *DirectorsDelete

Delete returns a delete builder for Directors.

func (*DirectorsClient) DeleteOne

func (c *DirectorsClient) DeleteOne(d *Directors) *DirectorsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DirectorsClient) DeleteOneID

func (c *DirectorsClient) DeleteOneID(id int) *DirectorsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DirectorsClient) Get

func (c *DirectorsClient) Get(ctx context.Context, id int) (*Directors, error)

Get returns a Directors entity by its id.

func (*DirectorsClient) GetX

func (c *DirectorsClient) GetX(ctx context.Context, id int) *Directors

GetX is like Get, but panics if an error occurs.

func (*DirectorsClient) Hooks

func (c *DirectorsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DirectorsClient) Intercept

func (c *DirectorsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `directors.Intercept(f(g(h())))`.

func (*DirectorsClient) Interceptors

func (c *DirectorsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DirectorsClient) MapCreateBulk

func (c *DirectorsClient) MapCreateBulk(slice any, setFunc func(*DirectorsCreate, int)) *DirectorsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DirectorsClient) Query

func (c *DirectorsClient) Query() *DirectorsQuery

Query returns a query builder for Directors.

func (*DirectorsClient) Update

func (c *DirectorsClient) Update() *DirectorsUpdate

Update returns an update builder for Directors.

func (*DirectorsClient) UpdateOne

func (c *DirectorsClient) UpdateOne(d *Directors) *DirectorsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DirectorsClient) UpdateOneID

func (c *DirectorsClient) UpdateOneID(id int) *DirectorsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DirectorsClient) Use

func (c *DirectorsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `directors.Hooks(f(g(h())))`.

type DirectorsCreate

type DirectorsCreate struct {
	// contains filtered or unexported fields
}

DirectorsCreate is the builder for creating a Directors entity.

func (*DirectorsCreate) Exec

func (dc *DirectorsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DirectorsCreate) ExecX

func (dc *DirectorsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DirectorsCreate) Mutation

func (dc *DirectorsCreate) Mutation() *DirectorsMutation

Mutation returns the DirectorsMutation object of the builder.

func (*DirectorsCreate) Save

func (dc *DirectorsCreate) Save(ctx context.Context) (*Directors, error)

Save creates the Directors in the database.

func (*DirectorsCreate) SaveX

func (dc *DirectorsCreate) SaveX(ctx context.Context) *Directors

SaveX calls Save and panics if Save returns an error.

type DirectorsCreateBulk

type DirectorsCreateBulk struct {
	// contains filtered or unexported fields
}

DirectorsCreateBulk is the builder for creating many Directors entities in bulk.

func (*DirectorsCreateBulk) Exec

func (dcb *DirectorsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DirectorsCreateBulk) ExecX

func (dcb *DirectorsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DirectorsCreateBulk) Save

func (dcb *DirectorsCreateBulk) Save(ctx context.Context) ([]*Directors, error)

Save creates the Directors entities in the database.

func (*DirectorsCreateBulk) SaveX

func (dcb *DirectorsCreateBulk) SaveX(ctx context.Context) []*Directors

SaveX is like Save, but panics if an error occurs.

type DirectorsDelete

type DirectorsDelete struct {
	// contains filtered or unexported fields
}

DirectorsDelete is the builder for deleting a Directors entity.

func (*DirectorsDelete) Exec

func (dd *DirectorsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DirectorsDelete) ExecX

func (dd *DirectorsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DirectorsDelete) Where

Where appends a list predicates to the DirectorsDelete builder.

type DirectorsDeleteOne

type DirectorsDeleteOne struct {
	// contains filtered or unexported fields
}

DirectorsDeleteOne is the builder for deleting a single Directors entity.

func (*DirectorsDeleteOne) Exec

func (ddo *DirectorsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DirectorsDeleteOne) ExecX

func (ddo *DirectorsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DirectorsDeleteOne) Where

Where appends a list predicates to the DirectorsDelete builder.

type DirectorsGroupBy

type DirectorsGroupBy struct {
	// contains filtered or unexported fields
}

DirectorsGroupBy is the group-by builder for Directors entities.

func (*DirectorsGroupBy) Aggregate

func (dgb *DirectorsGroupBy) Aggregate(fns ...AggregateFunc) *DirectorsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DirectorsGroupBy) Bool

func (s *DirectorsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) BoolX

func (s *DirectorsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DirectorsGroupBy) Bools

func (s *DirectorsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) BoolsX

func (s *DirectorsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DirectorsGroupBy) Float64

func (s *DirectorsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) Float64X

func (s *DirectorsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DirectorsGroupBy) Float64s

func (s *DirectorsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) Float64sX

func (s *DirectorsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DirectorsGroupBy) Int

func (s *DirectorsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) IntX

func (s *DirectorsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DirectorsGroupBy) Ints

func (s *DirectorsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) IntsX

func (s *DirectorsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DirectorsGroupBy) Scan

func (dgb *DirectorsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DirectorsGroupBy) ScanX

func (s *DirectorsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DirectorsGroupBy) String

func (s *DirectorsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) StringX

func (s *DirectorsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DirectorsGroupBy) Strings

func (s *DirectorsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DirectorsGroupBy) StringsX

func (s *DirectorsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DirectorsMutation

type DirectorsMutation struct {
	// contains filtered or unexported fields
}

DirectorsMutation represents an operation that mutates the Directors nodes in the graph.

func (*DirectorsMutation) AddField

func (m *DirectorsMutation) 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 (*DirectorsMutation) AddedEdges

func (m *DirectorsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DirectorsMutation) AddedField

func (m *DirectorsMutation) 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 (*DirectorsMutation) AddedFields

func (m *DirectorsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DirectorsMutation) AddedIDs

func (m *DirectorsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DirectorsMutation) ClearEdge

func (m *DirectorsMutation) 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 (*DirectorsMutation) ClearField

func (m *DirectorsMutation) 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 (*DirectorsMutation) ClearedEdges

func (m *DirectorsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DirectorsMutation) ClearedFields

func (m *DirectorsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DirectorsMutation) Client

func (m DirectorsMutation) 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 (*DirectorsMutation) EdgeCleared

func (m *DirectorsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DirectorsMutation) Field

func (m *DirectorsMutation) 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 (*DirectorsMutation) FieldCleared

func (m *DirectorsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DirectorsMutation) Fields

func (m *DirectorsMutation) 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 (*DirectorsMutation) ID

func (m *DirectorsMutation) 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 (*DirectorsMutation) IDs

func (m *DirectorsMutation) 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 (*DirectorsMutation) OldField

func (m *DirectorsMutation) 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 (*DirectorsMutation) Op

func (m *DirectorsMutation) Op() Op

Op returns the operation name.

func (*DirectorsMutation) RemovedEdges

func (m *DirectorsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DirectorsMutation) RemovedIDs

func (m *DirectorsMutation) 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 (*DirectorsMutation) ResetEdge

func (m *DirectorsMutation) 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 (*DirectorsMutation) ResetField

func (m *DirectorsMutation) 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 (*DirectorsMutation) SetField

func (m *DirectorsMutation) 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 (*DirectorsMutation) SetOp

func (m *DirectorsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (DirectorsMutation) Tx

func (m DirectorsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DirectorsMutation) Type

func (m *DirectorsMutation) Type() string

Type returns the node type of this mutation (Directors).

func (*DirectorsMutation) Where

func (m *DirectorsMutation) Where(ps ...predicate.Directors)

Where appends a list predicates to the DirectorsMutation builder.

func (*DirectorsMutation) WhereP

func (m *DirectorsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DirectorsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DirectorsQuery

type DirectorsQuery struct {
	// contains filtered or unexported fields
}

DirectorsQuery is the builder for querying Directors entities.

func (*DirectorsQuery) Aggregate

func (dq *DirectorsQuery) Aggregate(fns ...AggregateFunc) *DirectorsSelect

Aggregate returns a DirectorsSelect configured with the given aggregations.

func (*DirectorsQuery) All

func (dq *DirectorsQuery) All(ctx context.Context) ([]*Directors, error)

All executes the query and returns a list of DirectorsSlice.

func (*DirectorsQuery) AllX

func (dq *DirectorsQuery) AllX(ctx context.Context) []*Directors

AllX is like All, but panics if an error occurs.

func (*DirectorsQuery) Clone

func (dq *DirectorsQuery) Clone() *DirectorsQuery

Clone returns a duplicate of the DirectorsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DirectorsQuery) Count

func (dq *DirectorsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DirectorsQuery) CountX

func (dq *DirectorsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DirectorsQuery) Exist

func (dq *DirectorsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DirectorsQuery) ExistX

func (dq *DirectorsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DirectorsQuery) First

func (dq *DirectorsQuery) First(ctx context.Context) (*Directors, error)

First returns the first Directors entity from the query. Returns a *NotFoundError when no Directors was found.

func (*DirectorsQuery) FirstID

func (dq *DirectorsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Directors ID from the query. Returns a *NotFoundError when no Directors ID was found.

func (*DirectorsQuery) FirstIDX

func (dq *DirectorsQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*DirectorsQuery) FirstX

func (dq *DirectorsQuery) FirstX(ctx context.Context) *Directors

FirstX is like First, but panics if an error occurs.

func (*DirectorsQuery) GroupBy

func (dq *DirectorsQuery) GroupBy(field string, fields ...string) *DirectorsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*DirectorsQuery) IDs

func (dq *DirectorsQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Directors IDs.

func (*DirectorsQuery) IDsX

func (dq *DirectorsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*DirectorsQuery) Limit

func (dq *DirectorsQuery) Limit(limit int) *DirectorsQuery

Limit the number of records to be returned by this query.

func (*DirectorsQuery) Offset

func (dq *DirectorsQuery) Offset(offset int) *DirectorsQuery

Offset to start from.

func (*DirectorsQuery) Only

func (dq *DirectorsQuery) Only(ctx context.Context) (*Directors, error)

Only returns a single Directors entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Directors entity is found. Returns a *NotFoundError when no Directors entities are found.

func (*DirectorsQuery) OnlyID

func (dq *DirectorsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Directors ID in the query. Returns a *NotSingularError when more than one Directors ID is found. Returns a *NotFoundError when no entities are found.

func (*DirectorsQuery) OnlyIDX

func (dq *DirectorsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DirectorsQuery) OnlyX

func (dq *DirectorsQuery) OnlyX(ctx context.Context) *Directors

OnlyX is like Only, but panics if an error occurs.

func (*DirectorsQuery) Order

Order specifies how the records should be ordered.

func (*DirectorsQuery) Select

func (dq *DirectorsQuery) Select(fields ...string) *DirectorsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*DirectorsQuery) Unique

func (dq *DirectorsQuery) Unique(unique bool) *DirectorsQuery

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 (*DirectorsQuery) Where

Where adds a new predicate for the DirectorsQuery builder.

type DirectorsSelect

type DirectorsSelect struct {
	*DirectorsQuery
	// contains filtered or unexported fields
}

DirectorsSelect is the builder for selecting fields of Directors entities.

func (*DirectorsSelect) Aggregate

func (ds *DirectorsSelect) Aggregate(fns ...AggregateFunc) *DirectorsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DirectorsSelect) Bool

func (s *DirectorsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) BoolX

func (s *DirectorsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DirectorsSelect) Bools

func (s *DirectorsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) BoolsX

func (s *DirectorsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DirectorsSelect) Float64

func (s *DirectorsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) Float64X

func (s *DirectorsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DirectorsSelect) Float64s

func (s *DirectorsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) Float64sX

func (s *DirectorsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DirectorsSelect) Int

func (s *DirectorsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) IntX

func (s *DirectorsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DirectorsSelect) Ints

func (s *DirectorsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) IntsX

func (s *DirectorsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DirectorsSelect) Scan

func (ds *DirectorsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DirectorsSelect) ScanX

func (s *DirectorsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DirectorsSelect) String

func (s *DirectorsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) StringX

func (s *DirectorsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DirectorsSelect) Strings

func (s *DirectorsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DirectorsSelect) StringsX

func (s *DirectorsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DirectorsSlice

type DirectorsSlice []*Directors

DirectorsSlice is a parsable slice of Directors.

type DirectorsUpdate

type DirectorsUpdate struct {
	// contains filtered or unexported fields
}

DirectorsUpdate is the builder for updating Directors entities.

func (*DirectorsUpdate) Exec

func (du *DirectorsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DirectorsUpdate) ExecX

func (du *DirectorsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DirectorsUpdate) Mutation

func (du *DirectorsUpdate) Mutation() *DirectorsMutation

Mutation returns the DirectorsMutation object of the builder.

func (*DirectorsUpdate) Save

func (du *DirectorsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DirectorsUpdate) SaveX

func (du *DirectorsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DirectorsUpdate) Where

Where appends a list predicates to the DirectorsUpdate builder.

type DirectorsUpdateOne

type DirectorsUpdateOne struct {
	// contains filtered or unexported fields
}

DirectorsUpdateOne is the builder for updating a single Directors entity.

func (*DirectorsUpdateOne) Exec

func (duo *DirectorsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DirectorsUpdateOne) ExecX

func (duo *DirectorsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DirectorsUpdateOne) Mutation

func (duo *DirectorsUpdateOne) Mutation() *DirectorsMutation

Mutation returns the DirectorsMutation object of the builder.

func (*DirectorsUpdateOne) Save

func (duo *DirectorsUpdateOne) Save(ctx context.Context) (*Directors, error)

Save executes the query and returns the updated Directors entity.

func (*DirectorsUpdateOne) SaveX

func (duo *DirectorsUpdateOne) SaveX(ctx context.Context) *Directors

SaveX is like Save, but panics if an error occurs.

func (*DirectorsUpdateOne) Select

func (duo *DirectorsUpdateOne) Select(field string, fields ...string) *DirectorsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DirectorsUpdateOne) Where

Where appends a list predicates to the DirectorsUpdate builder.

type Files

type Files struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Size holds the value of the "size" field.
	Size uint64 `json:"size,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FilesQuery when eager-loading is set.
	Edges FilesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Files is the model entity for the Files schema.

func (*Files) QueryImages

func (f *Files) QueryImages() *ImagesQuery

QueryImages queries the "images" edge of the Files entity.

func (*Files) QueryMusics

func (f *Files) QueryMusics() *MusicsQuery

QueryMusics queries the "musics" edge of the Files entity.

func (*Files) String

func (f *Files) String() string

String implements the fmt.Stringer.

func (*Files) Unwrap

func (f *Files) Unwrap() *Files

Unwrap unwraps the Files 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 (*Files) Update

func (f *Files) Update() *FilesUpdateOne

Update returns a builder for updating this Files. Note that you need to call Files.Unwrap() before calling this method if this Files was returned from a transaction, and the transaction was committed or rolled back.

func (*Files) Value

func (f *Files) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Files. This includes values selected through modifiers, order, etc.

type FilesClient

type FilesClient struct {
	// contains filtered or unexported fields
}

FilesClient is a client for the Files schema.

func NewFilesClient

func NewFilesClient(c config) *FilesClient

NewFilesClient returns a client for the Files from the given config.

func (*FilesClient) Create

func (c *FilesClient) Create() *FilesCreate

Create returns a builder for creating a Files entity.

func (*FilesClient) CreateBulk

func (c *FilesClient) CreateBulk(builders ...*FilesCreate) *FilesCreateBulk

CreateBulk returns a builder for creating a bulk of Files entities.

func (*FilesClient) Delete

func (c *FilesClient) Delete() *FilesDelete

Delete returns a delete builder for Files.

func (*FilesClient) DeleteOne

func (c *FilesClient) DeleteOne(f *Files) *FilesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FilesClient) DeleteOneID

func (c *FilesClient) DeleteOneID(id uint64) *FilesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FilesClient) Get

func (c *FilesClient) Get(ctx context.Context, id uint64) (*Files, error)

Get returns a Files entity by its id.

func (*FilesClient) GetX

func (c *FilesClient) GetX(ctx context.Context, id uint64) *Files

GetX is like Get, but panics if an error occurs.

func (*FilesClient) Hooks

func (c *FilesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FilesClient) Intercept

func (c *FilesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `files.Intercept(f(g(h())))`.

func (*FilesClient) Interceptors

func (c *FilesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FilesClient) MapCreateBulk

func (c *FilesClient) MapCreateBulk(slice any, setFunc func(*FilesCreate, int)) *FilesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FilesClient) Query

func (c *FilesClient) Query() *FilesQuery

Query returns a query builder for Files.

func (*FilesClient) QueryImages

func (c *FilesClient) QueryImages(f *Files) *ImagesQuery

QueryImages queries the images edge of a Files.

func (*FilesClient) QueryMusics

func (c *FilesClient) QueryMusics(f *Files) *MusicsQuery

QueryMusics queries the musics edge of a Files.

func (*FilesClient) Update

func (c *FilesClient) Update() *FilesUpdate

Update returns an update builder for Files.

func (*FilesClient) UpdateOne

func (c *FilesClient) UpdateOne(f *Files) *FilesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FilesClient) UpdateOneID

func (c *FilesClient) UpdateOneID(id uint64) *FilesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FilesClient) Use

func (c *FilesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `files.Hooks(f(g(h())))`.

type FilesCreate

type FilesCreate struct {
	// contains filtered or unexported fields
}

FilesCreate is the builder for creating a Files entity.

func (*FilesCreate) AddImageIDs

func (fc *FilesCreate) AddImageIDs(ids ...uint64) *FilesCreate

AddImageIDs adds the "images" edge to the Images entity by IDs.

func (*FilesCreate) AddImages

func (fc *FilesCreate) AddImages(i ...*Images) *FilesCreate

AddImages adds the "images" edges to the Images entity.

func (*FilesCreate) AddMusicIDs

func (fc *FilesCreate) AddMusicIDs(ids ...uint64) *FilesCreate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*FilesCreate) AddMusics

func (fc *FilesCreate) AddMusics(m ...*Musics) *FilesCreate

AddMusics adds the "musics" edges to the Musics entity.

func (*FilesCreate) Exec

func (fc *FilesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FilesCreate) ExecX

func (fc *FilesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FilesCreate) Mutation

func (fc *FilesCreate) Mutation() *FilesMutation

Mutation returns the FilesMutation object of the builder.

func (*FilesCreate) Save

func (fc *FilesCreate) Save(ctx context.Context) (*Files, error)

Save creates the Files in the database.

func (*FilesCreate) SaveX

func (fc *FilesCreate) SaveX(ctx context.Context) *Files

SaveX calls Save and panics if Save returns an error.

func (*FilesCreate) SetHash

func (fc *FilesCreate) SetHash(s string) *FilesCreate

SetHash sets the "hash" field.

func (*FilesCreate) SetID

func (fc *FilesCreate) SetID(u uint64) *FilesCreate

SetID sets the "id" field.

func (*FilesCreate) SetName

func (fc *FilesCreate) SetName(s string) *FilesCreate

SetName sets the "name" field.

func (*FilesCreate) SetSize

func (fc *FilesCreate) SetSize(u uint64) *FilesCreate

SetSize sets the "size" field.

type FilesCreateBulk

type FilesCreateBulk struct {
	// contains filtered or unexported fields
}

FilesCreateBulk is the builder for creating many Files entities in bulk.

func (*FilesCreateBulk) Exec

func (fcb *FilesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FilesCreateBulk) ExecX

func (fcb *FilesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FilesCreateBulk) Save

func (fcb *FilesCreateBulk) Save(ctx context.Context) ([]*Files, error)

Save creates the Files entities in the database.

func (*FilesCreateBulk) SaveX

func (fcb *FilesCreateBulk) SaveX(ctx context.Context) []*Files

SaveX is like Save, but panics if an error occurs.

type FilesDelete

type FilesDelete struct {
	// contains filtered or unexported fields
}

FilesDelete is the builder for deleting a Files entity.

func (*FilesDelete) Exec

func (fd *FilesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FilesDelete) ExecX

func (fd *FilesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FilesDelete) Where

func (fd *FilesDelete) Where(ps ...predicate.Files) *FilesDelete

Where appends a list predicates to the FilesDelete builder.

type FilesDeleteOne

type FilesDeleteOne struct {
	// contains filtered or unexported fields
}

FilesDeleteOne is the builder for deleting a single Files entity.

func (*FilesDeleteOne) Exec

func (fdo *FilesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FilesDeleteOne) ExecX

func (fdo *FilesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FilesDeleteOne) Where

func (fdo *FilesDeleteOne) Where(ps ...predicate.Files) *FilesDeleteOne

Where appends a list predicates to the FilesDelete builder.

type FilesEdges

type FilesEdges struct {
	// Musics holds the value of the musics edge.
	Musics []*Musics `json:"musics,omitempty"`
	// Images holds the value of the images edge.
	Images []*Images `json:"images,omitempty"`
	// contains filtered or unexported fields
}

FilesEdges holds the relations/edges for other nodes in the graph.

func (FilesEdges) ImagesOrErr

func (e FilesEdges) ImagesOrErr() ([]*Images, error)

ImagesOrErr returns the Images value or an error if the edge was not loaded in eager-loading.

func (FilesEdges) MusicsOrErr

func (e FilesEdges) MusicsOrErr() ([]*Musics, error)

MusicsOrErr returns the Musics value or an error if the edge was not loaded in eager-loading.

type FilesGroupBy

type FilesGroupBy struct {
	// contains filtered or unexported fields
}

FilesGroupBy is the group-by builder for Files entities.

func (*FilesGroupBy) Aggregate

func (fgb *FilesGroupBy) Aggregate(fns ...AggregateFunc) *FilesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FilesGroupBy) Bool

func (s *FilesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) BoolX

func (s *FilesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FilesGroupBy) Bools

func (s *FilesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) BoolsX

func (s *FilesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FilesGroupBy) Float64

func (s *FilesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) Float64X

func (s *FilesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FilesGroupBy) Float64s

func (s *FilesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) Float64sX

func (s *FilesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FilesGroupBy) Int

func (s *FilesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) IntX

func (s *FilesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FilesGroupBy) Ints

func (s *FilesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) IntsX

func (s *FilesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FilesGroupBy) Scan

func (fgb *FilesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FilesGroupBy) ScanX

func (s *FilesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FilesGroupBy) String

func (s *FilesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) StringX

func (s *FilesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FilesGroupBy) Strings

func (s *FilesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FilesGroupBy) StringsX

func (s *FilesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FilesMutation

type FilesMutation struct {
	// contains filtered or unexported fields
}

FilesMutation represents an operation that mutates the Files nodes in the graph.

func (*FilesMutation) AddField

func (m *FilesMutation) 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 (*FilesMutation) AddImageIDs

func (m *FilesMutation) AddImageIDs(ids ...uint64)

AddImageIDs adds the "images" edge to the Images entity by ids.

func (*FilesMutation) AddMusicIDs

func (m *FilesMutation) AddMusicIDs(ids ...uint64)

AddMusicIDs adds the "musics" edge to the Musics entity by ids.

func (*FilesMutation) AddSize

func (m *FilesMutation) AddSize(u int64)

AddSize adds u to the "size" field.

func (*FilesMutation) AddedEdges

func (m *FilesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FilesMutation) AddedField

func (m *FilesMutation) 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 (*FilesMutation) AddedFields

func (m *FilesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FilesMutation) AddedIDs

func (m *FilesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FilesMutation) AddedSize

func (m *FilesMutation) AddedSize() (r int64, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*FilesMutation) ClearEdge

func (m *FilesMutation) 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 (*FilesMutation) ClearField

func (m *FilesMutation) 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 (*FilesMutation) ClearImages

func (m *FilesMutation) ClearImages()

ClearImages clears the "images" edge to the Images entity.

func (*FilesMutation) ClearMusics

func (m *FilesMutation) ClearMusics()

ClearMusics clears the "musics" edge to the Musics entity.

func (*FilesMutation) ClearedEdges

func (m *FilesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FilesMutation) ClearedFields

func (m *FilesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FilesMutation) Client

func (m FilesMutation) 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 (*FilesMutation) EdgeCleared

func (m *FilesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FilesMutation) Field

func (m *FilesMutation) 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 (*FilesMutation) FieldCleared

func (m *FilesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FilesMutation) Fields

func (m *FilesMutation) 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 (*FilesMutation) Hash

func (m *FilesMutation) Hash() (r string, exists bool)

Hash returns the value of the "hash" field in the mutation.

func (*FilesMutation) ID

func (m *FilesMutation) 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 (*FilesMutation) IDs

func (m *FilesMutation) 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 (*FilesMutation) ImagesCleared

func (m *FilesMutation) ImagesCleared() bool

ImagesCleared reports if the "images" edge to the Images entity was cleared.

func (*FilesMutation) ImagesIDs

func (m *FilesMutation) ImagesIDs() (ids []uint64)

ImagesIDs returns the "images" edge IDs in the mutation.

func (*FilesMutation) MusicsCleared

func (m *FilesMutation) MusicsCleared() bool

MusicsCleared reports if the "musics" edge to the Musics entity was cleared.

func (*FilesMutation) MusicsIDs

func (m *FilesMutation) MusicsIDs() (ids []uint64)

MusicsIDs returns the "musics" edge IDs in the mutation.

func (*FilesMutation) Name

func (m *FilesMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*FilesMutation) OldField

func (m *FilesMutation) 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 (*FilesMutation) OldHash

func (m *FilesMutation) OldHash(ctx context.Context) (v string, err error)

OldHash returns the old "hash" field's value of the Files entity. If the Files 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 (*FilesMutation) OldName

func (m *FilesMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Files entity. If the Files 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 (*FilesMutation) OldSize

func (m *FilesMutation) OldSize(ctx context.Context) (v uint64, err error)

OldSize returns the old "size" field's value of the Files entity. If the Files 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 (*FilesMutation) Op

func (m *FilesMutation) Op() Op

Op returns the operation name.

func (*FilesMutation) RemoveImageIDs

func (m *FilesMutation) RemoveImageIDs(ids ...uint64)

RemoveImageIDs removes the "images" edge to the Images entity by IDs.

func (*FilesMutation) RemoveMusicIDs

func (m *FilesMutation) RemoveMusicIDs(ids ...uint64)

RemoveMusicIDs removes the "musics" edge to the Musics entity by IDs.

func (*FilesMutation) RemovedEdges

func (m *FilesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FilesMutation) RemovedIDs

func (m *FilesMutation) 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 (*FilesMutation) RemovedImagesIDs

func (m *FilesMutation) RemovedImagesIDs() (ids []uint64)

RemovedImages returns the removed IDs of the "images" edge to the Images entity.

func (*FilesMutation) RemovedMusicsIDs

func (m *FilesMutation) RemovedMusicsIDs() (ids []uint64)

RemovedMusics returns the removed IDs of the "musics" edge to the Musics entity.

func (*FilesMutation) ResetEdge

func (m *FilesMutation) 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 (*FilesMutation) ResetField

func (m *FilesMutation) 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 (*FilesMutation) ResetHash

func (m *FilesMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*FilesMutation) ResetImages

func (m *FilesMutation) ResetImages()

ResetImages resets all changes to the "images" edge.

func (*FilesMutation) ResetMusics

func (m *FilesMutation) ResetMusics()

ResetMusics resets all changes to the "musics" edge.

func (*FilesMutation) ResetName

func (m *FilesMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FilesMutation) ResetSize

func (m *FilesMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*FilesMutation) SetField

func (m *FilesMutation) 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 (*FilesMutation) SetHash

func (m *FilesMutation) SetHash(s string)

SetHash sets the "hash" field.

func (*FilesMutation) SetID

func (m *FilesMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Files entities.

func (*FilesMutation) SetName

func (m *FilesMutation) SetName(s string)

SetName sets the "name" field.

func (*FilesMutation) SetOp

func (m *FilesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FilesMutation) SetSize

func (m *FilesMutation) SetSize(u uint64)

SetSize sets the "size" field.

func (*FilesMutation) Size

func (m *FilesMutation) Size() (r uint64, exists bool)

Size returns the value of the "size" field in the mutation.

func (FilesMutation) Tx

func (m FilesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FilesMutation) Type

func (m *FilesMutation) Type() string

Type returns the node type of this mutation (Files).

func (*FilesMutation) Where

func (m *FilesMutation) Where(ps ...predicate.Files)

Where appends a list predicates to the FilesMutation builder.

func (*FilesMutation) WhereP

func (m *FilesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FilesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FilesQuery

type FilesQuery struct {
	// contains filtered or unexported fields
}

FilesQuery is the builder for querying Files entities.

func (*FilesQuery) Aggregate

func (fq *FilesQuery) Aggregate(fns ...AggregateFunc) *FilesSelect

Aggregate returns a FilesSelect configured with the given aggregations.

func (*FilesQuery) All

func (fq *FilesQuery) All(ctx context.Context) ([]*Files, error)

All executes the query and returns a list of FilesSlice.

func (*FilesQuery) AllX

func (fq *FilesQuery) AllX(ctx context.Context) []*Files

AllX is like All, but panics if an error occurs.

func (*FilesQuery) Clone

func (fq *FilesQuery) Clone() *FilesQuery

Clone returns a duplicate of the FilesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FilesQuery) Count

func (fq *FilesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FilesQuery) CountX

func (fq *FilesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FilesQuery) Exist

func (fq *FilesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FilesQuery) ExistX

func (fq *FilesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FilesQuery) First

func (fq *FilesQuery) First(ctx context.Context) (*Files, error)

First returns the first Files entity from the query. Returns a *NotFoundError when no Files was found.

func (*FilesQuery) FirstID

func (fq *FilesQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Files ID from the query. Returns a *NotFoundError when no Files ID was found.

func (*FilesQuery) FirstIDX

func (fq *FilesQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*FilesQuery) FirstX

func (fq *FilesQuery) FirstX(ctx context.Context) *Files

FirstX is like First, but panics if an error occurs.

func (*FilesQuery) GroupBy

func (fq *FilesQuery) GroupBy(field string, fields ...string) *FilesGroupBy

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 {
	Hash string `json:"hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Files.Query().
	GroupBy(files.FieldHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FilesQuery) IDs

func (fq *FilesQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Files IDs.

func (*FilesQuery) IDsX

func (fq *FilesQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*FilesQuery) Limit

func (fq *FilesQuery) Limit(limit int) *FilesQuery

Limit the number of records to be returned by this query.

func (*FilesQuery) Offset

func (fq *FilesQuery) Offset(offset int) *FilesQuery

Offset to start from.

func (*FilesQuery) Only

func (fq *FilesQuery) Only(ctx context.Context) (*Files, error)

Only returns a single Files entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Files entity is found. Returns a *NotFoundError when no Files entities are found.

func (*FilesQuery) OnlyID

func (fq *FilesQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Files ID in the query. Returns a *NotSingularError when more than one Files ID is found. Returns a *NotFoundError when no entities are found.

func (*FilesQuery) OnlyIDX

func (fq *FilesQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FilesQuery) OnlyX

func (fq *FilesQuery) OnlyX(ctx context.Context) *Files

OnlyX is like Only, but panics if an error occurs.

func (*FilesQuery) Order

func (fq *FilesQuery) Order(o ...files.OrderOption) *FilesQuery

Order specifies how the records should be ordered.

func (*FilesQuery) QueryImages

func (fq *FilesQuery) QueryImages() *ImagesQuery

QueryImages chains the current query on the "images" edge.

func (*FilesQuery) QueryMusics

func (fq *FilesQuery) QueryMusics() *MusicsQuery

QueryMusics chains the current query on the "musics" edge.

func (*FilesQuery) Select

func (fq *FilesQuery) Select(fields ...string) *FilesSelect

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 {
	Hash string `json:"hash,omitempty"`
}

client.Files.Query().
	Select(files.FieldHash).
	Scan(ctx, &v)

func (*FilesQuery) Unique

func (fq *FilesQuery) Unique(unique bool) *FilesQuery

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 (*FilesQuery) Where

func (fq *FilesQuery) Where(ps ...predicate.Files) *FilesQuery

Where adds a new predicate for the FilesQuery builder.

func (*FilesQuery) WithImages

func (fq *FilesQuery) WithImages(opts ...func(*ImagesQuery)) *FilesQuery

WithImages tells the query-builder to eager-load the nodes that are connected to the "images" edge. The optional arguments are used to configure the query builder of the edge.

func (*FilesQuery) WithMusics

func (fq *FilesQuery) WithMusics(opts ...func(*MusicsQuery)) *FilesQuery

WithMusics tells the query-builder to eager-load the nodes that are connected to the "musics" edge. The optional arguments are used to configure the query builder of the edge.

type FilesSelect

type FilesSelect struct {
	*FilesQuery
	// contains filtered or unexported fields
}

FilesSelect is the builder for selecting fields of Files entities.

func (*FilesSelect) Aggregate

func (fs *FilesSelect) Aggregate(fns ...AggregateFunc) *FilesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FilesSelect) Bool

func (s *FilesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FilesSelect) BoolX

func (s *FilesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FilesSelect) Bools

func (s *FilesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FilesSelect) BoolsX

func (s *FilesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FilesSelect) Float64

func (s *FilesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FilesSelect) Float64X

func (s *FilesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FilesSelect) Float64s

func (s *FilesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FilesSelect) Float64sX

func (s *FilesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FilesSelect) Int

func (s *FilesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FilesSelect) IntX

func (s *FilesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FilesSelect) Ints

func (s *FilesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FilesSelect) IntsX

func (s *FilesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FilesSelect) Scan

func (fs *FilesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FilesSelect) ScanX

func (s *FilesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FilesSelect) String

func (s *FilesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FilesSelect) StringX

func (s *FilesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FilesSelect) Strings

func (s *FilesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FilesSelect) StringsX

func (s *FilesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FilesSlice

type FilesSlice []*Files

FilesSlice is a parsable slice of Files.

type FilesUpdate

type FilesUpdate struct {
	// contains filtered or unexported fields
}

FilesUpdate is the builder for updating Files entities.

func (*FilesUpdate) AddImageIDs

func (fu *FilesUpdate) AddImageIDs(ids ...uint64) *FilesUpdate

AddImageIDs adds the "images" edge to the Images entity by IDs.

func (*FilesUpdate) AddImages

func (fu *FilesUpdate) AddImages(i ...*Images) *FilesUpdate

AddImages adds the "images" edges to the Images entity.

func (*FilesUpdate) AddMusicIDs

func (fu *FilesUpdate) AddMusicIDs(ids ...uint64) *FilesUpdate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*FilesUpdate) AddMusics

func (fu *FilesUpdate) AddMusics(m ...*Musics) *FilesUpdate

AddMusics adds the "musics" edges to the Musics entity.

func (*FilesUpdate) AddSize

func (fu *FilesUpdate) AddSize(u int64) *FilesUpdate

AddSize adds u to the "size" field.

func (*FilesUpdate) ClearImages

func (fu *FilesUpdate) ClearImages() *FilesUpdate

ClearImages clears all "images" edges to the Images entity.

func (*FilesUpdate) ClearMusics

func (fu *FilesUpdate) ClearMusics() *FilesUpdate

ClearMusics clears all "musics" edges to the Musics entity.

func (*FilesUpdate) Exec

func (fu *FilesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FilesUpdate) ExecX

func (fu *FilesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FilesUpdate) Mutation

func (fu *FilesUpdate) Mutation() *FilesMutation

Mutation returns the FilesMutation object of the builder.

func (*FilesUpdate) RemoveImageIDs

func (fu *FilesUpdate) RemoveImageIDs(ids ...uint64) *FilesUpdate

RemoveImageIDs removes the "images" edge to Images entities by IDs.

func (*FilesUpdate) RemoveImages

func (fu *FilesUpdate) RemoveImages(i ...*Images) *FilesUpdate

RemoveImages removes "images" edges to Images entities.

func (*FilesUpdate) RemoveMusicIDs

func (fu *FilesUpdate) RemoveMusicIDs(ids ...uint64) *FilesUpdate

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*FilesUpdate) RemoveMusics

func (fu *FilesUpdate) RemoveMusics(m ...*Musics) *FilesUpdate

RemoveMusics removes "musics" edges to Musics entities.

func (*FilesUpdate) Save

func (fu *FilesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FilesUpdate) SaveX

func (fu *FilesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FilesUpdate) SetHash

func (fu *FilesUpdate) SetHash(s string) *FilesUpdate

SetHash sets the "hash" field.

func (*FilesUpdate) SetName

func (fu *FilesUpdate) SetName(s string) *FilesUpdate

SetName sets the "name" field.

func (*FilesUpdate) SetNillableHash

func (fu *FilesUpdate) SetNillableHash(s *string) *FilesUpdate

SetNillableHash sets the "hash" field if the given value is not nil.

func (*FilesUpdate) SetNillableName

func (fu *FilesUpdate) SetNillableName(s *string) *FilesUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FilesUpdate) SetNillableSize

func (fu *FilesUpdate) SetNillableSize(u *uint64) *FilesUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*FilesUpdate) SetSize

func (fu *FilesUpdate) SetSize(u uint64) *FilesUpdate

SetSize sets the "size" field.

func (*FilesUpdate) Where

func (fu *FilesUpdate) Where(ps ...predicate.Files) *FilesUpdate

Where appends a list predicates to the FilesUpdate builder.

type FilesUpdateOne

type FilesUpdateOne struct {
	// contains filtered or unexported fields
}

FilesUpdateOne is the builder for updating a single Files entity.

func (*FilesUpdateOne) AddImageIDs

func (fuo *FilesUpdateOne) AddImageIDs(ids ...uint64) *FilesUpdateOne

AddImageIDs adds the "images" edge to the Images entity by IDs.

func (*FilesUpdateOne) AddImages

func (fuo *FilesUpdateOne) AddImages(i ...*Images) *FilesUpdateOne

AddImages adds the "images" edges to the Images entity.

func (*FilesUpdateOne) AddMusicIDs

func (fuo *FilesUpdateOne) AddMusicIDs(ids ...uint64) *FilesUpdateOne

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*FilesUpdateOne) AddMusics

func (fuo *FilesUpdateOne) AddMusics(m ...*Musics) *FilesUpdateOne

AddMusics adds the "musics" edges to the Musics entity.

func (*FilesUpdateOne) AddSize

func (fuo *FilesUpdateOne) AddSize(u int64) *FilesUpdateOne

AddSize adds u to the "size" field.

func (*FilesUpdateOne) ClearImages

func (fuo *FilesUpdateOne) ClearImages() *FilesUpdateOne

ClearImages clears all "images" edges to the Images entity.

func (*FilesUpdateOne) ClearMusics

func (fuo *FilesUpdateOne) ClearMusics() *FilesUpdateOne

ClearMusics clears all "musics" edges to the Musics entity.

func (*FilesUpdateOne) Exec

func (fuo *FilesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FilesUpdateOne) ExecX

func (fuo *FilesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FilesUpdateOne) Mutation

func (fuo *FilesUpdateOne) Mutation() *FilesMutation

Mutation returns the FilesMutation object of the builder.

func (*FilesUpdateOne) RemoveImageIDs

func (fuo *FilesUpdateOne) RemoveImageIDs(ids ...uint64) *FilesUpdateOne

RemoveImageIDs removes the "images" edge to Images entities by IDs.

func (*FilesUpdateOne) RemoveImages

func (fuo *FilesUpdateOne) RemoveImages(i ...*Images) *FilesUpdateOne

RemoveImages removes "images" edges to Images entities.

func (*FilesUpdateOne) RemoveMusicIDs

func (fuo *FilesUpdateOne) RemoveMusicIDs(ids ...uint64) *FilesUpdateOne

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*FilesUpdateOne) RemoveMusics

func (fuo *FilesUpdateOne) RemoveMusics(m ...*Musics) *FilesUpdateOne

RemoveMusics removes "musics" edges to Musics entities.

func (*FilesUpdateOne) Save

func (fuo *FilesUpdateOne) Save(ctx context.Context) (*Files, error)

Save executes the query and returns the updated Files entity.

func (*FilesUpdateOne) SaveX

func (fuo *FilesUpdateOne) SaveX(ctx context.Context) *Files

SaveX is like Save, but panics if an error occurs.

func (*FilesUpdateOne) Select

func (fuo *FilesUpdateOne) Select(field string, fields ...string) *FilesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*FilesUpdateOne) SetHash

func (fuo *FilesUpdateOne) SetHash(s string) *FilesUpdateOne

SetHash sets the "hash" field.

func (*FilesUpdateOne) SetName

func (fuo *FilesUpdateOne) SetName(s string) *FilesUpdateOne

SetName sets the "name" field.

func (*FilesUpdateOne) SetNillableHash

func (fuo *FilesUpdateOne) SetNillableHash(s *string) *FilesUpdateOne

SetNillableHash sets the "hash" field if the given value is not nil.

func (*FilesUpdateOne) SetNillableName

func (fuo *FilesUpdateOne) SetNillableName(s *string) *FilesUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FilesUpdateOne) SetNillableSize

func (fuo *FilesUpdateOne) SetNillableSize(u *uint64) *FilesUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*FilesUpdateOne) SetSize

func (fuo *FilesUpdateOne) SetSize(u uint64) *FilesUpdateOne

SetSize sets the "size" field.

func (*FilesUpdateOne) Where

func (fuo *FilesUpdateOne) Where(ps ...predicate.Files) *FilesUpdateOne

Where appends a list predicates to the FilesUpdate builder.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Images

type Images struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// IMAGE WIDTH
	Width int32 `json:"width,omitempty"`
	// IMAGE HEIGHT
	Height int32 `json:"height,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ImagesQuery when eager-loading is set.
	Edges ImagesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Images is the model entity for the Images schema.

func (*Images) QueryAlbums

func (i *Images) QueryAlbums() *AlbumsQuery

QueryAlbums queries the "albums" edge of the Images entity.

func (*Images) QueryFile

func (i *Images) QueryFile() *FilesQuery

QueryFile queries the "file" edge of the Images entity.

func (*Images) QueryPlaylists

func (i *Images) QueryPlaylists() *PlaylistsQuery

QueryPlaylists queries the "playlists" edge of the Images entity.

func (*Images) String

func (i *Images) String() string

String implements the fmt.Stringer.

func (*Images) Unwrap

func (i *Images) Unwrap() *Images

Unwrap unwraps the Images 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 (*Images) Update

func (i *Images) Update() *ImagesUpdateOne

Update returns a builder for updating this Images. Note that you need to call Images.Unwrap() before calling this method if this Images was returned from a transaction, and the transaction was committed or rolled back.

func (*Images) Value

func (i *Images) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Images. This includes values selected through modifiers, order, etc.

type ImagesClient

type ImagesClient struct {
	// contains filtered or unexported fields
}

ImagesClient is a client for the Images schema.

func NewImagesClient

func NewImagesClient(c config) *ImagesClient

NewImagesClient returns a client for the Images from the given config.

func (*ImagesClient) Create

func (c *ImagesClient) Create() *ImagesCreate

Create returns a builder for creating a Images entity.

func (*ImagesClient) CreateBulk

func (c *ImagesClient) CreateBulk(builders ...*ImagesCreate) *ImagesCreateBulk

CreateBulk returns a builder for creating a bulk of Images entities.

func (*ImagesClient) Delete

func (c *ImagesClient) Delete() *ImagesDelete

Delete returns a delete builder for Images.

func (*ImagesClient) DeleteOne

func (c *ImagesClient) DeleteOne(i *Images) *ImagesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ImagesClient) DeleteOneID

func (c *ImagesClient) DeleteOneID(id uint64) *ImagesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ImagesClient) Get

func (c *ImagesClient) Get(ctx context.Context, id uint64) (*Images, error)

Get returns a Images entity by its id.

func (*ImagesClient) GetX

func (c *ImagesClient) GetX(ctx context.Context, id uint64) *Images

GetX is like Get, but panics if an error occurs.

func (*ImagesClient) Hooks

func (c *ImagesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ImagesClient) Intercept

func (c *ImagesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `images.Intercept(f(g(h())))`.

func (*ImagesClient) Interceptors

func (c *ImagesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ImagesClient) MapCreateBulk

func (c *ImagesClient) MapCreateBulk(slice any, setFunc func(*ImagesCreate, int)) *ImagesCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ImagesClient) Query

func (c *ImagesClient) Query() *ImagesQuery

Query returns a query builder for Images.

func (*ImagesClient) QueryAlbums

func (c *ImagesClient) QueryAlbums(i *Images) *AlbumsQuery

QueryAlbums queries the albums edge of a Images.

func (*ImagesClient) QueryFile

func (c *ImagesClient) QueryFile(i *Images) *FilesQuery

QueryFile queries the file edge of a Images.

func (*ImagesClient) QueryPlaylists

func (c *ImagesClient) QueryPlaylists(i *Images) *PlaylistsQuery

QueryPlaylists queries the playlists edge of a Images.

func (*ImagesClient) Update

func (c *ImagesClient) Update() *ImagesUpdate

Update returns an update builder for Images.

func (*ImagesClient) UpdateOne

func (c *ImagesClient) UpdateOne(i *Images) *ImagesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ImagesClient) UpdateOneID

func (c *ImagesClient) UpdateOneID(id uint64) *ImagesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ImagesClient) Use

func (c *ImagesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `images.Hooks(f(g(h())))`.

type ImagesCreate

type ImagesCreate struct {
	// contains filtered or unexported fields
}

ImagesCreate is the builder for creating a Images entity.

func (*ImagesCreate) AddAlbumIDs

func (ic *ImagesCreate) AddAlbumIDs(ids ...uint64) *ImagesCreate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*ImagesCreate) AddAlbums

func (ic *ImagesCreate) AddAlbums(a ...*Albums) *ImagesCreate

AddAlbums adds the "albums" edges to the Albums entity.

func (*ImagesCreate) AddPlaylistIDs

func (ic *ImagesCreate) AddPlaylistIDs(ids ...uint64) *ImagesCreate

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*ImagesCreate) AddPlaylists

func (ic *ImagesCreate) AddPlaylists(p ...*Playlists) *ImagesCreate

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*ImagesCreate) Exec

func (ic *ImagesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ImagesCreate) ExecX

func (ic *ImagesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ImagesCreate) Mutation

func (ic *ImagesCreate) Mutation() *ImagesMutation

Mutation returns the ImagesMutation object of the builder.

func (*ImagesCreate) Save

func (ic *ImagesCreate) Save(ctx context.Context) (*Images, error)

Save creates the Images in the database.

func (*ImagesCreate) SaveX

func (ic *ImagesCreate) SaveX(ctx context.Context) *Images

SaveX calls Save and panics if Save returns an error.

func (*ImagesCreate) SetCreateTime

func (ic *ImagesCreate) SetCreateTime(t time.Time) *ImagesCreate

SetCreateTime sets the "create_time" field.

func (*ImagesCreate) SetFile

func (ic *ImagesCreate) SetFile(f *Files) *ImagesCreate

SetFile sets the "file" edge to the Files entity.

func (*ImagesCreate) SetFileID

func (ic *ImagesCreate) SetFileID(id uint64) *ImagesCreate

SetFileID sets the "file" edge to the Files entity by ID.

func (*ImagesCreate) SetHeight

func (ic *ImagesCreate) SetHeight(i int32) *ImagesCreate

SetHeight sets the "height" field.

func (*ImagesCreate) SetID

func (ic *ImagesCreate) SetID(u uint64) *ImagesCreate

SetID sets the "id" field.

func (*ImagesCreate) SetNillableCreateTime

func (ic *ImagesCreate) SetNillableCreateTime(t *time.Time) *ImagesCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ImagesCreate) SetNillableUpdateTime

func (ic *ImagesCreate) SetNillableUpdateTime(t *time.Time) *ImagesCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ImagesCreate) SetUpdateTime

func (ic *ImagesCreate) SetUpdateTime(t time.Time) *ImagesCreate

SetUpdateTime sets the "update_time" field.

func (*ImagesCreate) SetWidth

func (ic *ImagesCreate) SetWidth(i int32) *ImagesCreate

SetWidth sets the "width" field.

type ImagesCreateBulk

type ImagesCreateBulk struct {
	// contains filtered or unexported fields
}

ImagesCreateBulk is the builder for creating many Images entities in bulk.

func (*ImagesCreateBulk) Exec

func (icb *ImagesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ImagesCreateBulk) ExecX

func (icb *ImagesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ImagesCreateBulk) Save

func (icb *ImagesCreateBulk) Save(ctx context.Context) ([]*Images, error)

Save creates the Images entities in the database.

func (*ImagesCreateBulk) SaveX

func (icb *ImagesCreateBulk) SaveX(ctx context.Context) []*Images

SaveX is like Save, but panics if an error occurs.

type ImagesDelete

type ImagesDelete struct {
	// contains filtered or unexported fields
}

ImagesDelete is the builder for deleting a Images entity.

func (*ImagesDelete) Exec

func (id *ImagesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ImagesDelete) ExecX

func (id *ImagesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ImagesDelete) Where

func (id *ImagesDelete) Where(ps ...predicate.Images) *ImagesDelete

Where appends a list predicates to the ImagesDelete builder.

type ImagesDeleteOne

type ImagesDeleteOne struct {
	// contains filtered or unexported fields
}

ImagesDeleteOne is the builder for deleting a single Images entity.

func (*ImagesDeleteOne) Exec

func (ido *ImagesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ImagesDeleteOne) ExecX

func (ido *ImagesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ImagesDeleteOne) Where

func (ido *ImagesDeleteOne) Where(ps ...predicate.Images) *ImagesDeleteOne

Where appends a list predicates to the ImagesDelete builder.

type ImagesEdges

type ImagesEdges struct {
	// File holds the value of the file edge.
	File *Files `json:"file,omitempty"`
	// Albums holds the value of the albums edge.
	Albums []*Albums `json:"albums,omitempty"`
	// Playlists holds the value of the playlists edge.
	Playlists []*Playlists `json:"playlists,omitempty"`
	// contains filtered or unexported fields
}

ImagesEdges holds the relations/edges for other nodes in the graph.

func (ImagesEdges) AlbumsOrErr

func (e ImagesEdges) AlbumsOrErr() ([]*Albums, error)

AlbumsOrErr returns the Albums value or an error if the edge was not loaded in eager-loading.

func (ImagesEdges) FileOrErr

func (e ImagesEdges) FileOrErr() (*Files, error)

FileOrErr returns the File value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ImagesEdges) PlaylistsOrErr

func (e ImagesEdges) PlaylistsOrErr() ([]*Playlists, error)

PlaylistsOrErr returns the Playlists value or an error if the edge was not loaded in eager-loading.

type ImagesGroupBy

type ImagesGroupBy struct {
	// contains filtered or unexported fields
}

ImagesGroupBy is the group-by builder for Images entities.

func (*ImagesGroupBy) Aggregate

func (igb *ImagesGroupBy) Aggregate(fns ...AggregateFunc) *ImagesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ImagesGroupBy) Bool

func (s *ImagesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) BoolX

func (s *ImagesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ImagesGroupBy) Bools

func (s *ImagesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) BoolsX

func (s *ImagesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ImagesGroupBy) Float64

func (s *ImagesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) Float64X

func (s *ImagesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ImagesGroupBy) Float64s

func (s *ImagesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) Float64sX

func (s *ImagesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ImagesGroupBy) Int

func (s *ImagesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) IntX

func (s *ImagesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ImagesGroupBy) Ints

func (s *ImagesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) IntsX

func (s *ImagesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ImagesGroupBy) Scan

func (igb *ImagesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ImagesGroupBy) ScanX

func (s *ImagesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ImagesGroupBy) String

func (s *ImagesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) StringX

func (s *ImagesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ImagesGroupBy) Strings

func (s *ImagesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ImagesGroupBy) StringsX

func (s *ImagesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ImagesMutation

type ImagesMutation struct {
	// contains filtered or unexported fields
}

ImagesMutation represents an operation that mutates the Images nodes in the graph.

func (*ImagesMutation) AddAlbumIDs

func (m *ImagesMutation) AddAlbumIDs(ids ...uint64)

AddAlbumIDs adds the "albums" edge to the Albums entity by ids.

func (*ImagesMutation) AddField

func (m *ImagesMutation) 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 (*ImagesMutation) AddHeight

func (m *ImagesMutation) AddHeight(i int32)

AddHeight adds i to the "height" field.

func (*ImagesMutation) AddPlaylistIDs

func (m *ImagesMutation) AddPlaylistIDs(ids ...uint64)

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by ids.

func (*ImagesMutation) AddWidth

func (m *ImagesMutation) AddWidth(i int32)

AddWidth adds i to the "width" field.

func (*ImagesMutation) AddedEdges

func (m *ImagesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ImagesMutation) AddedField

func (m *ImagesMutation) 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 (*ImagesMutation) AddedFields

func (m *ImagesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ImagesMutation) AddedHeight

func (m *ImagesMutation) AddedHeight() (r int32, exists bool)

AddedHeight returns the value that was added to the "height" field in this mutation.

func (*ImagesMutation) AddedIDs

func (m *ImagesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ImagesMutation) AddedWidth

func (m *ImagesMutation) AddedWidth() (r int32, exists bool)

AddedWidth returns the value that was added to the "width" field in this mutation.

func (*ImagesMutation) AlbumsCleared

func (m *ImagesMutation) AlbumsCleared() bool

AlbumsCleared reports if the "albums" edge to the Albums entity was cleared.

func (*ImagesMutation) AlbumsIDs

func (m *ImagesMutation) AlbumsIDs() (ids []uint64)

AlbumsIDs returns the "albums" edge IDs in the mutation.

func (*ImagesMutation) ClearAlbums

func (m *ImagesMutation) ClearAlbums()

ClearAlbums clears the "albums" edge to the Albums entity.

func (*ImagesMutation) ClearEdge

func (m *ImagesMutation) 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 (*ImagesMutation) ClearField

func (m *ImagesMutation) 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 (*ImagesMutation) ClearFile

func (m *ImagesMutation) ClearFile()

ClearFile clears the "file" edge to the Files entity.

func (*ImagesMutation) ClearPlaylists

func (m *ImagesMutation) ClearPlaylists()

ClearPlaylists clears the "playlists" edge to the Playlists entity.

func (*ImagesMutation) ClearedEdges

func (m *ImagesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ImagesMutation) ClearedFields

func (m *ImagesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ImagesMutation) Client

func (m ImagesMutation) 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 (*ImagesMutation) CreateTime

func (m *ImagesMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ImagesMutation) EdgeCleared

func (m *ImagesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ImagesMutation) Field

func (m *ImagesMutation) 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 (*ImagesMutation) FieldCleared

func (m *ImagesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ImagesMutation) Fields

func (m *ImagesMutation) 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 (*ImagesMutation) FileCleared

func (m *ImagesMutation) FileCleared() bool

FileCleared reports if the "file" edge to the Files entity was cleared.

func (*ImagesMutation) FileID

func (m *ImagesMutation) FileID() (id uint64, exists bool)

FileID returns the "file" edge ID in the mutation.

func (*ImagesMutation) FileIDs

func (m *ImagesMutation) FileIDs() (ids []uint64)

FileIDs returns the "file" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FileID instead. It exists only for internal usage by the builders.

func (*ImagesMutation) Height

func (m *ImagesMutation) Height() (r int32, exists bool)

Height returns the value of the "height" field in the mutation.

func (*ImagesMutation) ID

func (m *ImagesMutation) 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 (*ImagesMutation) IDs

func (m *ImagesMutation) 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 (*ImagesMutation) OldCreateTime

func (m *ImagesMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Images entity. If the Images 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 (*ImagesMutation) OldField

func (m *ImagesMutation) 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 (*ImagesMutation) OldHeight

func (m *ImagesMutation) OldHeight(ctx context.Context) (v int32, err error)

OldHeight returns the old "height" field's value of the Images entity. If the Images 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 (*ImagesMutation) OldUpdateTime

func (m *ImagesMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Images entity. If the Images 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 (*ImagesMutation) OldWidth

func (m *ImagesMutation) OldWidth(ctx context.Context) (v int32, err error)

OldWidth returns the old "width" field's value of the Images entity. If the Images 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 (*ImagesMutation) Op

func (m *ImagesMutation) Op() Op

Op returns the operation name.

func (*ImagesMutation) PlaylistsCleared

func (m *ImagesMutation) PlaylistsCleared() bool

PlaylistsCleared reports if the "playlists" edge to the Playlists entity was cleared.

func (*ImagesMutation) PlaylistsIDs

func (m *ImagesMutation) PlaylistsIDs() (ids []uint64)

PlaylistsIDs returns the "playlists" edge IDs in the mutation.

func (*ImagesMutation) RemoveAlbumIDs

func (m *ImagesMutation) RemoveAlbumIDs(ids ...uint64)

RemoveAlbumIDs removes the "albums" edge to the Albums entity by IDs.

func (*ImagesMutation) RemovePlaylistIDs

func (m *ImagesMutation) RemovePlaylistIDs(ids ...uint64)

RemovePlaylistIDs removes the "playlists" edge to the Playlists entity by IDs.

func (*ImagesMutation) RemovedAlbumsIDs

func (m *ImagesMutation) RemovedAlbumsIDs() (ids []uint64)

RemovedAlbums returns the removed IDs of the "albums" edge to the Albums entity.

func (*ImagesMutation) RemovedEdges

func (m *ImagesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ImagesMutation) RemovedIDs

func (m *ImagesMutation) 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 (*ImagesMutation) RemovedPlaylistsIDs

func (m *ImagesMutation) RemovedPlaylistsIDs() (ids []uint64)

RemovedPlaylists returns the removed IDs of the "playlists" edge to the Playlists entity.

func (*ImagesMutation) ResetAlbums

func (m *ImagesMutation) ResetAlbums()

ResetAlbums resets all changes to the "albums" edge.

func (*ImagesMutation) ResetCreateTime

func (m *ImagesMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ImagesMutation) ResetEdge

func (m *ImagesMutation) 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 (*ImagesMutation) ResetField

func (m *ImagesMutation) 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 (*ImagesMutation) ResetFile

func (m *ImagesMutation) ResetFile()

ResetFile resets all changes to the "file" edge.

func (*ImagesMutation) ResetHeight

func (m *ImagesMutation) ResetHeight()

ResetHeight resets all changes to the "height" field.

func (*ImagesMutation) ResetPlaylists

func (m *ImagesMutation) ResetPlaylists()

ResetPlaylists resets all changes to the "playlists" edge.

func (*ImagesMutation) ResetUpdateTime

func (m *ImagesMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ImagesMutation) ResetWidth

func (m *ImagesMutation) ResetWidth()

ResetWidth resets all changes to the "width" field.

func (*ImagesMutation) SetCreateTime

func (m *ImagesMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ImagesMutation) SetField

func (m *ImagesMutation) 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 (*ImagesMutation) SetFileID

func (m *ImagesMutation) SetFileID(id uint64)

SetFileID sets the "file" edge to the Files entity by id.

func (*ImagesMutation) SetHeight

func (m *ImagesMutation) SetHeight(i int32)

SetHeight sets the "height" field.

func (*ImagesMutation) SetID

func (m *ImagesMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Images entities.

func (*ImagesMutation) SetOp

func (m *ImagesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ImagesMutation) SetUpdateTime

func (m *ImagesMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ImagesMutation) SetWidth

func (m *ImagesMutation) SetWidth(i int32)

SetWidth sets the "width" field.

func (ImagesMutation) Tx

func (m ImagesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ImagesMutation) Type

func (m *ImagesMutation) Type() string

Type returns the node type of this mutation (Images).

func (*ImagesMutation) UpdateTime

func (m *ImagesMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ImagesMutation) Where

func (m *ImagesMutation) Where(ps ...predicate.Images)

Where appends a list predicates to the ImagesMutation builder.

func (*ImagesMutation) WhereP

func (m *ImagesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ImagesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*ImagesMutation) Width

func (m *ImagesMutation) Width() (r int32, exists bool)

Width returns the value of the "width" field in the mutation.

type ImagesQuery

type ImagesQuery struct {
	// contains filtered or unexported fields
}

ImagesQuery is the builder for querying Images entities.

func (*ImagesQuery) Aggregate

func (iq *ImagesQuery) Aggregate(fns ...AggregateFunc) *ImagesSelect

Aggregate returns a ImagesSelect configured with the given aggregations.

func (*ImagesQuery) All

func (iq *ImagesQuery) All(ctx context.Context) ([]*Images, error)

All executes the query and returns a list of ImagesSlice.

func (*ImagesQuery) AllX

func (iq *ImagesQuery) AllX(ctx context.Context) []*Images

AllX is like All, but panics if an error occurs.

func (*ImagesQuery) Clone

func (iq *ImagesQuery) Clone() *ImagesQuery

Clone returns a duplicate of the ImagesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ImagesQuery) Count

func (iq *ImagesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ImagesQuery) CountX

func (iq *ImagesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ImagesQuery) Exist

func (iq *ImagesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ImagesQuery) ExistX

func (iq *ImagesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ImagesQuery) First

func (iq *ImagesQuery) First(ctx context.Context) (*Images, error)

First returns the first Images entity from the query. Returns a *NotFoundError when no Images was found.

func (*ImagesQuery) FirstID

func (iq *ImagesQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Images ID from the query. Returns a *NotFoundError when no Images ID was found.

func (*ImagesQuery) FirstIDX

func (iq *ImagesQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*ImagesQuery) FirstX

func (iq *ImagesQuery) FirstX(ctx context.Context) *Images

FirstX is like First, but panics if an error occurs.

func (*ImagesQuery) GroupBy

func (iq *ImagesQuery) GroupBy(field string, fields ...string) *ImagesGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Images.Query().
	GroupBy(images.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ImagesQuery) IDs

func (iq *ImagesQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Images IDs.

func (*ImagesQuery) IDsX

func (iq *ImagesQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*ImagesQuery) Limit

func (iq *ImagesQuery) Limit(limit int) *ImagesQuery

Limit the number of records to be returned by this query.

func (*ImagesQuery) Offset

func (iq *ImagesQuery) Offset(offset int) *ImagesQuery

Offset to start from.

func (*ImagesQuery) Only

func (iq *ImagesQuery) Only(ctx context.Context) (*Images, error)

Only returns a single Images entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Images entity is found. Returns a *NotFoundError when no Images entities are found.

func (*ImagesQuery) OnlyID

func (iq *ImagesQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Images ID in the query. Returns a *NotSingularError when more than one Images ID is found. Returns a *NotFoundError when no entities are found.

func (*ImagesQuery) OnlyIDX

func (iq *ImagesQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ImagesQuery) OnlyX

func (iq *ImagesQuery) OnlyX(ctx context.Context) *Images

OnlyX is like Only, but panics if an error occurs.

func (*ImagesQuery) Order

func (iq *ImagesQuery) Order(o ...images.OrderOption) *ImagesQuery

Order specifies how the records should be ordered.

func (*ImagesQuery) QueryAlbums

func (iq *ImagesQuery) QueryAlbums() *AlbumsQuery

QueryAlbums chains the current query on the "albums" edge.

func (*ImagesQuery) QueryFile

func (iq *ImagesQuery) QueryFile() *FilesQuery

QueryFile chains the current query on the "file" edge.

func (*ImagesQuery) QueryPlaylists

func (iq *ImagesQuery) QueryPlaylists() *PlaylistsQuery

QueryPlaylists chains the current query on the "playlists" edge.

func (*ImagesQuery) Select

func (iq *ImagesQuery) Select(fields ...string) *ImagesSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Images.Query().
	Select(images.FieldCreateTime).
	Scan(ctx, &v)

func (*ImagesQuery) Unique

func (iq *ImagesQuery) Unique(unique bool) *ImagesQuery

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 (*ImagesQuery) Where

func (iq *ImagesQuery) Where(ps ...predicate.Images) *ImagesQuery

Where adds a new predicate for the ImagesQuery builder.

func (*ImagesQuery) WithAlbums

func (iq *ImagesQuery) WithAlbums(opts ...func(*AlbumsQuery)) *ImagesQuery

WithAlbums tells the query-builder to eager-load the nodes that are connected to the "albums" edge. The optional arguments are used to configure the query builder of the edge.

func (*ImagesQuery) WithFile

func (iq *ImagesQuery) WithFile(opts ...func(*FilesQuery)) *ImagesQuery

WithFile tells the query-builder to eager-load the nodes that are connected to the "file" edge. The optional arguments are used to configure the query builder of the edge.

func (*ImagesQuery) WithPlaylists

func (iq *ImagesQuery) WithPlaylists(opts ...func(*PlaylistsQuery)) *ImagesQuery

WithPlaylists tells the query-builder to eager-load the nodes that are connected to the "playlists" edge. The optional arguments are used to configure the query builder of the edge.

type ImagesSelect

type ImagesSelect struct {
	*ImagesQuery
	// contains filtered or unexported fields
}

ImagesSelect is the builder for selecting fields of Images entities.

func (*ImagesSelect) Aggregate

func (is *ImagesSelect) Aggregate(fns ...AggregateFunc) *ImagesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ImagesSelect) Bool

func (s *ImagesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) BoolX

func (s *ImagesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ImagesSelect) Bools

func (s *ImagesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) BoolsX

func (s *ImagesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ImagesSelect) Float64

func (s *ImagesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) Float64X

func (s *ImagesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ImagesSelect) Float64s

func (s *ImagesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) Float64sX

func (s *ImagesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ImagesSelect) Int

func (s *ImagesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) IntX

func (s *ImagesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ImagesSelect) Ints

func (s *ImagesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) IntsX

func (s *ImagesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ImagesSelect) Scan

func (is *ImagesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ImagesSelect) ScanX

func (s *ImagesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ImagesSelect) String

func (s *ImagesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) StringX

func (s *ImagesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ImagesSelect) Strings

func (s *ImagesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ImagesSelect) StringsX

func (s *ImagesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ImagesSlice

type ImagesSlice []*Images

ImagesSlice is a parsable slice of Images.

type ImagesUpdate

type ImagesUpdate struct {
	// contains filtered or unexported fields
}

ImagesUpdate is the builder for updating Images entities.

func (*ImagesUpdate) AddAlbumIDs

func (iu *ImagesUpdate) AddAlbumIDs(ids ...uint64) *ImagesUpdate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*ImagesUpdate) AddAlbums

func (iu *ImagesUpdate) AddAlbums(a ...*Albums) *ImagesUpdate

AddAlbums adds the "albums" edges to the Albums entity.

func (*ImagesUpdate) AddHeight

func (iu *ImagesUpdate) AddHeight(i int32) *ImagesUpdate

AddHeight adds i to the "height" field.

func (*ImagesUpdate) AddPlaylistIDs

func (iu *ImagesUpdate) AddPlaylistIDs(ids ...uint64) *ImagesUpdate

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*ImagesUpdate) AddPlaylists

func (iu *ImagesUpdate) AddPlaylists(p ...*Playlists) *ImagesUpdate

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*ImagesUpdate) AddWidth

func (iu *ImagesUpdate) AddWidth(i int32) *ImagesUpdate

AddWidth adds i to the "width" field.

func (*ImagesUpdate) ClearAlbums

func (iu *ImagesUpdate) ClearAlbums() *ImagesUpdate

ClearAlbums clears all "albums" edges to the Albums entity.

func (*ImagesUpdate) ClearFile

func (iu *ImagesUpdate) ClearFile() *ImagesUpdate

ClearFile clears the "file" edge to the Files entity.

func (*ImagesUpdate) ClearPlaylists

func (iu *ImagesUpdate) ClearPlaylists() *ImagesUpdate

ClearPlaylists clears all "playlists" edges to the Playlists entity.

func (*ImagesUpdate) Exec

func (iu *ImagesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ImagesUpdate) ExecX

func (iu *ImagesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ImagesUpdate) Mutation

func (iu *ImagesUpdate) Mutation() *ImagesMutation

Mutation returns the ImagesMutation object of the builder.

func (*ImagesUpdate) RemoveAlbumIDs

func (iu *ImagesUpdate) RemoveAlbumIDs(ids ...uint64) *ImagesUpdate

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*ImagesUpdate) RemoveAlbums

func (iu *ImagesUpdate) RemoveAlbums(a ...*Albums) *ImagesUpdate

RemoveAlbums removes "albums" edges to Albums entities.

func (*ImagesUpdate) RemovePlaylistIDs

func (iu *ImagesUpdate) RemovePlaylistIDs(ids ...uint64) *ImagesUpdate

RemovePlaylistIDs removes the "playlists" edge to Playlists entities by IDs.

func (*ImagesUpdate) RemovePlaylists

func (iu *ImagesUpdate) RemovePlaylists(p ...*Playlists) *ImagesUpdate

RemovePlaylists removes "playlists" edges to Playlists entities.

func (*ImagesUpdate) Save

func (iu *ImagesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ImagesUpdate) SaveX

func (iu *ImagesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ImagesUpdate) SetFile

func (iu *ImagesUpdate) SetFile(f *Files) *ImagesUpdate

SetFile sets the "file" edge to the Files entity.

func (*ImagesUpdate) SetFileID

func (iu *ImagesUpdate) SetFileID(id uint64) *ImagesUpdate

SetFileID sets the "file" edge to the Files entity by ID.

func (*ImagesUpdate) SetHeight

func (iu *ImagesUpdate) SetHeight(i int32) *ImagesUpdate

SetHeight sets the "height" field.

func (*ImagesUpdate) SetNillableHeight

func (iu *ImagesUpdate) SetNillableHeight(i *int32) *ImagesUpdate

SetNillableHeight sets the "height" field if the given value is not nil.

func (*ImagesUpdate) SetNillableWidth

func (iu *ImagesUpdate) SetNillableWidth(i *int32) *ImagesUpdate

SetNillableWidth sets the "width" field if the given value is not nil.

func (*ImagesUpdate) SetUpdateTime

func (iu *ImagesUpdate) SetUpdateTime(t time.Time) *ImagesUpdate

SetUpdateTime sets the "update_time" field.

func (*ImagesUpdate) SetWidth

func (iu *ImagesUpdate) SetWidth(i int32) *ImagesUpdate

SetWidth sets the "width" field.

func (*ImagesUpdate) Where

func (iu *ImagesUpdate) Where(ps ...predicate.Images) *ImagesUpdate

Where appends a list predicates to the ImagesUpdate builder.

type ImagesUpdateOne

type ImagesUpdateOne struct {
	// contains filtered or unexported fields
}

ImagesUpdateOne is the builder for updating a single Images entity.

func (*ImagesUpdateOne) AddAlbumIDs

func (iuo *ImagesUpdateOne) AddAlbumIDs(ids ...uint64) *ImagesUpdateOne

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*ImagesUpdateOne) AddAlbums

func (iuo *ImagesUpdateOne) AddAlbums(a ...*Albums) *ImagesUpdateOne

AddAlbums adds the "albums" edges to the Albums entity.

func (*ImagesUpdateOne) AddHeight

func (iuo *ImagesUpdateOne) AddHeight(i int32) *ImagesUpdateOne

AddHeight adds i to the "height" field.

func (*ImagesUpdateOne) AddPlaylistIDs

func (iuo *ImagesUpdateOne) AddPlaylistIDs(ids ...uint64) *ImagesUpdateOne

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*ImagesUpdateOne) AddPlaylists

func (iuo *ImagesUpdateOne) AddPlaylists(p ...*Playlists) *ImagesUpdateOne

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*ImagesUpdateOne) AddWidth

func (iuo *ImagesUpdateOne) AddWidth(i int32) *ImagesUpdateOne

AddWidth adds i to the "width" field.

func (*ImagesUpdateOne) ClearAlbums

func (iuo *ImagesUpdateOne) ClearAlbums() *ImagesUpdateOne

ClearAlbums clears all "albums" edges to the Albums entity.

func (*ImagesUpdateOne) ClearFile

func (iuo *ImagesUpdateOne) ClearFile() *ImagesUpdateOne

ClearFile clears the "file" edge to the Files entity.

func (*ImagesUpdateOne) ClearPlaylists

func (iuo *ImagesUpdateOne) ClearPlaylists() *ImagesUpdateOne

ClearPlaylists clears all "playlists" edges to the Playlists entity.

func (*ImagesUpdateOne) Exec

func (iuo *ImagesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ImagesUpdateOne) ExecX

func (iuo *ImagesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ImagesUpdateOne) Mutation

func (iuo *ImagesUpdateOne) Mutation() *ImagesMutation

Mutation returns the ImagesMutation object of the builder.

func (*ImagesUpdateOne) RemoveAlbumIDs

func (iuo *ImagesUpdateOne) RemoveAlbumIDs(ids ...uint64) *ImagesUpdateOne

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*ImagesUpdateOne) RemoveAlbums

func (iuo *ImagesUpdateOne) RemoveAlbums(a ...*Albums) *ImagesUpdateOne

RemoveAlbums removes "albums" edges to Albums entities.

func (*ImagesUpdateOne) RemovePlaylistIDs

func (iuo *ImagesUpdateOne) RemovePlaylistIDs(ids ...uint64) *ImagesUpdateOne

RemovePlaylistIDs removes the "playlists" edge to Playlists entities by IDs.

func (*ImagesUpdateOne) RemovePlaylists

func (iuo *ImagesUpdateOne) RemovePlaylists(p ...*Playlists) *ImagesUpdateOne

RemovePlaylists removes "playlists" edges to Playlists entities.

func (*ImagesUpdateOne) Save

func (iuo *ImagesUpdateOne) Save(ctx context.Context) (*Images, error)

Save executes the query and returns the updated Images entity.

func (*ImagesUpdateOne) SaveX

func (iuo *ImagesUpdateOne) SaveX(ctx context.Context) *Images

SaveX is like Save, but panics if an error occurs.

func (*ImagesUpdateOne) Select

func (iuo *ImagesUpdateOne) Select(field string, fields ...string) *ImagesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ImagesUpdateOne) SetFile

func (iuo *ImagesUpdateOne) SetFile(f *Files) *ImagesUpdateOne

SetFile sets the "file" edge to the Files entity.

func (*ImagesUpdateOne) SetFileID

func (iuo *ImagesUpdateOne) SetFileID(id uint64) *ImagesUpdateOne

SetFileID sets the "file" edge to the Files entity by ID.

func (*ImagesUpdateOne) SetHeight

func (iuo *ImagesUpdateOne) SetHeight(i int32) *ImagesUpdateOne

SetHeight sets the "height" field.

func (*ImagesUpdateOne) SetNillableHeight

func (iuo *ImagesUpdateOne) SetNillableHeight(i *int32) *ImagesUpdateOne

SetNillableHeight sets the "height" field if the given value is not nil.

func (*ImagesUpdateOne) SetNillableWidth

func (iuo *ImagesUpdateOne) SetNillableWidth(i *int32) *ImagesUpdateOne

SetNillableWidth sets the "width" field if the given value is not nil.

func (*ImagesUpdateOne) SetUpdateTime

func (iuo *ImagesUpdateOne) SetUpdateTime(t time.Time) *ImagesUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ImagesUpdateOne) SetWidth

func (iuo *ImagesUpdateOne) SetWidth(i int32) *ImagesUpdateOne

SetWidth sets the "width" field.

func (*ImagesUpdateOne) Where

func (iuo *ImagesUpdateOne) Where(ps ...predicate.Images) *ImagesUpdateOne

Where appends a list predicates to the ImagesUpdate builder.

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 Musics

type Musics struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MusicsQuery when eager-loading is set.
	Edges MusicsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Musics is the model entity for the Musics schema.

func (*Musics) QueryAlbums

func (m *Musics) QueryAlbums() *AlbumsQuery

QueryAlbums queries the "albums" edge of the Musics entity.

func (*Musics) QueryArtists

func (m *Musics) QueryArtists() *ArtistsQuery

QueryArtists queries the "artists" edge of the Musics entity.

func (*Musics) QueryFile

func (m *Musics) QueryFile() *FilesQuery

QueryFile queries the "file" edge of the Musics entity.

func (*Musics) QueryPlaylists

func (m *Musics) QueryPlaylists() *PlaylistsQuery

QueryPlaylists queries the "playlists" edge of the Musics entity.

func (*Musics) QueryUsers

func (m *Musics) QueryUsers() *UsersQuery

QueryUsers queries the "users" edge of the Musics entity.

func (*Musics) String

func (m *Musics) String() string

String implements the fmt.Stringer.

func (*Musics) Unwrap

func (m *Musics) Unwrap() *Musics

Unwrap unwraps the Musics 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 (*Musics) Update

func (m *Musics) Update() *MusicsUpdateOne

Update returns a builder for updating this Musics. Note that you need to call Musics.Unwrap() before calling this method if this Musics was returned from a transaction, and the transaction was committed or rolled back.

func (*Musics) Value

func (m *Musics) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Musics. This includes values selected through modifiers, order, etc.

type MusicsClient

type MusicsClient struct {
	// contains filtered or unexported fields
}

MusicsClient is a client for the Musics schema.

func NewMusicsClient

func NewMusicsClient(c config) *MusicsClient

NewMusicsClient returns a client for the Musics from the given config.

func (*MusicsClient) Create

func (c *MusicsClient) Create() *MusicsCreate

Create returns a builder for creating a Musics entity.

func (*MusicsClient) CreateBulk

func (c *MusicsClient) CreateBulk(builders ...*MusicsCreate) *MusicsCreateBulk

CreateBulk returns a builder for creating a bulk of Musics entities.

func (*MusicsClient) Delete

func (c *MusicsClient) Delete() *MusicsDelete

Delete returns a delete builder for Musics.

func (*MusicsClient) DeleteOne

func (c *MusicsClient) DeleteOne(m *Musics) *MusicsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MusicsClient) DeleteOneID

func (c *MusicsClient) DeleteOneID(id uint64) *MusicsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MusicsClient) Get

func (c *MusicsClient) Get(ctx context.Context, id uint64) (*Musics, error)

Get returns a Musics entity by its id.

func (*MusicsClient) GetX

func (c *MusicsClient) GetX(ctx context.Context, id uint64) *Musics

GetX is like Get, but panics if an error occurs.

func (*MusicsClient) Hooks

func (c *MusicsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MusicsClient) Intercept

func (c *MusicsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `musics.Intercept(f(g(h())))`.

func (*MusicsClient) Interceptors

func (c *MusicsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MusicsClient) MapCreateBulk

func (c *MusicsClient) MapCreateBulk(slice any, setFunc func(*MusicsCreate, int)) *MusicsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MusicsClient) Query

func (c *MusicsClient) Query() *MusicsQuery

Query returns a query builder for Musics.

func (*MusicsClient) QueryAlbums

func (c *MusicsClient) QueryAlbums(m *Musics) *AlbumsQuery

QueryAlbums queries the albums edge of a Musics.

func (*MusicsClient) QueryArtists

func (c *MusicsClient) QueryArtists(m *Musics) *ArtistsQuery

QueryArtists queries the artists edge of a Musics.

func (*MusicsClient) QueryFile

func (c *MusicsClient) QueryFile(m *Musics) *FilesQuery

QueryFile queries the file edge of a Musics.

func (*MusicsClient) QueryPlaylists

func (c *MusicsClient) QueryPlaylists(m *Musics) *PlaylistsQuery

QueryPlaylists queries the playlists edge of a Musics.

func (*MusicsClient) QueryUsers

func (c *MusicsClient) QueryUsers(m *Musics) *UsersQuery

QueryUsers queries the users edge of a Musics.

func (*MusicsClient) Update

func (c *MusicsClient) Update() *MusicsUpdate

Update returns an update builder for Musics.

func (*MusicsClient) UpdateOne

func (c *MusicsClient) UpdateOne(m *Musics) *MusicsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MusicsClient) UpdateOneID

func (c *MusicsClient) UpdateOneID(id uint64) *MusicsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MusicsClient) Use

func (c *MusicsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `musics.Hooks(f(g(h())))`.

type MusicsCreate

type MusicsCreate struct {
	// contains filtered or unexported fields
}

MusicsCreate is the builder for creating a Musics entity.

func (*MusicsCreate) AddAlbumIDs

func (mc *MusicsCreate) AddAlbumIDs(ids ...uint64) *MusicsCreate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*MusicsCreate) AddAlbums

func (mc *MusicsCreate) AddAlbums(a ...*Albums) *MusicsCreate

AddAlbums adds the "albums" edges to the Albums entity.

func (*MusicsCreate) AddArtistIDs

func (mc *MusicsCreate) AddArtistIDs(ids ...uint64) *MusicsCreate

AddArtistIDs adds the "artists" edge to the Artists entity by IDs.

func (*MusicsCreate) AddArtists

func (mc *MusicsCreate) AddArtists(a ...*Artists) *MusicsCreate

AddArtists adds the "artists" edges to the Artists entity.

func (*MusicsCreate) AddPlaylistIDs

func (mc *MusicsCreate) AddPlaylistIDs(ids ...uint64) *MusicsCreate

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*MusicsCreate) AddPlaylists

func (mc *MusicsCreate) AddPlaylists(p ...*Playlists) *MusicsCreate

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*MusicsCreate) AddUserIDs

func (mc *MusicsCreate) AddUserIDs(ids ...uint64) *MusicsCreate

AddUserIDs adds the "users" edge to the Users entity by IDs.

func (*MusicsCreate) AddUsers

func (mc *MusicsCreate) AddUsers(u ...*Users) *MusicsCreate

AddUsers adds the "users" edges to the Users entity.

func (*MusicsCreate) Exec

func (mc *MusicsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MusicsCreate) ExecX

func (mc *MusicsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MusicsCreate) Mutation

func (mc *MusicsCreate) Mutation() *MusicsMutation

Mutation returns the MusicsMutation object of the builder.

func (*MusicsCreate) Save

func (mc *MusicsCreate) Save(ctx context.Context) (*Musics, error)

Save creates the Musics in the database.

func (*MusicsCreate) SaveX

func (mc *MusicsCreate) SaveX(ctx context.Context) *Musics

SaveX calls Save and panics if Save returns an error.

func (*MusicsCreate) SetCreateTime

func (mc *MusicsCreate) SetCreateTime(t time.Time) *MusicsCreate

SetCreateTime sets the "create_time" field.

func (*MusicsCreate) SetDescription

func (mc *MusicsCreate) SetDescription(s string) *MusicsCreate

SetDescription sets the "description" field.

func (*MusicsCreate) SetFile

func (mc *MusicsCreate) SetFile(f *Files) *MusicsCreate

SetFile sets the "file" edge to the Files entity.

func (*MusicsCreate) SetFileID

func (mc *MusicsCreate) SetFileID(id uint64) *MusicsCreate

SetFileID sets the "file" edge to the Files entity by ID.

func (*MusicsCreate) SetID

func (mc *MusicsCreate) SetID(u uint64) *MusicsCreate

SetID sets the "id" field.

func (*MusicsCreate) SetName

func (mc *MusicsCreate) SetName(s string) *MusicsCreate

SetName sets the "name" field.

func (*MusicsCreate) SetNillableCreateTime

func (mc *MusicsCreate) SetNillableCreateTime(t *time.Time) *MusicsCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MusicsCreate) SetNillableDescription

func (mc *MusicsCreate) SetNillableDescription(s *string) *MusicsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MusicsCreate) SetNillableUpdateTime

func (mc *MusicsCreate) SetNillableUpdateTime(t *time.Time) *MusicsCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MusicsCreate) SetUpdateTime

func (mc *MusicsCreate) SetUpdateTime(t time.Time) *MusicsCreate

SetUpdateTime sets the "update_time" field.

type MusicsCreateBulk

type MusicsCreateBulk struct {
	// contains filtered or unexported fields
}

MusicsCreateBulk is the builder for creating many Musics entities in bulk.

func (*MusicsCreateBulk) Exec

func (mcb *MusicsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MusicsCreateBulk) ExecX

func (mcb *MusicsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MusicsCreateBulk) Save

func (mcb *MusicsCreateBulk) Save(ctx context.Context) ([]*Musics, error)

Save creates the Musics entities in the database.

func (*MusicsCreateBulk) SaveX

func (mcb *MusicsCreateBulk) SaveX(ctx context.Context) []*Musics

SaveX is like Save, but panics if an error occurs.

type MusicsDelete

type MusicsDelete struct {
	// contains filtered or unexported fields
}

MusicsDelete is the builder for deleting a Musics entity.

func (*MusicsDelete) Exec

func (md *MusicsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MusicsDelete) ExecX

func (md *MusicsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MusicsDelete) Where

func (md *MusicsDelete) Where(ps ...predicate.Musics) *MusicsDelete

Where appends a list predicates to the MusicsDelete builder.

type MusicsDeleteOne

type MusicsDeleteOne struct {
	// contains filtered or unexported fields
}

MusicsDeleteOne is the builder for deleting a single Musics entity.

func (*MusicsDeleteOne) Exec

func (mdo *MusicsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MusicsDeleteOne) ExecX

func (mdo *MusicsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MusicsDeleteOne) Where

func (mdo *MusicsDeleteOne) Where(ps ...predicate.Musics) *MusicsDeleteOne

Where appends a list predicates to the MusicsDelete builder.

type MusicsEdges

type MusicsEdges struct {
	// Users holds the value of the users edge.
	Users []*Users `json:"users,omitempty"`
	// File holds the value of the file edge.
	File *Files `json:"file,omitempty"`
	// Artists holds the value of the artists edge.
	Artists []*Artists `json:"artists,omitempty"`
	// Playlists holds the value of the playlists edge.
	Playlists []*Playlists `json:"playlists,omitempty"`
	// Albums holds the value of the albums edge.
	Albums []*Albums `json:"albums,omitempty"`
	// contains filtered or unexported fields
}

MusicsEdges holds the relations/edges for other nodes in the graph.

func (MusicsEdges) AlbumsOrErr

func (e MusicsEdges) AlbumsOrErr() ([]*Albums, error)

AlbumsOrErr returns the Albums value or an error if the edge was not loaded in eager-loading.

func (MusicsEdges) ArtistsOrErr

func (e MusicsEdges) ArtistsOrErr() ([]*Artists, error)

ArtistsOrErr returns the Artists value or an error if the edge was not loaded in eager-loading.

func (MusicsEdges) FileOrErr

func (e MusicsEdges) FileOrErr() (*Files, error)

FileOrErr returns the File value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MusicsEdges) PlaylistsOrErr

func (e MusicsEdges) PlaylistsOrErr() ([]*Playlists, error)

PlaylistsOrErr returns the Playlists value or an error if the edge was not loaded in eager-loading.

func (MusicsEdges) UsersOrErr

func (e MusicsEdges) UsersOrErr() ([]*Users, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type MusicsGroupBy

type MusicsGroupBy struct {
	// contains filtered or unexported fields
}

MusicsGroupBy is the group-by builder for Musics entities.

func (*MusicsGroupBy) Aggregate

func (mgb *MusicsGroupBy) Aggregate(fns ...AggregateFunc) *MusicsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MusicsGroupBy) Bool

func (s *MusicsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) BoolX

func (s *MusicsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MusicsGroupBy) Bools

func (s *MusicsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) BoolsX

func (s *MusicsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MusicsGroupBy) Float64

func (s *MusicsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) Float64X

func (s *MusicsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MusicsGroupBy) Float64s

func (s *MusicsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) Float64sX

func (s *MusicsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MusicsGroupBy) Int

func (s *MusicsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) IntX

func (s *MusicsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MusicsGroupBy) Ints

func (s *MusicsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) IntsX

func (s *MusicsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MusicsGroupBy) Scan

func (mgb *MusicsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MusicsGroupBy) ScanX

func (s *MusicsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MusicsGroupBy) String

func (s *MusicsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) StringX

func (s *MusicsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MusicsGroupBy) Strings

func (s *MusicsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MusicsGroupBy) StringsX

func (s *MusicsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MusicsMutation

type MusicsMutation struct {
	// contains filtered or unexported fields
}

MusicsMutation represents an operation that mutates the Musics nodes in the graph.

func (*MusicsMutation) AddAlbumIDs

func (m *MusicsMutation) AddAlbumIDs(ids ...uint64)

AddAlbumIDs adds the "albums" edge to the Albums entity by ids.

func (*MusicsMutation) AddArtistIDs

func (m *MusicsMutation) AddArtistIDs(ids ...uint64)

AddArtistIDs adds the "artists" edge to the Artists entity by ids.

func (*MusicsMutation) AddField

func (m *MusicsMutation) 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 (*MusicsMutation) AddPlaylistIDs

func (m *MusicsMutation) AddPlaylistIDs(ids ...uint64)

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by ids.

func (*MusicsMutation) AddUserIDs

func (m *MusicsMutation) AddUserIDs(ids ...uint64)

AddUserIDs adds the "users" edge to the Users entity by ids.

func (*MusicsMutation) AddedEdges

func (m *MusicsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MusicsMutation) AddedField

func (m *MusicsMutation) 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 (*MusicsMutation) AddedFields

func (m *MusicsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MusicsMutation) AddedIDs

func (m *MusicsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MusicsMutation) AlbumsCleared

func (m *MusicsMutation) AlbumsCleared() bool

AlbumsCleared reports if the "albums" edge to the Albums entity was cleared.

func (*MusicsMutation) AlbumsIDs

func (m *MusicsMutation) AlbumsIDs() (ids []uint64)

AlbumsIDs returns the "albums" edge IDs in the mutation.

func (*MusicsMutation) ArtistsCleared

func (m *MusicsMutation) ArtistsCleared() bool

ArtistsCleared reports if the "artists" edge to the Artists entity was cleared.

func (*MusicsMutation) ArtistsIDs

func (m *MusicsMutation) ArtistsIDs() (ids []uint64)

ArtistsIDs returns the "artists" edge IDs in the mutation.

func (*MusicsMutation) ClearAlbums

func (m *MusicsMutation) ClearAlbums()

ClearAlbums clears the "albums" edge to the Albums entity.

func (*MusicsMutation) ClearArtists

func (m *MusicsMutation) ClearArtists()

ClearArtists clears the "artists" edge to the Artists entity.

func (*MusicsMutation) ClearDescription

func (m *MusicsMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*MusicsMutation) ClearEdge

func (m *MusicsMutation) 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 (*MusicsMutation) ClearField

func (m *MusicsMutation) 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 (*MusicsMutation) ClearFile

func (m *MusicsMutation) ClearFile()

ClearFile clears the "file" edge to the Files entity.

func (*MusicsMutation) ClearPlaylists

func (m *MusicsMutation) ClearPlaylists()

ClearPlaylists clears the "playlists" edge to the Playlists entity.

func (*MusicsMutation) ClearUsers

func (m *MusicsMutation) ClearUsers()

ClearUsers clears the "users" edge to the Users entity.

func (*MusicsMutation) ClearedEdges

func (m *MusicsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MusicsMutation) ClearedFields

func (m *MusicsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MusicsMutation) Client

func (m MusicsMutation) 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 (*MusicsMutation) CreateTime

func (m *MusicsMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MusicsMutation) Description

func (m *MusicsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*MusicsMutation) DescriptionCleared

func (m *MusicsMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*MusicsMutation) EdgeCleared

func (m *MusicsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MusicsMutation) Field

func (m *MusicsMutation) 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 (*MusicsMutation) FieldCleared

func (m *MusicsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MusicsMutation) Fields

func (m *MusicsMutation) 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 (*MusicsMutation) FileCleared

func (m *MusicsMutation) FileCleared() bool

FileCleared reports if the "file" edge to the Files entity was cleared.

func (*MusicsMutation) FileID

func (m *MusicsMutation) FileID() (id uint64, exists bool)

FileID returns the "file" edge ID in the mutation.

func (*MusicsMutation) FileIDs

func (m *MusicsMutation) FileIDs() (ids []uint64)

FileIDs returns the "file" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FileID instead. It exists only for internal usage by the builders.

func (*MusicsMutation) ID

func (m *MusicsMutation) 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 (*MusicsMutation) IDs

func (m *MusicsMutation) 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 (*MusicsMutation) Name

func (m *MusicsMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MusicsMutation) OldCreateTime

func (m *MusicsMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Musics entity. If the Musics 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 (*MusicsMutation) OldDescription

func (m *MusicsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Musics entity. If the Musics 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 (*MusicsMutation) OldField

func (m *MusicsMutation) 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 (*MusicsMutation) OldName

func (m *MusicsMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Musics entity. If the Musics 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 (*MusicsMutation) OldUpdateTime

func (m *MusicsMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Musics entity. If the Musics 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 (*MusicsMutation) Op

func (m *MusicsMutation) Op() Op

Op returns the operation name.

func (*MusicsMutation) PlaylistsCleared

func (m *MusicsMutation) PlaylistsCleared() bool

PlaylistsCleared reports if the "playlists" edge to the Playlists entity was cleared.

func (*MusicsMutation) PlaylistsIDs

func (m *MusicsMutation) PlaylistsIDs() (ids []uint64)

PlaylistsIDs returns the "playlists" edge IDs in the mutation.

func (*MusicsMutation) RemoveAlbumIDs

func (m *MusicsMutation) RemoveAlbumIDs(ids ...uint64)

RemoveAlbumIDs removes the "albums" edge to the Albums entity by IDs.

func (*MusicsMutation) RemoveArtistIDs

func (m *MusicsMutation) RemoveArtistIDs(ids ...uint64)

RemoveArtistIDs removes the "artists" edge to the Artists entity by IDs.

func (*MusicsMutation) RemovePlaylistIDs

func (m *MusicsMutation) RemovePlaylistIDs(ids ...uint64)

RemovePlaylistIDs removes the "playlists" edge to the Playlists entity by IDs.

func (*MusicsMutation) RemoveUserIDs

func (m *MusicsMutation) RemoveUserIDs(ids ...uint64)

RemoveUserIDs removes the "users" edge to the Users entity by IDs.

func (*MusicsMutation) RemovedAlbumsIDs

func (m *MusicsMutation) RemovedAlbumsIDs() (ids []uint64)

RemovedAlbums returns the removed IDs of the "albums" edge to the Albums entity.

func (*MusicsMutation) RemovedArtistsIDs

func (m *MusicsMutation) RemovedArtistsIDs() (ids []uint64)

RemovedArtists returns the removed IDs of the "artists" edge to the Artists entity.

func (*MusicsMutation) RemovedEdges

func (m *MusicsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MusicsMutation) RemovedIDs

func (m *MusicsMutation) 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 (*MusicsMutation) RemovedPlaylistsIDs

func (m *MusicsMutation) RemovedPlaylistsIDs() (ids []uint64)

RemovedPlaylists returns the removed IDs of the "playlists" edge to the Playlists entity.

func (*MusicsMutation) RemovedUsersIDs

func (m *MusicsMutation) RemovedUsersIDs() (ids []uint64)

RemovedUsers returns the removed IDs of the "users" edge to the Users entity.

func (*MusicsMutation) ResetAlbums

func (m *MusicsMutation) ResetAlbums()

ResetAlbums resets all changes to the "albums" edge.

func (*MusicsMutation) ResetArtists

func (m *MusicsMutation) ResetArtists()

ResetArtists resets all changes to the "artists" edge.

func (*MusicsMutation) ResetCreateTime

func (m *MusicsMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MusicsMutation) ResetDescription

func (m *MusicsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MusicsMutation) ResetEdge

func (m *MusicsMutation) 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 (*MusicsMutation) ResetField

func (m *MusicsMutation) 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 (*MusicsMutation) ResetFile

func (m *MusicsMutation) ResetFile()

ResetFile resets all changes to the "file" edge.

func (*MusicsMutation) ResetName

func (m *MusicsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MusicsMutation) ResetPlaylists

func (m *MusicsMutation) ResetPlaylists()

ResetPlaylists resets all changes to the "playlists" edge.

func (*MusicsMutation) ResetUpdateTime

func (m *MusicsMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MusicsMutation) ResetUsers

func (m *MusicsMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*MusicsMutation) SetCreateTime

func (m *MusicsMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MusicsMutation) SetDescription

func (m *MusicsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MusicsMutation) SetField

func (m *MusicsMutation) 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 (*MusicsMutation) SetFileID

func (m *MusicsMutation) SetFileID(id uint64)

SetFileID sets the "file" edge to the Files entity by id.

func (*MusicsMutation) SetID

func (m *MusicsMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Musics entities.

func (*MusicsMutation) SetName

func (m *MusicsMutation) SetName(s string)

SetName sets the "name" field.

func (*MusicsMutation) SetOp

func (m *MusicsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MusicsMutation) SetUpdateTime

func (m *MusicsMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (MusicsMutation) Tx

func (m MusicsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MusicsMutation) Type

func (m *MusicsMutation) Type() string

Type returns the node type of this mutation (Musics).

func (*MusicsMutation) UpdateTime

func (m *MusicsMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MusicsMutation) UsersCleared

func (m *MusicsMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the Users entity was cleared.

func (*MusicsMutation) UsersIDs

func (m *MusicsMutation) UsersIDs() (ids []uint64)

UsersIDs returns the "users" edge IDs in the mutation.

func (*MusicsMutation) Where

func (m *MusicsMutation) Where(ps ...predicate.Musics)

Where appends a list predicates to the MusicsMutation builder.

func (*MusicsMutation) WhereP

func (m *MusicsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MusicsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MusicsQuery

type MusicsQuery struct {
	// contains filtered or unexported fields
}

MusicsQuery is the builder for querying Musics entities.

func (*MusicsQuery) Aggregate

func (mq *MusicsQuery) Aggregate(fns ...AggregateFunc) *MusicsSelect

Aggregate returns a MusicsSelect configured with the given aggregations.

func (*MusicsQuery) All

func (mq *MusicsQuery) All(ctx context.Context) ([]*Musics, error)

All executes the query and returns a list of MusicsSlice.

func (*MusicsQuery) AllX

func (mq *MusicsQuery) AllX(ctx context.Context) []*Musics

AllX is like All, but panics if an error occurs.

func (*MusicsQuery) Clone

func (mq *MusicsQuery) Clone() *MusicsQuery

Clone returns a duplicate of the MusicsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MusicsQuery) Count

func (mq *MusicsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MusicsQuery) CountX

func (mq *MusicsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MusicsQuery) Exist

func (mq *MusicsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MusicsQuery) ExistX

func (mq *MusicsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MusicsQuery) First

func (mq *MusicsQuery) First(ctx context.Context) (*Musics, error)

First returns the first Musics entity from the query. Returns a *NotFoundError when no Musics was found.

func (*MusicsQuery) FirstID

func (mq *MusicsQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Musics ID from the query. Returns a *NotFoundError when no Musics ID was found.

func (*MusicsQuery) FirstIDX

func (mq *MusicsQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*MusicsQuery) FirstX

func (mq *MusicsQuery) FirstX(ctx context.Context) *Musics

FirstX is like First, but panics if an error occurs.

func (*MusicsQuery) GroupBy

func (mq *MusicsQuery) GroupBy(field string, fields ...string) *MusicsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Musics.Query().
	GroupBy(musics.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MusicsQuery) IDs

func (mq *MusicsQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Musics IDs.

func (*MusicsQuery) IDsX

func (mq *MusicsQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*MusicsQuery) Limit

func (mq *MusicsQuery) Limit(limit int) *MusicsQuery

Limit the number of records to be returned by this query.

func (*MusicsQuery) Offset

func (mq *MusicsQuery) Offset(offset int) *MusicsQuery

Offset to start from.

func (*MusicsQuery) Only

func (mq *MusicsQuery) Only(ctx context.Context) (*Musics, error)

Only returns a single Musics entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Musics entity is found. Returns a *NotFoundError when no Musics entities are found.

func (*MusicsQuery) OnlyID

func (mq *MusicsQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Musics ID in the query. Returns a *NotSingularError when more than one Musics ID is found. Returns a *NotFoundError when no entities are found.

func (*MusicsQuery) OnlyIDX

func (mq *MusicsQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MusicsQuery) OnlyX

func (mq *MusicsQuery) OnlyX(ctx context.Context) *Musics

OnlyX is like Only, but panics if an error occurs.

func (*MusicsQuery) Order

func (mq *MusicsQuery) Order(o ...musics.OrderOption) *MusicsQuery

Order specifies how the records should be ordered.

func (*MusicsQuery) QueryAlbums

func (mq *MusicsQuery) QueryAlbums() *AlbumsQuery

QueryAlbums chains the current query on the "albums" edge.

func (*MusicsQuery) QueryArtists

func (mq *MusicsQuery) QueryArtists() *ArtistsQuery

QueryArtists chains the current query on the "artists" edge.

func (*MusicsQuery) QueryFile

func (mq *MusicsQuery) QueryFile() *FilesQuery

QueryFile chains the current query on the "file" edge.

func (*MusicsQuery) QueryPlaylists

func (mq *MusicsQuery) QueryPlaylists() *PlaylistsQuery

QueryPlaylists chains the current query on the "playlists" edge.

func (*MusicsQuery) QueryUsers

func (mq *MusicsQuery) QueryUsers() *UsersQuery

QueryUsers chains the current query on the "users" edge.

func (*MusicsQuery) Select

func (mq *MusicsQuery) Select(fields ...string) *MusicsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Musics.Query().
	Select(musics.FieldCreateTime).
	Scan(ctx, &v)

func (*MusicsQuery) Unique

func (mq *MusicsQuery) Unique(unique bool) *MusicsQuery

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 (*MusicsQuery) Where

func (mq *MusicsQuery) Where(ps ...predicate.Musics) *MusicsQuery

Where adds a new predicate for the MusicsQuery builder.

func (*MusicsQuery) WithAlbums

func (mq *MusicsQuery) WithAlbums(opts ...func(*AlbumsQuery)) *MusicsQuery

WithAlbums tells the query-builder to eager-load the nodes that are connected to the "albums" edge. The optional arguments are used to configure the query builder of the edge.

func (*MusicsQuery) WithArtists

func (mq *MusicsQuery) WithArtists(opts ...func(*ArtistsQuery)) *MusicsQuery

WithArtists tells the query-builder to eager-load the nodes that are connected to the "artists" edge. The optional arguments are used to configure the query builder of the edge.

func (*MusicsQuery) WithFile

func (mq *MusicsQuery) WithFile(opts ...func(*FilesQuery)) *MusicsQuery

WithFile tells the query-builder to eager-load the nodes that are connected to the "file" edge. The optional arguments are used to configure the query builder of the edge.

func (*MusicsQuery) WithPlaylists

func (mq *MusicsQuery) WithPlaylists(opts ...func(*PlaylistsQuery)) *MusicsQuery

WithPlaylists tells the query-builder to eager-load the nodes that are connected to the "playlists" edge. The optional arguments are used to configure the query builder of the edge.

func (*MusicsQuery) WithUsers

func (mq *MusicsQuery) WithUsers(opts ...func(*UsersQuery)) *MusicsQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type MusicsSelect

type MusicsSelect struct {
	*MusicsQuery
	// contains filtered or unexported fields
}

MusicsSelect is the builder for selecting fields of Musics entities.

func (*MusicsSelect) Aggregate

func (ms *MusicsSelect) Aggregate(fns ...AggregateFunc) *MusicsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MusicsSelect) Bool

func (s *MusicsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) BoolX

func (s *MusicsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MusicsSelect) Bools

func (s *MusicsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) BoolsX

func (s *MusicsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MusicsSelect) Float64

func (s *MusicsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) Float64X

func (s *MusicsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MusicsSelect) Float64s

func (s *MusicsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) Float64sX

func (s *MusicsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MusicsSelect) Int

func (s *MusicsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) IntX

func (s *MusicsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MusicsSelect) Ints

func (s *MusicsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) IntsX

func (s *MusicsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MusicsSelect) Scan

func (ms *MusicsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MusicsSelect) ScanX

func (s *MusicsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MusicsSelect) String

func (s *MusicsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) StringX

func (s *MusicsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MusicsSelect) Strings

func (s *MusicsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MusicsSelect) StringsX

func (s *MusicsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MusicsSlice

type MusicsSlice []*Musics

MusicsSlice is a parsable slice of Musics.

type MusicsUpdate

type MusicsUpdate struct {
	// contains filtered or unexported fields
}

MusicsUpdate is the builder for updating Musics entities.

func (*MusicsUpdate) AddAlbumIDs

func (mu *MusicsUpdate) AddAlbumIDs(ids ...uint64) *MusicsUpdate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*MusicsUpdate) AddAlbums

func (mu *MusicsUpdate) AddAlbums(a ...*Albums) *MusicsUpdate

AddAlbums adds the "albums" edges to the Albums entity.

func (*MusicsUpdate) AddArtistIDs

func (mu *MusicsUpdate) AddArtistIDs(ids ...uint64) *MusicsUpdate

AddArtistIDs adds the "artists" edge to the Artists entity by IDs.

func (*MusicsUpdate) AddArtists

func (mu *MusicsUpdate) AddArtists(a ...*Artists) *MusicsUpdate

AddArtists adds the "artists" edges to the Artists entity.

func (*MusicsUpdate) AddPlaylistIDs

func (mu *MusicsUpdate) AddPlaylistIDs(ids ...uint64) *MusicsUpdate

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*MusicsUpdate) AddPlaylists

func (mu *MusicsUpdate) AddPlaylists(p ...*Playlists) *MusicsUpdate

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*MusicsUpdate) AddUserIDs

func (mu *MusicsUpdate) AddUserIDs(ids ...uint64) *MusicsUpdate

AddUserIDs adds the "users" edge to the Users entity by IDs.

func (*MusicsUpdate) AddUsers

func (mu *MusicsUpdate) AddUsers(u ...*Users) *MusicsUpdate

AddUsers adds the "users" edges to the Users entity.

func (*MusicsUpdate) ClearAlbums

func (mu *MusicsUpdate) ClearAlbums() *MusicsUpdate

ClearAlbums clears all "albums" edges to the Albums entity.

func (*MusicsUpdate) ClearArtists

func (mu *MusicsUpdate) ClearArtists() *MusicsUpdate

ClearArtists clears all "artists" edges to the Artists entity.

func (*MusicsUpdate) ClearDescription

func (mu *MusicsUpdate) ClearDescription() *MusicsUpdate

ClearDescription clears the value of the "description" field.

func (*MusicsUpdate) ClearFile

func (mu *MusicsUpdate) ClearFile() *MusicsUpdate

ClearFile clears the "file" edge to the Files entity.

func (*MusicsUpdate) ClearPlaylists

func (mu *MusicsUpdate) ClearPlaylists() *MusicsUpdate

ClearPlaylists clears all "playlists" edges to the Playlists entity.

func (*MusicsUpdate) ClearUsers

func (mu *MusicsUpdate) ClearUsers() *MusicsUpdate

ClearUsers clears all "users" edges to the Users entity.

func (*MusicsUpdate) Exec

func (mu *MusicsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MusicsUpdate) ExecX

func (mu *MusicsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MusicsUpdate) Mutation

func (mu *MusicsUpdate) Mutation() *MusicsMutation

Mutation returns the MusicsMutation object of the builder.

func (*MusicsUpdate) RemoveAlbumIDs

func (mu *MusicsUpdate) RemoveAlbumIDs(ids ...uint64) *MusicsUpdate

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*MusicsUpdate) RemoveAlbums

func (mu *MusicsUpdate) RemoveAlbums(a ...*Albums) *MusicsUpdate

RemoveAlbums removes "albums" edges to Albums entities.

func (*MusicsUpdate) RemoveArtistIDs

func (mu *MusicsUpdate) RemoveArtistIDs(ids ...uint64) *MusicsUpdate

RemoveArtistIDs removes the "artists" edge to Artists entities by IDs.

func (*MusicsUpdate) RemoveArtists

func (mu *MusicsUpdate) RemoveArtists(a ...*Artists) *MusicsUpdate

RemoveArtists removes "artists" edges to Artists entities.

func (*MusicsUpdate) RemovePlaylistIDs

func (mu *MusicsUpdate) RemovePlaylistIDs(ids ...uint64) *MusicsUpdate

RemovePlaylistIDs removes the "playlists" edge to Playlists entities by IDs.

func (*MusicsUpdate) RemovePlaylists

func (mu *MusicsUpdate) RemovePlaylists(p ...*Playlists) *MusicsUpdate

RemovePlaylists removes "playlists" edges to Playlists entities.

func (*MusicsUpdate) RemoveUserIDs

func (mu *MusicsUpdate) RemoveUserIDs(ids ...uint64) *MusicsUpdate

RemoveUserIDs removes the "users" edge to Users entities by IDs.

func (*MusicsUpdate) RemoveUsers

func (mu *MusicsUpdate) RemoveUsers(u ...*Users) *MusicsUpdate

RemoveUsers removes "users" edges to Users entities.

func (*MusicsUpdate) Save

func (mu *MusicsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MusicsUpdate) SaveX

func (mu *MusicsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MusicsUpdate) SetDescription

func (mu *MusicsUpdate) SetDescription(s string) *MusicsUpdate

SetDescription sets the "description" field.

func (*MusicsUpdate) SetFile

func (mu *MusicsUpdate) SetFile(f *Files) *MusicsUpdate

SetFile sets the "file" edge to the Files entity.

func (*MusicsUpdate) SetFileID

func (mu *MusicsUpdate) SetFileID(id uint64) *MusicsUpdate

SetFileID sets the "file" edge to the Files entity by ID.

func (*MusicsUpdate) SetName

func (mu *MusicsUpdate) SetName(s string) *MusicsUpdate

SetName sets the "name" field.

func (*MusicsUpdate) SetNillableDescription

func (mu *MusicsUpdate) SetNillableDescription(s *string) *MusicsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MusicsUpdate) SetNillableName

func (mu *MusicsUpdate) SetNillableName(s *string) *MusicsUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*MusicsUpdate) SetUpdateTime

func (mu *MusicsUpdate) SetUpdateTime(t time.Time) *MusicsUpdate

SetUpdateTime sets the "update_time" field.

func (*MusicsUpdate) Where

func (mu *MusicsUpdate) Where(ps ...predicate.Musics) *MusicsUpdate

Where appends a list predicates to the MusicsUpdate builder.

type MusicsUpdateOne

type MusicsUpdateOne struct {
	// contains filtered or unexported fields
}

MusicsUpdateOne is the builder for updating a single Musics entity.

func (*MusicsUpdateOne) AddAlbumIDs

func (muo *MusicsUpdateOne) AddAlbumIDs(ids ...uint64) *MusicsUpdateOne

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*MusicsUpdateOne) AddAlbums

func (muo *MusicsUpdateOne) AddAlbums(a ...*Albums) *MusicsUpdateOne

AddAlbums adds the "albums" edges to the Albums entity.

func (*MusicsUpdateOne) AddArtistIDs

func (muo *MusicsUpdateOne) AddArtistIDs(ids ...uint64) *MusicsUpdateOne

AddArtistIDs adds the "artists" edge to the Artists entity by IDs.

func (*MusicsUpdateOne) AddArtists

func (muo *MusicsUpdateOne) AddArtists(a ...*Artists) *MusicsUpdateOne

AddArtists adds the "artists" edges to the Artists entity.

func (*MusicsUpdateOne) AddPlaylistIDs

func (muo *MusicsUpdateOne) AddPlaylistIDs(ids ...uint64) *MusicsUpdateOne

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*MusicsUpdateOne) AddPlaylists

func (muo *MusicsUpdateOne) AddPlaylists(p ...*Playlists) *MusicsUpdateOne

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*MusicsUpdateOne) AddUserIDs

func (muo *MusicsUpdateOne) AddUserIDs(ids ...uint64) *MusicsUpdateOne

AddUserIDs adds the "users" edge to the Users entity by IDs.

func (*MusicsUpdateOne) AddUsers

func (muo *MusicsUpdateOne) AddUsers(u ...*Users) *MusicsUpdateOne

AddUsers adds the "users" edges to the Users entity.

func (*MusicsUpdateOne) ClearAlbums

func (muo *MusicsUpdateOne) ClearAlbums() *MusicsUpdateOne

ClearAlbums clears all "albums" edges to the Albums entity.

func (*MusicsUpdateOne) ClearArtists

func (muo *MusicsUpdateOne) ClearArtists() *MusicsUpdateOne

ClearArtists clears all "artists" edges to the Artists entity.

func (*MusicsUpdateOne) ClearDescription

func (muo *MusicsUpdateOne) ClearDescription() *MusicsUpdateOne

ClearDescription clears the value of the "description" field.

func (*MusicsUpdateOne) ClearFile

func (muo *MusicsUpdateOne) ClearFile() *MusicsUpdateOne

ClearFile clears the "file" edge to the Files entity.

func (*MusicsUpdateOne) ClearPlaylists

func (muo *MusicsUpdateOne) ClearPlaylists() *MusicsUpdateOne

ClearPlaylists clears all "playlists" edges to the Playlists entity.

func (*MusicsUpdateOne) ClearUsers

func (muo *MusicsUpdateOne) ClearUsers() *MusicsUpdateOne

ClearUsers clears all "users" edges to the Users entity.

func (*MusicsUpdateOne) Exec

func (muo *MusicsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MusicsUpdateOne) ExecX

func (muo *MusicsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MusicsUpdateOne) Mutation

func (muo *MusicsUpdateOne) Mutation() *MusicsMutation

Mutation returns the MusicsMutation object of the builder.

func (*MusicsUpdateOne) RemoveAlbumIDs

func (muo *MusicsUpdateOne) RemoveAlbumIDs(ids ...uint64) *MusicsUpdateOne

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*MusicsUpdateOne) RemoveAlbums

func (muo *MusicsUpdateOne) RemoveAlbums(a ...*Albums) *MusicsUpdateOne

RemoveAlbums removes "albums" edges to Albums entities.

func (*MusicsUpdateOne) RemoveArtistIDs

func (muo *MusicsUpdateOne) RemoveArtistIDs(ids ...uint64) *MusicsUpdateOne

RemoveArtistIDs removes the "artists" edge to Artists entities by IDs.

func (*MusicsUpdateOne) RemoveArtists

func (muo *MusicsUpdateOne) RemoveArtists(a ...*Artists) *MusicsUpdateOne

RemoveArtists removes "artists" edges to Artists entities.

func (*MusicsUpdateOne) RemovePlaylistIDs

func (muo *MusicsUpdateOne) RemovePlaylistIDs(ids ...uint64) *MusicsUpdateOne

RemovePlaylistIDs removes the "playlists" edge to Playlists entities by IDs.

func (*MusicsUpdateOne) RemovePlaylists

func (muo *MusicsUpdateOne) RemovePlaylists(p ...*Playlists) *MusicsUpdateOne

RemovePlaylists removes "playlists" edges to Playlists entities.

func (*MusicsUpdateOne) RemoveUserIDs

func (muo *MusicsUpdateOne) RemoveUserIDs(ids ...uint64) *MusicsUpdateOne

RemoveUserIDs removes the "users" edge to Users entities by IDs.

func (*MusicsUpdateOne) RemoveUsers

func (muo *MusicsUpdateOne) RemoveUsers(u ...*Users) *MusicsUpdateOne

RemoveUsers removes "users" edges to Users entities.

func (*MusicsUpdateOne) Save

func (muo *MusicsUpdateOne) Save(ctx context.Context) (*Musics, error)

Save executes the query and returns the updated Musics entity.

func (*MusicsUpdateOne) SaveX

func (muo *MusicsUpdateOne) SaveX(ctx context.Context) *Musics

SaveX is like Save, but panics if an error occurs.

func (*MusicsUpdateOne) Select

func (muo *MusicsUpdateOne) Select(field string, fields ...string) *MusicsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MusicsUpdateOne) SetDescription

func (muo *MusicsUpdateOne) SetDescription(s string) *MusicsUpdateOne

SetDescription sets the "description" field.

func (*MusicsUpdateOne) SetFile

func (muo *MusicsUpdateOne) SetFile(f *Files) *MusicsUpdateOne

SetFile sets the "file" edge to the Files entity.

func (*MusicsUpdateOne) SetFileID

func (muo *MusicsUpdateOne) SetFileID(id uint64) *MusicsUpdateOne

SetFileID sets the "file" edge to the Files entity by ID.

func (*MusicsUpdateOne) SetName

func (muo *MusicsUpdateOne) SetName(s string) *MusicsUpdateOne

SetName sets the "name" field.

func (*MusicsUpdateOne) SetNillableDescription

func (muo *MusicsUpdateOne) SetNillableDescription(s *string) *MusicsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MusicsUpdateOne) SetNillableName

func (muo *MusicsUpdateOne) SetNillableName(s *string) *MusicsUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*MusicsUpdateOne) SetUpdateTime

func (muo *MusicsUpdateOne) SetUpdateTime(t time.Time) *MusicsUpdateOne

SetUpdateTime sets the "update_time" field.

func (*MusicsUpdateOne) Where

func (muo *MusicsUpdateOne) Where(ps ...predicate.Musics) *MusicsUpdateOne

Where appends a list predicates to the MusicsUpdate builder.

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 Oidc

type Oidc struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// ConfigurationEndpoint holds the value of the "configuration_endpoint" field.
	ConfigurationEndpoint string `json:"configuration_endpoint,omitempty"`
	// contains filtered or unexported fields
}

Oidc is the model entity for the Oidc schema.

func (*Oidc) String

func (o *Oidc) String() string

String implements the fmt.Stringer.

func (*Oidc) Unwrap

func (o *Oidc) Unwrap() *Oidc

Unwrap unwraps the Oidc 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 (*Oidc) Update

func (o *Oidc) Update() *OidcUpdateOne

Update returns a builder for updating this Oidc. Note that you need to call Oidc.Unwrap() before calling this method if this Oidc was returned from a transaction, and the transaction was committed or rolled back.

func (*Oidc) Value

func (o *Oidc) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Oidc. This includes values selected through modifiers, order, etc.

type OidcClient

type OidcClient struct {
	// contains filtered or unexported fields
}

OidcClient is a client for the Oidc schema.

func NewOidcClient

func NewOidcClient(c config) *OidcClient

NewOidcClient returns a client for the Oidc from the given config.

func (*OidcClient) Create

func (c *OidcClient) Create() *OidcCreate

Create returns a builder for creating a Oidc entity.

func (*OidcClient) CreateBulk

func (c *OidcClient) CreateBulk(builders ...*OidcCreate) *OidcCreateBulk

CreateBulk returns a builder for creating a bulk of Oidc entities.

func (*OidcClient) Delete

func (c *OidcClient) Delete() *OidcDelete

Delete returns a delete builder for Oidc.

func (*OidcClient) DeleteOne

func (c *OidcClient) DeleteOne(o *Oidc) *OidcDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OidcClient) DeleteOneID

func (c *OidcClient) DeleteOneID(id uint64) *OidcDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OidcClient) Get

func (c *OidcClient) Get(ctx context.Context, id uint64) (*Oidc, error)

Get returns a Oidc entity by its id.

func (*OidcClient) GetX

func (c *OidcClient) GetX(ctx context.Context, id uint64) *Oidc

GetX is like Get, but panics if an error occurs.

func (*OidcClient) Hooks

func (c *OidcClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OidcClient) Intercept

func (c *OidcClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `oidc.Intercept(f(g(h())))`.

func (*OidcClient) Interceptors

func (c *OidcClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OidcClient) MapCreateBulk

func (c *OidcClient) MapCreateBulk(slice any, setFunc func(*OidcCreate, int)) *OidcCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*OidcClient) Query

func (c *OidcClient) Query() *OidcQuery

Query returns a query builder for Oidc.

func (*OidcClient) Update

func (c *OidcClient) Update() *OidcUpdate

Update returns an update builder for Oidc.

func (*OidcClient) UpdateOne

func (c *OidcClient) UpdateOne(o *Oidc) *OidcUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OidcClient) UpdateOneID

func (c *OidcClient) UpdateOneID(id uint64) *OidcUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OidcClient) Use

func (c *OidcClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `oidc.Hooks(f(g(h())))`.

type OidcCreate

type OidcCreate struct {
	// contains filtered or unexported fields
}

OidcCreate is the builder for creating a Oidc entity.

func (*OidcCreate) Exec

func (oc *OidcCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OidcCreate) ExecX

func (oc *OidcCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OidcCreate) Mutation

func (oc *OidcCreate) Mutation() *OidcMutation

Mutation returns the OidcMutation object of the builder.

func (*OidcCreate) Save

func (oc *OidcCreate) Save(ctx context.Context) (*Oidc, error)

Save creates the Oidc in the database.

func (*OidcCreate) SaveX

func (oc *OidcCreate) SaveX(ctx context.Context) *Oidc

SaveX calls Save and panics if Save returns an error.

func (*OidcCreate) SetConfigurationEndpoint

func (oc *OidcCreate) SetConfigurationEndpoint(s string) *OidcCreate

SetConfigurationEndpoint sets the "configuration_endpoint" field.

func (*OidcCreate) SetCreateTime

func (oc *OidcCreate) SetCreateTime(t time.Time) *OidcCreate

SetCreateTime sets the "create_time" field.

func (*OidcCreate) SetID

func (oc *OidcCreate) SetID(u uint64) *OidcCreate

SetID sets the "id" field.

func (*OidcCreate) SetName

func (oc *OidcCreate) SetName(s string) *OidcCreate

SetName sets the "name" field.

func (*OidcCreate) SetNillableCreateTime

func (oc *OidcCreate) SetNillableCreateTime(t *time.Time) *OidcCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*OidcCreate) SetNillableUpdateTime

func (oc *OidcCreate) SetNillableUpdateTime(t *time.Time) *OidcCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*OidcCreate) SetUpdateTime

func (oc *OidcCreate) SetUpdateTime(t time.Time) *OidcCreate

SetUpdateTime sets the "update_time" field.

type OidcCreateBulk

type OidcCreateBulk struct {
	// contains filtered or unexported fields
}

OidcCreateBulk is the builder for creating many Oidc entities in bulk.

func (*OidcCreateBulk) Exec

func (ocb *OidcCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OidcCreateBulk) ExecX

func (ocb *OidcCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OidcCreateBulk) Save

func (ocb *OidcCreateBulk) Save(ctx context.Context) ([]*Oidc, error)

Save creates the Oidc entities in the database.

func (*OidcCreateBulk) SaveX

func (ocb *OidcCreateBulk) SaveX(ctx context.Context) []*Oidc

SaveX is like Save, but panics if an error occurs.

type OidcDelete

type OidcDelete struct {
	// contains filtered or unexported fields
}

OidcDelete is the builder for deleting a Oidc entity.

func (*OidcDelete) Exec

func (od *OidcDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OidcDelete) ExecX

func (od *OidcDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OidcDelete) Where

func (od *OidcDelete) Where(ps ...predicate.Oidc) *OidcDelete

Where appends a list predicates to the OidcDelete builder.

type OidcDeleteOne

type OidcDeleteOne struct {
	// contains filtered or unexported fields
}

OidcDeleteOne is the builder for deleting a single Oidc entity.

func (*OidcDeleteOne) Exec

func (odo *OidcDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OidcDeleteOne) ExecX

func (odo *OidcDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OidcDeleteOne) Where

func (odo *OidcDeleteOne) Where(ps ...predicate.Oidc) *OidcDeleteOne

Where appends a list predicates to the OidcDelete builder.

type OidcGroupBy

type OidcGroupBy struct {
	// contains filtered or unexported fields
}

OidcGroupBy is the group-by builder for Oidc entities.

func (*OidcGroupBy) Aggregate

func (ogb *OidcGroupBy) Aggregate(fns ...AggregateFunc) *OidcGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OidcGroupBy) Bool

func (s *OidcGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) BoolX

func (s *OidcGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OidcGroupBy) Bools

func (s *OidcGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) BoolsX

func (s *OidcGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OidcGroupBy) Float64

func (s *OidcGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) Float64X

func (s *OidcGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OidcGroupBy) Float64s

func (s *OidcGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) Float64sX

func (s *OidcGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OidcGroupBy) Int

func (s *OidcGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) IntX

func (s *OidcGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OidcGroupBy) Ints

func (s *OidcGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) IntsX

func (s *OidcGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OidcGroupBy) Scan

func (ogb *OidcGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OidcGroupBy) ScanX

func (s *OidcGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OidcGroupBy) String

func (s *OidcGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) StringX

func (s *OidcGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OidcGroupBy) Strings

func (s *OidcGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OidcGroupBy) StringsX

func (s *OidcGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OidcMutation

type OidcMutation struct {
	// contains filtered or unexported fields
}

OidcMutation represents an operation that mutates the Oidc nodes in the graph.

func (*OidcMutation) AddField

func (m *OidcMutation) 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 (*OidcMutation) AddedEdges

func (m *OidcMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OidcMutation) AddedField

func (m *OidcMutation) 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 (*OidcMutation) AddedFields

func (m *OidcMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OidcMutation) AddedIDs

func (m *OidcMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OidcMutation) ClearEdge

func (m *OidcMutation) 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 (*OidcMutation) ClearField

func (m *OidcMutation) 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 (*OidcMutation) ClearedEdges

func (m *OidcMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OidcMutation) ClearedFields

func (m *OidcMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OidcMutation) Client

func (m OidcMutation) 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 (*OidcMutation) ConfigurationEndpoint

func (m *OidcMutation) ConfigurationEndpoint() (r string, exists bool)

ConfigurationEndpoint returns the value of the "configuration_endpoint" field in the mutation.

func (*OidcMutation) CreateTime

func (m *OidcMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*OidcMutation) EdgeCleared

func (m *OidcMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OidcMutation) Field

func (m *OidcMutation) 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 (*OidcMutation) FieldCleared

func (m *OidcMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OidcMutation) Fields

func (m *OidcMutation) 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 (*OidcMutation) ID

func (m *OidcMutation) 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 (*OidcMutation) IDs

func (m *OidcMutation) 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 (*OidcMutation) Name

func (m *OidcMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*OidcMutation) OldConfigurationEndpoint

func (m *OidcMutation) OldConfigurationEndpoint(ctx context.Context) (v string, err error)

OldConfigurationEndpoint returns the old "configuration_endpoint" field's value of the Oidc entity. If the Oidc 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 (*OidcMutation) OldCreateTime

func (m *OidcMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Oidc entity. If the Oidc 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 (*OidcMutation) OldField

func (m *OidcMutation) 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 (*OidcMutation) OldName

func (m *OidcMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Oidc entity. If the Oidc 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 (*OidcMutation) OldUpdateTime

func (m *OidcMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Oidc entity. If the Oidc 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 (*OidcMutation) Op

func (m *OidcMutation) Op() Op

Op returns the operation name.

func (*OidcMutation) RemovedEdges

func (m *OidcMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OidcMutation) RemovedIDs

func (m *OidcMutation) 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 (*OidcMutation) ResetConfigurationEndpoint

func (m *OidcMutation) ResetConfigurationEndpoint()

ResetConfigurationEndpoint resets all changes to the "configuration_endpoint" field.

func (*OidcMutation) ResetCreateTime

func (m *OidcMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*OidcMutation) ResetEdge

func (m *OidcMutation) 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 (*OidcMutation) ResetField

func (m *OidcMutation) 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 (*OidcMutation) ResetName

func (m *OidcMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OidcMutation) ResetUpdateTime

func (m *OidcMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*OidcMutation) SetConfigurationEndpoint

func (m *OidcMutation) SetConfigurationEndpoint(s string)

SetConfigurationEndpoint sets the "configuration_endpoint" field.

func (*OidcMutation) SetCreateTime

func (m *OidcMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*OidcMutation) SetField

func (m *OidcMutation) 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 (*OidcMutation) SetID

func (m *OidcMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Oidc entities.

func (*OidcMutation) SetName

func (m *OidcMutation) SetName(s string)

SetName sets the "name" field.

func (*OidcMutation) SetOp

func (m *OidcMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OidcMutation) SetUpdateTime

func (m *OidcMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (OidcMutation) Tx

func (m OidcMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OidcMutation) Type

func (m *OidcMutation) Type() string

Type returns the node type of this mutation (Oidc).

func (*OidcMutation) UpdateTime

func (m *OidcMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*OidcMutation) Where

func (m *OidcMutation) Where(ps ...predicate.Oidc)

Where appends a list predicates to the OidcMutation builder.

func (*OidcMutation) WhereP

func (m *OidcMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OidcMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OidcQuery

type OidcQuery struct {
	// contains filtered or unexported fields
}

OidcQuery is the builder for querying Oidc entities.

func (*OidcQuery) Aggregate

func (oq *OidcQuery) Aggregate(fns ...AggregateFunc) *OidcSelect

Aggregate returns a OidcSelect configured with the given aggregations.

func (*OidcQuery) All

func (oq *OidcQuery) All(ctx context.Context) ([]*Oidc, error)

All executes the query and returns a list of Oidcs.

func (*OidcQuery) AllX

func (oq *OidcQuery) AllX(ctx context.Context) []*Oidc

AllX is like All, but panics if an error occurs.

func (*OidcQuery) Clone

func (oq *OidcQuery) Clone() *OidcQuery

Clone returns a duplicate of the OidcQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OidcQuery) Count

func (oq *OidcQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OidcQuery) CountX

func (oq *OidcQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OidcQuery) Exist

func (oq *OidcQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OidcQuery) ExistX

func (oq *OidcQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OidcQuery) First

func (oq *OidcQuery) First(ctx context.Context) (*Oidc, error)

First returns the first Oidc entity from the query. Returns a *NotFoundError when no Oidc was found.

func (*OidcQuery) FirstID

func (oq *OidcQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Oidc ID from the query. Returns a *NotFoundError when no Oidc ID was found.

func (*OidcQuery) FirstIDX

func (oq *OidcQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*OidcQuery) FirstX

func (oq *OidcQuery) FirstX(ctx context.Context) *Oidc

FirstX is like First, but panics if an error occurs.

func (*OidcQuery) GroupBy

func (oq *OidcQuery) GroupBy(field string, fields ...string) *OidcGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Oidc.Query().
	GroupBy(oidc.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OidcQuery) IDs

func (oq *OidcQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Oidc IDs.

func (*OidcQuery) IDsX

func (oq *OidcQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*OidcQuery) Limit

func (oq *OidcQuery) Limit(limit int) *OidcQuery

Limit the number of records to be returned by this query.

func (*OidcQuery) Offset

func (oq *OidcQuery) Offset(offset int) *OidcQuery

Offset to start from.

func (*OidcQuery) Only

func (oq *OidcQuery) Only(ctx context.Context) (*Oidc, error)

Only returns a single Oidc entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Oidc entity is found. Returns a *NotFoundError when no Oidc entities are found.

func (*OidcQuery) OnlyID

func (oq *OidcQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Oidc ID in the query. Returns a *NotSingularError when more than one Oidc ID is found. Returns a *NotFoundError when no entities are found.

func (*OidcQuery) OnlyIDX

func (oq *OidcQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OidcQuery) OnlyX

func (oq *OidcQuery) OnlyX(ctx context.Context) *Oidc

OnlyX is like Only, but panics if an error occurs.

func (*OidcQuery) Order

func (oq *OidcQuery) Order(o ...oidc.OrderOption) *OidcQuery

Order specifies how the records should be ordered.

func (*OidcQuery) Select

func (oq *OidcQuery) Select(fields ...string) *OidcSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Oidc.Query().
	Select(oidc.FieldCreateTime).
	Scan(ctx, &v)

func (*OidcQuery) Unique

func (oq *OidcQuery) Unique(unique bool) *OidcQuery

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 (*OidcQuery) Where

func (oq *OidcQuery) Where(ps ...predicate.Oidc) *OidcQuery

Where adds a new predicate for the OidcQuery builder.

type OidcSelect

type OidcSelect struct {
	*OidcQuery
	// contains filtered or unexported fields
}

OidcSelect is the builder for selecting fields of Oidc entities.

func (*OidcSelect) Aggregate

func (os *OidcSelect) Aggregate(fns ...AggregateFunc) *OidcSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OidcSelect) Bool

func (s *OidcSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OidcSelect) BoolX

func (s *OidcSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OidcSelect) Bools

func (s *OidcSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OidcSelect) BoolsX

func (s *OidcSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OidcSelect) Float64

func (s *OidcSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OidcSelect) Float64X

func (s *OidcSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OidcSelect) Float64s

func (s *OidcSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OidcSelect) Float64sX

func (s *OidcSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OidcSelect) Int

func (s *OidcSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OidcSelect) IntX

func (s *OidcSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OidcSelect) Ints

func (s *OidcSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OidcSelect) IntsX

func (s *OidcSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OidcSelect) Scan

func (os *OidcSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OidcSelect) ScanX

func (s *OidcSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OidcSelect) String

func (s *OidcSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OidcSelect) StringX

func (s *OidcSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OidcSelect) Strings

func (s *OidcSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OidcSelect) StringsX

func (s *OidcSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OidcUpdate

type OidcUpdate struct {
	// contains filtered or unexported fields
}

OidcUpdate is the builder for updating Oidc entities.

func (*OidcUpdate) Exec

func (ou *OidcUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OidcUpdate) ExecX

func (ou *OidcUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OidcUpdate) Mutation

func (ou *OidcUpdate) Mutation() *OidcMutation

Mutation returns the OidcMutation object of the builder.

func (*OidcUpdate) Save

func (ou *OidcUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OidcUpdate) SaveX

func (ou *OidcUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OidcUpdate) SetConfigurationEndpoint

func (ou *OidcUpdate) SetConfigurationEndpoint(s string) *OidcUpdate

SetConfigurationEndpoint sets the "configuration_endpoint" field.

func (*OidcUpdate) SetName

func (ou *OidcUpdate) SetName(s string) *OidcUpdate

SetName sets the "name" field.

func (*OidcUpdate) SetNillableConfigurationEndpoint

func (ou *OidcUpdate) SetNillableConfigurationEndpoint(s *string) *OidcUpdate

SetNillableConfigurationEndpoint sets the "configuration_endpoint" field if the given value is not nil.

func (*OidcUpdate) SetNillableName

func (ou *OidcUpdate) SetNillableName(s *string) *OidcUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*OidcUpdate) SetUpdateTime

func (ou *OidcUpdate) SetUpdateTime(t time.Time) *OidcUpdate

SetUpdateTime sets the "update_time" field.

func (*OidcUpdate) Where

func (ou *OidcUpdate) Where(ps ...predicate.Oidc) *OidcUpdate

Where appends a list predicates to the OidcUpdate builder.

type OidcUpdateOne

type OidcUpdateOne struct {
	// contains filtered or unexported fields
}

OidcUpdateOne is the builder for updating a single Oidc entity.

func (*OidcUpdateOne) Exec

func (ouo *OidcUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OidcUpdateOne) ExecX

func (ouo *OidcUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OidcUpdateOne) Mutation

func (ouo *OidcUpdateOne) Mutation() *OidcMutation

Mutation returns the OidcMutation object of the builder.

func (*OidcUpdateOne) Save

func (ouo *OidcUpdateOne) Save(ctx context.Context) (*Oidc, error)

Save executes the query and returns the updated Oidc entity.

func (*OidcUpdateOne) SaveX

func (ouo *OidcUpdateOne) SaveX(ctx context.Context) *Oidc

SaveX is like Save, but panics if an error occurs.

func (*OidcUpdateOne) Select

func (ouo *OidcUpdateOne) Select(field string, fields ...string) *OidcUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OidcUpdateOne) SetConfigurationEndpoint

func (ouo *OidcUpdateOne) SetConfigurationEndpoint(s string) *OidcUpdateOne

SetConfigurationEndpoint sets the "configuration_endpoint" field.

func (*OidcUpdateOne) SetName

func (ouo *OidcUpdateOne) SetName(s string) *OidcUpdateOne

SetName sets the "name" field.

func (*OidcUpdateOne) SetNillableConfigurationEndpoint

func (ouo *OidcUpdateOne) SetNillableConfigurationEndpoint(s *string) *OidcUpdateOne

SetNillableConfigurationEndpoint sets the "configuration_endpoint" field if the given value is not nil.

func (*OidcUpdateOne) SetNillableName

func (ouo *OidcUpdateOne) SetNillableName(s *string) *OidcUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*OidcUpdateOne) SetUpdateTime

func (ouo *OidcUpdateOne) SetUpdateTime(t time.Time) *OidcUpdateOne

SetUpdateTime sets the "update_time" field.

func (*OidcUpdateOne) Where

func (ouo *OidcUpdateOne) Where(ps ...predicate.Oidc) *OidcUpdateOne

Where appends a list predicates to the OidcUpdate builder.

type Oidcs

type Oidcs []*Oidc

Oidcs is a parsable slice of Oidc.

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 Playlists

type Playlists struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Private holds the value of the "private" field.
	Private bool `json:"private,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PlaylistsQuery when eager-loading is set.
	Edges PlaylistsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Playlists is the model entity for the Playlists schema.

func (*Playlists) QueryImage

func (pl *Playlists) QueryImage() *ImagesQuery

QueryImage queries the "image" edge of the Playlists entity.

func (*Playlists) QueryMusics

func (pl *Playlists) QueryMusics() *MusicsQuery

QueryMusics queries the "musics" edge of the Playlists entity.

func (*Playlists) QueryOwner

func (pl *Playlists) QueryOwner() *UsersQuery

QueryOwner queries the "owner" edge of the Playlists entity.

func (*Playlists) String

func (pl *Playlists) String() string

String implements the fmt.Stringer.

func (*Playlists) Unwrap

func (pl *Playlists) Unwrap() *Playlists

Unwrap unwraps the Playlists 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 (*Playlists) Update

func (pl *Playlists) Update() *PlaylistsUpdateOne

Update returns a builder for updating this Playlists. Note that you need to call Playlists.Unwrap() before calling this method if this Playlists was returned from a transaction, and the transaction was committed or rolled back.

func (*Playlists) Value

func (pl *Playlists) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Playlists. This includes values selected through modifiers, order, etc.

type PlaylistsClient

type PlaylistsClient struct {
	// contains filtered or unexported fields
}

PlaylistsClient is a client for the Playlists schema.

func NewPlaylistsClient

func NewPlaylistsClient(c config) *PlaylistsClient

NewPlaylistsClient returns a client for the Playlists from the given config.

func (*PlaylistsClient) Create

func (c *PlaylistsClient) Create() *PlaylistsCreate

Create returns a builder for creating a Playlists entity.

func (*PlaylistsClient) CreateBulk

func (c *PlaylistsClient) CreateBulk(builders ...*PlaylistsCreate) *PlaylistsCreateBulk

CreateBulk returns a builder for creating a bulk of Playlists entities.

func (*PlaylistsClient) Delete

func (c *PlaylistsClient) Delete() *PlaylistsDelete

Delete returns a delete builder for Playlists.

func (*PlaylistsClient) DeleteOne

func (c *PlaylistsClient) DeleteOne(pl *Playlists) *PlaylistsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PlaylistsClient) DeleteOneID

func (c *PlaylistsClient) DeleteOneID(id uint64) *PlaylistsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PlaylistsClient) Get

func (c *PlaylistsClient) Get(ctx context.Context, id uint64) (*Playlists, error)

Get returns a Playlists entity by its id.

func (*PlaylistsClient) GetX

func (c *PlaylistsClient) GetX(ctx context.Context, id uint64) *Playlists

GetX is like Get, but panics if an error occurs.

func (*PlaylistsClient) Hooks

func (c *PlaylistsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PlaylistsClient) Intercept

func (c *PlaylistsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `playlists.Intercept(f(g(h())))`.

func (*PlaylistsClient) Interceptors

func (c *PlaylistsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PlaylistsClient) MapCreateBulk

func (c *PlaylistsClient) MapCreateBulk(slice any, setFunc func(*PlaylistsCreate, int)) *PlaylistsCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PlaylistsClient) Query

func (c *PlaylistsClient) Query() *PlaylistsQuery

Query returns a query builder for Playlists.

func (*PlaylistsClient) QueryImage

func (c *PlaylistsClient) QueryImage(pl *Playlists) *ImagesQuery

QueryImage queries the image edge of a Playlists.

func (*PlaylistsClient) QueryMusics

func (c *PlaylistsClient) QueryMusics(pl *Playlists) *MusicsQuery

QueryMusics queries the musics edge of a Playlists.

func (*PlaylistsClient) QueryOwner

func (c *PlaylistsClient) QueryOwner(pl *Playlists) *UsersQuery

QueryOwner queries the owner edge of a Playlists.

func (*PlaylistsClient) Update

func (c *PlaylistsClient) Update() *PlaylistsUpdate

Update returns an update builder for Playlists.

func (*PlaylistsClient) UpdateOne

func (c *PlaylistsClient) UpdateOne(pl *Playlists) *PlaylistsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PlaylistsClient) UpdateOneID

func (c *PlaylistsClient) UpdateOneID(id uint64) *PlaylistsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PlaylistsClient) Use

func (c *PlaylistsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `playlists.Hooks(f(g(h())))`.

type PlaylistsCreate

type PlaylistsCreate struct {
	// contains filtered or unexported fields
}

PlaylistsCreate is the builder for creating a Playlists entity.

func (*PlaylistsCreate) AddMusicIDs

func (pc *PlaylistsCreate) AddMusicIDs(ids ...uint64) *PlaylistsCreate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*PlaylistsCreate) AddMusics

func (pc *PlaylistsCreate) AddMusics(m ...*Musics) *PlaylistsCreate

AddMusics adds the "musics" edges to the Musics entity.

func (*PlaylistsCreate) Exec

func (pc *PlaylistsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlaylistsCreate) ExecX

func (pc *PlaylistsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlaylistsCreate) Mutation

func (pc *PlaylistsCreate) Mutation() *PlaylistsMutation

Mutation returns the PlaylistsMutation object of the builder.

func (*PlaylistsCreate) Save

func (pc *PlaylistsCreate) Save(ctx context.Context) (*Playlists, error)

Save creates the Playlists in the database.

func (*PlaylistsCreate) SaveX

func (pc *PlaylistsCreate) SaveX(ctx context.Context) *Playlists

SaveX calls Save and panics if Save returns an error.

func (*PlaylistsCreate) SetCreateTime

func (pc *PlaylistsCreate) SetCreateTime(t time.Time) *PlaylistsCreate

SetCreateTime sets the "create_time" field.

func (*PlaylistsCreate) SetDescription

func (pc *PlaylistsCreate) SetDescription(s string) *PlaylistsCreate

SetDescription sets the "description" field.

func (*PlaylistsCreate) SetID

func (pc *PlaylistsCreate) SetID(u uint64) *PlaylistsCreate

SetID sets the "id" field.

func (*PlaylistsCreate) SetImage

func (pc *PlaylistsCreate) SetImage(i *Images) *PlaylistsCreate

SetImage sets the "image" edge to the Images entity.

func (*PlaylistsCreate) SetImageID

func (pc *PlaylistsCreate) SetImageID(id uint64) *PlaylistsCreate

SetImageID sets the "image" edge to the Images entity by ID.

func (*PlaylistsCreate) SetName

func (pc *PlaylistsCreate) SetName(s string) *PlaylistsCreate

SetName sets the "name" field.

func (*PlaylistsCreate) SetNillableCreateTime

func (pc *PlaylistsCreate) SetNillableCreateTime(t *time.Time) *PlaylistsCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*PlaylistsCreate) SetNillableDescription

func (pc *PlaylistsCreate) SetNillableDescription(s *string) *PlaylistsCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PlaylistsCreate) SetNillableImageID

func (pc *PlaylistsCreate) SetNillableImageID(id *uint64) *PlaylistsCreate

SetNillableImageID sets the "image" edge to the Images entity by ID if the given value is not nil.

func (*PlaylistsCreate) SetNillablePrivate

func (pc *PlaylistsCreate) SetNillablePrivate(b *bool) *PlaylistsCreate

SetNillablePrivate sets the "private" field if the given value is not nil.

func (*PlaylistsCreate) SetNillableUpdateTime

func (pc *PlaylistsCreate) SetNillableUpdateTime(t *time.Time) *PlaylistsCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*PlaylistsCreate) SetOwner

func (pc *PlaylistsCreate) SetOwner(u *Users) *PlaylistsCreate

SetOwner sets the "owner" edge to the Users entity.

func (*PlaylistsCreate) SetOwnerID

func (pc *PlaylistsCreate) SetOwnerID(id uint64) *PlaylistsCreate

SetOwnerID sets the "owner" edge to the Users entity by ID.

func (*PlaylistsCreate) SetPrivate

func (pc *PlaylistsCreate) SetPrivate(b bool) *PlaylistsCreate

SetPrivate sets the "private" field.

func (*PlaylistsCreate) SetUpdateTime

func (pc *PlaylistsCreate) SetUpdateTime(t time.Time) *PlaylistsCreate

SetUpdateTime sets the "update_time" field.

type PlaylistsCreateBulk

type PlaylistsCreateBulk struct {
	// contains filtered or unexported fields
}

PlaylistsCreateBulk is the builder for creating many Playlists entities in bulk.

func (*PlaylistsCreateBulk) Exec

func (pcb *PlaylistsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PlaylistsCreateBulk) ExecX

func (pcb *PlaylistsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlaylistsCreateBulk) Save

func (pcb *PlaylistsCreateBulk) Save(ctx context.Context) ([]*Playlists, error)

Save creates the Playlists entities in the database.

func (*PlaylistsCreateBulk) SaveX

func (pcb *PlaylistsCreateBulk) SaveX(ctx context.Context) []*Playlists

SaveX is like Save, but panics if an error occurs.

type PlaylistsDelete

type PlaylistsDelete struct {
	// contains filtered or unexported fields
}

PlaylistsDelete is the builder for deleting a Playlists entity.

func (*PlaylistsDelete) Exec

func (pd *PlaylistsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PlaylistsDelete) ExecX

func (pd *PlaylistsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PlaylistsDelete) Where

Where appends a list predicates to the PlaylistsDelete builder.

type PlaylistsDeleteOne

type PlaylistsDeleteOne struct {
	// contains filtered or unexported fields
}

PlaylistsDeleteOne is the builder for deleting a single Playlists entity.

func (*PlaylistsDeleteOne) Exec

func (pdo *PlaylistsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PlaylistsDeleteOne) ExecX

func (pdo *PlaylistsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlaylistsDeleteOne) Where

Where appends a list predicates to the PlaylistsDelete builder.

type PlaylistsEdges

type PlaylistsEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Users `json:"owner,omitempty"`
	// Musics holds the value of the musics edge.
	Musics []*Musics `json:"musics,omitempty"`
	// Image holds the value of the image edge.
	Image *Images `json:"image,omitempty"`
	// contains filtered or unexported fields
}

PlaylistsEdges holds the relations/edges for other nodes in the graph.

func (PlaylistsEdges) ImageOrErr

func (e PlaylistsEdges) ImageOrErr() (*Images, error)

ImageOrErr returns the Image value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PlaylistsEdges) MusicsOrErr

func (e PlaylistsEdges) MusicsOrErr() ([]*Musics, error)

MusicsOrErr returns the Musics value or an error if the edge was not loaded in eager-loading.

func (PlaylistsEdges) OwnerOrErr

func (e PlaylistsEdges) OwnerOrErr() (*Users, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type PlaylistsGroupBy

type PlaylistsGroupBy struct {
	// contains filtered or unexported fields
}

PlaylistsGroupBy is the group-by builder for Playlists entities.

func (*PlaylistsGroupBy) Aggregate

func (pgb *PlaylistsGroupBy) Aggregate(fns ...AggregateFunc) *PlaylistsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PlaylistsGroupBy) Bool

func (s *PlaylistsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) BoolX

func (s *PlaylistsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PlaylistsGroupBy) Bools

func (s *PlaylistsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) BoolsX

func (s *PlaylistsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PlaylistsGroupBy) Float64

func (s *PlaylistsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) Float64X

func (s *PlaylistsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PlaylistsGroupBy) Float64s

func (s *PlaylistsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) Float64sX

func (s *PlaylistsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PlaylistsGroupBy) Int

func (s *PlaylistsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) IntX

func (s *PlaylistsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PlaylistsGroupBy) Ints

func (s *PlaylistsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) IntsX

func (s *PlaylistsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PlaylistsGroupBy) Scan

func (pgb *PlaylistsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PlaylistsGroupBy) ScanX

func (s *PlaylistsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PlaylistsGroupBy) String

func (s *PlaylistsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) StringX

func (s *PlaylistsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PlaylistsGroupBy) Strings

func (s *PlaylistsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PlaylistsGroupBy) StringsX

func (s *PlaylistsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PlaylistsMutation

type PlaylistsMutation struct {
	// contains filtered or unexported fields
}

PlaylistsMutation represents an operation that mutates the Playlists nodes in the graph.

func (*PlaylistsMutation) AddField

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) AddMusicIDs

func (m *PlaylistsMutation) AddMusicIDs(ids ...uint64)

AddMusicIDs adds the "musics" edge to the Musics entity by ids.

func (*PlaylistsMutation) AddedEdges

func (m *PlaylistsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PlaylistsMutation) AddedField

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) AddedFields

func (m *PlaylistsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PlaylistsMutation) AddedIDs

func (m *PlaylistsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PlaylistsMutation) ClearDescription

func (m *PlaylistsMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*PlaylistsMutation) ClearEdge

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) ClearField

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) ClearImage

func (m *PlaylistsMutation) ClearImage()

ClearImage clears the "image" edge to the Images entity.

func (*PlaylistsMutation) ClearMusics

func (m *PlaylistsMutation) ClearMusics()

ClearMusics clears the "musics" edge to the Musics entity.

func (*PlaylistsMutation) ClearOwner

func (m *PlaylistsMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Users entity.

func (*PlaylistsMutation) ClearedEdges

func (m *PlaylistsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PlaylistsMutation) ClearedFields

func (m *PlaylistsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PlaylistsMutation) Client

func (m PlaylistsMutation) 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 (*PlaylistsMutation) CreateTime

func (m *PlaylistsMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*PlaylistsMutation) Description

func (m *PlaylistsMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*PlaylistsMutation) DescriptionCleared

func (m *PlaylistsMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*PlaylistsMutation) EdgeCleared

func (m *PlaylistsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PlaylistsMutation) Field

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) FieldCleared

func (m *PlaylistsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PlaylistsMutation) Fields

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) ID

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) IDs

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) ImageCleared

func (m *PlaylistsMutation) ImageCleared() bool

ImageCleared reports if the "image" edge to the Images entity was cleared.

func (*PlaylistsMutation) ImageID

func (m *PlaylistsMutation) ImageID() (id uint64, exists bool)

ImageID returns the "image" edge ID in the mutation.

func (*PlaylistsMutation) ImageIDs

func (m *PlaylistsMutation) ImageIDs() (ids []uint64)

ImageIDs returns the "image" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ImageID instead. It exists only for internal usage by the builders.

func (*PlaylistsMutation) MusicsCleared

func (m *PlaylistsMutation) MusicsCleared() bool

MusicsCleared reports if the "musics" edge to the Musics entity was cleared.

func (*PlaylistsMutation) MusicsIDs

func (m *PlaylistsMutation) MusicsIDs() (ids []uint64)

MusicsIDs returns the "musics" edge IDs in the mutation.

func (*PlaylistsMutation) Name

func (m *PlaylistsMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PlaylistsMutation) OldCreateTime

func (m *PlaylistsMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Playlists entity. If the Playlists 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 (*PlaylistsMutation) OldDescription

func (m *PlaylistsMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Playlists entity. If the Playlists 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 (*PlaylistsMutation) OldField

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) OldName

func (m *PlaylistsMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Playlists entity. If the Playlists 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 (*PlaylistsMutation) OldPrivate

func (m *PlaylistsMutation) OldPrivate(ctx context.Context) (v bool, err error)

OldPrivate returns the old "private" field's value of the Playlists entity. If the Playlists 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 (*PlaylistsMutation) OldUpdateTime

func (m *PlaylistsMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Playlists entity. If the Playlists 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 (*PlaylistsMutation) Op

func (m *PlaylistsMutation) Op() Op

Op returns the operation name.

func (*PlaylistsMutation) OwnerCleared

func (m *PlaylistsMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Users entity was cleared.

func (*PlaylistsMutation) OwnerID

func (m *PlaylistsMutation) OwnerID() (id uint64, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*PlaylistsMutation) OwnerIDs

func (m *PlaylistsMutation) OwnerIDs() (ids []uint64)

OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*PlaylistsMutation) Private

func (m *PlaylistsMutation) Private() (r bool, exists bool)

Private returns the value of the "private" field in the mutation.

func (*PlaylistsMutation) RemoveMusicIDs

func (m *PlaylistsMutation) RemoveMusicIDs(ids ...uint64)

RemoveMusicIDs removes the "musics" edge to the Musics entity by IDs.

func (*PlaylistsMutation) RemovedEdges

func (m *PlaylistsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PlaylistsMutation) RemovedIDs

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) RemovedMusicsIDs

func (m *PlaylistsMutation) RemovedMusicsIDs() (ids []uint64)

RemovedMusics returns the removed IDs of the "musics" edge to the Musics entity.

func (*PlaylistsMutation) ResetCreateTime

func (m *PlaylistsMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*PlaylistsMutation) ResetDescription

func (m *PlaylistsMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*PlaylistsMutation) ResetEdge

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) ResetField

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) ResetImage

func (m *PlaylistsMutation) ResetImage()

ResetImage resets all changes to the "image" edge.

func (*PlaylistsMutation) ResetMusics

func (m *PlaylistsMutation) ResetMusics()

ResetMusics resets all changes to the "musics" edge.

func (*PlaylistsMutation) ResetName

func (m *PlaylistsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PlaylistsMutation) ResetOwner

func (m *PlaylistsMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*PlaylistsMutation) ResetPrivate

func (m *PlaylistsMutation) ResetPrivate()

ResetPrivate resets all changes to the "private" field.

func (*PlaylistsMutation) ResetUpdateTime

func (m *PlaylistsMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*PlaylistsMutation) SetCreateTime

func (m *PlaylistsMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*PlaylistsMutation) SetDescription

func (m *PlaylistsMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*PlaylistsMutation) SetField

func (m *PlaylistsMutation) 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 (*PlaylistsMutation) SetID

func (m *PlaylistsMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Playlists entities.

func (*PlaylistsMutation) SetImageID

func (m *PlaylistsMutation) SetImageID(id uint64)

SetImageID sets the "image" edge to the Images entity by id.

func (*PlaylistsMutation) SetName

func (m *PlaylistsMutation) SetName(s string)

SetName sets the "name" field.

func (*PlaylistsMutation) SetOp

func (m *PlaylistsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PlaylistsMutation) SetOwnerID

func (m *PlaylistsMutation) SetOwnerID(id uint64)

SetOwnerID sets the "owner" edge to the Users entity by id.

func (*PlaylistsMutation) SetPrivate

func (m *PlaylistsMutation) SetPrivate(b bool)

SetPrivate sets the "private" field.

func (*PlaylistsMutation) SetUpdateTime

func (m *PlaylistsMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (PlaylistsMutation) Tx

func (m PlaylistsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PlaylistsMutation) Type

func (m *PlaylistsMutation) Type() string

Type returns the node type of this mutation (Playlists).

func (*PlaylistsMutation) UpdateTime

func (m *PlaylistsMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*PlaylistsMutation) Where

func (m *PlaylistsMutation) Where(ps ...predicate.Playlists)

Where appends a list predicates to the PlaylistsMutation builder.

func (*PlaylistsMutation) WhereP

func (m *PlaylistsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PlaylistsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PlaylistsQuery

type PlaylistsQuery struct {
	// contains filtered or unexported fields
}

PlaylistsQuery is the builder for querying Playlists entities.

func (*PlaylistsQuery) Aggregate

func (pq *PlaylistsQuery) Aggregate(fns ...AggregateFunc) *PlaylistsSelect

Aggregate returns a PlaylistsSelect configured with the given aggregations.

func (*PlaylistsQuery) All

func (pq *PlaylistsQuery) All(ctx context.Context) ([]*Playlists, error)

All executes the query and returns a list of PlaylistsSlice.

func (*PlaylistsQuery) AllX

func (pq *PlaylistsQuery) AllX(ctx context.Context) []*Playlists

AllX is like All, but panics if an error occurs.

func (*PlaylistsQuery) Clone

func (pq *PlaylistsQuery) Clone() *PlaylistsQuery

Clone returns a duplicate of the PlaylistsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PlaylistsQuery) Count

func (pq *PlaylistsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PlaylistsQuery) CountX

func (pq *PlaylistsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PlaylistsQuery) Exist

func (pq *PlaylistsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PlaylistsQuery) ExistX

func (pq *PlaylistsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PlaylistsQuery) First

func (pq *PlaylistsQuery) First(ctx context.Context) (*Playlists, error)

First returns the first Playlists entity from the query. Returns a *NotFoundError when no Playlists was found.

func (*PlaylistsQuery) FirstID

func (pq *PlaylistsQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Playlists ID from the query. Returns a *NotFoundError when no Playlists ID was found.

func (*PlaylistsQuery) FirstIDX

func (pq *PlaylistsQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*PlaylistsQuery) FirstX

func (pq *PlaylistsQuery) FirstX(ctx context.Context) *Playlists

FirstX is like First, but panics if an error occurs.

func (*PlaylistsQuery) GroupBy

func (pq *PlaylistsQuery) GroupBy(field string, fields ...string) *PlaylistsGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Playlists.Query().
	GroupBy(playlists.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PlaylistsQuery) IDs

func (pq *PlaylistsQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Playlists IDs.

func (*PlaylistsQuery) IDsX

func (pq *PlaylistsQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*PlaylistsQuery) Limit

func (pq *PlaylistsQuery) Limit(limit int) *PlaylistsQuery

Limit the number of records to be returned by this query.

func (*PlaylistsQuery) Offset

func (pq *PlaylistsQuery) Offset(offset int) *PlaylistsQuery

Offset to start from.

func (*PlaylistsQuery) Only

func (pq *PlaylistsQuery) Only(ctx context.Context) (*Playlists, error)

Only returns a single Playlists entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Playlists entity is found. Returns a *NotFoundError when no Playlists entities are found.

func (*PlaylistsQuery) OnlyID

func (pq *PlaylistsQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Playlists ID in the query. Returns a *NotSingularError when more than one Playlists ID is found. Returns a *NotFoundError when no entities are found.

func (*PlaylistsQuery) OnlyIDX

func (pq *PlaylistsQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PlaylistsQuery) OnlyX

func (pq *PlaylistsQuery) OnlyX(ctx context.Context) *Playlists

OnlyX is like Only, but panics if an error occurs.

func (*PlaylistsQuery) Order

Order specifies how the records should be ordered.

func (*PlaylistsQuery) QueryImage

func (pq *PlaylistsQuery) QueryImage() *ImagesQuery

QueryImage chains the current query on the "image" edge.

func (*PlaylistsQuery) QueryMusics

func (pq *PlaylistsQuery) QueryMusics() *MusicsQuery

QueryMusics chains the current query on the "musics" edge.

func (*PlaylistsQuery) QueryOwner

func (pq *PlaylistsQuery) QueryOwner() *UsersQuery

QueryOwner chains the current query on the "owner" edge.

func (*PlaylistsQuery) Select

func (pq *PlaylistsQuery) Select(fields ...string) *PlaylistsSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Playlists.Query().
	Select(playlists.FieldCreateTime).
	Scan(ctx, &v)

func (*PlaylistsQuery) Unique

func (pq *PlaylistsQuery) Unique(unique bool) *PlaylistsQuery

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 (*PlaylistsQuery) Where

Where adds a new predicate for the PlaylistsQuery builder.

func (*PlaylistsQuery) WithImage

func (pq *PlaylistsQuery) WithImage(opts ...func(*ImagesQuery)) *PlaylistsQuery

WithImage tells the query-builder to eager-load the nodes that are connected to the "image" edge. The optional arguments are used to configure the query builder of the edge.

func (*PlaylistsQuery) WithMusics

func (pq *PlaylistsQuery) WithMusics(opts ...func(*MusicsQuery)) *PlaylistsQuery

WithMusics tells the query-builder to eager-load the nodes that are connected to the "musics" edge. The optional arguments are used to configure the query builder of the edge.

func (*PlaylistsQuery) WithOwner

func (pq *PlaylistsQuery) WithOwner(opts ...func(*UsersQuery)) *PlaylistsQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

type PlaylistsSelect

type PlaylistsSelect struct {
	*PlaylistsQuery
	// contains filtered or unexported fields
}

PlaylistsSelect is the builder for selecting fields of Playlists entities.

func (*PlaylistsSelect) Aggregate

func (ps *PlaylistsSelect) Aggregate(fns ...AggregateFunc) *PlaylistsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PlaylistsSelect) Bool

func (s *PlaylistsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) BoolX

func (s *PlaylistsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PlaylistsSelect) Bools

func (s *PlaylistsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) BoolsX

func (s *PlaylistsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PlaylistsSelect) Float64

func (s *PlaylistsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) Float64X

func (s *PlaylistsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PlaylistsSelect) Float64s

func (s *PlaylistsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) Float64sX

func (s *PlaylistsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PlaylistsSelect) Int

func (s *PlaylistsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) IntX

func (s *PlaylistsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PlaylistsSelect) Ints

func (s *PlaylistsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) IntsX

func (s *PlaylistsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PlaylistsSelect) Scan

func (ps *PlaylistsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PlaylistsSelect) ScanX

func (s *PlaylistsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PlaylistsSelect) String

func (s *PlaylistsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) StringX

func (s *PlaylistsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PlaylistsSelect) Strings

func (s *PlaylistsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PlaylistsSelect) StringsX

func (s *PlaylistsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PlaylistsSlice

type PlaylistsSlice []*Playlists

PlaylistsSlice is a parsable slice of Playlists.

type PlaylistsUpdate

type PlaylistsUpdate struct {
	// contains filtered or unexported fields
}

PlaylistsUpdate is the builder for updating Playlists entities.

func (*PlaylistsUpdate) AddMusicIDs

func (pu *PlaylistsUpdate) AddMusicIDs(ids ...uint64) *PlaylistsUpdate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*PlaylistsUpdate) AddMusics

func (pu *PlaylistsUpdate) AddMusics(m ...*Musics) *PlaylistsUpdate

AddMusics adds the "musics" edges to the Musics entity.

func (*PlaylistsUpdate) ClearDescription

func (pu *PlaylistsUpdate) ClearDescription() *PlaylistsUpdate

ClearDescription clears the value of the "description" field.

func (*PlaylistsUpdate) ClearImage

func (pu *PlaylistsUpdate) ClearImage() *PlaylistsUpdate

ClearImage clears the "image" edge to the Images entity.

func (*PlaylistsUpdate) ClearMusics

func (pu *PlaylistsUpdate) ClearMusics() *PlaylistsUpdate

ClearMusics clears all "musics" edges to the Musics entity.

func (*PlaylistsUpdate) ClearOwner

func (pu *PlaylistsUpdate) ClearOwner() *PlaylistsUpdate

ClearOwner clears the "owner" edge to the Users entity.

func (*PlaylistsUpdate) Exec

func (pu *PlaylistsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PlaylistsUpdate) ExecX

func (pu *PlaylistsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlaylistsUpdate) Mutation

func (pu *PlaylistsUpdate) Mutation() *PlaylistsMutation

Mutation returns the PlaylistsMutation object of the builder.

func (*PlaylistsUpdate) RemoveMusicIDs

func (pu *PlaylistsUpdate) RemoveMusicIDs(ids ...uint64) *PlaylistsUpdate

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*PlaylistsUpdate) RemoveMusics

func (pu *PlaylistsUpdate) RemoveMusics(m ...*Musics) *PlaylistsUpdate

RemoveMusics removes "musics" edges to Musics entities.

func (*PlaylistsUpdate) Save

func (pu *PlaylistsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PlaylistsUpdate) SaveX

func (pu *PlaylistsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PlaylistsUpdate) SetDescription

func (pu *PlaylistsUpdate) SetDescription(s string) *PlaylistsUpdate

SetDescription sets the "description" field.

func (*PlaylistsUpdate) SetImage

func (pu *PlaylistsUpdate) SetImage(i *Images) *PlaylistsUpdate

SetImage sets the "image" edge to the Images entity.

func (*PlaylistsUpdate) SetImageID

func (pu *PlaylistsUpdate) SetImageID(id uint64) *PlaylistsUpdate

SetImageID sets the "image" edge to the Images entity by ID.

func (*PlaylistsUpdate) SetName

func (pu *PlaylistsUpdate) SetName(s string) *PlaylistsUpdate

SetName sets the "name" field.

func (*PlaylistsUpdate) SetNillableDescription

func (pu *PlaylistsUpdate) SetNillableDescription(s *string) *PlaylistsUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PlaylistsUpdate) SetNillableImageID

func (pu *PlaylistsUpdate) SetNillableImageID(id *uint64) *PlaylistsUpdate

SetNillableImageID sets the "image" edge to the Images entity by ID if the given value is not nil.

func (*PlaylistsUpdate) SetNillableName

func (pu *PlaylistsUpdate) SetNillableName(s *string) *PlaylistsUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PlaylistsUpdate) SetNillablePrivate

func (pu *PlaylistsUpdate) SetNillablePrivate(b *bool) *PlaylistsUpdate

SetNillablePrivate sets the "private" field if the given value is not nil.

func (*PlaylistsUpdate) SetOwner

func (pu *PlaylistsUpdate) SetOwner(u *Users) *PlaylistsUpdate

SetOwner sets the "owner" edge to the Users entity.

func (*PlaylistsUpdate) SetOwnerID

func (pu *PlaylistsUpdate) SetOwnerID(id uint64) *PlaylistsUpdate

SetOwnerID sets the "owner" edge to the Users entity by ID.

func (*PlaylistsUpdate) SetPrivate

func (pu *PlaylistsUpdate) SetPrivate(b bool) *PlaylistsUpdate

SetPrivate sets the "private" field.

func (*PlaylistsUpdate) SetUpdateTime

func (pu *PlaylistsUpdate) SetUpdateTime(t time.Time) *PlaylistsUpdate

SetUpdateTime sets the "update_time" field.

func (*PlaylistsUpdate) Where

Where appends a list predicates to the PlaylistsUpdate builder.

type PlaylistsUpdateOne

type PlaylistsUpdateOne struct {
	// contains filtered or unexported fields
}

PlaylistsUpdateOne is the builder for updating a single Playlists entity.

func (*PlaylistsUpdateOne) AddMusicIDs

func (puo *PlaylistsUpdateOne) AddMusicIDs(ids ...uint64) *PlaylistsUpdateOne

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*PlaylistsUpdateOne) AddMusics

func (puo *PlaylistsUpdateOne) AddMusics(m ...*Musics) *PlaylistsUpdateOne

AddMusics adds the "musics" edges to the Musics entity.

func (*PlaylistsUpdateOne) ClearDescription

func (puo *PlaylistsUpdateOne) ClearDescription() *PlaylistsUpdateOne

ClearDescription clears the value of the "description" field.

func (*PlaylistsUpdateOne) ClearImage

func (puo *PlaylistsUpdateOne) ClearImage() *PlaylistsUpdateOne

ClearImage clears the "image" edge to the Images entity.

func (*PlaylistsUpdateOne) ClearMusics

func (puo *PlaylistsUpdateOne) ClearMusics() *PlaylistsUpdateOne

ClearMusics clears all "musics" edges to the Musics entity.

func (*PlaylistsUpdateOne) ClearOwner

func (puo *PlaylistsUpdateOne) ClearOwner() *PlaylistsUpdateOne

ClearOwner clears the "owner" edge to the Users entity.

func (*PlaylistsUpdateOne) Exec

func (puo *PlaylistsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PlaylistsUpdateOne) ExecX

func (puo *PlaylistsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PlaylistsUpdateOne) Mutation

func (puo *PlaylistsUpdateOne) Mutation() *PlaylistsMutation

Mutation returns the PlaylistsMutation object of the builder.

func (*PlaylistsUpdateOne) RemoveMusicIDs

func (puo *PlaylistsUpdateOne) RemoveMusicIDs(ids ...uint64) *PlaylistsUpdateOne

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*PlaylistsUpdateOne) RemoveMusics

func (puo *PlaylistsUpdateOne) RemoveMusics(m ...*Musics) *PlaylistsUpdateOne

RemoveMusics removes "musics" edges to Musics entities.

func (*PlaylistsUpdateOne) Save

func (puo *PlaylistsUpdateOne) Save(ctx context.Context) (*Playlists, error)

Save executes the query and returns the updated Playlists entity.

func (*PlaylistsUpdateOne) SaveX

func (puo *PlaylistsUpdateOne) SaveX(ctx context.Context) *Playlists

SaveX is like Save, but panics if an error occurs.

func (*PlaylistsUpdateOne) Select

func (puo *PlaylistsUpdateOne) Select(field string, fields ...string) *PlaylistsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PlaylistsUpdateOne) SetDescription

func (puo *PlaylistsUpdateOne) SetDescription(s string) *PlaylistsUpdateOne

SetDescription sets the "description" field.

func (*PlaylistsUpdateOne) SetImage

func (puo *PlaylistsUpdateOne) SetImage(i *Images) *PlaylistsUpdateOne

SetImage sets the "image" edge to the Images entity.

func (*PlaylistsUpdateOne) SetImageID

func (puo *PlaylistsUpdateOne) SetImageID(id uint64) *PlaylistsUpdateOne

SetImageID sets the "image" edge to the Images entity by ID.

func (*PlaylistsUpdateOne) SetName

func (puo *PlaylistsUpdateOne) SetName(s string) *PlaylistsUpdateOne

SetName sets the "name" field.

func (*PlaylistsUpdateOne) SetNillableDescription

func (puo *PlaylistsUpdateOne) SetNillableDescription(s *string) *PlaylistsUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*PlaylistsUpdateOne) SetNillableImageID

func (puo *PlaylistsUpdateOne) SetNillableImageID(id *uint64) *PlaylistsUpdateOne

SetNillableImageID sets the "image" edge to the Images entity by ID if the given value is not nil.

func (*PlaylistsUpdateOne) SetNillableName

func (puo *PlaylistsUpdateOne) SetNillableName(s *string) *PlaylistsUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PlaylistsUpdateOne) SetNillablePrivate

func (puo *PlaylistsUpdateOne) SetNillablePrivate(b *bool) *PlaylistsUpdateOne

SetNillablePrivate sets the "private" field if the given value is not nil.

func (*PlaylistsUpdateOne) SetOwner

func (puo *PlaylistsUpdateOne) SetOwner(u *Users) *PlaylistsUpdateOne

SetOwner sets the "owner" edge to the Users entity.

func (*PlaylistsUpdateOne) SetOwnerID

func (puo *PlaylistsUpdateOne) SetOwnerID(id uint64) *PlaylistsUpdateOne

SetOwnerID sets the "owner" edge to the Users entity by ID.

func (*PlaylistsUpdateOne) SetPrivate

func (puo *PlaylistsUpdateOne) SetPrivate(b bool) *PlaylistsUpdateOne

SetPrivate sets the "private" field.

func (*PlaylistsUpdateOne) SetUpdateTime

func (puo *PlaylistsUpdateOne) SetUpdateTime(t time.Time) *PlaylistsUpdateOne

SetUpdateTime sets the "update_time" field.

func (*PlaylistsUpdateOne) Where

Where appends a list predicates to the PlaylistsUpdate builder.

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 {

	// Actors is the client for interacting with the Actors builders.
	Actors *ActorsClient
	// Albums is the client for interacting with the Albums builders.
	Albums *AlbumsClient
	// Artists is the client for interacting with the Artists builders.
	Artists *ArtistsClient
	// Audiobooks is the client for interacting with the Audiobooks builders.
	Audiobooks *AudiobooksClient
	// Categorys is the client for interacting with the Categorys builders.
	Categorys *CategorysClient
	// Devices is the client for interacting with the Devices builders.
	Devices *DevicesClient
	// Directors is the client for interacting with the Directors builders.
	Directors *DirectorsClient
	// Files is the client for interacting with the Files builders.
	Files *FilesClient
	// Images is the client for interacting with the Images builders.
	Images *ImagesClient
	// Musics is the client for interacting with the Musics builders.
	Musics *MusicsClient
	// Oidc is the client for interacting with the Oidc builders.
	Oidc *OidcClient
	// Playlists is the client for interacting with the Playlists builders.
	Playlists *PlaylistsClient
	// Users is the client for interacting with the Users builders.
	Users *UsersClient
	// Videos is the client for interacting with the Videos builders.
	Videos *VideosClient
	// 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 Users

type Users struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Bio holds the value of the "bio" field.
	Bio string `json:"bio,omitempty"`
	// Avatar holds the value of the "avatar" field.
	Avatar string `json:"avatar,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UsersQuery when eager-loading is set.
	Edges UsersEdges `json:"edges"`
	// contains filtered or unexported fields
}

Users is the model entity for the Users schema.

func (*Users) QueryAlbums

func (u *Users) QueryAlbums() *AlbumsQuery

QueryAlbums queries the "albums" edge of the Users entity.

func (*Users) QueryDevices

func (u *Users) QueryDevices() *DevicesQuery

QueryDevices queries the "devices" edge of the Users entity.

func (*Users) QueryMusics

func (u *Users) QueryMusics() *MusicsQuery

QueryMusics queries the "musics" edge of the Users entity.

func (*Users) QueryPlaylists

func (u *Users) QueryPlaylists() *PlaylistsQuery

QueryPlaylists queries the "playlists" edge of the Users entity.

func (*Users) String

func (u *Users) String() string

String implements the fmt.Stringer.

func (*Users) Unwrap

func (u *Users) Unwrap() *Users

Unwrap unwraps the Users 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 (*Users) Update

func (u *Users) Update() *UsersUpdateOne

Update returns a builder for updating this Users. Note that you need to call Users.Unwrap() before calling this method if this Users was returned from a transaction, and the transaction was committed or rolled back.

func (*Users) Value

func (u *Users) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Users. This includes values selected through modifiers, order, etc.

type UsersClient

type UsersClient struct {
	// contains filtered or unexported fields
}

UsersClient is a client for the Users schema.

func NewUsersClient

func NewUsersClient(c config) *UsersClient

NewUsersClient returns a client for the Users from the given config.

func (*UsersClient) Create

func (c *UsersClient) Create() *UsersCreate

Create returns a builder for creating a Users entity.

func (*UsersClient) CreateBulk

func (c *UsersClient) CreateBulk(builders ...*UsersCreate) *UsersCreateBulk

CreateBulk returns a builder for creating a bulk of Users entities.

func (*UsersClient) Delete

func (c *UsersClient) Delete() *UsersDelete

Delete returns a delete builder for Users.

func (*UsersClient) DeleteOne

func (c *UsersClient) DeleteOne(u *Users) *UsersDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UsersClient) DeleteOneID

func (c *UsersClient) DeleteOneID(id uint64) *UsersDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UsersClient) Get

func (c *UsersClient) Get(ctx context.Context, id uint64) (*Users, error)

Get returns a Users entity by its id.

func (*UsersClient) GetX

func (c *UsersClient) GetX(ctx context.Context, id uint64) *Users

GetX is like Get, but panics if an error occurs.

func (*UsersClient) Hooks

func (c *UsersClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UsersClient) Intercept

func (c *UsersClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `users.Intercept(f(g(h())))`.

func (*UsersClient) Interceptors

func (c *UsersClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UsersClient) MapCreateBulk

func (c *UsersClient) MapCreateBulk(slice any, setFunc func(*UsersCreate, int)) *UsersCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UsersClient) Query

func (c *UsersClient) Query() *UsersQuery

Query returns a query builder for Users.

func (*UsersClient) QueryAlbums

func (c *UsersClient) QueryAlbums(u *Users) *AlbumsQuery

QueryAlbums queries the albums edge of a Users.

func (*UsersClient) QueryDevices

func (c *UsersClient) QueryDevices(u *Users) *DevicesQuery

QueryDevices queries the devices edge of a Users.

func (*UsersClient) QueryMusics

func (c *UsersClient) QueryMusics(u *Users) *MusicsQuery

QueryMusics queries the musics edge of a Users.

func (*UsersClient) QueryPlaylists

func (c *UsersClient) QueryPlaylists(u *Users) *PlaylistsQuery

QueryPlaylists queries the playlists edge of a Users.

func (*UsersClient) Update

func (c *UsersClient) Update() *UsersUpdate

Update returns an update builder for Users.

func (*UsersClient) UpdateOne

func (c *UsersClient) UpdateOne(u *Users) *UsersUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UsersClient) UpdateOneID

func (c *UsersClient) UpdateOneID(id uint64) *UsersUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UsersClient) Use

func (c *UsersClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `users.Hooks(f(g(h())))`.

type UsersCreate

type UsersCreate struct {
	// contains filtered or unexported fields
}

UsersCreate is the builder for creating a Users entity.

func (*UsersCreate) AddAlbumIDs

func (uc *UsersCreate) AddAlbumIDs(ids ...uint64) *UsersCreate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*UsersCreate) AddAlbums

func (uc *UsersCreate) AddAlbums(a ...*Albums) *UsersCreate

AddAlbums adds the "albums" edges to the Albums entity.

func (*UsersCreate) AddDeviceIDs

func (uc *UsersCreate) AddDeviceIDs(ids ...uint64) *UsersCreate

AddDeviceIDs adds the "devices" edge to the Devices entity by IDs.

func (*UsersCreate) AddDevices

func (uc *UsersCreate) AddDevices(d ...*Devices) *UsersCreate

AddDevices adds the "devices" edges to the Devices entity.

func (*UsersCreate) AddMusicIDs

func (uc *UsersCreate) AddMusicIDs(ids ...uint64) *UsersCreate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*UsersCreate) AddMusics

func (uc *UsersCreate) AddMusics(m ...*Musics) *UsersCreate

AddMusics adds the "musics" edges to the Musics entity.

func (*UsersCreate) AddPlaylistIDs

func (uc *UsersCreate) AddPlaylistIDs(ids ...uint64) *UsersCreate

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*UsersCreate) AddPlaylists

func (uc *UsersCreate) AddPlaylists(p ...*Playlists) *UsersCreate

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*UsersCreate) Exec

func (uc *UsersCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UsersCreate) ExecX

func (uc *UsersCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersCreate) Mutation

func (uc *UsersCreate) Mutation() *UsersMutation

Mutation returns the UsersMutation object of the builder.

func (*UsersCreate) Save

func (uc *UsersCreate) Save(ctx context.Context) (*Users, error)

Save creates the Users in the database.

func (*UsersCreate) SaveX

func (uc *UsersCreate) SaveX(ctx context.Context) *Users

SaveX calls Save and panics if Save returns an error.

func (*UsersCreate) SetAvatar

func (uc *UsersCreate) SetAvatar(s string) *UsersCreate

SetAvatar sets the "avatar" field.

func (*UsersCreate) SetBio

func (uc *UsersCreate) SetBio(s string) *UsersCreate

SetBio sets the "bio" field.

func (*UsersCreate) SetCreateTime

func (uc *UsersCreate) SetCreateTime(t time.Time) *UsersCreate

SetCreateTime sets the "create_time" field.

func (*UsersCreate) SetEmail

func (uc *UsersCreate) SetEmail(s string) *UsersCreate

SetEmail sets the "email" field.

func (*UsersCreate) SetID

func (uc *UsersCreate) SetID(u uint64) *UsersCreate

SetID sets the "id" field.

func (*UsersCreate) SetName

func (uc *UsersCreate) SetName(s string) *UsersCreate

SetName sets the "name" field.

func (*UsersCreate) SetNillableAvatar

func (uc *UsersCreate) SetNillableAvatar(s *string) *UsersCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UsersCreate) SetNillableBio

func (uc *UsersCreate) SetNillableBio(s *string) *UsersCreate

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UsersCreate) SetNillableCreateTime

func (uc *UsersCreate) SetNillableCreateTime(t *time.Time) *UsersCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UsersCreate) SetNillableEmail

func (uc *UsersCreate) SetNillableEmail(s *string) *UsersCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UsersCreate) SetNillableName

func (uc *UsersCreate) SetNillableName(s *string) *UsersCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*UsersCreate) SetNillablePassword

func (uc *UsersCreate) SetNillablePassword(s *string) *UsersCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UsersCreate) SetNillableUpdateTime

func (uc *UsersCreate) SetNillableUpdateTime(t *time.Time) *UsersCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UsersCreate) SetPassword

func (uc *UsersCreate) SetPassword(s string) *UsersCreate

SetPassword sets the "password" field.

func (*UsersCreate) SetUpdateTime

func (uc *UsersCreate) SetUpdateTime(t time.Time) *UsersCreate

SetUpdateTime sets the "update_time" field.

func (*UsersCreate) SetUsername

func (uc *UsersCreate) SetUsername(s string) *UsersCreate

SetUsername sets the "username" field.

type UsersCreateBulk

type UsersCreateBulk struct {
	// contains filtered or unexported fields
}

UsersCreateBulk is the builder for creating many Users entities in bulk.

func (*UsersCreateBulk) Exec

func (ucb *UsersCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UsersCreateBulk) ExecX

func (ucb *UsersCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersCreateBulk) Save

func (ucb *UsersCreateBulk) Save(ctx context.Context) ([]*Users, error)

Save creates the Users entities in the database.

func (*UsersCreateBulk) SaveX

func (ucb *UsersCreateBulk) SaveX(ctx context.Context) []*Users

SaveX is like Save, but panics if an error occurs.

type UsersDelete

type UsersDelete struct {
	// contains filtered or unexported fields
}

UsersDelete is the builder for deleting a Users entity.

func (*UsersDelete) Exec

func (ud *UsersDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UsersDelete) ExecX

func (ud *UsersDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UsersDelete) Where

func (ud *UsersDelete) Where(ps ...predicate.Users) *UsersDelete

Where appends a list predicates to the UsersDelete builder.

type UsersDeleteOne

type UsersDeleteOne struct {
	// contains filtered or unexported fields
}

UsersDeleteOne is the builder for deleting a single Users entity.

func (*UsersDeleteOne) Exec

func (udo *UsersDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UsersDeleteOne) ExecX

func (udo *UsersDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersDeleteOne) Where

func (udo *UsersDeleteOne) Where(ps ...predicate.Users) *UsersDeleteOne

Where appends a list predicates to the UsersDelete builder.

type UsersEdges

type UsersEdges struct {
	// Devices holds the value of the devices edge.
	Devices []*Devices `json:"devices,omitempty"`
	// Playlists holds the value of the playlists edge.
	Playlists []*Playlists `json:"playlists,omitempty"`
	// Albums holds the value of the albums edge.
	Albums []*Albums `json:"albums,omitempty"`
	// Musics holds the value of the musics edge.
	Musics []*Musics `json:"musics,omitempty"`
	// contains filtered or unexported fields
}

UsersEdges holds the relations/edges for other nodes in the graph.

func (UsersEdges) AlbumsOrErr

func (e UsersEdges) AlbumsOrErr() ([]*Albums, error)

AlbumsOrErr returns the Albums value or an error if the edge was not loaded in eager-loading.

func (UsersEdges) DevicesOrErr

func (e UsersEdges) DevicesOrErr() ([]*Devices, error)

DevicesOrErr returns the Devices value or an error if the edge was not loaded in eager-loading.

func (UsersEdges) MusicsOrErr

func (e UsersEdges) MusicsOrErr() ([]*Musics, error)

MusicsOrErr returns the Musics value or an error if the edge was not loaded in eager-loading.

func (UsersEdges) PlaylistsOrErr

func (e UsersEdges) PlaylistsOrErr() ([]*Playlists, error)

PlaylistsOrErr returns the Playlists value or an error if the edge was not loaded in eager-loading.

type UsersGroupBy

type UsersGroupBy struct {
	// contains filtered or unexported fields
}

UsersGroupBy is the group-by builder for Users entities.

func (*UsersGroupBy) Aggregate

func (ugb *UsersGroupBy) Aggregate(fns ...AggregateFunc) *UsersGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UsersGroupBy) Bool

func (s *UsersGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) BoolX

func (s *UsersGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UsersGroupBy) Bools

func (s *UsersGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) BoolsX

func (s *UsersGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UsersGroupBy) Float64

func (s *UsersGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) Float64X

func (s *UsersGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UsersGroupBy) Float64s

func (s *UsersGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) Float64sX

func (s *UsersGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UsersGroupBy) Int

func (s *UsersGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) IntX

func (s *UsersGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UsersGroupBy) Ints

func (s *UsersGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) IntsX

func (s *UsersGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UsersGroupBy) Scan

func (ugb *UsersGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UsersGroupBy) ScanX

func (s *UsersGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UsersGroupBy) String

func (s *UsersGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) StringX

func (s *UsersGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UsersGroupBy) Strings

func (s *UsersGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UsersGroupBy) StringsX

func (s *UsersGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UsersMutation

type UsersMutation struct {
	// contains filtered or unexported fields
}

UsersMutation represents an operation that mutates the Users nodes in the graph.

func (*UsersMutation) AddAlbumIDs

func (m *UsersMutation) AddAlbumIDs(ids ...uint64)

AddAlbumIDs adds the "albums" edge to the Albums entity by ids.

func (*UsersMutation) AddDeviceIDs

func (m *UsersMutation) AddDeviceIDs(ids ...uint64)

AddDeviceIDs adds the "devices" edge to the Devices entity by ids.

func (*UsersMutation) AddField

func (m *UsersMutation) 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 (*UsersMutation) AddMusicIDs

func (m *UsersMutation) AddMusicIDs(ids ...uint64)

AddMusicIDs adds the "musics" edge to the Musics entity by ids.

func (*UsersMutation) AddPlaylistIDs

func (m *UsersMutation) AddPlaylistIDs(ids ...uint64)

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by ids.

func (*UsersMutation) AddedEdges

func (m *UsersMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UsersMutation) AddedField

func (m *UsersMutation) 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 (*UsersMutation) AddedFields

func (m *UsersMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UsersMutation) AddedIDs

func (m *UsersMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UsersMutation) AlbumsCleared

func (m *UsersMutation) AlbumsCleared() bool

AlbumsCleared reports if the "albums" edge to the Albums entity was cleared.

func (*UsersMutation) AlbumsIDs

func (m *UsersMutation) AlbumsIDs() (ids []uint64)

AlbumsIDs returns the "albums" edge IDs in the mutation.

func (*UsersMutation) Avatar

func (m *UsersMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*UsersMutation) AvatarCleared

func (m *UsersMutation) AvatarCleared() bool

AvatarCleared returns if the "avatar" field was cleared in this mutation.

func (*UsersMutation) Bio

func (m *UsersMutation) Bio() (r string, exists bool)

Bio returns the value of the "bio" field in the mutation.

func (*UsersMutation) BioCleared

func (m *UsersMutation) BioCleared() bool

BioCleared returns if the "bio" field was cleared in this mutation.

func (*UsersMutation) ClearAlbums

func (m *UsersMutation) ClearAlbums()

ClearAlbums clears the "albums" edge to the Albums entity.

func (*UsersMutation) ClearAvatar

func (m *UsersMutation) ClearAvatar()

ClearAvatar clears the value of the "avatar" field.

func (*UsersMutation) ClearBio

func (m *UsersMutation) ClearBio()

ClearBio clears the value of the "bio" field.

func (*UsersMutation) ClearDevices

func (m *UsersMutation) ClearDevices()

ClearDevices clears the "devices" edge to the Devices entity.

func (*UsersMutation) ClearEdge

func (m *UsersMutation) 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 (*UsersMutation) ClearEmail

func (m *UsersMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*UsersMutation) ClearField

func (m *UsersMutation) 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 (*UsersMutation) ClearMusics

func (m *UsersMutation) ClearMusics()

ClearMusics clears the "musics" edge to the Musics entity.

func (*UsersMutation) ClearName

func (m *UsersMutation) ClearName()

ClearName clears the value of the "name" field.

func (*UsersMutation) ClearPassword

func (m *UsersMutation) ClearPassword()

ClearPassword clears the value of the "password" field.

func (*UsersMutation) ClearPlaylists

func (m *UsersMutation) ClearPlaylists()

ClearPlaylists clears the "playlists" edge to the Playlists entity.

func (*UsersMutation) ClearedEdges

func (m *UsersMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UsersMutation) ClearedFields

func (m *UsersMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UsersMutation) Client

func (m UsersMutation) 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 (*UsersMutation) CreateTime

func (m *UsersMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UsersMutation) DevicesCleared

func (m *UsersMutation) DevicesCleared() bool

DevicesCleared reports if the "devices" edge to the Devices entity was cleared.

func (*UsersMutation) DevicesIDs

func (m *UsersMutation) DevicesIDs() (ids []uint64)

DevicesIDs returns the "devices" edge IDs in the mutation.

func (*UsersMutation) EdgeCleared

func (m *UsersMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UsersMutation) Email

func (m *UsersMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UsersMutation) EmailCleared

func (m *UsersMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*UsersMutation) Field

func (m *UsersMutation) 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 (*UsersMutation) FieldCleared

func (m *UsersMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UsersMutation) Fields

func (m *UsersMutation) 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 (*UsersMutation) ID

func (m *UsersMutation) 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 (*UsersMutation) IDs

func (m *UsersMutation) 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 (*UsersMutation) MusicsCleared

func (m *UsersMutation) MusicsCleared() bool

MusicsCleared reports if the "musics" edge to the Musics entity was cleared.

func (*UsersMutation) MusicsIDs

func (m *UsersMutation) MusicsIDs() (ids []uint64)

MusicsIDs returns the "musics" edge IDs in the mutation.

func (*UsersMutation) Name

func (m *UsersMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UsersMutation) NameCleared

func (m *UsersMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*UsersMutation) OldAvatar

func (m *UsersMutation) OldAvatar(ctx context.Context) (v string, err error)

OldAvatar returns the old "avatar" field's value of the Users entity. If the Users 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 (*UsersMutation) OldBio

func (m *UsersMutation) OldBio(ctx context.Context) (v string, err error)

OldBio returns the old "bio" field's value of the Users entity. If the Users 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 (*UsersMutation) OldCreateTime

func (m *UsersMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Users entity. If the Users 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 (*UsersMutation) OldEmail

func (m *UsersMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Users entity. If the Users 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 (*UsersMutation) OldField

func (m *UsersMutation) 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 (*UsersMutation) OldName

func (m *UsersMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Users entity. If the Users 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 (*UsersMutation) OldPassword

func (m *UsersMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUpdateTime

func (m *UsersMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUsername

func (m *UsersMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Users entity. If the Users 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 (*UsersMutation) Op

func (m *UsersMutation) Op() Op

Op returns the operation name.

func (*UsersMutation) Password

func (m *UsersMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UsersMutation) PasswordCleared

func (m *UsersMutation) PasswordCleared() bool

PasswordCleared returns if the "password" field was cleared in this mutation.

func (*UsersMutation) PlaylistsCleared

func (m *UsersMutation) PlaylistsCleared() bool

PlaylistsCleared reports if the "playlists" edge to the Playlists entity was cleared.

func (*UsersMutation) PlaylistsIDs

func (m *UsersMutation) PlaylistsIDs() (ids []uint64)

PlaylistsIDs returns the "playlists" edge IDs in the mutation.

func (*UsersMutation) RemoveAlbumIDs

func (m *UsersMutation) RemoveAlbumIDs(ids ...uint64)

RemoveAlbumIDs removes the "albums" edge to the Albums entity by IDs.

func (*UsersMutation) RemoveDeviceIDs

func (m *UsersMutation) RemoveDeviceIDs(ids ...uint64)

RemoveDeviceIDs removes the "devices" edge to the Devices entity by IDs.

func (*UsersMutation) RemoveMusicIDs

func (m *UsersMutation) RemoveMusicIDs(ids ...uint64)

RemoveMusicIDs removes the "musics" edge to the Musics entity by IDs.

func (*UsersMutation) RemovePlaylistIDs

func (m *UsersMutation) RemovePlaylistIDs(ids ...uint64)

RemovePlaylistIDs removes the "playlists" edge to the Playlists entity by IDs.

func (*UsersMutation) RemovedAlbumsIDs

func (m *UsersMutation) RemovedAlbumsIDs() (ids []uint64)

RemovedAlbums returns the removed IDs of the "albums" edge to the Albums entity.

func (*UsersMutation) RemovedDevicesIDs

func (m *UsersMutation) RemovedDevicesIDs() (ids []uint64)

RemovedDevices returns the removed IDs of the "devices" edge to the Devices entity.

func (*UsersMutation) RemovedEdges

func (m *UsersMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UsersMutation) RemovedIDs

func (m *UsersMutation) 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 (*UsersMutation) RemovedMusicsIDs

func (m *UsersMutation) RemovedMusicsIDs() (ids []uint64)

RemovedMusics returns the removed IDs of the "musics" edge to the Musics entity.

func (*UsersMutation) RemovedPlaylistsIDs

func (m *UsersMutation) RemovedPlaylistsIDs() (ids []uint64)

RemovedPlaylists returns the removed IDs of the "playlists" edge to the Playlists entity.

func (*UsersMutation) ResetAlbums

func (m *UsersMutation) ResetAlbums()

ResetAlbums resets all changes to the "albums" edge.

func (*UsersMutation) ResetAvatar

func (m *UsersMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*UsersMutation) ResetBio

func (m *UsersMutation) ResetBio()

ResetBio resets all changes to the "bio" field.

func (*UsersMutation) ResetCreateTime

func (m *UsersMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UsersMutation) ResetDevices

func (m *UsersMutation) ResetDevices()

ResetDevices resets all changes to the "devices" edge.

func (*UsersMutation) ResetEdge

func (m *UsersMutation) 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 (*UsersMutation) ResetEmail

func (m *UsersMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UsersMutation) ResetField

func (m *UsersMutation) 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 (*UsersMutation) ResetMusics

func (m *UsersMutation) ResetMusics()

ResetMusics resets all changes to the "musics" edge.

func (*UsersMutation) ResetName

func (m *UsersMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UsersMutation) ResetPassword

func (m *UsersMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UsersMutation) ResetPlaylists

func (m *UsersMutation) ResetPlaylists()

ResetPlaylists resets all changes to the "playlists" edge.

func (*UsersMutation) ResetUpdateTime

func (m *UsersMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UsersMutation) ResetUsername

func (m *UsersMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UsersMutation) SetAvatar

func (m *UsersMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*UsersMutation) SetBio

func (m *UsersMutation) SetBio(s string)

SetBio sets the "bio" field.

func (*UsersMutation) SetCreateTime

func (m *UsersMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*UsersMutation) SetEmail

func (m *UsersMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UsersMutation) SetField

func (m *UsersMutation) 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 (*UsersMutation) SetID

func (m *UsersMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Users entities.

func (*UsersMutation) SetName

func (m *UsersMutation) SetName(s string)

SetName sets the "name" field.

func (*UsersMutation) SetOp

func (m *UsersMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UsersMutation) SetPassword

func (m *UsersMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UsersMutation) SetUpdateTime

func (m *UsersMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*UsersMutation) SetUsername

func (m *UsersMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UsersMutation) Tx

func (m UsersMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UsersMutation) Type

func (m *UsersMutation) Type() string

Type returns the node type of this mutation (Users).

func (*UsersMutation) UpdateTime

func (m *UsersMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UsersMutation) Username

func (m *UsersMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UsersMutation) Where

func (m *UsersMutation) Where(ps ...predicate.Users)

Where appends a list predicates to the UsersMutation builder.

func (*UsersMutation) WhereP

func (m *UsersMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UsersMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UsersQuery

type UsersQuery struct {
	// contains filtered or unexported fields
}

UsersQuery is the builder for querying Users entities.

func (*UsersQuery) Aggregate

func (uq *UsersQuery) Aggregate(fns ...AggregateFunc) *UsersSelect

Aggregate returns a UsersSelect configured with the given aggregations.

func (*UsersQuery) All

func (uq *UsersQuery) All(ctx context.Context) ([]*Users, error)

All executes the query and returns a list of UsersSlice.

func (*UsersQuery) AllX

func (uq *UsersQuery) AllX(ctx context.Context) []*Users

AllX is like All, but panics if an error occurs.

func (*UsersQuery) Clone

func (uq *UsersQuery) Clone() *UsersQuery

Clone returns a duplicate of the UsersQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UsersQuery) Count

func (uq *UsersQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UsersQuery) CountX

func (uq *UsersQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UsersQuery) Exist

func (uq *UsersQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UsersQuery) ExistX

func (uq *UsersQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UsersQuery) First

func (uq *UsersQuery) First(ctx context.Context) (*Users, error)

First returns the first Users entity from the query. Returns a *NotFoundError when no Users was found.

func (*UsersQuery) FirstID

func (uq *UsersQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Users ID from the query. Returns a *NotFoundError when no Users ID was found.

func (*UsersQuery) FirstIDX

func (uq *UsersQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*UsersQuery) FirstX

func (uq *UsersQuery) FirstX(ctx context.Context) *Users

FirstX is like First, but panics if an error occurs.

func (*UsersQuery) GroupBy

func (uq *UsersQuery) GroupBy(field string, fields ...string) *UsersGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Users.Query().
	GroupBy(users.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UsersQuery) IDs

func (uq *UsersQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Users IDs.

func (*UsersQuery) IDsX

func (uq *UsersQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*UsersQuery) Limit

func (uq *UsersQuery) Limit(limit int) *UsersQuery

Limit the number of records to be returned by this query.

func (*UsersQuery) Offset

func (uq *UsersQuery) Offset(offset int) *UsersQuery

Offset to start from.

func (*UsersQuery) Only

func (uq *UsersQuery) Only(ctx context.Context) (*Users, error)

Only returns a single Users entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Users entity is found. Returns a *NotFoundError when no Users entities are found.

func (*UsersQuery) OnlyID

func (uq *UsersQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Users ID in the query. Returns a *NotSingularError when more than one Users ID is found. Returns a *NotFoundError when no entities are found.

func (*UsersQuery) OnlyIDX

func (uq *UsersQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UsersQuery) OnlyX

func (uq *UsersQuery) OnlyX(ctx context.Context) *Users

OnlyX is like Only, but panics if an error occurs.

func (*UsersQuery) Order

func (uq *UsersQuery) Order(o ...users.OrderOption) *UsersQuery

Order specifies how the records should be ordered.

func (*UsersQuery) QueryAlbums

func (uq *UsersQuery) QueryAlbums() *AlbumsQuery

QueryAlbums chains the current query on the "albums" edge.

func (*UsersQuery) QueryDevices

func (uq *UsersQuery) QueryDevices() *DevicesQuery

QueryDevices chains the current query on the "devices" edge.

func (*UsersQuery) QueryMusics

func (uq *UsersQuery) QueryMusics() *MusicsQuery

QueryMusics chains the current query on the "musics" edge.

func (*UsersQuery) QueryPlaylists

func (uq *UsersQuery) QueryPlaylists() *PlaylistsQuery

QueryPlaylists chains the current query on the "playlists" edge.

func (*UsersQuery) Select

func (uq *UsersQuery) Select(fields ...string) *UsersSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Users.Query().
	Select(users.FieldCreateTime).
	Scan(ctx, &v)

func (*UsersQuery) Unique

func (uq *UsersQuery) Unique(unique bool) *UsersQuery

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 (*UsersQuery) Where

func (uq *UsersQuery) Where(ps ...predicate.Users) *UsersQuery

Where adds a new predicate for the UsersQuery builder.

func (*UsersQuery) WithAlbums

func (uq *UsersQuery) WithAlbums(opts ...func(*AlbumsQuery)) *UsersQuery

WithAlbums tells the query-builder to eager-load the nodes that are connected to the "albums" edge. The optional arguments are used to configure the query builder of the edge.

func (*UsersQuery) WithDevices

func (uq *UsersQuery) WithDevices(opts ...func(*DevicesQuery)) *UsersQuery

WithDevices tells the query-builder to eager-load the nodes that are connected to the "devices" edge. The optional arguments are used to configure the query builder of the edge.

func (*UsersQuery) WithMusics

func (uq *UsersQuery) WithMusics(opts ...func(*MusicsQuery)) *UsersQuery

WithMusics tells the query-builder to eager-load the nodes that are connected to the "musics" edge. The optional arguments are used to configure the query builder of the edge.

func (*UsersQuery) WithPlaylists

func (uq *UsersQuery) WithPlaylists(opts ...func(*PlaylistsQuery)) *UsersQuery

WithPlaylists tells the query-builder to eager-load the nodes that are connected to the "playlists" edge. The optional arguments are used to configure the query builder of the edge.

type UsersSelect

type UsersSelect struct {
	*UsersQuery
	// contains filtered or unexported fields
}

UsersSelect is the builder for selecting fields of Users entities.

func (*UsersSelect) Aggregate

func (us *UsersSelect) Aggregate(fns ...AggregateFunc) *UsersSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UsersSelect) Bool

func (s *UsersSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UsersSelect) BoolX

func (s *UsersSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UsersSelect) Bools

func (s *UsersSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UsersSelect) BoolsX

func (s *UsersSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UsersSelect) Float64

func (s *UsersSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UsersSelect) Float64X

func (s *UsersSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UsersSelect) Float64s

func (s *UsersSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UsersSelect) Float64sX

func (s *UsersSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UsersSelect) Int

func (s *UsersSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UsersSelect) IntX

func (s *UsersSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UsersSelect) Ints

func (s *UsersSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UsersSelect) IntsX

func (s *UsersSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UsersSelect) Scan

func (us *UsersSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UsersSelect) ScanX

func (s *UsersSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UsersSelect) String

func (s *UsersSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UsersSelect) StringX

func (s *UsersSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UsersSelect) Strings

func (s *UsersSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UsersSelect) StringsX

func (s *UsersSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UsersSlice

type UsersSlice []*Users

UsersSlice is a parsable slice of Users.

type UsersUpdate

type UsersUpdate struct {
	// contains filtered or unexported fields
}

UsersUpdate is the builder for updating Users entities.

func (*UsersUpdate) AddAlbumIDs

func (uu *UsersUpdate) AddAlbumIDs(ids ...uint64) *UsersUpdate

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*UsersUpdate) AddAlbums

func (uu *UsersUpdate) AddAlbums(a ...*Albums) *UsersUpdate

AddAlbums adds the "albums" edges to the Albums entity.

func (*UsersUpdate) AddDeviceIDs

func (uu *UsersUpdate) AddDeviceIDs(ids ...uint64) *UsersUpdate

AddDeviceIDs adds the "devices" edge to the Devices entity by IDs.

func (*UsersUpdate) AddDevices

func (uu *UsersUpdate) AddDevices(d ...*Devices) *UsersUpdate

AddDevices adds the "devices" edges to the Devices entity.

func (*UsersUpdate) AddMusicIDs

func (uu *UsersUpdate) AddMusicIDs(ids ...uint64) *UsersUpdate

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*UsersUpdate) AddMusics

func (uu *UsersUpdate) AddMusics(m ...*Musics) *UsersUpdate

AddMusics adds the "musics" edges to the Musics entity.

func (*UsersUpdate) AddPlaylistIDs

func (uu *UsersUpdate) AddPlaylistIDs(ids ...uint64) *UsersUpdate

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*UsersUpdate) AddPlaylists

func (uu *UsersUpdate) AddPlaylists(p ...*Playlists) *UsersUpdate

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*UsersUpdate) ClearAlbums

func (uu *UsersUpdate) ClearAlbums() *UsersUpdate

ClearAlbums clears all "albums" edges to the Albums entity.

func (*UsersUpdate) ClearAvatar

func (uu *UsersUpdate) ClearAvatar() *UsersUpdate

ClearAvatar clears the value of the "avatar" field.

func (*UsersUpdate) ClearBio

func (uu *UsersUpdate) ClearBio() *UsersUpdate

ClearBio clears the value of the "bio" field.

func (*UsersUpdate) ClearDevices

func (uu *UsersUpdate) ClearDevices() *UsersUpdate

ClearDevices clears all "devices" edges to the Devices entity.

func (*UsersUpdate) ClearEmail

func (uu *UsersUpdate) ClearEmail() *UsersUpdate

ClearEmail clears the value of the "email" field.

func (*UsersUpdate) ClearMusics

func (uu *UsersUpdate) ClearMusics() *UsersUpdate

ClearMusics clears all "musics" edges to the Musics entity.

func (*UsersUpdate) ClearName

func (uu *UsersUpdate) ClearName() *UsersUpdate

ClearName clears the value of the "name" field.

func (*UsersUpdate) ClearPassword

func (uu *UsersUpdate) ClearPassword() *UsersUpdate

ClearPassword clears the value of the "password" field.

func (*UsersUpdate) ClearPlaylists

func (uu *UsersUpdate) ClearPlaylists() *UsersUpdate

ClearPlaylists clears all "playlists" edges to the Playlists entity.

func (*UsersUpdate) Exec

func (uu *UsersUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UsersUpdate) ExecX

func (uu *UsersUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersUpdate) Mutation

func (uu *UsersUpdate) Mutation() *UsersMutation

Mutation returns the UsersMutation object of the builder.

func (*UsersUpdate) RemoveAlbumIDs

func (uu *UsersUpdate) RemoveAlbumIDs(ids ...uint64) *UsersUpdate

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*UsersUpdate) RemoveAlbums

func (uu *UsersUpdate) RemoveAlbums(a ...*Albums) *UsersUpdate

RemoveAlbums removes "albums" edges to Albums entities.

func (*UsersUpdate) RemoveDeviceIDs

func (uu *UsersUpdate) RemoveDeviceIDs(ids ...uint64) *UsersUpdate

RemoveDeviceIDs removes the "devices" edge to Devices entities by IDs.

func (*UsersUpdate) RemoveDevices

func (uu *UsersUpdate) RemoveDevices(d ...*Devices) *UsersUpdate

RemoveDevices removes "devices" edges to Devices entities.

func (*UsersUpdate) RemoveMusicIDs

func (uu *UsersUpdate) RemoveMusicIDs(ids ...uint64) *UsersUpdate

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*UsersUpdate) RemoveMusics

func (uu *UsersUpdate) RemoveMusics(m ...*Musics) *UsersUpdate

RemoveMusics removes "musics" edges to Musics entities.

func (*UsersUpdate) RemovePlaylistIDs

func (uu *UsersUpdate) RemovePlaylistIDs(ids ...uint64) *UsersUpdate

RemovePlaylistIDs removes the "playlists" edge to Playlists entities by IDs.

func (*UsersUpdate) RemovePlaylists

func (uu *UsersUpdate) RemovePlaylists(p ...*Playlists) *UsersUpdate

RemovePlaylists removes "playlists" edges to Playlists entities.

func (*UsersUpdate) Save

func (uu *UsersUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UsersUpdate) SaveX

func (uu *UsersUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UsersUpdate) SetAvatar

func (uu *UsersUpdate) SetAvatar(s string) *UsersUpdate

SetAvatar sets the "avatar" field.

func (*UsersUpdate) SetBio

func (uu *UsersUpdate) SetBio(s string) *UsersUpdate

SetBio sets the "bio" field.

func (*UsersUpdate) SetEmail

func (uu *UsersUpdate) SetEmail(s string) *UsersUpdate

SetEmail sets the "email" field.

func (*UsersUpdate) SetName

func (uu *UsersUpdate) SetName(s string) *UsersUpdate

SetName sets the "name" field.

func (*UsersUpdate) SetNillableAvatar

func (uu *UsersUpdate) SetNillableAvatar(s *string) *UsersUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UsersUpdate) SetNillableBio

func (uu *UsersUpdate) SetNillableBio(s *string) *UsersUpdate

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UsersUpdate) SetNillableEmail

func (uu *UsersUpdate) SetNillableEmail(s *string) *UsersUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UsersUpdate) SetNillableName

func (uu *UsersUpdate) SetNillableName(s *string) *UsersUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UsersUpdate) SetNillablePassword

func (uu *UsersUpdate) SetNillablePassword(s *string) *UsersUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UsersUpdate) SetNillableUsername

func (uu *UsersUpdate) SetNillableUsername(s *string) *UsersUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UsersUpdate) SetPassword

func (uu *UsersUpdate) SetPassword(s string) *UsersUpdate

SetPassword sets the "password" field.

func (*UsersUpdate) SetUpdateTime

func (uu *UsersUpdate) SetUpdateTime(t time.Time) *UsersUpdate

SetUpdateTime sets the "update_time" field.

func (*UsersUpdate) SetUsername

func (uu *UsersUpdate) SetUsername(s string) *UsersUpdate

SetUsername sets the "username" field.

func (*UsersUpdate) Where

func (uu *UsersUpdate) Where(ps ...predicate.Users) *UsersUpdate

Where appends a list predicates to the UsersUpdate builder.

type UsersUpdateOne

type UsersUpdateOne struct {
	// contains filtered or unexported fields
}

UsersUpdateOne is the builder for updating a single Users entity.

func (*UsersUpdateOne) AddAlbumIDs

func (uuo *UsersUpdateOne) AddAlbumIDs(ids ...uint64) *UsersUpdateOne

AddAlbumIDs adds the "albums" edge to the Albums entity by IDs.

func (*UsersUpdateOne) AddAlbums

func (uuo *UsersUpdateOne) AddAlbums(a ...*Albums) *UsersUpdateOne

AddAlbums adds the "albums" edges to the Albums entity.

func (*UsersUpdateOne) AddDeviceIDs

func (uuo *UsersUpdateOne) AddDeviceIDs(ids ...uint64) *UsersUpdateOne

AddDeviceIDs adds the "devices" edge to the Devices entity by IDs.

func (*UsersUpdateOne) AddDevices

func (uuo *UsersUpdateOne) AddDevices(d ...*Devices) *UsersUpdateOne

AddDevices adds the "devices" edges to the Devices entity.

func (*UsersUpdateOne) AddMusicIDs

func (uuo *UsersUpdateOne) AddMusicIDs(ids ...uint64) *UsersUpdateOne

AddMusicIDs adds the "musics" edge to the Musics entity by IDs.

func (*UsersUpdateOne) AddMusics

func (uuo *UsersUpdateOne) AddMusics(m ...*Musics) *UsersUpdateOne

AddMusics adds the "musics" edges to the Musics entity.

func (*UsersUpdateOne) AddPlaylistIDs

func (uuo *UsersUpdateOne) AddPlaylistIDs(ids ...uint64) *UsersUpdateOne

AddPlaylistIDs adds the "playlists" edge to the Playlists entity by IDs.

func (*UsersUpdateOne) AddPlaylists

func (uuo *UsersUpdateOne) AddPlaylists(p ...*Playlists) *UsersUpdateOne

AddPlaylists adds the "playlists" edges to the Playlists entity.

func (*UsersUpdateOne) ClearAlbums

func (uuo *UsersUpdateOne) ClearAlbums() *UsersUpdateOne

ClearAlbums clears all "albums" edges to the Albums entity.

func (*UsersUpdateOne) ClearAvatar

func (uuo *UsersUpdateOne) ClearAvatar() *UsersUpdateOne

ClearAvatar clears the value of the "avatar" field.

func (*UsersUpdateOne) ClearBio

func (uuo *UsersUpdateOne) ClearBio() *UsersUpdateOne

ClearBio clears the value of the "bio" field.

func (*UsersUpdateOne) ClearDevices

func (uuo *UsersUpdateOne) ClearDevices() *UsersUpdateOne

ClearDevices clears all "devices" edges to the Devices entity.

func (*UsersUpdateOne) ClearEmail

func (uuo *UsersUpdateOne) ClearEmail() *UsersUpdateOne

ClearEmail clears the value of the "email" field.

func (*UsersUpdateOne) ClearMusics

func (uuo *UsersUpdateOne) ClearMusics() *UsersUpdateOne

ClearMusics clears all "musics" edges to the Musics entity.

func (*UsersUpdateOne) ClearName

func (uuo *UsersUpdateOne) ClearName() *UsersUpdateOne

ClearName clears the value of the "name" field.

func (*UsersUpdateOne) ClearPassword

func (uuo *UsersUpdateOne) ClearPassword() *UsersUpdateOne

ClearPassword clears the value of the "password" field.

func (*UsersUpdateOne) ClearPlaylists

func (uuo *UsersUpdateOne) ClearPlaylists() *UsersUpdateOne

ClearPlaylists clears all "playlists" edges to the Playlists entity.

func (*UsersUpdateOne) Exec

func (uuo *UsersUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UsersUpdateOne) ExecX

func (uuo *UsersUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UsersUpdateOne) Mutation

func (uuo *UsersUpdateOne) Mutation() *UsersMutation

Mutation returns the UsersMutation object of the builder.

func (*UsersUpdateOne) RemoveAlbumIDs

func (uuo *UsersUpdateOne) RemoveAlbumIDs(ids ...uint64) *UsersUpdateOne

RemoveAlbumIDs removes the "albums" edge to Albums entities by IDs.

func (*UsersUpdateOne) RemoveAlbums

func (uuo *UsersUpdateOne) RemoveAlbums(a ...*Albums) *UsersUpdateOne

RemoveAlbums removes "albums" edges to Albums entities.

func (*UsersUpdateOne) RemoveDeviceIDs

func (uuo *UsersUpdateOne) RemoveDeviceIDs(ids ...uint64) *UsersUpdateOne

RemoveDeviceIDs removes the "devices" edge to Devices entities by IDs.

func (*UsersUpdateOne) RemoveDevices

func (uuo *UsersUpdateOne) RemoveDevices(d ...*Devices) *UsersUpdateOne

RemoveDevices removes "devices" edges to Devices entities.

func (*UsersUpdateOne) RemoveMusicIDs

func (uuo *UsersUpdateOne) RemoveMusicIDs(ids ...uint64) *UsersUpdateOne

RemoveMusicIDs removes the "musics" edge to Musics entities by IDs.

func (*UsersUpdateOne) RemoveMusics

func (uuo *UsersUpdateOne) RemoveMusics(m ...*Musics) *UsersUpdateOne

RemoveMusics removes "musics" edges to Musics entities.

func (*UsersUpdateOne) RemovePlaylistIDs

func (uuo *UsersUpdateOne) RemovePlaylistIDs(ids ...uint64) *UsersUpdateOne

RemovePlaylistIDs removes the "playlists" edge to Playlists entities by IDs.

func (*UsersUpdateOne) RemovePlaylists

func (uuo *UsersUpdateOne) RemovePlaylists(p ...*Playlists) *UsersUpdateOne

RemovePlaylists removes "playlists" edges to Playlists entities.

func (*UsersUpdateOne) Save

func (uuo *UsersUpdateOne) Save(ctx context.Context) (*Users, error)

Save executes the query and returns the updated Users entity.

func (*UsersUpdateOne) SaveX

func (uuo *UsersUpdateOne) SaveX(ctx context.Context) *Users

SaveX is like Save, but panics if an error occurs.

func (*UsersUpdateOne) Select

func (uuo *UsersUpdateOne) Select(field string, fields ...string) *UsersUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UsersUpdateOne) SetAvatar

func (uuo *UsersUpdateOne) SetAvatar(s string) *UsersUpdateOne

SetAvatar sets the "avatar" field.

func (*UsersUpdateOne) SetBio

func (uuo *UsersUpdateOne) SetBio(s string) *UsersUpdateOne

SetBio sets the "bio" field.

func (*UsersUpdateOne) SetEmail

func (uuo *UsersUpdateOne) SetEmail(s string) *UsersUpdateOne

SetEmail sets the "email" field.

func (*UsersUpdateOne) SetName

func (uuo *UsersUpdateOne) SetName(s string) *UsersUpdateOne

SetName sets the "name" field.

func (*UsersUpdateOne) SetNillableAvatar

func (uuo *UsersUpdateOne) SetNillableAvatar(s *string) *UsersUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableBio

func (uuo *UsersUpdateOne) SetNillableBio(s *string) *UsersUpdateOne

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableEmail

func (uuo *UsersUpdateOne) SetNillableEmail(s *string) *UsersUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableName

func (uuo *UsersUpdateOne) SetNillableName(s *string) *UsersUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UsersUpdateOne) SetNillablePassword

func (uuo *UsersUpdateOne) SetNillablePassword(s *string) *UsersUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UsersUpdateOne) SetNillableUsername

func (uuo *UsersUpdateOne) SetNillableUsername(s *string) *UsersUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UsersUpdateOne) SetPassword

func (uuo *UsersUpdateOne) SetPassword(s string) *UsersUpdateOne

SetPassword sets the "password" field.

func (*UsersUpdateOne) SetUpdateTime

func (uuo *UsersUpdateOne) SetUpdateTime(t time.Time) *UsersUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UsersUpdateOne) SetUsername

func (uuo *UsersUpdateOne) SetUsername(s string) *UsersUpdateOne

SetUsername sets the "username" field.

func (*UsersUpdateOne) Where

func (uuo *UsersUpdateOne) Where(ps ...predicate.Users) *UsersUpdateOne

Where appends a list predicates to the UsersUpdate builder.

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 Videos

type Videos struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// contains filtered or unexported fields
}

Videos is the model entity for the Videos schema.

func (*Videos) String

func (v *Videos) String() string

String implements the fmt.Stringer.

func (*Videos) Unwrap

func (v *Videos) Unwrap() *Videos

Unwrap unwraps the Videos 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 (*Videos) Update

func (v *Videos) Update() *VideosUpdateOne

Update returns a builder for updating this Videos. Note that you need to call Videos.Unwrap() before calling this method if this Videos was returned from a transaction, and the transaction was committed or rolled back.

func (*Videos) Value

func (v *Videos) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Videos. This includes values selected through modifiers, order, etc.

type VideosClient

type VideosClient struct {
	// contains filtered or unexported fields
}

VideosClient is a client for the Videos schema.

func NewVideosClient

func NewVideosClient(c config) *VideosClient

NewVideosClient returns a client for the Videos from the given config.

func (*VideosClient) Create

func (c *VideosClient) Create() *VideosCreate

Create returns a builder for creating a Videos entity.

func (*VideosClient) CreateBulk

func (c *VideosClient) CreateBulk(builders ...*VideosCreate) *VideosCreateBulk

CreateBulk returns a builder for creating a bulk of Videos entities.

func (*VideosClient) Delete

func (c *VideosClient) Delete() *VideosDelete

Delete returns a delete builder for Videos.

func (*VideosClient) DeleteOne

func (c *VideosClient) DeleteOne(v *Videos) *VideosDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*VideosClient) DeleteOneID

func (c *VideosClient) DeleteOneID(id int) *VideosDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*VideosClient) Get

func (c *VideosClient) Get(ctx context.Context, id int) (*Videos, error)

Get returns a Videos entity by its id.

func (*VideosClient) GetX

func (c *VideosClient) GetX(ctx context.Context, id int) *Videos

GetX is like Get, but panics if an error occurs.

func (*VideosClient) Hooks

func (c *VideosClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VideosClient) Intercept

func (c *VideosClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `videos.Intercept(f(g(h())))`.

func (*VideosClient) Interceptors

func (c *VideosClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*VideosClient) MapCreateBulk

func (c *VideosClient) MapCreateBulk(slice any, setFunc func(*VideosCreate, int)) *VideosCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*VideosClient) Query

func (c *VideosClient) Query() *VideosQuery

Query returns a query builder for Videos.

func (*VideosClient) Update

func (c *VideosClient) Update() *VideosUpdate

Update returns an update builder for Videos.

func (*VideosClient) UpdateOne

func (c *VideosClient) UpdateOne(v *Videos) *VideosUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VideosClient) UpdateOneID

func (c *VideosClient) UpdateOneID(id int) *VideosUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VideosClient) Use

func (c *VideosClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `videos.Hooks(f(g(h())))`.

type VideosCreate

type VideosCreate struct {
	// contains filtered or unexported fields
}

VideosCreate is the builder for creating a Videos entity.

func (*VideosCreate) Exec

func (vc *VideosCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VideosCreate) ExecX

func (vc *VideosCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VideosCreate) Mutation

func (vc *VideosCreate) Mutation() *VideosMutation

Mutation returns the VideosMutation object of the builder.

func (*VideosCreate) Save

func (vc *VideosCreate) Save(ctx context.Context) (*Videos, error)

Save creates the Videos in the database.

func (*VideosCreate) SaveX

func (vc *VideosCreate) SaveX(ctx context.Context) *Videos

SaveX calls Save and panics if Save returns an error.

type VideosCreateBulk

type VideosCreateBulk struct {
	// contains filtered or unexported fields
}

VideosCreateBulk is the builder for creating many Videos entities in bulk.

func (*VideosCreateBulk) Exec

func (vcb *VideosCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VideosCreateBulk) ExecX

func (vcb *VideosCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VideosCreateBulk) Save

func (vcb *VideosCreateBulk) Save(ctx context.Context) ([]*Videos, error)

Save creates the Videos entities in the database.

func (*VideosCreateBulk) SaveX

func (vcb *VideosCreateBulk) SaveX(ctx context.Context) []*Videos

SaveX is like Save, but panics if an error occurs.

type VideosDelete

type VideosDelete struct {
	// contains filtered or unexported fields
}

VideosDelete is the builder for deleting a Videos entity.

func (*VideosDelete) Exec

func (vd *VideosDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VideosDelete) ExecX

func (vd *VideosDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VideosDelete) Where

func (vd *VideosDelete) Where(ps ...predicate.Videos) *VideosDelete

Where appends a list predicates to the VideosDelete builder.

type VideosDeleteOne

type VideosDeleteOne struct {
	// contains filtered or unexported fields
}

VideosDeleteOne is the builder for deleting a single Videos entity.

func (*VideosDeleteOne) Exec

func (vdo *VideosDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VideosDeleteOne) ExecX

func (vdo *VideosDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VideosDeleteOne) Where

func (vdo *VideosDeleteOne) Where(ps ...predicate.Videos) *VideosDeleteOne

Where appends a list predicates to the VideosDelete builder.

type VideosGroupBy

type VideosGroupBy struct {
	// contains filtered or unexported fields
}

VideosGroupBy is the group-by builder for Videos entities.

func (*VideosGroupBy) Aggregate

func (vgb *VideosGroupBy) Aggregate(fns ...AggregateFunc) *VideosGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VideosGroupBy) Bool

func (s *VideosGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) BoolX

func (s *VideosGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VideosGroupBy) Bools

func (s *VideosGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) BoolsX

func (s *VideosGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VideosGroupBy) Float64

func (s *VideosGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) Float64X

func (s *VideosGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VideosGroupBy) Float64s

func (s *VideosGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) Float64sX

func (s *VideosGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VideosGroupBy) Int

func (s *VideosGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) IntX

func (s *VideosGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VideosGroupBy) Ints

func (s *VideosGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) IntsX

func (s *VideosGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VideosGroupBy) Scan

func (vgb *VideosGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VideosGroupBy) ScanX

func (s *VideosGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VideosGroupBy) String

func (s *VideosGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) StringX

func (s *VideosGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VideosGroupBy) Strings

func (s *VideosGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VideosGroupBy) StringsX

func (s *VideosGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VideosMutation

type VideosMutation struct {
	// contains filtered or unexported fields
}

VideosMutation represents an operation that mutates the Videos nodes in the graph.

func (*VideosMutation) AddField

func (m *VideosMutation) 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 (*VideosMutation) AddedEdges

func (m *VideosMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VideosMutation) AddedField

func (m *VideosMutation) 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 (*VideosMutation) AddedFields

func (m *VideosMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VideosMutation) AddedIDs

func (m *VideosMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VideosMutation) ClearEdge

func (m *VideosMutation) 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 (*VideosMutation) ClearField

func (m *VideosMutation) 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 (*VideosMutation) ClearedEdges

func (m *VideosMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VideosMutation) ClearedFields

func (m *VideosMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VideosMutation) Client

func (m VideosMutation) 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 (*VideosMutation) EdgeCleared

func (m *VideosMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VideosMutation) Field

func (m *VideosMutation) 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 (*VideosMutation) FieldCleared

func (m *VideosMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VideosMutation) Fields

func (m *VideosMutation) 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 (*VideosMutation) ID

func (m *VideosMutation) 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 (*VideosMutation) IDs

func (m *VideosMutation) 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 (*VideosMutation) OldField

func (m *VideosMutation) 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 (*VideosMutation) Op

func (m *VideosMutation) Op() Op

Op returns the operation name.

func (*VideosMutation) RemovedEdges

func (m *VideosMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VideosMutation) RemovedIDs

func (m *VideosMutation) 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 (*VideosMutation) ResetEdge

func (m *VideosMutation) 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 (*VideosMutation) ResetField

func (m *VideosMutation) 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 (*VideosMutation) SetField

func (m *VideosMutation) 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 (*VideosMutation) SetOp

func (m *VideosMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (VideosMutation) Tx

func (m VideosMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VideosMutation) Type

func (m *VideosMutation) Type() string

Type returns the node type of this mutation (Videos).

func (*VideosMutation) Where

func (m *VideosMutation) Where(ps ...predicate.Videos)

Where appends a list predicates to the VideosMutation builder.

func (*VideosMutation) WhereP

func (m *VideosMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the VideosMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type VideosQuery

type VideosQuery struct {
	// contains filtered or unexported fields
}

VideosQuery is the builder for querying Videos entities.

func (*VideosQuery) Aggregate

func (vq *VideosQuery) Aggregate(fns ...AggregateFunc) *VideosSelect

Aggregate returns a VideosSelect configured with the given aggregations.

func (*VideosQuery) All

func (vq *VideosQuery) All(ctx context.Context) ([]*Videos, error)

All executes the query and returns a list of VideosSlice.

func (*VideosQuery) AllX

func (vq *VideosQuery) AllX(ctx context.Context) []*Videos

AllX is like All, but panics if an error occurs.

func (*VideosQuery) Clone

func (vq *VideosQuery) Clone() *VideosQuery

Clone returns a duplicate of the VideosQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VideosQuery) Count

func (vq *VideosQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VideosQuery) CountX

func (vq *VideosQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VideosQuery) Exist

func (vq *VideosQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VideosQuery) ExistX

func (vq *VideosQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VideosQuery) First

func (vq *VideosQuery) First(ctx context.Context) (*Videos, error)

First returns the first Videos entity from the query. Returns a *NotFoundError when no Videos was found.

func (*VideosQuery) FirstID

func (vq *VideosQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Videos ID from the query. Returns a *NotFoundError when no Videos ID was found.

func (*VideosQuery) FirstIDX

func (vq *VideosQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*VideosQuery) FirstX

func (vq *VideosQuery) FirstX(ctx context.Context) *Videos

FirstX is like First, but panics if an error occurs.

func (*VideosQuery) GroupBy

func (vq *VideosQuery) GroupBy(field string, fields ...string) *VideosGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*VideosQuery) IDs

func (vq *VideosQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Videos IDs.

func (*VideosQuery) IDsX

func (vq *VideosQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*VideosQuery) Limit

func (vq *VideosQuery) Limit(limit int) *VideosQuery

Limit the number of records to be returned by this query.

func (*VideosQuery) Offset

func (vq *VideosQuery) Offset(offset int) *VideosQuery

Offset to start from.

func (*VideosQuery) Only

func (vq *VideosQuery) Only(ctx context.Context) (*Videos, error)

Only returns a single Videos entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Videos entity is found. Returns a *NotFoundError when no Videos entities are found.

func (*VideosQuery) OnlyID

func (vq *VideosQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Videos ID in the query. Returns a *NotSingularError when more than one Videos ID is found. Returns a *NotFoundError when no entities are found.

func (*VideosQuery) OnlyIDX

func (vq *VideosQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VideosQuery) OnlyX

func (vq *VideosQuery) OnlyX(ctx context.Context) *Videos

OnlyX is like Only, but panics if an error occurs.

func (*VideosQuery) Order

func (vq *VideosQuery) Order(o ...videos.OrderOption) *VideosQuery

Order specifies how the records should be ordered.

func (*VideosQuery) Select

func (vq *VideosQuery) Select(fields ...string) *VideosSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*VideosQuery) Unique

func (vq *VideosQuery) Unique(unique bool) *VideosQuery

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 (*VideosQuery) Where

func (vq *VideosQuery) Where(ps ...predicate.Videos) *VideosQuery

Where adds a new predicate for the VideosQuery builder.

type VideosSelect

type VideosSelect struct {
	*VideosQuery
	// contains filtered or unexported fields
}

VideosSelect is the builder for selecting fields of Videos entities.

func (*VideosSelect) Aggregate

func (vs *VideosSelect) Aggregate(fns ...AggregateFunc) *VideosSelect

Aggregate adds the given aggregation functions to the selector query.

func (*VideosSelect) Bool

func (s *VideosSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VideosSelect) BoolX

func (s *VideosSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VideosSelect) Bools

func (s *VideosSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VideosSelect) BoolsX

func (s *VideosSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VideosSelect) Float64

func (s *VideosSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VideosSelect) Float64X

func (s *VideosSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VideosSelect) Float64s

func (s *VideosSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VideosSelect) Float64sX

func (s *VideosSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VideosSelect) Int

func (s *VideosSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VideosSelect) IntX

func (s *VideosSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VideosSelect) Ints

func (s *VideosSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VideosSelect) IntsX

func (s *VideosSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VideosSelect) Scan

func (vs *VideosSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VideosSelect) ScanX

func (s *VideosSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VideosSelect) String

func (s *VideosSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VideosSelect) StringX

func (s *VideosSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VideosSelect) Strings

func (s *VideosSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VideosSelect) StringsX

func (s *VideosSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VideosSlice

type VideosSlice []*Videos

VideosSlice is a parsable slice of Videos.

type VideosUpdate

type VideosUpdate struct {
	// contains filtered or unexported fields
}

VideosUpdate is the builder for updating Videos entities.

func (*VideosUpdate) Exec

func (vu *VideosUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VideosUpdate) ExecX

func (vu *VideosUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VideosUpdate) Mutation

func (vu *VideosUpdate) Mutation() *VideosMutation

Mutation returns the VideosMutation object of the builder.

func (*VideosUpdate) Save

func (vu *VideosUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VideosUpdate) SaveX

func (vu *VideosUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VideosUpdate) Where

func (vu *VideosUpdate) Where(ps ...predicate.Videos) *VideosUpdate

Where appends a list predicates to the VideosUpdate builder.

type VideosUpdateOne

type VideosUpdateOne struct {
	// contains filtered or unexported fields
}

VideosUpdateOne is the builder for updating a single Videos entity.

func (*VideosUpdateOne) Exec

func (vuo *VideosUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VideosUpdateOne) ExecX

func (vuo *VideosUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VideosUpdateOne) Mutation

func (vuo *VideosUpdateOne) Mutation() *VideosMutation

Mutation returns the VideosMutation object of the builder.

func (*VideosUpdateOne) Save

func (vuo *VideosUpdateOne) Save(ctx context.Context) (*Videos, error)

Save executes the query and returns the updated Videos entity.

func (*VideosUpdateOne) SaveX

func (vuo *VideosUpdateOne) SaveX(ctx context.Context) *Videos

SaveX is like Save, but panics if an error occurs.

func (*VideosUpdateOne) Select

func (vuo *VideosUpdateOne) Select(field string, fields ...string) *VideosUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VideosUpdateOne) Where

func (vuo *VideosUpdateOne) Where(ps ...predicate.Videos) *VideosUpdateOne

Where appends a list predicates to the VideosUpdate builder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL