ent

package
v0.0.0-...-9131046 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 24 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.
	TypeArtist     = "Artist"
	TypeCountry    = "Country"
	TypeFile       = "File"
	TypeMovie      = "Movie"
	TypeMovieGenre = "MovieGenre"
	TypePicture    = "Picture"
	TypeRating     = "Rating"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Artist

type Artist struct {

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

Artist is the model entity for the Artist schema.

func (*Artist) QueryActed

func (a *Artist) QueryActed() *MovieQuery

QueryActed queries the "acted" edge of the Artist entity.

func (*Artist) QueryCountries

func (a *Artist) QueryCountries() *CountryQuery

QueryCountries queries the "countries" edge of the Artist entity.

func (*Artist) QueryDirected

func (a *Artist) QueryDirected() *MovieQuery

QueryDirected queries the "directed" edge of the Artist entity.

func (*Artist) QueryPictures

func (a *Artist) QueryPictures() *PictureQuery

QueryPictures queries the "pictures" edge of the Artist entity.

func (*Artist) QueryProfilePicture

func (a *Artist) QueryProfilePicture() *PictureQuery

QueryProfilePicture queries the "profile_picture" edge of the Artist entity.

func (*Artist) QueryWrote

func (a *Artist) QueryWrote() *MovieQuery

QueryWrote queries the "wrote" edge of the Artist entity.

func (*Artist) String

func (a *Artist) String() string

String implements the fmt.Stringer.

func (*Artist) Unwrap

func (a *Artist) Unwrap() *Artist

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

func (a *Artist) Update() *ArtistUpdateOne

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

type ArtistClient

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

ArtistClient is a client for the Artist schema.

func NewArtistClient

func NewArtistClient(c config) *ArtistClient

NewArtistClient returns a client for the Artist from the given config.

func (*ArtistClient) Create

func (c *ArtistClient) Create() *ArtistCreate

Create returns a create builder for Artist.

func (*ArtistClient) CreateBulk

func (c *ArtistClient) CreateBulk(builders ...*ArtistCreate) *ArtistCreateBulk

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

func (*ArtistClient) Delete

func (c *ArtistClient) Delete() *ArtistDelete

Delete returns a delete builder for Artist.

func (*ArtistClient) DeleteOne

func (c *ArtistClient) DeleteOne(a *Artist) *ArtistDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ArtistClient) DeleteOneID

func (c *ArtistClient) DeleteOneID(id int) *ArtistDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ArtistClient) Get

func (c *ArtistClient) Get(ctx context.Context, id int) (*Artist, error)

Get returns a Artist entity by its id.

func (*ArtistClient) GetX

func (c *ArtistClient) GetX(ctx context.Context, id int) *Artist

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

func (*ArtistClient) Hooks

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

Hooks returns the client hooks.

func (*ArtistClient) Query

func (c *ArtistClient) Query() *ArtistQuery

Query returns a query builder for Artist.

func (*ArtistClient) QueryActed

func (c *ArtistClient) QueryActed(a *Artist) *MovieQuery

QueryActed queries the acted edge of a Artist.

func (*ArtistClient) QueryCountries

func (c *ArtistClient) QueryCountries(a *Artist) *CountryQuery

QueryCountries queries the countries edge of a Artist.

func (*ArtistClient) QueryDirected

func (c *ArtistClient) QueryDirected(a *Artist) *MovieQuery

QueryDirected queries the directed edge of a Artist.

func (*ArtistClient) QueryPictures

func (c *ArtistClient) QueryPictures(a *Artist) *PictureQuery

QueryPictures queries the pictures edge of a Artist.

func (*ArtistClient) QueryProfilePicture

func (c *ArtistClient) QueryProfilePicture(a *Artist) *PictureQuery

QueryProfilePicture queries the profile_picture edge of a Artist.

func (*ArtistClient) QueryWrote

func (c *ArtistClient) QueryWrote(a *Artist) *MovieQuery

QueryWrote queries the wrote edge of a Artist.

func (*ArtistClient) Update

func (c *ArtistClient) Update() *ArtistUpdate

Update returns an update builder for Artist.

func (*ArtistClient) UpdateOne

func (c *ArtistClient) UpdateOne(a *Artist) *ArtistUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ArtistClient) UpdateOneID

func (c *ArtistClient) UpdateOneID(id int) *ArtistUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ArtistClient) Use

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

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

type ArtistCreate

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

ArtistCreate is the builder for creating a Artist entity.

func (*ArtistCreate) AddActed

func (ac *ArtistCreate) AddActed(m ...*Movie) *ArtistCreate

AddActed adds the "acted" edges to the Movie entity.

func (*ArtistCreate) AddActedIDs

func (ac *ArtistCreate) AddActedIDs(ids ...int) *ArtistCreate

AddActedIDs adds the "acted" edge to the Movie entity by IDs.

func (*ArtistCreate) AddCountries

func (ac *ArtistCreate) AddCountries(c ...*Country) *ArtistCreate

AddCountries adds the "countries" edges to the Country entity.

func (*ArtistCreate) AddCountryIDs

func (ac *ArtistCreate) AddCountryIDs(ids ...int) *ArtistCreate

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*ArtistCreate) AddDirected

func (ac *ArtistCreate) AddDirected(m ...*Movie) *ArtistCreate

AddDirected adds the "directed" edges to the Movie entity.

func (*ArtistCreate) AddDirectedIDs

func (ac *ArtistCreate) AddDirectedIDs(ids ...int) *ArtistCreate

AddDirectedIDs adds the "directed" edge to the Movie entity by IDs.

func (*ArtistCreate) AddPictureIDs

func (ac *ArtistCreate) AddPictureIDs(ids ...int) *ArtistCreate

AddPictureIDs adds the "pictures" edge to the Picture entity by IDs.

func (*ArtistCreate) AddPictures

func (ac *ArtistCreate) AddPictures(p ...*Picture) *ArtistCreate

AddPictures adds the "pictures" edges to the Picture entity.

func (*ArtistCreate) AddWrote

func (ac *ArtistCreate) AddWrote(m ...*Movie) *ArtistCreate

AddWrote adds the "wrote" edges to the Movie entity.

func (*ArtistCreate) AddWroteIDs

func (ac *ArtistCreate) AddWroteIDs(ids ...int) *ArtistCreate

AddWroteIDs adds the "wrote" edge to the Movie entity by IDs.

func (*ArtistCreate) Exec

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

Exec executes the query.

func (*ArtistCreate) ExecX

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

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

func (*ArtistCreate) Mutation

func (ac *ArtistCreate) Mutation() *ArtistMutation

Mutation returns the ArtistMutation object of the builder.

func (*ArtistCreate) Save

func (ac *ArtistCreate) Save(ctx context.Context) (*Artist, error)

Save creates the Artist in the database.

func (*ArtistCreate) SaveX

func (ac *ArtistCreate) SaveX(ctx context.Context) *Artist

SaveX calls Save and panics if Save returns an error.

func (*ArtistCreate) SetBirthday

func (ac *ArtistCreate) SetBirthday(t time.Time) *ArtistCreate

SetBirthday sets the "birthday" field.

func (*ArtistCreate) SetName

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

SetName sets the "name" field.

func (*ArtistCreate) SetNillableBirthday

func (ac *ArtistCreate) SetNillableBirthday(t *time.Time) *ArtistCreate

SetNillableBirthday sets the "birthday" field if the given value is not nil.

func (*ArtistCreate) SetNillableProfilePictureID

func (ac *ArtistCreate) SetNillableProfilePictureID(id *int) *ArtistCreate

SetNillableProfilePictureID sets the "profile_picture" edge to the Picture entity by ID if the given value is not nil.

func (*ArtistCreate) SetProfilePicture

func (ac *ArtistCreate) SetProfilePicture(p *Picture) *ArtistCreate

SetProfilePicture sets the "profile_picture" edge to the Picture entity.

func (*ArtistCreate) SetProfilePictureID

func (ac *ArtistCreate) SetProfilePictureID(id int) *ArtistCreate

SetProfilePictureID sets the "profile_picture" edge to the Picture entity by ID.

type ArtistCreateBulk

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

ArtistCreateBulk is the builder for creating many Artist entities in bulk.

func (*ArtistCreateBulk) Exec

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

Exec executes the query.

func (*ArtistCreateBulk) ExecX

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

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

func (*ArtistCreateBulk) Save

func (acb *ArtistCreateBulk) Save(ctx context.Context) ([]*Artist, error)

Save creates the Artist entities in the database.

func (*ArtistCreateBulk) SaveX

func (acb *ArtistCreateBulk) SaveX(ctx context.Context) []*Artist

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

type ArtistDelete

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

ArtistDelete is the builder for deleting a Artist entity.

func (*ArtistDelete) Exec

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

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

func (*ArtistDelete) ExecX

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

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

func (*ArtistDelete) Where

func (ad *ArtistDelete) Where(ps ...predicate.Artist) *ArtistDelete

Where appends a list predicates to the ArtistDelete builder.

type ArtistDeleteOne

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

ArtistDeleteOne is the builder for deleting a single Artist entity.

func (*ArtistDeleteOne) Exec

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

Exec executes the deletion query.

func (*ArtistDeleteOne) ExecX

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

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

type ArtistEdges

type ArtistEdges struct {
	// ProfilePicture holds the value of the profile_picture edge.
	ProfilePicture *Picture `json:"profile_picture,omitempty"`
	// Pictures holds the value of the pictures edge.
	Pictures []*Picture `json:"pictures,omitempty"`
	// Directed holds the value of the directed edge.
	Directed []*Movie `json:"directed,omitempty"`
	// Acted holds the value of the acted edge.
	Acted []*Movie `json:"acted,omitempty"`
	// Wrote holds the value of the wrote edge.
	Wrote []*Movie `json:"wrote,omitempty"`
	// Countries holds the value of the countries edge.
	Countries []*Country `json:"countries,omitempty"`
	// contains filtered or unexported fields
}

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

func (ArtistEdges) ActedOrErr

func (e ArtistEdges) ActedOrErr() ([]*Movie, error)

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

func (ArtistEdges) CountriesOrErr

func (e ArtistEdges) CountriesOrErr() ([]*Country, error)

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

func (ArtistEdges) DirectedOrErr

func (e ArtistEdges) DirectedOrErr() ([]*Movie, error)

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

func (ArtistEdges) PicturesOrErr

func (e ArtistEdges) PicturesOrErr() ([]*Picture, error)

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

func (ArtistEdges) ProfilePictureOrErr

func (e ArtistEdges) ProfilePictureOrErr() (*Picture, error)

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

func (ArtistEdges) WroteOrErr

func (e ArtistEdges) WroteOrErr() ([]*Movie, error)

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

type ArtistGroupBy

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

ArtistGroupBy is the group-by builder for Artist entities.

func (*ArtistGroupBy) Aggregate

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

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

func (*ArtistGroupBy) Bool

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

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

func (*ArtistGroupBy) BoolX

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

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

func (*ArtistGroupBy) Bools

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

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

func (*ArtistGroupBy) BoolsX

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

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

func (*ArtistGroupBy) Float64

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

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

func (*ArtistGroupBy) Float64X

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

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

func (*ArtistGroupBy) Float64s

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

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

func (*ArtistGroupBy) Float64sX

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

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

func (*ArtistGroupBy) Int

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

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

func (*ArtistGroupBy) IntX

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

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

func (*ArtistGroupBy) Ints

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

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

func (*ArtistGroupBy) IntsX

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

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

func (*ArtistGroupBy) Scan

func (agb *ArtistGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ArtistGroupBy) ScanX

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

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

func (*ArtistGroupBy) String

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

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

func (*ArtistGroupBy) StringX

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

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

func (*ArtistGroupBy) Strings

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

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

func (*ArtistGroupBy) StringsX

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

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

type ArtistMutation

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

ArtistMutation represents an operation that mutates the Artist nodes in the graph.

func (*ArtistMutation) ActedCleared

func (m *ArtistMutation) ActedCleared() bool

ActedCleared reports if the "acted" edge to the Movie entity was cleared.

func (*ArtistMutation) ActedIDs

func (m *ArtistMutation) ActedIDs() (ids []int)

ActedIDs returns the "acted" edge IDs in the mutation.

func (*ArtistMutation) AddActedIDs

func (m *ArtistMutation) AddActedIDs(ids ...int)

AddActedIDs adds the "acted" edge to the Movie entity by ids.

func (*ArtistMutation) AddCountryIDs

func (m *ArtistMutation) AddCountryIDs(ids ...int)

AddCountryIDs adds the "countries" edge to the Country entity by ids.

func (*ArtistMutation) AddDirectedIDs

func (m *ArtistMutation) AddDirectedIDs(ids ...int)

AddDirectedIDs adds the "directed" edge to the Movie entity by ids.

func (*ArtistMutation) AddField

func (m *ArtistMutation) 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 (*ArtistMutation) AddPictureIDs

func (m *ArtistMutation) AddPictureIDs(ids ...int)

AddPictureIDs adds the "pictures" edge to the Picture entity by ids.

func (*ArtistMutation) AddWroteIDs

func (m *ArtistMutation) AddWroteIDs(ids ...int)

AddWroteIDs adds the "wrote" edge to the Movie entity by ids.

func (*ArtistMutation) AddedEdges

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

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

func (*ArtistMutation) AddedField

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

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

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

func (*ArtistMutation) AddedIDs

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

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

func (*ArtistMutation) Birthday

func (m *ArtistMutation) Birthday() (r time.Time, exists bool)

Birthday returns the value of the "birthday" field in the mutation.

func (*ArtistMutation) BirthdayCleared

func (m *ArtistMutation) BirthdayCleared() bool

BirthdayCleared returns if the "birthday" field was cleared in this mutation.

func (*ArtistMutation) ClearActed

func (m *ArtistMutation) ClearActed()

ClearActed clears the "acted" edge to the Movie entity.

func (*ArtistMutation) ClearBirthday

func (m *ArtistMutation) ClearBirthday()

ClearBirthday clears the value of the "birthday" field.

func (*ArtistMutation) ClearCountries

func (m *ArtistMutation) ClearCountries()

ClearCountries clears the "countries" edge to the Country entity.

func (*ArtistMutation) ClearDirected

func (m *ArtistMutation) ClearDirected()

ClearDirected clears the "directed" edge to the Movie entity.

func (*ArtistMutation) ClearEdge

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

func (m *ArtistMutation) 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 (*ArtistMutation) ClearPictures

func (m *ArtistMutation) ClearPictures()

ClearPictures clears the "pictures" edge to the Picture entity.

func (*ArtistMutation) ClearProfilePicture

func (m *ArtistMutation) ClearProfilePicture()

ClearProfilePicture clears the "profile_picture" edge to the Picture entity.

func (*ArtistMutation) ClearWrote

func (m *ArtistMutation) ClearWrote()

ClearWrote clears the "wrote" edge to the Movie entity.

func (*ArtistMutation) ClearedEdges

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

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

func (*ArtistMutation) ClearedFields

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

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

func (ArtistMutation) Client

func (m ArtistMutation) 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 (*ArtistMutation) CountriesCleared

func (m *ArtistMutation) CountriesCleared() bool

CountriesCleared reports if the "countries" edge to the Country entity was cleared.

func (*ArtistMutation) CountriesIDs

func (m *ArtistMutation) CountriesIDs() (ids []int)

CountriesIDs returns the "countries" edge IDs in the mutation.

func (*ArtistMutation) DirectedCleared

func (m *ArtistMutation) DirectedCleared() bool

DirectedCleared reports if the "directed" edge to the Movie entity was cleared.

func (*ArtistMutation) DirectedIDs

func (m *ArtistMutation) DirectedIDs() (ids []int)

DirectedIDs returns the "directed" edge IDs in the mutation.

func (*ArtistMutation) EdgeCleared

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

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

func (*ArtistMutation) Field

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

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

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

func (*ArtistMutation) Fields

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

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

func (m *ArtistMutation) 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 (*ArtistMutation) Name

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

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

func (*ArtistMutation) OldBirthday

func (m *ArtistMutation) OldBirthday(ctx context.Context) (v time.Time, err error)

OldBirthday returns the old "birthday" field's value of the Artist entity. If the Artist 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 (*ArtistMutation) OldField

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

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

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

func (m *ArtistMutation) Op() Op

Op returns the operation name.

func (*ArtistMutation) PicturesCleared

func (m *ArtistMutation) PicturesCleared() bool

PicturesCleared reports if the "pictures" edge to the Picture entity was cleared.

func (*ArtistMutation) PicturesIDs

func (m *ArtistMutation) PicturesIDs() (ids []int)

PicturesIDs returns the "pictures" edge IDs in the mutation.

func (*ArtistMutation) ProfilePictureCleared

func (m *ArtistMutation) ProfilePictureCleared() bool

ProfilePictureCleared reports if the "profile_picture" edge to the Picture entity was cleared.

func (*ArtistMutation) ProfilePictureID

func (m *ArtistMutation) ProfilePictureID() (id int, exists bool)

ProfilePictureID returns the "profile_picture" edge ID in the mutation.

func (*ArtistMutation) ProfilePictureIDs

func (m *ArtistMutation) ProfilePictureIDs() (ids []int)

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

func (*ArtistMutation) RemoveActedIDs

func (m *ArtistMutation) RemoveActedIDs(ids ...int)

RemoveActedIDs removes the "acted" edge to the Movie entity by IDs.

func (*ArtistMutation) RemoveCountryIDs

func (m *ArtistMutation) RemoveCountryIDs(ids ...int)

RemoveCountryIDs removes the "countries" edge to the Country entity by IDs.

func (*ArtistMutation) RemoveDirectedIDs

func (m *ArtistMutation) RemoveDirectedIDs(ids ...int)

RemoveDirectedIDs removes the "directed" edge to the Movie entity by IDs.

func (*ArtistMutation) RemovePictureIDs

func (m *ArtistMutation) RemovePictureIDs(ids ...int)

RemovePictureIDs removes the "pictures" edge to the Picture entity by IDs.

func (*ArtistMutation) RemoveWroteIDs

func (m *ArtistMutation) RemoveWroteIDs(ids ...int)

RemoveWroteIDs removes the "wrote" edge to the Movie entity by IDs.

func (*ArtistMutation) RemovedActedIDs

func (m *ArtistMutation) RemovedActedIDs() (ids []int)

RemovedActed returns the removed IDs of the "acted" edge to the Movie entity.

func (*ArtistMutation) RemovedCountriesIDs

func (m *ArtistMutation) RemovedCountriesIDs() (ids []int)

RemovedCountries returns the removed IDs of the "countries" edge to the Country entity.

func (*ArtistMutation) RemovedDirectedIDs

func (m *ArtistMutation) RemovedDirectedIDs() (ids []int)

RemovedDirected returns the removed IDs of the "directed" edge to the Movie entity.

func (*ArtistMutation) RemovedEdges

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

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

func (*ArtistMutation) RemovedIDs

func (m *ArtistMutation) 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 (*ArtistMutation) RemovedPicturesIDs

func (m *ArtistMutation) RemovedPicturesIDs() (ids []int)

RemovedPictures returns the removed IDs of the "pictures" edge to the Picture entity.

func (*ArtistMutation) RemovedWroteIDs

func (m *ArtistMutation) RemovedWroteIDs() (ids []int)

RemovedWrote returns the removed IDs of the "wrote" edge to the Movie entity.

func (*ArtistMutation) ResetActed

func (m *ArtistMutation) ResetActed()

ResetActed resets all changes to the "acted" edge.

func (*ArtistMutation) ResetBirthday

func (m *ArtistMutation) ResetBirthday()

ResetBirthday resets all changes to the "birthday" field.

func (*ArtistMutation) ResetCountries

func (m *ArtistMutation) ResetCountries()

ResetCountries resets all changes to the "countries" edge.

func (*ArtistMutation) ResetDirected

func (m *ArtistMutation) ResetDirected()

ResetDirected resets all changes to the "directed" edge.

func (*ArtistMutation) ResetEdge

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

func (m *ArtistMutation) 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 (*ArtistMutation) ResetName

func (m *ArtistMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ArtistMutation) ResetPictures

func (m *ArtistMutation) ResetPictures()

ResetPictures resets all changes to the "pictures" edge.

func (*ArtistMutation) ResetProfilePicture

func (m *ArtistMutation) ResetProfilePicture()

ResetProfilePicture resets all changes to the "profile_picture" edge.

func (*ArtistMutation) ResetWrote

func (m *ArtistMutation) ResetWrote()

ResetWrote resets all changes to the "wrote" edge.

func (*ArtistMutation) SetBirthday

func (m *ArtistMutation) SetBirthday(t time.Time)

SetBirthday sets the "birthday" field.

func (*ArtistMutation) SetField

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

func (m *ArtistMutation) SetName(s string)

SetName sets the "name" field.

func (*ArtistMutation) SetProfilePictureID

func (m *ArtistMutation) SetProfilePictureID(id int)

SetProfilePictureID sets the "profile_picture" edge to the Picture entity by id.

func (ArtistMutation) Tx

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

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

func (*ArtistMutation) Type

func (m *ArtistMutation) Type() string

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

func (*ArtistMutation) Where

func (m *ArtistMutation) Where(ps ...predicate.Artist)

Where appends a list predicates to the ArtistMutation builder.

func (*ArtistMutation) WroteCleared

func (m *ArtistMutation) WroteCleared() bool

WroteCleared reports if the "wrote" edge to the Movie entity was cleared.

func (*ArtistMutation) WroteIDs

func (m *ArtistMutation) WroteIDs() (ids []int)

WroteIDs returns the "wrote" edge IDs in the mutation.

type ArtistQuery

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

ArtistQuery is the builder for querying Artist entities.

func (*ArtistQuery) All

func (aq *ArtistQuery) All(ctx context.Context) ([]*Artist, error)

All executes the query and returns a list of Artists.

func (*ArtistQuery) AllX

func (aq *ArtistQuery) AllX(ctx context.Context) []*Artist

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

func (*ArtistQuery) Clone

func (aq *ArtistQuery) Clone() *ArtistQuery

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

func (*ArtistQuery) Count

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

Count returns the count of the given query.

func (*ArtistQuery) CountX

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

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

func (*ArtistQuery) Exist

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

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

func (*ArtistQuery) ExistX

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

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

func (*ArtistQuery) First

func (aq *ArtistQuery) First(ctx context.Context) (*Artist, error)

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

func (*ArtistQuery) FirstID

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

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

func (*ArtistQuery) FirstIDX

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

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

func (*ArtistQuery) FirstX

func (aq *ArtistQuery) FirstX(ctx context.Context) *Artist

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

func (*ArtistQuery) GroupBy

func (aq *ArtistQuery) GroupBy(field string, fields ...string) *ArtistGroupBy

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

func (*ArtistQuery) IDs

func (aq *ArtistQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ArtistQuery) IDsX

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

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

func (*ArtistQuery) Limit

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

Limit adds a limit step to the query.

func (*ArtistQuery) Offset

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

Offset adds an offset step to the query.

func (*ArtistQuery) Only

func (aq *ArtistQuery) Only(ctx context.Context) (*Artist, error)

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

func (*ArtistQuery) OnlyID

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

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

func (*ArtistQuery) OnlyIDX

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

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

func (*ArtistQuery) OnlyX

func (aq *ArtistQuery) OnlyX(ctx context.Context) *Artist

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

func (*ArtistQuery) Order

func (aq *ArtistQuery) Order(o ...OrderFunc) *ArtistQuery

Order adds an order step to the query.

func (*ArtistQuery) QueryActed

func (aq *ArtistQuery) QueryActed() *MovieQuery

QueryActed chains the current query on the "acted" edge.

func (*ArtistQuery) QueryCountries

func (aq *ArtistQuery) QueryCountries() *CountryQuery

QueryCountries chains the current query on the "countries" edge.

func (*ArtistQuery) QueryDirected

func (aq *ArtistQuery) QueryDirected() *MovieQuery

QueryDirected chains the current query on the "directed" edge.

func (*ArtistQuery) QueryPictures

func (aq *ArtistQuery) QueryPictures() *PictureQuery

QueryPictures chains the current query on the "pictures" edge.

func (*ArtistQuery) QueryProfilePicture

func (aq *ArtistQuery) QueryProfilePicture() *PictureQuery

QueryProfilePicture chains the current query on the "profile_picture" edge.

func (*ArtistQuery) QueryWrote

func (aq *ArtistQuery) QueryWrote() *MovieQuery

QueryWrote chains the current query on the "wrote" edge.

func (*ArtistQuery) Select

func (aq *ArtistQuery) Select(fields ...string) *ArtistSelect

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

func (*ArtistQuery) Unique

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

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

func (aq *ArtistQuery) Where(ps ...predicate.Artist) *ArtistQuery

Where adds a new predicate for the ArtistQuery builder.

func (*ArtistQuery) WithActed

func (aq *ArtistQuery) WithActed(opts ...func(*MovieQuery)) *ArtistQuery

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

func (*ArtistQuery) WithCountries

func (aq *ArtistQuery) WithCountries(opts ...func(*CountryQuery)) *ArtistQuery

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

func (*ArtistQuery) WithDirected

func (aq *ArtistQuery) WithDirected(opts ...func(*MovieQuery)) *ArtistQuery

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

func (*ArtistQuery) WithPictures

func (aq *ArtistQuery) WithPictures(opts ...func(*PictureQuery)) *ArtistQuery

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

func (*ArtistQuery) WithProfilePicture

func (aq *ArtistQuery) WithProfilePicture(opts ...func(*PictureQuery)) *ArtistQuery

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

func (*ArtistQuery) WithWrote

