oracle

package module
v0.0.0-...-b44d1c1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

README

oracle

Oracle is an ent schema for storing Magic: The Gathering cards, sets, artists, printings, and more.

It is provided as a separate package because I believe many projects would benefit from having an easy-to-use store for cards.

Installation

Before using oracle, you will need to install a driver for ent. The official documentation is the ent documentation.

SQLite

To use SQLite, you will need to install github.com/mattn/go-sqlite3.

An example that connects to an SQLite database:

package main

import (
  "github.com/red-deck-wins/oracle"
  _ "github.com/mattn/go-sqlite3"
)

func main() {
  client, err := oracle.NewClient("sqlite3", "file:oracle.db?cache=shared&_fk=1")
  if err != nil {
    panic(err)
  }
  defer client.Close()

  // create all of the tables/columns if they don't exist
  if err := client.Schema.Create(context.Background()); err != nil {
    panic(err)
  }
}
PostgreSQL

To use PostgreSQL, you will need to install github.com/lib/pq.

An example that connects to a PostgreSQL database:

package main

import (
  "github.com/red-deck-wins/oracle"
  _ "github.com/lib/pq"
)

func main() {
  client, err := oracle.NewClient("postgres", "user=postgres password=postgres dbname=oracle")
  if err != nil {
    panic(err)
  }
  defer client.Close()

  // create all of the tables/columns if they don't exist
  if err := client.Schema.Create(context.Background()); err != nil {
    panic(err)
  }
}
MySQL

To use MySQL, you will need to install github.com/go-sql-driver/mysql.

An example that connects to a MySQL database:

package main

import (
  "github.com/red-deck-wins/oracle"
  _ "github.com/go-sql-driver/mysql"
)

func main() {
  client, err := oracle.NewClient("mysql", "user:password@tcp(localhost:3306)/oracle")
  if err != nil {
    panic(err)
  }
  defer client.Close()

  // create all of the tables/columns if they don't exist
  if err := client.Schema.Create(context.Background()); err != nil {
    panic(err)
  }
}

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"
	TypeCard          = "Card"
	TypeCardFace      = "CardFace"
	TypePrinting      = "Printing"
	TypePrintingImage = "PrintingImage"
	TypeRuling        = "Ruling"
	TypeSet           = "Set"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(oracle.As(oracle.Sum(field1), "sum_field1"), (oracle.As(oracle.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"`
	// 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) QueryPrintings

func (a *Artist) QueryPrintings() *PrintingQuery

QueryPrintings queries the "printings" 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.

func (*Artist) Value

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

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

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 builder for creating a Artist entity.

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 builder for deleting the given entity.

func (*ArtistClient) DeleteOneID

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

DeleteOneID returns a builder for deleting the given entity by its 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) Intercept

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

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

func (*ArtistClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ArtistClient) MapCreateBulk

func (c *ArtistClient) MapCreateBulk(slice any, setFunc func(*ArtistCreate, int)) *ArtistCreateBulk

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

func (*ArtistClient) Query

func (c *ArtistClient) Query() *ArtistQuery

Query returns a query builder for Artist.

func (*ArtistClient) QueryPrintings

func (c *ArtistClient) QueryPrintings(a *Artist) *PrintingQuery

QueryPrintings queries the printings 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) AddPrintingIDs

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

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*ArtistCreate) AddPrintings

func (ac *ArtistCreate) AddPrintings(p ...*Printing) *ArtistCreate

AddPrintings adds the "printings" edges to the Printing entity.

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) SetName

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

SetName sets the "name" field.

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.

func (*ArtistDeleteOne) Where

func (ado *ArtistDeleteOne) Where(ps ...predicate.Artist) *ArtistDeleteOne

Where appends a list predicates to the ArtistDelete builder.

type ArtistEdges

type ArtistEdges struct {
	// Printings holds the value of the printings edge.
	Printings []*Printing `json:"printings,omitempty"`
	// contains filtered or unexported fields
}

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

func (ArtistEdges) PrintingsOrErr

func (e ArtistEdges) PrintingsOrErr() ([]*Printing, error)

PrintingsOrErr returns the Printings 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 any) error

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

func (*ArtistGroupBy) ScanX

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

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) 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) AddPrintingIDs

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

AddPrintingIDs adds the "printings" edge to the Printing 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) 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) ClearPrintings

func (m *ArtistMutation) ClearPrintings()

ClearPrintings clears the "printings" edge to the Printing 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) 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) 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) PrintingsCleared

func (m *ArtistMutation) PrintingsCleared() bool

PrintingsCleared reports if the "printings" edge to the Printing entity was cleared.

func (*ArtistMutation) PrintingsIDs

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

PrintingsIDs returns the "printings" edge IDs in the mutation.

func (*ArtistMutation) RemovePrintingIDs

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

RemovePrintingIDs removes the "printings" edge to the Printing entity by IDs.

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) RemovedPrintingsIDs

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

RemovedPrintings returns the removed IDs of the "printings" edge to the Printing entity.

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) ResetPrintings

func (m *ArtistMutation) ResetPrintings()

ResetPrintings resets all changes to the "printings" edge.

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) SetOp

func (m *ArtistMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

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) WhereP

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

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

type ArtistQuery

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

ArtistQuery is the builder for querying Artist entities.

func (*ArtistQuery) Aggregate

func (aq *ArtistQuery) Aggregate(fns ...AggregateFunc) *ArtistSelect

Aggregate returns a ArtistSelect configured with the given aggregations.

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(oracle.Count()).
	Scan(ctx, &v)

func (*ArtistQuery) IDs

func (aq *ArtistQuery) IDs(ctx context.Context) (ids []int, err 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 the number of records to be returned by this query.

func (*ArtistQuery) Offset

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

Offset to start from.

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 ...artist.OrderOption) *ArtistQuery

Order specifies how the records should be ordered.

func (*ArtistQuery) QueryPrintings

func (aq *ArtistQuery) QueryPrintings() *PrintingQuery

QueryPrintings chains the current query on the "printings" 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) WithPrintings

func (aq *ArtistQuery) WithPrintings(opts ...func(*PrintingQuery)) *ArtistQuery

WithPrintings tells the query-builder to eager-load the nodes that are connected to the "printings" 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) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

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 any) 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 any)

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) AddPrintingIDs

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

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*ArtistUpdate) AddPrintings

func (au *ArtistUpdate) AddPrintings(p ...*Printing) *ArtistUpdate

AddPrintings adds the "printings" edges to the Printing entity.

func (*ArtistUpdate) ClearPrintings

func (au *ArtistUpdate) ClearPrintings() *ArtistUpdate

ClearPrintings clears all "printings" edges to the Printing 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) RemovePrintingIDs

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

RemovePrintingIDs removes the "printings" edge to Printing entities by IDs.

func (*ArtistUpdate) RemovePrintings

func (au *ArtistUpdate) RemovePrintings(p ...*Printing) *ArtistUpdate

RemovePrintings removes "printings" edges to Printing entities.

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) SetName

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

SetName sets the "name" field.

func (*ArtistUpdate) SetNillableName

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

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

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) AddPrintingIDs

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

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*ArtistUpdateOne) AddPrintings

func (auo *ArtistUpdateOne) AddPrintings(p ...*Printing) *ArtistUpdateOne

AddPrintings adds the "printings" edges to the Printing entity.

func (*ArtistUpdateOne) ClearPrintings

func (auo *ArtistUpdateOne) ClearPrintings() *ArtistUpdateOne

ClearPrintings clears all "printings" edges to the Printing 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) RemovePrintingIDs

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

RemovePrintingIDs removes the "printings" edge to Printing entities by IDs.

func (*ArtistUpdateOne) RemovePrintings

func (auo *ArtistUpdateOne) RemovePrintings(p ...*Printing) *ArtistUpdateOne

RemovePrintings removes "printings" edges to Printing entities.

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) SetName

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

SetName sets the "name" field.

func (*ArtistUpdateOne) SetNillableName

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

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

func (*ArtistUpdateOne) Where

func (auo *ArtistUpdateOne) Where(ps ...predicate.Artist) *ArtistUpdateOne

Where appends a list predicates to the ArtistUpdate builder.

type Artists

type Artists []*Artist

Artists is a parsable slice of Artist.

type Card

type Card struct {

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

Card is the model entity for the Card schema.

func (*Card) QueryFaces

func (c *Card) QueryFaces() *CardFaceQuery

QueryFaces queries the "faces" edge of the Card entity.

func (*Card) QueryRulings

func (c *Card) QueryRulings() *RulingQuery

QueryRulings queries the "rulings" edge of the Card entity.

func (*Card) String

func (c *Card) String() string

String implements the fmt.Stringer.

func (*Card) Unwrap

func (c *Card) Unwrap() *Card

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

func (c *Card) Update() *CardUpdateOne

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

func (*Card) Value

func (c *Card) Value(name string) (ent.Value, error)

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

type CardClient

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

CardClient is a client for the Card schema.

func NewCardClient

func NewCardClient(c config) *CardClient

NewCardClient returns a client for the Card from the given config.

func (*CardClient) Create

func (c *CardClient) Create() *CardCreate

Create returns a builder for creating a Card entity.

func (*CardClient) CreateBulk

func (c *CardClient) CreateBulk(builders ...*CardCreate) *CardCreateBulk

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

func (*CardClient) Delete

func (c *CardClient) Delete() *CardDelete

Delete returns a delete builder for Card.

func (*CardClient) DeleteOne

func (c *CardClient) DeleteOne(ca *Card) *CardDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CardClient) DeleteOneID

func (c *CardClient) DeleteOneID(id int) *CardDeleteOne

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

func (*CardClient) Get

func (c *CardClient) Get(ctx context.Context, id int) (*Card, error)

Get returns a Card entity by its id.

func (*CardClient) GetX

func (c *CardClient) GetX(ctx context.Context, id int) *Card

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

func (*CardClient) Hooks

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

Hooks returns the client hooks.

func (*CardClient) Intercept

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

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

func (*CardClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CardClient) MapCreateBulk

func (c *CardClient) MapCreateBulk(slice any, setFunc func(*CardCreate, int)) *CardCreateBulk

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

func (*CardClient) Query

func (c *CardClient) Query() *CardQuery

Query returns a query builder for Card.

func (*CardClient) QueryFaces

func (c *CardClient) QueryFaces(ca *Card) *CardFaceQuery

QueryFaces queries the faces edge of a Card.

func (*CardClient) QueryRulings

func (c *CardClient) QueryRulings(ca *Card) *RulingQuery

QueryRulings queries the rulings edge of a Card.

func (*CardClient) Update

func (c *CardClient) Update() *CardUpdate

Update returns an update builder for Card.

func (*CardClient) UpdateOne

func (c *CardClient) UpdateOne(ca *Card) *CardUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CardClient) UpdateOneID

func (c *CardClient) UpdateOneID(id int) *CardUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CardClient) Use

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

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

type CardCreate

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

CardCreate is the builder for creating a Card entity.

func (*CardCreate) AddFaceIDs

func (cc *CardCreate) AddFaceIDs(ids ...int) *CardCreate

AddFaceIDs adds the "faces" edge to the CardFace entity by IDs.

func (*CardCreate) AddFaces

func (cc *CardCreate) AddFaces(c ...*CardFace) *CardCreate

AddFaces adds the "faces" edges to the CardFace entity.

func (*CardCreate) AddRulingIDs

func (cc *CardCreate) AddRulingIDs(ids ...int) *CardCreate

AddRulingIDs adds the "rulings" edge to the Ruling entity by IDs.

func (*CardCreate) AddRulings

func (cc *CardCreate) AddRulings(r ...*Ruling) *CardCreate

AddRulings adds the "rulings" edges to the Ruling entity.

func (*CardCreate) Exec

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

Exec executes the query.

func (*CardCreate) ExecX

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

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

func (*CardCreate) Mutation

func (cc *CardCreate) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardCreate) Save

func (cc *CardCreate) Save(ctx context.Context) (*Card, error)

Save creates the Card in the database.

func (*CardCreate) SaveX

func (cc *CardCreate) SaveX(ctx context.Context) *Card

SaveX calls Save and panics if Save returns an error.

func (*CardCreate) SetColorIdentity

func (cc *CardCreate) SetColorIdentity(u uint8) *CardCreate

SetColorIdentity sets the "color_identity" field.

func (*CardCreate) SetName

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

SetName sets the "name" field.

func (*CardCreate) SetOracleID

func (cc *CardCreate) SetOracleID(s string) *CardCreate

SetOracleID sets the "oracle_id" field.

type CardCreateBulk

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

CardCreateBulk is the builder for creating many Card entities in bulk.

func (*CardCreateBulk) Exec

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

Exec executes the query.

func (*CardCreateBulk) ExecX

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

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

func (*CardCreateBulk) Save

func (ccb *CardCreateBulk) Save(ctx context.Context) ([]*Card, error)

Save creates the Card entities in the database.

func (*CardCreateBulk) SaveX

func (ccb *CardCreateBulk) SaveX(ctx context.Context) []*Card

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

type CardDelete

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

CardDelete is the builder for deleting a Card entity.

func (*CardDelete) Exec

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

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

func (*CardDelete) ExecX

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

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

func (*CardDelete) Where

func (cd *CardDelete) Where(ps ...predicate.Card) *CardDelete

Where appends a list predicates to the CardDelete builder.

type CardDeleteOne

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

CardDeleteOne is the builder for deleting a single Card entity.

func (*CardDeleteOne) Exec

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

Exec executes the deletion query.

func (*CardDeleteOne) ExecX

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

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

func (*CardDeleteOne) Where

func (cdo *CardDeleteOne) Where(ps ...predicate.Card) *CardDeleteOne

Where appends a list predicates to the CardDelete builder.

type CardEdges

type CardEdges struct {
	// Faces holds the value of the faces edge.
	Faces []*CardFace `json:"faces,omitempty"`
	// Rulings holds the value of the rulings edge.
	Rulings []*Ruling `json:"rulings,omitempty"`
	// contains filtered or unexported fields
}

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

func (CardEdges) FacesOrErr

func (e CardEdges) FacesOrErr() ([]*CardFace, error)

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

func (CardEdges) RulingsOrErr

func (e CardEdges) RulingsOrErr() ([]*Ruling, error)

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

type CardFace

type CardFace struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// FlavorText holds the value of the "flavor_text" field.
	FlavorText string `json:"flavor_text,omitempty"`
	// OracleText holds the value of the "oracle_text" field.
	OracleText string `json:"oracle_text,omitempty"`
	// Language holds the value of the "language" field.
	Language string `json:"language,omitempty"`
	// Cmc holds the value of the "cmc" field.
	Cmc float32 `json:"cmc,omitempty"`
	// Power holds the value of the "power" field.
	Power string `json:"power,omitempty"`
	// Toughness holds the value of the "toughness" field.
	Toughness string `json:"toughness,omitempty"`
	// Loyalty holds the value of the "loyalty" field.
	Loyalty string `json:"loyalty,omitempty"`
	// ManaCost holds the value of the "mana_cost" field.
	ManaCost string `json:"mana_cost,omitempty"`
	// TypeLine holds the value of the "type_line" field.
	TypeLine string `json:"type_line,omitempty"`
	// Colors holds the value of the "colors" field.
	Colors string `json:"colors,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CardFaceQuery when eager-loading is set.
	Edges CardFaceEdges `json:"edges"`
	// contains filtered or unexported fields
}

CardFace is the model entity for the CardFace schema.

func (*CardFace) QueryCard

func (cf *CardFace) QueryCard() *CardQuery

QueryCard queries the "card" edge of the CardFace entity.

func (*CardFace) QueryPrintings

func (cf *CardFace) QueryPrintings() *PrintingQuery

QueryPrintings queries the "printings" edge of the CardFace entity.

func (*CardFace) String

func (cf *CardFace) String() string

String implements the fmt.Stringer.

func (*CardFace) Unwrap

func (cf *CardFace) Unwrap() *CardFace

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

func (cf *CardFace) Update() *CardFaceUpdateOne

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

func (*CardFace) Value

func (cf *CardFace) Value(name string) (ent.Value, error)

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

type CardFaceClient

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

CardFaceClient is a client for the CardFace schema.

func NewCardFaceClient

func NewCardFaceClient(c config) *CardFaceClient

NewCardFaceClient returns a client for the CardFace from the given config.

func (*CardFaceClient) Create

func (c *CardFaceClient) Create() *CardFaceCreate

Create returns a builder for creating a CardFace entity.

func (*CardFaceClient) CreateBulk

func (c *CardFaceClient) CreateBulk(builders ...*CardFaceCreate) *CardFaceCreateBulk

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

func (*CardFaceClient) Delete

func (c *CardFaceClient) Delete() *CardFaceDelete

Delete returns a delete builder for CardFace.

func (*CardFaceClient) DeleteOne

func (c *CardFaceClient) DeleteOne(cf *CardFace) *CardFaceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CardFaceClient) DeleteOneID

func (c *CardFaceClient) DeleteOneID(id int) *CardFaceDeleteOne

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

func (*CardFaceClient) Get

func (c *CardFaceClient) Get(ctx context.Context, id int) (*CardFace, error)

Get returns a CardFace entity by its id.

func (*CardFaceClient) GetX

func (c *CardFaceClient) GetX(ctx context.Context, id int) *CardFace

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

func (*CardFaceClient) Hooks

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

Hooks returns the client hooks.

func (*CardFaceClient) Intercept

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

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

func (*CardFaceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CardFaceClient) MapCreateBulk

func (c *CardFaceClient) MapCreateBulk(slice any, setFunc func(*CardFaceCreate, int)) *CardFaceCreateBulk

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

func (*CardFaceClient) Query

func (c *CardFaceClient) Query() *CardFaceQuery

Query returns a query builder for CardFace.

func (*CardFaceClient) QueryCard

func (c *CardFaceClient) QueryCard(cf *CardFace) *CardQuery

QueryCard queries the card edge of a CardFace.

func (*CardFaceClient) QueryPrintings

func (c *CardFaceClient) QueryPrintings(cf *CardFace) *PrintingQuery

QueryPrintings queries the printings edge of a CardFace.

func (*CardFaceClient) Update

func (c *CardFaceClient) Update() *CardFaceUpdate

Update returns an update builder for CardFace.

func (*CardFaceClient) UpdateOne

func (c *CardFaceClient) UpdateOne(cf *CardFace) *CardFaceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CardFaceClient) UpdateOneID

func (c *CardFaceClient) UpdateOneID(id int) *CardFaceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CardFaceClient) Use

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

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

type CardFaceCreate

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

CardFaceCreate is the builder for creating a CardFace entity.

func (*CardFaceCreate) AddPrintingIDs

func (cfc *CardFaceCreate) AddPrintingIDs(ids ...int) *CardFaceCreate

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*CardFaceCreate) AddPrintings

func (cfc *CardFaceCreate) AddPrintings(p ...*Printing) *CardFaceCreate

AddPrintings adds the "printings" edges to the Printing entity.

func (*CardFaceCreate) Exec

func (cfc *CardFaceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CardFaceCreate) ExecX

func (cfc *CardFaceCreate) ExecX(ctx context.Context)

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

func (*CardFaceCreate) Mutation

func (cfc *CardFaceCreate) Mutation() *CardFaceMutation

Mutation returns the CardFaceMutation object of the builder.

func (*CardFaceCreate) Save

func (cfc *CardFaceCreate) Save(ctx context.Context) (*CardFace, error)

Save creates the CardFace in the database.

func (*CardFaceCreate) SaveX

func (cfc *CardFaceCreate) SaveX(ctx context.Context) *CardFace

SaveX calls Save and panics if Save returns an error.

func (*CardFaceCreate) SetCard

func (cfc *CardFaceCreate) SetCard(c *Card) *CardFaceCreate

SetCard sets the "card" edge to the Card entity.

func (*CardFaceCreate) SetCardID

func (cfc *CardFaceCreate) SetCardID(id int) *CardFaceCreate

SetCardID sets the "card" edge to the Card entity by ID.

func (*CardFaceCreate) SetCmc

func (cfc *CardFaceCreate) SetCmc(f float32) *CardFaceCreate

SetCmc sets the "cmc" field.

func (*CardFaceCreate) SetColors

func (cfc *CardFaceCreate) SetColors(s string) *CardFaceCreate

SetColors sets the "colors" field.

func (*CardFaceCreate) SetFlavorText

func (cfc *CardFaceCreate) SetFlavorText(s string) *CardFaceCreate

SetFlavorText sets the "flavor_text" field.

func (*CardFaceCreate) SetLanguage

func (cfc *CardFaceCreate) SetLanguage(s string) *CardFaceCreate

SetLanguage sets the "language" field.

func (*CardFaceCreate) SetLoyalty

func (cfc *CardFaceCreate) SetLoyalty(s string) *CardFaceCreate

SetLoyalty sets the "loyalty" field.

func (*CardFaceCreate) SetManaCost

func (cfc *CardFaceCreate) SetManaCost(s string) *CardFaceCreate

SetManaCost sets the "mana_cost" field.

func (*CardFaceCreate) SetName

func (cfc *CardFaceCreate) SetName(s string) *CardFaceCreate

SetName sets the "name" field.

func (*CardFaceCreate) SetNillableCardID

func (cfc *CardFaceCreate) SetNillableCardID(id *int) *CardFaceCreate

SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.

func (*CardFaceCreate) SetOracleText

func (cfc *CardFaceCreate) SetOracleText(s string) *CardFaceCreate

SetOracleText sets the "oracle_text" field.

func (*CardFaceCreate) SetPower

func (cfc *CardFaceCreate) SetPower(s string) *CardFaceCreate

SetPower sets the "power" field.

func (*CardFaceCreate) SetToughness

func (cfc *CardFaceCreate) SetToughness(s string) *CardFaceCreate

SetToughness sets the "toughness" field.

func (*CardFaceCreate) SetTypeLine

func (cfc *CardFaceCreate) SetTypeLine(s string) *CardFaceCreate

SetTypeLine sets the "type_line" field.

type CardFaceCreateBulk

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

CardFaceCreateBulk is the builder for creating many CardFace entities in bulk.

func (*CardFaceCreateBulk) Exec

func (cfcb *CardFaceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CardFaceCreateBulk) ExecX

func (cfcb *CardFaceCreateBulk) ExecX(ctx context.Context)

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

func (*CardFaceCreateBulk) Save

func (cfcb *CardFaceCreateBulk) Save(ctx context.Context) ([]*CardFace, error)

Save creates the CardFace entities in the database.

func (*CardFaceCreateBulk) SaveX

func (cfcb *CardFaceCreateBulk) SaveX(ctx context.Context) []*CardFace

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

type CardFaceDelete

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

CardFaceDelete is the builder for deleting a CardFace entity.

func (*CardFaceDelete) Exec

func (cfd *CardFaceDelete) Exec(ctx context.Context) (int, error)

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

func (*CardFaceDelete) ExecX

func (cfd *CardFaceDelete) ExecX(ctx context.Context) int

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

func (*CardFaceDelete) Where

func (cfd *CardFaceDelete) Where(ps ...predicate.CardFace) *CardFaceDelete

Where appends a list predicates to the CardFaceDelete builder.

type CardFaceDeleteOne

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

CardFaceDeleteOne is the builder for deleting a single CardFace entity.

func (*CardFaceDeleteOne) Exec

func (cfdo *CardFaceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CardFaceDeleteOne) ExecX

func (cfdo *CardFaceDeleteOne) ExecX(ctx context.Context)

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

func (*CardFaceDeleteOne) Where

Where appends a list predicates to the CardFaceDelete builder.

type CardFaceEdges

type CardFaceEdges struct {
	// Card holds the value of the card edge.
	Card *Card `json:"card,omitempty"`
	// Printings holds the value of the printings edge.
	Printings []*Printing `json:"printings,omitempty"`
	// contains filtered or unexported fields
}

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

func (CardFaceEdges) CardOrErr

func (e CardFaceEdges) CardOrErr() (*Card, error)

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

func (CardFaceEdges) PrintingsOrErr

func (e CardFaceEdges) PrintingsOrErr() ([]*Printing, error)

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

type CardFaceGroupBy

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

CardFaceGroupBy is the group-by builder for CardFace entities.

func (*CardFaceGroupBy) Aggregate

func (cfgb *CardFaceGroupBy) Aggregate(fns ...AggregateFunc) *CardFaceGroupBy

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

func (*CardFaceGroupBy) Bool

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

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

func (*CardFaceGroupBy) BoolX

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

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

func (*CardFaceGroupBy) Bools

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

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

func (*CardFaceGroupBy) BoolsX

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

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

func (*CardFaceGroupBy) Float64

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

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

func (*CardFaceGroupBy) Float64X

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

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

func (*CardFaceGroupBy) Float64s

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

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

func (*CardFaceGroupBy) Float64sX

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

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

func (*CardFaceGroupBy) Int

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

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

func (*CardFaceGroupBy) IntX

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

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

func (*CardFaceGroupBy) Ints

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

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

func (*CardFaceGroupBy) IntsX

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

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

func (*CardFaceGroupBy) Scan

func (cfgb *CardFaceGroupBy) Scan(ctx context.Context, v any) error

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

func (*CardFaceGroupBy) ScanX

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

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

func (*CardFaceGroupBy) String

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

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

func (*CardFaceGroupBy) StringX

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

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

func (*CardFaceGroupBy) Strings

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

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

func (*CardFaceGroupBy) StringsX

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

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

type CardFaceMutation

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

CardFaceMutation represents an operation that mutates the CardFace nodes in the graph.

func (*CardFaceMutation) AddCmc

func (m *CardFaceMutation) AddCmc(f float32)

AddCmc adds f to the "cmc" field.

func (*CardFaceMutation) AddField

func (m *CardFaceMutation) 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 (*CardFaceMutation) AddPrintingIDs

func (m *CardFaceMutation) AddPrintingIDs(ids ...int)

AddPrintingIDs adds the "printings" edge to the Printing entity by ids.

func (*CardFaceMutation) AddedCmc

func (m *CardFaceMutation) AddedCmc() (r float32, exists bool)

AddedCmc returns the value that was added to the "cmc" field in this mutation.

func (*CardFaceMutation) AddedEdges

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

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

func (*CardFaceMutation) AddedField

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

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

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

func (*CardFaceMutation) AddedIDs

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

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

func (*CardFaceMutation) CardCleared

func (m *CardFaceMutation) CardCleared() bool

CardCleared reports if the "card" edge to the Card entity was cleared.

func (*CardFaceMutation) CardID

func (m *CardFaceMutation) CardID() (id int, exists bool)

CardID returns the "card" edge ID in the mutation.

func (*CardFaceMutation) CardIDs

func (m *CardFaceMutation) CardIDs() (ids []int)

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

func (*CardFaceMutation) ClearCard

func (m *CardFaceMutation) ClearCard()

ClearCard clears the "card" edge to the Card entity.

func (*CardFaceMutation) ClearEdge

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

func (m *CardFaceMutation) 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 (*CardFaceMutation) ClearPrintings

func (m *CardFaceMutation) ClearPrintings()

ClearPrintings clears the "printings" edge to the Printing entity.

func (*CardFaceMutation) ClearedEdges

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

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

func (*CardFaceMutation) ClearedFields

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

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

func (CardFaceMutation) Client

func (m CardFaceMutation) 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 (*CardFaceMutation) Cmc

func (m *CardFaceMutation) Cmc() (r float32, exists bool)

Cmc returns the value of the "cmc" field in the mutation.

func (*CardFaceMutation) Colors

func (m *CardFaceMutation) Colors() (r string, exists bool)

Colors returns the value of the "colors" field in the mutation.

func (*CardFaceMutation) EdgeCleared

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

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

func (*CardFaceMutation) Field

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

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

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

func (*CardFaceMutation) Fields

func (m *CardFaceMutation) 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 (*CardFaceMutation) FlavorText

func (m *CardFaceMutation) FlavorText() (r string, exists bool)

FlavorText returns the value of the "flavor_text" field in the mutation.

func (*CardFaceMutation) ID

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

func (m *CardFaceMutation) 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 (*CardFaceMutation) Language

func (m *CardFaceMutation) Language() (r string, exists bool)

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

func (*CardFaceMutation) Loyalty

func (m *CardFaceMutation) Loyalty() (r string, exists bool)

Loyalty returns the value of the "loyalty" field in the mutation.

func (*CardFaceMutation) ManaCost

func (m *CardFaceMutation) ManaCost() (r string, exists bool)

ManaCost returns the value of the "mana_cost" field in the mutation.

func (*CardFaceMutation) Name

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

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

func (*CardFaceMutation) OldCmc

func (m *CardFaceMutation) OldCmc(ctx context.Context) (v float32, err error)

OldCmc returns the old "cmc" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldColors

func (m *CardFaceMutation) OldColors(ctx context.Context) (v string, err error)

OldColors returns the old "colors" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldField

func (m *CardFaceMutation) 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 (*CardFaceMutation) OldFlavorText

func (m *CardFaceMutation) OldFlavorText(ctx context.Context) (v string, err error)

OldFlavorText returns the old "flavor_text" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldLanguage

func (m *CardFaceMutation) OldLanguage(ctx context.Context) (v string, err error)

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

func (m *CardFaceMutation) OldLoyalty(ctx context.Context) (v string, err error)

OldLoyalty returns the old "loyalty" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldManaCost

func (m *CardFaceMutation) OldManaCost(ctx context.Context) (v string, err error)

OldManaCost returns the old "mana_cost" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldName

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

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

func (m *CardFaceMutation) OldOracleText(ctx context.Context) (v string, err error)

OldOracleText returns the old "oracle_text" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldPower

func (m *CardFaceMutation) OldPower(ctx context.Context) (v string, err error)

OldPower returns the old "power" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldToughness

func (m *CardFaceMutation) OldToughness(ctx context.Context) (v string, err error)

OldToughness returns the old "toughness" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) OldTypeLine

func (m *CardFaceMutation) OldTypeLine(ctx context.Context) (v string, err error)

OldTypeLine returns the old "type_line" field's value of the CardFace entity. If the CardFace 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 (*CardFaceMutation) Op

func (m *CardFaceMutation) Op() Op

Op returns the operation name.

func (*CardFaceMutation) OracleText

func (m *CardFaceMutation) OracleText() (r string, exists bool)

OracleText returns the value of the "oracle_text" field in the mutation.

func (*CardFaceMutation) Power

func (m *CardFaceMutation) Power() (r string, exists bool)

Power returns the value of the "power" field in the mutation.

func (*CardFaceMutation) PrintingsCleared

func (m *CardFaceMutation) PrintingsCleared() bool

PrintingsCleared reports if the "printings" edge to the Printing entity was cleared.

func (*CardFaceMutation) PrintingsIDs

func (m *CardFaceMutation) PrintingsIDs() (ids []int)

PrintingsIDs returns the "printings" edge IDs in the mutation.

func (*CardFaceMutation) RemovePrintingIDs

func (m *CardFaceMutation) RemovePrintingIDs(ids ...int)

RemovePrintingIDs removes the "printings" edge to the Printing entity by IDs.

func (*CardFaceMutation) RemovedEdges

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

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

func (*CardFaceMutation) RemovedIDs

func (m *CardFaceMutation) 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 (*CardFaceMutation) RemovedPrintingsIDs

func (m *CardFaceMutation) RemovedPrintingsIDs() (ids []int)

RemovedPrintings returns the removed IDs of the "printings" edge to the Printing entity.

func (*CardFaceMutation) ResetCard

func (m *CardFaceMutation) ResetCard()

ResetCard resets all changes to the "card" edge.

func (*CardFaceMutation) ResetCmc

func (m *CardFaceMutation) ResetCmc()

ResetCmc resets all changes to the "cmc" field.

func (*CardFaceMutation) ResetColors

func (m *CardFaceMutation) ResetColors()

ResetColors resets all changes to the "colors" field.

func (*CardFaceMutation) ResetEdge

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

func (m *CardFaceMutation) 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 (*CardFaceMutation) ResetFlavorText

func (m *CardFaceMutation) ResetFlavorText()

ResetFlavorText resets all changes to the "flavor_text" field.

func (*CardFaceMutation) ResetLanguage

func (m *CardFaceMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*CardFaceMutation) ResetLoyalty

func (m *CardFaceMutation) ResetLoyalty()

ResetLoyalty resets all changes to the "loyalty" field.

func (*CardFaceMutation) ResetManaCost

func (m *CardFaceMutation) ResetManaCost()

ResetManaCost resets all changes to the "mana_cost" field.

func (*CardFaceMutation) ResetName

func (m *CardFaceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CardFaceMutation) ResetOracleText

func (m *CardFaceMutation) ResetOracleText()

ResetOracleText resets all changes to the "oracle_text" field.

func (*CardFaceMutation) ResetPower

func (m *CardFaceMutation) ResetPower()

ResetPower resets all changes to the "power" field.

func (*CardFaceMutation) ResetPrintings

func (m *CardFaceMutation) ResetPrintings()

ResetPrintings resets all changes to the "printings" edge.

func (*CardFaceMutation) ResetToughness

func (m *CardFaceMutation) ResetToughness()

ResetToughness resets all changes to the "toughness" field.

func (*CardFaceMutation) ResetTypeLine

func (m *CardFaceMutation) ResetTypeLine()

ResetTypeLine resets all changes to the "type_line" field.

func (*CardFaceMutation) SetCardID

func (m *CardFaceMutation) SetCardID(id int)

SetCardID sets the "card" edge to the Card entity by id.

func (*CardFaceMutation) SetCmc

func (m *CardFaceMutation) SetCmc(f float32)

SetCmc sets the "cmc" field.

func (*CardFaceMutation) SetColors

func (m *CardFaceMutation) SetColors(s string)

SetColors sets the "colors" field.

func (*CardFaceMutation) SetField

func (m *CardFaceMutation) 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 (*CardFaceMutation) SetFlavorText

func (m *CardFaceMutation) SetFlavorText(s string)

SetFlavorText sets the "flavor_text" field.

func (*CardFaceMutation) SetLanguage

func (m *CardFaceMutation) SetLanguage(s string)

SetLanguage sets the "language" field.

func (*CardFaceMutation) SetLoyalty

func (m *CardFaceMutation) SetLoyalty(s string)

SetLoyalty sets the "loyalty" field.

func (*CardFaceMutation) SetManaCost

func (m *CardFaceMutation) SetManaCost(s string)

SetManaCost sets the "mana_cost" field.

func (*CardFaceMutation) SetName

func (m *CardFaceMutation) SetName(s string)

SetName sets the "name" field.

func (*CardFaceMutation) SetOp

func (m *CardFaceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CardFaceMutation) SetOracleText

func (m *CardFaceMutation) SetOracleText(s string)

SetOracleText sets the "oracle_text" field.

func (*CardFaceMutation) SetPower

func (m *CardFaceMutation) SetPower(s string)

SetPower sets the "power" field.

func (*CardFaceMutation) SetToughness

func (m *CardFaceMutation) SetToughness(s string)

SetToughness sets the "toughness" field.

func (*CardFaceMutation) SetTypeLine

func (m *CardFaceMutation) SetTypeLine(s string)

SetTypeLine sets the "type_line" field.

func (*CardFaceMutation) Toughness

func (m *CardFaceMutation) Toughness() (r string, exists bool)

Toughness returns the value of the "toughness" field in the mutation.

func (CardFaceMutation) Tx

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

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

func (*CardFaceMutation) Type

func (m *CardFaceMutation) Type() string

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

func (*CardFaceMutation) TypeLine

func (m *CardFaceMutation) TypeLine() (r string, exists bool)

TypeLine returns the value of the "type_line" field in the mutation.

func (*CardFaceMutation) Where

func (m *CardFaceMutation) Where(ps ...predicate.CardFace)

Where appends a list predicates to the CardFaceMutation builder.

func (*CardFaceMutation) WhereP

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

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

type CardFaceQuery

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

CardFaceQuery is the builder for querying CardFace entities.

func (*CardFaceQuery) Aggregate

func (cfq *CardFaceQuery) Aggregate(fns ...AggregateFunc) *CardFaceSelect

Aggregate returns a CardFaceSelect configured with the given aggregations.

func (*CardFaceQuery) All

func (cfq *CardFaceQuery) All(ctx context.Context) ([]*CardFace, error)

All executes the query and returns a list of CardFaces.

func (*CardFaceQuery) AllX

func (cfq *CardFaceQuery) AllX(ctx context.Context) []*CardFace

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

func (*CardFaceQuery) Clone

func (cfq *CardFaceQuery) Clone() *CardFaceQuery

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

func (*CardFaceQuery) Count

func (cfq *CardFaceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CardFaceQuery) CountX

func (cfq *CardFaceQuery) CountX(ctx context.Context) int

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

func (*CardFaceQuery) Exist

func (cfq *CardFaceQuery) Exist(ctx context.Context) (bool, error)

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

func (*CardFaceQuery) ExistX

func (cfq *CardFaceQuery) ExistX(ctx context.Context) bool

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

func (*CardFaceQuery) First

func (cfq *CardFaceQuery) First(ctx context.Context) (*CardFace, error)

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

func (*CardFaceQuery) FirstID

func (cfq *CardFaceQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CardFaceQuery) FirstIDX

func (cfq *CardFaceQuery) FirstIDX(ctx context.Context) int

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

func (*CardFaceQuery) FirstX

func (cfq *CardFaceQuery) FirstX(ctx context.Context) *CardFace

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

func (*CardFaceQuery) GroupBy

func (cfq *CardFaceQuery) GroupBy(field string, fields ...string) *CardFaceGroupBy

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.CardFace.Query().
	GroupBy(cardface.FieldName).
	Aggregate(oracle.Count()).
	Scan(ctx, &v)

func (*CardFaceQuery) IDs

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

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

func (*CardFaceQuery) IDsX

func (cfq *CardFaceQuery) IDsX(ctx context.Context) []int

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

func (*CardFaceQuery) Limit

func (cfq *CardFaceQuery) Limit(limit int) *CardFaceQuery

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

func (*CardFaceQuery) Offset

func (cfq *CardFaceQuery) Offset(offset int) *CardFaceQuery

Offset to start from.

func (*CardFaceQuery) Only

func (cfq *CardFaceQuery) Only(ctx context.Context) (*CardFace, error)

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

func (*CardFaceQuery) OnlyID

func (cfq *CardFaceQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CardFaceQuery) OnlyIDX

func (cfq *CardFaceQuery) OnlyIDX(ctx context.Context) int

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

func (*CardFaceQuery) OnlyX

func (cfq *CardFaceQuery) OnlyX(ctx context.Context) *CardFace

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

func (*CardFaceQuery) Order

func (cfq *CardFaceQuery) Order(o ...cardface.OrderOption) *CardFaceQuery

Order specifies how the records should be ordered.

func (*CardFaceQuery) QueryCard

func (cfq *CardFaceQuery) QueryCard() *CardQuery

QueryCard chains the current query on the "card" edge.

func (*CardFaceQuery) QueryPrintings

func (cfq *CardFaceQuery) QueryPrintings() *PrintingQuery

QueryPrintings chains the current query on the "printings" edge.

func (*CardFaceQuery) Select

func (cfq *CardFaceQuery) Select(fields ...string) *CardFaceSelect

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

func (*CardFaceQuery) Unique

func (cfq *CardFaceQuery) Unique(unique bool) *CardFaceQuery

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

func (cfq *CardFaceQuery) Where(ps ...predicate.CardFace) *CardFaceQuery

Where adds a new predicate for the CardFaceQuery builder.

func (*CardFaceQuery) WithCard

func (cfq *CardFaceQuery) WithCard(opts ...func(*CardQuery)) *CardFaceQuery

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

func (*CardFaceQuery) WithPrintings

func (cfq *CardFaceQuery) WithPrintings(opts ...func(*PrintingQuery)) *CardFaceQuery

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

type CardFaceSelect

type CardFaceSelect struct {
	*CardFaceQuery
	// contains filtered or unexported fields
}

CardFaceSelect is the builder for selecting fields of CardFace entities.

func (*CardFaceSelect) Aggregate

func (cfs *CardFaceSelect) Aggregate(fns ...AggregateFunc) *CardFaceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CardFaceSelect) Bool

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

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

func (*CardFaceSelect) BoolX

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

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

func (*CardFaceSelect) Bools

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

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

func (*CardFaceSelect) BoolsX

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

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

func (*CardFaceSelect) Float64

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

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

func (*CardFaceSelect) Float64X

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

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

func (*CardFaceSelect) Float64s

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

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

func (*CardFaceSelect) Float64sX

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

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

func (*CardFaceSelect) Int

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

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

func (*CardFaceSelect) IntX

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

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

func (*CardFaceSelect) Ints

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

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

func (*CardFaceSelect) IntsX

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

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

func (*CardFaceSelect) Scan

func (cfs *CardFaceSelect) Scan(ctx context.Context, v any) error

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

func (*CardFaceSelect) ScanX

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

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

func (*CardFaceSelect) String

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

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

func (*CardFaceSelect) StringX

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

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

func (*CardFaceSelect) Strings

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

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

func (*CardFaceSelect) StringsX

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

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

type CardFaceUpdate

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

CardFaceUpdate is the builder for updating CardFace entities.

func (*CardFaceUpdate) AddCmc

func (cfu *CardFaceUpdate) AddCmc(f float32) *CardFaceUpdate

AddCmc adds f to the "cmc" field.

func (*CardFaceUpdate) AddPrintingIDs

func (cfu *CardFaceUpdate) AddPrintingIDs(ids ...int) *CardFaceUpdate

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*CardFaceUpdate) AddPrintings

func (cfu *CardFaceUpdate) AddPrintings(p ...*Printing) *CardFaceUpdate

AddPrintings adds the "printings" edges to the Printing entity.

func (*CardFaceUpdate) ClearCard

func (cfu *CardFaceUpdate) ClearCard() *CardFaceUpdate

ClearCard clears the "card" edge to the Card entity.

func (*CardFaceUpdate) ClearPrintings

func (cfu *CardFaceUpdate) ClearPrintings() *CardFaceUpdate

ClearPrintings clears all "printings" edges to the Printing entity.

func (*CardFaceUpdate) Exec

func (cfu *CardFaceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CardFaceUpdate) ExecX

func (cfu *CardFaceUpdate) ExecX(ctx context.Context)

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

func (*CardFaceUpdate) Mutation

func (cfu *CardFaceUpdate) Mutation() *CardFaceMutation

Mutation returns the CardFaceMutation object of the builder.

func (*CardFaceUpdate) RemovePrintingIDs

func (cfu *CardFaceUpdate) RemovePrintingIDs(ids ...int) *CardFaceUpdate

RemovePrintingIDs removes the "printings" edge to Printing entities by IDs.

func (*CardFaceUpdate) RemovePrintings

func (cfu *CardFaceUpdate) RemovePrintings(p ...*Printing) *CardFaceUpdate

RemovePrintings removes "printings" edges to Printing entities.

func (*CardFaceUpdate) Save

func (cfu *CardFaceUpdate) Save(ctx context.Context) (int, error)

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

func (*CardFaceUpdate) SaveX

func (cfu *CardFaceUpdate) SaveX(ctx context.Context) int

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

func (*CardFaceUpdate) SetCard

func (cfu *CardFaceUpdate) SetCard(c *Card) *CardFaceUpdate

SetCard sets the "card" edge to the Card entity.

func (*CardFaceUpdate) SetCardID

func (cfu *CardFaceUpdate) SetCardID(id int) *CardFaceUpdate

SetCardID sets the "card" edge to the Card entity by ID.

func (*CardFaceUpdate) SetCmc

func (cfu *CardFaceUpdate) SetCmc(f float32) *CardFaceUpdate

SetCmc sets the "cmc" field.

func (*CardFaceUpdate) SetColors

func (cfu *CardFaceUpdate) SetColors(s string) *CardFaceUpdate

SetColors sets the "colors" field.

func (*CardFaceUpdate) SetFlavorText

func (cfu *CardFaceUpdate) SetFlavorText(s string) *CardFaceUpdate

SetFlavorText sets the "flavor_text" field.

func (*CardFaceUpdate) SetLanguage

func (cfu *CardFaceUpdate) SetLanguage(s string) *CardFaceUpdate

SetLanguage sets the "language" field.

func (*CardFaceUpdate) SetLoyalty

func (cfu *CardFaceUpdate) SetLoyalty(s string) *CardFaceUpdate

SetLoyalty sets the "loyalty" field.

func (*CardFaceUpdate) SetManaCost

func (cfu *CardFaceUpdate) SetManaCost(s string) *CardFaceUpdate

SetManaCost sets the "mana_cost" field.

func (*CardFaceUpdate) SetName

func (cfu *CardFaceUpdate) SetName(s string) *CardFaceUpdate

SetName sets the "name" field.

func (*CardFaceUpdate) SetNillableCardID

func (cfu *CardFaceUpdate) SetNillableCardID(id *int) *CardFaceUpdate

SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.

func (*CardFaceUpdate) SetNillableCmc

func (cfu *CardFaceUpdate) SetNillableCmc(f *float32) *CardFaceUpdate

SetNillableCmc sets the "cmc" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableColors

func (cfu *CardFaceUpdate) SetNillableColors(s *string) *CardFaceUpdate

SetNillableColors sets the "colors" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableFlavorText

func (cfu *CardFaceUpdate) SetNillableFlavorText(s *string) *CardFaceUpdate

SetNillableFlavorText sets the "flavor_text" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableLanguage

func (cfu *CardFaceUpdate) SetNillableLanguage(s *string) *CardFaceUpdate

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

func (*CardFaceUpdate) SetNillableLoyalty

func (cfu *CardFaceUpdate) SetNillableLoyalty(s *string) *CardFaceUpdate

SetNillableLoyalty sets the "loyalty" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableManaCost

func (cfu *CardFaceUpdate) SetNillableManaCost(s *string) *CardFaceUpdate

SetNillableManaCost sets the "mana_cost" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableName

func (cfu *CardFaceUpdate) SetNillableName(s *string) *CardFaceUpdate

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

func (*CardFaceUpdate) SetNillableOracleText

func (cfu *CardFaceUpdate) SetNillableOracleText(s *string) *CardFaceUpdate

SetNillableOracleText sets the "oracle_text" field if the given value is not nil.

func (*CardFaceUpdate) SetNillablePower

func (cfu *CardFaceUpdate) SetNillablePower(s *string) *CardFaceUpdate

SetNillablePower sets the "power" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableToughness

func (cfu *CardFaceUpdate) SetNillableToughness(s *string) *CardFaceUpdate

SetNillableToughness sets the "toughness" field if the given value is not nil.

func (*CardFaceUpdate) SetNillableTypeLine

func (cfu *CardFaceUpdate) SetNillableTypeLine(s *string) *CardFaceUpdate

SetNillableTypeLine sets the "type_line" field if the given value is not nil.

func (*CardFaceUpdate) SetOracleText

func (cfu *CardFaceUpdate) SetOracleText(s string) *CardFaceUpdate

SetOracleText sets the "oracle_text" field.

func (*CardFaceUpdate) SetPower

func (cfu *CardFaceUpdate) SetPower(s string) *CardFaceUpdate

SetPower sets the "power" field.

func (*CardFaceUpdate) SetToughness

func (cfu *CardFaceUpdate) SetToughness(s string) *CardFaceUpdate

SetToughness sets the "toughness" field.

func (*CardFaceUpdate) SetTypeLine

func (cfu *CardFaceUpdate) SetTypeLine(s string) *CardFaceUpdate

SetTypeLine sets the "type_line" field.

func (*CardFaceUpdate) Where

func (cfu *CardFaceUpdate) Where(ps ...predicate.CardFace) *CardFaceUpdate

Where appends a list predicates to the CardFaceUpdate builder.

type CardFaceUpdateOne

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

CardFaceUpdateOne is the builder for updating a single CardFace entity.

func (*CardFaceUpdateOne) AddCmc

func (cfuo *CardFaceUpdateOne) AddCmc(f float32) *CardFaceUpdateOne

AddCmc adds f to the "cmc" field.

func (*CardFaceUpdateOne) AddPrintingIDs

func (cfuo *CardFaceUpdateOne) AddPrintingIDs(ids ...int) *CardFaceUpdateOne

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*CardFaceUpdateOne) AddPrintings

func (cfuo *CardFaceUpdateOne) AddPrintings(p ...*Printing) *CardFaceUpdateOne

AddPrintings adds the "printings" edges to the Printing entity.

func (*CardFaceUpdateOne) ClearCard

func (cfuo *CardFaceUpdateOne) ClearCard() *CardFaceUpdateOne

ClearCard clears the "card" edge to the Card entity.

func (*CardFaceUpdateOne) ClearPrintings

func (cfuo *CardFaceUpdateOne) ClearPrintings() *CardFaceUpdateOne

ClearPrintings clears all "printings" edges to the Printing entity.

func (*CardFaceUpdateOne) Exec

func (cfuo *CardFaceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CardFaceUpdateOne) ExecX

func (cfuo *CardFaceUpdateOne) ExecX(ctx context.Context)

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

func (*CardFaceUpdateOne) Mutation

func (cfuo *CardFaceUpdateOne) Mutation() *CardFaceMutation

Mutation returns the CardFaceMutation object of the builder.

func (*CardFaceUpdateOne) RemovePrintingIDs

func (cfuo *CardFaceUpdateOne) RemovePrintingIDs(ids ...int) *CardFaceUpdateOne

RemovePrintingIDs removes the "printings" edge to Printing entities by IDs.

func (*CardFaceUpdateOne) RemovePrintings

func (cfuo *CardFaceUpdateOne) RemovePrintings(p ...*Printing) *CardFaceUpdateOne

RemovePrintings removes "printings" edges to Printing entities.

func (*CardFaceUpdateOne) Save

func (cfuo *CardFaceUpdateOne) Save(ctx context.Context) (*CardFace, error)

Save executes the query and returns the updated CardFace entity.

func (*CardFaceUpdateOne) SaveX

func (cfuo *CardFaceUpdateOne) SaveX(ctx context.Context) *CardFace

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

func (*CardFaceUpdateOne) Select

func (cfuo *CardFaceUpdateOne) Select(field string, fields ...string) *CardFaceUpdateOne

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

func (*CardFaceUpdateOne) SetCard

func (cfuo *CardFaceUpdateOne) SetCard(c *Card) *CardFaceUpdateOne

SetCard sets the "card" edge to the Card entity.

func (*CardFaceUpdateOne) SetCardID

func (cfuo *CardFaceUpdateOne) SetCardID(id int) *CardFaceUpdateOne

SetCardID sets the "card" edge to the Card entity by ID.

func (*CardFaceUpdateOne) SetCmc

func (cfuo *CardFaceUpdateOne) SetCmc(f float32) *CardFaceUpdateOne

SetCmc sets the "cmc" field.

func (*CardFaceUpdateOne) SetColors

func (cfuo *CardFaceUpdateOne) SetColors(s string) *CardFaceUpdateOne

SetColors sets the "colors" field.

func (*CardFaceUpdateOne) SetFlavorText

func (cfuo *CardFaceUpdateOne) SetFlavorText(s string) *CardFaceUpdateOne

SetFlavorText sets the "flavor_text" field.

func (*CardFaceUpdateOne) SetLanguage

func (cfuo *CardFaceUpdateOne) SetLanguage(s string) *CardFaceUpdateOne

SetLanguage sets the "language" field.

func (*CardFaceUpdateOne) SetLoyalty

func (cfuo *CardFaceUpdateOne) SetLoyalty(s string) *CardFaceUpdateOne

SetLoyalty sets the "loyalty" field.

func (*CardFaceUpdateOne) SetManaCost

func (cfuo *CardFaceUpdateOne) SetManaCost(s string) *CardFaceUpdateOne

SetManaCost sets the "mana_cost" field.

func (*CardFaceUpdateOne) SetName

func (cfuo *CardFaceUpdateOne) SetName(s string) *CardFaceUpdateOne

SetName sets the "name" field.

func (*CardFaceUpdateOne) SetNillableCardID

func (cfuo *CardFaceUpdateOne) SetNillableCardID(id *int) *CardFaceUpdateOne

SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableCmc

func (cfuo *CardFaceUpdateOne) SetNillableCmc(f *float32) *CardFaceUpdateOne

SetNillableCmc sets the "cmc" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableColors

func (cfuo *CardFaceUpdateOne) SetNillableColors(s *string) *CardFaceUpdateOne

SetNillableColors sets the "colors" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableFlavorText

func (cfuo *CardFaceUpdateOne) SetNillableFlavorText(s *string) *CardFaceUpdateOne

SetNillableFlavorText sets the "flavor_text" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableLanguage

func (cfuo *CardFaceUpdateOne) SetNillableLanguage(s *string) *CardFaceUpdateOne

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

func (*CardFaceUpdateOne) SetNillableLoyalty

func (cfuo *CardFaceUpdateOne) SetNillableLoyalty(s *string) *CardFaceUpdateOne

SetNillableLoyalty sets the "loyalty" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableManaCost

func (cfuo *CardFaceUpdateOne) SetNillableManaCost(s *string) *CardFaceUpdateOne

SetNillableManaCost sets the "mana_cost" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableName

func (cfuo *CardFaceUpdateOne) SetNillableName(s *string) *CardFaceUpdateOne

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

func (*CardFaceUpdateOne) SetNillableOracleText

func (cfuo *CardFaceUpdateOne) SetNillableOracleText(s *string) *CardFaceUpdateOne

SetNillableOracleText sets the "oracle_text" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillablePower

func (cfuo *CardFaceUpdateOne) SetNillablePower(s *string) *CardFaceUpdateOne

SetNillablePower sets the "power" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableToughness

func (cfuo *CardFaceUpdateOne) SetNillableToughness(s *string) *CardFaceUpdateOne

SetNillableToughness sets the "toughness" field if the given value is not nil.

func (*CardFaceUpdateOne) SetNillableTypeLine

func (cfuo *CardFaceUpdateOne) SetNillableTypeLine(s *string) *CardFaceUpdateOne

SetNillableTypeLine sets the "type_line" field if the given value is not nil.

func (*CardFaceUpdateOne) SetOracleText

func (cfuo *CardFaceUpdateOne) SetOracleText(s string) *CardFaceUpdateOne

SetOracleText sets the "oracle_text" field.

func (*CardFaceUpdateOne) SetPower

func (cfuo *CardFaceUpdateOne) SetPower(s string) *CardFaceUpdateOne

SetPower sets the "power" field.

func (*CardFaceUpdateOne) SetToughness

func (cfuo *CardFaceUpdateOne) SetToughness(s string) *CardFaceUpdateOne

SetToughness sets the "toughness" field.

func (*CardFaceUpdateOne) SetTypeLine

func (cfuo *CardFaceUpdateOne) SetTypeLine(s string) *CardFaceUpdateOne

SetTypeLine sets the "type_line" field.

func (*CardFaceUpdateOne) Where

Where appends a list predicates to the CardFaceUpdate builder.

type CardFaces

type CardFaces []*CardFace

CardFaces is a parsable slice of CardFace.

type CardGroupBy

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

CardGroupBy is the group-by builder for Card entities.

func (*CardGroupBy) Aggregate

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

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

func (*CardGroupBy) Bool

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

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

func (*CardGroupBy) BoolX

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

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

func (*CardGroupBy) Bools

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

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

func (*CardGroupBy) BoolsX

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

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

func (*CardGroupBy) Float64

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

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

func (*CardGroupBy) Float64X

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

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

func (*CardGroupBy) Float64s

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

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

func (*CardGroupBy) Float64sX

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

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

func (*CardGroupBy) Int

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

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

func (*CardGroupBy) IntX

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

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

func (*CardGroupBy) Ints

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

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

func (*CardGroupBy) IntsX

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

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

func (*CardGroupBy) Scan

func (cgb *CardGroupBy) Scan(ctx context.Context, v any) error

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

func (*CardGroupBy) ScanX

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

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

func (*CardGroupBy) String

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

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

func (*CardGroupBy) StringX

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

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

func (*CardGroupBy) Strings

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

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

func (*CardGroupBy) StringsX

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

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

type CardMutation

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

CardMutation represents an operation that mutates the Card nodes in the graph.

func (*CardMutation) AddColorIdentity

func (m *CardMutation) AddColorIdentity(u int8)

AddColorIdentity adds u to the "color_identity" field.

func (*CardMutation) AddFaceIDs

func (m *CardMutation) AddFaceIDs(ids ...int)

AddFaceIDs adds the "faces" edge to the CardFace entity by ids.

func (*CardMutation) AddField

func (m *CardMutation) 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 (*CardMutation) AddRulingIDs

func (m *CardMutation) AddRulingIDs(ids ...int)

AddRulingIDs adds the "rulings" edge to the Ruling entity by ids.

func (*CardMutation) AddedColorIdentity

func (m *CardMutation) AddedColorIdentity() (r int8, exists bool)

AddedColorIdentity returns the value that was added to the "color_identity" field in this mutation.

func (*CardMutation) AddedEdges

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

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

func (*CardMutation) AddedField

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

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

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

func (*CardMutation) AddedIDs

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

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

func (*CardMutation) ClearEdge

func (m *CardMutation) 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 (*CardMutation) ClearFaces

func (m *CardMutation) ClearFaces()

ClearFaces clears the "faces" edge to the CardFace entity.

func (*CardMutation) ClearField

func (m *CardMutation) 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 (*CardMutation) ClearRulings

func (m *CardMutation) ClearRulings()

ClearRulings clears the "rulings" edge to the Ruling entity.

func (*CardMutation) ClearedEdges

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

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

func (*CardMutation) ClearedFields

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

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

func (CardMutation) Client

func (m CardMutation) 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 (*CardMutation) ColorIdentity

func (m *CardMutation) ColorIdentity() (r uint8, exists bool)

ColorIdentity returns the value of the "color_identity" field in the mutation.

func (*CardMutation) EdgeCleared

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

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

func (*CardMutation) FacesCleared

func (m *CardMutation) FacesCleared() bool

FacesCleared reports if the "faces" edge to the CardFace entity was cleared.

func (*CardMutation) FacesIDs

func (m *CardMutation) FacesIDs() (ids []int)

FacesIDs returns the "faces" edge IDs in the mutation.

func (*CardMutation) Field

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

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

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

func (*CardMutation) Fields

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

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

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

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

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

func (*CardMutation) OldColorIdentity

func (m *CardMutation) OldColorIdentity(ctx context.Context) (v uint8, err error)

OldColorIdentity returns the old "color_identity" field's value of the Card entity. If the Card 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 (*CardMutation) OldField

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

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

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

func (m *CardMutation) OldOracleID(ctx context.Context) (v string, err error)

OldOracleID returns the old "oracle_id" field's value of the Card entity. If the Card 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 (*CardMutation) Op

func (m *CardMutation) Op() Op

Op returns the operation name.

func (*CardMutation) OracleID

func (m *CardMutation) OracleID() (r string, exists bool)

OracleID returns the value of the "oracle_id" field in the mutation.

func (*CardMutation) RemoveFaceIDs

func (m *CardMutation) RemoveFaceIDs(ids ...int)

RemoveFaceIDs removes the "faces" edge to the CardFace entity by IDs.

func (*CardMutation) RemoveRulingIDs

func (m *CardMutation) RemoveRulingIDs(ids ...int)

RemoveRulingIDs removes the "rulings" edge to the Ruling entity by IDs.

func (*CardMutation) RemovedEdges

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

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

func (*CardMutation) RemovedFacesIDs

func (m *CardMutation) RemovedFacesIDs() (ids []int)

RemovedFaces returns the removed IDs of the "faces" edge to the CardFace entity.

func (*CardMutation) RemovedIDs

func (m *CardMutation) 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 (*CardMutation) RemovedRulingsIDs

func (m *CardMutation) RemovedRulingsIDs() (ids []int)

RemovedRulings returns the removed IDs of the "rulings" edge to the Ruling entity.

func (*CardMutation) ResetColorIdentity

func (m *CardMutation) ResetColorIdentity()

ResetColorIdentity resets all changes to the "color_identity" field.

func (*CardMutation) ResetEdge

func (m *CardMutation) 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 (*CardMutation) ResetFaces

func (m *CardMutation) ResetFaces()

ResetFaces resets all changes to the "faces" edge.

func (*CardMutation) ResetField

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

func (m *CardMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CardMutation) ResetOracleID

func (m *CardMutation) ResetOracleID()

ResetOracleID resets all changes to the "oracle_id" field.

func (*CardMutation) ResetRulings

func (m *CardMutation) ResetRulings()

ResetRulings resets all changes to the "rulings" edge.

func (*CardMutation) RulingsCleared

func (m *CardMutation) RulingsCleared() bool

RulingsCleared reports if the "rulings" edge to the Ruling entity was cleared.

func (*CardMutation) RulingsIDs

func (m *CardMutation) RulingsIDs() (ids []int)

RulingsIDs returns the "rulings" edge IDs in the mutation.

func (*CardMutation) SetColorIdentity

func (m *CardMutation) SetColorIdentity(u uint8)

SetColorIdentity sets the "color_identity" field.

func (*CardMutation) SetField

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

func (m *CardMutation) SetName(s string)

SetName sets the "name" field.

func (*CardMutation) SetOp

func (m *CardMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CardMutation) SetOracleID

func (m *CardMutation) SetOracleID(s string)

SetOracleID sets the "oracle_id" field.

func (CardMutation) Tx

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

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

func (*CardMutation) Type

func (m *CardMutation) Type() string

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

func (*CardMutation) Where

func (m *CardMutation) Where(ps ...predicate.Card)

Where appends a list predicates to the CardMutation builder.

func (*CardMutation) WhereP

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

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

type CardQuery

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

CardQuery is the builder for querying Card entities.

func (*CardQuery) Aggregate

func (cq *CardQuery) Aggregate(fns ...AggregateFunc) *CardSelect

Aggregate returns a CardSelect configured with the given aggregations.

func (*CardQuery) All

func (cq *CardQuery) All(ctx context.Context) ([]*Card, error)

All executes the query and returns a list of Cards.

func (*CardQuery) AllX

func (cq *CardQuery) AllX(ctx context.Context) []*Card

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

func (*CardQuery) Clone

func (cq *CardQuery) Clone() *CardQuery

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

func (*CardQuery) Count

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

Count returns the count of the given query.

func (*CardQuery) CountX

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

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

func (*CardQuery) Exist

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

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

func (*CardQuery) ExistX

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

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

func (*CardQuery) First

func (cq *CardQuery) First(ctx context.Context) (*Card, error)

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

func (*CardQuery) FirstID

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

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

func (*CardQuery) FirstIDX

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

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

func (*CardQuery) FirstX

func (cq *CardQuery) FirstX(ctx context.Context) *Card

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

func (*CardQuery) GroupBy

func (cq *CardQuery) GroupBy(field string, fields ...string) *CardGroupBy

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.Card.Query().
	GroupBy(card.FieldName).
	Aggregate(oracle.Count()).
	Scan(ctx, &v)

func (*CardQuery) IDs

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

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

func (*CardQuery) IDsX

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

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

func (*CardQuery) Limit

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

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

func (*CardQuery) Offset

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

Offset to start from.

func (*CardQuery) Only

func (cq *CardQuery) Only(ctx context.Context) (*Card, error)

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

func (*CardQuery) OnlyID

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

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

func (*CardQuery) OnlyIDX

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

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

func (*CardQuery) OnlyX

func (cq *CardQuery) OnlyX(ctx context.Context) *Card

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

func (*CardQuery) Order

func (cq *CardQuery) Order(o ...card.OrderOption) *CardQuery

Order specifies how the records should be ordered.

func (*CardQuery) QueryFaces

func (cq *CardQuery) QueryFaces() *CardFaceQuery

QueryFaces chains the current query on the "faces" edge.

func (*CardQuery) QueryRulings

func (cq *CardQuery) QueryRulings() *RulingQuery

QueryRulings chains the current query on the "rulings" edge.

func (*CardQuery) Select

func (cq *CardQuery) Select(fields ...string) *CardSelect

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

func (*CardQuery) Unique

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

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

func (cq *CardQuery) Where(ps ...predicate.Card) *CardQuery

Where adds a new predicate for the CardQuery builder.

func (*CardQuery) WithFaces

func (cq *CardQuery) WithFaces(opts ...func(*CardFaceQuery)) *CardQuery

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

func (*CardQuery) WithRulings

func (cq *CardQuery) WithRulings(opts ...func(*RulingQuery)) *CardQuery

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

type CardSelect

type CardSelect struct {
	*CardQuery
	// contains filtered or unexported fields
}

CardSelect is the builder for selecting fields of Card entities.

func (*CardSelect) Aggregate

func (cs *CardSelect) Aggregate(fns ...AggregateFunc) *CardSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CardSelect) Bool

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

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

func (*CardSelect) BoolX

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

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

func (*CardSelect) Bools

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

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

func (*CardSelect) BoolsX

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

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

func (*CardSelect) Float64

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

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

func (*CardSelect) Float64X

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

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

func (*CardSelect) Float64s

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

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

func (*CardSelect) Float64sX

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

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

func (*CardSelect) Int

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

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

func (*CardSelect) IntX

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

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

func (*CardSelect) Ints

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

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

func (*CardSelect) IntsX

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

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

func (*CardSelect) Scan

func (cs *CardSelect) Scan(ctx context.Context, v any) error

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

func (*CardSelect) ScanX

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

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

func (*CardSelect) String

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

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

func (*CardSelect) StringX

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

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

func (*CardSelect) Strings

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

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

func (*CardSelect) StringsX

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

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

type CardUpdate

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

CardUpdate is the builder for updating Card entities.

func (*CardUpdate) AddColorIdentity

func (cu *CardUpdate) AddColorIdentity(u int8) *CardUpdate

AddColorIdentity adds u to the "color_identity" field.

func (*CardUpdate) AddFaceIDs

func (cu *CardUpdate) AddFaceIDs(ids ...int) *CardUpdate

AddFaceIDs adds the "faces" edge to the CardFace entity by IDs.

func (*CardUpdate) AddFaces

func (cu *CardUpdate) AddFaces(c ...*CardFace) *CardUpdate

AddFaces adds the "faces" edges to the CardFace entity.

func (*CardUpdate) AddRulingIDs

func (cu *CardUpdate) AddRulingIDs(ids ...int) *CardUpdate

AddRulingIDs adds the "rulings" edge to the Ruling entity by IDs.

func (*CardUpdate) AddRulings

func (cu *CardUpdate) AddRulings(r ...*Ruling) *CardUpdate

AddRulings adds the "rulings" edges to the Ruling entity.

func (*CardUpdate) ClearFaces

func (cu *CardUpdate) ClearFaces() *CardUpdate

ClearFaces clears all "faces" edges to the CardFace entity.

func (*CardUpdate) ClearRulings

func (cu *CardUpdate) ClearRulings() *CardUpdate

ClearRulings clears all "rulings" edges to the Ruling entity.

func (*CardUpdate) Exec

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

Exec executes the query.

func (*CardUpdate) ExecX

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

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

func (*CardUpdate) Mutation

func (cu *CardUpdate) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardUpdate) RemoveFaceIDs

func (cu *CardUpdate) RemoveFaceIDs(ids ...int) *CardUpdate

RemoveFaceIDs removes the "faces" edge to CardFace entities by IDs.

func (*CardUpdate) RemoveFaces

func (cu *CardUpdate) RemoveFaces(c ...*CardFace) *CardUpdate

RemoveFaces removes "faces" edges to CardFace entities.

func (*CardUpdate) RemoveRulingIDs

func (cu *CardUpdate) RemoveRulingIDs(ids ...int) *CardUpdate

RemoveRulingIDs removes the "rulings" edge to Ruling entities by IDs.

func (*CardUpdate) RemoveRulings

func (cu *CardUpdate) RemoveRulings(r ...*Ruling) *CardUpdate

RemoveRulings removes "rulings" edges to Ruling entities.

func (*CardUpdate) Save

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

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

func (*CardUpdate) SaveX

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

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

func (*CardUpdate) SetColorIdentity

func (cu *CardUpdate) SetColorIdentity(u uint8) *CardUpdate

SetColorIdentity sets the "color_identity" field.

func (*CardUpdate) SetName

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

SetName sets the "name" field.

func (*CardUpdate) SetNillableColorIdentity

func (cu *CardUpdate) SetNillableColorIdentity(u *uint8) *CardUpdate

SetNillableColorIdentity sets the "color_identity" field if the given value is not nil.

func (*CardUpdate) SetNillableName

func (cu *CardUpdate) SetNillableName(s *string) *CardUpdate

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

func (*CardUpdate) SetNillableOracleID

func (cu *CardUpdate) SetNillableOracleID(s *string) *CardUpdate

SetNillableOracleID sets the "oracle_id" field if the given value is not nil.

func (*CardUpdate) SetOracleID

func (cu *CardUpdate) SetOracleID(s string) *CardUpdate

SetOracleID sets the "oracle_id" field.

func (*CardUpdate) Where

func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate

Where appends a list predicates to the CardUpdate builder.

type CardUpdateOne

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

CardUpdateOne is the builder for updating a single Card entity.

func (*CardUpdateOne) AddColorIdentity

func (cuo *CardUpdateOne) AddColorIdentity(u int8) *CardUpdateOne

AddColorIdentity adds u to the "color_identity" field.

func (*CardUpdateOne) AddFaceIDs

func (cuo *CardUpdateOne) AddFaceIDs(ids ...int) *CardUpdateOne

AddFaceIDs adds the "faces" edge to the CardFace entity by IDs.

func (*CardUpdateOne) AddFaces

func (cuo *CardUpdateOne) AddFaces(c ...*CardFace) *CardUpdateOne

AddFaces adds the "faces" edges to the CardFace entity.

func (*CardUpdateOne) AddRulingIDs

func (cuo *CardUpdateOne) AddRulingIDs(ids ...int) *CardUpdateOne

AddRulingIDs adds the "rulings" edge to the Ruling entity by IDs.

func (*CardUpdateOne) AddRulings

func (cuo *CardUpdateOne) AddRulings(r ...*Ruling) *CardUpdateOne

AddRulings adds the "rulings" edges to the Ruling entity.

func (*CardUpdateOne) ClearFaces

func (cuo *CardUpdateOne) ClearFaces() *CardUpdateOne

ClearFaces clears all "faces" edges to the CardFace entity.

func (*CardUpdateOne) ClearRulings

func (cuo *CardUpdateOne) ClearRulings() *CardUpdateOne

ClearRulings clears all "rulings" edges to the Ruling entity.

func (*CardUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CardUpdateOne) ExecX

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

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

func (*CardUpdateOne) Mutation

func (cuo *CardUpdateOne) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardUpdateOne) RemoveFaceIDs

func (cuo *CardUpdateOne) RemoveFaceIDs(ids ...int) *CardUpdateOne

RemoveFaceIDs removes the "faces" edge to CardFace entities by IDs.

func (*CardUpdateOne) RemoveFaces

func (cuo *CardUpdateOne) RemoveFaces(c ...*CardFace) *CardUpdateOne

RemoveFaces removes "faces" edges to CardFace entities.

func (*CardUpdateOne) RemoveRulingIDs

func (cuo *CardUpdateOne) RemoveRulingIDs(ids ...int) *CardUpdateOne

RemoveRulingIDs removes the "rulings" edge to Ruling entities by IDs.

func (*CardUpdateOne) RemoveRulings

func (cuo *CardUpdateOne) RemoveRulings(r ...*Ruling) *CardUpdateOne

RemoveRulings removes "rulings" edges to Ruling entities.

func (*CardUpdateOne) Save

func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)

Save executes the query and returns the updated Card entity.

func (*CardUpdateOne) SaveX

func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card

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

func (*CardUpdateOne) Select

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

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

func (*CardUpdateOne) SetColorIdentity

func (cuo *CardUpdateOne) SetColorIdentity(u uint8) *CardUpdateOne

SetColorIdentity sets the "color_identity" field.

func (*CardUpdateOne) SetName

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

SetName sets the "name" field.

func (*CardUpdateOne) SetNillableColorIdentity

func (cuo *CardUpdateOne) SetNillableColorIdentity(u *uint8) *CardUpdateOne

SetNillableColorIdentity sets the "color_identity" field if the given value is not nil.

func (*CardUpdateOne) SetNillableName

func (cuo *CardUpdateOne) SetNillableName(s *string) *CardUpdateOne

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

func (*CardUpdateOne) SetNillableOracleID

func (cuo *CardUpdateOne) SetNillableOracleID(s *string) *CardUpdateOne

SetNillableOracleID sets the "oracle_id" field if the given value is not nil.

func (*CardUpdateOne) SetOracleID

func (cuo *CardUpdateOne) SetOracleID(s string) *CardUpdateOne

SetOracleID sets the "oracle_id" field.

func (*CardUpdateOne) Where

func (cuo *CardUpdateOne) Where(ps ...predicate.Card) *CardUpdateOne

Where appends a list predicates to the CardUpdate builder.

type Cards

type Cards []*Card

Cards is a parsable slice of Card.

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
	// Card is the client for interacting with the Card builders.
	Card *CardClient
	// CardFace is the client for interacting with the CardFace builders.
	CardFace *CardFaceClient
	// Printing is the client for interacting with the Printing builders.
	Printing *PrintingClient
	// PrintingImage is the client for interacting with the PrintingImage builders.
	PrintingImage *PrintingImageClient
	// Ruling is the client for interacting with the Ruling builders.
	Ruling *RulingClient
	// Set is the client for interacting with the Set builders.
	Set *SetClient
	// 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) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Printing

type Printing struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Rarity holds the value of the "rarity" field.
	Rarity printing.Rarity `json:"rarity,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PrintingQuery when eager-loading is set.
	Edges PrintingEdges `json:"edges"`
	// contains filtered or unexported fields
}

Printing is the model entity for the Printing schema.

func (*Printing) QueryArtist

func (pr *Printing) QueryArtist() *ArtistQuery

QueryArtist queries the "artist" edge of the Printing entity.

func (*Printing) QueryCardFace

func (pr *Printing) QueryCardFace() *CardFaceQuery

QueryCardFace queries the "card_face" edge of the Printing entity.

func (*Printing) QueryImages

func (pr *Printing) QueryImages() *PrintingImageQuery

QueryImages queries the "images" edge of the Printing entity.

func (*Printing) QuerySet

func (pr *Printing) QuerySet() *SetQuery

QuerySet queries the "set" edge of the Printing entity.

func (*Printing) String

func (pr *Printing) String() string

String implements the fmt.Stringer.

func (*Printing) Unwrap

func (pr *Printing) Unwrap() *Printing

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

func (pr *Printing) Update() *PrintingUpdateOne

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

func (*Printing) Value

func (pr *Printing) Value(name string) (ent.Value, error)

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

type PrintingClient

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

PrintingClient is a client for the Printing schema.

func NewPrintingClient

func NewPrintingClient(c config) *PrintingClient

NewPrintingClient returns a client for the Printing from the given config.

func (*PrintingClient) Create

func (c *PrintingClient) Create() *PrintingCreate

Create returns a builder for creating a Printing entity.

func (*PrintingClient) CreateBulk

func (c *PrintingClient) CreateBulk(builders ...*PrintingCreate) *PrintingCreateBulk

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

func (*PrintingClient) Delete

func (c *PrintingClient) Delete() *PrintingDelete

Delete returns a delete builder for Printing.

func (*PrintingClient) DeleteOne

func (c *PrintingClient) DeleteOne(pr *Printing) *PrintingDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PrintingClient) DeleteOneID

func (c *PrintingClient) DeleteOneID(id int) *PrintingDeleteOne

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

func (*PrintingClient) Get

func (c *PrintingClient) Get(ctx context.Context, id int) (*Printing, error)

Get returns a Printing entity by its id.

func (*PrintingClient) GetX

func (c *PrintingClient) GetX(ctx context.Context, id int) *Printing

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

func (*PrintingClient) Hooks

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

Hooks returns the client hooks.

func (*PrintingClient) Intercept

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

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

func (*PrintingClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PrintingClient) MapCreateBulk

func (c *PrintingClient) MapCreateBulk(slice any, setFunc func(*PrintingCreate, int)) *PrintingCreateBulk

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

func (*PrintingClient) Query

func (c *PrintingClient) Query() *PrintingQuery

Query returns a query builder for Printing.

func (*PrintingClient) QueryArtist

func (c *PrintingClient) QueryArtist(pr *Printing) *ArtistQuery

QueryArtist queries the artist edge of a Printing.

func (*PrintingClient) QueryCardFace

func (c *PrintingClient) QueryCardFace(pr *Printing) *CardFaceQuery

QueryCardFace queries the card_face edge of a Printing.

func (*PrintingClient) QueryImages

func (c *PrintingClient) QueryImages(pr *Printing) *PrintingImageQuery

QueryImages queries the images edge of a Printing.

func (*PrintingClient) QuerySet

func (c *PrintingClient) QuerySet(pr *Printing) *SetQuery

QuerySet queries the set edge of a Printing.

func (*PrintingClient) Update

func (c *PrintingClient) Update() *PrintingUpdate

Update returns an update builder for Printing.

func (*PrintingClient) UpdateOne

func (c *PrintingClient) UpdateOne(pr *Printing) *PrintingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PrintingClient) UpdateOneID

func (c *PrintingClient) UpdateOneID(id int) *PrintingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PrintingClient) Use

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

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

type PrintingCreate

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

PrintingCreate is the builder for creating a Printing entity.

func (*PrintingCreate) AddImageIDs

func (pc *PrintingCreate) AddImageIDs(ids ...int) *PrintingCreate

AddImageIDs adds the "images" edge to the PrintingImage entity by IDs.

func (*PrintingCreate) AddImages

func (pc *PrintingCreate) AddImages(p ...*PrintingImage) *PrintingCreate

AddImages adds the "images" edges to the PrintingImage entity.

func (*PrintingCreate) Exec

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

Exec executes the query.

func (*PrintingCreate) ExecX

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

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

func (*PrintingCreate) Mutation

func (pc *PrintingCreate) Mutation() *PrintingMutation

Mutation returns the PrintingMutation object of the builder.

func (*PrintingCreate) Save

func (pc *PrintingCreate) Save(ctx context.Context) (*Printing, error)

Save creates the Printing in the database.

func (*PrintingCreate) SaveX

func (pc *PrintingCreate) SaveX(ctx context.Context) *Printing

SaveX calls Save and panics if Save returns an error.

func (*PrintingCreate) SetArtist

func (pc *PrintingCreate) SetArtist(a *Artist) *PrintingCreate

SetArtist sets the "artist" edge to the Artist entity.

func (*PrintingCreate) SetArtistID

func (pc *PrintingCreate) SetArtistID(id int) *PrintingCreate

SetArtistID sets the "artist" edge to the Artist entity by ID.

func (*PrintingCreate) SetCardFace

func (pc *PrintingCreate) SetCardFace(c *CardFace) *PrintingCreate

SetCardFace sets the "card_face" edge to the CardFace entity.

func (*PrintingCreate) SetCardFaceID

func (pc *PrintingCreate) SetCardFaceID(id int) *PrintingCreate

SetCardFaceID sets the "card_face" edge to the CardFace entity by ID.

func (*PrintingCreate) SetNillableArtistID

func (pc *PrintingCreate) SetNillableArtistID(id *int) *PrintingCreate

SetNillableArtistID sets the "artist" edge to the Artist entity by ID if the given value is not nil.

func (*PrintingCreate) SetNillableCardFaceID

func (pc *PrintingCreate) SetNillableCardFaceID(id *int) *PrintingCreate

SetNillableCardFaceID sets the "card_face" edge to the CardFace entity by ID if the given value is not nil.

func (*PrintingCreate) SetNillableSetID

func (pc *PrintingCreate) SetNillableSetID(id *int) *PrintingCreate

SetNillableSetID sets the "set" edge to the Set entity by ID if the given value is not nil.

func (*PrintingCreate) SetRarity

func (pc *PrintingCreate) SetRarity(pr printing.Rarity) *PrintingCreate

SetRarity sets the "rarity" field.

func (*PrintingCreate) SetSet

func (pc *PrintingCreate) SetSet(s *Set) *PrintingCreate

SetSet sets the "set" edge to the Set entity.

func (*PrintingCreate) SetSetID

func (pc *PrintingCreate) SetSetID(id int) *PrintingCreate

SetSetID sets the "set" edge to the Set entity by ID.

type PrintingCreateBulk

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

PrintingCreateBulk is the builder for creating many Printing entities in bulk.

func (*PrintingCreateBulk) Exec

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

Exec executes the query.

func (*PrintingCreateBulk) ExecX

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

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

func (*PrintingCreateBulk) Save

func (pcb *PrintingCreateBulk) Save(ctx context.Context) ([]*Printing, error)

Save creates the Printing entities in the database.

func (*PrintingCreateBulk) SaveX

func (pcb *PrintingCreateBulk) SaveX(ctx context.Context) []*Printing

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

type PrintingDelete

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

PrintingDelete is the builder for deleting a Printing entity.

func (*PrintingDelete) Exec

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

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

func (*PrintingDelete) ExecX

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

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

func (*PrintingDelete) Where

func (pd *PrintingDelete) Where(ps ...predicate.Printing) *PrintingDelete

Where appends a list predicates to the PrintingDelete builder.

type PrintingDeleteOne

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

PrintingDeleteOne is the builder for deleting a single Printing entity.

func (*PrintingDeleteOne) Exec

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

Exec executes the deletion query.

func (*PrintingDeleteOne) ExecX

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

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

func (*PrintingDeleteOne) Where

Where appends a list predicates to the PrintingDelete builder.

type PrintingEdges

type PrintingEdges struct {
	// Artist holds the value of the artist edge.
	Artist *Artist `json:"artist,omitempty"`
	// Set holds the value of the set edge.
	Set *Set `json:"set,omitempty"`
	// CardFace holds the value of the card_face edge.
	CardFace *CardFace `json:"card_face,omitempty"`
	// Images holds the value of the images edge.
	Images []*PrintingImage `json:"images,omitempty"`
	// contains filtered or unexported fields
}

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

func (PrintingEdges) ArtistOrErr

func (e PrintingEdges) ArtistOrErr() (*Artist, error)

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

func (PrintingEdges) CardFaceOrErr

func (e PrintingEdges) CardFaceOrErr() (*CardFace, error)

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

func (PrintingEdges) ImagesOrErr

func (e PrintingEdges) ImagesOrErr() ([]*PrintingImage, error)

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

func (PrintingEdges) SetOrErr

func (e PrintingEdges) SetOrErr() (*Set, error)

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

type PrintingGroupBy

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

PrintingGroupBy is the group-by builder for Printing entities.

func (*PrintingGroupBy) Aggregate

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

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

func (*PrintingGroupBy) Bool

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

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

func (*PrintingGroupBy) BoolX

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

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

func (*PrintingGroupBy) Bools

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

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

func (*PrintingGroupBy) BoolsX

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

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

func (*PrintingGroupBy) Float64

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

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

func (*PrintingGroupBy) Float64X

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

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

func (*PrintingGroupBy) Float64s

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

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

func (*PrintingGroupBy) Float64sX

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

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

func (*PrintingGroupBy) Int

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

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

func (*PrintingGroupBy) IntX

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

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

func (*PrintingGroupBy) Ints

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

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

func (*PrintingGroupBy) IntsX

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

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

func (*PrintingGroupBy) Scan

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

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

func (*PrintingGroupBy) ScanX

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

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

func (*PrintingGroupBy) String

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

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

func (*PrintingGroupBy) StringX

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

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

func (*PrintingGroupBy) Strings

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

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

func (*PrintingGroupBy) StringsX

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

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

type PrintingImage

type PrintingImage struct {

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

PrintingImage is the model entity for the PrintingImage schema.

func (*PrintingImage) QueryPrinting

func (pi *PrintingImage) QueryPrinting() *PrintingQuery

QueryPrinting queries the "printing" edge of the PrintingImage entity.

func (*PrintingImage) String

func (pi *PrintingImage) String() string

String implements the fmt.Stringer.

func (*PrintingImage) Unwrap

func (pi *PrintingImage) Unwrap() *PrintingImage

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

func (pi *PrintingImage) Update() *PrintingImageUpdateOne

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

func (*PrintingImage) Value

func (pi *PrintingImage) Value(name string) (ent.Value, error)

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

type PrintingImageClient

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

PrintingImageClient is a client for the PrintingImage schema.

func NewPrintingImageClient

func NewPrintingImageClient(c config) *PrintingImageClient

NewPrintingImageClient returns a client for the PrintingImage from the given config.

func (*PrintingImageClient) Create

Create returns a builder for creating a PrintingImage entity.

func (*PrintingImageClient) CreateBulk

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

func (*PrintingImageClient) Delete

Delete returns a delete builder for PrintingImage.

func (*PrintingImageClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PrintingImageClient) DeleteOneID

func (c *PrintingImageClient) DeleteOneID(id int) *PrintingImageDeleteOne

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

func (*PrintingImageClient) Get

Get returns a PrintingImage entity by its id.

func (*PrintingImageClient) GetX

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

func (*PrintingImageClient) Hooks

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

Hooks returns the client hooks.

func (*PrintingImageClient) Intercept

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

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

func (*PrintingImageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PrintingImageClient) MapCreateBulk

func (c *PrintingImageClient) MapCreateBulk(slice any, setFunc func(*PrintingImageCreate, int)) *PrintingImageCreateBulk

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

func (*PrintingImageClient) Query

Query returns a query builder for PrintingImage.

func (*PrintingImageClient) QueryPrinting

func (c *PrintingImageClient) QueryPrinting(pi *PrintingImage) *PrintingQuery

QueryPrinting queries the printing edge of a PrintingImage.

func (*PrintingImageClient) Update

Update returns an update builder for PrintingImage.

func (*PrintingImageClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*PrintingImageClient) UpdateOneID

func (c *PrintingImageClient) UpdateOneID(id int) *PrintingImageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PrintingImageClient) Use

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

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

type PrintingImageCreate

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

PrintingImageCreate is the builder for creating a PrintingImage entity.

func (*PrintingImageCreate) Exec

func (pic *PrintingImageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PrintingImageCreate) ExecX

func (pic *PrintingImageCreate) ExecX(ctx context.Context)

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

func (*PrintingImageCreate) Mutation

func (pic *PrintingImageCreate) Mutation() *PrintingImageMutation

Mutation returns the PrintingImageMutation object of the builder.

func (*PrintingImageCreate) Save

Save creates the PrintingImage in the database.

func (*PrintingImageCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*PrintingImageCreate) SetNillablePrintingID

func (pic *PrintingImageCreate) SetNillablePrintingID(id *int) *PrintingImageCreate

SetNillablePrintingID sets the "printing" edge to the Printing entity by ID if the given value is not nil.

func (*PrintingImageCreate) SetPrinting

func (pic *PrintingImageCreate) SetPrinting(p *Printing) *PrintingImageCreate

SetPrinting sets the "printing" edge to the Printing entity.

func (*PrintingImageCreate) SetPrintingID

func (pic *PrintingImageCreate) SetPrintingID(id int) *PrintingImageCreate

SetPrintingID sets the "printing" edge to the Printing entity by ID.

func (*PrintingImageCreate) SetURL

SetURL sets the "url" field.

type PrintingImageCreateBulk

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

PrintingImageCreateBulk is the builder for creating many PrintingImage entities in bulk.

func (*PrintingImageCreateBulk) Exec

func (picb *PrintingImageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PrintingImageCreateBulk) ExecX

func (picb *PrintingImageCreateBulk) ExecX(ctx context.Context)

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

func (*PrintingImageCreateBulk) Save

Save creates the PrintingImage entities in the database.

func (*PrintingImageCreateBulk) SaveX

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

type PrintingImageDelete

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

PrintingImageDelete is the builder for deleting a PrintingImage entity.

func (*PrintingImageDelete) Exec

func (pid *PrintingImageDelete) Exec(ctx context.Context) (int, error)

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

func (*PrintingImageDelete) ExecX

func (pid *PrintingImageDelete) ExecX(ctx context.Context) int

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

func (*PrintingImageDelete) Where

Where appends a list predicates to the PrintingImageDelete builder.

type PrintingImageDeleteOne

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

PrintingImageDeleteOne is the builder for deleting a single PrintingImage entity.

func (*PrintingImageDeleteOne) Exec

func (pido *PrintingImageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PrintingImageDeleteOne) ExecX

func (pido *PrintingImageDeleteOne) ExecX(ctx context.Context)

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

func (*PrintingImageDeleteOne) Where

Where appends a list predicates to the PrintingImageDelete builder.

type PrintingImageEdges

type PrintingImageEdges struct {
	// Printing holds the value of the printing edge.
	Printing *Printing `json:"printing,omitempty"`
	// contains filtered or unexported fields
}

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

func (PrintingImageEdges) PrintingOrErr

func (e PrintingImageEdges) PrintingOrErr() (*Printing, error)

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

type PrintingImageGroupBy

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

PrintingImageGroupBy is the group-by builder for PrintingImage entities.

func (*PrintingImageGroupBy) Aggregate

func (pigb *PrintingImageGroupBy) Aggregate(fns ...AggregateFunc) *PrintingImageGroupBy

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

func (*PrintingImageGroupBy) Bool

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

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

func (*PrintingImageGroupBy) BoolX

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

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

func (*PrintingImageGroupBy) Bools

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

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

func (*PrintingImageGroupBy) BoolsX

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

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

func (*PrintingImageGroupBy) Float64

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

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

func (*PrintingImageGroupBy) Float64X

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

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

func (*PrintingImageGroupBy) Float64s

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

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

func (*PrintingImageGroupBy) Float64sX

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

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

func (*PrintingImageGroupBy) Int

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

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

func (*PrintingImageGroupBy) IntX

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

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

func (*PrintingImageGroupBy) Ints

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

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

func (*PrintingImageGroupBy) IntsX

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

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

func (*PrintingImageGroupBy) Scan

func (pigb *PrintingImageGroupBy) Scan(ctx context.Context, v any) error

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

func (*PrintingImageGroupBy) ScanX

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

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

func (*PrintingImageGroupBy) String

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

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

func (*PrintingImageGroupBy) StringX

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

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

func (*PrintingImageGroupBy) Strings

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

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

func (*PrintingImageGroupBy) StringsX

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

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

type PrintingImageMutation

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

PrintingImageMutation represents an operation that mutates the PrintingImage nodes in the graph.

func (*PrintingImageMutation) AddField

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

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

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

func (*PrintingImageMutation) AddedField

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

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

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

func (*PrintingImageMutation) AddedIDs

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

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

func (*PrintingImageMutation) ClearEdge

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

func (m *PrintingImageMutation) 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 (*PrintingImageMutation) ClearPrinting

func (m *PrintingImageMutation) ClearPrinting()

ClearPrinting clears the "printing" edge to the Printing entity.

func (*PrintingImageMutation) ClearedEdges

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

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

func (*PrintingImageMutation) ClearedFields

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

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

func (PrintingImageMutation) Client

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

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

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

func (*PrintingImageMutation) Field

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

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

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

func (*PrintingImageMutation) Fields

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

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

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

func (m *PrintingImageMutation) 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 (*PrintingImageMutation) OldURL

func (m *PrintingImageMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the PrintingImage entity. If the PrintingImage 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 (*PrintingImageMutation) Op

func (m *PrintingImageMutation) Op() Op

Op returns the operation name.

func (*PrintingImageMutation) PrintingCleared

func (m *PrintingImageMutation) PrintingCleared() bool

PrintingCleared reports if the "printing" edge to the Printing entity was cleared.

func (*PrintingImageMutation) PrintingID

func (m *PrintingImageMutation) PrintingID() (id int, exists bool)

PrintingID returns the "printing" edge ID in the mutation.

func (*PrintingImageMutation) PrintingIDs

func (m *PrintingImageMutation) PrintingIDs() (ids []int)

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

func (*PrintingImageMutation) RemovedEdges

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

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

func (*PrintingImageMutation) RemovedIDs

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

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

func (m *PrintingImageMutation) 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 (*PrintingImageMutation) ResetPrinting

func (m *PrintingImageMutation) ResetPrinting()

ResetPrinting resets all changes to the "printing" edge.

func (*PrintingImageMutation) ResetURL

func (m *PrintingImageMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*PrintingImageMutation) SetField

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

func (m *PrintingImageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PrintingImageMutation) SetPrintingID

func (m *PrintingImageMutation) SetPrintingID(id int)

SetPrintingID sets the "printing" edge to the Printing entity by id.

func (*PrintingImageMutation) SetURL

func (m *PrintingImageMutation) SetURL(s string)

SetURL sets the "url" field.

func (PrintingImageMutation) Tx

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

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

func (*PrintingImageMutation) Type

func (m *PrintingImageMutation) Type() string

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

func (*PrintingImageMutation) URL

func (m *PrintingImageMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*PrintingImageMutation) Where

Where appends a list predicates to the PrintingImageMutation builder.

func (*PrintingImageMutation) WhereP

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

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

type PrintingImageQuery

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

PrintingImageQuery is the builder for querying PrintingImage entities.

func (*PrintingImageQuery) Aggregate

func (piq *PrintingImageQuery) Aggregate(fns ...AggregateFunc) *PrintingImageSelect

Aggregate returns a PrintingImageSelect configured with the given aggregations.

func (*PrintingImageQuery) All

All executes the query and returns a list of PrintingImages.

func (*PrintingImageQuery) AllX

func (piq *PrintingImageQuery) AllX(ctx context.Context) []*PrintingImage

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

func (*PrintingImageQuery) Clone

func (piq *PrintingImageQuery) Clone() *PrintingImageQuery

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

func (*PrintingImageQuery) Count

func (piq *PrintingImageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PrintingImageQuery) CountX

func (piq *PrintingImageQuery) CountX(ctx context.Context) int

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

func (*PrintingImageQuery) Exist

func (piq *PrintingImageQuery) Exist(ctx context.Context) (bool, error)

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

func (*PrintingImageQuery) ExistX

func (piq *PrintingImageQuery) ExistX(ctx context.Context) bool

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

func (*PrintingImageQuery) First

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

func (*PrintingImageQuery) FirstID

func (piq *PrintingImageQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PrintingImageQuery) FirstIDX

func (piq *PrintingImageQuery) FirstIDX(ctx context.Context) int

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

func (*PrintingImageQuery) FirstX

func (piq *PrintingImageQuery) FirstX(ctx context.Context) *PrintingImage

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

func (*PrintingImageQuery) GroupBy

func (piq *PrintingImageQuery) GroupBy(field string, fields ...string) *PrintingImageGroupBy

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

client.PrintingImage.Query().
	GroupBy(printingimage.FieldURL).
	Aggregate(oracle.Count()).
	Scan(ctx, &v)

func (*PrintingImageQuery) IDs

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

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

func (*PrintingImageQuery) IDsX

func (piq *PrintingImageQuery) IDsX(ctx context.Context) []int

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

func (*PrintingImageQuery) Limit

func (piq *PrintingImageQuery) Limit(limit int) *PrintingImageQuery

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

func (*PrintingImageQuery) Offset

func (piq *PrintingImageQuery) Offset(offset int) *PrintingImageQuery

Offset to start from.

func (*PrintingImageQuery) Only

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

func (*PrintingImageQuery) OnlyID

func (piq *PrintingImageQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PrintingImageQuery) OnlyIDX

func (piq *PrintingImageQuery) OnlyIDX(ctx context.Context) int

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

func (*PrintingImageQuery) OnlyX

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

func (*PrintingImageQuery) Order

Order specifies how the records should be ordered.

func (*PrintingImageQuery) QueryPrinting

func (piq *PrintingImageQuery) QueryPrinting() *PrintingQuery

QueryPrinting chains the current query on the "printing" edge.

func (*PrintingImageQuery) Select

func (piq *PrintingImageQuery) Select(fields ...string) *PrintingImageSelect

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

client.PrintingImage.Query().
	Select(printingimage.FieldURL).
	Scan(ctx, &v)

func (*PrintingImageQuery) Unique

func (piq *PrintingImageQuery) Unique(unique bool) *PrintingImageQuery

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

Where adds a new predicate for the PrintingImageQuery builder.

func (*PrintingImageQuery) WithPrinting

func (piq *PrintingImageQuery) WithPrinting(opts ...func(*PrintingQuery)) *PrintingImageQuery

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

type PrintingImageSelect

type PrintingImageSelect struct {
	*PrintingImageQuery
	// contains filtered or unexported fields
}

PrintingImageSelect is the builder for selecting fields of PrintingImage entities.

func (*PrintingImageSelect) Aggregate

func (pis *PrintingImageSelect) Aggregate(fns ...AggregateFunc) *PrintingImageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PrintingImageSelect) Bool

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

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

func (*PrintingImageSelect) BoolX

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

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

func (*PrintingImageSelect) Bools

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

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

func (*PrintingImageSelect) BoolsX

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

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

func (*PrintingImageSelect) Float64

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

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

func (*PrintingImageSelect) Float64X

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

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

func (*PrintingImageSelect) Float64s

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

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

func (*PrintingImageSelect) Float64sX

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

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

func (*PrintingImageSelect) Int

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

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

func (*PrintingImageSelect) IntX

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

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

func (*PrintingImageSelect) Ints

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

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

func (*PrintingImageSelect) IntsX

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

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

func (*PrintingImageSelect) Scan

func (pis *PrintingImageSelect) Scan(ctx context.Context, v any) error

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

func (*PrintingImageSelect) ScanX

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

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

func (*PrintingImageSelect) String

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

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

func (*PrintingImageSelect) StringX

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

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

func (*PrintingImageSelect) Strings

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

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

func (*PrintingImageSelect) StringsX

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

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

type PrintingImageUpdate

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

PrintingImageUpdate is the builder for updating PrintingImage entities.

func (*PrintingImageUpdate) ClearPrinting

func (piu *PrintingImageUpdate) ClearPrinting() *PrintingImageUpdate

ClearPrinting clears the "printing" edge to the Printing entity.

func (*PrintingImageUpdate) Exec

func (piu *PrintingImageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PrintingImageUpdate) ExecX

func (piu *PrintingImageUpdate) ExecX(ctx context.Context)

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

func (*PrintingImageUpdate) Mutation

func (piu *PrintingImageUpdate) Mutation() *PrintingImageMutation

Mutation returns the PrintingImageMutation object of the builder.

func (*PrintingImageUpdate) Save

func (piu *PrintingImageUpdate) Save(ctx context.Context) (int, error)

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

func (*PrintingImageUpdate) SaveX

func (piu *PrintingImageUpdate) SaveX(ctx context.Context) int

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

func (*PrintingImageUpdate) SetNillablePrintingID

func (piu *PrintingImageUpdate) SetNillablePrintingID(id *int) *PrintingImageUpdate

SetNillablePrintingID sets the "printing" edge to the Printing entity by ID if the given value is not nil.

func (*PrintingImageUpdate) SetNillableURL

func (piu *PrintingImageUpdate) SetNillableURL(s *string) *PrintingImageUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*PrintingImageUpdate) SetPrinting

func (piu *PrintingImageUpdate) SetPrinting(p *Printing) *PrintingImageUpdate

SetPrinting sets the "printing" edge to the Printing entity.

func (*PrintingImageUpdate) SetPrintingID

func (piu *PrintingImageUpdate) SetPrintingID(id int) *PrintingImageUpdate

SetPrintingID sets the "printing" edge to the Printing entity by ID.

func (*PrintingImageUpdate) SetURL

SetURL sets the "url" field.

func (*PrintingImageUpdate) Where

Where appends a list predicates to the PrintingImageUpdate builder.

type PrintingImageUpdateOne

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

PrintingImageUpdateOne is the builder for updating a single PrintingImage entity.

func (*PrintingImageUpdateOne) ClearPrinting

func (piuo *PrintingImageUpdateOne) ClearPrinting() *PrintingImageUpdateOne

ClearPrinting clears the "printing" edge to the Printing entity.

func (*PrintingImageUpdateOne) Exec

func (piuo *PrintingImageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PrintingImageUpdateOne) ExecX

func (piuo *PrintingImageUpdateOne) ExecX(ctx context.Context)

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

func (*PrintingImageUpdateOne) Mutation

Mutation returns the PrintingImageMutation object of the builder.

func (*PrintingImageUpdateOne) Save

Save executes the query and returns the updated PrintingImage entity.

func (*PrintingImageUpdateOne) SaveX

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

func (*PrintingImageUpdateOne) Select

func (piuo *PrintingImageUpdateOne) Select(field string, fields ...string) *PrintingImageUpdateOne

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

func (*PrintingImageUpdateOne) SetNillablePrintingID

func (piuo *PrintingImageUpdateOne) SetNillablePrintingID(id *int) *PrintingImageUpdateOne

SetNillablePrintingID sets the "printing" edge to the Printing entity by ID if the given value is not nil.

func (*PrintingImageUpdateOne) SetNillableURL

func (piuo *PrintingImageUpdateOne) SetNillableURL(s *string) *PrintingImageUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*PrintingImageUpdateOne) SetPrinting

SetPrinting sets the "printing" edge to the Printing entity.

func (*PrintingImageUpdateOne) SetPrintingID

func (piuo *PrintingImageUpdateOne) SetPrintingID(id int) *PrintingImageUpdateOne

SetPrintingID sets the "printing" edge to the Printing entity by ID.

func (*PrintingImageUpdateOne) SetURL

SetURL sets the "url" field.

func (*PrintingImageUpdateOne) Where

Where appends a list predicates to the PrintingImageUpdate builder.

type PrintingImages

type PrintingImages []*PrintingImage

PrintingImages is a parsable slice of PrintingImage.

type PrintingMutation

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

PrintingMutation represents an operation that mutates the Printing nodes in the graph.

func (*PrintingMutation) AddField

func (m *PrintingMutation) 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 (*PrintingMutation) AddImageIDs

func (m *PrintingMutation) AddImageIDs(ids ...int)

AddImageIDs adds the "images" edge to the PrintingImage entity by ids.

func (*PrintingMutation) AddedEdges

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

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

func (*PrintingMutation) AddedField

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

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

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

func (*PrintingMutation) AddedIDs

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

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

func (*PrintingMutation) ArtistCleared

func (m *PrintingMutation) ArtistCleared() bool

ArtistCleared reports if the "artist" edge to the Artist entity was cleared.

func (*PrintingMutation) ArtistID

func (m *PrintingMutation) ArtistID() (id int, exists bool)

ArtistID returns the "artist" edge ID in the mutation.

func (*PrintingMutation) ArtistIDs

func (m *PrintingMutation) ArtistIDs() (ids []int)

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

func (*PrintingMutation) CardFaceCleared

func (m *PrintingMutation) CardFaceCleared() bool

CardFaceCleared reports if the "card_face" edge to the CardFace entity was cleared.

func (*PrintingMutation) CardFaceID

func (m *PrintingMutation) CardFaceID() (id int, exists bool)

CardFaceID returns the "card_face" edge ID in the mutation.

func (*PrintingMutation) CardFaceIDs

func (m *PrintingMutation) CardFaceIDs() (ids []int)

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

func (*PrintingMutation) ClearArtist

func (m *PrintingMutation) ClearArtist()

ClearArtist clears the "artist" edge to the Artist entity.

func (*PrintingMutation) ClearCardFace

func (m *PrintingMutation) ClearCardFace()

ClearCardFace clears the "card_face" edge to the CardFace entity.

func (*PrintingMutation) ClearEdge

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

func (m *PrintingMutation) 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 (*PrintingMutation) ClearImages

func (m *PrintingMutation) ClearImages()

ClearImages clears the "images" edge to the PrintingImage entity.

func (*PrintingMutation) ClearSet

func (m *PrintingMutation) ClearSet()

ClearSet clears the "set" edge to the Set entity.

func (*PrintingMutation) ClearedEdges

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

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

func (*PrintingMutation) ClearedFields

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

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

func (PrintingMutation) Client

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

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

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

func (*PrintingMutation) Field

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

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

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

func (*PrintingMutation) Fields

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

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

func (m *PrintingMutation) 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 (*PrintingMutation) ImagesCleared

func (m *PrintingMutation) ImagesCleared() bool

ImagesCleared reports if the "images" edge to the PrintingImage entity was cleared.

func (*PrintingMutation) ImagesIDs

func (m *PrintingMutation) ImagesIDs() (ids []int)

ImagesIDs returns the "images" edge IDs in the mutation.

func (*PrintingMutation) OldField

func (m *PrintingMutation) 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 (*PrintingMutation) OldRarity

func (m *PrintingMutation) OldRarity(ctx context.Context) (v printing.Rarity, err error)

OldRarity returns the old "rarity" field's value of the Printing entity. If the Printing 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 (*PrintingMutation) Op

func (m *PrintingMutation) Op() Op

Op returns the operation name.

func (*PrintingMutation) Rarity

func (m *PrintingMutation) Rarity() (r printing.Rarity, exists bool)

Rarity returns the value of the "rarity" field in the mutation.

func (*PrintingMutation) RemoveImageIDs

func (m *PrintingMutation) RemoveImageIDs(ids ...int)

RemoveImageIDs removes the "images" edge to the PrintingImage entity by IDs.

func (*PrintingMutation) RemovedEdges

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

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

func (*PrintingMutation) RemovedIDs

func (m *PrintingMutation) 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 (*PrintingMutation) RemovedImagesIDs

func (m *PrintingMutation) RemovedImagesIDs() (ids []int)

RemovedImages returns the removed IDs of the "images" edge to the PrintingImage entity.

func (*PrintingMutation) ResetArtist

func (m *PrintingMutation) ResetArtist()

ResetArtist resets all changes to the "artist" edge.

func (*PrintingMutation) ResetCardFace

func (m *PrintingMutation) ResetCardFace()

ResetCardFace resets all changes to the "card_face" edge.

func (*PrintingMutation) ResetEdge

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

func (m *PrintingMutation) 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 (*PrintingMutation) ResetImages

func (m *PrintingMutation) ResetImages()

ResetImages resets all changes to the "images" edge.

func (*PrintingMutation) ResetRarity

func (m *PrintingMutation) ResetRarity()

ResetRarity resets all changes to the "rarity" field.

func (*PrintingMutation) ResetSet

func (m *PrintingMutation) ResetSet()

ResetSet resets all changes to the "set" edge.

func (*PrintingMutation) SetArtistID

func (m *PrintingMutation) SetArtistID(id int)

SetArtistID sets the "artist" edge to the Artist entity by id.

func (*PrintingMutation) SetCardFaceID

func (m *PrintingMutation) SetCardFaceID(id int)

SetCardFaceID sets the "card_face" edge to the CardFace entity by id.

func (*PrintingMutation) SetCleared

func (m *PrintingMutation) SetCleared() bool

SetCleared reports if the "set" edge to the Set entity was cleared.

func (*PrintingMutation) SetField

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

func (m *PrintingMutation) SetID() (id int, exists bool)

SetID returns the "set" edge ID in the mutation.

func (*PrintingMutation) SetIDs

func (m *PrintingMutation) SetIDs() (ids []int)

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

func (*PrintingMutation) SetOp

func (m *PrintingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PrintingMutation) SetRarity

func (m *PrintingMutation) SetRarity(pr printing.Rarity)

SetRarity sets the "rarity" field.

func (*PrintingMutation) SetSetID

func (m *PrintingMutation) SetSetID(id int)

SetSetID sets the "set" edge to the Set entity by id.

func (PrintingMutation) Tx

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

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

func (*PrintingMutation) Type

func (m *PrintingMutation) Type() string

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

func (*PrintingMutation) Where

func (m *PrintingMutation) Where(ps ...predicate.Printing)

Where appends a list predicates to the PrintingMutation builder.

func (*PrintingMutation) WhereP

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

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

type PrintingQuery

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

PrintingQuery is the builder for querying Printing entities.

func (*PrintingQuery) Aggregate

func (pq *PrintingQuery) Aggregate(fns ...AggregateFunc) *PrintingSelect

Aggregate returns a PrintingSelect configured with the given aggregations.

func (*PrintingQuery) All

func (pq *PrintingQuery) All(ctx context.Context) ([]*Printing, error)

All executes the query and returns a list of Printings.

func (*PrintingQuery) AllX

func (pq *PrintingQuery) AllX(ctx context.Context) []*Printing

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

func (*PrintingQuery) Clone

func (pq *PrintingQuery) Clone() *PrintingQuery

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

func (*PrintingQuery) Count

func (pq *PrintingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PrintingQuery) CountX

func (pq *PrintingQuery) CountX(ctx context.Context) int

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

func (*PrintingQuery) Exist

func (pq *PrintingQuery) Exist(ctx context.Context) (bool, error)

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

func (*PrintingQuery) ExistX

func (pq *PrintingQuery) ExistX(ctx context.Context) bool

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

func (*PrintingQuery) First

func (pq *PrintingQuery) First(ctx context.Context) (*Printing, error)

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

func (*PrintingQuery) FirstID

func (pq *PrintingQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PrintingQuery) FirstIDX

func (pq *PrintingQuery) FirstIDX(ctx context.Context) int

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

func (*PrintingQuery) FirstX

func (pq *PrintingQuery) FirstX(ctx context.Context) *Printing

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

func (*PrintingQuery) GroupBy

func (pq *PrintingQuery) GroupBy(field string, fields ...string) *PrintingGroupBy

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 {
	Rarity printing.Rarity `json:"rarity,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Printing.Query().
	GroupBy(printing.FieldRarity).
	Aggregate(oracle.Count()).
	Scan(ctx, &v)

func (*PrintingQuery) IDs

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

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

func (*PrintingQuery) IDsX

func (pq *PrintingQuery) IDsX(ctx context.Context) []int

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

func (*PrintingQuery) Limit

func (pq *PrintingQuery) Limit(limit int) *PrintingQuery

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

func (*PrintingQuery) Offset

func (pq *PrintingQuery) Offset(offset int) *PrintingQuery

Offset to start from.

func (*PrintingQuery) Only

func (pq *PrintingQuery) Only(ctx context.Context) (*Printing, error)

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

func (*PrintingQuery) OnlyID

func (pq *PrintingQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PrintingQuery) OnlyIDX

func (pq *PrintingQuery) OnlyIDX(ctx context.Context) int

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

func (*PrintingQuery) OnlyX

func (pq *PrintingQuery) OnlyX(ctx context.Context) *Printing

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

func (*PrintingQuery) Order

Order specifies how the records should be ordered.

func (*PrintingQuery) QueryArtist

func (pq *PrintingQuery) QueryArtist() *ArtistQuery

QueryArtist chains the current query on the "artist" edge.

func (*PrintingQuery) QueryCardFace

func (pq *PrintingQuery) QueryCardFace() *CardFaceQuery

QueryCardFace chains the current query on the "card_face" edge.

func (*PrintingQuery) QueryImages

func (pq *PrintingQuery) QueryImages() *PrintingImageQuery

QueryImages chains the current query on the "images" edge.

func (*PrintingQuery) QuerySet

func (pq *PrintingQuery) QuerySet() *SetQuery

QuerySet chains the current query on the "set" edge.

func (*PrintingQuery) Select

func (pq *PrintingQuery) Select(fields ...string) *PrintingSelect

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 {
	Rarity printing.Rarity `json:"rarity,omitempty"`
}

client.Printing.Query().
	Select(printing.FieldRarity).
	Scan(ctx, &v)

func (*PrintingQuery) Unique

func (pq *PrintingQuery) Unique(unique bool) *PrintingQuery

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

func (pq *PrintingQuery) Where(ps ...predicate.Printing) *PrintingQuery

Where adds a new predicate for the PrintingQuery builder.

func (*PrintingQuery) WithArtist

func (pq *PrintingQuery) WithArtist(opts ...func(*ArtistQuery)) *PrintingQuery

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

func (*PrintingQuery) WithCardFace

func (pq *PrintingQuery) WithCardFace(opts ...func(*CardFaceQuery)) *PrintingQuery

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

func (*PrintingQuery) WithImages

func (pq *PrintingQuery) WithImages(opts ...func(*PrintingImageQuery)) *PrintingQuery

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

func (*PrintingQuery) WithSet

func (pq *PrintingQuery) WithSet(opts ...func(*SetQuery)) *PrintingQuery

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

type PrintingSelect

type PrintingSelect struct {
	*PrintingQuery
	// contains filtered or unexported fields
}

PrintingSelect is the builder for selecting fields of Printing entities.

func (*PrintingSelect) Aggregate

func (ps *PrintingSelect) Aggregate(fns ...AggregateFunc) *PrintingSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PrintingSelect) Bool

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

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

func (*PrintingSelect) BoolX

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

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

func (*PrintingSelect) Bools

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

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

func (*PrintingSelect) BoolsX

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

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

func (*PrintingSelect) Float64

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

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

func (*PrintingSelect) Float64X

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

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

func (*PrintingSelect) Float64s

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

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

func (*PrintingSelect) Float64sX

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

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

func (*PrintingSelect) Int

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

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

func (*PrintingSelect) IntX

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

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

func (*PrintingSelect) Ints

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

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

func (*PrintingSelect) IntsX

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

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

func (*PrintingSelect) Scan

func (ps *PrintingSelect) Scan(ctx context.Context, v any) error

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

func (*PrintingSelect) ScanX

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

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

func (*PrintingSelect) String

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

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

func (*PrintingSelect) StringX

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

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

func (*PrintingSelect) Strings

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

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

func (*PrintingSelect) StringsX

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

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

type PrintingUpdate

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

PrintingUpdate is the builder for updating Printing entities.

func (*PrintingUpdate) AddImageIDs

func (pu *PrintingUpdate) AddImageIDs(ids ...int) *PrintingUpdate

AddImageIDs adds the "images" edge to the PrintingImage entity by IDs.

func (*PrintingUpdate) AddImages

func (pu *PrintingUpdate) AddImages(p ...*PrintingImage) *PrintingUpdate

AddImages adds the "images" edges to the PrintingImage entity.

func (*PrintingUpdate) ClearArtist

func (pu *PrintingUpdate) ClearArtist() *PrintingUpdate

ClearArtist clears the "artist" edge to the Artist entity.

func (*PrintingUpdate) ClearCardFace

func (pu *PrintingUpdate) ClearCardFace() *PrintingUpdate

ClearCardFace clears the "card_face" edge to the CardFace entity.

func (*PrintingUpdate) ClearImages

func (pu *PrintingUpdate) ClearImages() *PrintingUpdate

ClearImages clears all "images" edges to the PrintingImage entity.

func (*PrintingUpdate) ClearSet

func (pu *PrintingUpdate) ClearSet() *PrintingUpdate

ClearSet clears the "set" edge to the Set entity.

func (*PrintingUpdate) Exec

func (pu *PrintingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PrintingUpdate) ExecX

func (pu *PrintingUpdate) ExecX(ctx context.Context)

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

func (*PrintingUpdate) Mutation

func (pu *PrintingUpdate) Mutation() *PrintingMutation

Mutation returns the PrintingMutation object of the builder.

func (*PrintingUpdate) RemoveImageIDs

func (pu *PrintingUpdate) RemoveImageIDs(ids ...int) *PrintingUpdate

RemoveImageIDs removes the "images" edge to PrintingImage entities by IDs.

func (*PrintingUpdate) RemoveImages

func (pu *PrintingUpdate) RemoveImages(p ...*PrintingImage) *PrintingUpdate

RemoveImages removes "images" edges to PrintingImage entities.

func (*PrintingUpdate) Save

func (pu *PrintingUpdate) Save(ctx context.Context) (int, error)

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

func (*PrintingUpdate) SaveX

func (pu *PrintingUpdate) SaveX(ctx context.Context) int

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

func (*PrintingUpdate) SetArtist

func (pu *PrintingUpdate) SetArtist(a *Artist) *PrintingUpdate

SetArtist sets the "artist" edge to the Artist entity.

func (*PrintingUpdate) SetArtistID

func (pu *PrintingUpdate) SetArtistID(id int) *PrintingUpdate

SetArtistID sets the "artist" edge to the Artist entity by ID.

func (*PrintingUpdate) SetCardFace

func (pu *PrintingUpdate) SetCardFace(c *CardFace) *PrintingUpdate

SetCardFace sets the "card_face" edge to the CardFace entity.

func (*PrintingUpdate) SetCardFaceID

func (pu *PrintingUpdate) SetCardFaceID(id int) *PrintingUpdate

SetCardFaceID sets the "card_face" edge to the CardFace entity by ID.

func (*PrintingUpdate) SetNillableArtistID

func (pu *PrintingUpdate) SetNillableArtistID(id *int) *PrintingUpdate

SetNillableArtistID sets the "artist" edge to the Artist entity by ID if the given value is not nil.

func (*PrintingUpdate) SetNillableCardFaceID

func (pu *PrintingUpdate) SetNillableCardFaceID(id *int) *PrintingUpdate

SetNillableCardFaceID sets the "card_face" edge to the CardFace entity by ID if the given value is not nil.

func (*PrintingUpdate) SetNillableRarity

func (pu *PrintingUpdate) SetNillableRarity(pr *printing.Rarity) *PrintingUpdate

SetNillableRarity sets the "rarity" field if the given value is not nil.

func (*PrintingUpdate) SetNillableSetID

func (pu *PrintingUpdate) SetNillableSetID(id *int) *PrintingUpdate

SetNillableSetID sets the "set" edge to the Set entity by ID if the given value is not nil.

func (*PrintingUpdate) SetRarity

func (pu *PrintingUpdate) SetRarity(pr printing.Rarity) *PrintingUpdate

SetRarity sets the "rarity" field.

func (*PrintingUpdate) SetSet

func (pu *PrintingUpdate) SetSet(s *Set) *PrintingUpdate

SetSet sets the "set" edge to the Set entity.

func (*PrintingUpdate) SetSetID

func (pu *PrintingUpdate) SetSetID(id int) *PrintingUpdate

SetSetID sets the "set" edge to the Set entity by ID.

func (*PrintingUpdate) Where

func (pu *PrintingUpdate) Where(ps ...predicate.Printing) *PrintingUpdate

Where appends a list predicates to the PrintingUpdate builder.

type PrintingUpdateOne

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

PrintingUpdateOne is the builder for updating a single Printing entity.

func (*PrintingUpdateOne) AddImageIDs

func (puo *PrintingUpdateOne) AddImageIDs(ids ...int) *PrintingUpdateOne

AddImageIDs adds the "images" edge to the PrintingImage entity by IDs.

func (*PrintingUpdateOne) AddImages

func (puo *PrintingUpdateOne) AddImages(p ...*PrintingImage) *PrintingUpdateOne

AddImages adds the "images" edges to the PrintingImage entity.

func (*PrintingUpdateOne) ClearArtist

func (puo *PrintingUpdateOne) ClearArtist() *PrintingUpdateOne

ClearArtist clears the "artist" edge to the Artist entity.

func (*PrintingUpdateOne) ClearCardFace

func (puo *PrintingUpdateOne) ClearCardFace() *PrintingUpdateOne

ClearCardFace clears the "card_face" edge to the CardFace entity.

func (*PrintingUpdateOne) ClearImages

func (puo *PrintingUpdateOne) ClearImages() *PrintingUpdateOne

ClearImages clears all "images" edges to the PrintingImage entity.

func (*PrintingUpdateOne) ClearSet

func (puo *PrintingUpdateOne) ClearSet() *PrintingUpdateOne

ClearSet clears the "set" edge to the Set entity.

func (*PrintingUpdateOne) Exec

func (puo *PrintingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PrintingUpdateOne) ExecX

func (puo *PrintingUpdateOne) ExecX(ctx context.Context)

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

func (*PrintingUpdateOne) Mutation

func (puo *PrintingUpdateOne) Mutation() *PrintingMutation

Mutation returns the PrintingMutation object of the builder.

func (*PrintingUpdateOne) RemoveImageIDs

func (puo *PrintingUpdateOne) RemoveImageIDs(ids ...int) *PrintingUpdateOne

RemoveImageIDs removes the "images" edge to PrintingImage entities by IDs.

func (*PrintingUpdateOne) RemoveImages

func (puo *PrintingUpdateOne) RemoveImages(p ...*PrintingImage) *PrintingUpdateOne

RemoveImages removes "images" edges to PrintingImage entities.

func (*PrintingUpdateOne) Save

func (puo *PrintingUpdateOne) Save(ctx context.Context) (*Printing, error)

Save executes the query and returns the updated Printing entity.

func (*PrintingUpdateOne) SaveX

func (puo *PrintingUpdateOne) SaveX(ctx context.Context) *Printing

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

func (*PrintingUpdateOne) Select

func (puo *PrintingUpdateOne) Select(field string, fields ...string) *PrintingUpdateOne

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

func (*PrintingUpdateOne) SetArtist

func (puo *PrintingUpdateOne) SetArtist(a *Artist) *PrintingUpdateOne

SetArtist sets the "artist" edge to the Artist entity.

func (*PrintingUpdateOne) SetArtistID

func (puo *PrintingUpdateOne) SetArtistID(id int) *PrintingUpdateOne

SetArtistID sets the "artist" edge to the Artist entity by ID.

func (*PrintingUpdateOne) SetCardFace

func (puo *PrintingUpdateOne) SetCardFace(c *CardFace) *PrintingUpdateOne

SetCardFace sets the "card_face" edge to the CardFace entity.

func (*PrintingUpdateOne) SetCardFaceID

func (puo *PrintingUpdateOne) SetCardFaceID(id int) *PrintingUpdateOne

SetCardFaceID sets the "card_face" edge to the CardFace entity by ID.

func (*PrintingUpdateOne) SetNillableArtistID

func (puo *PrintingUpdateOne) SetNillableArtistID(id *int) *PrintingUpdateOne

SetNillableArtistID sets the "artist" edge to the Artist entity by ID if the given value is not nil.

func (*PrintingUpdateOne) SetNillableCardFaceID

func (puo *PrintingUpdateOne) SetNillableCardFaceID(id *int) *PrintingUpdateOne

SetNillableCardFaceID sets the "card_face" edge to the CardFace entity by ID if the given value is not nil.

func (*PrintingUpdateOne) SetNillableRarity

func (puo *PrintingUpdateOne) SetNillableRarity(pr *printing.Rarity) *PrintingUpdateOne

SetNillableRarity sets the "rarity" field if the given value is not nil.

func (*PrintingUpdateOne) SetNillableSetID

func (puo *PrintingUpdateOne) SetNillableSetID(id *int) *PrintingUpdateOne

SetNillableSetID sets the "set" edge to the Set entity by ID if the given value is not nil.

func (*PrintingUpdateOne) SetRarity

func (puo *PrintingUpdateOne) SetRarity(pr printing.Rarity) *PrintingUpdateOne

SetRarity sets the "rarity" field.

func (*PrintingUpdateOne) SetSet

func (puo *PrintingUpdateOne) SetSet(s *Set) *PrintingUpdateOne

SetSet sets the "set" edge to the Set entity.

func (*PrintingUpdateOne) SetSetID

func (puo *PrintingUpdateOne) SetSetID(id int) *PrintingUpdateOne

SetSetID sets the "set" edge to the Set entity by ID.

func (*PrintingUpdateOne) Where

Where appends a list predicates to the PrintingUpdate builder.

type Printings

type Printings []*Printing

Printings is a parsable slice of Printing.

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Ruling

type Ruling struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RulingQuery when eager-loading is set.
	Edges RulingEdges `json:"edges"`
	// contains filtered or unexported fields
}

Ruling is the model entity for the Ruling schema.

func (*Ruling) QueryCard

func (r *Ruling) QueryCard() *CardQuery

QueryCard queries the "card" edge of the Ruling entity.

func (*Ruling) String

func (r *Ruling) String() string

String implements the fmt.Stringer.

func (*Ruling) Unwrap

func (r *Ruling) Unwrap() *Ruling

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

func (r *Ruling) Update() *RulingUpdateOne

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

func (*Ruling) Value

func (r *Ruling) Value(name string) (ent.Value, error)

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

type RulingClient

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

RulingClient is a client for the Ruling schema.

func NewRulingClient

func NewRulingClient(c config) *RulingClient

NewRulingClient returns a client for the Ruling from the given config.

func (*RulingClient) Create

func (c *RulingClient) Create() *RulingCreate

Create returns a builder for creating a Ruling entity.

func (*RulingClient) CreateBulk

func (c *RulingClient) CreateBulk(builders ...*RulingCreate) *RulingCreateBulk

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

func (*RulingClient) Delete

func (c *RulingClient) Delete() *RulingDelete

Delete returns a delete builder for Ruling.

func (*RulingClient) DeleteOne

func (c *RulingClient) DeleteOne(r *Ruling) *RulingDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RulingClient) DeleteOneID

func (c *RulingClient) DeleteOneID(id int) *RulingDeleteOne

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

func (*RulingClient) Get

func (c *RulingClient) Get(ctx context.Context, id int) (*Ruling, error)

Get returns a Ruling entity by its id.

func (*RulingClient) GetX

func (c *RulingClient) GetX(ctx context.Context, id int) *Ruling

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

func (*RulingClient) Hooks

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

Hooks returns the client hooks.

func (*RulingClient) Intercept

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

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

func (*RulingClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RulingClient) MapCreateBulk

func (c *RulingClient) MapCreateBulk(slice any, setFunc func(*RulingCreate, int)) *RulingCreateBulk

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

func (*RulingClient) Query

func (c *RulingClient) Query() *RulingQuery

Query returns a query builder for Ruling.

func (*RulingClient) QueryCard

func (c *RulingClient) QueryCard(r *Ruling) *CardQuery

QueryCard queries the card edge of a Ruling.

func (*RulingClient) Update

func (c *RulingClient) Update() *RulingUpdate

Update returns an update builder for Ruling.

func (*RulingClient) UpdateOne

func (c *RulingClient) UpdateOne(r *Ruling) *RulingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RulingClient) UpdateOneID

func (c *RulingClient) UpdateOneID(id int) *RulingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RulingClient) Use

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

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

type RulingCreate

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

RulingCreate is the builder for creating a Ruling entity.

func (*RulingCreate) Exec

func (rc *RulingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RulingCreate) ExecX

func (rc *RulingCreate) ExecX(ctx context.Context)

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

func (*RulingCreate) Mutation

func (rc *RulingCreate) Mutation() *RulingMutation

Mutation returns the RulingMutation object of the builder.

func (*RulingCreate) Save

func (rc *RulingCreate) Save(ctx context.Context) (*Ruling, error)

Save creates the Ruling in the database.

func (*RulingCreate) SaveX

func (rc *RulingCreate) SaveX(ctx context.Context) *Ruling

SaveX calls Save and panics if Save returns an error.

func (*RulingCreate) SetCard

func (rc *RulingCreate) SetCard(c *Card) *RulingCreate

SetCard sets the "card" edge to the Card entity.

func (*RulingCreate) SetCardID

func (rc *RulingCreate) SetCardID(id int) *RulingCreate

SetCardID sets the "card" edge to the Card entity by ID.

func (*RulingCreate) SetDate

func (rc *RulingCreate) SetDate(t time.Time) *RulingCreate

SetDate sets the "date" field.

func (*RulingCreate) SetNillableCardID

func (rc *RulingCreate) SetNillableCardID(id *int) *RulingCreate

SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.

func (*RulingCreate) SetText

func (rc *RulingCreate) SetText(s string) *RulingCreate

SetText sets the "text" field.

type RulingCreateBulk

type RulingCreateBulk struct {
	// contains filtered or unexported fields
}

RulingCreateBulk is the builder for creating many Ruling entities in bulk.

func (*RulingCreateBulk) Exec

func (rcb *RulingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RulingCreateBulk) ExecX

func (rcb *RulingCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RulingCreateBulk) Save

func (rcb *RulingCreateBulk) Save(ctx context.Context) ([]*Ruling, error)

Save creates the Ruling entities in the database.

func (*RulingCreateBulk) SaveX

func (rcb *RulingCreateBulk) SaveX(ctx context.Context) []*Ruling

SaveX is like Save, but panics if an error occurs.

type RulingDelete

type RulingDelete struct {
	// contains filtered or unexported fields
}

RulingDelete is the builder for deleting a Ruling entity.

func (*RulingDelete) Exec

func (rd *RulingDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RulingDelete) ExecX

func (rd *RulingDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RulingDelete) Where

func (rd *RulingDelete) Where(ps ...predicate.Ruling) *RulingDelete

Where appends a list predicates to the RulingDelete builder.

type RulingDeleteOne

type RulingDeleteOne struct {
	// contains filtered or unexported fields
}

RulingDeleteOne is the builder for deleting a single Ruling entity.

func (*RulingDeleteOne) Exec

func (rdo *RulingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RulingDeleteOne) ExecX

func (rdo *RulingDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RulingDeleteOne) Where

func (rdo *RulingDeleteOne) Where(ps ...predicate.Ruling) *RulingDeleteOne

Where appends a list predicates to the RulingDelete builder.

type RulingEdges

type RulingEdges struct {
	// Card holds the value of the card edge.
	Card *Card `json:"card,omitempty"`
	// contains filtered or unexported fields
}

RulingEdges holds the relations/edges for other nodes in the graph.

func (RulingEdges) CardOrErr

func (e RulingEdges) CardOrErr() (*Card, error)

CardOrErr returns the Card value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RulingGroupBy

type RulingGroupBy struct {
	// contains filtered or unexported fields
}

RulingGroupBy is the group-by builder for Ruling entities.

func (*RulingGroupBy) Aggregate

func (rgb *RulingGroupBy) Aggregate(fns ...AggregateFunc) *RulingGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RulingGroupBy) Bool

func (s *RulingGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) BoolX

func (s *RulingGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RulingGroupBy) Bools

func (s *RulingGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) BoolsX

func (s *RulingGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RulingGroupBy) Float64

func (s *RulingGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) Float64X

func (s *RulingGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RulingGroupBy) Float64s

func (s *RulingGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) Float64sX

func (s *RulingGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RulingGroupBy) Int

func (s *RulingGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) IntX

func (s *RulingGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RulingGroupBy) Ints

func (s *RulingGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) IntsX

func (s *RulingGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RulingGroupBy) Scan

func (rgb *RulingGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RulingGroupBy) ScanX

func (s *RulingGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RulingGroupBy) String

func (s *RulingGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) StringX

func (s *RulingGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RulingGroupBy) Strings

func (s *RulingGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RulingGroupBy) StringsX

func (s *RulingGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RulingMutation

type RulingMutation struct {
	// contains filtered or unexported fields
}

RulingMutation represents an operation that mutates the Ruling nodes in the graph.

func (*RulingMutation) AddField

func (m *RulingMutation) 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 (*RulingMutation) AddedEdges

func (m *RulingMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RulingMutation) AddedField

func (m *RulingMutation) 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 (*RulingMutation) AddedFields

func (m *RulingMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RulingMutation) AddedIDs

func (m *RulingMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RulingMutation) CardCleared

func (m *RulingMutation) CardCleared() bool

CardCleared reports if the "card" edge to the Card entity was cleared.

func (*RulingMutation) CardID

func (m *RulingMutation) CardID() (id int, exists bool)

CardID returns the "card" edge ID in the mutation.

func (*RulingMutation) CardIDs

func (m *RulingMutation) CardIDs() (ids []int)

CardIDs returns the "card" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CardID instead. It exists only for internal usage by the builders.

func (*RulingMutation) ClearCard

func (m *RulingMutation) ClearCard()

ClearCard clears the "card" edge to the Card entity.

func (*RulingMutation) ClearEdge

func (m *RulingMutation) 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 (*RulingMutation) ClearField

func (m *RulingMutation) 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 (*RulingMutation) ClearedEdges

func (m *RulingMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RulingMutation) ClearedFields

func (m *RulingMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RulingMutation) Client

func (m RulingMutation) 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 (*RulingMutation) Date

func (m *RulingMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*RulingMutation) EdgeCleared

func (m *RulingMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RulingMutation) Field

func (m *RulingMutation) 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 (*RulingMutation) FieldCleared

func (m *RulingMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RulingMutation) Fields

func (m *RulingMutation) 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 (*RulingMutation) ID

func (m *RulingMutation) 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 (*RulingMutation) IDs

func (m *RulingMutation) 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 (*RulingMutation) OldDate

func (m *RulingMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the Ruling entity. If the Ruling 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 (*RulingMutation) OldField

func (m *RulingMutation) 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 (*RulingMutation) OldText

func (m *RulingMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Ruling entity. If the Ruling 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 (*RulingMutation) Op

func (m *RulingMutation) Op() Op

Op returns the operation name.

func (*RulingMutation) RemovedEdges

func (m *RulingMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RulingMutation) RemovedIDs

func (m *RulingMutation) 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 (*RulingMutation) ResetCard

func (m *RulingMutation) ResetCard()

ResetCard resets all changes to the "card" edge.

func (*RulingMutation) ResetDate

func (m *RulingMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*RulingMutation) ResetEdge

func (m *RulingMutation) 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 (*RulingMutation) ResetField

func (m *RulingMutation) 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 (*RulingMutation) ResetText

func (m *RulingMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*RulingMutation) SetCardID

func (m *RulingMutation) SetCardID(id int)

SetCardID sets the "card" edge to the Card entity by id.

func (*RulingMutation) SetDate

func (m *RulingMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*RulingMutation) SetField

func (m *RulingMutation) 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 (*RulingMutation) SetOp

func (m *RulingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RulingMutation) SetText

func (m *RulingMutation) SetText(s string)

SetText sets the "text" field.

func (*RulingMutation) Text

func (m *RulingMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (RulingMutation) Tx

func (m RulingMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RulingMutation) Type

func (m *RulingMutation) Type() string

Type returns the node type of this mutation (Ruling).

func (*RulingMutation) Where

func (m *RulingMutation) Where(ps ...predicate.Ruling)

Where appends a list predicates to the RulingMutation builder.

func (*RulingMutation) WhereP

func (m *RulingMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RulingMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RulingQuery

type RulingQuery struct {
	// contains filtered or unexported fields
}

RulingQuery is the builder for querying Ruling entities.

func (*RulingQuery) Aggregate

func (rq *RulingQuery) Aggregate(fns ...AggregateFunc) *RulingSelect

Aggregate returns a RulingSelect configured with the given aggregations.

func (*RulingQuery) All

func (rq *RulingQuery) All(ctx context.Context) ([]*Ruling, error)

All executes the query and returns a list of Rulings.

func (*RulingQuery) AllX

func (rq *RulingQuery) AllX(ctx context.Context) []*Ruling

AllX is like All, but panics if an error occurs.

func (*RulingQuery) Clone

func (rq *RulingQuery) Clone() *RulingQuery

Clone returns a duplicate of the RulingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RulingQuery) Count

func (rq *RulingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RulingQuery) CountX

func (rq *RulingQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RulingQuery) Exist

func (rq *RulingQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RulingQuery) ExistX

func (rq *RulingQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RulingQuery) First

func (rq *RulingQuery) First(ctx context.Context) (*Ruling, error)

First returns the first Ruling entity from the query. Returns a *NotFoundError when no Ruling was found.

func (*RulingQuery) FirstID

func (rq *RulingQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Ruling ID from the query. Returns a *NotFoundError when no Ruling ID was found.

func (*RulingQuery) FirstIDX

func (rq *RulingQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RulingQuery) FirstX

func (rq *RulingQuery) FirstX(ctx context.Context) *Ruling

FirstX is like First, but panics if an error occurs.

func (*RulingQuery) GroupBy

func (rq *RulingQuery) GroupBy(field string, fields ...string) *RulingGroupBy

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 {
	Text string `json:"text,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Ruling.Query().
	GroupBy(ruling.FieldText).
	Aggregate(oracle.Count()).
	Scan(ctx, &v)

func (*RulingQuery) IDs

func (rq *RulingQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Ruling IDs.

func (*RulingQuery) IDsX

func (rq *RulingQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RulingQuery) Limit

func (rq *RulingQuery) Limit(limit int) *RulingQuery

Limit the number of records to be returned by this query.

func (*RulingQuery) Offset

func (rq *RulingQuery) Offset(offset int) *RulingQuery

Offset to start from.

func (*RulingQuery) Only

func (rq *RulingQuery) Only(ctx context.Context) (*Ruling, error)

Only returns a single Ruling entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Ruling entity is found. Returns a *NotFoundError when no Ruling entities are found.

func (*RulingQuery) OnlyID

func (rq *RulingQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Ruling ID in the query. Returns a *NotSingularError when more than one Ruling ID is found. Returns a *NotFoundError when no entities are found.

func (*RulingQuery) OnlyIDX

func (rq *RulingQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RulingQuery) OnlyX

func (rq *RulingQuery) OnlyX(ctx context.Context) *Ruling

OnlyX is like Only, but panics if an error occurs.

func (*RulingQuery) Order

func (rq *RulingQuery) Order(o ...ruling.OrderOption) *RulingQuery

Order specifies how the records should be ordered.

func (*RulingQuery) QueryCard

func (rq *RulingQuery) QueryCard() *CardQuery

QueryCard chains the current query on the "card" edge.

func (*RulingQuery) Select

func (rq *RulingQuery) Select(fields ...string) *RulingSelect

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 {
	Text string `json:"text,omitempty"`
}

client.Ruling.Query().
	Select(ruling.FieldText).
	Scan(ctx, &v)

func (*RulingQuery) Unique

func (rq *RulingQuery) Unique(unique bool) *RulingQuery

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 (*RulingQuery) Where

func (rq *RulingQuery) Where(ps ...predicate.Ruling) *RulingQuery

Where adds a new predicate for the RulingQuery builder.

func (*RulingQuery) WithCard

func (rq *RulingQuery) WithCard(opts ...func(*CardQuery)) *RulingQuery

WithCard tells the query-builder to eager-load the nodes that are connected to the "card" edge. The optional arguments are used to configure the query builder of the edge.

type RulingSelect

type RulingSelect struct {
	*RulingQuery
	// contains filtered or unexported fields
}

RulingSelect is the builder for selecting fields of Ruling entities.

func (*RulingSelect) Aggregate

func (rs *RulingSelect) Aggregate(fns ...AggregateFunc) *RulingSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RulingSelect) Bool

func (s *RulingSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RulingSelect) BoolX

func (s *RulingSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RulingSelect) Bools

func (s *RulingSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RulingSelect) BoolsX

func (s *RulingSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RulingSelect) Float64

func (s *RulingSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RulingSelect) Float64X

func (s *RulingSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RulingSelect) Float64s

func (s *RulingSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RulingSelect) Float64sX

func (s *RulingSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RulingSelect) Int

func (s *RulingSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RulingSelect) IntX

func (s *RulingSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RulingSelect) Ints

func (s *RulingSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RulingSelect) IntsX

func (s *RulingSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RulingSelect) Scan

func (rs *RulingSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RulingSelect) ScanX

func (s *RulingSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RulingSelect) String

func (s *RulingSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RulingSelect) StringX

func (s *RulingSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RulingSelect) Strings

func (s *RulingSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RulingSelect) StringsX

func (s *RulingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RulingUpdate

type RulingUpdate struct {
	// contains filtered or unexported fields
}

RulingUpdate is the builder for updating Ruling entities.

func (*RulingUpdate) ClearCard

func (ru *RulingUpdate) ClearCard() *RulingUpdate

ClearCard clears the "card" edge to the Card entity.

func (*RulingUpdate) Exec

func (ru *RulingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RulingUpdate) ExecX

func (ru *RulingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RulingUpdate) Mutation

func (ru *RulingUpdate) Mutation() *RulingMutation

Mutation returns the RulingMutation object of the builder.

func (*RulingUpdate) Save

func (ru *RulingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RulingUpdate) SaveX

func (ru *RulingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RulingUpdate) SetCard

func (ru *RulingUpdate) SetCard(c *Card) *RulingUpdate

SetCard sets the "card" edge to the Card entity.

func (*RulingUpdate) SetCardID

func (ru *RulingUpdate) SetCardID(id int) *RulingUpdate

SetCardID sets the "card" edge to the Card entity by ID.

func (*RulingUpdate) SetDate

func (ru *RulingUpdate) SetDate(t time.Time) *RulingUpdate

SetDate sets the "date" field.

func (*RulingUpdate) SetNillableCardID

func (ru *RulingUpdate) SetNillableCardID(id *int) *RulingUpdate

SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.

func (*RulingUpdate) SetNillableDate

func (ru *RulingUpdate) SetNillableDate(t *time.Time) *RulingUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*RulingUpdate) SetNillableText

func (ru *RulingUpdate) SetNillableText(s *string) *RulingUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*RulingUpdate) SetText

func (ru *RulingUpdate) SetText(s string) *RulingUpdate

SetText sets the "text" field.

func (*RulingUpdate) Where

func (ru *RulingUpdate) Where(ps ...predicate.Ruling) *RulingUpdate

Where appends a list predicates to the RulingUpdate builder.

type RulingUpdateOne

type RulingUpdateOne struct {
	// contains filtered or unexported fields
}

RulingUpdateOne is the builder for updating a single Ruling entity.

func (*RulingUpdateOne) ClearCard

func (ruo *RulingUpdateOne) ClearCard() *RulingUpdateOne

ClearCard clears the "card" edge to the Card entity.

func (*RulingUpdateOne) Exec

func (ruo *RulingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RulingUpdateOne) ExecX

func (ruo *RulingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RulingUpdateOne) Mutation

func (ruo *RulingUpdateOne) Mutation() *RulingMutation

Mutation returns the RulingMutation object of the builder.

func (*RulingUpdateOne) Save

func (ruo *RulingUpdateOne) Save(ctx context.Context) (*Ruling, error)

Save executes the query and returns the updated Ruling entity.

func (*RulingUpdateOne) SaveX

func (ruo *RulingUpdateOne) SaveX(ctx context.Context) *Ruling

SaveX is like Save, but panics if an error occurs.

func (*RulingUpdateOne) Select

func (ruo *RulingUpdateOne) Select(field string, fields ...string) *RulingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RulingUpdateOne) SetCard

func (ruo *RulingUpdateOne) SetCard(c *Card) *RulingUpdateOne

SetCard sets the "card" edge to the Card entity.

func (*RulingUpdateOne) SetCardID

func (ruo *RulingUpdateOne) SetCardID(id int) *RulingUpdateOne

SetCardID sets the "card" edge to the Card entity by ID.

func (*RulingUpdateOne) SetDate

func (ruo *RulingUpdateOne) SetDate(t time.Time) *RulingUpdateOne

SetDate sets the "date" field.

func (*RulingUpdateOne) SetNillableCardID

func (ruo *RulingUpdateOne) SetNillableCardID(id *int) *RulingUpdateOne

SetNillableCardID sets the "card" edge to the Card entity by ID if the given value is not nil.

func (*RulingUpdateOne) SetNillableDate

func (ruo *RulingUpdateOne) SetNillableDate(t *time.Time) *RulingUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*RulingUpdateOne) SetNillableText

func (ruo *RulingUpdateOne) SetNillableText(s *string) *RulingUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*RulingUpdateOne) SetText

func (ruo *RulingUpdateOne) SetText(s string) *RulingUpdateOne

SetText sets the "text" field.

func (*RulingUpdateOne) Where

func (ruo *RulingUpdateOne) Where(ps ...predicate.Ruling) *RulingUpdateOne

Where appends a list predicates to the RulingUpdate builder.

type Rulings

type Rulings []*Ruling

Rulings is a parsable slice of Ruling.

type Set

type Set 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 SetQuery when eager-loading is set.
	Edges SetEdges `json:"edges"`
	// contains filtered or unexported fields
}

Set is the model entity for the Set schema.

func (*Set) QueryPrintings

func (s *Set) QueryPrintings() *PrintingQuery

QueryPrintings queries the "printings" edge of the Set entity.

func (*Set) String

func (s *Set) String() string

String implements the fmt.Stringer.

func (*Set) Unwrap

func (s *Set) Unwrap() *Set

Unwrap unwraps the Set 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 (*Set) Update

func (s *Set) Update() *SetUpdateOne

Update returns a builder for updating this Set. Note that you need to call Set.Unwrap() before calling this method if this Set was returned from a transaction, and the transaction was committed or rolled back.

func (*Set) Value

func (s *Set) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Set. This includes values selected through modifiers, order, etc.

type SetClient

type SetClient struct {
	// contains filtered or unexported fields
}

SetClient is a client for the Set schema.

func NewSetClient

func NewSetClient(c config) *SetClient

NewSetClient returns a client for the Set from the given config.

func (*SetClient) Create

func (c *SetClient) Create() *SetCreate

Create returns a builder for creating a Set entity.

func (*SetClient) CreateBulk

func (c *SetClient) CreateBulk(builders ...*SetCreate) *SetCreateBulk

CreateBulk returns a builder for creating a bulk of Set entities.

func (*SetClient) Delete

func (c *SetClient) Delete() *SetDelete

Delete returns a delete builder for Set.

func (*SetClient) DeleteOne

func (c *SetClient) DeleteOne(s *Set) *SetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SetClient) DeleteOneID

func (c *SetClient) DeleteOneID(id int) *SetDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SetClient) Get

func (c *SetClient) Get(ctx context.Context, id int) (*Set, error)

Get returns a Set entity by its id.

func (*SetClient) GetX

func (c *SetClient) GetX(ctx context.Context, id int) *Set

GetX is like Get, but panics if an error occurs.

func (*SetClient) Hooks

func (c *SetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SetClient) Intercept

func (c *SetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `set.Intercept(f(g(h())))`.

func (*SetClient) Interceptors

func (c *SetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SetClient) MapCreateBulk

func (c *SetClient) MapCreateBulk(slice any, setFunc func(*SetCreate, int)) *SetCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SetClient) Query

func (c *SetClient) Query() *SetQuery

Query returns a query builder for Set.

func (*SetClient) QueryPrintings

func (c *SetClient) QueryPrintings(s *Set) *PrintingQuery

QueryPrintings queries the printings edge of a Set.

func (*SetClient) Update

func (c *SetClient) Update() *SetUpdate

Update returns an update builder for Set.

func (*SetClient) UpdateOne

func (c *SetClient) UpdateOne(s *Set) *SetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SetClient) UpdateOneID

func (c *SetClient) UpdateOneID(id int) *SetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SetClient) Use

func (c *SetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `set.Hooks(f(g(h())))`.

type SetCreate

type SetCreate struct {
	// contains filtered or unexported fields
}

SetCreate is the builder for creating a Set entity.

func (*SetCreate) AddPrintingIDs

func (sc *SetCreate) AddPrintingIDs(ids ...int) *SetCreate

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*SetCreate) AddPrintings

func (sc *SetCreate) AddPrintings(p ...*Printing) *SetCreate

AddPrintings adds the "printings" edges to the Printing entity.

func (*SetCreate) Exec

func (sc *SetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetCreate) ExecX

func (sc *SetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetCreate) Mutation

func (sc *SetCreate) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetCreate) Save

func (sc *SetCreate) Save(ctx context.Context) (*Set, error)

Save creates the Set in the database.

func (*SetCreate) SaveX

func (sc *SetCreate) SaveX(ctx context.Context) *Set

SaveX calls Save and panics if Save returns an error.

func (*SetCreate) SetCode

func (sc *SetCreate) SetCode(s string) *SetCreate

SetCode sets the "code" field.

func (*SetCreate) SetName

func (sc *SetCreate) SetName(s string) *SetCreate

SetName sets the "name" field.

type SetCreateBulk

type SetCreateBulk struct {
	// contains filtered or unexported fields
}

SetCreateBulk is the builder for creating many Set entities in bulk.

func (*SetCreateBulk) Exec

func (scb *SetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SetCreateBulk) ExecX

func (scb *SetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetCreateBulk) Save

func (scb *SetCreateBulk) Save(ctx context.Context) ([]*Set, error)

Save creates the Set entities in the database.

func (*SetCreateBulk) SaveX

func (scb *SetCreateBulk) SaveX(ctx context.Context) []*Set

SaveX is like Save, but panics if an error occurs.

type SetDelete

type SetDelete struct {
	// contains filtered or unexported fields
}

SetDelete is the builder for deleting a Set entity.

func (*SetDelete) Exec

func (sd *SetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SetDelete) ExecX

func (sd *SetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SetDelete) Where

func (sd *SetDelete) Where(ps ...predicate.Set) *SetDelete

Where appends a list predicates to the SetDelete builder.

type SetDeleteOne

type SetDeleteOne struct {
	// contains filtered or unexported fields
}

SetDeleteOne is the builder for deleting a single Set entity.

func (*SetDeleteOne) Exec

func (sdo *SetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SetDeleteOne) ExecX

func (sdo *SetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetDeleteOne) Where

func (sdo *SetDeleteOne) Where(ps ...predicate.Set) *SetDeleteOne

Where appends a list predicates to the SetDelete builder.

type SetEdges

type SetEdges struct {
	// Printings holds the value of the printings edge.
	Printings []*Printing `json:"printings,omitempty"`
	// contains filtered or unexported fields
}

SetEdges holds the relations/edges for other nodes in the graph.

func (SetEdges) PrintingsOrErr

func (e SetEdges) PrintingsOrErr() ([]*Printing, error)

PrintingsOrErr returns the Printings value or an error if the edge was not loaded in eager-loading.

type SetGroupBy

type SetGroupBy struct {
	// contains filtered or unexported fields
}

SetGroupBy is the group-by builder for Set entities.

func (*SetGroupBy) Aggregate

func (sgb *SetGroupBy) Aggregate(fns ...AggregateFunc) *SetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SetGroupBy) Bool

func (s *SetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) BoolX

func (s *SetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetGroupBy) Bools

func (s *SetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) BoolsX

func (s *SetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SetGroupBy) Float64

func (s *SetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) Float64X

func (s *SetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetGroupBy) Float64s

func (s *SetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) Float64sX

func (s *SetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetGroupBy) Int

func (s *SetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) IntX

func (s *SetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetGroupBy) Ints

func (s *SetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) IntsX

func (s *SetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SetGroupBy) Scan

func (sgb *SetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetGroupBy) ScanX

func (s *SetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetGroupBy) String

func (s *SetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) StringX

func (s *SetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetGroupBy) Strings

func (s *SetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetGroupBy) StringsX

func (s *SetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetMutation

type SetMutation struct {
	// contains filtered or unexported fields
}

SetMutation represents an operation that mutates the Set nodes in the graph.

func (*SetMutation) AddField

func (m *SetMutation) 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 (*SetMutation) AddPrintingIDs

func (m *SetMutation) AddPrintingIDs(ids ...int)

AddPrintingIDs adds the "printings" edge to the Printing entity by ids.

func (*SetMutation) AddedEdges

func (m *SetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SetMutation) AddedField

func (m *SetMutation) 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 (*SetMutation) AddedFields

func (m *SetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SetMutation) AddedIDs

func (m *SetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SetMutation) ClearEdge

func (m *SetMutation) 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 (*SetMutation) ClearField

func (m *SetMutation) 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 (*SetMutation) ClearPrintings

func (m *SetMutation) ClearPrintings()

ClearPrintings clears the "printings" edge to the Printing entity.

func (*SetMutation) ClearedEdges

func (m *SetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SetMutation) ClearedFields

func (m *SetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SetMutation) Client

func (m SetMutation) 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 (*SetMutation) Code

func (m *SetMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*SetMutation) EdgeCleared

func (m *SetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SetMutation) Field

func (m *SetMutation) 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 (*SetMutation) FieldCleared

func (m *SetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SetMutation) Fields

func (m *SetMutation) 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 (*SetMutation) ID

func (m *SetMutation) 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 (*SetMutation) IDs

func (m *SetMutation) 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 (*SetMutation) Name

func (m *SetMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SetMutation) OldCode

func (m *SetMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Set entity. If the Set 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 (*SetMutation) OldField

func (m *SetMutation) 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 (*SetMutation) OldName

func (m *SetMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Set entity. If the Set 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 (*SetMutation) Op

func (m *SetMutation) Op() Op

Op returns the operation name.

func (*SetMutation) PrintingsCleared

func (m *SetMutation) PrintingsCleared() bool

PrintingsCleared reports if the "printings" edge to the Printing entity was cleared.

func (*SetMutation) PrintingsIDs

func (m *SetMutation) PrintingsIDs() (ids []int)

PrintingsIDs returns the "printings" edge IDs in the mutation.

func (*SetMutation) RemovePrintingIDs

func (m *SetMutation) RemovePrintingIDs(ids ...int)

RemovePrintingIDs removes the "printings" edge to the Printing entity by IDs.

func (*SetMutation) RemovedEdges

func (m *SetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SetMutation) RemovedIDs

func (m *SetMutation) 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 (*SetMutation) RemovedPrintingsIDs

func (m *SetMutation) RemovedPrintingsIDs() (ids []int)

RemovedPrintings returns the removed IDs of the "printings" edge to the Printing entity.

func (*SetMutation) ResetCode

func (m *SetMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*SetMutation) ResetEdge

func (m *SetMutation) 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 (*SetMutation) ResetField

func (m *SetMutation) 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 (*SetMutation) ResetName

func (m *SetMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SetMutation) ResetPrintings

func (m *SetMutation) ResetPrintings()

ResetPrintings resets all changes to the "printings" edge.

func (*SetMutation) SetCode

func (m *SetMutation) SetCode(s string)

SetCode sets the "code" field.

func (*SetMutation) SetField

func (m *SetMutation) 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 (*SetMutation) SetName

func (m *SetMutation) SetName(s string)

SetName sets the "name" field.

func (*SetMutation) SetOp

func (m *SetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (SetMutation) Tx

func (m SetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SetMutation) Type

func (m *SetMutation) Type() string

Type returns the node type of this mutation (Set).

func (*SetMutation) Where

func (m *SetMutation) Where(ps ...predicate.Set)

Where appends a list predicates to the SetMutation builder.

func (*SetMutation) WhereP

func (m *SetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SetQuery

type SetQuery struct {
	// contains filtered or unexported fields
}

SetQuery is the builder for querying Set entities.

func (*SetQuery) Aggregate

func (sq *SetQuery) Aggregate(fns ...AggregateFunc) *SetSelect

Aggregate returns a SetSelect configured with the given aggregations.

func (*SetQuery) All

func (sq *SetQuery) All(ctx context.Context) ([]*Set, error)

All executes the query and returns a list of Sets.

func (*SetQuery) AllX

func (sq *SetQuery) AllX(ctx context.Context) []*Set

AllX is like All, but panics if an error occurs.

func (*SetQuery) Clone

func (sq *SetQuery) Clone() *SetQuery

Clone returns a duplicate of the SetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SetQuery) Count

func (sq *SetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SetQuery) CountX

func (sq *SetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SetQuery) Exist

func (sq *SetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SetQuery) ExistX

func (sq *SetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SetQuery) First

func (sq *SetQuery) First(ctx context.Context) (*Set, error)

First returns the first Set entity from the query. Returns a *NotFoundError when no Set was found.

func (*SetQuery) FirstID

func (sq *SetQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Set ID from the query. Returns a *NotFoundError when no Set ID was found.

func (*SetQuery) FirstIDX

func (sq *SetQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SetQuery) FirstX

func (sq *SetQuery) FirstX(ctx context.Context) *Set

FirstX is like First, but panics if an error occurs.

func (*SetQuery) GroupBy

func (sq *SetQuery) GroupBy(field string, fields ...string) *SetGroupBy

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.Set.Query().
	GroupBy(set.FieldName).
	Aggregate(oracle.Count()).
	Scan(ctx, &v)

func (*SetQuery) IDs

func (sq *SetQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Set IDs.

func (*SetQuery) IDsX

func (sq *SetQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SetQuery) Limit

func (sq *SetQuery) Limit(limit int) *SetQuery

Limit the number of records to be returned by this query.

func (*SetQuery) Offset

func (sq *SetQuery) Offset(offset int) *SetQuery

Offset to start from.

func (*SetQuery) Only

func (sq *SetQuery) Only(ctx context.Context) (*Set, error)

Only returns a single Set entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Set entity is found. Returns a *NotFoundError when no Set entities are found.

func (*SetQuery) OnlyID

func (sq *SetQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Set ID in the query. Returns a *NotSingularError when more than one Set ID is found. Returns a *NotFoundError when no entities are found.

func (*SetQuery) OnlyIDX

func (sq *SetQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SetQuery) OnlyX

func (sq *SetQuery) OnlyX(ctx context.Context) *Set

OnlyX is like Only, but panics if an error occurs.

func (*SetQuery) Order

func (sq *SetQuery) Order(o ...set.OrderOption) *SetQuery

Order specifies how the records should be ordered.

func (*SetQuery) QueryPrintings

func (sq *SetQuery) QueryPrintings() *PrintingQuery

QueryPrintings chains the current query on the "printings" edge.

func (*SetQuery) Select

func (sq *SetQuery) Select(fields ...string) *SetSelect

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.Set.Query().
	Select(set.FieldName).
	Scan(ctx, &v)

func (*SetQuery) Unique

func (sq *SetQuery) Unique(unique bool) *SetQuery

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 (*SetQuery) Where

func (sq *SetQuery) Where(ps ...predicate.Set) *SetQuery

Where adds a new predicate for the SetQuery builder.

func (*SetQuery) WithPrintings

func (sq *SetQuery) WithPrintings(opts ...func(*PrintingQuery)) *SetQuery

WithPrintings tells the query-builder to eager-load the nodes that are connected to the "printings" edge. The optional arguments are used to configure the query builder of the edge.

type SetSelect

type SetSelect struct {
	*SetQuery
	// contains filtered or unexported fields
}

SetSelect is the builder for selecting fields of Set entities.

func (*SetSelect) Aggregate

func (ss *SetSelect) Aggregate(fns ...AggregateFunc) *SetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SetSelect) Bool

func (s *SetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetSelect) BoolX

func (s *SetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetSelect) Bools

func (s *SetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetSelect) BoolsX

func (s *SetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SetSelect) Float64

func (s *SetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetSelect) Float64X

func (s *SetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetSelect) Float64s

func (s *SetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetSelect) Float64sX

func (s *SetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetSelect) Int

func (s *SetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetSelect) IntX

func (s *SetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetSelect) Ints

func (s *SetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetSelect) IntsX

func (s *SetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SetSelect) Scan

func (ss *SetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetSelect) ScanX

func (s *SetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetSelect) String

func (s *SetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetSelect) StringX

func (s *SetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetSelect) Strings

func (s *SetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetSelect) StringsX

func (s *SetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetUpdate

type SetUpdate struct {
	// contains filtered or unexported fields
}

SetUpdate is the builder for updating Set entities.

func (*SetUpdate) AddPrintingIDs

func (su *SetUpdate) AddPrintingIDs(ids ...int) *SetUpdate

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*SetUpdate) AddPrintings

func (su *SetUpdate) AddPrintings(p ...*Printing) *SetUpdate

AddPrintings adds the "printings" edges to the Printing entity.

func (*SetUpdate) ClearPrintings

func (su *SetUpdate) ClearPrintings() *SetUpdate

ClearPrintings clears all "printings" edges to the Printing entity.

func (*SetUpdate) Exec

func (su *SetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetUpdate) ExecX

func (su *SetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetUpdate) Mutation

func (su *SetUpdate) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetUpdate) RemovePrintingIDs

func (su *SetUpdate) RemovePrintingIDs(ids ...int) *SetUpdate

RemovePrintingIDs removes the "printings" edge to Printing entities by IDs.

func (*SetUpdate) RemovePrintings

func (su *SetUpdate) RemovePrintings(p ...*Printing) *SetUpdate

RemovePrintings removes "printings" edges to Printing entities.

func (*SetUpdate) Save

func (su *SetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SetUpdate) SaveX

func (su *SetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SetUpdate) SetCode

func (su *SetUpdate) SetCode(s string) *SetUpdate

SetCode sets the "code" field.

func (*SetUpdate) SetName

func (su *SetUpdate) SetName(s string) *SetUpdate

SetName sets the "name" field.

func (*SetUpdate) SetNillableCode

func (su *SetUpdate) SetNillableCode(s *string) *SetUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (*SetUpdate) SetNillableName

func (su *SetUpdate) SetNillableName(s *string) *SetUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SetUpdate) Where

func (su *SetUpdate) Where(ps ...predicate.Set) *SetUpdate

Where appends a list predicates to the SetUpdate builder.

type SetUpdateOne

type SetUpdateOne struct {
	// contains filtered or unexported fields
}

SetUpdateOne is the builder for updating a single Set entity.

func (*SetUpdateOne) AddPrintingIDs

func (suo *SetUpdateOne) AddPrintingIDs(ids ...int) *SetUpdateOne

AddPrintingIDs adds the "printings" edge to the Printing entity by IDs.

func (*SetUpdateOne) AddPrintings

func (suo *SetUpdateOne) AddPrintings(p ...*Printing) *SetUpdateOne

AddPrintings adds the "printings" edges to the Printing entity.

func (*SetUpdateOne) ClearPrintings

func (suo *SetUpdateOne) ClearPrintings() *SetUpdateOne

ClearPrintings clears all "printings" edges to the Printing entity.

func (*SetUpdateOne) Exec

func (suo *SetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SetUpdateOne) ExecX

func (suo *SetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetUpdateOne) Mutation

func (suo *SetUpdateOne) Mutation() *SetMutation

Mutation returns the SetMutation object of the builder.

func (*SetUpdateOne) RemovePrintingIDs

func (suo *SetUpdateOne) RemovePrintingIDs(ids ...int) *SetUpdateOne

RemovePrintingIDs removes the "printings" edge to Printing entities by IDs.

func (*SetUpdateOne) RemovePrintings

func (suo *SetUpdateOne) RemovePrintings(p ...*Printing) *SetUpdateOne

RemovePrintings removes "printings" edges to Printing entities.

func (*SetUpdateOne) Save

func (suo *SetUpdateOne) Save(ctx context.Context) (*Set, error)

Save executes the query and returns the updated Set entity.

func (*SetUpdateOne) SaveX

func (suo *SetUpdateOne) SaveX(ctx context.Context) *Set

SaveX is like Save, but panics if an error occurs.

func (*SetUpdateOne) Select

func (suo *SetUpdateOne) Select(field string, fields ...string) *SetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SetUpdateOne) SetCode

func (suo *SetUpdateOne) SetCode(s string) *SetUpdateOne

SetCode sets the "code" field.

func (*SetUpdateOne) SetName

func (suo *SetUpdateOne) SetName(s string) *SetUpdateOne

SetName sets the "name" field.

func (*SetUpdateOne) SetNillableCode

func (suo *SetUpdateOne) SetNillableCode(s *string) *SetUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (*SetUpdateOne) SetNillableName

func (suo *SetUpdateOne) SetNillableName(s *string) *SetUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SetUpdateOne) Where

func (suo *SetUpdateOne) Where(ps ...predicate.Set) *SetUpdateOne

Where appends a list predicates to the SetUpdate builder.

type Sets

type Sets []*Set

Sets is a parsable slice of Set.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Artist is the client for interacting with the Artist builders.
	Artist *ArtistClient
	// Card is the client for interacting with the Card builders.
	Card *CardClient
	// CardFace is the client for interacting with the CardFace builders.
	CardFace *CardFaceClient
	// Printing is the client for interacting with the Printing builders.
	Printing *PrintingClient
	// PrintingImage is the client for interacting with the PrintingImage builders.
	PrintingImage *PrintingImageClient
	// Ruling is the client for interacting with the Ruling builders.
	Ruling *RulingClient
	// Set is the client for interacting with the Set builders.
	Set *SetClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL