ent

package
v0.0.0-...-516dd05 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeCustomerTokens = "CustomerTokens"
	TypeProject        = "Project"
)

Variables

View Source
var DefaultCustomerTokensOrder = &CustomerTokensOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &CustomerTokensOrderField{
		Value: func(ct *CustomerTokens) (ent.Value, error) {
			return ct.ID, nil
		},
		column: customertokens.FieldID,
		toTerm: customertokens.ByID,
		toCursor: func(ct *CustomerTokens) Cursor {
			return Cursor{ID: ct.ID}
		},
	},
}

DefaultCustomerTokensOrder is the default ordering of CustomerTokens.

View Source
var DefaultProjectOrder = &ProjectOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &ProjectOrderField{
		Value: func(pr *Project) (ent.Value, error) {
			return pr.ID, nil
		},
		column: project.FieldID,
		toTerm: project.ByID,
		toCursor: func(pr *Project) Cursor {
			return Cursor{ID: pr.ID}
		},
	},
}

DefaultProjectOrder is the default ordering of Project.

View Source
var ErrEmptyCustomerTokensWhereInput = errors.New("ent: empty predicate CustomerTokensWhereInput")

ErrEmptyCustomerTokensWhereInput is returned in case the CustomerTokensWhereInput is empty.

View Source
var ErrEmptyProjectWhereInput = errors.New("ent: empty predicate ProjectWhereInput")

ErrEmptyProjectWhereInput is returned in case the ProjectWhereInput is empty.

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// CustomerTokens is the client for interacting with the CustomerTokens builders.
	CustomerTokens *CustomerTokensClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// 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 NewTestClient

func NewTestClient(t *testing.T) *Client

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().
	CustomerTokens.
	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) Noder

func (c *Client) Noder(ctx context.Context, id int, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []int, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

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 Cursor

type Cursor = entgql.Cursor[int]

Common entgql types.

type CustomerTokens

type CustomerTokens struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// ProjectAddress holds the value of the "project_address" field.
	ProjectAddress string `json:"project_address,omitempty"`
	// Slot holds the value of the "slot" field.
	Slot int `json:"slot,omitempty"`
	// TokenID holds the value of the "token_id" field.
	TokenID string `json:"token_id,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CustomerTokensQuery when eager-loading is set.
	Edges CustomerTokensEdges `json:"edges"`
	// contains filtered or unexported fields
}

CustomerTokens is the model entity for the CustomerTokens schema.

func (*CustomerTokens) GetValue

func (ct *CustomerTokens) GetValue(name string) (ent.Value, error)

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

func (*CustomerTokens) IsNode

func (*CustomerTokens) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*CustomerTokens) NamedProject

func (ct *CustomerTokens) NamedProject(name string) ([]*Project, error)

NamedProject returns the Project named value or an error if the edge was not loaded in eager-loading with this name.

func (*CustomerTokens) Project

func (ct *CustomerTokens) Project(ctx context.Context) (result []*Project, err error)

func (*CustomerTokens) QueryProject

func (ct *CustomerTokens) QueryProject() *ProjectQuery

QueryProject queries the "project" edge of the CustomerTokens entity.

func (*CustomerTokens) String

func (ct *CustomerTokens) String() string

String implements the fmt.Stringer.

func (*CustomerTokens) ToEdge

ToEdge converts CustomerTokens into CustomerTokensEdge.

func (*CustomerTokens) Unwrap

func (ct *CustomerTokens) Unwrap() *CustomerTokens

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

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

type CustomerTokensClient

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

CustomerTokensClient is a client for the CustomerTokens schema.

func NewCustomerTokensClient

func NewCustomerTokensClient(c config) *CustomerTokensClient

NewCustomerTokensClient returns a client for the CustomerTokens from the given config.

func (*CustomerTokensClient) Create

Create returns a builder for creating a CustomerTokens entity.

func (*CustomerTokensClient) CreateBulk

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

func (*CustomerTokensClient) Delete

Delete returns a delete builder for CustomerTokens.

func (*CustomerTokensClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CustomerTokensClient) DeleteOneID

func (c *CustomerTokensClient) DeleteOneID(id int) *CustomerTokensDeleteOne

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

func (*CustomerTokensClient) Get

Get returns a CustomerTokens entity by its id.

func (*CustomerTokensClient) GetX

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

func (*CustomerTokensClient) Hooks

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

Hooks returns the client hooks.

func (*CustomerTokensClient) Intercept

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

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

func (*CustomerTokensClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CustomerTokensClient) MapCreateBulk

func (c *CustomerTokensClient) MapCreateBulk(slice any, setFunc func(*CustomerTokensCreate, int)) *CustomerTokensCreateBulk

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 (*CustomerTokensClient) Query

Query returns a query builder for CustomerTokens.

func (*CustomerTokensClient) QueryProject

func (c *CustomerTokensClient) QueryProject(ct *CustomerTokens) *ProjectQuery

QueryProject queries the project edge of a CustomerTokens.

func (*CustomerTokensClient) Update

Update returns an update builder for CustomerTokens.

func (*CustomerTokensClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CustomerTokensClient) UpdateOneID

func (c *CustomerTokensClient) UpdateOneID(id int) *CustomerTokensUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CustomerTokensClient) Use

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

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

type CustomerTokensConnection

type CustomerTokensConnection struct {
	Edges      []*CustomerTokensEdge `json:"edges"`
	PageInfo   PageInfo              `json:"pageInfo"`
	TotalCount int                   `json:"totalCount"`
}

CustomerTokensConnection is the connection containing edges to CustomerTokens.

type CustomerTokensCreate

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

CustomerTokensCreate is the builder for creating a CustomerTokens entity.

func (*CustomerTokensCreate) AddProject

func (ctc *CustomerTokensCreate) AddProject(p ...*Project) *CustomerTokensCreate

AddProject adds the "project" edges to the Project entity.

func (*CustomerTokensCreate) AddProjectIDs

func (ctc *CustomerTokensCreate) AddProjectIDs(ids ...int) *CustomerTokensCreate

AddProjectIDs adds the "project" edge to the Project entity by IDs.

func (*CustomerTokensCreate) Exec

func (ctc *CustomerTokensCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CustomerTokensCreate) ExecX

func (ctc *CustomerTokensCreate) ExecX(ctx context.Context)

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

func (*CustomerTokensCreate) Mutation

Mutation returns the CustomerTokensMutation object of the builder.

func (*CustomerTokensCreate) OnConflict

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

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

func (*CustomerTokensCreate) OnConflictColumns

func (ctc *CustomerTokensCreate) OnConflictColumns(columns ...string) *CustomerTokensUpsertOne

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

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

func (*CustomerTokensCreate) Save

Save creates the CustomerTokens in the database.

func (*CustomerTokensCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*CustomerTokensCreate) SetAddress

func (ctc *CustomerTokensCreate) SetAddress(s string) *CustomerTokensCreate

SetAddress sets the "address" field.

func (*CustomerTokensCreate) SetProjectAddress

func (ctc *CustomerTokensCreate) SetProjectAddress(s string) *CustomerTokensCreate

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensCreate) SetSlot

SetSlot sets the "slot" field.

func (*CustomerTokensCreate) SetTokenID

func (ctc *CustomerTokensCreate) SetTokenID(s string) *CustomerTokensCreate

SetTokenID sets the "token_id" field.

func (*CustomerTokensCreate) SetValue

SetValue sets the "value" field.

type CustomerTokensCreateBulk

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

CustomerTokensCreateBulk is the builder for creating many CustomerTokens entities in bulk.

func (*CustomerTokensCreateBulk) Exec

Exec executes the query.

func (*CustomerTokensCreateBulk) ExecX

func (ctcb *CustomerTokensCreateBulk) ExecX(ctx context.Context)

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

func (*CustomerTokensCreateBulk) OnConflict

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

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

func (*CustomerTokensCreateBulk) OnConflictColumns

func (ctcb *CustomerTokensCreateBulk) OnConflictColumns(columns ...string) *CustomerTokensUpsertBulk

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

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

func (*CustomerTokensCreateBulk) Save

Save creates the CustomerTokens entities in the database.

func (*CustomerTokensCreateBulk) SaveX

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

type CustomerTokensDelete

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

CustomerTokensDelete is the builder for deleting a CustomerTokens entity.

func (*CustomerTokensDelete) Exec

func (ctd *CustomerTokensDelete) Exec(ctx context.Context) (int, error)

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

func (*CustomerTokensDelete) ExecX

func (ctd *CustomerTokensDelete) ExecX(ctx context.Context) int

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

func (*CustomerTokensDelete) Where

Where appends a list predicates to the CustomerTokensDelete builder.

type CustomerTokensDeleteOne

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

CustomerTokensDeleteOne is the builder for deleting a single CustomerTokens entity.

func (*CustomerTokensDeleteOne) Exec

func (ctdo *CustomerTokensDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CustomerTokensDeleteOne) ExecX

func (ctdo *CustomerTokensDeleteOne) ExecX(ctx context.Context)

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

func (*CustomerTokensDeleteOne) Where

Where appends a list predicates to the CustomerTokensDelete builder.

type CustomerTokensEdge

type CustomerTokensEdge struct {
	Node   *CustomerTokens `json:"node"`
	Cursor Cursor          `json:"cursor"`
}

CustomerTokensEdge is the edge representation of CustomerTokens.

type CustomerTokensEdges

type CustomerTokensEdges struct {
	// Project holds the value of the project edge.
	Project []*Project `json:"project,omitempty"`
	// contains filtered or unexported fields
}

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

func (CustomerTokensEdges) ProjectOrErr

func (e CustomerTokensEdges) ProjectOrErr() ([]*Project, error)

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

type CustomerTokensGroupBy

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

CustomerTokensGroupBy is the group-by builder for CustomerTokens entities.

func (*CustomerTokensGroupBy) Aggregate

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

func (*CustomerTokensGroupBy) Bool

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

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

func (*CustomerTokensGroupBy) BoolX

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

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

func (*CustomerTokensGroupBy) Bools

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

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

func (*CustomerTokensGroupBy) BoolsX

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

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

func (*CustomerTokensGroupBy) Float64

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

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

func (*CustomerTokensGroupBy) Float64X

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

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

func (*CustomerTokensGroupBy) Float64s

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

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

func (*CustomerTokensGroupBy) Float64sX

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

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

func (*CustomerTokensGroupBy) Int

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

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

func (*CustomerTokensGroupBy) IntX

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

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

func (*CustomerTokensGroupBy) Ints

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

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

func (*CustomerTokensGroupBy) IntsX

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

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

func (*CustomerTokensGroupBy) Scan

func (ctgb *CustomerTokensGroupBy) Scan(ctx context.Context, v any) error

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

func (*CustomerTokensGroupBy) ScanX

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

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

func (*CustomerTokensGroupBy) String

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

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

func (*CustomerTokensGroupBy) StringX

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

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

func (*CustomerTokensGroupBy) Strings

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

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

func (*CustomerTokensGroupBy) StringsX

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

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

type CustomerTokensMutation

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

CustomerTokensMutation represents an operation that mutates the CustomerTokens nodes in the graph.

func (*CustomerTokensMutation) AddField

func (m *CustomerTokensMutation) 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 (*CustomerTokensMutation) AddProjectIDs

func (m *CustomerTokensMutation) AddProjectIDs(ids ...int)

AddProjectIDs adds the "project" edge to the Project entity by ids.

func (*CustomerTokensMutation) AddSlot

func (m *CustomerTokensMutation) AddSlot(i int)

AddSlot adds i to the "slot" field.

func (*CustomerTokensMutation) AddedEdges

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

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

func (*CustomerTokensMutation) AddedField

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

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

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

func (*CustomerTokensMutation) AddedIDs

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

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

func (*CustomerTokensMutation) AddedSlot

func (m *CustomerTokensMutation) AddedSlot() (r int, exists bool)

AddedSlot returns the value that was added to the "slot" field in this mutation.

func (*CustomerTokensMutation) Address

func (m *CustomerTokensMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*CustomerTokensMutation) ClearEdge

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

func (m *CustomerTokensMutation) 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 (*CustomerTokensMutation) ClearProject

func (m *CustomerTokensMutation) ClearProject()

ClearProject clears the "project" edge to the Project entity.

func (*CustomerTokensMutation) ClearedEdges

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

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

func (*CustomerTokensMutation) ClearedFields

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

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

func (CustomerTokensMutation) Client

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

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

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

func (*CustomerTokensMutation) Field

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

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

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

func (*CustomerTokensMutation) Fields

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

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

func (m *CustomerTokensMutation) 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 (*CustomerTokensMutation) OldAddress

func (m *CustomerTokensMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the CustomerTokens entity. If the CustomerTokens 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 (*CustomerTokensMutation) OldField

func (m *CustomerTokensMutation) 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 (*CustomerTokensMutation) OldProjectAddress

func (m *CustomerTokensMutation) OldProjectAddress(ctx context.Context) (v string, err error)

OldProjectAddress returns the old "project_address" field's value of the CustomerTokens entity. If the CustomerTokens 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 (*CustomerTokensMutation) OldSlot

func (m *CustomerTokensMutation) OldSlot(ctx context.Context) (v int, err error)

OldSlot returns the old "slot" field's value of the CustomerTokens entity. If the CustomerTokens 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 (*CustomerTokensMutation) OldTokenID

func (m *CustomerTokensMutation) OldTokenID(ctx context.Context) (v string, err error)

OldTokenID returns the old "token_id" field's value of the CustomerTokens entity. If the CustomerTokens 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 (*CustomerTokensMutation) OldValue

func (m *CustomerTokensMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the CustomerTokens entity. If the CustomerTokens 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 (*CustomerTokensMutation) Op

func (m *CustomerTokensMutation) Op() Op

Op returns the operation name.

func (*CustomerTokensMutation) ProjectAddress

func (m *CustomerTokensMutation) ProjectAddress() (r string, exists bool)

ProjectAddress returns the value of the "project_address" field in the mutation.

func (*CustomerTokensMutation) ProjectCleared

func (m *CustomerTokensMutation) ProjectCleared() bool

ProjectCleared reports if the "project" edge to the Project entity was cleared.

func (*CustomerTokensMutation) ProjectIDs

func (m *CustomerTokensMutation) ProjectIDs() (ids []int)

ProjectIDs returns the "project" edge IDs in the mutation.

func (*CustomerTokensMutation) RemoveProjectIDs

func (m *CustomerTokensMutation) RemoveProjectIDs(ids ...int)

RemoveProjectIDs removes the "project" edge to the Project entity by IDs.

func (*CustomerTokensMutation) RemovedEdges

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

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

func (*CustomerTokensMutation) RemovedIDs

func (m *CustomerTokensMutation) 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 (*CustomerTokensMutation) RemovedProjectIDs

func (m *CustomerTokensMutation) RemovedProjectIDs() (ids []int)

RemovedProject returns the removed IDs of the "project" edge to the Project entity.

func (*CustomerTokensMutation) ResetAddress

func (m *CustomerTokensMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*CustomerTokensMutation) ResetEdge

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

func (m *CustomerTokensMutation) 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 (*CustomerTokensMutation) ResetProject

func (m *CustomerTokensMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*CustomerTokensMutation) ResetProjectAddress

func (m *CustomerTokensMutation) ResetProjectAddress()

ResetProjectAddress resets all changes to the "project_address" field.

func (*CustomerTokensMutation) ResetSlot

func (m *CustomerTokensMutation) ResetSlot()

ResetSlot resets all changes to the "slot" field.

func (*CustomerTokensMutation) ResetTokenID

func (m *CustomerTokensMutation) ResetTokenID()

ResetTokenID resets all changes to the "token_id" field.

func (*CustomerTokensMutation) ResetValue

func (m *CustomerTokensMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*CustomerTokensMutation) SetAddress

func (m *CustomerTokensMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*CustomerTokensMutation) SetField

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

func (m *CustomerTokensMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CustomerTokensMutation) SetProjectAddress

func (m *CustomerTokensMutation) SetProjectAddress(s string)

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensMutation) SetSlot

func (m *CustomerTokensMutation) SetSlot(i int)

SetSlot sets the "slot" field.

func (*CustomerTokensMutation) SetTokenID

func (m *CustomerTokensMutation) SetTokenID(s string)

SetTokenID sets the "token_id" field.

func (*CustomerTokensMutation) SetValue

func (m *CustomerTokensMutation) SetValue(s string)

SetValue sets the "value" field.

func (*CustomerTokensMutation) Slot

func (m *CustomerTokensMutation) Slot() (r int, exists bool)

Slot returns the value of the "slot" field in the mutation.

func (*CustomerTokensMutation) TokenID

func (m *CustomerTokensMutation) TokenID() (r string, exists bool)

TokenID returns the value of the "token_id" field in the mutation.

func (CustomerTokensMutation) Tx

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

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

func (*CustomerTokensMutation) Type

func (m *CustomerTokensMutation) Type() string

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

func (*CustomerTokensMutation) Value

func (m *CustomerTokensMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*CustomerTokensMutation) Where

Where appends a list predicates to the CustomerTokensMutation builder.

func (*CustomerTokensMutation) WhereP

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

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

type CustomerTokensOrder

type CustomerTokensOrder struct {
	Direction OrderDirection            `json:"direction"`
	Field     *CustomerTokensOrderField `json:"field"`
}

CustomerTokensOrder defines the ordering of CustomerTokens.

type CustomerTokensOrderField

type CustomerTokensOrderField struct {
	// Value extracts the ordering value from the given CustomerTokens.
	Value func(*CustomerTokens) (ent.Value, error)
	// contains filtered or unexported fields
}

CustomerTokensOrderField defines the ordering field of CustomerTokens.

type CustomerTokensPaginateOption

type CustomerTokensPaginateOption func(*customertokensPager) error

CustomerTokensPaginateOption enables pagination customization.

func WithCustomerTokensFilter

func WithCustomerTokensFilter(filter func(*CustomerTokensQuery) (*CustomerTokensQuery, error)) CustomerTokensPaginateOption

WithCustomerTokensFilter configures pagination filter.

func WithCustomerTokensOrder

func WithCustomerTokensOrder(order *CustomerTokensOrder) CustomerTokensPaginateOption

WithCustomerTokensOrder configures pagination ordering.

type CustomerTokensQuery

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

CustomerTokensQuery is the builder for querying CustomerTokens entities.

func (*CustomerTokensQuery) Aggregate

func (ctq *CustomerTokensQuery) Aggregate(fns ...AggregateFunc) *CustomerTokensSelect

Aggregate returns a CustomerTokensSelect configured with the given aggregations.

func (*CustomerTokensQuery) All

All executes the query and returns a list of CustomerTokensSlice.

func (*CustomerTokensQuery) AllX

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

func (*CustomerTokensQuery) Clone

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

func (*CustomerTokensQuery) CollectFields

func (ct *CustomerTokensQuery) CollectFields(ctx context.Context, satisfies ...string) (*CustomerTokensQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*CustomerTokensQuery) Count

func (ctq *CustomerTokensQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CustomerTokensQuery) CountX

func (ctq *CustomerTokensQuery) CountX(ctx context.Context) int

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

func (*CustomerTokensQuery) Exist

func (ctq *CustomerTokensQuery) Exist(ctx context.Context) (bool, error)

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

func (*CustomerTokensQuery) ExistX

func (ctq *CustomerTokensQuery) ExistX(ctx context.Context) bool

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

func (*CustomerTokensQuery) First

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

func (*CustomerTokensQuery) FirstID

func (ctq *CustomerTokensQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CustomerTokensQuery) FirstIDX

func (ctq *CustomerTokensQuery) FirstIDX(ctx context.Context) int

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

func (*CustomerTokensQuery) FirstX

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

func (*CustomerTokensQuery) GroupBy

func (ctq *CustomerTokensQuery) GroupBy(field string, fields ...string) *CustomerTokensGroupBy

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

client.CustomerTokens.Query().
	GroupBy(customertokens.FieldAddress).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CustomerTokensQuery) IDs

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

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

func (*CustomerTokensQuery) IDsX

func (ctq *CustomerTokensQuery) IDsX(ctx context.Context) []int

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

func (*CustomerTokensQuery) Limit

func (ctq *CustomerTokensQuery) Limit(limit int) *CustomerTokensQuery

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

func (*CustomerTokensQuery) Offset

func (ctq *CustomerTokensQuery) Offset(offset int) *CustomerTokensQuery

Offset to start from.

func (*CustomerTokensQuery) Only

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

func (*CustomerTokensQuery) OnlyID

func (ctq *CustomerTokensQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CustomerTokensQuery) OnlyIDX

func (ctq *CustomerTokensQuery) OnlyIDX(ctx context.Context) int

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

func (*CustomerTokensQuery) OnlyX

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

func (*CustomerTokensQuery) Order

Order specifies how the records should be ordered.

func (*CustomerTokensQuery) Paginate

func (ct *CustomerTokensQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CustomerTokensPaginateOption,
) (*CustomerTokensConnection, error)

Paginate executes the query and returns a relay based cursor connection to CustomerTokens.

func (*CustomerTokensQuery) QueryProject

func (ctq *CustomerTokensQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "project" edge.

func (*CustomerTokensQuery) Select

func (ctq *CustomerTokensQuery) Select(fields ...string) *CustomerTokensSelect

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

client.CustomerTokens.Query().
	Select(customertokens.FieldAddress).
	Scan(ctx, &v)

func (*CustomerTokensQuery) Unique

func (ctq *CustomerTokensQuery) Unique(unique bool) *CustomerTokensQuery

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

Where adds a new predicate for the CustomerTokensQuery builder.

func (*CustomerTokensQuery) WithNamedProject

func (ctq *CustomerTokensQuery) WithNamedProject(name string, opts ...func(*ProjectQuery)) *CustomerTokensQuery

WithNamedProject tells the query-builder to eager-load the nodes that are connected to the "project" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*CustomerTokensQuery) WithProject

func (ctq *CustomerTokensQuery) WithProject(opts ...func(*ProjectQuery)) *CustomerTokensQuery

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

type CustomerTokensSelect

type CustomerTokensSelect struct {
	*CustomerTokensQuery
	// contains filtered or unexported fields
}

CustomerTokensSelect is the builder for selecting fields of CustomerTokens entities.

func (*CustomerTokensSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*CustomerTokensSelect) Bool

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

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

func (*CustomerTokensSelect) BoolX

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

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

func (*CustomerTokensSelect) Bools

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

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

func (*CustomerTokensSelect) BoolsX

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

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

func (*CustomerTokensSelect) Float64

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

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

func (*CustomerTokensSelect) Float64X

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

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

func (*CustomerTokensSelect) Float64s

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

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

func (*CustomerTokensSelect) Float64sX

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

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

func (*CustomerTokensSelect) Int

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

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

func (*CustomerTokensSelect) IntX

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

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

func (*CustomerTokensSelect) Ints

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

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

func (*CustomerTokensSelect) IntsX

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

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

func (*CustomerTokensSelect) Scan

func (cts *CustomerTokensSelect) Scan(ctx context.Context, v any) error

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

func (*CustomerTokensSelect) ScanX

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

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

func (*CustomerTokensSelect) String

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

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

func (*CustomerTokensSelect) StringX

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

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

func (*CustomerTokensSelect) Strings

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

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

func (*CustomerTokensSelect) StringsX

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

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

type CustomerTokensSlice

type CustomerTokensSlice []*CustomerTokens

CustomerTokensSlice is a parsable slice of CustomerTokens.

type CustomerTokensUpdate

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

CustomerTokensUpdate is the builder for updating CustomerTokens entities.

func (*CustomerTokensUpdate) AddProject

func (ctu *CustomerTokensUpdate) AddProject(p ...*Project) *CustomerTokensUpdate

AddProject adds the "project" edges to the Project entity.

func (*CustomerTokensUpdate) AddProjectIDs

func (ctu *CustomerTokensUpdate) AddProjectIDs(ids ...int) *CustomerTokensUpdate

AddProjectIDs adds the "project" edge to the Project entity by IDs.

func (*CustomerTokensUpdate) AddSlot

AddSlot adds i to the "slot" field.

func (*CustomerTokensUpdate) ClearProject

func (ctu *CustomerTokensUpdate) ClearProject() *CustomerTokensUpdate

ClearProject clears all "project" edges to the Project entity.

func (*CustomerTokensUpdate) Exec

func (ctu *CustomerTokensUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CustomerTokensUpdate) ExecX

func (ctu *CustomerTokensUpdate) ExecX(ctx context.Context)

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

func (*CustomerTokensUpdate) Mutation

Mutation returns the CustomerTokensMutation object of the builder.

func (*CustomerTokensUpdate) RemoveProject

func (ctu *CustomerTokensUpdate) RemoveProject(p ...*Project) *CustomerTokensUpdate

RemoveProject removes "project" edges to Project entities.

func (*CustomerTokensUpdate) RemoveProjectIDs

func (ctu *CustomerTokensUpdate) RemoveProjectIDs(ids ...int) *CustomerTokensUpdate

RemoveProjectIDs removes the "project" edge to Project entities by IDs.

func (*CustomerTokensUpdate) Save

func (ctu *CustomerTokensUpdate) Save(ctx context.Context) (int, error)

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

func (*CustomerTokensUpdate) SaveX

func (ctu *CustomerTokensUpdate) SaveX(ctx context.Context) int

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

func (*CustomerTokensUpdate) SetAddress

func (ctu *CustomerTokensUpdate) SetAddress(s string) *CustomerTokensUpdate

SetAddress sets the "address" field.

func (*CustomerTokensUpdate) SetNillableAddress

func (ctu *CustomerTokensUpdate) SetNillableAddress(s *string) *CustomerTokensUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*CustomerTokensUpdate) SetNillableProjectAddress

func (ctu *CustomerTokensUpdate) SetNillableProjectAddress(s *string) *CustomerTokensUpdate

SetNillableProjectAddress sets the "project_address" field if the given value is not nil.

func (*CustomerTokensUpdate) SetNillableSlot

func (ctu *CustomerTokensUpdate) SetNillableSlot(i *int) *CustomerTokensUpdate

SetNillableSlot sets the "slot" field if the given value is not nil.

func (*CustomerTokensUpdate) SetNillableTokenID

func (ctu *CustomerTokensUpdate) SetNillableTokenID(s *string) *CustomerTokensUpdate

SetNillableTokenID sets the "token_id" field if the given value is not nil.

func (*CustomerTokensUpdate) SetNillableValue

func (ctu *CustomerTokensUpdate) SetNillableValue(s *string) *CustomerTokensUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*CustomerTokensUpdate) SetProjectAddress

func (ctu *CustomerTokensUpdate) SetProjectAddress(s string) *CustomerTokensUpdate

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensUpdate) SetSlot

SetSlot sets the "slot" field.

func (*CustomerTokensUpdate) SetTokenID

func (ctu *CustomerTokensUpdate) SetTokenID(s string) *CustomerTokensUpdate

SetTokenID sets the "token_id" field.

func (*CustomerTokensUpdate) SetValue

SetValue sets the "value" field.

func (*CustomerTokensUpdate) Where

Where appends a list predicates to the CustomerTokensUpdate builder.

type CustomerTokensUpdateOne

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

CustomerTokensUpdateOne is the builder for updating a single CustomerTokens entity.

func (*CustomerTokensUpdateOne) AddProject

func (ctuo *CustomerTokensUpdateOne) AddProject(p ...*Project) *CustomerTokensUpdateOne

AddProject adds the "project" edges to the Project entity.

func (*CustomerTokensUpdateOne) AddProjectIDs

func (ctuo *CustomerTokensUpdateOne) AddProjectIDs(ids ...int) *CustomerTokensUpdateOne

AddProjectIDs adds the "project" edge to the Project entity by IDs.

func (*CustomerTokensUpdateOne) AddSlot

AddSlot adds i to the "slot" field.

func (*CustomerTokensUpdateOne) ClearProject

func (ctuo *CustomerTokensUpdateOne) ClearProject() *CustomerTokensUpdateOne

ClearProject clears all "project" edges to the Project entity.

func (*CustomerTokensUpdateOne) Exec

func (ctuo *CustomerTokensUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CustomerTokensUpdateOne) ExecX

func (ctuo *CustomerTokensUpdateOne) ExecX(ctx context.Context)

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

func (*CustomerTokensUpdateOne) Mutation

Mutation returns the CustomerTokensMutation object of the builder.

func (*CustomerTokensUpdateOne) RemoveProject

func (ctuo *CustomerTokensUpdateOne) RemoveProject(p ...*Project) *CustomerTokensUpdateOne

RemoveProject removes "project" edges to Project entities.

func (*CustomerTokensUpdateOne) RemoveProjectIDs

func (ctuo *CustomerTokensUpdateOne) RemoveProjectIDs(ids ...int) *CustomerTokensUpdateOne

RemoveProjectIDs removes the "project" edge to Project entities by IDs.

func (*CustomerTokensUpdateOne) Save

Save executes the query and returns the updated CustomerTokens entity.

func (*CustomerTokensUpdateOne) SaveX

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

func (*CustomerTokensUpdateOne) Select

func (ctuo *CustomerTokensUpdateOne) Select(field string, fields ...string) *CustomerTokensUpdateOne

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

func (*CustomerTokensUpdateOne) SetAddress

SetAddress sets the "address" field.

func (*CustomerTokensUpdateOne) SetNillableAddress

func (ctuo *CustomerTokensUpdateOne) SetNillableAddress(s *string) *CustomerTokensUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*CustomerTokensUpdateOne) SetNillableProjectAddress

func (ctuo *CustomerTokensUpdateOne) SetNillableProjectAddress(s *string) *CustomerTokensUpdateOne

SetNillableProjectAddress sets the "project_address" field if the given value is not nil.

func (*CustomerTokensUpdateOne) SetNillableSlot

func (ctuo *CustomerTokensUpdateOne) SetNillableSlot(i *int) *CustomerTokensUpdateOne

SetNillableSlot sets the "slot" field if the given value is not nil.

func (*CustomerTokensUpdateOne) SetNillableTokenID

func (ctuo *CustomerTokensUpdateOne) SetNillableTokenID(s *string) *CustomerTokensUpdateOne

SetNillableTokenID sets the "token_id" field if the given value is not nil.

func (*CustomerTokensUpdateOne) SetNillableValue

func (ctuo *CustomerTokensUpdateOne) SetNillableValue(s *string) *CustomerTokensUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*CustomerTokensUpdateOne) SetProjectAddress

func (ctuo *CustomerTokensUpdateOne) SetProjectAddress(s string) *CustomerTokensUpdateOne

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensUpdateOne) SetSlot

SetSlot sets the "slot" field.

func (*CustomerTokensUpdateOne) SetTokenID

SetTokenID sets the "token_id" field.

func (*CustomerTokensUpdateOne) SetValue

SetValue sets the "value" field.

func (*CustomerTokensUpdateOne) Where

Where appends a list predicates to the CustomerTokensUpdate builder.

type CustomerTokensUpsert

type CustomerTokensUpsert struct {
	*sql.UpdateSet
}

CustomerTokensUpsert is the "OnConflict" setter.

func (*CustomerTokensUpsert) AddSlot

AddSlot adds v to the "slot" field.

func (*CustomerTokensUpsert) SetAddress

SetAddress sets the "address" field.

func (*CustomerTokensUpsert) SetProjectAddress

func (u *CustomerTokensUpsert) SetProjectAddress(v string) *CustomerTokensUpsert

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensUpsert) SetSlot

SetSlot sets the "slot" field.

func (*CustomerTokensUpsert) SetTokenID

SetTokenID sets the "token_id" field.

func (*CustomerTokensUpsert) SetValue

SetValue sets the "value" field.

func (*CustomerTokensUpsert) UpdateAddress

func (u *CustomerTokensUpsert) UpdateAddress() *CustomerTokensUpsert

UpdateAddress sets the "address" field to the value that was provided on create.

func (*CustomerTokensUpsert) UpdateProjectAddress

func (u *CustomerTokensUpsert) UpdateProjectAddress() *CustomerTokensUpsert

UpdateProjectAddress sets the "project_address" field to the value that was provided on create.

func (*CustomerTokensUpsert) UpdateSlot

func (u *CustomerTokensUpsert) UpdateSlot() *CustomerTokensUpsert

UpdateSlot sets the "slot" field to the value that was provided on create.

func (*CustomerTokensUpsert) UpdateTokenID

func (u *CustomerTokensUpsert) UpdateTokenID() *CustomerTokensUpsert

UpdateTokenID sets the "token_id" field to the value that was provided on create.

func (*CustomerTokensUpsert) UpdateValue

func (u *CustomerTokensUpsert) UpdateValue() *CustomerTokensUpsert

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

type CustomerTokensUpsertBulk

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

CustomerTokensUpsertBulk is the builder for "upsert"-ing a bulk of CustomerTokens nodes.

func (*CustomerTokensUpsertBulk) AddSlot

AddSlot adds v to the "slot" field.

func (*CustomerTokensUpsertBulk) DoNothing

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

func (*CustomerTokensUpsertBulk) Exec

Exec executes the query.

func (*CustomerTokensUpsertBulk) ExecX

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

func (*CustomerTokensUpsertBulk) Ignore

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

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

func (*CustomerTokensUpsertBulk) SetAddress

SetAddress sets the "address" field.

func (*CustomerTokensUpsertBulk) SetProjectAddress

func (u *CustomerTokensUpsertBulk) SetProjectAddress(v string) *CustomerTokensUpsertBulk

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensUpsertBulk) SetSlot

SetSlot sets the "slot" field.

func (*CustomerTokensUpsertBulk) SetTokenID

SetTokenID sets the "token_id" field.

func (*CustomerTokensUpsertBulk) SetValue

SetValue sets the "value" field.

func (*CustomerTokensUpsertBulk) Update

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

func (*CustomerTokensUpsertBulk) UpdateAddress

UpdateAddress sets the "address" field to the value that was provided on create.

func (*CustomerTokensUpsertBulk) UpdateNewValues

func (u *CustomerTokensUpsertBulk) UpdateNewValues() *CustomerTokensUpsertBulk

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

client.CustomerTokens.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*CustomerTokensUpsertBulk) UpdateProjectAddress

func (u *CustomerTokensUpsertBulk) UpdateProjectAddress() *CustomerTokensUpsertBulk

UpdateProjectAddress sets the "project_address" field to the value that was provided on create.

func (*CustomerTokensUpsertBulk) UpdateSlot

UpdateSlot sets the "slot" field to the value that was provided on create.

func (*CustomerTokensUpsertBulk) UpdateTokenID

UpdateTokenID sets the "token_id" field to the value that was provided on create.

func (*CustomerTokensUpsertBulk) UpdateValue

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

type CustomerTokensUpsertOne

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

CustomerTokensUpsertOne is the builder for "upsert"-ing

one CustomerTokens node.

func (*CustomerTokensUpsertOne) AddSlot

AddSlot adds v to the "slot" field.

func (*CustomerTokensUpsertOne) DoNothing

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

func (*CustomerTokensUpsertOne) Exec

Exec executes the query.

func (*CustomerTokensUpsertOne) ExecX

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

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

func (*CustomerTokensUpsertOne) ID

func (u *CustomerTokensUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*CustomerTokensUpsertOne) IDX

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

func (*CustomerTokensUpsertOne) Ignore

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

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

func (*CustomerTokensUpsertOne) SetAddress

SetAddress sets the "address" field.

func (*CustomerTokensUpsertOne) SetProjectAddress

func (u *CustomerTokensUpsertOne) SetProjectAddress(v string) *CustomerTokensUpsertOne

SetProjectAddress sets the "project_address" field.

func (*CustomerTokensUpsertOne) SetSlot

SetSlot sets the "slot" field.

func (*CustomerTokensUpsertOne) SetTokenID

SetTokenID sets the "token_id" field.

func (*CustomerTokensUpsertOne) SetValue

SetValue sets the "value" field.

func (*CustomerTokensUpsertOne) Update

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

func (*CustomerTokensUpsertOne) UpdateAddress

UpdateAddress sets the "address" field to the value that was provided on create.

func (*CustomerTokensUpsertOne) UpdateNewValues

func (u *CustomerTokensUpsertOne) UpdateNewValues() *CustomerTokensUpsertOne

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

client.CustomerTokens.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*CustomerTokensUpsertOne) UpdateProjectAddress

func (u *CustomerTokensUpsertOne) UpdateProjectAddress() *CustomerTokensUpsertOne

UpdateProjectAddress sets the "project_address" field to the value that was provided on create.

func (*CustomerTokensUpsertOne) UpdateSlot

UpdateSlot sets the "slot" field to the value that was provided on create.

func (*CustomerTokensUpsertOne) UpdateTokenID

UpdateTokenID sets the "token_id" field to the value that was provided on create.

func (*CustomerTokensUpsertOne) UpdateValue

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

type CustomerTokensWhereInput

type CustomerTokensWhereInput struct {
	Predicates []predicate.CustomerTokens  `json:"-"`
	Not        *CustomerTokensWhereInput   `json:"not,omitempty"`
	Or         []*CustomerTokensWhereInput `json:"or,omitempty"`
	And        []*CustomerTokensWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "address" field predicates.
	Address             *string  `json:"address,omitempty"`
	AddressNEQ          *string  `json:"addressNEQ,omitempty"`
	AddressIn           []string `json:"addressIn,omitempty"`
	AddressNotIn        []string `json:"addressNotIn,omitempty"`
	AddressGT           *string  `json:"addressGT,omitempty"`
	AddressGTE          *string  `json:"addressGTE,omitempty"`
	AddressLT           *string  `json:"addressLT,omitempty"`
	AddressLTE          *string  `json:"addressLTE,omitempty"`
	AddressContains     *string  `json:"addressContains,omitempty"`
	AddressHasPrefix    *string  `json:"addressHasPrefix,omitempty"`
	AddressHasSuffix    *string  `json:"addressHasSuffix,omitempty"`
	AddressEqualFold    *string  `json:"addressEqualFold,omitempty"`
	AddressContainsFold *string  `json:"addressContainsFold,omitempty"`

	// "project_address" field predicates.
	ProjectAddress             *string  `json:"projectAddress,omitempty"`
	ProjectAddressNEQ          *string  `json:"projectAddressNEQ,omitempty"`
	ProjectAddressIn           []string `json:"projectAddressIn,omitempty"`
	ProjectAddressNotIn        []string `json:"projectAddressNotIn,omitempty"`
	ProjectAddressGT           *string  `json:"projectAddressGT,omitempty"`
	ProjectAddressGTE          *string  `json:"projectAddressGTE,omitempty"`
	ProjectAddressLT           *string  `json:"projectAddressLT,omitempty"`
	ProjectAddressLTE          *string  `json:"projectAddressLTE,omitempty"`
	ProjectAddressContains     *string  `json:"projectAddressContains,omitempty"`
	ProjectAddressHasPrefix    *string  `json:"projectAddressHasPrefix,omitempty"`
	ProjectAddressHasSuffix    *string  `json:"projectAddressHasSuffix,omitempty"`
	ProjectAddressEqualFold    *string  `json:"projectAddressEqualFold,omitempty"`
	ProjectAddressContainsFold *string  `json:"projectAddressContainsFold,omitempty"`

	// "slot" field predicates.
	Slot      *int  `json:"slot,omitempty"`
	SlotNEQ   *int  `json:"slotNEQ,omitempty"`
	SlotIn    []int `json:"slotIn,omitempty"`
	SlotNotIn []int `json:"slotNotIn,omitempty"`
	SlotGT    *int  `json:"slotGT,omitempty"`
	SlotGTE   *int  `json:"slotGTE,omitempty"`
	SlotLT    *int  `json:"slotLT,omitempty"`
	SlotLTE   *int  `json:"slotLTE,omitempty"`

	// "token_id" field predicates.
	TokenID             *string  `json:"tokenID,omitempty"`
	TokenIDNEQ          *string  `json:"tokenIDNEQ,omitempty"`
	TokenIDIn           []string `json:"tokenIDIn,omitempty"`
	TokenIDNotIn        []string `json:"tokenIDNotIn,omitempty"`
	TokenIDGT           *string  `json:"tokenIDGT,omitempty"`
	TokenIDGTE          *string  `json:"tokenIDGTE,omitempty"`
	TokenIDLT           *string  `json:"tokenIDLT,omitempty"`
	TokenIDLTE          *string  `json:"tokenIDLTE,omitempty"`
	TokenIDContains     *string  `json:"tokenIDContains,omitempty"`
	TokenIDHasPrefix    *string  `json:"tokenIDHasPrefix,omitempty"`
	TokenIDHasSuffix    *string  `json:"tokenIDHasSuffix,omitempty"`
	TokenIDEqualFold    *string  `json:"tokenIDEqualFold,omitempty"`
	TokenIDContainsFold *string  `json:"tokenIDContainsFold,omitempty"`

	// "value" field predicates.
	Value             *string  `json:"value,omitempty"`
	ValueNEQ          *string  `json:"valueNEQ,omitempty"`
	ValueIn           []string `json:"valueIn,omitempty"`
	ValueNotIn        []string `json:"valueNotIn,omitempty"`
	ValueGT           *string  `json:"valueGT,omitempty"`
	ValueGTE          *string  `json:"valueGTE,omitempty"`
	ValueLT           *string  `json:"valueLT,omitempty"`
	ValueLTE          *string  `json:"valueLTE,omitempty"`
	ValueContains     *string  `json:"valueContains,omitempty"`
	ValueHasPrefix    *string  `json:"valueHasPrefix,omitempty"`
	ValueHasSuffix    *string  `json:"valueHasSuffix,omitempty"`
	ValueEqualFold    *string  `json:"valueEqualFold,omitempty"`
	ValueContainsFold *string  `json:"valueContainsFold,omitempty"`

	// "project" edge predicates.
	HasProject     *bool                `json:"hasProject,omitempty"`
	HasProjectWith []*ProjectWhereInput `json:"hasProjectWith,omitempty"`
}

CustomerTokensWhereInput represents a where input for filtering CustomerTokens queries.

func (*CustomerTokensWhereInput) AddPredicates

func (i *CustomerTokensWhereInput) AddPredicates(predicates ...predicate.CustomerTokens)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*CustomerTokensWhereInput) Filter

Filter applies the CustomerTokensWhereInput filter on the CustomerTokensQuery builder.

func (*CustomerTokensWhereInput) P

P returns a predicate for filtering customertokensslice. An error is returned if the input is empty or invalid.

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 NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	IsNode()
}

Noder wraps the basic Node method.

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 OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

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 PageInfo

type PageInfo = entgql.PageInfo[int]

Common entgql types.

type Policy

type Policy = ent.Policy

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

type Project

type Project struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Slot holds the value of the "slot" field.
	Slot int `json:"slot,omitempty"`
	// MinterAddress holds the value of the "minter_address" field.
	MinterAddress string `json:"minter_address,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Abi holds the value of the "abi" field.
	Abi model.ProjectAbi `json:"abi,omitempty"`
	// SlotURI holds the value of the "slot_uri" field.
	SlotURI model.SlotUri `json:"slot_uri,omitempty"`
	// Image holds the value of the "image" field.
	Image string `json:"image,omitempty"`
	// YielderAddress holds the value of the "yielder_address" field.
	YielderAddress string `json:"yielder_address,omitempty"`
	// OffseterAddress holds the value of the "offseter_address" field.
	OffseterAddress string `json:"offseter_address,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProjectQuery when eager-loading is set.
	Edges ProjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

Project is the model entity for the Project schema.

func (*Project) IsNode

func (*Project) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Project) NamedTokens

func (pr *Project) NamedTokens(name string) ([]*CustomerTokens, error)

NamedTokens returns the Tokens named value or an error if the edge was not loaded in eager-loading with this name.

func (*Project) QueryTokens

func (pr *Project) QueryTokens() *CustomerTokensQuery

QueryTokens queries the "tokens" edge of the Project entity.

func (*Project) String

func (pr *Project) String() string

String implements the fmt.Stringer.

func (*Project) ToEdge

func (pr *Project) ToEdge(order *ProjectOrder) *ProjectEdge

ToEdge converts Project into ProjectEdge.

func (*Project) Tokens

func (pr *Project) Tokens(ctx context.Context) (result []*CustomerTokens, err error)

func (*Project) Unwrap

func (pr *Project) Unwrap() *Project

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

func (pr *Project) Update() *ProjectUpdateOne

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

func (*Project) Value

func (pr *Project) Value(name string) (ent.Value, error)

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

type ProjectClient

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

ProjectClient is a client for the Project schema.

func NewProjectClient

func NewProjectClient(c config) *ProjectClient

NewProjectClient returns a client for the Project from the given config.

func (*ProjectClient) Create

func (c *ProjectClient) Create() *ProjectCreate

Create returns a builder for creating a Project entity.

func (*ProjectClient) CreateBulk

func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk

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

func (*ProjectClient) Delete

func (c *ProjectClient) Delete() *ProjectDelete

Delete returns a delete builder for Project.

func (*ProjectClient) DeleteOne

func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectClient) DeleteOneID

func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne

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

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id int) *Project

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

func (*ProjectClient) Hooks

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

Hooks returns the client hooks.

func (*ProjectClient) Intercept

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

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

func (*ProjectClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProjectClient) MapCreateBulk

func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk

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 (*ProjectClient) Query

func (c *ProjectClient) Query() *ProjectQuery

Query returns a query builder for Project.

func (*ProjectClient) QueryTokens

func (c *ProjectClient) QueryTokens(pr *Project) *CustomerTokensQuery

QueryTokens queries the tokens edge of a Project.

func (*ProjectClient) Update

func (c *ProjectClient) Update() *ProjectUpdate

Update returns an update builder for Project.

func (*ProjectClient) UpdateOne

func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectClient) UpdateOneID

func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectClient) Use

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

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

type ProjectConnection

type ProjectConnection struct {
	Edges      []*ProjectEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

ProjectConnection is the connection containing edges to Project.

type ProjectCreate

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

ProjectCreate is the builder for creating a Project entity.

func (*ProjectCreate) AddTokenIDs

func (pc *ProjectCreate) AddTokenIDs(ids ...int) *ProjectCreate

AddTokenIDs adds the "tokens" edge to the CustomerTokens entity by IDs.

func (*ProjectCreate) AddTokens

func (pc *ProjectCreate) AddTokens(c ...*CustomerTokens) *ProjectCreate

AddTokens adds the "tokens" edges to the CustomerTokens entity.

func (*ProjectCreate) Exec

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

Exec executes the query.

func (*ProjectCreate) ExecX

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

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

func (*ProjectCreate) Mutation

func (pc *ProjectCreate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectCreate) OnConflict

func (pc *ProjectCreate) OnConflict(opts ...sql.ConflictOption) *ProjectUpsertOne

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

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

func (*ProjectCreate) OnConflictColumns

func (pc *ProjectCreate) OnConflictColumns(columns ...string) *ProjectUpsertOne

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

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

func (*ProjectCreate) Save

func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)

Save creates the Project in the database.

func (*ProjectCreate) SaveX

func (pc *ProjectCreate) SaveX(ctx context.Context) *Project

SaveX calls Save and panics if Save returns an error.

func (*ProjectCreate) SetAbi

func (pc *ProjectCreate) SetAbi(ma model.ProjectAbi) *ProjectCreate

SetAbi sets the "abi" field.

func (*ProjectCreate) SetAddress

func (pc *ProjectCreate) SetAddress(s string) *ProjectCreate

SetAddress sets the "address" field.

func (*ProjectCreate) SetImage

func (pc *ProjectCreate) SetImage(s string) *ProjectCreate

SetImage sets the "image" field.

func (*ProjectCreate) SetMinterAddress

func (pc *ProjectCreate) SetMinterAddress(s string) *ProjectCreate

SetMinterAddress sets the "minter_address" field.

func (*ProjectCreate) SetName

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

SetName sets the "name" field.

func (*ProjectCreate) SetNillableOffseterAddress

func (pc *ProjectCreate) SetNillableOffseterAddress(s *string) *ProjectCreate

SetNillableOffseterAddress sets the "offseter_address" field if the given value is not nil.

func (*ProjectCreate) SetNillableYielderAddress

func (pc *ProjectCreate) SetNillableYielderAddress(s *string) *ProjectCreate

SetNillableYielderAddress sets the "yielder_address" field if the given value is not nil.

func (*ProjectCreate) SetOffseterAddress

func (pc *ProjectCreate) SetOffseterAddress(s string) *ProjectCreate

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectCreate) SetSlot

func (pc *ProjectCreate) SetSlot(i int) *ProjectCreate

SetSlot sets the "slot" field.

func (*ProjectCreate) SetSlotURI

func (pc *ProjectCreate) SetSlotURI(mu model.SlotUri) *ProjectCreate

SetSlotURI sets the "slot_uri" field.

func (*ProjectCreate) SetYielderAddress

func (pc *ProjectCreate) SetYielderAddress(s string) *ProjectCreate

SetYielderAddress sets the "yielder_address" field.

type ProjectCreateBulk

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

ProjectCreateBulk is the builder for creating many Project entities in bulk.

func (*ProjectCreateBulk) Exec

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

Exec executes the query.

func (*ProjectCreateBulk) ExecX

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

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

func (*ProjectCreateBulk) OnConflict

func (pcb *ProjectCreateBulk) OnConflict(opts ...sql.ConflictOption) *ProjectUpsertBulk

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

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

func (*ProjectCreateBulk) OnConflictColumns

func (pcb *ProjectCreateBulk) OnConflictColumns(columns ...string) *ProjectUpsertBulk

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

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

func (*ProjectCreateBulk) Save

func (pcb *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error)

Save creates the Project entities in the database.

func (*ProjectCreateBulk) SaveX

func (pcb *ProjectCreateBulk) SaveX(ctx context.Context) []*Project

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

type ProjectDelete

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

ProjectDelete is the builder for deleting a Project entity.

func (*ProjectDelete) Exec

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

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

func (*ProjectDelete) ExecX

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

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

func (*ProjectDelete) Where

func (pd *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete

Where appends a list predicates to the ProjectDelete builder.

type ProjectDeleteOne

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

ProjectDeleteOne is the builder for deleting a single Project entity.

func (*ProjectDeleteOne) Exec

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

Exec executes the deletion query.

func (*ProjectDeleteOne) ExecX

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

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

func (*ProjectDeleteOne) Where

Where appends a list predicates to the ProjectDelete builder.

type ProjectEdge

type ProjectEdge struct {
	Node   *Project `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

ProjectEdge is the edge representation of Project.

type ProjectEdges

type ProjectEdges struct {
	// Tokens holds the value of the tokens edge.
	Tokens []*CustomerTokens `json:"tokens,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProjectEdges) TokensOrErr

func (e ProjectEdges) TokensOrErr() ([]*CustomerTokens, error)

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

type ProjectGroupBy

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

ProjectGroupBy is the group-by builder for Project entities.

func (*ProjectGroupBy) Aggregate

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

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

func (*ProjectGroupBy) Bool

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

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

func (*ProjectGroupBy) BoolX

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

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

func (*ProjectGroupBy) Bools

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

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

func (*ProjectGroupBy) BoolsX

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

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

func (*ProjectGroupBy) Float64

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

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

func (*ProjectGroupBy) Float64X

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

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

func (*ProjectGroupBy) Float64s

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

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

func (*ProjectGroupBy) Float64sX

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

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

func (*ProjectGroupBy) Int

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

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

func (*ProjectGroupBy) IntX

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

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

func (*ProjectGroupBy) Ints

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

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

func (*ProjectGroupBy) IntsX

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

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

func (*ProjectGroupBy) Scan

func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProjectGroupBy) ScanX

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

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

func (*ProjectGroupBy) String

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

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

func (*ProjectGroupBy) StringX

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

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

func (*ProjectGroupBy) Strings

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

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

func (*ProjectGroupBy) StringsX

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

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

type ProjectMutation

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

ProjectMutation represents an operation that mutates the Project nodes in the graph.

func (*ProjectMutation) Abi

func (m *ProjectMutation) Abi() (r model.ProjectAbi, exists bool)

Abi returns the value of the "abi" field in the mutation.

func (*ProjectMutation) AddField

func (m *ProjectMutation) 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 (*ProjectMutation) AddSlot

func (m *ProjectMutation) AddSlot(i int)

AddSlot adds i to the "slot" field.

func (*ProjectMutation) AddTokenIDs

func (m *ProjectMutation) AddTokenIDs(ids ...int)

AddTokenIDs adds the "tokens" edge to the CustomerTokens entity by ids.

func (*ProjectMutation) AddedEdges

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

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

func (*ProjectMutation) AddedField

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

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

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

func (*ProjectMutation) AddedIDs

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

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

func (*ProjectMutation) AddedSlot

func (m *ProjectMutation) AddedSlot() (r int, exists bool)

AddedSlot returns the value that was added to the "slot" field in this mutation.

func (*ProjectMutation) Address

func (m *ProjectMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*ProjectMutation) ClearEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ClearOffseterAddress

func (m *ProjectMutation) ClearOffseterAddress()

ClearOffseterAddress clears the value of the "offseter_address" field.

func (*ProjectMutation) ClearTokens

func (m *ProjectMutation) ClearTokens()

ClearTokens clears the "tokens" edge to the CustomerTokens entity.

func (*ProjectMutation) ClearYielderAddress

func (m *ProjectMutation) ClearYielderAddress()

ClearYielderAddress clears the value of the "yielder_address" field.

func (*ProjectMutation) ClearedEdges

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

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

func (*ProjectMutation) ClearedFields

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

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

func (ProjectMutation) Client

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

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

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

func (*ProjectMutation) Field

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

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

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

func (*ProjectMutation) Fields

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

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

func (m *ProjectMutation) 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 (*ProjectMutation) Image

func (m *ProjectMutation) Image() (r string, exists bool)

Image returns the value of the "image" field in the mutation.

func (*ProjectMutation) MinterAddress

func (m *ProjectMutation) MinterAddress() (r string, exists bool)

MinterAddress returns the value of the "minter_address" field in the mutation.

func (*ProjectMutation) Name

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

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

func (*ProjectMutation) OffseterAddress

func (m *ProjectMutation) OffseterAddress() (r string, exists bool)

OffseterAddress returns the value of the "offseter_address" field in the mutation.

func (*ProjectMutation) OffseterAddressCleared

func (m *ProjectMutation) OffseterAddressCleared() bool

OffseterAddressCleared returns if the "offseter_address" field was cleared in this mutation.

func (*ProjectMutation) OldAbi

func (m *ProjectMutation) OldAbi(ctx context.Context) (v model.ProjectAbi, err error)

OldAbi returns the old "abi" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldAddress

func (m *ProjectMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldField

func (m *ProjectMutation) 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 (*ProjectMutation) OldImage

func (m *ProjectMutation) OldImage(ctx context.Context) (v string, err error)

OldImage returns the old "image" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldMinterAddress

func (m *ProjectMutation) OldMinterAddress(ctx context.Context) (v string, err error)

OldMinterAddress returns the old "minter_address" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldName

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

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

func (m *ProjectMutation) OldOffseterAddress(ctx context.Context) (v string, err error)

OldOffseterAddress returns the old "offseter_address" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldSlot

func (m *ProjectMutation) OldSlot(ctx context.Context) (v int, err error)

OldSlot returns the old "slot" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldSlotURI

func (m *ProjectMutation) OldSlotURI(ctx context.Context) (v model.SlotUri, err error)

OldSlotURI returns the old "slot_uri" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldYielderAddress

func (m *ProjectMutation) OldYielderAddress(ctx context.Context) (v string, err error)

OldYielderAddress returns the old "yielder_address" field's value of the Project entity. If the Project 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 (*ProjectMutation) Op

func (m *ProjectMutation) Op() Op

Op returns the operation name.

func (*ProjectMutation) RemoveTokenIDs

func (m *ProjectMutation) RemoveTokenIDs(ids ...int)

RemoveTokenIDs removes the "tokens" edge to the CustomerTokens entity by IDs.

func (*ProjectMutation) RemovedEdges

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

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

func (*ProjectMutation) RemovedIDs

func (m *ProjectMutation) 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 (*ProjectMutation) RemovedTokensIDs

func (m *ProjectMutation) RemovedTokensIDs() (ids []int)

RemovedTokens returns the removed IDs of the "tokens" edge to the CustomerTokens entity.

func (*ProjectMutation) ResetAbi

func (m *ProjectMutation) ResetAbi()

ResetAbi resets all changes to the "abi" field.

func (*ProjectMutation) ResetAddress

func (m *ProjectMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*ProjectMutation) ResetEdge

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

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

func (m *ProjectMutation) ResetImage()

ResetImage resets all changes to the "image" field.

func (*ProjectMutation) ResetMinterAddress

func (m *ProjectMutation) ResetMinterAddress()

ResetMinterAddress resets all changes to the "minter_address" field.

func (*ProjectMutation) ResetName

func (m *ProjectMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProjectMutation) ResetOffseterAddress

func (m *ProjectMutation) ResetOffseterAddress()

ResetOffseterAddress resets all changes to the "offseter_address" field.

func (*ProjectMutation) ResetSlot

func (m *ProjectMutation) ResetSlot()

ResetSlot resets all changes to the "slot" field.

func (*ProjectMutation) ResetSlotURI

func (m *ProjectMutation) ResetSlotURI()

ResetSlotURI resets all changes to the "slot_uri" field.

func (*ProjectMutation) ResetTokens

func (m *ProjectMutation) ResetTokens()

ResetTokens resets all changes to the "tokens" edge.

func (*ProjectMutation) ResetYielderAddress

func (m *ProjectMutation) ResetYielderAddress()

ResetYielderAddress resets all changes to the "yielder_address" field.

func (*ProjectMutation) SetAbi

func (m *ProjectMutation) SetAbi(ma model.ProjectAbi)

SetAbi sets the "abi" field.

func (*ProjectMutation) SetAddress

func (m *ProjectMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*ProjectMutation) SetField

func (m *ProjectMutation) 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 (*ProjectMutation) SetImage

func (m *ProjectMutation) SetImage(s string)

SetImage sets the "image" field.

func (*ProjectMutation) SetMinterAddress

func (m *ProjectMutation) SetMinterAddress(s string)

SetMinterAddress sets the "minter_address" field.

func (*ProjectMutation) SetName

func (m *ProjectMutation) SetName(s string)

SetName sets the "name" field.

func (*ProjectMutation) SetOffseterAddress

func (m *ProjectMutation) SetOffseterAddress(s string)

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectMutation) SetOp

func (m *ProjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMutation) SetSlot

func (m *ProjectMutation) SetSlot(i int)

SetSlot sets the "slot" field.

func (*ProjectMutation) SetSlotURI

func (m *ProjectMutation) SetSlotURI(mu model.SlotUri)

SetSlotURI sets the "slot_uri" field.

func (*ProjectMutation) SetYielderAddress

func (m *ProjectMutation) SetYielderAddress(s string)

SetYielderAddress sets the "yielder_address" field.

func (*ProjectMutation) Slot

func (m *ProjectMutation) Slot() (r int, exists bool)

Slot returns the value of the "slot" field in the mutation.

func (*ProjectMutation) SlotURI

func (m *ProjectMutation) SlotURI() (r model.SlotUri, exists bool)

SlotURI returns the value of the "slot_uri" field in the mutation.

func (*ProjectMutation) TokensCleared

func (m *ProjectMutation) TokensCleared() bool

TokensCleared reports if the "tokens" edge to the CustomerTokens entity was cleared.

func (*ProjectMutation) TokensIDs

func (m *ProjectMutation) TokensIDs() (ids []int)

TokensIDs returns the "tokens" edge IDs in the mutation.

func (ProjectMutation) Tx

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

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

func (*ProjectMutation) Type

func (m *ProjectMutation) Type() string

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

func (*ProjectMutation) Where

func (m *ProjectMutation) Where(ps ...predicate.Project)

Where appends a list predicates to the ProjectMutation builder.

func (*ProjectMutation) WhereP

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

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

func (*ProjectMutation) YielderAddress

func (m *ProjectMutation) YielderAddress() (r string, exists bool)

YielderAddress returns the value of the "yielder_address" field in the mutation.

func (*ProjectMutation) YielderAddressCleared

func (m *ProjectMutation) YielderAddressCleared() bool

YielderAddressCleared returns if the "yielder_address" field was cleared in this mutation.

type ProjectOrder

type ProjectOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *ProjectOrderField `json:"field"`
}

ProjectOrder defines the ordering of Project.

type ProjectOrderField

type ProjectOrderField struct {
	// Value extracts the ordering value from the given Project.
	Value func(*Project) (ent.Value, error)
	// contains filtered or unexported fields
}

ProjectOrderField defines the ordering field of Project.

type ProjectPaginateOption

type ProjectPaginateOption func(*projectPager) error

ProjectPaginateOption enables pagination customization.

func WithProjectFilter

func WithProjectFilter(filter func(*ProjectQuery) (*ProjectQuery, error)) ProjectPaginateOption

WithProjectFilter configures pagination filter.

func WithProjectOrder

func WithProjectOrder(order *ProjectOrder) ProjectPaginateOption

WithProjectOrder configures pagination ordering.

type ProjectQuery

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

ProjectQuery is the builder for querying Project entities.

func (*ProjectQuery) Aggregate

func (pq *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate returns a ProjectSelect configured with the given aggregations.

func (*ProjectQuery) All

func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)

All executes the query and returns a list of Projects.

func (*ProjectQuery) AllX

func (pq *ProjectQuery) AllX(ctx context.Context) []*Project

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

func (*ProjectQuery) Clone

func (pq *ProjectQuery) Clone() *ProjectQuery

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

func (*ProjectQuery) CollectFields

func (pr *ProjectQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProjectQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ProjectQuery) Count

func (pq *ProjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectQuery) CountX

func (pq *ProjectQuery) CountX(ctx context.Context) int

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

func (*ProjectQuery) Exist

func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProjectQuery) ExistX

func (pq *ProjectQuery) ExistX(ctx context.Context) bool

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

func (*ProjectQuery) First

func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) FirstID

func (pq *ProjectQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) FirstIDX

func (pq *ProjectQuery) FirstIDX(ctx context.Context) int

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

func (*ProjectQuery) FirstX

func (pq *ProjectQuery) FirstX(ctx context.Context) *Project

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

func (*ProjectQuery) GroupBy

func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy

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

client.Project.Query().
	GroupBy(project.FieldAddress).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProjectQuery) IDs

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

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

func (*ProjectQuery) IDsX

func (pq *ProjectQuery) IDsX(ctx context.Context) []int

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

func (*ProjectQuery) Limit

func (pq *ProjectQuery) Limit(limit int) *ProjectQuery

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

func (*ProjectQuery) Offset

func (pq *ProjectQuery) Offset(offset int) *ProjectQuery

Offset to start from.

func (*ProjectQuery) Only

func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) OnlyID

func (pq *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) OnlyIDX

func (pq *ProjectQuery) OnlyIDX(ctx context.Context) int

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

func (*ProjectQuery) OnlyX

func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project

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

func (*ProjectQuery) Order

func (pq *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery

Order specifies how the records should be ordered.

func (*ProjectQuery) Paginate

func (pr *ProjectQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ProjectPaginateOption,
) (*ProjectConnection, error)

Paginate executes the query and returns a relay based cursor connection to Project.

func (*ProjectQuery) QueryTokens

func (pq *ProjectQuery) QueryTokens() *CustomerTokensQuery

QueryTokens chains the current query on the "tokens" edge.

func (*ProjectQuery) Select

func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect

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

client.Project.Query().
	Select(project.FieldAddress).
	Scan(ctx, &v)

func (*ProjectQuery) Unique

func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery

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

func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery

Where adds a new predicate for the ProjectQuery builder.

func (*ProjectQuery) WithNamedTokens

func (pq *ProjectQuery) WithNamedTokens(name string, opts ...func(*CustomerTokensQuery)) *ProjectQuery

WithNamedTokens tells the query-builder to eager-load the nodes that are connected to the "tokens" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithTokens

func (pq *ProjectQuery) WithTokens(opts ...func(*CustomerTokensQuery)) *ProjectQuery

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

type ProjectSelect

type ProjectSelect struct {
	*ProjectQuery
	// contains filtered or unexported fields
}

ProjectSelect is the builder for selecting fields of Project entities.

func (*ProjectSelect) Aggregate

func (ps *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProjectSelect) Bool

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

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

func (*ProjectSelect) BoolX

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

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

func (*ProjectSelect) Bools

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

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

func (*ProjectSelect) BoolsX

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

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

func (*ProjectSelect) Float64

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

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

func (*ProjectSelect) Float64X

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

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

func (*ProjectSelect) Float64s

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

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

func (*ProjectSelect) Float64sX

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

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

func (*ProjectSelect) Int

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

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

func (*ProjectSelect) IntX

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

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

func (*ProjectSelect) Ints

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

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

func (*ProjectSelect) IntsX

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

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

func (*ProjectSelect) Scan

func (ps *ProjectSelect) Scan(ctx context.Context, v any) error

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

func (*ProjectSelect) ScanX

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

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

func (*ProjectSelect) String

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

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

func (*ProjectSelect) StringX

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

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

func (*ProjectSelect) Strings

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

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

func (*ProjectSelect) StringsX

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

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

type ProjectUpdate

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

ProjectUpdate is the builder for updating Project entities.

func (*ProjectUpdate) AddSlot

func (pu *ProjectUpdate) AddSlot(i int) *ProjectUpdate

AddSlot adds i to the "slot" field.

func (*ProjectUpdate) AddTokenIDs

func (pu *ProjectUpdate) AddTokenIDs(ids ...int) *ProjectUpdate

AddTokenIDs adds the "tokens" edge to the CustomerTokens entity by IDs.

func (*ProjectUpdate) AddTokens

func (pu *ProjectUpdate) AddTokens(c ...*CustomerTokens) *ProjectUpdate

AddTokens adds the "tokens" edges to the CustomerTokens entity.

func (*ProjectUpdate) ClearOffseterAddress

func (pu *ProjectUpdate) ClearOffseterAddress() *ProjectUpdate

ClearOffseterAddress clears the value of the "offseter_address" field.

func (*ProjectUpdate) ClearTokens

func (pu *ProjectUpdate) ClearTokens() *ProjectUpdate

ClearTokens clears all "tokens" edges to the CustomerTokens entity.

func (*ProjectUpdate) ClearYielderAddress

func (pu *ProjectUpdate) ClearYielderAddress() *ProjectUpdate

ClearYielderAddress clears the value of the "yielder_address" field.

func (*ProjectUpdate) Exec

func (pu *ProjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectUpdate) ExecX

func (pu *ProjectUpdate) ExecX(ctx context.Context)

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

func (*ProjectUpdate) Mutation

func (pu *ProjectUpdate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdate) RemoveTokenIDs

func (pu *ProjectUpdate) RemoveTokenIDs(ids ...int) *ProjectUpdate

RemoveTokenIDs removes the "tokens" edge to CustomerTokens entities by IDs.

func (*ProjectUpdate) RemoveTokens

func (pu *ProjectUpdate) RemoveTokens(c ...*CustomerTokens) *ProjectUpdate

RemoveTokens removes "tokens" edges to CustomerTokens entities.

func (*ProjectUpdate) Save

func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)

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

func (*ProjectUpdate) SaveX

func (pu *ProjectUpdate) SaveX(ctx context.Context) int

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

func (*ProjectUpdate) SetAbi

func (pu *ProjectUpdate) SetAbi(ma model.ProjectAbi) *ProjectUpdate

SetAbi sets the "abi" field.

func (*ProjectUpdate) SetAddress

func (pu *ProjectUpdate) SetAddress(s string) *ProjectUpdate

SetAddress sets the "address" field.

func (*ProjectUpdate) SetImage

func (pu *ProjectUpdate) SetImage(s string) *ProjectUpdate

SetImage sets the "image" field.

func (*ProjectUpdate) SetMinterAddress

func (pu *ProjectUpdate) SetMinterAddress(s string) *ProjectUpdate

SetMinterAddress sets the "minter_address" field.

func (*ProjectUpdate) SetName

func (pu *ProjectUpdate) SetName(s string) *ProjectUpdate

SetName sets the "name" field.

func (*ProjectUpdate) SetNillableAbi

func (pu *ProjectUpdate) SetNillableAbi(ma *model.ProjectAbi) *ProjectUpdate

SetNillableAbi sets the "abi" field if the given value is not nil.

func (*ProjectUpdate) SetNillableAddress

func (pu *ProjectUpdate) SetNillableAddress(s *string) *ProjectUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*ProjectUpdate) SetNillableImage

func (pu *ProjectUpdate) SetNillableImage(s *string) *ProjectUpdate

SetNillableImage sets the "image" field if the given value is not nil.

func (*ProjectUpdate) SetNillableMinterAddress

func (pu *ProjectUpdate) SetNillableMinterAddress(s *string) *ProjectUpdate

SetNillableMinterAddress sets the "minter_address" field if the given value is not nil.

func (*ProjectUpdate) SetNillableName

func (pu *ProjectUpdate) SetNillableName(s *string) *ProjectUpdate

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

func (*ProjectUpdate) SetNillableOffseterAddress

func (pu *ProjectUpdate) SetNillableOffseterAddress(s *string) *ProjectUpdate

SetNillableOffseterAddress sets the "offseter_address" field if the given value is not nil.

func (*ProjectUpdate) SetNillableSlot

func (pu *ProjectUpdate) SetNillableSlot(i *int) *ProjectUpdate

SetNillableSlot sets the "slot" field if the given value is not nil.

func (*ProjectUpdate) SetNillableSlotURI

func (pu *ProjectUpdate) SetNillableSlotURI(mu *model.SlotUri) *ProjectUpdate

SetNillableSlotURI sets the "slot_uri" field if the given value is not nil.

func (*ProjectUpdate) SetNillableYielderAddress

func (pu *ProjectUpdate) SetNillableYielderAddress(s *string) *ProjectUpdate

SetNillableYielderAddress sets the "yielder_address" field if the given value is not nil.

func (*ProjectUpdate) SetOffseterAddress

func (pu *ProjectUpdate) SetOffseterAddress(s string) *ProjectUpdate

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectUpdate) SetSlot

func (pu *ProjectUpdate) SetSlot(i int) *ProjectUpdate

SetSlot sets the "slot" field.

func (*ProjectUpdate) SetSlotURI

func (pu *ProjectUpdate) SetSlotURI(mu model.SlotUri) *ProjectUpdate

SetSlotURI sets the "slot_uri" field.

func (*ProjectUpdate) SetYielderAddress

func (pu *ProjectUpdate) SetYielderAddress(s string) *ProjectUpdate

SetYielderAddress sets the "yielder_address" field.

func (*ProjectUpdate) Where

func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpdateOne

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

ProjectUpdateOne is the builder for updating a single Project entity.

func (*ProjectUpdateOne) AddSlot

func (puo *ProjectUpdateOne) AddSlot(i int) *ProjectUpdateOne

AddSlot adds i to the "slot" field.

func (*ProjectUpdateOne) AddTokenIDs

func (puo *ProjectUpdateOne) AddTokenIDs(ids ...int) *ProjectUpdateOne

AddTokenIDs adds the "tokens" edge to the CustomerTokens entity by IDs.

func (*ProjectUpdateOne) AddTokens

func (puo *ProjectUpdateOne) AddTokens(c ...*CustomerTokens) *ProjectUpdateOne

AddTokens adds the "tokens" edges to the CustomerTokens entity.

func (*ProjectUpdateOne) ClearOffseterAddress

func (puo *ProjectUpdateOne) ClearOffseterAddress() *ProjectUpdateOne

ClearOffseterAddress clears the value of the "offseter_address" field.

func (*ProjectUpdateOne) ClearTokens

func (puo *ProjectUpdateOne) ClearTokens() *ProjectUpdateOne

ClearTokens clears all "tokens" edges to the CustomerTokens entity.

func (*ProjectUpdateOne) ClearYielderAddress

func (puo *ProjectUpdateOne) ClearYielderAddress() *ProjectUpdateOne

ClearYielderAddress clears the value of the "yielder_address" field.

func (*ProjectUpdateOne) Exec

func (puo *ProjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProjectUpdateOne) ExecX

func (puo *ProjectUpdateOne) ExecX(ctx context.Context)

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

func (*ProjectUpdateOne) Mutation

func (puo *ProjectUpdateOne) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdateOne) RemoveTokenIDs

func (puo *ProjectUpdateOne) RemoveTokenIDs(ids ...int) *ProjectUpdateOne

RemoveTokenIDs removes the "tokens" edge to CustomerTokens entities by IDs.

func (*ProjectUpdateOne) RemoveTokens

func (puo *ProjectUpdateOne) RemoveTokens(c ...*CustomerTokens) *ProjectUpdateOne

RemoveTokens removes "tokens" edges to CustomerTokens entities.

func (*ProjectUpdateOne) Save

func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)

Save executes the query and returns the updated Project entity.

func (*ProjectUpdateOne) SaveX

func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project

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

func (*ProjectUpdateOne) Select

func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetAbi

SetAbi sets the "abi" field.

func (*ProjectUpdateOne) SetAddress

func (puo *ProjectUpdateOne) SetAddress(s string) *ProjectUpdateOne

SetAddress sets the "address" field.

func (*ProjectUpdateOne) SetImage

func (puo *ProjectUpdateOne) SetImage(s string) *ProjectUpdateOne

SetImage sets the "image" field.

func (*ProjectUpdateOne) SetMinterAddress

func (puo *ProjectUpdateOne) SetMinterAddress(s string) *ProjectUpdateOne

SetMinterAddress sets the "minter_address" field.

func (*ProjectUpdateOne) SetName

func (puo *ProjectUpdateOne) SetName(s string) *ProjectUpdateOne

SetName sets the "name" field.

func (*ProjectUpdateOne) SetNillableAbi

func (puo *ProjectUpdateOne) SetNillableAbi(ma *model.ProjectAbi) *ProjectUpdateOne

SetNillableAbi sets the "abi" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableAddress

func (puo *ProjectUpdateOne) SetNillableAddress(s *string) *ProjectUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableImage

func (puo *ProjectUpdateOne) SetNillableImage(s *string) *ProjectUpdateOne

SetNillableImage sets the "image" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableMinterAddress

func (puo *ProjectUpdateOne) SetNillableMinterAddress(s *string) *ProjectUpdateOne

SetNillableMinterAddress sets the "minter_address" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableName

func (puo *ProjectUpdateOne) SetNillableName(s *string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetNillableOffseterAddress

func (puo *ProjectUpdateOne) SetNillableOffseterAddress(s *string) *ProjectUpdateOne

SetNillableOffseterAddress sets the "offseter_address" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableSlot

func (puo *ProjectUpdateOne) SetNillableSlot(i *int) *ProjectUpdateOne

SetNillableSlot sets the "slot" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableSlotURI

func (puo *ProjectUpdateOne) SetNillableSlotURI(mu *model.SlotUri) *ProjectUpdateOne

SetNillableSlotURI sets the "slot_uri" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableYielderAddress

func (puo *ProjectUpdateOne) SetNillableYielderAddress(s *string) *ProjectUpdateOne

SetNillableYielderAddress sets the "yielder_address" field if the given value is not nil.

func (*ProjectUpdateOne) SetOffseterAddress

func (puo *ProjectUpdateOne) SetOffseterAddress(s string) *ProjectUpdateOne

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectUpdateOne) SetSlot

func (puo *ProjectUpdateOne) SetSlot(i int) *ProjectUpdateOne

SetSlot sets the "slot" field.

func (*ProjectUpdateOne) SetSlotURI

func (puo *ProjectUpdateOne) SetSlotURI(mu model.SlotUri) *ProjectUpdateOne

SetSlotURI sets the "slot_uri" field.

func (*ProjectUpdateOne) SetYielderAddress

func (puo *ProjectUpdateOne) SetYielderAddress(s string) *ProjectUpdateOne

SetYielderAddress sets the "yielder_address" field.

func (*ProjectUpdateOne) Where

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpsert

type ProjectUpsert struct {
	*sql.UpdateSet
}

ProjectUpsert is the "OnConflict" setter.

func (*ProjectUpsert) AddSlot

func (u *ProjectUpsert) AddSlot(v int) *ProjectUpsert

AddSlot adds v to the "slot" field.

func (*ProjectUpsert) ClearOffseterAddress

func (u *ProjectUpsert) ClearOffseterAddress() *ProjectUpsert

ClearOffseterAddress clears the value of the "offseter_address" field.

func (*ProjectUpsert) ClearYielderAddress

func (u *ProjectUpsert) ClearYielderAddress() *ProjectUpsert

ClearYielderAddress clears the value of the "yielder_address" field.

func (*ProjectUpsert) SetAbi

SetAbi sets the "abi" field.

func (*ProjectUpsert) SetAddress

func (u *ProjectUpsert) SetAddress(v string) *ProjectUpsert

SetAddress sets the "address" field.

func (*ProjectUpsert) SetImage

func (u *ProjectUpsert) SetImage(v string) *ProjectUpsert

SetImage sets the "image" field.

func (*ProjectUpsert) SetMinterAddress

func (u *ProjectUpsert) SetMinterAddress(v string) *ProjectUpsert

SetMinterAddress sets the "minter_address" field.

func (*ProjectUpsert) SetName

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

SetName sets the "name" field.

func (*ProjectUpsert) SetOffseterAddress

func (u *ProjectUpsert) SetOffseterAddress(v string) *ProjectUpsert

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectUpsert) SetSlot

func (u *ProjectUpsert) SetSlot(v int) *ProjectUpsert

SetSlot sets the "slot" field.

func (*ProjectUpsert) SetSlotURI

func (u *ProjectUpsert) SetSlotURI(v model.SlotUri) *ProjectUpsert

SetSlotURI sets the "slot_uri" field.

func (*ProjectUpsert) SetYielderAddress

func (u *ProjectUpsert) SetYielderAddress(v string) *ProjectUpsert

SetYielderAddress sets the "yielder_address" field.

func (*ProjectUpsert) UpdateAbi

func (u *ProjectUpsert) UpdateAbi() *ProjectUpsert

UpdateAbi sets the "abi" field to the value that was provided on create.

func (*ProjectUpsert) UpdateAddress

func (u *ProjectUpsert) UpdateAddress() *ProjectUpsert

UpdateAddress sets the "address" field to the value that was provided on create.

func (*ProjectUpsert) UpdateImage

func (u *ProjectUpsert) UpdateImage() *ProjectUpsert

UpdateImage sets the "image" field to the value that was provided on create.

func (*ProjectUpsert) UpdateMinterAddress

func (u *ProjectUpsert) UpdateMinterAddress() *ProjectUpsert

UpdateMinterAddress sets the "minter_address" field to the value that was provided on create.

func (*ProjectUpsert) UpdateName

func (u *ProjectUpsert) UpdateName() *ProjectUpsert

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

func (*ProjectUpsert) UpdateOffseterAddress

func (u *ProjectUpsert) UpdateOffseterAddress() *ProjectUpsert

UpdateOffseterAddress sets the "offseter_address" field to the value that was provided on create.

func (*ProjectUpsert) UpdateSlot

func (u *ProjectUpsert) UpdateSlot() *ProjectUpsert

UpdateSlot sets the "slot" field to the value that was provided on create.

func (*ProjectUpsert) UpdateSlotURI

func (u *ProjectUpsert) UpdateSlotURI() *ProjectUpsert

UpdateSlotURI sets the "slot_uri" field to the value that was provided on create.

func (*ProjectUpsert) UpdateYielderAddress

func (u *ProjectUpsert) UpdateYielderAddress() *ProjectUpsert

UpdateYielderAddress sets the "yielder_address" field to the value that was provided on create.

type ProjectUpsertBulk

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

ProjectUpsertBulk is the builder for "upsert"-ing a bulk of Project nodes.

func (*ProjectUpsertBulk) AddSlot

func (u *ProjectUpsertBulk) AddSlot(v int) *ProjectUpsertBulk

AddSlot adds v to the "slot" field.

func (*ProjectUpsertBulk) ClearOffseterAddress

func (u *ProjectUpsertBulk) ClearOffseterAddress() *ProjectUpsertBulk

ClearOffseterAddress clears the value of the "offseter_address" field.

func (*ProjectUpsertBulk) ClearYielderAddress

func (u *ProjectUpsertBulk) ClearYielderAddress() *ProjectUpsertBulk

ClearYielderAddress clears the value of the "yielder_address" field.

func (*ProjectUpsertBulk) DoNothing

func (u *ProjectUpsertBulk) DoNothing() *ProjectUpsertBulk

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

func (*ProjectUpsertBulk) Exec

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

Exec executes the query.

func (*ProjectUpsertBulk) ExecX

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

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

func (*ProjectUpsertBulk) Ignore

func (u *ProjectUpsertBulk) Ignore() *ProjectUpsertBulk

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

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

func (*ProjectUpsertBulk) SetAbi

SetAbi sets the "abi" field.

func (*ProjectUpsertBulk) SetAddress

func (u *ProjectUpsertBulk) SetAddress(v string) *ProjectUpsertBulk

SetAddress sets the "address" field.

func (*ProjectUpsertBulk) SetImage

func (u *ProjectUpsertBulk) SetImage(v string) *ProjectUpsertBulk

SetImage sets the "image" field.

func (*ProjectUpsertBulk) SetMinterAddress

func (u *ProjectUpsertBulk) SetMinterAddress(v string) *ProjectUpsertBulk

SetMinterAddress sets the "minter_address" field.

func (*ProjectUpsertBulk) SetName

SetName sets the "name" field.

func (*ProjectUpsertBulk) SetOffseterAddress

func (u *ProjectUpsertBulk) SetOffseterAddress(v string) *ProjectUpsertBulk

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectUpsertBulk) SetSlot

func (u *ProjectUpsertBulk) SetSlot(v int) *ProjectUpsertBulk

SetSlot sets the "slot" field.

func (*ProjectUpsertBulk) SetSlotURI

SetSlotURI sets the "slot_uri" field.

func (*ProjectUpsertBulk) SetYielderAddress

func (u *ProjectUpsertBulk) SetYielderAddress(v string) *ProjectUpsertBulk

SetYielderAddress sets the "yielder_address" field.

func (*ProjectUpsertBulk) Update

func (u *ProjectUpsertBulk) Update(set func(*ProjectUpsert)) *ProjectUpsertBulk

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

func (*ProjectUpsertBulk) UpdateAbi

func (u *ProjectUpsertBulk) UpdateAbi() *ProjectUpsertBulk

UpdateAbi sets the "abi" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateAddress

func (u *ProjectUpsertBulk) UpdateAddress() *ProjectUpsertBulk

UpdateAddress sets the "address" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateImage

func (u *ProjectUpsertBulk) UpdateImage() *ProjectUpsertBulk

UpdateImage sets the "image" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateMinterAddress

func (u *ProjectUpsertBulk) UpdateMinterAddress() *ProjectUpsertBulk

UpdateMinterAddress sets the "minter_address" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateName

func (u *ProjectUpsertBulk) UpdateName() *ProjectUpsertBulk

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

func (*ProjectUpsertBulk) UpdateNewValues

func (u *ProjectUpsertBulk) UpdateNewValues() *ProjectUpsertBulk

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

client.Project.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ProjectUpsertBulk) UpdateOffseterAddress

func (u *ProjectUpsertBulk) UpdateOffseterAddress() *ProjectUpsertBulk

UpdateOffseterAddress sets the "offseter_address" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateSlot

func (u *ProjectUpsertBulk) UpdateSlot() *ProjectUpsertBulk

UpdateSlot sets the "slot" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateSlotURI

func (u *ProjectUpsertBulk) UpdateSlotURI() *ProjectUpsertBulk

UpdateSlotURI sets the "slot_uri" field to the value that was provided on create.

func (*ProjectUpsertBulk) UpdateYielderAddress

func (u *ProjectUpsertBulk) UpdateYielderAddress() *ProjectUpsertBulk

UpdateYielderAddress sets the "yielder_address" field to the value that was provided on create.

type ProjectUpsertOne

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

ProjectUpsertOne is the builder for "upsert"-ing

one Project node.

func (*ProjectUpsertOne) AddSlot

func (u *ProjectUpsertOne) AddSlot(v int) *ProjectUpsertOne

AddSlot adds v to the "slot" field.

func (*ProjectUpsertOne) ClearOffseterAddress

func (u *ProjectUpsertOne) ClearOffseterAddress() *ProjectUpsertOne

ClearOffseterAddress clears the value of the "offseter_address" field.

func (*ProjectUpsertOne) ClearYielderAddress

func (u *ProjectUpsertOne) ClearYielderAddress() *ProjectUpsertOne

ClearYielderAddress clears the value of the "yielder_address" field.

func (*ProjectUpsertOne) DoNothing

func (u *ProjectUpsertOne) DoNothing() *ProjectUpsertOne

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

func (*ProjectUpsertOne) Exec

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

Exec executes the query.

func (*ProjectUpsertOne) ExecX

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

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

func (*ProjectUpsertOne) ID

func (u *ProjectUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*ProjectUpsertOne) IDX

func (u *ProjectUpsertOne) IDX(ctx context.Context) int

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

func (*ProjectUpsertOne) Ignore

func (u *ProjectUpsertOne) Ignore() *ProjectUpsertOne

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

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

func (*ProjectUpsertOne) SetAbi

SetAbi sets the "abi" field.

func (*ProjectUpsertOne) SetAddress

func (u *ProjectUpsertOne) SetAddress(v string) *ProjectUpsertOne

SetAddress sets the "address" field.

func (*ProjectUpsertOne) SetImage

func (u *ProjectUpsertOne) SetImage(v string) *ProjectUpsertOne

SetImage sets the "image" field.

func (*ProjectUpsertOne) SetMinterAddress

func (u *ProjectUpsertOne) SetMinterAddress(v string) *ProjectUpsertOne

SetMinterAddress sets the "minter_address" field.

func (*ProjectUpsertOne) SetName

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

SetName sets the "name" field.

func (*ProjectUpsertOne) SetOffseterAddress

func (u *ProjectUpsertOne) SetOffseterAddress(v string) *ProjectUpsertOne

SetOffseterAddress sets the "offseter_address" field.

func (*ProjectUpsertOne) SetSlot

func (u *ProjectUpsertOne) SetSlot(v int) *ProjectUpsertOne

SetSlot sets the "slot" field.

func (*ProjectUpsertOne) SetSlotURI

func (u *ProjectUpsertOne) SetSlotURI(v model.SlotUri) *ProjectUpsertOne

SetSlotURI sets the "slot_uri" field.

func (*ProjectUpsertOne) SetYielderAddress

func (u *ProjectUpsertOne) SetYielderAddress(v string) *ProjectUpsertOne

SetYielderAddress sets the "yielder_address" field.

func (*ProjectUpsertOne) Update

func (u *ProjectUpsertOne) Update(set func(*ProjectUpsert)) *ProjectUpsertOne

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

func (*ProjectUpsertOne) UpdateAbi

func (u *ProjectUpsertOne) UpdateAbi() *ProjectUpsertOne

UpdateAbi sets the "abi" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateAddress

func (u *ProjectUpsertOne) UpdateAddress() *ProjectUpsertOne

UpdateAddress sets the "address" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateImage

func (u *ProjectUpsertOne) UpdateImage() *ProjectUpsertOne

UpdateImage sets the "image" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateMinterAddress

func (u *ProjectUpsertOne) UpdateMinterAddress() *ProjectUpsertOne

UpdateMinterAddress sets the "minter_address" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateName

func (u *ProjectUpsertOne) UpdateName() *ProjectUpsertOne

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

func (*ProjectUpsertOne) UpdateNewValues

func (u *ProjectUpsertOne) UpdateNewValues() *ProjectUpsertOne

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

client.Project.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ProjectUpsertOne) UpdateOffseterAddress

func (u *ProjectUpsertOne) UpdateOffseterAddress() *ProjectUpsertOne

UpdateOffseterAddress sets the "offseter_address" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateSlot

func (u *ProjectUpsertOne) UpdateSlot() *ProjectUpsertOne

UpdateSlot sets the "slot" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateSlotURI

func (u *ProjectUpsertOne) UpdateSlotURI() *ProjectUpsertOne

UpdateSlotURI sets the "slot_uri" field to the value that was provided on create.

func (*ProjectUpsertOne) UpdateYielderAddress

func (u *ProjectUpsertOne) UpdateYielderAddress() *ProjectUpsertOne

UpdateYielderAddress sets the "yielder_address" field to the value that was provided on create.

type ProjectWhereInput

type ProjectWhereInput struct {
	Predicates []predicate.Project  `json:"-"`
	Not        *ProjectWhereInput   `json:"not,omitempty"`
	Or         []*ProjectWhereInput `json:"or,omitempty"`
	And        []*ProjectWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "address" field predicates.
	Address             *string  `json:"address,omitempty"`
	AddressNEQ          *string  `json:"addressNEQ,omitempty"`
	AddressIn           []string `json:"addressIn,omitempty"`
	AddressNotIn        []string `json:"addressNotIn,omitempty"`
	AddressGT           *string  `json:"addressGT,omitempty"`
	AddressGTE          *string  `json:"addressGTE,omitempty"`
	AddressLT           *string  `json:"addressLT,omitempty"`
	AddressLTE          *string  `json:"addressLTE,omitempty"`
	AddressContains     *string  `json:"addressContains,omitempty"`
	AddressHasPrefix    *string  `json:"addressHasPrefix,omitempty"`
	AddressHasSuffix    *string  `json:"addressHasSuffix,omitempty"`
	AddressEqualFold    *string  `json:"addressEqualFold,omitempty"`
	AddressContainsFold *string  `json:"addressContainsFold,omitempty"`

	// "slot" field predicates.
	Slot      *int  `json:"slot,omitempty"`
	SlotNEQ   *int  `json:"slotNEQ,omitempty"`
	SlotIn    []int `json:"slotIn,omitempty"`
	SlotNotIn []int `json:"slotNotIn,omitempty"`
	SlotGT    *int  `json:"slotGT,omitempty"`
	SlotGTE   *int  `json:"slotGTE,omitempty"`
	SlotLT    *int  `json:"slotLT,omitempty"`
	SlotLTE   *int  `json:"slotLTE,omitempty"`

	// "minter_address" field predicates.
	MinterAddress             *string  `json:"minterAddress,omitempty"`
	MinterAddressNEQ          *string  `json:"minterAddressNEQ,omitempty"`
	MinterAddressIn           []string `json:"minterAddressIn,omitempty"`
	MinterAddressNotIn        []string `json:"minterAddressNotIn,omitempty"`
	MinterAddressGT           *string  `json:"minterAddressGT,omitempty"`
	MinterAddressGTE          *string  `json:"minterAddressGTE,omitempty"`
	MinterAddressLT           *string  `json:"minterAddressLT,omitempty"`
	MinterAddressLTE          *string  `json:"minterAddressLTE,omitempty"`
	MinterAddressContains     *string  `json:"minterAddressContains,omitempty"`
	MinterAddressHasPrefix    *string  `json:"minterAddressHasPrefix,omitempty"`
	MinterAddressHasSuffix    *string  `json:"minterAddressHasSuffix,omitempty"`
	MinterAddressEqualFold    *string  `json:"minterAddressEqualFold,omitempty"`
	MinterAddressContainsFold *string  `json:"minterAddressContainsFold,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "image" field predicates.
	Image             *string  `json:"image,omitempty"`
	ImageNEQ          *string  `json:"imageNEQ,omitempty"`
	ImageIn           []string `json:"imageIn,omitempty"`
	ImageNotIn        []string `json:"imageNotIn,omitempty"`
	ImageGT           *string  `json:"imageGT,omitempty"`
	ImageGTE          *string  `json:"imageGTE,omitempty"`
	ImageLT           *string  `json:"imageLT,omitempty"`
	ImageLTE          *string  `json:"imageLTE,omitempty"`
	ImageContains     *string  `json:"imageContains,omitempty"`
	ImageHasPrefix    *string  `json:"imageHasPrefix,omitempty"`
	ImageHasSuffix    *string  `json:"imageHasSuffix,omitempty"`
	ImageEqualFold    *string  `json:"imageEqualFold,omitempty"`
	ImageContainsFold *string  `json:"imageContainsFold,omitempty"`

	// "yielder_address" field predicates.
	YielderAddress             *string  `json:"yielderAddress,omitempty"`
	YielderAddressNEQ          *string  `json:"yielderAddressNEQ,omitempty"`
	YielderAddressIn           []string `json:"yielderAddressIn,omitempty"`
	YielderAddressNotIn        []string `json:"yielderAddressNotIn,omitempty"`
	YielderAddressGT           *string  `json:"yielderAddressGT,omitempty"`
	YielderAddressGTE          *string  `json:"yielderAddressGTE,omitempty"`
	YielderAddressLT           *string  `json:"yielderAddressLT,omitempty"`
	YielderAddressLTE          *string  `json:"yielderAddressLTE,omitempty"`
	YielderAddressContains     *string  `json:"yielderAddressContains,omitempty"`
	YielderAddressHasPrefix    *string  `json:"yielderAddressHasPrefix,omitempty"`
	YielderAddressHasSuffix    *string  `json:"yielderAddressHasSuffix,omitempty"`
	YielderAddressIsNil        bool     `json:"yielderAddressIsNil,omitempty"`
	YielderAddressNotNil       bool     `json:"yielderAddressNotNil,omitempty"`
	YielderAddressEqualFold    *string  `json:"yielderAddressEqualFold,omitempty"`
	YielderAddressContainsFold *string  `json:"yielderAddressContainsFold,omitempty"`

	// "offseter_address" field predicates.
	OffseterAddress             *string  `json:"offseterAddress,omitempty"`
	OffseterAddressNEQ          *string  `json:"offseterAddressNEQ,omitempty"`
	OffseterAddressIn           []string `json:"offseterAddressIn,omitempty"`
	OffseterAddressNotIn        []string `json:"offseterAddressNotIn,omitempty"`
	OffseterAddressGT           *string  `json:"offseterAddressGT,omitempty"`
	OffseterAddressGTE          *string  `json:"offseterAddressGTE,omitempty"`
	OffseterAddressLT           *string  `json:"offseterAddressLT,omitempty"`
	OffseterAddressLTE          *string  `json:"offseterAddressLTE,omitempty"`
	OffseterAddressContains     *string  `json:"offseterAddressContains,omitempty"`
	OffseterAddressHasPrefix    *string  `json:"offseterAddressHasPrefix,omitempty"`
	OffseterAddressHasSuffix    *string  `json:"offseterAddressHasSuffix,omitempty"`
	OffseterAddressIsNil        bool     `json:"offseterAddressIsNil,omitempty"`
	OffseterAddressNotNil       bool     `json:"offseterAddressNotNil,omitempty"`
	OffseterAddressEqualFold    *string  `json:"offseterAddressEqualFold,omitempty"`
	OffseterAddressContainsFold *string  `json:"offseterAddressContainsFold,omitempty"`

	// "tokens" edge predicates.
	HasTokens     *bool                       `json:"hasTokens,omitempty"`
	HasTokensWith []*CustomerTokensWhereInput `json:"hasTokensWith,omitempty"`
}

ProjectWhereInput represents a where input for filtering Project queries.

func (*ProjectWhereInput) AddPredicates

func (i *ProjectWhereInput) AddPredicates(predicates ...predicate.Project)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*ProjectWhereInput) Filter

Filter applies the ProjectWhereInput filter on the ProjectQuery builder.

func (*ProjectWhereInput) P

P returns a predicate for filtering projects. An error is returned if the input is empty or invalid.

type Projects

type Projects []*Project

Projects is a parsable slice of Project.

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// CustomerTokens is the client for interacting with the CustomerTokens builders.
	CustomerTokens *CustomerTokensClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// 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