func (aq *ArtistQuery) WithWrote(opts ...func(*MovieQuery)) *ArtistQuery

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

type ArtistSelect

type ArtistSelect struct {
	*ArtistQuery
	// contains filtered or unexported fields
}

ArtistSelect is the builder for selecting fields of Artist entities.

func (*ArtistSelect) Bool

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

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

func (*ArtistSelect) BoolX

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

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

func (*ArtistSelect) Bools

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

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

func (*ArtistSelect) BoolsX

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

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

func (*ArtistSelect) Float64

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

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

func (*ArtistSelect) Float64X

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

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

func (*ArtistSelect) Float64s

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

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

func (*ArtistSelect) Float64sX

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

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

func (*ArtistSelect) Int

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

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

func (*ArtistSelect) IntX

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

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

func (*ArtistSelect) Ints

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

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

func (*ArtistSelect) IntsX

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

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

func (*ArtistSelect) Scan

func (as *ArtistSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ArtistSelect) ScanX

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

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

func (*ArtistSelect) String

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

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

func (*ArtistSelect) StringX

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

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

func (*ArtistSelect) Strings

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

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

func (*ArtistSelect) StringsX

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

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

type ArtistUpdate

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

ArtistUpdate is the builder for updating Artist entities.

func (*ArtistUpdate) AddActed

func (au *ArtistUpdate) AddActed(m ...*Movie) *ArtistUpdate

AddActed adds the "acted" edges to the Movie entity.

func (*ArtistUpdate) AddActedIDs

func (au *ArtistUpdate) AddActedIDs(ids ...int) *ArtistUpdate

AddActedIDs adds the "acted" edge to the Movie entity by IDs.

func (*ArtistUpdate) AddCountries

func (au *ArtistUpdate) AddCountries(c ...*Country) *ArtistUpdate

AddCountries adds the "countries" edges to the Country entity.

func (*ArtistUpdate) AddCountryIDs

func (au *ArtistUpdate) AddCountryIDs(ids ...int) *ArtistUpdate

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*ArtistUpdate) AddDirected

func (au *ArtistUpdate) AddDirected(m ...*Movie) *ArtistUpdate

AddDirected adds the "directed" edges to the Movie entity.

func (*ArtistUpdate) AddDirectedIDs

func (au *ArtistUpdate) AddDirectedIDs(ids ...int) *ArtistUpdate

AddDirectedIDs adds the "directed" edge to the Movie entity by IDs.

func (*ArtistUpdate) AddPictureIDs

func (au *ArtistUpdate) AddPictureIDs(ids ...int) *ArtistUpdate

AddPictureIDs adds the "pictures" edge to the Picture entity by IDs.

func (*ArtistUpdate) AddPictures

func (au *ArtistUpdate) AddPictures(p ...*Picture) *ArtistUpdate

AddPictures adds the "pictures" edges to the Picture entity.

func (*ArtistUpdate) AddWrote

func (au *ArtistUpdate) AddWrote(m ...*Movie) *ArtistUpdate

AddWrote adds the "wrote" edges to the Movie entity.

func (*ArtistUpdate) AddWroteIDs

func (au *ArtistUpdate) AddWroteIDs(ids ...int) *ArtistUpdate

AddWroteIDs adds the "wrote" edge to the Movie entity by IDs.

func (*ArtistUpdate) ClearActed

func (au *ArtistUpdate) ClearActed() *ArtistUpdate

ClearActed clears all "acted" edges to the Movie entity.

func (*ArtistUpdate) ClearBirthday

func (au *ArtistUpdate) ClearBirthday() *ArtistUpdate

ClearBirthday clears the value of the "birthday" field.

func (*ArtistUpdate) ClearCountries

func (au *ArtistUpdate) ClearCountries() *ArtistUpdate

ClearCountries clears all "countries" edges to the Country entity.

func (*ArtistUpdate) ClearDirected

func (au *ArtistUpdate) ClearDirected() *ArtistUpdate

ClearDirected clears all "directed" edges to the Movie entity.

func (*ArtistUpdate) ClearPictures

func (au *ArtistUpdate) ClearPictures() *ArtistUpdate

ClearPictures clears all "pictures" edges to the Picture entity.

func (*ArtistUpdate) ClearProfilePicture

func (au *ArtistUpdate) ClearProfilePicture() *ArtistUpdate

ClearProfilePicture clears the "profile_picture" edge to the Picture entity.

func (*ArtistUpdate) ClearWrote

func (au *ArtistUpdate) ClearWrote() *ArtistUpdate

ClearWrote clears all "wrote" edges to the Movie entity.

func (*ArtistUpdate) Exec

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

Exec executes the query.

func (*ArtistUpdate) ExecX

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

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

func (*ArtistUpdate) Mutation

func (au *ArtistUpdate) Mutation() *ArtistMutation

Mutation returns the ArtistMutation object of the builder.

func (*ArtistUpdate) RemoveActed

func (au *ArtistUpdate) RemoveActed(m ...*Movie) *ArtistUpdate

RemoveActed removes "acted" edges to Movie entities.

func (*ArtistUpdate) RemoveActedIDs

func (au *ArtistUpdate) RemoveActedIDs(ids ...int) *ArtistUpdate

RemoveActedIDs removes the "acted" edge to Movie entities by IDs.

func (*ArtistUpdate) RemoveCountries

func (au *ArtistUpdate) RemoveCountries(c ...*Country) *ArtistUpdate

RemoveCountries removes "countries" edges to Country entities.

func (*ArtistUpdate) RemoveCountryIDs

func (au *ArtistUpdate) RemoveCountryIDs(ids ...int) *ArtistUpdate

RemoveCountryIDs removes the "countries" edge to Country entities by IDs.

func (*ArtistUpdate) RemoveDirected

func (au *ArtistUpdate) RemoveDirected(m ...*Movie) *ArtistUpdate

RemoveDirected removes "directed" edges to Movie entities.

func (*ArtistUpdate) RemoveDirectedIDs

func (au *ArtistUpdate) RemoveDirectedIDs(ids ...int) *ArtistUpdate

RemoveDirectedIDs removes the "directed" edge to Movie entities by IDs.

func (*ArtistUpdate) RemovePictureIDs

func (au *ArtistUpdate) RemovePictureIDs(ids ...int) *ArtistUpdate

RemovePictureIDs removes the "pictures" edge to Picture entities by IDs.

func (*ArtistUpdate) RemovePictures

func (au *ArtistUpdate) RemovePictures(p ...*Picture) *ArtistUpdate

RemovePictures removes "pictures" edges to Picture entities.

func (*ArtistUpdate) RemoveWrote

func (au *ArtistUpdate) RemoveWrote(m ...*Movie) *ArtistUpdate

RemoveWrote removes "wrote" edges to Movie entities.

func (*ArtistUpdate) RemoveWroteIDs

func (au *ArtistUpdate) RemoveWroteIDs(ids ...int) *ArtistUpdate

RemoveWroteIDs removes the "wrote" edge to Movie entities by IDs.

func (*ArtistUpdate) Save

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

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

func (*ArtistUpdate) SaveX

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

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

func (*ArtistUpdate) SetBirthday

func (au *ArtistUpdate) SetBirthday(t time.Time) *ArtistUpdate

SetBirthday sets the "birthday" field.

func (*ArtistUpdate) SetName

func (au *ArtistUpdate) SetName(s string) *ArtistUpdate

SetName sets the "name" field.

func (*ArtistUpdate) SetNillableBirthday

func (au *ArtistUpdate) SetNillableBirthday(t *time.Time) *ArtistUpdate

SetNillableBirthday sets the "birthday" field if the given value is not nil.

func (*ArtistUpdate) SetNillableProfilePictureID

func (au *ArtistUpdate) SetNillableProfilePictureID(id *int) *ArtistUpdate

SetNillableProfilePictureID sets the "profile_picture" edge to the Picture entity by ID if the given value is not nil.

func (*ArtistUpdate) SetProfilePicture

func (au *ArtistUpdate) SetProfilePicture(p *Picture) *ArtistUpdate

SetProfilePicture sets the "profile_picture" edge to the Picture entity.

func (*ArtistUpdate) SetProfilePictureID

func (au *ArtistUpdate) SetProfilePictureID(id int) *ArtistUpdate

SetProfilePictureID sets the "profile_picture" edge to the Picture entity by ID.

func (*ArtistUpdate) Where

func (au *ArtistUpdate) Where(ps ...predicate.Artist) *ArtistUpdate

Where appends a list predicates to the ArtistUpdate builder.

type ArtistUpdateOne

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

ArtistUpdateOne is the builder for updating a single Artist entity.

func (*ArtistUpdateOne) AddActed

func (auo *ArtistUpdateOne) AddActed(m ...*Movie) *ArtistUpdateOne

AddActed adds the "acted" edges to the Movie entity.

func (*ArtistUpdateOne) AddActedIDs

func (auo *ArtistUpdateOne) AddActedIDs(ids ...int) *ArtistUpdateOne

AddActedIDs adds the "acted" edge to the Movie entity by IDs.

func (*ArtistUpdateOne) AddCountries

func (auo *ArtistUpdateOne) AddCountries(c ...*Country) *ArtistUpdateOne

AddCountries adds the "countries" edges to the Country entity.

func (*ArtistUpdateOne) AddCountryIDs

func (auo *ArtistUpdateOne) AddCountryIDs(ids ...int) *ArtistUpdateOne

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*ArtistUpdateOne) AddDirected

func (auo *ArtistUpdateOne) AddDirected(m ...*Movie) *ArtistUpdateOne

AddDirected adds the "directed" edges to the Movie entity.

func (*ArtistUpdateOne) AddDirectedIDs

func (auo *ArtistUpdateOne) AddDirectedIDs(ids ...int) *ArtistUpdateOne

AddDirectedIDs adds the "directed" edge to the Movie entity by IDs.

func (*ArtistUpdateOne) AddPictureIDs

func (auo *ArtistUpdateOne) AddPictureIDs(ids ...int) *ArtistUpdateOne

AddPictureIDs adds the "pictures" edge to the Picture entity by IDs.

func (*ArtistUpdateOne) AddPictures

func (auo *ArtistUpdateOne) AddPictures(p ...*Picture) *ArtistUpdateOne

AddPictures adds the "pictures" edges to the Picture entity.

func (*ArtistUpdateOne) AddWrote

func (auo *ArtistUpdateOne) AddWrote(m ...*Movie) *ArtistUpdateOne

AddWrote adds the "wrote" edges to the Movie entity.

func (*ArtistUpdateOne) AddWroteIDs

func (auo *ArtistUpdateOne) AddWroteIDs(ids ...int) *ArtistUpdateOne

AddWroteIDs adds the "wrote" edge to the Movie entity by IDs.

func (*ArtistUpdateOne) ClearActed

func (auo *ArtistUpdateOne) ClearActed() *ArtistUpdateOne

ClearActed clears all "acted" edges to the Movie entity.

func (*ArtistUpdateOne) ClearBirthday

func (auo *ArtistUpdateOne) ClearBirthday() *ArtistUpdateOne

ClearBirthday clears the value of the "birthday" field.

func (*ArtistUpdateOne) ClearCountries

func (auo *ArtistUpdateOne) ClearCountries() *ArtistUpdateOne

ClearCountries clears all "countries" edges to the Country entity.

func (*ArtistUpdateOne) ClearDirected

func (auo *ArtistUpdateOne) ClearDirected() *ArtistUpdateOne

ClearDirected clears all "directed" edges to the Movie entity.

func (*ArtistUpdateOne) ClearPictures

func (auo *ArtistUpdateOne) ClearPictures() *ArtistUpdateOne

ClearPictures clears all "pictures" edges to the Picture entity.

func (*ArtistUpdateOne) ClearProfilePicture

func (auo *ArtistUpdateOne) ClearProfilePicture() *ArtistUpdateOne

ClearProfilePicture clears the "profile_picture" edge to the Picture entity.

func (*ArtistUpdateOne) ClearWrote

func (auo *ArtistUpdateOne) ClearWrote() *ArtistUpdateOne

ClearWrote clears all "wrote" edges to the Movie entity.

func (*ArtistUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ArtistUpdateOne) ExecX

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

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

func (*ArtistUpdateOne) Mutation

func (auo *ArtistUpdateOne) Mutation() *ArtistMutation

Mutation returns the ArtistMutation object of the builder.

func (*ArtistUpdateOne) RemoveActed

func (auo *ArtistUpdateOne) RemoveActed(m ...*Movie) *ArtistUpdateOne

RemoveActed removes "acted" edges to Movie entities.

func (*ArtistUpdateOne) RemoveActedIDs

func (auo *ArtistUpdateOne) RemoveActedIDs(ids ...int) *ArtistUpdateOne

RemoveActedIDs removes the "acted" edge to Movie entities by IDs.

func (*ArtistUpdateOne) RemoveCountries

func (auo *ArtistUpdateOne) RemoveCountries(c ...*Country) *ArtistUpdateOne

RemoveCountries removes "countries" edges to Country entities.

func (*ArtistUpdateOne) RemoveCountryIDs

func (auo *ArtistUpdateOne) RemoveCountryIDs(ids ...int) *ArtistUpdateOne

RemoveCountryIDs removes the "countries" edge to Country entities by IDs.

func (*ArtistUpdateOne) RemoveDirected

func (auo *ArtistUpdateOne) RemoveDirected(m ...*Movie) *ArtistUpdateOne

RemoveDirected removes "directed" edges to Movie entities.

func (*ArtistUpdateOne) RemoveDirectedIDs

func (auo *ArtistUpdateOne) RemoveDirectedIDs(ids ...int) *ArtistUpdateOne

RemoveDirectedIDs removes the "directed" edge to Movie entities by IDs.

func (*ArtistUpdateOne) RemovePictureIDs

func (auo *ArtistUpdateOne) RemovePictureIDs(ids ...int) *ArtistUpdateOne

RemovePictureIDs removes the "pictures" edge to Picture entities by IDs.

func (*ArtistUpdateOne) RemovePictures

func (auo *ArtistUpdateOne) RemovePictures(p ...*Picture) *ArtistUpdateOne

RemovePictures removes "pictures" edges to Picture entities.

func (*ArtistUpdateOne) RemoveWrote

func (auo *ArtistUpdateOne) RemoveWrote(m ...*Movie) *ArtistUpdateOne

RemoveWrote removes "wrote" edges to Movie entities.

func (*ArtistUpdateOne) RemoveWroteIDs

func (auo *ArtistUpdateOne) RemoveWroteIDs(ids ...int) *ArtistUpdateOne

RemoveWroteIDs removes the "wrote" edge to Movie entities by IDs.

func (*ArtistUpdateOne) Save

func (auo *ArtistUpdateOne) Save(ctx context.Context) (*Artist, error)

Save executes the query and returns the updated Artist entity.

func (*ArtistUpdateOne) SaveX

func (auo *ArtistUpdateOne) SaveX(ctx context.Context) *Artist

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

func (*ArtistUpdateOne) Select

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

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

func (*ArtistUpdateOne) SetBirthday

func (auo *ArtistUpdateOne) SetBirthday(t time.Time) *ArtistUpdateOne

SetBirthday sets the "birthday" field.

func (*ArtistUpdateOne) SetName

func (auo *ArtistUpdateOne) SetName(s string) *ArtistUpdateOne

SetName sets the "name" field.

func (*ArtistUpdateOne) SetNillableBirthday

func (auo *ArtistUpdateOne) SetNillableBirthday(t *time.Time) *ArtistUpdateOne

SetNillableBirthday sets the "birthday" field if the given value is not nil.

func (*ArtistUpdateOne) SetNillableProfilePictureID

func (auo *ArtistUpdateOne) SetNillableProfilePictureID(id *int) *ArtistUpdateOne

SetNillableProfilePictureID sets the "profile_picture" edge to the Picture entity by ID if the given value is not nil.

func (*ArtistUpdateOne) SetProfilePicture

func (auo *ArtistUpdateOne) SetProfilePicture(p *Picture) *ArtistUpdateOne

SetProfilePicture sets the "profile_picture" edge to the Picture entity.

func (*ArtistUpdateOne) SetProfilePictureID

func (auo *ArtistUpdateOne) SetProfilePictureID(id int) *ArtistUpdateOne

SetProfilePictureID sets the "profile_picture" edge to the Picture entity by ID.

type Artists

type Artists []*Artist

Artists is a parsable slice of Artist.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Artist is the client for interacting with the Artist builders.
	Artist *ArtistClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Movie is the client for interacting with the Movie builders.
	Movie *MovieClient
	// MovieGenre is the client for interacting with the MovieGenre builders.
	MovieGenre *MovieGenreClient
	// Picture is the client for interacting with the Picture builders.
	Picture *PictureClient
	// Rating is the client for interacting with the Rating builders.
	Rating *RatingClient
	// 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().
	Artist.
	Query().
	Count(ctx)

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

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

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Countries

type Countries []*Country

Countries is a parsable slice of Country.

type Country

type Country struct {

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

Country is the model entity for the Country schema.

func (*Country) QueryArtists

func (c *Country) QueryArtists() *ArtistQuery

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

func (*Country) QueryMovies

func (c *Country) QueryMovies() *MovieQuery

QueryMovies queries the "movies" edge of the Country entity.

func (*Country) String

func (c *Country) String() string

String implements the fmt.Stringer.

func (*Country) Unwrap

func (c *Country) Unwrap() *Country

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

func (c *Country) Update() *CountryUpdateOne

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

type CountryClient

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

CountryClient is a client for the Country schema.

func NewCountryClient

func NewCountryClient(c config) *CountryClient

NewCountryClient returns a client for the Country from the given config.

func (*CountryClient) Create

func (c *CountryClient) Create() *CountryCreate

Create returns a create builder for Country.

func (*CountryClient) CreateBulk

func (c *CountryClient) CreateBulk(builders ...*CountryCreate) *CountryCreateBulk

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

func (*CountryClient) Delete

func (c *CountryClient) Delete() *CountryDelete

Delete returns a delete builder for Country.

func (*CountryClient) DeleteOne

func (c *CountryClient) DeleteOne(co *Country) *CountryDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*CountryClient) DeleteOneID

func (c *CountryClient) DeleteOneID(id int) *CountryDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*CountryClient) Get

func (c *CountryClient) Get(ctx context.Context, id int) (*Country, error)

Get returns a Country entity by its id.

func (*CountryClient) GetX

func (c *CountryClient) GetX(ctx context.Context, id int) *Country

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

func (*CountryClient) Hooks

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

Hooks returns the client hooks.

func (*CountryClient) Query

func (c *CountryClient) Query() *CountryQuery

Query returns a query builder for Country.

func (*CountryClient) QueryArtists

func (c *CountryClient) QueryArtists(co *Country) *ArtistQuery

QueryArtists queries the artists edge of a Country.

func (*CountryClient) QueryMovies

func (c *CountryClient) QueryMovies(co *Country) *MovieQuery

QueryMovies queries the movies edge of a Country.

func (*CountryClient) Update

func (c *CountryClient) Update() *CountryUpdate

Update returns an update builder for Country.

func (*CountryClient) UpdateOne

func (c *CountryClient) UpdateOne(co *Country) *CountryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CountryClient) UpdateOneID

func (c *CountryClient) UpdateOneID(id int) *CountryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CountryClient) Use

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

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

type CountryCreate

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

CountryCreate is the builder for creating a Country entity.

func (*CountryCreate) AddArtistIDs

func (cc *CountryCreate) AddArtistIDs(ids ...int) *CountryCreate

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

func (*CountryCreate) AddArtists

func (cc *CountryCreate) AddArtists(a ...*Artist) *CountryCreate

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

func (*CountryCreate) AddMovieIDs

func (cc *CountryCreate) AddMovieIDs(ids ...int) *CountryCreate

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*CountryCreate) AddMovies

func (cc *CountryCreate) AddMovies(m ...*Movie) *CountryCreate

AddMovies adds the "movies" edges to the Movie entity.

func (*CountryCreate) Exec

func (cc *CountryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryCreate) ExecX

func (cc *CountryCreate) ExecX(ctx context.Context)

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

func (*CountryCreate) Mutation

func (cc *CountryCreate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryCreate) Save

func (cc *CountryCreate) Save(ctx context.Context) (*Country, error)

Save creates the Country in the database.

func (*CountryCreate) SaveX

func (cc *CountryCreate) SaveX(ctx context.Context) *Country

SaveX calls Save and panics if Save returns an error.

func (*CountryCreate) SetCode

func (cc *CountryCreate) SetCode(s string) *CountryCreate

SetCode sets the "code" field.

func (*CountryCreate) SetName

func (cc *CountryCreate) SetName(s string) *CountryCreate

SetName sets the "name" field.

type CountryCreateBulk

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

CountryCreateBulk is the builder for creating many Country entities in bulk.

func (*CountryCreateBulk) Exec

func (ccb *CountryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryCreateBulk) ExecX

func (ccb *CountryCreateBulk) ExecX(ctx context.Context)

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

func (*CountryCreateBulk) Save

func (ccb *CountryCreateBulk) Save(ctx context.Context) ([]*Country, error)

Save creates the Country entities in the database.

func (*CountryCreateBulk) SaveX

func (ccb *CountryCreateBulk) SaveX(ctx context.Context) []*Country

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

type CountryDelete

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

CountryDelete is the builder for deleting a Country entity.

func (*CountryDelete) Exec

func (cd *CountryDelete) Exec(ctx context.Context) (int, error)

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

func (*CountryDelete) ExecX

func (cd *CountryDelete) ExecX(ctx context.Context) int

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

func (*CountryDelete) Where

func (cd *CountryDelete) Where(ps ...predicate.Country) *CountryDelete

Where appends a list predicates to the CountryDelete builder.

type CountryDeleteOne

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

CountryDeleteOne is the builder for deleting a single Country entity.

func (*CountryDeleteOne) Exec

func (cdo *CountryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CountryDeleteOne) ExecX

func (cdo *CountryDeleteOne) ExecX(ctx context.Context)

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

type CountryEdges

type CountryEdges struct {
	// Movies holds the value of the movies edge.
	Movies []*Movie `json:"movies,omitempty"`
	// Artists holds the value of the artists edge.
	Artists []*Artist `json:"artists,omitempty"`
	// contains filtered or unexported fields
}

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

func (CountryEdges) ArtistsOrErr

func (e CountryEdges) ArtistsOrErr() ([]*Artist, error)

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

func (CountryEdges) MoviesOrErr

func (e CountryEdges) MoviesOrErr() ([]*Movie, error)

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

type CountryGroupBy

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

CountryGroupBy is the group-by builder for Country entities.

func (*CountryGroupBy) Aggregate

func (cgb *CountryGroupBy) Aggregate(fns ...AggregateFunc) *CountryGroupBy

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

func (*CountryGroupBy) Bool

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

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

func (*CountryGroupBy) BoolX

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

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

func (*CountryGroupBy) Bools

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

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

func (*CountryGroupBy) BoolsX

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

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

func (*CountryGroupBy) Float64

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

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

func (*CountryGroupBy) Float64X

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

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

func (*CountryGroupBy) Float64s

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

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

func (*CountryGroupBy) Float64sX

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

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

func (*CountryGroupBy) Int

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

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

func (*CountryGroupBy) IntX

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

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

func (*CountryGroupBy) Ints

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

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

func (*CountryGroupBy) IntsX

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

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

func (*CountryGroupBy) Scan

func (cgb *CountryGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*CountryGroupBy) ScanX

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

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

func (*CountryGroupBy) String

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

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

func (*CountryGroupBy) StringX

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

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

func (*CountryGroupBy) Strings

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

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

func (*CountryGroupBy) StringsX

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

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

type CountryMutation

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

CountryMutation represents an operation that mutates the Country nodes in the graph.

func (*CountryMutation) AddArtistIDs

func (m *CountryMutation) AddArtistIDs(ids ...int)

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

func (*CountryMutation) AddField

func (m *CountryMutation) 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 (*CountryMutation) AddMovieIDs

func (m *CountryMutation) AddMovieIDs(ids ...int)

AddMovieIDs adds the "movies" edge to the Movie entity by ids.

func (*CountryMutation) AddedEdges

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

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

func (*CountryMutation) AddedField

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

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

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

func (*CountryMutation) AddedIDs

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

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

func (*CountryMutation) ArtistsCleared

func (m *CountryMutation) ArtistsCleared() bool

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

func (*CountryMutation) ArtistsIDs

func (m *CountryMutation) ArtistsIDs() (ids []int)

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

func (*CountryMutation) ClearArtists

func (m *CountryMutation) ClearArtists()

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

func (*CountryMutation) ClearEdge

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

func (m *CountryMutation) 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 (*CountryMutation) ClearMovies

func (m *CountryMutation) ClearMovies()

ClearMovies clears the "movies" edge to the Movie entity.

func (*CountryMutation) ClearedEdges

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

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

func (*CountryMutation) ClearedFields

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

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

func (CountryMutation) Client

func (m CountryMutation) 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 (*CountryMutation) Code

func (m *CountryMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*CountryMutation) EdgeCleared

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

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

func (*CountryMutation) Field

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

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

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

func (*CountryMutation) Fields

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

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

func (m *CountryMutation) 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 (*CountryMutation) MoviesCleared

func (m *CountryMutation) MoviesCleared() bool

MoviesCleared reports if the "movies" edge to the Movie entity was cleared.

func (*CountryMutation) MoviesIDs

func (m *CountryMutation) MoviesIDs() (ids []int)

MoviesIDs returns the "movies" edge IDs in the mutation.

func (*CountryMutation) Name

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

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

func (*CountryMutation) OldCode

func (m *CountryMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Country entity. If the Country 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 (*CountryMutation) OldField

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

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

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

func (m *CountryMutation) Op() Op

Op returns the operation name.

func (*CountryMutation) RemoveArtistIDs

func (m *CountryMutation) RemoveArtistIDs(ids ...int)

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

func (*CountryMutation) RemoveMovieIDs

func (m *CountryMutation) RemoveMovieIDs(ids ...int)

RemoveMovieIDs removes the "movies" edge to the Movie entity by IDs.

func (*CountryMutation) RemovedArtistsIDs

func (m *CountryMutation) RemovedArtistsIDs() (ids []int)

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

func (*CountryMutation) RemovedEdges

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

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

func (*CountryMutation) RemovedIDs

func (m *CountryMutation) 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 (*CountryMutation) RemovedMoviesIDs

func (m *CountryMutation) RemovedMoviesIDs() (ids []int)

RemovedMovies returns the removed IDs of the "movies" edge to the Movie entity.

func (*CountryMutation) ResetArtists

func (m *CountryMutation) ResetArtists()

ResetArtists resets all changes to the "artists" edge.

func (*CountryMutation) ResetCode

func (m *CountryMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*CountryMutation) ResetEdge

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

func (m *CountryMutation) 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 (*CountryMutation) ResetMovies

func (m *CountryMutation) ResetMovies()

ResetMovies resets all changes to the "movies" edge.

func (*CountryMutation) ResetName

func (m *CountryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CountryMutation) SetCode

func (m *CountryMutation) SetCode(s string)

SetCode sets the "code" field.

func (*CountryMutation) SetField

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

func (m *CountryMutation) SetName(s string)

SetName sets the "name" field.

func (CountryMutation) Tx

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

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

func (*CountryMutation) Type

func (m *CountryMutation) Type() string

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

func (*CountryMutation) Where

func (m *CountryMutation) Where(ps ...predicate.Country)

Where appends a list predicates to the CountryMutation builder.

type CountryQuery

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

CountryQuery is the builder for querying Country entities.

func (*CountryQuery) All

func (cq *CountryQuery) All(ctx context.Context) ([]*Country, error)

All executes the query and returns a list of Countries.

func (*CountryQuery) AllX

func (cq *CountryQuery) AllX(ctx context.Context) []*Country

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

func (*CountryQuery) Clone

func (cq *CountryQuery) Clone() *CountryQuery

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

func (*CountryQuery) Count

func (cq *CountryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CountryQuery) CountX

func (cq *CountryQuery) CountX(ctx context.Context) int

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

func (*CountryQuery) Exist

func (cq *CountryQuery) Exist(ctx context.Context) (bool, error)

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

func (*CountryQuery) ExistX

func (cq *CountryQuery) ExistX(ctx context.Context) bool

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

func (*CountryQuery) First

func (cq *CountryQuery) First(ctx context.Context) (*Country, error)

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

func (*CountryQuery) FirstID

func (cq *CountryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CountryQuery) FirstIDX

func (cq *CountryQuery) FirstIDX(ctx context.Context) int

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

func (*CountryQuery) FirstX

func (cq *CountryQuery) FirstX(ctx context.Context) *Country

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

func (*CountryQuery) GroupBy

func (cq *CountryQuery) GroupBy(field string, fields ...string) *CountryGroupBy

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

func (*CountryQuery) IDs

func (cq *CountryQuery) IDs(ctx context.Context) ([]int, error)

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

func (*CountryQuery) IDsX

func (cq *CountryQuery) IDsX(ctx context.Context) []int

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

func (*CountryQuery) Limit

func (cq *CountryQuery) Limit(limit int) *CountryQuery

Limit adds a limit step to the query.

func (*CountryQuery) Offset

func (cq *CountryQuery) Offset(offset int) *CountryQuery

Offset adds an offset step to the query.

func (*CountryQuery) Only

func (cq *CountryQuery) Only(ctx context.Context) (*Country, error)

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

func (*CountryQuery) OnlyID

func (cq *CountryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CountryQuery) OnlyIDX

func (cq *CountryQuery) OnlyIDX(ctx context.Context) int

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

func (*CountryQuery) OnlyX

func (cq *CountryQuery) OnlyX(ctx context.Context) *Country

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

func (*CountryQuery) Order

func (cq *CountryQuery) Order(o ...OrderFunc) *CountryQuery

Order adds an order step to the query.

func (*CountryQuery) QueryArtists

func (cq *CountryQuery) QueryArtists() *ArtistQuery

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

func (*CountryQuery) QueryMovies

func (cq *CountryQuery) QueryMovies() *MovieQuery

QueryMovies chains the current query on the "movies" edge.

func (*CountryQuery) Select

func (cq *CountryQuery) Select(fields ...string) *CountrySelect

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

func (*CountryQuery) Unique

func (cq *CountryQuery) Unique(unique bool) *CountryQuery

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

func (cq *CountryQuery) Where(ps ...predicate.Country) *CountryQuery

Where adds a new predicate for the CountryQuery builder.

func (*CountryQuery) WithArtists

func (cq *CountryQuery) WithArtists(opts ...func(*ArtistQuery)) *CountryQuery

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 (*CountryQuery) WithMovies

func (cq *CountryQuery) WithMovies(opts ...func(*MovieQuery)) *CountryQuery

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

type CountrySelect

type CountrySelect struct {
	*CountryQuery
	// contains filtered or unexported fields
}

CountrySelect is the builder for selecting fields of Country entities.

func (*CountrySelect) Bool

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

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

func (*CountrySelect) BoolX

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

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

func (*CountrySelect) Bools

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

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

func (*CountrySelect) BoolsX

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

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

func (*CountrySelect) Float64

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

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

func (*CountrySelect) Float64X

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

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

func (*CountrySelect) Float64s

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

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

func (*CountrySelect) Float64sX

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

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

func (*CountrySelect) Int

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

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

func (*CountrySelect) IntX

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

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

func (*CountrySelect) Ints

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

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

func (*CountrySelect) IntsX

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

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

func (*CountrySelect) Scan

func (cs *CountrySelect) Scan(ctx context.Context, v interface{}) error

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

func (*CountrySelect) ScanX

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

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

func (*CountrySelect) String

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

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

func (*CountrySelect) StringX

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

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

func (*CountrySelect) Strings

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

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

func (*CountrySelect) StringsX

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

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

type CountryUpdate

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

CountryUpdate is the builder for updating Country entities.

func (*CountryUpdate) AddArtistIDs

func (cu *CountryUpdate) AddArtistIDs(ids ...int) *CountryUpdate

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

func (*CountryUpdate) AddArtists

func (cu *CountryUpdate) AddArtists(a ...*Artist) *CountryUpdate

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

func (*CountryUpdate) AddMovieIDs

func (cu *CountryUpdate) AddMovieIDs(ids ...int) *CountryUpdate

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*CountryUpdate) AddMovies

func (cu *CountryUpdate) AddMovies(m ...*Movie) *CountryUpdate

AddMovies adds the "movies" edges to the Movie entity.

func (*CountryUpdate) ClearArtists

func (cu *CountryUpdate) ClearArtists() *CountryUpdate

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

func (*CountryUpdate) ClearMovies

func (cu *CountryUpdate) ClearMovies() *CountryUpdate

ClearMovies clears all "movies" edges to the Movie entity.

func (*CountryUpdate) Exec

func (cu *CountryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryUpdate) ExecX

func (cu *CountryUpdate) ExecX(ctx context.Context)

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

func (*CountryUpdate) Mutation

func (cu *CountryUpdate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdate) RemoveArtistIDs

func (cu *CountryUpdate) RemoveArtistIDs(ids ...int) *CountryUpdate

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

func (*CountryUpdate) RemoveArtists

func (cu *CountryUpdate) RemoveArtists(a ...*Artist) *CountryUpdate

RemoveArtists removes "artists" edges to Artist entities.

func (*CountryUpdate) RemoveMovieIDs

func (cu *CountryUpdate) RemoveMovieIDs(ids ...int) *CountryUpdate

RemoveMovieIDs removes the "movies" edge to Movie entities by IDs.

func (*CountryUpdate) RemoveMovies

func (cu *CountryUpdate) RemoveMovies(m ...*Movie) *CountryUpdate

RemoveMovies removes "movies" edges to Movie entities.

func (*CountryUpdate) Save

func (cu *CountryUpdate) Save(ctx context.Context) (int, error)

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

func (*CountryUpdate) SaveX

func (cu *CountryUpdate) SaveX(ctx context.Context) int

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

func (*CountryUpdate) SetCode

func (cu *CountryUpdate) SetCode(s string) *CountryUpdate

SetCode sets the "code" field.

func (*CountryUpdate) SetName

func (cu *CountryUpdate) SetName(s string) *CountryUpdate

SetName sets the "name" field.

func (*CountryUpdate) Where

func (cu *CountryUpdate) Where(ps ...predicate.Country) *CountryUpdate

Where appends a list predicates to the CountryUpdate builder.

type CountryUpdateOne

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

CountryUpdateOne is the builder for updating a single Country entity.

func (*CountryUpdateOne) AddArtistIDs

func (cuo *CountryUpdateOne) AddArtistIDs(ids ...int) *CountryUpdateOne

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

func (*CountryUpdateOne) AddArtists

func (cuo *CountryUpdateOne) AddArtists(a ...*Artist) *CountryUpdateOne

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

func (*CountryUpdateOne) AddMovieIDs

func (cuo *CountryUpdateOne) AddMovieIDs(ids ...int) *CountryUpdateOne

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*CountryUpdateOne) AddMovies

func (cuo *CountryUpdateOne) AddMovies(m ...*Movie) *CountryUpdateOne

AddMovies adds the "movies" edges to the Movie entity.

func (*CountryUpdateOne) ClearArtists

func (cuo *CountryUpdateOne) ClearArtists() *CountryUpdateOne

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

func (*CountryUpdateOne) ClearMovies

func (cuo *CountryUpdateOne) ClearMovies() *CountryUpdateOne

ClearMovies clears all "movies" edges to the Movie entity.

func (*CountryUpdateOne) Exec

func (cuo *CountryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CountryUpdateOne) ExecX

func (cuo *CountryUpdateOne) ExecX(ctx context.Context)

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

func (*CountryUpdateOne) Mutation

func (cuo *CountryUpdateOne) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdateOne) RemoveArtistIDs

func (cuo *CountryUpdateOne) RemoveArtistIDs(ids ...int) *CountryUpdateOne

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

func (*CountryUpdateOne) RemoveArtists

func (cuo *CountryUpdateOne) RemoveArtists(a ...*Artist) *CountryUpdateOne

RemoveArtists removes "artists" edges to Artist entities.

func (*CountryUpdateOne) RemoveMovieIDs

func (cuo *CountryUpdateOne) RemoveMovieIDs(ids ...int) *CountryUpdateOne

RemoveMovieIDs removes the "movies" edge to Movie entities by IDs.

func (*CountryUpdateOne) RemoveMovies

func (cuo *CountryUpdateOne) RemoveMovies(m ...*Movie) *CountryUpdateOne

RemoveMovies removes "movies" edges to Movie entities.

func (*CountryUpdateOne) Save

func (cuo *CountryUpdateOne) Save(ctx context.Context) (*Country, error)

Save executes the query and returns the updated Country entity.

func (*CountryUpdateOne) SaveX

func (cuo *CountryUpdateOne) SaveX(ctx context.Context) *Country

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

func (*CountryUpdateOne) Select

func (cuo *CountryUpdateOne) Select(field string, fields ...string) *CountryUpdateOne

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

func (*CountryUpdateOne) SetCode

func (cuo *CountryUpdateOne) SetCode(s string) *CountryUpdateOne

SetCode sets the "code" field.

func (*CountryUpdateOne) SetName

func (cuo *CountryUpdateOne) SetName(s string) *CountryUpdateOne

SetName sets the "name" field.

type File

type File struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Type holds the value of the "type" field.
	Type file.Type `json:"type,omitempty"`
	// ExternalID holds the value of the "external_id" field.
	ExternalID string `json:"external_id,omitempty"`
	// ExternalInfoProvider holds the value of the "external_info_provider" field.
	ExternalInfoProvider string `json:"external_info_provider,omitempty"`
	// Results holds the value of the "results" field.
	Results string `json:"results,omitempty"`
	// Synced holds the value of the "synced" field.
	Synced bool `json:"synced,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileQuery when eager-loading is set.
	Edges FileEdges `json:"edges"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) QueryMovie

func (f *File) QueryMovie() *MovieQuery

QueryMovie queries the "movie" edge of the File entity.

func (*File) String

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap

func (f *File) Unwrap() *File

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

func (f *File) Update() *FileUpdateOne

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

type FileClient

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

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a create builder for File.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

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

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(f *File) *FileDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id int) *FileDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id int) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id int) *File

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

func (*FileClient) Hooks

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

Hooks returns the client hooks.

func (*FileClient) Query

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) QueryMovie

func (c *FileClient) QueryMovie(f *File) *MovieQuery

QueryMovie queries the movie edge of a File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(f *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id int) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

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

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

type FileCreate

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

FileCreate is the builder for creating a File entity.

func (*FileCreate) Exec

func (fc *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecX

func (fc *FileCreate) ExecX(ctx context.Context)

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

func (*FileCreate) Mutation

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) Save

func (fc *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (fc *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetExternalID

func (fc *FileCreate) SetExternalID(s string) *FileCreate

SetExternalID sets the "external_id" field.

func (*FileCreate) SetExternalInfoProvider

func (fc *FileCreate) SetExternalInfoProvider(s string) *FileCreate

SetExternalInfoProvider sets the "external_info_provider" field.

func (*FileCreate) SetMovie

func (fc *FileCreate) SetMovie(m *Movie) *FileCreate

SetMovie sets the "movie" edge to the Movie entity.

func (*FileCreate) SetMovieID

func (fc *FileCreate) SetMovieID(id int) *FileCreate

SetMovieID sets the "movie" edge to the Movie entity by ID.

func (*FileCreate) SetName

func (fc *FileCreate) SetName(s string) *FileCreate

SetName sets the "name" field.

func (*FileCreate) SetNillableExternalID

func (fc *FileCreate) SetNillableExternalID(s *string) *FileCreate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*FileCreate) SetNillableExternalInfoProvider

func (fc *FileCreate) SetNillableExternalInfoProvider(s *string) *FileCreate

SetNillableExternalInfoProvider sets the "external_info_provider" field if the given value is not nil.

func (*FileCreate) SetNillableMovieID

func (fc *FileCreate) SetNillableMovieID(id *int) *FileCreate

SetNillableMovieID sets the "movie" edge to the Movie entity by ID if the given value is not nil.

func (*FileCreate) SetNillableResults

func (fc *FileCreate) SetNillableResults(s *string) *FileCreate

SetNillableResults sets the "results" field if the given value is not nil.

func (*FileCreate) SetNillableSynced

func (fc *FileCreate) SetNillableSynced(b *bool) *FileCreate

SetNillableSynced sets the "synced" field if the given value is not nil.

func (*FileCreate) SetPath

func (fc *FileCreate) SetPath(s string) *FileCreate

SetPath sets the "path" field.

func (*FileCreate) SetResults

func (fc *FileCreate) SetResults(s string) *FileCreate

SetResults sets the "results" field.

func (*FileCreate) SetSynced

func (fc *FileCreate) SetSynced(b bool) *FileCreate

SetSynced sets the "synced" field.

func (*FileCreate) SetType

func (fc *FileCreate) SetType(f file.Type) *FileCreate

SetType sets the "type" field.

type FileCreateBulk

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

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecX

func (fcb *FileCreateBulk) ExecX(ctx context.Context)

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

func (*FileCreateBulk) Save

func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File

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

type FileDelete

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

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (fd *FileDelete) Exec(ctx context.Context) (int, error)

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

func (*FileDelete) ExecX

func (fd *FileDelete) ExecX(ctx context.Context) int

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

func (*FileDelete) Where

func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

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

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (fdo *FileDeleteOne) ExecX(ctx context.Context)

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

type FileEdges

type FileEdges struct {
	// Movie holds the value of the movie edge.
	Movie *Movie `json:"movie,omitempty"`
	// contains filtered or unexported fields
}

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

func (FileEdges) MovieOrErr

func (e FileEdges) MovieOrErr() (*Movie, error)

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

type FileGroupBy

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

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

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

func (*FileGroupBy) Bool

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

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

func (*FileGroupBy) BoolX

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

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

func (*FileGroupBy) Bools

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

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

func (*FileGroupBy) BoolsX

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

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

func (*FileGroupBy) Float64

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

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

func (*FileGroupBy) Float64X

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

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

func (*FileGroupBy) Float64s

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

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

func (*FileGroupBy) Float64sX

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

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

func (*FileGroupBy) Int

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

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

func (*FileGroupBy) IntX

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

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

func (*FileGroupBy) Ints

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

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

func (*FileGroupBy) IntsX

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

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

func (*FileGroupBy) Scan

func (fgb *FileGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*FileGroupBy) ScanX

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

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

func (*FileGroupBy) String

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

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

func (*FileGroupBy) StringX

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

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

func (*FileGroupBy) Strings

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

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

func (*FileGroupBy) StringsX

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

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

type FileMutation

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

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddField

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

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

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

func (*FileMutation) AddedField

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

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

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

func (*FileMutation) AddedIDs

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

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

func (*FileMutation) ClearEdge

func (m *FileMutation) 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 (*FileMutation) ClearExternalID

func (m *FileMutation) ClearExternalID()

ClearExternalID clears the value of the "external_id" field.

func (*FileMutation) ClearExternalInfoProvider

func (m *FileMutation) ClearExternalInfoProvider()

ClearExternalInfoProvider clears the value of the "external_info_provider" field.

func (*FileMutation) ClearField

func (m *FileMutation) 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 (*FileMutation) ClearMovie

func (m *FileMutation) ClearMovie()

ClearMovie clears the "movie" edge to the Movie entity.

func (*FileMutation) ClearResults

func (m *FileMutation) ClearResults()

ClearResults clears the value of the "results" field.

func (*FileMutation) ClearedEdges

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

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

func (*FileMutation) ClearedFields

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

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

func (FileMutation) Client

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

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

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

func (*FileMutation) ExternalID

func (m *FileMutation) ExternalID() (r string, exists bool)

ExternalID returns the value of the "external_id" field in the mutation.

func (*FileMutation) ExternalIDCleared

func (m *FileMutation) ExternalIDCleared() bool

ExternalIDCleared returns if the "external_id" field was cleared in this mutation.

func (*FileMutation) ExternalInfoProvider

func (m *FileMutation) ExternalInfoProvider() (r string, exists bool)

ExternalInfoProvider returns the value of the "external_info_provider" field in the mutation.

func (*FileMutation) ExternalInfoProviderCleared

func (m *FileMutation) ExternalInfoProviderCleared() bool

ExternalInfoProviderCleared returns if the "external_info_provider" field was cleared in this mutation.

func (*FileMutation) Field

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

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

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

func (*FileMutation) Fields

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

func (m *FileMutation) GetType() (r file.Type, exists bool)

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

func (*FileMutation) ID

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

func (m *FileMutation) 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 (*FileMutation) MovieCleared

func (m *FileMutation) MovieCleared() bool

MovieCleared reports if the "movie" edge to the Movie entity was cleared.

func (*FileMutation) MovieID

func (m *FileMutation) MovieID() (id int, exists bool)

MovieID returns the "movie" edge ID in the mutation.

func (*FileMutation) MovieIDs

func (m *FileMutation) MovieIDs() (ids []int)

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

func (*FileMutation) Name

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

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

func (*FileMutation) OldExternalID

func (m *FileMutation) OldExternalID(ctx context.Context) (v string, err error)

OldExternalID returns the old "external_id" field's value of the File entity. If the File 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 (*FileMutation) OldExternalInfoProvider

func (m *FileMutation) OldExternalInfoProvider(ctx context.Context) (v string, err error)

OldExternalInfoProvider returns the old "external_info_provider" field's value of the File entity. If the File 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 (*FileMutation) OldField

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

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

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

func (m *FileMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the File entity. If the File 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 (*FileMutation) OldResults

func (m *FileMutation) OldResults(ctx context.Context) (v string, err error)

OldResults returns the old "results" field's value of the File entity. If the File 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 (*FileMutation) OldSynced

func (m *FileMutation) OldSynced(ctx context.Context) (v bool, err error)

OldSynced returns the old "synced" field's value of the File entity. If the File 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 (*FileMutation) OldType

func (m *FileMutation) OldType(ctx context.Context) (v file.Type, err error)

OldType returns the old "type" field's value of the File entity. If the File 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 (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) Path

func (m *FileMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*FileMutation) RemovedEdges

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

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

func (*FileMutation) RemovedIDs

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

func (m *FileMutation) 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 (*FileMutation) ResetExternalID

func (m *FileMutation) ResetExternalID()

ResetExternalID resets all changes to the "external_id" field.

func (*FileMutation) ResetExternalInfoProvider

func (m *FileMutation) ResetExternalInfoProvider()

ResetExternalInfoProvider resets all changes to the "external_info_provider" field.

func (*FileMutation) ResetField

func (m *FileMutation) 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 (*FileMutation) ResetMovie

func (m *FileMutation) ResetMovie()

ResetMovie resets all changes to the "movie" edge.

func (*FileMutation) ResetName

func (m *FileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileMutation) ResetPath

func (m *FileMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*FileMutation) ResetResults

func (m *FileMutation) ResetResults()

ResetResults resets all changes to the "results" field.

func (*FileMutation) ResetSynced

func (m *FileMutation) ResetSynced()

ResetSynced resets all changes to the "synced" field.

func (*FileMutation) ResetType

func (m *FileMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*FileMutation) Results

func (m *FileMutation) Results() (r string, exists bool)

Results returns the value of the "results" field in the mutation.

func (*FileMutation) ResultsCleared

func (m *FileMutation) ResultsCleared() bool

ResultsCleared returns if the "results" field was cleared in this mutation.

func (*FileMutation) SetExternalID

func (m *FileMutation) SetExternalID(s string)

SetExternalID sets the "external_id" field.

func (*FileMutation) SetExternalInfoProvider

func (m *FileMutation) SetExternalInfoProvider(s string)

SetExternalInfoProvider sets the "external_info_provider" field.

func (*FileMutation) SetField

func (m *FileMutation) 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 (*FileMutation) SetMovieID

func (m *FileMutation) SetMovieID(id int)

SetMovieID sets the "movie" edge to the Movie entity by id.

func (*FileMutation) SetName

func (m *FileMutation) SetName(s string)

SetName sets the "name" field.

func (*FileMutation) SetPath

func (m *FileMutation) SetPath(s string)

SetPath sets the "path" field.

func (*FileMutation) SetResults

func (m *FileMutation) SetResults(s string)

SetResults sets the "results" field.

func (*FileMutation) SetSynced

func (m *FileMutation) SetSynced(b bool)

SetSynced sets the "synced" field.

func (*FileMutation) SetType

func (m *FileMutation) SetType(f file.Type)

SetType sets the "type" field.

func (*FileMutation) Synced

func (m *FileMutation) Synced() (r bool, exists bool)

Synced returns the value of the "synced" field in the mutation.

func (FileMutation) Tx

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

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

func (*FileMutation) Type

func (m *FileMutation) Type() string

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

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

type FileQuery

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

FileQuery is the builder for querying File entities.

func (*FileQuery) All

func (fq *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (fq *FileQuery) AllX(ctx context.Context) []*File

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

func (*FileQuery) Clone

func (fq *FileQuery) Clone() *FileQuery

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

func (*FileQuery) Count

func (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (fq *FileQuery) CountX(ctx context.Context) int

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

func (*FileQuery) Exist

func (fq *FileQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileQuery) ExistX

func (fq *FileQuery) ExistX(ctx context.Context) bool

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

func (*FileQuery) First

func (fq *FileQuery) First(ctx context.Context) (*File, error)

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

func (*FileQuery) FirstID

func (fq *FileQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FileQuery) FirstIDX

func (fq *FileQuery) FirstIDX(ctx context.Context) int

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

func (*FileQuery) FirstX

func (fq *FileQuery) FirstX(ctx context.Context) *File

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

func (*FileQuery) GroupBy

func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

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

func (*FileQuery) IDs

func (fq *FileQuery) IDs(ctx context.Context) ([]int, error)

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

func (*FileQuery) IDsX

func (fq *FileQuery) IDsX(ctx context.Context) []int

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

func (*FileQuery) Limit

func (fq *FileQuery) Limit(limit int) *FileQuery

Limit adds a limit step to the query.

func (*FileQuery) Offset

func (fq *FileQuery) Offset(offset int) *FileQuery

Offset adds an offset step to the query.

func (*FileQuery) Only

func (fq *FileQuery) Only(ctx context.Context) (*File, error)

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

func (*FileQuery) OnlyID

func (fq *FileQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FileQuery) OnlyIDX

func (fq *FileQuery) OnlyIDX(ctx context.Context) int

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

func (*FileQuery) OnlyX

func (fq *FileQuery) OnlyX(ctx context.Context) *File

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

func (*FileQuery) Order

func (fq *FileQuery) Order(o ...OrderFunc) *FileQuery

Order adds an order step to the query.

func (*FileQuery) QueryMovie

func (fq *FileQuery) QueryMovie() *MovieQuery

QueryMovie chains the current query on the "movie" edge.

func (*FileQuery) Select

func (fq *FileQuery) Select(fields ...string) *FileSelect

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

func (*FileQuery) Unique

func (fq *FileQuery) Unique(unique bool) *FileQuery

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

func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WithMovie

func (fq *FileQuery) WithMovie(opts ...func(*MovieQuery)) *FileQuery

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

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Bool

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

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

func (*FileSelect) BoolX

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

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

func (*FileSelect) Bools

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

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

func (*FileSelect) BoolsX

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

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

func (*FileSelect) Float64

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

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

func (*FileSelect) Float64X

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

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

func (*FileSelect) Float64s

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

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

func (*FileSelect) Float64sX

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

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

func (*FileSelect) Int

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

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

func (*FileSelect) IntX

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

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

func (*FileSelect) Ints

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

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

func (*FileSelect) IntsX

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

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

func (*FileSelect) Scan

func (fs *FileSelect) Scan(ctx context.Context, v interface{}) error

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

func (*FileSelect) ScanX

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

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

func (*FileSelect) String

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

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

func (*FileSelect) StringX

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

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

func (*FileSelect) Strings

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

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

func (*FileSelect) StringsX

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

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

type FileUpdate

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

FileUpdate is the builder for updating File entities.

func (*FileUpdate) ClearExternalID

func (fu *FileUpdate) ClearExternalID() *FileUpdate

ClearExternalID clears the value of the "external_id" field.

func (*FileUpdate) ClearExternalInfoProvider

func (fu *FileUpdate) ClearExternalInfoProvider() *FileUpdate

ClearExternalInfoProvider clears the value of the "external_info_provider" field.

func (*FileUpdate) ClearMovie

func (fu *FileUpdate) ClearMovie() *FileUpdate

ClearMovie clears the "movie" edge to the Movie entity.

func (*FileUpdate) ClearResults

func (fu *FileUpdate) ClearResults() *FileUpdate

ClearResults clears the value of the "results" field.

func (*FileUpdate) Exec

func (fu *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecX

func (fu *FileUpdate) ExecX(ctx context.Context)

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

func (*FileUpdate) Mutation

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) Save

func (fu *FileUpdate) Save(ctx context.Context) (int, error)

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

func (*FileUpdate) SaveX

func (fu *FileUpdate) SaveX(ctx context.Context) int

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

func (*FileUpdate) SetExternalID

func (fu *FileUpdate) SetExternalID(s string) *FileUpdate

SetExternalID sets the "external_id" field.

func (*FileUpdate) SetExternalInfoProvider

func (fu *FileUpdate) SetExternalInfoProvider(s string) *FileUpdate

SetExternalInfoProvider sets the "external_info_provider" field.

func (*FileUpdate) SetMovie

func (fu *FileUpdate) SetMovie(m *Movie) *FileUpdate

SetMovie sets the "movie" edge to the Movie entity.

func (*FileUpdate) SetMovieID

func (fu *FileUpdate) SetMovieID(id int) *FileUpdate

SetMovieID sets the "movie" edge to the Movie entity by ID.

func (*FileUpdate) SetName

func (fu *FileUpdate) SetName(s string) *FileUpdate

SetName sets the "name" field.

func (*FileUpdate) SetNillableExternalID

func (fu *FileUpdate) SetNillableExternalID(s *string) *FileUpdate

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*FileUpdate) SetNillableExternalInfoProvider

func (fu *FileUpdate) SetNillableExternalInfoProvider(s *string) *FileUpdate

SetNillableExternalInfoProvider sets the "external_info_provider" field if the given value is not nil.

func (*FileUpdate) SetNillableMovieID

func (fu *FileUpdate) SetNillableMovieID(id *int) *FileUpdate

SetNillableMovieID sets the "movie" edge to the Movie entity by ID if the given value is not nil.

func (*FileUpdate) SetNillableResults

func (fu *FileUpdate) SetNillableResults(s *string) *FileUpdate

SetNillableResults sets the "results" field if the given value is not nil.

func (*FileUpdate) SetNillableSynced

func (fu *FileUpdate) SetNillableSynced(b *bool) *FileUpdate

SetNillableSynced sets the "synced" field if the given value is not nil.

func (*FileUpdate) SetPath

func (fu *FileUpdate) SetPath(s string) *FileUpdate

SetPath sets the "path" field.

func (*FileUpdate) SetResults

func (fu *FileUpdate) SetResults(s string) *FileUpdate

SetResults sets the "results" field.

func (*FileUpdate) SetSynced

func (fu *FileUpdate) SetSynced(b bool) *FileUpdate

SetSynced sets the "synced" field.

func (*FileUpdate) SetType

func (fu *FileUpdate) SetType(f file.Type) *FileUpdate

SetType sets the "type" field.

func (*FileUpdate) Where

func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

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

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) ClearExternalID

func (fuo *FileUpdateOne) ClearExternalID() *FileUpdateOne

ClearExternalID clears the value of the "external_id" field.

func (*FileUpdateOne) ClearExternalInfoProvider

func (fuo *FileUpdateOne) ClearExternalInfoProvider() *FileUpdateOne

ClearExternalInfoProvider clears the value of the "external_info_provider" field.

func (*FileUpdateOne) ClearMovie

func (fuo *FileUpdateOne) ClearMovie() *FileUpdateOne

ClearMovie clears the "movie" edge to the Movie entity.

func (*FileUpdateOne) ClearResults

func (fuo *FileUpdateOne) ClearResults() *FileUpdateOne

ClearResults clears the value of the "results" field.

func (*FileUpdateOne) Exec

func (fuo *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecX

func (fuo *FileUpdateOne) ExecX(ctx context.Context)

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

func (*FileUpdateOne) Mutation

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) Save

func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File

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

func (*FileUpdateOne) Select

func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

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

func (*FileUpdateOne) SetExternalID

func (fuo *FileUpdateOne) SetExternalID(s string) *FileUpdateOne

SetExternalID sets the "external_id" field.

func (*FileUpdateOne) SetExternalInfoProvider

func (fuo *FileUpdateOne) SetExternalInfoProvider(s string) *FileUpdateOne

SetExternalInfoProvider sets the "external_info_provider" field.

func (*FileUpdateOne) SetMovie

func (fuo *FileUpdateOne) SetMovie(m *Movie) *FileUpdateOne

SetMovie sets the "movie" edge to the Movie entity.

func (*FileUpdateOne) SetMovieID

func (fuo *FileUpdateOne) SetMovieID(id int) *FileUpdateOne

SetMovieID sets the "movie" edge to the Movie entity by ID.

func (*FileUpdateOne) SetName

func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne

SetName sets the "name" field.

func (*FileUpdateOne) SetNillableExternalID

func (fuo *FileUpdateOne) SetNillableExternalID(s *string) *FileUpdateOne

SetNillableExternalID sets the "external_id" field if the given value is not nil.

func (*FileUpdateOne) SetNillableExternalInfoProvider

func (fuo *FileUpdateOne) SetNillableExternalInfoProvider(s *string) *FileUpdateOne

SetNillableExternalInfoProvider sets the "external_info_provider" field if the given value is not nil.

func (*FileUpdateOne) SetNillableMovieID

func (fuo *FileUpdateOne) SetNillableMovieID(id *int) *FileUpdateOne

SetNillableMovieID sets the "movie" edge to the Movie entity by ID if the given value is not nil.

func (*FileUpdateOne) SetNillableResults

func (fuo *FileUpdateOne) SetNillableResults(s *string) *FileUpdateOne

SetNillableResults sets the "results" field if the given value is not nil.

func (*FileUpdateOne) SetNillableSynced

func (fuo *FileUpdateOne) SetNillableSynced(b *bool) *FileUpdateOne

SetNillableSynced sets the "synced" field if the given value is not nil.

func (*FileUpdateOne) SetPath

func (fuo *FileUpdateOne) SetPath(s string) *FileUpdateOne

SetPath sets the "path" field.

func (*FileUpdateOne) SetResults

func (fuo *FileUpdateOne) SetResults(s string) *FileUpdateOne

SetResults sets the "results" field.

func (*FileUpdateOne) SetSynced

func (fuo *FileUpdateOne) SetSynced(b bool) *FileUpdateOne

SetSynced sets the "synced" field.

func (*FileUpdateOne) SetType

func (fuo *FileUpdateOne) SetType(f file.Type) *FileUpdateOne

SetType sets the "type" field.

type Files

type Files []*File

Files is a parsable slice of File.

type Hook

type Hook = ent.Hook

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

type Movie

type Movie struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// OriginalTitle holds the value of the "original_title" field.
	OriginalTitle string `json:"original_title,omitempty"`
	// ReleaseDate holds the value of the "release_date" field.
	ReleaseDate time.Time `json:"release_date,omitempty"`
	// Plot holds the value of the "plot" field.
	Plot string `json:"plot,omitempty"`
	// Duration holds the value of the "duration" field.
	Duration int `json:"duration,omitempty"`
	// Watched holds the value of the "watched" field.
	Watched bool `json:"watched,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MovieQuery when eager-loading is set.
	Edges MovieEdges `json:"edges"`
	// contains filtered or unexported fields
}

Movie is the model entity for the Movie schema.

func (*Movie) QueryCast

func (m *Movie) QueryCast() *ArtistQuery

QueryCast queries the "cast" edge of the Movie entity.

func (*Movie) QueryCountries

func (m *Movie) QueryCountries() *CountryQuery

QueryCountries queries the "countries" edge of the Movie entity.

func (*Movie) QueryDirectors

func (m *Movie) QueryDirectors() *ArtistQuery

QueryDirectors queries the "directors" edge of the Movie entity.

func (*Movie) QueryFanart

func (m *Movie) QueryFanart() *PictureQuery

QueryFanart queries the "fanart" edge of the Movie entity.

func (*Movie) QueryFile

func (m *Movie) QueryFile() *FileQuery

QueryFile queries the "file" edge of the Movie entity.

func (*Movie) QueryGenres

func (m *Movie) QueryGenres() *MovieGenreQuery

QueryGenres queries the "genres" edge of the Movie entity.

func (*Movie) QueryPoster

func (m *Movie) QueryPoster() *PictureQuery

QueryPoster queries the "poster" edge of the Movie entity.

func (*Movie) QueryRatings

func (m *Movie) QueryRatings() *RatingQuery

QueryRatings queries the "ratings" edge of the Movie entity.

func (*Movie) QueryWriters

func (m *Movie) QueryWriters() *ArtistQuery

QueryWriters queries the "writers" edge of the Movie entity.

func (*Movie) String

func (m *Movie) String() string

String implements the fmt.Stringer.

func (*Movie) Unwrap

func (m *Movie) Unwrap() *Movie

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

func (m *Movie) Update() *MovieUpdateOne

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

type MovieClient

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

MovieClient is a client for the Movie schema.

func NewMovieClient

func NewMovieClient(c config) *MovieClient

NewMovieClient returns a client for the Movie from the given config.

func (*MovieClient) Create

func (c *MovieClient) Create() *MovieCreate

Create returns a create builder for Movie.

func (*MovieClient) CreateBulk

func (c *MovieClient) CreateBulk(builders ...*MovieCreate) *MovieCreateBulk

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

func (*MovieClient) Delete

func (c *MovieClient) Delete() *MovieDelete

Delete returns a delete builder for Movie.

func (*MovieClient) DeleteOne

func (c *MovieClient) DeleteOne(m *Movie) *MovieDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MovieClient) DeleteOneID

func (c *MovieClient) DeleteOneID(id int) *MovieDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MovieClient) Get

func (c *MovieClient) Get(ctx context.Context, id int) (*Movie, error)

Get returns a Movie entity by its id.

func (*MovieClient) GetX

func (c *MovieClient) GetX(ctx context.Context, id int) *Movie

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

func (*MovieClient) Hooks

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

Hooks returns the client hooks.

func (*MovieClient) Query

func (c *MovieClient) Query() *MovieQuery

Query returns a query builder for Movie.

func (*MovieClient) QueryCast

func (c *MovieClient) QueryCast(m *Movie) *ArtistQuery

QueryCast queries the cast edge of a Movie.

func (*MovieClient) QueryCountries

func (c *MovieClient) QueryCountries(m *Movie) *CountryQuery

QueryCountries queries the countries edge of a Movie.

func (*MovieClient) QueryDirectors

func (c *MovieClient) QueryDirectors(m *Movie) *ArtistQuery

QueryDirectors queries the directors edge of a Movie.

func (*MovieClient) QueryFanart

func (c *MovieClient) QueryFanart(m *Movie) *PictureQuery

QueryFanart queries the fanart edge of a Movie.

func (*MovieClient) QueryFile

func (c *MovieClient) QueryFile(m *Movie) *FileQuery

QueryFile queries the file edge of a Movie.

func (*MovieClient) QueryGenres

func (c *MovieClient) QueryGenres(m *Movie) *MovieGenreQuery

QueryGenres queries the genres edge of a Movie.

func (*MovieClient) QueryPoster

func (c *MovieClient) QueryPoster(m *Movie) *PictureQuery

QueryPoster queries the poster edge of a Movie.

func (*MovieClient) QueryRatings

func (c *MovieClient) QueryRatings(m *Movie) *RatingQuery

QueryRatings queries the ratings edge of a Movie.

func (*MovieClient) QueryWriters

func (c *MovieClient) QueryWriters(m *Movie) *ArtistQuery

QueryWriters queries the writers edge of a Movie.

func (*MovieClient) Update

func (c *MovieClient) Update() *MovieUpdate

Update returns an update builder for Movie.

func (*MovieClient) UpdateOne

func (c *MovieClient) UpdateOne(m *Movie) *MovieUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MovieClient) UpdateOneID

func (c *MovieClient) UpdateOneID(id int) *MovieUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MovieClient) Use

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

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

type MovieCreate

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

MovieCreate is the builder for creating a Movie entity.

func (*MovieCreate) AddCast

func (mc *MovieCreate) AddCast(a ...*Artist) *MovieCreate

AddCast adds the "cast" edges to the Artist entity.

func (*MovieCreate) AddCastIDs

func (mc *MovieCreate) AddCastIDs(ids ...int) *MovieCreate

AddCastIDs adds the "cast" edge to the Artist entity by IDs.

func (*MovieCreate) AddCountries

func (mc *MovieCreate) AddCountries(c ...*Country) *MovieCreate

AddCountries adds the "countries" edges to the Country entity.

func (*MovieCreate) AddCountryIDs

func (mc *MovieCreate) AddCountryIDs(ids ...int) *MovieCreate

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*MovieCreate) AddDirectorIDs

func (mc *MovieCreate) AddDirectorIDs(ids ...int) *MovieCreate

AddDirectorIDs adds the "directors" edge to the Artist entity by IDs.

func (*MovieCreate) AddDirectors

func (mc *MovieCreate) AddDirectors(a ...*Artist) *MovieCreate

AddDirectors adds the "directors" edges to the Artist entity.

func (*MovieCreate) AddFanart

func (mc *MovieCreate) AddFanart(p ...*Picture) *MovieCreate

AddFanart adds the "fanart" edges to the Picture entity.

func (*MovieCreate) AddFanartIDs

func (mc *MovieCreate) AddFanartIDs(ids ...int) *MovieCreate

AddFanartIDs adds the "fanart" edge to the Picture entity by IDs.

func (*MovieCreate) AddGenreIDs

func (mc *MovieCreate) AddGenreIDs(ids ...int) *MovieCreate

AddGenreIDs adds the "genres" edge to the MovieGenre entity by IDs.

func (*MovieCreate) AddGenres

func (mc *MovieCreate) AddGenres(m ...*MovieGenre) *MovieCreate

AddGenres adds the "genres" edges to the MovieGenre entity.

func (*MovieCreate) AddRatingIDs

func (mc *MovieCreate) AddRatingIDs(ids ...int) *MovieCreate

AddRatingIDs adds the "ratings" edge to the Rating entity by IDs.

func (*MovieCreate) AddRatings

func (mc *MovieCreate) AddRatings(r ...*Rating) *MovieCreate

AddRatings adds the "ratings" edges to the Rating entity.

func (*MovieCreate) AddWriterIDs

func (mc *MovieCreate) AddWriterIDs(ids ...int) *MovieCreate

AddWriterIDs adds the "writers" edge to the Artist entity by IDs.

func (*MovieCreate) AddWriters

func (mc *MovieCreate) AddWriters(a ...*Artist) *MovieCreate

AddWriters adds the "writers" edges to the Artist entity.

func (*MovieCreate) Exec

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

Exec executes the query.

func (*MovieCreate) ExecX

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

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

func (*MovieCreate) Mutation

func (mc *MovieCreate) Mutation() *MovieMutation

Mutation returns the MovieMutation object of the builder.

func (*MovieCreate) Save

func (mc *MovieCreate) Save(ctx context.Context) (*Movie, error)

Save creates the Movie in the database.

func (*MovieCreate) SaveX

func (mc *MovieCreate) SaveX(ctx context.Context) *Movie

SaveX calls Save and panics if Save returns an error.

func (*MovieCreate) SetDuration

func (mc *MovieCreate) SetDuration(i int) *MovieCreate

SetDuration sets the "duration" field.

func (*MovieCreate) SetFile

func (mc *MovieCreate) SetFile(f *File) *MovieCreate

SetFile sets the "file" edge to the File entity.

func (*MovieCreate) SetFileID

func (mc *MovieCreate) SetFileID(id int) *MovieCreate

SetFileID sets the "file" edge to the File entity by ID.

func (*MovieCreate) SetNillableDuration

func (mc *MovieCreate) SetNillableDuration(i *int) *MovieCreate

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*MovieCreate) SetNillableFileID

func (mc *MovieCreate) SetNillableFileID(id *int) *MovieCreate

SetNillableFileID sets the "file" edge to the File entity by ID if the given value is not nil.

func (*MovieCreate) SetNillableOriginalTitle

func (mc *MovieCreate) SetNillableOriginalTitle(s *string) *MovieCreate

SetNillableOriginalTitle sets the "original_title" field if the given value is not nil.

func (*MovieCreate) SetNillablePlot

func (mc *MovieCreate) SetNillablePlot(s *string) *MovieCreate

SetNillablePlot sets the "plot" field if the given value is not nil.

func (*MovieCreate) SetNillablePosterID

func (mc *MovieCreate) SetNillablePosterID(id *int) *MovieCreate

SetNillablePosterID sets the "poster" edge to the Picture entity by ID if the given value is not nil.

func (*MovieCreate) SetNillableReleaseDate

func (mc *MovieCreate) SetNillableReleaseDate(t *time.Time) *MovieCreate

SetNillableReleaseDate sets the "release_date" field if the given value is not nil.

func (*MovieCreate) SetNillableWatched

func (mc *MovieCreate) SetNillableWatched(b *bool) *MovieCreate

SetNillableWatched sets the "watched" field if the given value is not nil.

func (*MovieCreate) SetOriginalTitle

func (mc *MovieCreate) SetOriginalTitle(s string) *MovieCreate

SetOriginalTitle sets the "original_title" field.

func (*MovieCreate) SetPlot

func (mc *MovieCreate) SetPlot(s string) *MovieCreate

SetPlot sets the "plot" field.

func (*MovieCreate) SetPoster

func (mc *MovieCreate) SetPoster(p *Picture) *MovieCreate

SetPoster sets the "poster" edge to the Picture entity.

func (*MovieCreate) SetPosterID

func (mc *MovieCreate) SetPosterID(id int) *MovieCreate

SetPosterID sets the "poster" edge to the Picture entity by ID.

func (*MovieCreate) SetReleaseDate

func (mc *MovieCreate) SetReleaseDate(t time.Time) *MovieCreate

SetReleaseDate sets the "release_date" field.

func (*MovieCreate) SetTitle

func (mc *MovieCreate) SetTitle(s string) *MovieCreate

SetTitle sets the "title" field.

func (*MovieCreate) SetWatched

func (mc *MovieCreate) SetWatched(b bool) *MovieCreate

SetWatched sets the "watched" field.

type MovieCreateBulk

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

MovieCreateBulk is the builder for creating many Movie entities in bulk.

func (*MovieCreateBulk) Exec

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

Exec executes the query.

func (*MovieCreateBulk) ExecX

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

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

func (*MovieCreateBulk) Save

func (mcb *MovieCreateBulk) Save(ctx context.Context) ([]*Movie, error)

Save creates the Movie entities in the database.

func (*MovieCreateBulk) SaveX

func (mcb *MovieCreateBulk) SaveX(ctx context.Context) []*Movie

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

type MovieDelete

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

MovieDelete is the builder for deleting a Movie entity.

func (*MovieDelete) Exec

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

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

func (*MovieDelete) ExecX

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

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

func (*MovieDelete) Where

func (md *MovieDelete) Where(ps ...predicate.Movie) *MovieDelete

Where appends a list predicates to the MovieDelete builder.

type MovieDeleteOne

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

MovieDeleteOne is the builder for deleting a single Movie entity.

func (*MovieDeleteOne) Exec

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

Exec executes the deletion query.

func (*MovieDeleteOne) ExecX

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

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

type MovieEdges

type MovieEdges struct {
	// File holds the value of the file edge.
	File *File `json:"file,omitempty"`
	// Ratings holds the value of the ratings edge.
	Ratings []*Rating `json:"ratings,omitempty"`
	// Poster holds the value of the poster edge.
	Poster *Picture `json:"poster,omitempty"`
	// Fanart holds the value of the fanart edge.
	Fanart []*Picture `json:"fanart,omitempty"`
	// Cast holds the value of the cast edge.
	Cast []*Artist `json:"cast,omitempty"`
	// Directors holds the value of the directors edge.
	Directors []*Artist `json:"directors,omitempty"`
	// Writers holds the value of the writers edge.
	Writers []*Artist `json:"writers,omitempty"`
	// Genres holds the value of the genres edge.
	Genres []*MovieGenre `json:"genres,omitempty"`
	// Countries holds the value of the countries edge.
	Countries []*Country `json:"countries,omitempty"`
	// contains filtered or unexported fields
}

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

func (MovieEdges) CastOrErr

func (e MovieEdges) CastOrErr() ([]*Artist, error)

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

func (MovieEdges) CountriesOrErr

func (e MovieEdges) CountriesOrErr() ([]*Country, error)

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

func (MovieEdges) DirectorsOrErr

func (e MovieEdges) DirectorsOrErr() ([]*Artist, error)

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

func (MovieEdges) FanartOrErr

func (e MovieEdges) FanartOrErr() ([]*Picture, error)

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

func (MovieEdges) FileOrErr

func (e MovieEdges) FileOrErr() (*File, 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 (MovieEdges) GenresOrErr

func (e MovieEdges) GenresOrErr() ([]*MovieGenre, error)

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

func (MovieEdges) PosterOrErr

func (e MovieEdges) PosterOrErr() (*Picture, error)

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

func (MovieEdges) RatingsOrErr

func (e MovieEdges) RatingsOrErr() ([]*Rating, error)

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

func (MovieEdges) WritersOrErr

func (e MovieEdges) WritersOrErr() ([]*Artist, error)

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

type MovieGenre

type MovieGenre struct {

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

MovieGenre is the model entity for the MovieGenre schema.

func (*MovieGenre) QueryMovies

func (mg *MovieGenre) QueryMovies() *MovieQuery

QueryMovies queries the "movies" edge of the MovieGenre entity.

func (*MovieGenre) String

func (mg *MovieGenre) String() string

String implements the fmt.Stringer.

func (*MovieGenre) Unwrap

func (mg *MovieGenre) Unwrap() *MovieGenre

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

func (mg *MovieGenre) Update() *MovieGenreUpdateOne

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

type MovieGenreClient

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

MovieGenreClient is a client for the MovieGenre schema.

func NewMovieGenreClient

func NewMovieGenreClient(c config) *MovieGenreClient

NewMovieGenreClient returns a client for the MovieGenre from the given config.

func (*MovieGenreClient) Create

func (c *MovieGenreClient) Create() *MovieGenreCreate

Create returns a create builder for MovieGenre.

func (*MovieGenreClient) CreateBulk

func (c *MovieGenreClient) CreateBulk(builders ...*MovieGenreCreate) *MovieGenreCreateBulk

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

func (*MovieGenreClient) Delete

func (c *MovieGenreClient) Delete() *MovieGenreDelete

Delete returns a delete builder for MovieGenre.

func (*MovieGenreClient) DeleteOne

func (c *MovieGenreClient) DeleteOne(mg *MovieGenre) *MovieGenreDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MovieGenreClient) DeleteOneID

func (c *MovieGenreClient) DeleteOneID(id int) *MovieGenreDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MovieGenreClient) Get

func (c *MovieGenreClient) Get(ctx context.Context, id int) (*MovieGenre, error)

Get returns a MovieGenre entity by its id.

func (*MovieGenreClient) GetX

func (c *MovieGenreClient) GetX(ctx context.Context, id int) *MovieGenre

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

func (*MovieGenreClient) Hooks

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

Hooks returns the client hooks.

func (*MovieGenreClient) Query

func (c *MovieGenreClient) Query() *MovieGenreQuery

Query returns a query builder for MovieGenre.

func (*MovieGenreClient) QueryMovies

func (c *MovieGenreClient) QueryMovies(mg *MovieGenre) *MovieQuery

QueryMovies queries the movies edge of a MovieGenre.

func (*MovieGenreClient) Update

func (c *MovieGenreClient) Update() *MovieGenreUpdate

Update returns an update builder for MovieGenre.

func (*MovieGenreClient) UpdateOne

func (c *MovieGenreClient) UpdateOne(mg *MovieGenre) *MovieGenreUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MovieGenreClient) UpdateOneID

func (c *MovieGenreClient) UpdateOneID(id int) *MovieGenreUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MovieGenreClient) Use

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

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

type MovieGenreCreate

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

MovieGenreCreate is the builder for creating a MovieGenre entity.

func (*MovieGenreCreate) AddMovieIDs

func (mgc *MovieGenreCreate) AddMovieIDs(ids ...int) *MovieGenreCreate

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*MovieGenreCreate) AddMovies

func (mgc *MovieGenreCreate) AddMovies(m ...*Movie) *MovieGenreCreate

AddMovies adds the "movies" edges to the Movie entity.

func (*MovieGenreCreate) Exec

func (mgc *MovieGenreCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieGenreCreate) ExecX

func (mgc *MovieGenreCreate) ExecX(ctx context.Context)

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

func (*MovieGenreCreate) Mutation

func (mgc *MovieGenreCreate) Mutation() *MovieGenreMutation

Mutation returns the MovieGenreMutation object of the builder.

func (*MovieGenreCreate) Save

func (mgc *MovieGenreCreate) Save(ctx context.Context) (*MovieGenre, error)

Save creates the MovieGenre in the database.

func (*MovieGenreCreate) SaveX

func (mgc *MovieGenreCreate) SaveX(ctx context.Context) *MovieGenre

SaveX calls Save and panics if Save returns an error.

func (*MovieGenreCreate) SetName

func (mgc *MovieGenreCreate) SetName(s string) *MovieGenreCreate

SetName sets the "name" field.

type MovieGenreCreateBulk

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

MovieGenreCreateBulk is the builder for creating many MovieGenre entities in bulk.

func (*MovieGenreCreateBulk) Exec

func (mgcb *MovieGenreCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieGenreCreateBulk) ExecX

func (mgcb *MovieGenreCreateBulk) ExecX(ctx context.Context)

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

func (*MovieGenreCreateBulk) Save

func (mgcb *MovieGenreCreateBulk) Save(ctx context.Context) ([]*MovieGenre, error)

Save creates the MovieGenre entities in the database.

func (*MovieGenreCreateBulk) SaveX

func (mgcb *MovieGenreCreateBulk) SaveX(ctx context.Context) []*MovieGenre

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

type MovieGenreDelete

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

MovieGenreDelete is the builder for deleting a MovieGenre entity.

func (*MovieGenreDelete) Exec

func (mgd *MovieGenreDelete) Exec(ctx context.Context) (int, error)

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

func (*MovieGenreDelete) ExecX

func (mgd *MovieGenreDelete) ExecX(ctx context.Context) int

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

func (*MovieGenreDelete) Where

Where appends a list predicates to the MovieGenreDelete builder.

type MovieGenreDeleteOne

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

MovieGenreDeleteOne is the builder for deleting a single MovieGenre entity.

func (*MovieGenreDeleteOne) Exec

func (mgdo *MovieGenreDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MovieGenreDeleteOne) ExecX

func (mgdo *MovieGenreDeleteOne) ExecX(ctx context.Context)

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

type MovieGenreEdges

type MovieGenreEdges struct {
	// Movies holds the value of the movies edge.
	Movies []*Movie `json:"movies,omitempty"`
	// contains filtered or unexported fields
}

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

func (MovieGenreEdges) MoviesOrErr

func (e MovieGenreEdges) MoviesOrErr() ([]*Movie, error)

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

type MovieGenreGroupBy

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

MovieGenreGroupBy is the group-by builder for MovieGenre entities.

func (*MovieGenreGroupBy) Aggregate

func (mggb *MovieGenreGroupBy) Aggregate(fns ...AggregateFunc) *MovieGenreGroupBy

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

func (*MovieGenreGroupBy) Bool

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

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

func (*MovieGenreGroupBy) BoolX

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

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

func (*MovieGenreGroupBy) Bools

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

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

func (*MovieGenreGroupBy) BoolsX

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

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

func (*MovieGenreGroupBy) Float64

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

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

func (*MovieGenreGroupBy) Float64X

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

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

func (*MovieGenreGroupBy) Float64s

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

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

func (*MovieGenreGroupBy) Float64sX

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

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

func (*MovieGenreGroupBy) Int

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

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

func (*MovieGenreGroupBy) IntX

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

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

func (*MovieGenreGroupBy) Ints

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

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

func (*MovieGenreGroupBy) IntsX

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

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

func (*MovieGenreGroupBy) Scan

func (mggb *MovieGenreGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MovieGenreGroupBy) ScanX

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

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

func (*MovieGenreGroupBy) String

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

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

func (*MovieGenreGroupBy) StringX

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

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

func (*MovieGenreGroupBy) Strings

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

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

func (*MovieGenreGroupBy) StringsX

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

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

type MovieGenreMutation

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

MovieGenreMutation represents an operation that mutates the MovieGenre nodes in the graph.

func (*MovieGenreMutation) AddField

func (m *MovieGenreMutation) 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 (*MovieGenreMutation) AddMovieIDs

func (m *MovieGenreMutation) AddMovieIDs(ids ...int)

AddMovieIDs adds the "movies" edge to the Movie entity by ids.

func (*MovieGenreMutation) AddedEdges

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

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

func (*MovieGenreMutation) AddedField

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

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

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

func (*MovieGenreMutation) AddedIDs

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

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

func (*MovieGenreMutation) ClearEdge

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

func (m *MovieGenreMutation) 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 (*MovieGenreMutation) ClearMovies

func (m *MovieGenreMutation) ClearMovies()

ClearMovies clears the "movies" edge to the Movie entity.

func (*MovieGenreMutation) ClearedEdges

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

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

func (*MovieGenreMutation) ClearedFields

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

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

func (MovieGenreMutation) Client

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

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

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

func (*MovieGenreMutation) Field

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

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

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

func (*MovieGenreMutation) Fields

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

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

func (m *MovieGenreMutation) 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 (*MovieGenreMutation) MoviesCleared

func (m *MovieGenreMutation) MoviesCleared() bool

MoviesCleared reports if the "movies" edge to the Movie entity was cleared.

func (*MovieGenreMutation) MoviesIDs

func (m *MovieGenreMutation) MoviesIDs() (ids []int)

MoviesIDs returns the "movies" edge IDs in the mutation.

func (*MovieGenreMutation) Name

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

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

func (*MovieGenreMutation) OldField

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

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

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

func (m *MovieGenreMutation) Op() Op

Op returns the operation name.

func (*MovieGenreMutation) RemoveMovieIDs

func (m *MovieGenreMutation) RemoveMovieIDs(ids ...int)

RemoveMovieIDs removes the "movies" edge to the Movie entity by IDs.

func (*MovieGenreMutation) RemovedEdges

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

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

func (*MovieGenreMutation) RemovedIDs

func (m *MovieGenreMutation) 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 (*MovieGenreMutation) RemovedMoviesIDs

func (m *MovieGenreMutation) RemovedMoviesIDs() (ids []int)

RemovedMovies returns the removed IDs of the "movies" edge to the Movie entity.

func (*MovieGenreMutation) ResetEdge

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

func (m *MovieGenreMutation) 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 (*MovieGenreMutation) ResetMovies

func (m *MovieGenreMutation) ResetMovies()

ResetMovies resets all changes to the "movies" edge.

func (*MovieGenreMutation) ResetName

func (m *MovieGenreMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MovieGenreMutation) SetField

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

func (m *MovieGenreMutation) SetName(s string)

SetName sets the "name" field.

func (MovieGenreMutation) Tx

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

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

func (*MovieGenreMutation) Type

func (m *MovieGenreMutation) Type() string

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

func (*MovieGenreMutation) Where

func (m *MovieGenreMutation) Where(ps ...predicate.MovieGenre)

Where appends a list predicates to the MovieGenreMutation builder.

type MovieGenreQuery

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

MovieGenreQuery is the builder for querying MovieGenre entities.

func (*MovieGenreQuery) All

func (mgq *MovieGenreQuery) All(ctx context.Context) ([]*MovieGenre, error)

All executes the query and returns a list of MovieGenres.

func (*MovieGenreQuery) AllX

func (mgq *MovieGenreQuery) AllX(ctx context.Context) []*MovieGenre

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

func (*MovieGenreQuery) Clone

func (mgq *MovieGenreQuery) Clone() *MovieGenreQuery

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

func (*MovieGenreQuery) Count

func (mgq *MovieGenreQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MovieGenreQuery) CountX

func (mgq *MovieGenreQuery) CountX(ctx context.Context) int

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

func (*MovieGenreQuery) Exist

func (mgq *MovieGenreQuery) Exist(ctx context.Context) (bool, error)

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

func (*MovieGenreQuery) ExistX

func (mgq *MovieGenreQuery) ExistX(ctx context.Context) bool

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

func (*MovieGenreQuery) First

func (mgq *MovieGenreQuery) First(ctx context.Context) (*MovieGenre, error)

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

func (*MovieGenreQuery) FirstID

func (mgq *MovieGenreQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MovieGenreQuery) FirstIDX

func (mgq *MovieGenreQuery) FirstIDX(ctx context.Context) int

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

func (*MovieGenreQuery) FirstX

func (mgq *MovieGenreQuery) FirstX(ctx context.Context) *MovieGenre

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

func (*MovieGenreQuery) GroupBy

func (mgq *MovieGenreQuery) GroupBy(field string, fields ...string) *MovieGenreGroupBy

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

func (*MovieGenreQuery) IDs

func (mgq *MovieGenreQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MovieGenreQuery) IDsX

func (mgq *MovieGenreQuery) IDsX(ctx context.Context) []int

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

func (*MovieGenreQuery) Limit

func (mgq *MovieGenreQuery) Limit(limit int) *MovieGenreQuery

Limit adds a limit step to the query.

func (*MovieGenreQuery) Offset

func (mgq *MovieGenreQuery) Offset(offset int) *MovieGenreQuery

Offset adds an offset step to the query.

func (*MovieGenreQuery) Only

func (mgq *MovieGenreQuery) Only(ctx context.Context) (*MovieGenre, error)

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

func (*MovieGenreQuery) OnlyID

func (mgq *MovieGenreQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MovieGenreQuery) OnlyIDX

func (mgq *MovieGenreQuery) OnlyIDX(ctx context.Context) int

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

func (*MovieGenreQuery) OnlyX

func (mgq *MovieGenreQuery) OnlyX(ctx context.Context) *MovieGenre

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

func (*MovieGenreQuery) Order

func (mgq *MovieGenreQuery) Order(o ...OrderFunc) *MovieGenreQuery

Order adds an order step to the query.

func (*MovieGenreQuery) QueryMovies

func (mgq *MovieGenreQuery) QueryMovies() *MovieQuery

QueryMovies chains the current query on the "movies" edge.

func (*MovieGenreQuery) Select

func (mgq *MovieGenreQuery) Select(fields ...string) *MovieGenreSelect

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

func (*MovieGenreQuery) Unique

func (mgq *MovieGenreQuery) Unique(unique bool) *MovieGenreQuery

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

Where adds a new predicate for the MovieGenreQuery builder.

func (*MovieGenreQuery) WithMovies

func (mgq *MovieGenreQuery) WithMovies(opts ...func(*MovieQuery)) *MovieGenreQuery

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

type MovieGenreSelect

type MovieGenreSelect struct {
	*MovieGenreQuery
	// contains filtered or unexported fields
}

MovieGenreSelect is the builder for selecting fields of MovieGenre entities.

func (*MovieGenreSelect) Bool

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

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

func (*MovieGenreSelect) BoolX

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

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

func (*MovieGenreSelect) Bools

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

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

func (*MovieGenreSelect) BoolsX

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

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

func (*MovieGenreSelect) Float64

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

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

func (*MovieGenreSelect) Float64X

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

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

func (*MovieGenreSelect) Float64s

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

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

func (*MovieGenreSelect) Float64sX

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

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

func (*MovieGenreSelect) Int

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

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

func (*MovieGenreSelect) IntX

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

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

func (*MovieGenreSelect) Ints

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

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

func (*MovieGenreSelect) IntsX

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

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

func (*MovieGenreSelect) Scan

func (mgs *MovieGenreSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MovieGenreSelect) ScanX

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

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

func (*MovieGenreSelect) String

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

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

func (*MovieGenreSelect) StringX

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

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

func (*MovieGenreSelect) Strings

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

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

func (*MovieGenreSelect) StringsX

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

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

type MovieGenreUpdate

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

MovieGenreUpdate is the builder for updating MovieGenre entities.

func (*MovieGenreUpdate) AddMovieIDs

func (mgu *MovieGenreUpdate) AddMovieIDs(ids ...int) *MovieGenreUpdate

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*MovieGenreUpdate) AddMovies

func (mgu *MovieGenreUpdate) AddMovies(m ...*Movie) *MovieGenreUpdate

AddMovies adds the "movies" edges to the Movie entity.

func (*MovieGenreUpdate) ClearMovies

func (mgu *MovieGenreUpdate) ClearMovies() *MovieGenreUpdate

ClearMovies clears all "movies" edges to the Movie entity.

func (*MovieGenreUpdate) Exec

func (mgu *MovieGenreUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieGenreUpdate) ExecX

func (mgu *MovieGenreUpdate) ExecX(ctx context.Context)

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

func (*MovieGenreUpdate) Mutation

func (mgu *MovieGenreUpdate) Mutation() *MovieGenreMutation

Mutation returns the MovieGenreMutation object of the builder.

func (*MovieGenreUpdate) RemoveMovieIDs

func (mgu *MovieGenreUpdate) RemoveMovieIDs(ids ...int) *MovieGenreUpdate

RemoveMovieIDs removes the "movies" edge to Movie entities by IDs.

func (*MovieGenreUpdate) RemoveMovies

func (mgu *MovieGenreUpdate) RemoveMovies(m ...*Movie) *MovieGenreUpdate

RemoveMovies removes "movies" edges to Movie entities.

func (*MovieGenreUpdate) Save

func (mgu *MovieGenreUpdate) Save(ctx context.Context) (int, error)

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

func (*MovieGenreUpdate) SaveX

func (mgu *MovieGenreUpdate) SaveX(ctx context.Context) int

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

func (*MovieGenreUpdate) SetName

func (mgu *MovieGenreUpdate) SetName(s string) *MovieGenreUpdate

SetName sets the "name" field.

func (*MovieGenreUpdate) Where

Where appends a list predicates to the MovieGenreUpdate builder.

type MovieGenreUpdateOne

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

MovieGenreUpdateOne is the builder for updating a single MovieGenre entity.

func (*MovieGenreUpdateOne) AddMovieIDs

func (mguo *MovieGenreUpdateOne) AddMovieIDs(ids ...int) *MovieGenreUpdateOne

AddMovieIDs adds the "movies" edge to the Movie entity by IDs.

func (*MovieGenreUpdateOne) AddMovies

func (mguo *MovieGenreUpdateOne) AddMovies(m ...*Movie) *MovieGenreUpdateOne

AddMovies adds the "movies" edges to the Movie entity.

func (*MovieGenreUpdateOne) ClearMovies

func (mguo *MovieGenreUpdateOne) ClearMovies() *MovieGenreUpdateOne

ClearMovies clears all "movies" edges to the Movie entity.

func (*MovieGenreUpdateOne) Exec

func (mguo *MovieGenreUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MovieGenreUpdateOne) ExecX

func (mguo *MovieGenreUpdateOne) ExecX(ctx context.Context)

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

func (*MovieGenreUpdateOne) Mutation

func (mguo *MovieGenreUpdateOne) Mutation() *MovieGenreMutation

Mutation returns the MovieGenreMutation object of the builder.

func (*MovieGenreUpdateOne) RemoveMovieIDs

func (mguo *MovieGenreUpdateOne) RemoveMovieIDs(ids ...int) *MovieGenreUpdateOne

RemoveMovieIDs removes the "movies" edge to Movie entities by IDs.

func (*MovieGenreUpdateOne) RemoveMovies

func (mguo *MovieGenreUpdateOne) RemoveMovies(m ...*Movie) *MovieGenreUpdateOne

RemoveMovies removes "movies" edges to Movie entities.

func (*MovieGenreUpdateOne) Save

func (mguo *MovieGenreUpdateOne) Save(ctx context.Context) (*MovieGenre, error)

Save executes the query and returns the updated MovieGenre entity.

func (*MovieGenreUpdateOne) SaveX

func (mguo *MovieGenreUpdateOne) SaveX(ctx context.Context) *MovieGenre

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

func (*MovieGenreUpdateOne) Select

func (mguo *MovieGenreUpdateOne) Select(field string, fields ...string) *MovieGenreUpdateOne

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

func (*MovieGenreUpdateOne) SetName

SetName sets the "name" field.

type MovieGenres

type MovieGenres []*MovieGenre

MovieGenres is a parsable slice of MovieGenre.

type MovieGroupBy

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

MovieGroupBy is the group-by builder for Movie entities.

func (*MovieGroupBy) Aggregate

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

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

func (*MovieGroupBy) Bool

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

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

func (*MovieGroupBy) BoolX

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

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

func (*MovieGroupBy) Bools

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

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

func (*MovieGroupBy) BoolsX

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

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

func (*MovieGroupBy) Float64

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

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

func (*MovieGroupBy) Float64X

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

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

func (*MovieGroupBy) Float64s

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

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

func (*MovieGroupBy) Float64sX

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

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

func (*MovieGroupBy) Int

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

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

func (*MovieGroupBy) IntX

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

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

func (*MovieGroupBy) Ints

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

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

func (*MovieGroupBy) IntsX

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

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

func (*MovieGroupBy) Scan

func (mgb *MovieGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MovieGroupBy) ScanX

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

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

func (*MovieGroupBy) String

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

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

func (*MovieGroupBy) StringX

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

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

func (*MovieGroupBy) Strings

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

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

func (*MovieGroupBy) StringsX

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

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

type MovieMutation

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

MovieMutation represents an operation that mutates the Movie nodes in the graph.

func (*MovieMutation) AddCastIDs

func (m *MovieMutation) AddCastIDs(ids ...int)

AddCastIDs adds the "cast" edge to the Artist entity by ids.

func (*MovieMutation) AddCountryIDs

func (m *MovieMutation) AddCountryIDs(ids ...int)

AddCountryIDs adds the "countries" edge to the Country entity by ids.

func (*MovieMutation) AddDirectorIDs

func (m *MovieMutation) AddDirectorIDs(ids ...int)

AddDirectorIDs adds the "directors" edge to the Artist entity by ids.

func (*MovieMutation) AddDuration

func (m *MovieMutation) AddDuration(i int)

AddDuration adds i to the "duration" field.

func (*MovieMutation) AddFanartIDs

func (m *MovieMutation) AddFanartIDs(ids ...int)

AddFanartIDs adds the "fanart" edge to the Picture entity by ids.

func (*MovieMutation) AddField

func (m *MovieMutation) 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 (*MovieMutation) AddGenreIDs

func (m *MovieMutation) AddGenreIDs(ids ...int)

AddGenreIDs adds the "genres" edge to the MovieGenre entity by ids.

func (*MovieMutation) AddRatingIDs

func (m *MovieMutation) AddRatingIDs(ids ...int)

AddRatingIDs adds the "ratings" edge to the Rating entity by ids.

func (*MovieMutation) AddWriterIDs

func (m *MovieMutation) AddWriterIDs(ids ...int)

AddWriterIDs adds the "writers" edge to the Artist entity by ids.

func (*MovieMutation) AddedDuration

func (m *MovieMutation) AddedDuration() (r int, exists bool)

AddedDuration returns the value that was added to the "duration" field in this mutation.

func (*MovieMutation) AddedEdges

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

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

func (*MovieMutation) AddedField

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

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

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

func (*MovieMutation) AddedIDs

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

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

func (*MovieMutation) CastCleared

func (m *MovieMutation) CastCleared() bool

CastCleared reports if the "cast" edge to the Artist entity was cleared.

func (*MovieMutation) CastIDs

func (m *MovieMutation) CastIDs() (ids []int)

CastIDs returns the "cast" edge IDs in the mutation.

func (*MovieMutation) ClearCast

func (m *MovieMutation) ClearCast()

ClearCast clears the "cast" edge to the Artist entity.

func (*MovieMutation) ClearCountries

func (m *MovieMutation) ClearCountries()

ClearCountries clears the "countries" edge to the Country entity.

func (*MovieMutation) ClearDirectors

func (m *MovieMutation) ClearDirectors()

ClearDirectors clears the "directors" edge to the Artist entity.

func (*MovieMutation) ClearDuration

func (m *MovieMutation) ClearDuration()

ClearDuration clears the value of the "duration" field.

func (*MovieMutation) ClearEdge

func (m *MovieMutation) 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 (*MovieMutation) ClearFanart

func (m *MovieMutation) ClearFanart()

ClearFanart clears the "fanart" edge to the Picture entity.

func (*MovieMutation) ClearField

func (m *MovieMutation) 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 (*MovieMutation) ClearFile

func (m *MovieMutation) ClearFile()

ClearFile clears the "file" edge to the File entity.

func (*MovieMutation) ClearGenres

func (m *MovieMutation) ClearGenres()

ClearGenres clears the "genres" edge to the MovieGenre entity.

func (*MovieMutation) ClearOriginalTitle

func (m *MovieMutation) ClearOriginalTitle()

ClearOriginalTitle clears the value of the "original_title" field.

func (*MovieMutation) ClearPlot

func (m *MovieMutation) ClearPlot()

ClearPlot clears the value of the "plot" field.

func (*MovieMutation) ClearPoster

func (m *MovieMutation) ClearPoster()

ClearPoster clears the "poster" edge to the Picture entity.

func (*MovieMutation) ClearRatings

func (m *MovieMutation) ClearRatings()

ClearRatings clears the "ratings" edge to the Rating entity.

func (*MovieMutation) ClearReleaseDate

func (m *MovieMutation) ClearReleaseDate()

ClearReleaseDate clears the value of the "release_date" field.

func (*MovieMutation) ClearWriters

func (m *MovieMutation) ClearWriters()

ClearWriters clears the "writers" edge to the Artist entity.

func (*MovieMutation) ClearedEdges

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

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

func (*MovieMutation) ClearedFields

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

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

func (MovieMutation) Client

func (m MovieMutation) 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 (*MovieMutation) CountriesCleared

func (m *MovieMutation) CountriesCleared() bool

CountriesCleared reports if the "countries" edge to the Country entity was cleared.

func (*MovieMutation) CountriesIDs

func (m *MovieMutation) CountriesIDs() (ids []int)

CountriesIDs returns the "countries" edge IDs in the mutation.

func (*MovieMutation) DirectorsCleared

func (m *MovieMutation) DirectorsCleared() bool

DirectorsCleared reports if the "directors" edge to the Artist entity was cleared.

func (*MovieMutation) DirectorsIDs

func (m *MovieMutation) DirectorsIDs() (ids []int)

DirectorsIDs returns the "directors" edge IDs in the mutation.

func (*MovieMutation) Duration

func (m *MovieMutation) Duration() (r int, exists bool)

Duration returns the value of the "duration" field in the mutation.

func (*MovieMutation) DurationCleared

func (m *MovieMutation) DurationCleared() bool

DurationCleared returns if the "duration" field was cleared in this mutation.

func (*MovieMutation) EdgeCleared

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

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

func (*MovieMutation) FanartCleared

func (m *MovieMutation) FanartCleared() bool

FanartCleared reports if the "fanart" edge to the Picture entity was cleared.

func (*MovieMutation) FanartIDs

func (m *MovieMutation) FanartIDs() (ids []int)

FanartIDs returns the "fanart" edge IDs in the mutation.

func (*MovieMutation) Field

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

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

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

func (*MovieMutation) Fields

func (m *MovieMutation) 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 (*MovieMutation) FileCleared

func (m *MovieMutation) FileCleared() bool

FileCleared reports if the "file" edge to the File entity was cleared.

func (*MovieMutation) FileID

func (m *MovieMutation) FileID() (id int, exists bool)

FileID returns the "file" edge ID in the mutation.

func (*MovieMutation) FileIDs

func (m *MovieMutation) FileIDs() (ids []int)

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 (*MovieMutation) GenresCleared

func (m *MovieMutation) GenresCleared() bool

GenresCleared reports if the "genres" edge to the MovieGenre entity was cleared.

func (*MovieMutation) GenresIDs

func (m *MovieMutation) GenresIDs() (ids []int)

GenresIDs returns the "genres" edge IDs in the mutation.

func (*MovieMutation) ID

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

func (m *MovieMutation) 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 (*MovieMutation) OldDuration

func (m *MovieMutation) OldDuration(ctx context.Context) (v int, err error)

OldDuration returns the old "duration" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldField

func (m *MovieMutation) 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 (*MovieMutation) OldOriginalTitle

func (m *MovieMutation) OldOriginalTitle(ctx context.Context) (v string, err error)

OldOriginalTitle returns the old "original_title" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldPlot

func (m *MovieMutation) OldPlot(ctx context.Context) (v string, err error)

OldPlot returns the old "plot" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldReleaseDate

func (m *MovieMutation) OldReleaseDate(ctx context.Context) (v time.Time, err error)

OldReleaseDate returns the old "release_date" field's value of the Movie entity. If the Movie 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 (*MovieMutation) OldTitle

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

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

func (m *MovieMutation) OldWatched(ctx context.Context) (v bool, err error)

OldWatched returns the old "watched" field's value of the Movie entity. If the Movie 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 (*MovieMutation) Op

func (m *MovieMutation) Op() Op

Op returns the operation name.

func (*MovieMutation) OriginalTitle

func (m *MovieMutation) OriginalTitle() (r string, exists bool)

OriginalTitle returns the value of the "original_title" field in the mutation.

func (*MovieMutation) OriginalTitleCleared

func (m *MovieMutation) OriginalTitleCleared() bool

OriginalTitleCleared returns if the "original_title" field was cleared in this mutation.

func (*MovieMutation) Plot

func (m *MovieMutation) Plot() (r string, exists bool)

Plot returns the value of the "plot" field in the mutation.

func (*MovieMutation) PlotCleared

func (m *MovieMutation) PlotCleared() bool

PlotCleared returns if the "plot" field was cleared in this mutation.

func (*MovieMutation) PosterCleared

func (m *MovieMutation) PosterCleared() bool

PosterCleared reports if the "poster" edge to the Picture entity was cleared.

func (*MovieMutation) PosterID

func (m *MovieMutation) PosterID() (id int, exists bool)

PosterID returns the "poster" edge ID in the mutation.

func (*MovieMutation) PosterIDs

func (m *MovieMutation) PosterIDs() (ids []int)

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

func (*MovieMutation) RatingsCleared

func (m *MovieMutation) RatingsCleared() bool

RatingsCleared reports if the "ratings" edge to the Rating entity was cleared.

func (*MovieMutation) RatingsIDs

func (m *MovieMutation) RatingsIDs() (ids []int)

RatingsIDs returns the "ratings" edge IDs in the mutation.

func (*MovieMutation) ReleaseDate

func (m *MovieMutation) ReleaseDate() (r time.Time, exists bool)

ReleaseDate returns the value of the "release_date" field in the mutation.

func (*MovieMutation) ReleaseDateCleared

func (m *MovieMutation) ReleaseDateCleared() bool

ReleaseDateCleared returns if the "release_date" field was cleared in this mutation.

func (*MovieMutation) RemoveCastIDs

func (m *MovieMutation) RemoveCastIDs(ids ...int)

RemoveCastIDs removes the "cast" edge to the Artist entity by IDs.

func (*MovieMutation) RemoveCountryIDs

func (m *MovieMutation) RemoveCountryIDs(ids ...int)

RemoveCountryIDs removes the "countries" edge to the Country entity by IDs.

func (*MovieMutation) RemoveDirectorIDs

func (m *MovieMutation) RemoveDirectorIDs(ids ...int)

RemoveDirectorIDs removes the "directors" edge to the Artist entity by IDs.

func (*MovieMutation) RemoveFanartIDs

func (m *MovieMutation) RemoveFanartIDs(ids ...int)

RemoveFanartIDs removes the "fanart" edge to the Picture entity by IDs.

func (*MovieMutation) RemoveGenreIDs

func (m *MovieMutation) RemoveGenreIDs(ids ...int)

RemoveGenreIDs removes the "genres" edge to the MovieGenre entity by IDs.

func (*MovieMutation) RemoveRatingIDs

func (m *MovieMutation) RemoveRatingIDs(ids ...int)

RemoveRatingIDs removes the "ratings" edge to the Rating entity by IDs.

func (*MovieMutation) RemoveWriterIDs

func (m *MovieMutation) RemoveWriterIDs(ids ...int)

RemoveWriterIDs removes the "writers" edge to the Artist entity by IDs.

func (*MovieMutation) RemovedCastIDs

func (m *MovieMutation) RemovedCastIDs() (ids []int)

RemovedCast returns the removed IDs of the "cast" edge to the Artist entity.

func (*MovieMutation) RemovedCountriesIDs

func (m *MovieMutation) RemovedCountriesIDs() (ids []int)

RemovedCountries returns the removed IDs of the "countries" edge to the Country entity.

func (*MovieMutation) RemovedDirectorsIDs

func (m *MovieMutation) RemovedDirectorsIDs() (ids []int)

RemovedDirectors returns the removed IDs of the "directors" edge to the Artist entity.

func (*MovieMutation) RemovedEdges

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

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

func (*MovieMutation) RemovedFanartIDs

func (m *MovieMutation) RemovedFanartIDs() (ids []int)

RemovedFanart returns the removed IDs of the "fanart" edge to the Picture entity.

func (*MovieMutation) RemovedGenresIDs

func (m *MovieMutation) RemovedGenresIDs() (ids []int)

RemovedGenres returns the removed IDs of the "genres" edge to the MovieGenre entity.

func (*MovieMutation) RemovedIDs

func (m *MovieMutation) 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 (*MovieMutation) RemovedRatingsIDs

func (m *MovieMutation) RemovedRatingsIDs() (ids []int)

RemovedRatings returns the removed IDs of the "ratings" edge to the Rating entity.

func (*MovieMutation) RemovedWritersIDs

func (m *MovieMutation) RemovedWritersIDs() (ids []int)

RemovedWriters returns the removed IDs of the "writers" edge to the Artist entity.

func (*MovieMutation) ResetCast

func (m *MovieMutation) ResetCast()

ResetCast resets all changes to the "cast" edge.

func (*MovieMutation) ResetCountries

func (m *MovieMutation) ResetCountries()

ResetCountries resets all changes to the "countries" edge.

func (*MovieMutation) ResetDirectors

func (m *MovieMutation) ResetDirectors()

ResetDirectors resets all changes to the "directors" edge.

func (*MovieMutation) ResetDuration

func (m *MovieMutation) ResetDuration()

ResetDuration resets all changes to the "duration" field.

func (*MovieMutation) ResetEdge

func (m *MovieMutation) 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 (*MovieMutation) ResetFanart

func (m *MovieMutation) ResetFanart()

ResetFanart resets all changes to the "fanart" edge.

func (*MovieMutation) ResetField

func (m *MovieMutation) 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 (*MovieMutation) ResetFile

func (m *MovieMutation) ResetFile()

ResetFile resets all changes to the "file" edge.

func (*MovieMutation) ResetGenres

func (m *MovieMutation) ResetGenres()

ResetGenres resets all changes to the "genres" edge.

func (*MovieMutation) ResetOriginalTitle

func (m *MovieMutation) ResetOriginalTitle()

ResetOriginalTitle resets all changes to the "original_title" field.

func (*MovieMutation) ResetPlot

func (m *MovieMutation) ResetPlot()

ResetPlot resets all changes to the "plot" field.

func (*MovieMutation) ResetPoster

func (m *MovieMutation) ResetPoster()

ResetPoster resets all changes to the "poster" edge.

func (*MovieMutation) ResetRatings

func (m *MovieMutation) ResetRatings()

ResetRatings resets all changes to the "ratings" edge.

func (*MovieMutation) ResetReleaseDate

func (m *MovieMutation) ResetReleaseDate()

ResetReleaseDate resets all changes to the "release_date" field.

func (*MovieMutation) ResetTitle

func (m *MovieMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*MovieMutation) ResetWatched

func (m *MovieMutation) ResetWatched()

ResetWatched resets all changes to the "watched" field.

func (*MovieMutation) ResetWriters

func (m *MovieMutation) ResetWriters()

ResetWriters resets all changes to the "writers" edge.

func (*MovieMutation) SetDuration

func (m *MovieMutation) SetDuration(i int)

SetDuration sets the "duration" field.

func (*MovieMutation) SetField

func (m *MovieMutation) 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 (*MovieMutation) SetFileID

func (m *MovieMutation) SetFileID(id int)

SetFileID sets the "file" edge to the File entity by id.

func (*MovieMutation) SetOriginalTitle

func (m *MovieMutation) SetOriginalTitle(s string)

SetOriginalTitle sets the "original_title" field.

func (*MovieMutation) SetPlot

func (m *MovieMutation) SetPlot(s string)

SetPlot sets the "plot" field.

func (*MovieMutation) SetPosterID

func (m *MovieMutation) SetPosterID(id int)

SetPosterID sets the "poster" edge to the Picture entity by id.

func (*MovieMutation) SetReleaseDate

func (m *MovieMutation) SetReleaseDate(t time.Time)

SetReleaseDate sets the "release_date" field.

func (*MovieMutation) SetTitle

func (m *MovieMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*MovieMutation) SetWatched

func (m *MovieMutation) SetWatched(b bool)

SetWatched sets the "watched" field.

func (*MovieMutation) Title

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

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

func (MovieMutation) Tx

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

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

func (*MovieMutation) Type

func (m *MovieMutation) Type() string

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

func (*MovieMutation) Watched

func (m *MovieMutation) Watched() (r bool, exists bool)

Watched returns the value of the "watched" field in the mutation.

func (*MovieMutation) Where

func (m *MovieMutation) Where(ps ...predicate.Movie)

Where appends a list predicates to the MovieMutation builder.

func (*MovieMutation) WritersCleared

func (m *MovieMutation) WritersCleared() bool

WritersCleared reports if the "writers" edge to the Artist entity was cleared.

func (*MovieMutation) WritersIDs

func (m *MovieMutation) WritersIDs() (ids []int)

WritersIDs returns the "writers" edge IDs in the mutation.

type MovieQuery

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

MovieQuery is the builder for querying Movie entities.

func (*MovieQuery) All

func (mq *MovieQuery) All(ctx context.Context) ([]*Movie, error)

All executes the query and returns a list of Movies.

func (*MovieQuery) AllX

func (mq *MovieQuery) AllX(ctx context.Context) []*Movie

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

func (*MovieQuery) Clone

func (mq *MovieQuery) Clone() *MovieQuery

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

func (*MovieQuery) Count

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

Count returns the count of the given query.

func (*MovieQuery) CountX

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

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

func (*MovieQuery) Exist

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

Exist returns true if the query has elements in the graph.

func (*MovieQuery) ExistX

func (mq *MovieQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MovieQuery) First

func (mq *MovieQuery) First(ctx context.Context) (*Movie, error)

First returns the first Movie entity from the query. Returns a *NotFoundError when no Movie was found.

func (*MovieQuery) FirstID

func (mq *MovieQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Movie ID from the query. Returns a *NotFoundError when no Movie ID was found.

func (*MovieQuery) FirstIDX

func (mq *MovieQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MovieQuery) FirstX

func (mq *MovieQuery) FirstX(ctx context.Context) *Movie

FirstX is like First, but panics if an error occurs.

func (*MovieQuery) GroupBy

func (mq *MovieQuery) GroupBy(field string, fields ...string) *MovieGroupBy

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 {
	Title string `json:"title,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Movie.Query().
	GroupBy(movie.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MovieQuery) IDs

func (mq *MovieQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Movie IDs.

func (*MovieQuery) IDsX

func (mq *MovieQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MovieQuery) Limit

func (mq *MovieQuery) Limit(limit int) *MovieQuery

Limit adds a limit step to the query.

func (*MovieQuery) Offset

func (mq *MovieQuery) Offset(offset int) *MovieQuery

Offset adds an offset step to the query.

func (*MovieQuery) Only

func (mq *MovieQuery) Only(ctx context.Context) (*Movie, error)

Only returns a single Movie entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Movie entity is found. Returns a *NotFoundError when no Movie entities are found.

func (*MovieQuery) OnlyID

func (mq *MovieQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Movie ID in the query. Returns a *NotSingularError when more than one Movie ID is found. Returns a *NotFoundError when no entities are found.

func (*MovieQuery) OnlyIDX

func (mq *MovieQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MovieQuery) OnlyX

func (mq *MovieQuery) OnlyX(ctx context.Context) *Movie

OnlyX is like Only, but panics if an error occurs.

func (*MovieQuery) Order

func (mq *MovieQuery) Order(o ...OrderFunc) *MovieQuery

Order adds an order step to the query.

func (*MovieQuery) QueryCast

func (mq *MovieQuery) QueryCast() *ArtistQuery

QueryCast chains the current query on the "cast" edge.

func (*MovieQuery) QueryCountries

func (mq *MovieQuery) QueryCountries() *CountryQuery

QueryCountries chains the current query on the "countries" edge.

func (*MovieQuery) QueryDirectors

func (mq *MovieQuery) QueryDirectors() *ArtistQuery

QueryDirectors chains the current query on the "directors" edge.

func (*MovieQuery) QueryFanart

func (mq *MovieQuery) QueryFanart() *PictureQuery

QueryFanart chains the current query on the "fanart" edge.

func (*MovieQuery) QueryFile

func (mq *MovieQuery) QueryFile() *FileQuery

QueryFile chains the current query on the "file" edge.

func (*MovieQuery) QueryGenres

func (mq *MovieQuery) QueryGenres() *MovieGenreQuery

QueryGenres chains the current query on the "genres" edge.

func (*MovieQuery) QueryPoster

func (mq *MovieQuery) QueryPoster() *PictureQuery

QueryPoster chains the current query on the "poster" edge.

func (*MovieQuery) QueryRatings

func (mq *MovieQuery) QueryRatings() *RatingQuery

QueryRatings chains the current query on the "ratings" edge.

func (*MovieQuery) QueryWriters

func (mq *MovieQuery) QueryWriters() *ArtistQuery

QueryWriters chains the current query on the "writers" edge.

func (*MovieQuery) Select

func (mq *MovieQuery) Select(fields ...string) *MovieSelect

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 {
	Title string `json:"title,omitempty"`
}

client.Movie.Query().
	Select(movie.FieldTitle).
	Scan(ctx, &v)

func (*MovieQuery) Unique

func (mq *MovieQuery) Unique(unique bool) *MovieQuery

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 (*MovieQuery) Where

func (mq *MovieQuery) Where(ps ...predicate.Movie) *MovieQuery

Where adds a new predicate for the MovieQuery builder.

func (*MovieQuery) WithCast

func (mq *MovieQuery) WithCast(opts ...func(*ArtistQuery)) *MovieQuery

WithCast tells the query-builder to eager-load the nodes that are connected to the "cast" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithCountries

func (mq *MovieQuery) WithCountries(opts ...func(*CountryQuery)) *MovieQuery

WithCountries tells the query-builder to eager-load the nodes that are connected to the "countries" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithDirectors

func (mq *MovieQuery) WithDirectors(opts ...func(*ArtistQuery)) *MovieQuery

WithDirectors tells the query-builder to eager-load the nodes that are connected to the "directors" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithFanart

func (mq *MovieQuery) WithFanart(opts ...func(*PictureQuery)) *MovieQuery

WithFanart tells the query-builder to eager-load the nodes that are connected to the "fanart" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithFile

func (mq *MovieQuery) WithFile(opts ...func(*FileQuery)) *MovieQuery

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 (*MovieQuery) WithGenres

func (mq *MovieQuery) WithGenres(opts ...func(*MovieGenreQuery)) *MovieQuery

WithGenres tells the query-builder to eager-load the nodes that are connected to the "genres" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithPoster

func (mq *MovieQuery) WithPoster(opts ...func(*PictureQuery)) *MovieQuery

WithPoster tells the query-builder to eager-load the nodes that are connected to the "poster" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithRatings

func (mq *MovieQuery) WithRatings(opts ...func(*RatingQuery)) *MovieQuery

WithRatings tells the query-builder to eager-load the nodes that are connected to the "ratings" edge. The optional arguments are used to configure the query builder of the edge.

func (*MovieQuery) WithWriters

func (mq *MovieQuery) WithWriters(opts ...func(*ArtistQuery)) *MovieQuery

WithWriters tells the query-builder to eager-load the nodes that are connected to the "writers" edge. The optional arguments are used to configure the query builder of the edge.

type MovieSelect

type MovieSelect struct {
	*MovieQuery
	// contains filtered or unexported fields
}

MovieSelect is the builder for selecting fields of Movie entities.

func (*MovieSelect) Bool

func (s *MovieSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MovieSelect) BoolX

func (s *MovieSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MovieSelect) Bools

func (s *MovieSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MovieSelect) BoolsX

func (s *MovieSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MovieSelect) Float64

func (s *MovieSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MovieSelect) Float64X

func (s *MovieSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MovieSelect) Float64s

func (s *MovieSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MovieSelect) Float64sX

func (s *MovieSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MovieSelect) Int

func (s *MovieSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MovieSelect) IntX

func (s *MovieSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MovieSelect) Ints

func (s *MovieSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MovieSelect) IntsX

func (s *MovieSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MovieSelect) Scan

func (ms *MovieSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MovieSelect) ScanX

func (s *MovieSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MovieSelect) String

func (s *MovieSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MovieSelect) StringX

func (s *MovieSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MovieSelect) Strings

func (s *MovieSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MovieSelect) StringsX

func (s *MovieSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MovieUpdate

type MovieUpdate struct {
	// contains filtered or unexported fields
}

MovieUpdate is the builder for updating Movie entities.

func (*MovieUpdate) AddCast

func (mu *MovieUpdate) AddCast(a ...*Artist) *MovieUpdate

AddCast adds the "cast" edges to the Artist entity.

func (*MovieUpdate) AddCastIDs

func (mu *MovieUpdate) AddCastIDs(ids ...int) *MovieUpdate

AddCastIDs adds the "cast" edge to the Artist entity by IDs.

func (*MovieUpdate) AddCountries

func (mu *MovieUpdate) AddCountries(c ...*Country) *MovieUpdate

AddCountries adds the "countries" edges to the Country entity.

func (*MovieUpdate) AddCountryIDs

func (mu *MovieUpdate) AddCountryIDs(ids ...int) *MovieUpdate

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*MovieUpdate) AddDirectorIDs

func (mu *MovieUpdate) AddDirectorIDs(ids ...int) *MovieUpdate

AddDirectorIDs adds the "directors" edge to the Artist entity by IDs.

func (*MovieUpdate) AddDirectors

func (mu *MovieUpdate) AddDirectors(a ...*Artist) *MovieUpdate

AddDirectors adds the "directors" edges to the Artist entity.

func (*MovieUpdate) AddDuration

func (mu *MovieUpdate) AddDuration(i int) *MovieUpdate

AddDuration adds i to the "duration" field.

func (*MovieUpdate) AddFanart

func (mu *MovieUpdate) AddFanart(p ...*Picture) *MovieUpdate

AddFanart adds the "fanart" edges to the Picture entity.

func (*MovieUpdate) AddFanartIDs

func (mu *MovieUpdate) AddFanartIDs(ids ...int) *MovieUpdate

AddFanartIDs adds the "fanart" edge to the Picture entity by IDs.

func (*MovieUpdate) AddGenreIDs

func (mu *MovieUpdate) AddGenreIDs(ids ...int) *MovieUpdate

AddGenreIDs adds the "genres" edge to the MovieGenre entity by IDs.

func (*MovieUpdate) AddGenres

func (mu *MovieUpdate) AddGenres(m ...*MovieGenre) *MovieUpdate

AddGenres adds the "genres" edges to the MovieGenre entity.

func (*MovieUpdate) AddRatingIDs

func (mu *MovieUpdate) AddRatingIDs(ids ...int) *MovieUpdate

AddRatingIDs adds the "ratings" edge to the Rating entity by IDs.

func (*MovieUpdate) AddRatings

func (mu *MovieUpdate) AddRatings(r ...*Rating) *MovieUpdate

AddRatings adds the "ratings" edges to the Rating entity.

func (*MovieUpdate) AddWriterIDs

func (mu *MovieUpdate) AddWriterIDs(ids ...int) *MovieUpdate

AddWriterIDs adds the "writers" edge to the Artist entity by IDs.

func (*MovieUpdate) AddWriters

func (mu *MovieUpdate) AddWriters(a ...*Artist) *MovieUpdate

AddWriters adds the "writers" edges to the Artist entity.

func (*MovieUpdate) ClearCast

func (mu *MovieUpdate) ClearCast() *MovieUpdate

ClearCast clears all "cast" edges to the Artist entity.

func (*MovieUpdate) ClearCountries

func (mu *MovieUpdate) ClearCountries() *MovieUpdate

ClearCountries clears all "countries" edges to the Country entity.

func (*MovieUpdate) ClearDirectors

func (mu *MovieUpdate) ClearDirectors() *MovieUpdate

ClearDirectors clears all "directors" edges to the Artist entity.

func (*MovieUpdate) ClearDuration

func (mu *MovieUpdate) ClearDuration() *MovieUpdate

ClearDuration clears the value of the "duration" field.

func (*MovieUpdate) ClearFanart

func (mu *MovieUpdate) ClearFanart() *MovieUpdate

ClearFanart clears all "fanart" edges to the Picture entity.

func (*MovieUpdate) ClearFile

func (mu *MovieUpdate) ClearFile() *MovieUpdate

ClearFile clears the "file" edge to the File entity.

func (*MovieUpdate) ClearGenres

func (mu *MovieUpdate) ClearGenres() *MovieUpdate

ClearGenres clears all "genres" edges to the MovieGenre entity.

func (*MovieUpdate) ClearOriginalTitle

func (mu *MovieUpdate) ClearOriginalTitle() *MovieUpdate

ClearOriginalTitle clears the value of the "original_title" field.

func (*MovieUpdate) ClearPlot

func (mu *MovieUpdate) ClearPlot() *MovieUpdate

ClearPlot clears the value of the "plot" field.

func (*MovieUpdate) ClearPoster

func (mu *MovieUpdate) ClearPoster() *MovieUpdate

ClearPoster clears the "poster" edge to the Picture entity.

func (*MovieUpdate) ClearRatings

func (mu *MovieUpdate) ClearRatings() *MovieUpdate

ClearRatings clears all "ratings" edges to the Rating entity.

func (*MovieUpdate) ClearReleaseDate

func (mu *MovieUpdate) ClearReleaseDate() *MovieUpdate

ClearReleaseDate clears the value of the "release_date" field.

func (*MovieUpdate) ClearWriters

func (mu *MovieUpdate) ClearWriters() *MovieUpdate

ClearWriters clears all "writers" edges to the Artist entity.

func (*MovieUpdate) Exec

func (mu *MovieUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MovieUpdate) ExecX

func (mu *MovieUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieUpdate) Mutation

func (mu *MovieUpdate) Mutation() *MovieMutation

Mutation returns the MovieMutation object of the builder.

func (*MovieUpdate) RemoveCast

func (mu *MovieUpdate) RemoveCast(a ...*Artist) *MovieUpdate

RemoveCast removes "cast" edges to Artist entities.

func (*MovieUpdate) RemoveCastIDs

func (mu *MovieUpdate) RemoveCastIDs(ids ...int) *MovieUpdate

RemoveCastIDs removes the "cast" edge to Artist entities by IDs.

func (*MovieUpdate) RemoveCountries

func (mu *MovieUpdate) RemoveCountries(c ...*Country) *MovieUpdate

RemoveCountries removes "countries" edges to Country entities.

func (*MovieUpdate) RemoveCountryIDs

func (mu *MovieUpdate) RemoveCountryIDs(ids ...int) *MovieUpdate

RemoveCountryIDs removes the "countries" edge to Country entities by IDs.

func (*MovieUpdate) RemoveDirectorIDs

func (mu *MovieUpdate) RemoveDirectorIDs(ids ...int) *MovieUpdate

RemoveDirectorIDs removes the "directors" edge to Artist entities by IDs.

func (*MovieUpdate) RemoveDirectors

func (mu *MovieUpdate) RemoveDirectors(a ...*Artist) *MovieUpdate

RemoveDirectors removes "directors" edges to Artist entities.

func (*MovieUpdate) RemoveFanart

func (mu *MovieUpdate) RemoveFanart(p ...*Picture) *MovieUpdate

RemoveFanart removes "fanart" edges to Picture entities.

func (*MovieUpdate) RemoveFanartIDs

func (mu *MovieUpdate) RemoveFanartIDs(ids ...int) *MovieUpdate

RemoveFanartIDs removes the "fanart" edge to Picture entities by IDs.

func (*MovieUpdate) RemoveGenreIDs

func (mu *MovieUpdate) RemoveGenreIDs(ids ...int) *MovieUpdate

RemoveGenreIDs removes the "genres" edge to MovieGenre entities by IDs.

func (*MovieUpdate) RemoveGenres

func (mu *MovieUpdate) RemoveGenres(m ...*MovieGenre) *MovieUpdate

RemoveGenres removes "genres" edges to MovieGenre entities.

func (*MovieUpdate) RemoveRatingIDs

func (mu *MovieUpdate) RemoveRatingIDs(ids ...int) *MovieUpdate

RemoveRatingIDs removes the "ratings" edge to Rating entities by IDs.

func (*MovieUpdate) RemoveRatings

func (mu *MovieUpdate) RemoveRatings(r ...*Rating) *MovieUpdate

RemoveRatings removes "ratings" edges to Rating entities.

func (*MovieUpdate) RemoveWriterIDs

func (mu *MovieUpdate) RemoveWriterIDs(ids ...int) *MovieUpdate

RemoveWriterIDs removes the "writers" edge to Artist entities by IDs.

func (*MovieUpdate) RemoveWriters

func (mu *MovieUpdate) RemoveWriters(a ...*Artist) *MovieUpdate

RemoveWriters removes "writers" edges to Artist entities.

func (*MovieUpdate) Save

func (mu *MovieUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MovieUpdate) SaveX

func (mu *MovieUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MovieUpdate) SetDuration

func (mu *MovieUpdate) SetDuration(i int) *MovieUpdate

SetDuration sets the "duration" field.

func (*MovieUpdate) SetFile

func (mu *MovieUpdate) SetFile(f *File) *MovieUpdate

SetFile sets the "file" edge to the File entity.

func (*MovieUpdate) SetFileID

func (mu *MovieUpdate) SetFileID(id int) *MovieUpdate

SetFileID sets the "file" edge to the File entity by ID.

func (*MovieUpdate) SetNillableDuration

func (mu *MovieUpdate) SetNillableDuration(i *int) *MovieUpdate

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*MovieUpdate) SetNillableFileID

func (mu *MovieUpdate) SetNillableFileID(id *int) *MovieUpdate

SetNillableFileID sets the "file" edge to the File entity by ID if the given value is not nil.

func (*MovieUpdate) SetNillableOriginalTitle

func (mu *MovieUpdate) SetNillableOriginalTitle(s *string) *MovieUpdate

SetNillableOriginalTitle sets the "original_title" field if the given value is not nil.

func (*MovieUpdate) SetNillablePlot

func (mu *MovieUpdate) SetNillablePlot(s *string) *MovieUpdate

SetNillablePlot sets the "plot" field if the given value is not nil.

func (*MovieUpdate) SetNillablePosterID

func (mu *MovieUpdate) SetNillablePosterID(id *int) *MovieUpdate

SetNillablePosterID sets the "poster" edge to the Picture entity by ID if the given value is not nil.

func (*MovieUpdate) SetNillableReleaseDate

func (mu *MovieUpdate) SetNillableReleaseDate(t *time.Time) *MovieUpdate

SetNillableReleaseDate sets the "release_date" field if the given value is not nil.

func (*MovieUpdate) SetNillableWatched

func (mu *MovieUpdate) SetNillableWatched(b *bool) *MovieUpdate

SetNillableWatched sets the "watched" field if the given value is not nil.

func (*MovieUpdate) SetOriginalTitle

func (mu *MovieUpdate) SetOriginalTitle(s string) *MovieUpdate

SetOriginalTitle sets the "original_title" field.

func (*MovieUpdate) SetPlot

func (mu *MovieUpdate) SetPlot(s string) *MovieUpdate

SetPlot sets the "plot" field.

func (*MovieUpdate) SetPoster

func (mu *MovieUpdate) SetPoster(p *Picture) *MovieUpdate

SetPoster sets the "poster" edge to the Picture entity.

func (*MovieUpdate) SetPosterID

func (mu *MovieUpdate) SetPosterID(id int) *MovieUpdate

SetPosterID sets the "poster" edge to the Picture entity by ID.

func (*MovieUpdate) SetReleaseDate

func (mu *MovieUpdate) SetReleaseDate(t time.Time) *MovieUpdate

SetReleaseDate sets the "release_date" field.

func (*MovieUpdate) SetTitle

func (mu *MovieUpdate) SetTitle(s string) *MovieUpdate

SetTitle sets the "title" field.

func (*MovieUpdate) SetWatched

func (mu *MovieUpdate) SetWatched(b bool) *MovieUpdate

SetWatched sets the "watched" field.

func (*MovieUpdate) Where

func (mu *MovieUpdate) Where(ps ...predicate.Movie) *MovieUpdate

Where appends a list predicates to the MovieUpdate builder.

type MovieUpdateOne

type MovieUpdateOne struct {
	// contains filtered or unexported fields
}

MovieUpdateOne is the builder for updating a single Movie entity.

func (*MovieUpdateOne) AddCast

func (muo *MovieUpdateOne) AddCast(a ...*Artist) *MovieUpdateOne

AddCast adds the "cast" edges to the Artist entity.

func (*MovieUpdateOne) AddCastIDs

func (muo *MovieUpdateOne) AddCastIDs(ids ...int) *MovieUpdateOne

AddCastIDs adds the "cast" edge to the Artist entity by IDs.

func (*MovieUpdateOne) AddCountries

func (muo *MovieUpdateOne) AddCountries(c ...*Country) *MovieUpdateOne

AddCountries adds the "countries" edges to the Country entity.

func (*MovieUpdateOne) AddCountryIDs

func (muo *MovieUpdateOne) AddCountryIDs(ids ...int) *MovieUpdateOne

AddCountryIDs adds the "countries" edge to the Country entity by IDs.

func (*MovieUpdateOne) AddDirectorIDs

func (muo *MovieUpdateOne) AddDirectorIDs(ids ...int) *MovieUpdateOne

AddDirectorIDs adds the "directors" edge to the Artist entity by IDs.

func (*MovieUpdateOne) AddDirectors

func (muo *MovieUpdateOne) AddDirectors(a ...*Artist) *MovieUpdateOne

AddDirectors adds the "directors" edges to the Artist entity.

func (*MovieUpdateOne) AddDuration

func (muo *MovieUpdateOne) AddDuration(i int) *MovieUpdateOne

AddDuration adds i to the "duration" field.

func (*MovieUpdateOne) AddFanart

func (muo *MovieUpdateOne) AddFanart(p ...*Picture) *MovieUpdateOne

AddFanart adds the "fanart" edges to the Picture entity.

func (*MovieUpdateOne) AddFanartIDs

func (muo *MovieUpdateOne) AddFanartIDs(ids ...int) *MovieUpdateOne

AddFanartIDs adds the "fanart" edge to the Picture entity by IDs.

func (*MovieUpdateOne) AddGenreIDs

func (muo *MovieUpdateOne) AddGenreIDs(ids ...int) *MovieUpdateOne

AddGenreIDs adds the "genres" edge to the MovieGenre entity by IDs.

func (*MovieUpdateOne) AddGenres

func (muo *MovieUpdateOne) AddGenres(m ...*MovieGenre) *MovieUpdateOne

AddGenres adds the "genres" edges to the MovieGenre entity.

func (*MovieUpdateOne) AddRatingIDs

func (muo *MovieUpdateOne) AddRatingIDs(ids ...int) *MovieUpdateOne

AddRatingIDs adds the "ratings" edge to the Rating entity by IDs.

func (*MovieUpdateOne) AddRatings

func (muo *MovieUpdateOne) AddRatings(r ...*Rating) *MovieUpdateOne

AddRatings adds the "ratings" edges to the Rating entity.

func (*MovieUpdateOne) AddWriterIDs

func (muo *MovieUpdateOne) AddWriterIDs(ids ...int) *MovieUpdateOne

AddWriterIDs adds the "writers" edge to the Artist entity by IDs.

func (*MovieUpdateOne) AddWriters

func (muo *MovieUpdateOne) AddWriters(a ...*Artist) *MovieUpdateOne

AddWriters adds the "writers" edges to the Artist entity.

func (*MovieUpdateOne) ClearCast

func (muo *MovieUpdateOne) ClearCast() *MovieUpdateOne

ClearCast clears all "cast" edges to the Artist entity.

func (*MovieUpdateOne) ClearCountries

func (muo *MovieUpdateOne) ClearCountries() *MovieUpdateOne

ClearCountries clears all "countries" edges to the Country entity.

func (*MovieUpdateOne) ClearDirectors

func (muo *MovieUpdateOne) ClearDirectors() *MovieUpdateOne

ClearDirectors clears all "directors" edges to the Artist entity.

func (*MovieUpdateOne) ClearDuration

func (muo *MovieUpdateOne) ClearDuration() *MovieUpdateOne

ClearDuration clears the value of the "duration" field.

func (*MovieUpdateOne) ClearFanart

func (muo *MovieUpdateOne) ClearFanart() *MovieUpdateOne

ClearFanart clears all "fanart" edges to the Picture entity.

func (*MovieUpdateOne) ClearFile

func (muo *MovieUpdateOne) ClearFile() *MovieUpdateOne

ClearFile clears the "file" edge to the File entity.

func (*MovieUpdateOne) ClearGenres

func (muo *MovieUpdateOne) ClearGenres() *MovieUpdateOne

ClearGenres clears all "genres" edges to the MovieGenre entity.

func (*MovieUpdateOne) ClearOriginalTitle

func (muo *MovieUpdateOne) ClearOriginalTitle() *MovieUpdateOne

ClearOriginalTitle clears the value of the "original_title" field.

func (*MovieUpdateOne) ClearPlot

func (muo *MovieUpdateOne) ClearPlot() *MovieUpdateOne

ClearPlot clears the value of the "plot" field.

func (*MovieUpdateOne) ClearPoster

func (muo *MovieUpdateOne) ClearPoster() *MovieUpdateOne

ClearPoster clears the "poster" edge to the Picture entity.

func (*MovieUpdateOne) ClearRatings

func (muo *MovieUpdateOne) ClearRatings() *MovieUpdateOne

ClearRatings clears all "ratings" edges to the Rating entity.

func (*MovieUpdateOne) ClearReleaseDate

func (muo *MovieUpdateOne) ClearReleaseDate() *MovieUpdateOne

ClearReleaseDate clears the value of the "release_date" field.

func (*MovieUpdateOne) ClearWriters

func (muo *MovieUpdateOne) ClearWriters() *MovieUpdateOne

ClearWriters clears all "writers" edges to the Artist entity.

func (*MovieUpdateOne) Exec

func (muo *MovieUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MovieUpdateOne) ExecX

func (muo *MovieUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MovieUpdateOne) Mutation

func (muo *MovieUpdateOne) Mutation() *MovieMutation

Mutation returns the MovieMutation object of the builder.

func (*MovieUpdateOne) RemoveCast

func (muo *MovieUpdateOne) RemoveCast(a ...*Artist) *MovieUpdateOne

RemoveCast removes "cast" edges to Artist entities.

func (*MovieUpdateOne) RemoveCastIDs

func (muo *MovieUpdateOne) RemoveCastIDs(ids ...int) *MovieUpdateOne

RemoveCastIDs removes the "cast" edge to Artist entities by IDs.

func (*MovieUpdateOne) RemoveCountries

func (muo *MovieUpdateOne) RemoveCountries(c ...*Country) *MovieUpdateOne

RemoveCountries removes "countries" edges to Country entities.

func (*MovieUpdateOne) RemoveCountryIDs

func (muo *MovieUpdateOne) RemoveCountryIDs(ids ...int) *MovieUpdateOne

RemoveCountryIDs removes the "countries" edge to Country entities by IDs.

func (*MovieUpdateOne) RemoveDirectorIDs

func (muo *MovieUpdateOne) RemoveDirectorIDs(ids ...int) *MovieUpdateOne

RemoveDirectorIDs removes the "directors" edge to Artist entities by IDs.

func (*MovieUpdateOne) RemoveDirectors

func (muo *MovieUpdateOne) RemoveDirectors(a ...*Artist) *MovieUpdateOne

RemoveDirectors removes "directors" edges to Artist entities.

func (*MovieUpdateOne) RemoveFanart

func (muo *MovieUpdateOne) RemoveFanart(p ...*Picture) *MovieUpdateOne

RemoveFanart removes "fanart" edges to Picture entities.

func (*MovieUpdateOne) RemoveFanartIDs

func (muo *MovieUpdateOne) RemoveFanartIDs(ids ...int) *MovieUpdateOne

RemoveFanartIDs removes the "fanart" edge to Picture entities by IDs.

func (*MovieUpdateOne) RemoveGenreIDs

func (muo *MovieUpdateOne) RemoveGenreIDs(ids ...int) *MovieUpdateOne

RemoveGenreIDs removes the "genres" edge to MovieGenre entities by IDs.

func (*MovieUpdateOne) RemoveGenres

func (muo *MovieUpdateOne) RemoveGenres(m ...*MovieGenre) *MovieUpdateOne

RemoveGenres removes "genres" edges to MovieGenre entities.

func (*MovieUpdateOne) RemoveRatingIDs

func (muo *MovieUpdateOne) RemoveRatingIDs(ids ...int) *MovieUpdateOne

RemoveRatingIDs removes the "ratings" edge to Rating entities by IDs.

func (*MovieUpdateOne) RemoveRatings

func (muo *MovieUpdateOne) RemoveRatings(r ...*Rating) *MovieUpdateOne

RemoveRatings removes "ratings" edges to Rating entities.

func (*MovieUpdateOne) RemoveWriterIDs

func (muo *MovieUpdateOne) RemoveWriterIDs(ids ...int) *MovieUpdateOne

RemoveWriterIDs removes the "writers" edge to Artist entities by IDs.

func (*MovieUpdateOne) RemoveWriters

func (muo *MovieUpdateOne) RemoveWriters(a ...*Artist) *MovieUpdateOne

RemoveWriters removes "writers" edges to Artist entities.

func (*MovieUpdateOne) Save

func (muo *MovieUpdateOne) Save(ctx context.Context) (*Movie, error)

Save executes the query and returns the updated Movie entity.

func (*MovieUpdateOne) SaveX

func (muo *MovieUpdateOne) SaveX(ctx context.Context) *Movie

SaveX is like Save, but panics if an error occurs.

func (*MovieUpdateOne) Select

func (muo *MovieUpdateOne) Select(field string, fields ...string) *MovieUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MovieUpdateOne) SetDuration

func (muo *MovieUpdateOne) SetDuration(i int) *MovieUpdateOne

SetDuration sets the "duration" field.

func (*MovieUpdateOne) SetFile

func (muo *MovieUpdateOne) SetFile(f *File) *MovieUpdateOne

SetFile sets the "file" edge to the File entity.

func (*MovieUpdateOne) SetFileID

func (muo *MovieUpdateOne) SetFileID(id int) *MovieUpdateOne

SetFileID sets the "file" edge to the File entity by ID.

func (*MovieUpdateOne) SetNillableDuration

func (muo *MovieUpdateOne) SetNillableDuration(i *int) *MovieUpdateOne

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*MovieUpdateOne) SetNillableFileID

func (muo *MovieUpdateOne) SetNillableFileID(id *int) *MovieUpdateOne

SetNillableFileID sets the "file" edge to the File entity by ID if the given value is not nil.

func (*MovieUpdateOne) SetNillableOriginalTitle

func (muo *MovieUpdateOne) SetNillableOriginalTitle(s *string) *MovieUpdateOne

SetNillableOriginalTitle sets the "original_title" field if the given value is not nil.

func (*MovieUpdateOne) SetNillablePlot

func (muo *MovieUpdateOne) SetNillablePlot(s *string) *MovieUpdateOne

SetNillablePlot sets the "plot" field if the given value is not nil.

func (*MovieUpdateOne) SetNillablePosterID

func (muo *MovieUpdateOne) SetNillablePosterID(id *int) *MovieUpdateOne

SetNillablePosterID sets the "poster" edge to the Picture entity by ID if the given value is not nil.

func (*MovieUpdateOne) SetNillableReleaseDate

func (muo *MovieUpdateOne) SetNillableReleaseDate(t *time.Time) *MovieUpdateOne

SetNillableReleaseDate sets the "release_date" field if the given value is not nil.

func (*MovieUpdateOne) SetNillableWatched

func (muo *MovieUpdateOne) SetNillableWatched(b *bool) *MovieUpdateOne

SetNillableWatched sets the "watched" field if the given value is not nil.

func (*MovieUpdateOne) SetOriginalTitle

func (muo *MovieUpdateOne) SetOriginalTitle(s string) *MovieUpdateOne

SetOriginalTitle sets the "original_title" field.

func (*MovieUpdateOne) SetPlot

func (muo *MovieUpdateOne) SetPlot(s string) *MovieUpdateOne

SetPlot sets the "plot" field.

func (*MovieUpdateOne) SetPoster

func (muo *MovieUpdateOne) SetPoster(p *Picture) *MovieUpdateOne

SetPoster sets the "poster" edge to the Picture entity.

func (*MovieUpdateOne) SetPosterID

func (muo *MovieUpdateOne) SetPosterID(id int) *MovieUpdateOne

SetPosterID sets the "poster" edge to the Picture entity by ID.

func (*MovieUpdateOne) SetReleaseDate

func (muo *MovieUpdateOne) SetReleaseDate(t time.Time) *MovieUpdateOne

SetReleaseDate sets the "release_date" field.

func (*MovieUpdateOne) SetTitle

func (muo *MovieUpdateOne) SetTitle(s string) *MovieUpdateOne

SetTitle sets the "title" field.

func (*MovieUpdateOne) SetWatched

func (muo *MovieUpdateOne) SetWatched(b bool) *MovieUpdateOne

SetWatched sets the "watched" field.

type Movies

type Movies []*Movie

Movies is a parsable slice of Movie.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Picture

type Picture struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Filename holds the value of the "filename" field.
	Filename string `json:"filename,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// contains filtered or unexported fields
}

Picture is the model entity for the Picture schema.

func (*Picture) String

func (pi *Picture) String() string

String implements the fmt.Stringer.

func (*Picture) Unwrap

func (pi *Picture) Unwrap() *Picture

Unwrap unwraps the Picture 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 (*Picture) Update

func (pi *Picture) Update() *PictureUpdateOne

Update returns a builder for updating this Picture. Note that you need to call Picture.Unwrap() before calling this method if this Picture was returned from a transaction, and the transaction was committed or rolled back.

type PictureClient

type PictureClient struct {
	// contains filtered or unexported fields
}

PictureClient is a client for the Picture schema.

func NewPictureClient

func NewPictureClient(c config) *PictureClient

NewPictureClient returns a client for the Picture from the given config.

func (*PictureClient) Create

func (c *PictureClient) Create() *PictureCreate

Create returns a create builder for Picture.

func (*PictureClient) CreateBulk

func (c *PictureClient) CreateBulk(builders ...*PictureCreate) *PictureCreateBulk

CreateBulk returns a builder for creating a bulk of Picture entities.

func (*PictureClient) Delete

func (c *PictureClient) Delete() *PictureDelete

Delete returns a delete builder for Picture.

func (*PictureClient) DeleteOne

func (c *PictureClient) DeleteOne(pi *Picture) *PictureDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*PictureClient) DeleteOneID

func (c *PictureClient) DeleteOneID(id int) *PictureDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*PictureClient) Get

func (c *PictureClient) Get(ctx context.Context, id int) (*Picture, error)

Get returns a Picture entity by its id.

func (*PictureClient) GetX

func (c *PictureClient) GetX(ctx context.Context, id int) *Picture

GetX is like Get, but panics if an error occurs.

func (*PictureClient) Hooks

func (c *PictureClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PictureClient) Query

func (c *PictureClient) Query() *PictureQuery

Query returns a query builder for Picture.

func (*PictureClient) Update

func (c *PictureClient) Update() *PictureUpdate

Update returns an update builder for Picture.

func (*PictureClient) UpdateOne

func (c *PictureClient) UpdateOne(pi *Picture) *PictureUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PictureClient) UpdateOneID

func (c *PictureClient) UpdateOneID(id int) *PictureUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PictureClient) Use

func (c *PictureClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `picture.Hooks(f(g(h())))`.

type PictureCreate

type PictureCreate struct {
	// contains filtered or unexported fields
}

PictureCreate is the builder for creating a Picture entity.

func (*PictureCreate) Exec

func (pc *PictureCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PictureCreate) ExecX

func (pc *PictureCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PictureCreate) Mutation

func (pc *PictureCreate) Mutation() *PictureMutation

Mutation returns the PictureMutation object of the builder.

func (*PictureCreate) Save

func (pc *PictureCreate) Save(ctx context.Context) (*Picture, error)

Save creates the Picture in the database.

func (*PictureCreate) SaveX

func (pc *PictureCreate) SaveX(ctx context.Context) *Picture

SaveX calls Save and panics if Save returns an error.

func (*PictureCreate) SetFilename

func (pc *PictureCreate) SetFilename(s string) *PictureCreate

SetFilename sets the "filename" field.

func (*PictureCreate) SetName

func (pc *PictureCreate) SetName(s string) *PictureCreate

SetName sets the "name" field.

func (*PictureCreate) SetNillableName

func (pc *PictureCreate) SetNillableName(s *string) *PictureCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*PictureCreate) SetPath

func (pc *PictureCreate) SetPath(s string) *PictureCreate

SetPath sets the "path" field.

type PictureCreateBulk

type PictureCreateBulk struct {
	// contains filtered or unexported fields
}

PictureCreateBulk is the builder for creating many Picture entities in bulk.

func (*PictureCreateBulk) Exec

func (pcb *PictureCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PictureCreateBulk) ExecX

func (pcb *PictureCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PictureCreateBulk) Save

func (pcb *PictureCreateBulk) Save(ctx context.Context) ([]*Picture, error)

Save creates the Picture entities in the database.

func (*PictureCreateBulk) SaveX

func (pcb *PictureCreateBulk) SaveX(ctx context.Context) []*Picture

SaveX is like Save, but panics if an error occurs.

type PictureDelete

type PictureDelete struct {
	// contains filtered or unexported fields
}

PictureDelete is the builder for deleting a Picture entity.

func (*PictureDelete) Exec

func (pd *PictureDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PictureDelete) ExecX

func (pd *PictureDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PictureDelete) Where

func (pd *PictureDelete) Where(ps ...predicate.Picture) *PictureDelete

Where appends a list predicates to the PictureDelete builder.

type PictureDeleteOne

type PictureDeleteOne struct {
	// contains filtered or unexported fields
}

PictureDeleteOne is the builder for deleting a single Picture entity.

func (*PictureDeleteOne) Exec

func (pdo *PictureDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PictureDeleteOne) ExecX

func (pdo *PictureDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type PictureGroupBy

type PictureGroupBy struct {
	// contains filtered or unexported fields
}

PictureGroupBy is the group-by builder for Picture entities.

func (*PictureGroupBy) Aggregate

func (pgb *PictureGroupBy) Aggregate(fns ...AggregateFunc) *PictureGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PictureGroupBy) Bool

func (s *PictureGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) BoolX

func (s *PictureGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PictureGroupBy) Bools

func (s *PictureGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) BoolsX

func (s *PictureGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PictureGroupBy) Float64

func (s *PictureGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) Float64X

func (s *PictureGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PictureGroupBy) Float64s

func (s *PictureGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) Float64sX

func (s *PictureGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PictureGroupBy) Int

func (s *PictureGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) IntX

func (s *PictureGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PictureGroupBy) Ints

func (s *PictureGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) IntsX

func (s *PictureGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PictureGroupBy) Scan

func (pgb *PictureGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*PictureGroupBy) ScanX

func (s *PictureGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*PictureGroupBy) String

func (s *PictureGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) StringX

func (s *PictureGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PictureGroupBy) Strings

func (s *PictureGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PictureGroupBy) StringsX

func (s *PictureGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PictureMutation

type PictureMutation struct {
	// contains filtered or unexported fields
}

PictureMutation represents an operation that mutates the Picture nodes in the graph.

func (*PictureMutation) AddField

func (m *PictureMutation) 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 (*PictureMutation) AddedEdges

func (m *PictureMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PictureMutation) AddedField

func (m *PictureMutation) 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 (*PictureMutation) AddedFields

func (m *PictureMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PictureMutation) AddedIDs

func (m *PictureMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PictureMutation) ClearEdge

func (m *PictureMutation) 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 (*PictureMutation) ClearField

func (m *PictureMutation) 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 (*PictureMutation) ClearName

func (m *PictureMutation) ClearName()

ClearName clears the value of the "name" field.

func (*PictureMutation) ClearedEdges

func (m *PictureMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PictureMutation) ClearedFields

func (m *PictureMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PictureMutation) Client

func (m PictureMutation) 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 (*PictureMutation) EdgeCleared

func (m *PictureMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PictureMutation) Field

func (m *PictureMutation) 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 (*PictureMutation) FieldCleared

func (m *PictureMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PictureMutation) Fields

func (m *PictureMutation) 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 (*PictureMutation) Filename

func (m *PictureMutation) Filename() (r string, exists bool)

Filename returns the value of the "filename" field in the mutation.

func (*PictureMutation) ID

func (m *PictureMutation) 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 (*PictureMutation) IDs

func (m *PictureMutation) 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 (*PictureMutation) Name

func (m *PictureMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PictureMutation) NameCleared

func (m *PictureMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*PictureMutation) OldField

func (m *PictureMutation) 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 (*PictureMutation) OldFilename

func (m *PictureMutation) OldFilename(ctx context.Context) (v string, err error)

OldFilename returns the old "filename" field's value of the Picture entity. If the Picture 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 (*PictureMutation) OldName

func (m *PictureMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Picture entity. If the Picture 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 (*PictureMutation) OldPath

func (m *PictureMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Picture entity. If the Picture 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 (*PictureMutation) Op

func (m *PictureMutation) Op() Op

Op returns the operation name.

func (*PictureMutation) Path

func (m *PictureMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*PictureMutation) RemovedEdges

func (m *PictureMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PictureMutation) RemovedIDs

func (m *PictureMutation) 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 (*PictureMutation) ResetEdge

func (m *PictureMutation) 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 (*PictureMutation) ResetField

func (m *PictureMutation) 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 (*PictureMutation) ResetFilename

func (m *PictureMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*PictureMutation) ResetName

func (m *PictureMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PictureMutation) ResetPath

func (m *PictureMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*PictureMutation) SetField

func (m *PictureMutation) 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 (*PictureMutation) SetFilename

func (m *PictureMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*PictureMutation) SetName

func (m *PictureMutation) SetName(s string)

SetName sets the "name" field.

func (*PictureMutation) SetPath

func (m *PictureMutation) SetPath(s string)

SetPath sets the "path" field.

func (PictureMutation) Tx

func (m PictureMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PictureMutation) Type

func (m *PictureMutation) Type() string

Type returns the node type of this mutation (Picture).

func (*PictureMutation) Where

func (m *PictureMutation) Where(ps ...predicate.Picture)

Where appends a list predicates to the PictureMutation builder.

type PictureQuery

type PictureQuery struct {
	// contains filtered or unexported fields
}

PictureQuery is the builder for querying Picture entities.

func (*PictureQuery) All

func (pq *PictureQuery) All(ctx context.Context) ([]*Picture, error)

All executes the query and returns a list of Pictures.

func (*PictureQuery) AllX

func (pq *PictureQuery) AllX(ctx context.Context) []*Picture

AllX is like All, but panics if an error occurs.

func (*PictureQuery) Clone

func (pq *PictureQuery) Clone() *PictureQuery

Clone returns a duplicate of the PictureQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PictureQuery) Count

func (pq *PictureQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PictureQuery) CountX

func (pq *PictureQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PictureQuery) Exist

func (pq *PictureQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PictureQuery) ExistX

func (pq *PictureQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PictureQuery) First

func (pq *PictureQuery) First(ctx context.Context) (*Picture, error)

First returns the first Picture entity from the query. Returns a *NotFoundError when no Picture was found.

func (*PictureQuery) FirstID

func (pq *PictureQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Picture ID from the query. Returns a *NotFoundError when no Picture ID was found.

func (*PictureQuery) FirstIDX

func (pq *PictureQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PictureQuery) FirstX

func (pq *PictureQuery) FirstX(ctx context.Context) *Picture

FirstX is like First, but panics if an error occurs.

func (*PictureQuery) GroupBy

func (pq *PictureQuery) GroupBy(field string, fields ...string) *PictureGroupBy

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.Picture.Query().
	GroupBy(picture.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PictureQuery) IDs

func (pq *PictureQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Picture IDs.

func (*PictureQuery) IDsX

func (pq *PictureQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PictureQuery) Limit

func (pq *PictureQuery) Limit(limit int) *PictureQuery

Limit adds a limit step to the query.

func (*PictureQuery) Offset

func (pq *PictureQuery) Offset(offset int) *PictureQuery

Offset adds an offset step to the query.

func (*PictureQuery) Only

func (pq *PictureQuery) Only(ctx context.Context) (*Picture, error)

Only returns a single Picture entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Picture entity is found. Returns a *NotFoundError when no Picture entities are found.

func (*PictureQuery) OnlyID

func (pq *PictureQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Picture ID in the query. Returns a *NotSingularError when more than one Picture ID is found. Returns a *NotFoundError when no entities are found.

func (*PictureQuery) OnlyIDX

func (pq *PictureQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PictureQuery) OnlyX

func (pq *PictureQuery) OnlyX(ctx context.Context) *Picture

OnlyX is like Only, but panics if an error occurs.

func (*PictureQuery) Order

func (pq *PictureQuery) Order(o ...OrderFunc) *PictureQuery

Order adds an order step to the query.

func (*PictureQuery) Select

func (pq *PictureQuery) Select(fields ...string) *PictureSelect

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.Picture.Query().
	Select(picture.FieldName).
	Scan(ctx, &v)

func (*PictureQuery) Unique

func (pq *PictureQuery) Unique(unique bool) *PictureQuery

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 (*PictureQuery) Where

func (pq *PictureQuery) Where(ps ...predicate.Picture) *PictureQuery

Where adds a new predicate for the PictureQuery builder.

type PictureSelect

type PictureSelect struct {
	*PictureQuery
	// contains filtered or unexported fields
}

PictureSelect is the builder for selecting fields of Picture entities.

func (*PictureSelect) Bool

func (s *PictureSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PictureSelect) BoolX

func (s *PictureSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PictureSelect) Bools

func (s *PictureSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PictureSelect) BoolsX

func (s *PictureSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PictureSelect) Float64

func (s *PictureSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PictureSelect) Float64X

func (s *PictureSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PictureSelect) Float64s

func (s *PictureSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PictureSelect) Float64sX

func (s *PictureSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PictureSelect) Int

func (s *PictureSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PictureSelect) IntX

func (s *PictureSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PictureSelect) Ints

func (s *PictureSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PictureSelect) IntsX

func (s *PictureSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PictureSelect) Scan

func (ps *PictureSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*PictureSelect) ScanX

func (s *PictureSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*PictureSelect) String

func (s *PictureSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PictureSelect) StringX

func (s *PictureSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PictureSelect) Strings

func (s *PictureSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PictureSelect) StringsX

func (s *PictureSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PictureUpdate

type PictureUpdate struct {
	// contains filtered or unexported fields
}

PictureUpdate is the builder for updating Picture entities.

func (*PictureUpdate) ClearName

func (pu *PictureUpdate) ClearName() *PictureUpdate

ClearName clears the value of the "name" field.

func (*PictureUpdate) Exec

func (pu *PictureUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PictureUpdate) ExecX

func (pu *PictureUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PictureUpdate) Mutation

func (pu *PictureUpdate) Mutation() *PictureMutation

Mutation returns the PictureMutation object of the builder.

func (*PictureUpdate) Save

func (pu *PictureUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PictureUpdate) SaveX

func (pu *PictureUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PictureUpdate) SetFilename

func (pu *PictureUpdate) SetFilename(s string) *PictureUpdate

SetFilename sets the "filename" field.

func (*PictureUpdate) SetName

func (pu *PictureUpdate) SetName(s string) *PictureUpdate

SetName sets the "name" field.

func (*PictureUpdate) SetNillableName

func (pu *PictureUpdate) SetNillableName(s *string) *PictureUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PictureUpdate) SetPath

func (pu *PictureUpdate) SetPath(s string) *PictureUpdate

SetPath sets the "path" field.

func (*PictureUpdate) Where

func (pu *PictureUpdate) Where(ps ...predicate.Picture) *PictureUpdate

Where appends a list predicates to the PictureUpdate builder.

type PictureUpdateOne

type PictureUpdateOne struct {
	// contains filtered or unexported fields
}

PictureUpdateOne is the builder for updating a single Picture entity.

func (*PictureUpdateOne) ClearName

func (puo *PictureUpdateOne) ClearName() *PictureUpdateOne

ClearName clears the value of the "name" field.

func (*PictureUpdateOne) Exec

func (puo *PictureUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PictureUpdateOne) ExecX

func (puo *PictureUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PictureUpdateOne) Mutation

func (puo *PictureUpdateOne) Mutation() *PictureMutation

Mutation returns the PictureMutation object of the builder.

func (*PictureUpdateOne) Save

func (puo *PictureUpdateOne) Save(ctx context.Context) (*Picture, error)

Save executes the query and returns the updated Picture entity.

func (*PictureUpdateOne) SaveX

func (puo *PictureUpdateOne) SaveX(ctx context.Context) *Picture

SaveX is like Save, but panics if an error occurs.

func (*PictureUpdateOne) Select

func (puo *PictureUpdateOne) Select(field string, fields ...string) *PictureUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PictureUpdateOne) SetFilename

func (puo *PictureUpdateOne) SetFilename(s string) *PictureUpdateOne

SetFilename sets the "filename" field.

func (*PictureUpdateOne) SetName

func (puo *PictureUpdateOne) SetName(s string) *PictureUpdateOne

SetName sets the "name" field.

func (*PictureUpdateOne) SetNillableName

func (puo *PictureUpdateOne) SetNillableName(s *string) *PictureUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PictureUpdateOne) SetPath

func (puo *PictureUpdateOne) SetPath(s string) *PictureUpdateOne

SetPath sets the "path" field.

type Pictures

type Pictures []*Picture

Pictures is a parsable slice of Picture.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type Rating

type Rating struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Origin holds the value of the "origin" field.
	Origin string `json:"origin,omitempty"`
	// OriginalRating holds the value of the "original_rating" field.
	OriginalRating string `json:"original_rating,omitempty"`
	// NormalizedRating holds the value of the "normalized_rating" field.
	NormalizedRating int `json:"normalized_rating,omitempty"`
	// contains filtered or unexported fields
}

Rating is the model entity for the Rating schema.

func (*Rating) String

func (r *Rating) String() string

String implements the fmt.Stringer.

func (*Rating) Unwrap

func (r *Rating) Unwrap() *Rating

Unwrap unwraps the Rating 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 (*Rating) Update

func (r *Rating) Update() *RatingUpdateOne

Update returns a builder for updating this Rating. Note that you need to call Rating.Unwrap() before calling this method if this Rating was returned from a transaction, and the transaction was committed or rolled back.

type RatingClient

type RatingClient struct {
	// contains filtered or unexported fields
}

RatingClient is a client for the Rating schema.

func NewRatingClient

func NewRatingClient(c config) *RatingClient

NewRatingClient returns a client for the Rating from the given config.

func (*RatingClient) Create

func (c *RatingClient) Create() *RatingCreate

Create returns a create builder for Rating.

func (*RatingClient) CreateBulk

func (c *RatingClient) CreateBulk(builders ...*RatingCreate) *RatingCreateBulk

CreateBulk returns a builder for creating a bulk of Rating entities.

func (*RatingClient) Delete

func (c *RatingClient) Delete() *RatingDelete

Delete returns a delete builder for Rating.

func (*RatingClient) DeleteOne

func (c *RatingClient) DeleteOne(r *Rating) *RatingDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*RatingClient) DeleteOneID

func (c *RatingClient) DeleteOneID(id int) *RatingDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*RatingClient) Get

func (c *RatingClient) Get(ctx context.Context, id int) (*Rating, error)

Get returns a Rating entity by its id.

func (*RatingClient) GetX

func (c *RatingClient) GetX(ctx context.Context, id int) *Rating

GetX is like Get, but panics if an error occurs.

func (*RatingClient) Hooks

func (c *RatingClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RatingClient) Query

func (c *RatingClient) Query() *RatingQuery

Query returns a query builder for Rating.

func (*RatingClient) Update

func (c *RatingClient) Update() *RatingUpdate

Update returns an update builder for Rating.

func (*RatingClient) UpdateOne

func (c *RatingClient) UpdateOne(r *Rating) *RatingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RatingClient) UpdateOneID

func (c *RatingClient) UpdateOneID(id int) *RatingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RatingClient) Use

func (c *RatingClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rating.Hooks(f(g(h())))`.

type RatingCreate

type RatingCreate struct {
	// contains filtered or unexported fields
}

RatingCreate is the builder for creating a Rating entity.

func (*RatingCreate) Exec

func (rc *RatingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RatingCreate) ExecX

func (rc *RatingCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RatingCreate) Mutation

func (rc *RatingCreate) Mutation() *RatingMutation

Mutation returns the RatingMutation object of the builder.

func (*RatingCreate) Save

func (rc *RatingCreate) Save(ctx context.Context) (*Rating, error)

Save creates the Rating in the database.

func (*RatingCreate) SaveX

func (rc *RatingCreate) SaveX(ctx context.Context) *Rating

SaveX calls Save and panics if Save returns an error.

func (*RatingCreate) SetNormalizedRating

func (rc *RatingCreate) SetNormalizedRating(i int) *RatingCreate

SetNormalizedRating sets the "normalized_rating" field.

func (*RatingCreate) SetOrigin

func (rc *RatingCreate) SetOrigin(s string) *RatingCreate

SetOrigin sets the "origin" field.

func (*RatingCreate) SetOriginalRating

func (rc *RatingCreate) SetOriginalRating(s string) *RatingCreate

SetOriginalRating sets the "original_rating" field.

type RatingCreateBulk

type RatingCreateBulk struct {
	// contains filtered or unexported fields
}

RatingCreateBulk is the builder for creating many Rating entities in bulk.

func (*RatingCreateBulk) Exec

func (rcb *RatingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RatingCreateBulk) ExecX

func (rcb *RatingCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RatingCreateBulk) Save

func (rcb *RatingCreateBulk) Save(ctx context.Context) ([]*Rating, error)

Save creates the Rating entities in the database.

func (*RatingCreateBulk) SaveX

func (rcb *RatingCreateBulk) SaveX(ctx context.Context) []*Rating

SaveX is like Save, but panics if an error occurs.

type RatingDelete

type RatingDelete struct {
	// contains filtered or unexported fields
}

RatingDelete is the builder for deleting a Rating entity.

func (*RatingDelete) Exec

func (rd *RatingDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RatingDelete) ExecX

func (rd *RatingDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RatingDelete) Where

func (rd *RatingDelete) Where(ps ...predicate.Rating) *RatingDelete

Where appends a list predicates to the RatingDelete builder.

type RatingDeleteOne

type RatingDeleteOne struct {
	// contains filtered or unexported fields
}

RatingDeleteOne is the builder for deleting a single Rating entity.

func (*RatingDeleteOne) Exec

func (rdo *RatingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RatingDeleteOne) ExecX

func (rdo *RatingDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type RatingGroupBy

type RatingGroupBy struct {
	// contains filtered or unexported fields
}

RatingGroupBy is the group-by builder for Rating entities.

func (*RatingGroupBy) Aggregate

func (rgb *RatingGroupBy) Aggregate(fns ...AggregateFunc) *RatingGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RatingGroupBy) Bool

func (s *RatingGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) BoolX

func (s *RatingGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RatingGroupBy) Bools

func (s *RatingGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) BoolsX

func (s *RatingGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RatingGroupBy) Float64

func (s *RatingGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) Float64X

func (s *RatingGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RatingGroupBy) Float64s

func (s *RatingGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) Float64sX

func (s *RatingGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RatingGroupBy) Int

func (s *RatingGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) IntX

func (s *RatingGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RatingGroupBy) Ints

func (s *RatingGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) IntsX

func (s *RatingGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RatingGroupBy) Scan

func (rgb *RatingGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*RatingGroupBy) ScanX

func (s *RatingGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*RatingGroupBy) String

func (s *RatingGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) StringX

func (s *RatingGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RatingGroupBy) Strings

func (s *RatingGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RatingGroupBy) StringsX

func (s *RatingGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RatingMutation

type RatingMutation struct {
	// contains filtered or unexported fields
}

RatingMutation represents an operation that mutates the Rating nodes in the graph.

func (*RatingMutation) AddField

func (m *RatingMutation) 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 (*RatingMutation) AddNormalizedRating

func (m *RatingMutation) AddNormalizedRating(i int)

AddNormalizedRating adds i to the "normalized_rating" field.

func (*RatingMutation) AddedEdges

func (m *RatingMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RatingMutation) AddedField

func (m *RatingMutation) 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 (*RatingMutation) AddedFields

func (m *RatingMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RatingMutation) AddedIDs

func (m *RatingMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RatingMutation) AddedNormalizedRating

func (m *RatingMutation) AddedNormalizedRating() (r int, exists bool)

AddedNormalizedRating returns the value that was added to the "normalized_rating" field in this mutation.

func (*RatingMutation) ClearEdge

func (m *RatingMutation) 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 (*RatingMutation) ClearField

func (m *RatingMutation) 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 (*RatingMutation) ClearedEdges

func (m *RatingMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RatingMutation) ClearedFields

func (m *RatingMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RatingMutation) Client

func (m RatingMutation) 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 (*RatingMutation) EdgeCleared

func (m *RatingMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RatingMutation) Field

func (m *RatingMutation) 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 (*RatingMutation) FieldCleared

func (m *RatingMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RatingMutation) Fields

func (m *RatingMutation) 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 (*RatingMutation) ID

func (m *RatingMutation) 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 (*RatingMutation) IDs

func (m *RatingMutation) 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 (*RatingMutation) NormalizedRating

func (m *RatingMutation) NormalizedRating() (r int, exists bool)

NormalizedRating returns the value of the "normalized_rating" field in the mutation.

func (*RatingMutation) OldField

func (m *RatingMutation) 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 (*RatingMutation) OldNormalizedRating

func (m *RatingMutation) OldNormalizedRating(ctx context.Context) (v int, err error)

OldNormalizedRating returns the old "normalized_rating" field's value of the Rating entity. If the Rating 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 (*RatingMutation) OldOrigin

func (m *RatingMutation) OldOrigin(ctx context.Context) (v string, err error)

OldOrigin returns the old "origin" field's value of the Rating entity. If the Rating 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 (*RatingMutation) OldOriginalRating

func (m *RatingMutation) OldOriginalRating(ctx context.Context) (v string, err error)

OldOriginalRating returns the old "original_rating" field's value of the Rating entity. If the Rating 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 (*RatingMutation) Op

func (m *RatingMutation) Op() Op

Op returns the operation name.

func (*RatingMutation) Origin

func (m *RatingMutation) Origin() (r string, exists bool)

Origin returns the value of the "origin" field in the mutation.

func (*RatingMutation) OriginalRating

func (m *RatingMutation) OriginalRating() (r string, exists bool)

OriginalRating returns the value of the "original_rating" field in the mutation.

func (*RatingMutation) RemovedEdges

func (m *RatingMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RatingMutation) RemovedIDs

func (m *RatingMutation) 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 (*RatingMutation) ResetEdge

func (m *RatingMutation) 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 (*RatingMutation) ResetField

func (m *RatingMutation) 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 (*RatingMutation) ResetNormalizedRating

func (m *RatingMutation) ResetNormalizedRating()

ResetNormalizedRating resets all changes to the "normalized_rating" field.

func (*RatingMutation) ResetOrigin

func (m *RatingMutation) ResetOrigin()

ResetOrigin resets all changes to the "origin" field.

func (*RatingMutation) ResetOriginalRating

func (m *RatingMutation) ResetOriginalRating()

ResetOriginalRating resets all changes to the "original_rating" field.

func (*RatingMutation) SetField

func (m *RatingMutation) 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 (*RatingMutation) SetNormalizedRating

func (m *RatingMutation) SetNormalizedRating(i int)

SetNormalizedRating sets the "normalized_rating" field.

func (*RatingMutation) SetOrigin

func (m *RatingMutation) SetOrigin(s string)

SetOrigin sets the "origin" field.

func (*RatingMutation) SetOriginalRating

func (m *RatingMutation) SetOriginalRating(s string)

SetOriginalRating sets the "original_rating" field.

func (RatingMutation) Tx

func (m RatingMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RatingMutation) Type

func (m *RatingMutation) Type() string

Type returns the node type of this mutation (Rating).

func (*RatingMutation) Where

func (m *RatingMutation) Where(ps ...predicate.Rating)

Where appends a list predicates to the RatingMutation builder.

type RatingQuery

type RatingQuery struct {
	// contains filtered or unexported fields
}

RatingQuery is the builder for querying Rating entities.

func (*RatingQuery) All

func (rq *RatingQuery) All(ctx context.Context) ([]*Rating, error)

All executes the query and returns a list of Ratings.

func (*RatingQuery) AllX

func (rq *RatingQuery) AllX(ctx context.Context) []*Rating

AllX is like All, but panics if an error occurs.

func (*RatingQuery) Clone

func (rq *RatingQuery) Clone() *RatingQuery

Clone returns a duplicate of the RatingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RatingQuery) Count

func (rq *RatingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RatingQuery) CountX

func (rq *RatingQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RatingQuery) Exist

func (rq *RatingQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RatingQuery) ExistX

func (rq *RatingQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RatingQuery) First

func (rq *RatingQuery) First(ctx context.Context) (*Rating, error)

First returns the first Rating entity from the query. Returns a *NotFoundError when no Rating was found.

func (*RatingQuery) FirstID

func (rq *RatingQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Rating ID from the query. Returns a *NotFoundError when no Rating ID was found.

func (*RatingQuery) FirstIDX

func (rq *RatingQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RatingQuery) FirstX

func (rq *RatingQuery) FirstX(ctx context.Context) *Rating

FirstX is like First, but panics if an error occurs.

func (*RatingQuery) GroupBy

func (rq *RatingQuery) GroupBy(field string, fields ...string) *RatingGroupBy

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 {
	Origin string `json:"origin,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Rating.Query().
	GroupBy(rating.FieldOrigin).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RatingQuery) IDs

func (rq *RatingQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Rating IDs.

func (*RatingQuery) IDsX

func (rq *RatingQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RatingQuery) Limit

func (rq *RatingQuery) Limit(limit int) *RatingQuery

Limit adds a limit step to the query.

func (*RatingQuery) Offset

func (rq *RatingQuery) Offset(offset int) *RatingQuery

Offset adds an offset step to the query.

func (*RatingQuery) Only

func (rq *RatingQuery) Only(ctx context.Context) (*Rating, error)

Only returns a single Rating entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Rating entity is found. Returns a *NotFoundError when no Rating entities are found.

func (*RatingQuery) OnlyID

func (rq *RatingQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Rating ID in the query. Returns a *NotSingularError when more than one Rating ID is found. Returns a *NotFoundError when no entities are found.

func (*RatingQuery) OnlyIDX

func (rq *RatingQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RatingQuery) OnlyX

func (rq *RatingQuery) OnlyX(ctx context.Context) *Rating

OnlyX is like Only, but panics if an error occurs.

func (*RatingQuery) Order

func (rq *RatingQuery) Order(o ...OrderFunc) *RatingQuery

Order adds an order step to the query.

func (*RatingQuery) Select

func (rq *RatingQuery) Select(fields ...string) *RatingSelect

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 {
	Origin string `json:"origin,omitempty"`
}

client.Rating.Query().
	Select(rating.FieldOrigin).
	Scan(ctx, &v)

func (*RatingQuery) Unique

func (rq *RatingQuery) Unique(unique bool) *RatingQuery

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 (*RatingQuery) Where

func (rq *RatingQuery) Where(ps ...predicate.Rating) *RatingQuery

Where adds a new predicate for the RatingQuery builder.

type RatingSelect

type RatingSelect struct {
	*RatingQuery
	// contains filtered or unexported fields
}

RatingSelect is the builder for selecting fields of Rating entities.

func (*RatingSelect) Bool

func (s *RatingSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RatingSelect) BoolX

func (s *RatingSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RatingSelect) Bools

func (s *RatingSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RatingSelect) BoolsX

func (s *RatingSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RatingSelect) Float64

func (s *RatingSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RatingSelect) Float64X

func (s *RatingSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RatingSelect) Float64s

func (s *RatingSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RatingSelect) Float64sX

func (s *RatingSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RatingSelect) Int

func (s *RatingSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RatingSelect) IntX

func (s *RatingSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RatingSelect) Ints

func (s *RatingSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RatingSelect) IntsX

func (s *RatingSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RatingSelect) Scan

func (rs *RatingSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*RatingSelect) ScanX

func (s *RatingSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*RatingSelect) String

func (s *RatingSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RatingSelect) StringX

func (s *RatingSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RatingSelect) Strings

func (s *RatingSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RatingSelect) StringsX

func (s *RatingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RatingUpdate

type RatingUpdate struct {
	// contains filtered or unexported fields
}

RatingUpdate is the builder for updating Rating entities.

func (*RatingUpdate) AddNormalizedRating

func (ru *RatingUpdate) AddNormalizedRating(i int) *RatingUpdate

AddNormalizedRating adds i to the "normalized_rating" field.

func (*RatingUpdate) Exec

func (ru *RatingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RatingUpdate) ExecX

func (ru *RatingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RatingUpdate) Mutation

func (ru *RatingUpdate) Mutation() *RatingMutation

Mutation returns the RatingMutation object of the builder.

func (*RatingUpdate) Save

func (ru *RatingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RatingUpdate) SaveX

func (ru *RatingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RatingUpdate) SetNormalizedRating

func (ru *RatingUpdate) SetNormalizedRating(i int) *RatingUpdate

SetNormalizedRating sets the "normalized_rating" field.

func (*RatingUpdate) SetOrigin

func (ru *RatingUpdate) SetOrigin(s string) *RatingUpdate

SetOrigin sets the "origin" field.

func (*RatingUpdate) SetOriginalRating

func (ru *RatingUpdate) SetOriginalRating(s string) *RatingUpdate

SetOriginalRating sets the "original_rating" field.

func (*RatingUpdate) Where

func (ru *RatingUpdate) Where(ps ...predicate.Rating) *RatingUpdate

Where appends a list predicates to the RatingUpdate builder.

type RatingUpdateOne

type RatingUpdateOne struct {
	// contains filtered or unexported fields
}

RatingUpdateOne is the builder for updating a single Rating entity.

func (*RatingUpdateOne) AddNormalizedRating

func (ruo *RatingUpdateOne) AddNormalizedRating(i int) *RatingUpdateOne

AddNormalizedRating adds i to the "normalized_rating" field.

func (*RatingUpdateOne) Exec

func (ruo *RatingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RatingUpdateOne) ExecX

func (ruo *RatingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RatingUpdateOne) Mutation

func (ruo *RatingUpdateOne) Mutation() *RatingMutation

Mutation returns the RatingMutation object of the builder.

func (*RatingUpdateOne) Save

func (ruo *RatingUpdateOne) Save(ctx context.Context) (*Rating, error)

Save executes the query and returns the updated Rating entity.

func (*RatingUpdateOne) SaveX

func (ruo *RatingUpdateOne) SaveX(ctx context.Context) *Rating

SaveX is like Save, but panics if an error occurs.

func (*RatingUpdateOne) Select

func (ruo *RatingUpdateOne) Select(field string, fields ...string) *RatingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RatingUpdateOne) SetNormalizedRating

func (ruo *RatingUpdateOne) SetNormalizedRating(i int) *RatingUpdateOne

SetNormalizedRating sets the "normalized_rating" field.

func (*RatingUpdateOne) SetOrigin

func (ruo *RatingUpdateOne) SetOrigin(s string) *RatingUpdateOne

SetOrigin sets the "origin" field.

func (*RatingUpdateOne) SetOriginalRating

func (ruo *RatingUpdateOne) SetOriginalRating(s string) *RatingUpdateOne

SetOriginalRating sets the "original_rating" field.

type Ratings

type Ratings []*Rating

Ratings is a parsable slice of Rating.

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 Tx

type Tx struct {

	// Artist is the client for interacting with the Artist builders.
	Artist *ArtistClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Movie is the client for interacting with the Movie builders.
	Movie *MovieClient
	// MovieGenre is the client for interacting with the MovieGenre builders.
	MovieGenre *MovieGenreClient
	// Picture is the client for interacting with the Picture builders.
	Picture *PictureClient
	// Rating is the client for interacting with the Rating builders.
	Rating *RatingClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis
Code generated by ogen, DO NOT EDIT.
Code generated by ogen, DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL